Function to fix the 'sharp' shapes?

Thank you all very much for all the help. I will try to try what YRH shared