Transformation of a polygon tunnel

Hey there!
Im am working with Grashopper since about 2 weeks so I’m still a beginner. I have a question regarding the geometry you find below. I want my “tunnel” of half-polygons to slowly open up and transform into a straight line which is on the top with grashopper. After many hours of trying and searching I didnt find a solution so I hope somebody here could help me out. (the desired transformation is also shown in a quick sketch.



Mister_Blackstars_ Problem.gh (13.5 KB)

Thank you all a lot for your help in advance!

Believe it or not, the description in this thread is not as clear as you might think. Your previous thread was more obvious - can you clarify this one?

Maybe something like this?

Or would you prefer a smooth transition using Graph Mapper ? Like this:


Mister_Blackstars_2023Mar12a.gh (18.3 KB)

1 Like

Hey, I’m sorry that the description was unclear, it is kind of hard to explain. I will try to model it in rhino somewhat quickly so that it will be more understandeable hopefully. Give me a moment. And thank you a lot for Reaching out!

Look again at my post.

This is like a tower on its side and cut in half.

1 Like

Hey. I did a quick model, of course its not precise and I would want to do that parametically with grashopper. And I want to apologize again for my unclear explanation, I hope this will clarify it:



Mister_Blackstars_ Problem.3dm (104.8 KB)

Each segment of the Polygon (except the top one which is horizontal) should rotate open until they are all paralell on the top.

I hadn’t even noticed that your curve has a Z component. So the top of your tunnel is at constant height while the half polygons become flat… Looks a little tricky.

1 Like

Yes, exactly. Then at least I didnt struggle at an easy task. Sadly also ChatGPT couldnt help me also after intense interrogation… Would you know any way for a solution for this, or do you think its maybe not really possible?

Of course it’s possible! I know this isn’t quite what you want, it’s a quick and dirty approximation.


Mister_Blackstars_2023Mar12b.gh (20.4 KB)

I wrote some code somewhere on this forum that applies angles to multiple segments that might be great for flattening these half polygons “properly”.

1 Like

That’s already much closer to what I want than I got ttrying to do this for hours!! Thank you a lot for taking your time to help me find a solution! I will try my best to learn out of your approach and maybe I will even reach my goal if I find your code somewhere. Really thank you a lot! have a great day!

Here it is. Looks like it uses Anemone:

And on the same page:

1 Like

Perfect! Thank you a lot!

Not perfect at all! The Anemone approach looks futile to me for this.

Here’s a different way that’s not perfect either, as it has a hard spot between the scaled arcs and the rest of the half polygons. I think the best way to fix that is to recreate all of the half polygons using arcs before scaling the first eight at the end. An exercise for you. :wink:


Mister_Blackstars_2023Mar12d.gh (26.0 KB)

P.S. Here you go. It wasn’t that hard. It’s less code, simpler, so better in two ways!


Mister_Blackstars_2023Mar12e.gh (24.7 KB)

Version ‘b’ was a pretty decent approximation, for quick and dirty!

This is getting a little carried away but it’s good to know how to do this, eh?

I used your curve (white) as a scale guide for tunnel height (Y in this case) and added a Value List switch (blue group) between the two methods. It could also be used for width but before doing that, a little more effort is need to make the white curve fair.

Full Size
Mister_Blackstars_2023Mar12f
Mister_Blackstars_2023Mar12f.gh (28.5 KB)

1 Like

It’s great to know how to do this! also with every solution you come up I can learn from it, so for me it’s just great! And now it’s even quite what I want! so, really thank you a lot!

Using plane intersections with a guide curve to scale height (and width) is a good trick to know but again, the results are only as fair as the guide curve. Instead, Graph Mapper was doing that fairing and you can get a very similar effect by manipulating it. This code is identical to version ‘e’ from yesterday with only small changes to Graph Mapper.


Mister_Blackstars_2023Mar13a.gh (20.8 KB)

1 Like