Reading roof data from (large) citygml file

I´m trying to read and construct roof-geometry from a citygml file. Converting the walls and the floors of the buildings into proper geometry is simple but I´m struggling with the roof structure which is not always planar and can be concave or convex. I´m also wondering why my approach takes some time to process. I mean the data is “just” a conversion of points?!

I`m looking for a fast and robust way to convert all the geometry in (closed) breps. Thanks!

Note: I´m using jSwan-Plugin to convert the xml to json first and then navigating to the data. Other methods/plugins are welcome as well. The data is quiet large so it might take few seconds to read it.
I´m looking for a “grasshopper-approach”. Therefore approaches using AntFarm or FZK-Viewer are not what I`m looking for. Thanks in advance!

citygml_to_brep.gh (18.6 KB)

LoD2_32_294_5740_1_NW.xml (16.5 MB)

Hi @paul.metzger ,
Try treating the roofs like the walls and ground surfaces and create polylines from their points. Then use Pufferfish’s PolylineToMesh (Heron has a similar component called MMPatch).