Rebuild mesh into a even geometry

Hi,

I was wondering if anyone knows a way to rebuild the mesh into a cleaner geometry?

I had to trim around the original geometry in order to achieve the shape I needed for my project.

This was how the geometry looked before the trim

If it is possible to rebuild it into even squares that would be greatly appreciated.

Grasshopper script: Rebuilt_Mesh_Script.gh (193.4 KB)