Extrude gable roof


I am trying to extrude the generated objects to get a gable roof.
The objects are allready split in half to extrude the polyline.
Especially when it come to corners with multiple polylines I am not sure what to do.

I am still rather new to grasshopper so I don’t know if the script is the way to go at all.

Hope someone can help me.

Best regards and I wish you a great day,


Question_GableRoof.gh (20.7 KB)

Anybody got an idea?

The subject has been discussed in other threads:

There are aspects of the puzzle you presented that made it look easier than past efforts. Unfortunately, there are hidden aspects that made it much more complicated than it should have been, requiring the yellow group (below) to clean up extraneous lines that caused trouble for new code (white groups).

GableRoof_2022Oct30a.gh (36.4 KB)

1 Like

Thank you @Joseph_Oster. I will look into it.

Oh just saw that. Thank you very much for your time.

F Schmidt,
Joseph_Oster is the master for sure. His solution is very elegant. Every time I look at his solutions I learn something. I took a run at this in a different way. Looking at just one of your “houses”. So here is a really basic way to get there on just one.
Gable v1.gh (11.4 KB)


F Schmidt,
Of course depending on what you are doing you could simply “chamfer” to get a similar result.
Gable v1.gh (9 KB)

Both of your files have no internalized geometry so I grabbed the extrusions from the original thread (mine and @F_Schmidt’s) and they all fail:

Gable v2.gh (80.1 KB)

Joseph, you are correct. I will repost.

Here is a clumsy effort to handle one building/roof at a time. It depends on knowing the gable ends are always on the edges that are 6 units long, which of course is not a general solution at all. And TweenCrv fails to find the correct midline on two of the four corner buildings, which is bad!

GableRoof_2022Nov1a.gh (81.3 KB)

As I said before:

P.S. Here is an alternative to TweenCrv that works in this case but again, is far from a general solution.

GableRoof_2022Nov1b.gh (82.1 KB)

P.P.S. By the way, I think it’s worth noting that this code still works when you graft the list of buildings.

GableRoof_2022Nov1bb.gh (42.4 KB)

I suppose the next challenge would be to extend these roofs so they have overhanging eves. :thinking:


Here is my “solution” with the data internalized.
Gable v1.gh (15.3 KB)
I may not be answering the correct question, but here it is anyway.

Same same for a solution that chamfers the edges. Neither really work at the corners.
Gable v1.gh (14.0 KB)

Completley missed the ongoing conversation.

Thanks for the sugestions!