Roof surfaces from 3D curves

So, my aim is to construct (closed) surfaces from these curves/polylines that represent roofs of buildings, so that I later can extrude the edges and trim against a terrain.

The script I’ve made so far does not work entirely, leaving some open spots. Not sure if weaverbird is the best approach. Are there any way to make it work flawlessly? The goal is to be able to make surfaces of a larger area of roofs.

I’ve included some example roofs and the grasshopper definition in the link below. (392.3 KB)

Flawlessly would be much to high a standard to aim for, especially when the input curves are this open to interpretation. If you don’t need too much accuracy, you can make the roofs into a delauney mesh, while making walls by projecting all of the curves downwards onto a base plane, as i did in the definition below.

I’m sure further improvements can be made, such as trimming the roof mesh to fit within the extruded floor plan, but i couldn’t get that to work properly just now. I hope this gives you some new directions to think about. (293.4 KB)

Thank you very much, really appreciate the effort. Unfortunately the mesh outputs are too jagged and rough. I’ve tried to play around and tweak the definition without any success.

However, I can still use some parts of your script maybe. I’m thinking of another approach where I either sweep and loft the gables to create the roof surfaces, I suppose I need to do some sorting? I’m no grasshopper expert so I might concider to just model everything manually, but there’s really no fun in that :frowning:

What I don’t understand is that you have some clean curves, so they must comes from some good file. Is it not possible to use more information from this file ?

Did you look at this post ?

The curves originates from a GIS dataset, where they also are represented as lines, I managed to elevate the lines using height data. I’ve also explored converting these lines to multipatches and multipolygon(z) to create 3D volumes in Qgis and Arcgis but I haven’t figured it out.

I’ll take a closer look on that thread, but at first glance it seems to be dealing with planar roof edges as starting point? may be a bit cumbersome when I have to make 100+ different roof shapes and angles, then again, so is manual modeling, which I have started doing now :frowning:

suppose I have planar surfaces, could these be oriented and attached to the 3D vertices/curves? maybe too complicated?

I think the most feasible is to 1) loft the gables 2) use ‘surface from 3/4 points’ to fill in the gaps.

The result I think is pretty, but it will take forever :slight_smile:

For sure “Old town roofs” is for planar curves.
Your problem is not simple but doable but requires times. Each curve must be splitted by curve touching it, topology of the overall curves has to be done then the planar curves. So if you can’t program the algorithm I hope you will find someone with a solution.
I can’t help more, too long to do and too specific.

It is a really interesting problem to me, so I had another look at it. This time i split the floor plan into fragments, extruded each of these, and used fit plane to points to define the roof plane for each of these fragments.

This way you get perfectly smooth roof surfaces, but they do not perfectly align with each other. Some cleanup beforehand will still be necessary. You also need to delete the courtyards solids afterwards by hand. It’s really heavy on the CPU, even one block at a time might be difficult.

Doing everything by hand will get you the best results of course, but will be timeconsuming. Anyway, its a fun exercise. (40.5 KB)


Bert, that is truly amazing. I was actually heading somewhat in that direction; using planes and sorting points after seeing this:

but my script would crash if I selected more complicated buildings, and was nowhere near as sophisticated as your script. So, I was loosing hope. Then I saw your post and it made my day, heck, my week, thank you very, very much. I don’t mind doing little bit manual labor, that is expected. But this really makes things go faster. And I really like that the surfaces don’t align perfectly with each other, with too much abstraction you’ll kind of loose the uniqueness of each buildings, and one might as well just make solid cubes. So this is perfect. :ok_hand:

Great, I’m happy to hear it!