City Planning Wireframes

I have a question about a City Plan. I am a bit new to grashopper and didnt work in Architecture topics. I have a bulk of Closed curves (wireframes) which are my buildings. I need to find a efficient way to get surfaces out of this frames.
This is just a small amount which you can see in this Rhino file so the real plan is much bigger.
I thought about set curves and then find a way to get surfaces through the corner points. But all my thoughts didnt work.
Thank you in advance for your help.Frage Grashopper Forum.3dm (112.1 KB)

Hi @michael.hickisch, Not all your curves are planar Closed Curve.
As you see here, they are closed but not planar.

same here
and there are multiple instances of these in the file

The General concept for creating planar surface is to use either “BoundarySurface” Component or “Surface4Pt” Component. If you have closed Curves which change directions like this. It will be very difficult to generate this through any parametric approach. Sorting them is not a problem and you can even collapse some polylines to reduce the complexity here and there. But since the modelled curves are of not right consistency, it will still cause a lot of trouble getting what you are looking for.
Try to get a cleaner and single Closed planar curves at each position first.

Here is a quick test script to sort out the surfaces which are planar and can be quickly converted into Surfaces. and the other set is the one which collects all these non-coplanar curves.

Sort 4pt (13.7 KB)
This will give you a good start for it, you can bake the bad curves, fix them and then reassign them in the script.
Hope this helps.

thank you so much for your help. I tried and it worked. Perfect thanks.