How to recreate this folding 2d ribbon in GH?

Hi there! Below an example of an artwork by artist Amber Vittoria. As a challenge, I’d like to create a definition that can recreate this geometry with an input polyline.

So my thinking is to take a polyline curve as input, and then to define the ribbon width by offsetting the curve on both sides. I can then loft the two curve offsets and define whatever colour to the resulting surfaces. What I’m struggling with is what happens where there is a change in direction and how that folded edge detail is created.

To avoid issues with curve offsetting, I explode the polyline into segments and move each curve segment up by 1 in the Z-axis. I get unpredictable curve offset results otherwise where the polyline overlaps itself, having each segment on it’s own “layer” is my attempt at getting around this. I figure there are better ways to go about this.

From the example image, I devised the following rule for determining the angle of the fold edge: Where the polyline has a change in direction, the angle of the fold edge CD appears to be perpendicular to the line AB (with A being at the point of change in direction in the polyline, and B being the intersection between the curve offsets)

How to set this up in Grasshopper, I’m a bit stumped. I presume that one could calculate the angle of the fold edge by extracting the curve segment vectors? Bearing in mind, the definition needs to be able to accept a polyline with a variable number of segments - how to manage the data branches in this case is a bit above my skill level - I made an attempt at this by using the Heteroptera component Dispatch/Unweave, but the definition isn’t flexible if the input polyline were to suddenly have more segments.

Any ideas on how to approach this would be appreciated!
amber vittoria experiment.gh (10.0 KB)

List shifting on steriods here, plus a little help from trigonometry.
(oops, error in list matching)
(added internalized curve and colors)

PaperFold.gh (17.3 KB)

2 Likes

Wow, you are way too fast for me! You didn’t internalize your curve so I used the one @dancon88 posted with an adjustment to the ribbon width.

P.S. The crazy color pattern is a distraction. :-1:

Agreed :sweat_smile:
I think it would be better to do this directly in Rhino with a custom material but this is where my skills end.

My method is far more brute force. I was stuck at one point until I saw how you lofted the folds.

I managed to remove the twist using the original curve but it still twists using your curve. So far, the only solution I can think of is an Anemone loop which is silly, of course. Oh well, why not, I’ve come this far. Go ahead and laugh. (the ‘Radius’ slider sets the ribbon width)


amber vittoria_2023_Aug13a.gh (27.1 KB)

I’ll look more deeply into your code to see how it’s done the smart way. :slight_smile:

I did review your code in detail. Very nice!! Well done.

I started to measure angles between segments but could not resolve the results with what I was seeing with my eyes - and I can’t with your code either. I have a mental block to overcome there and instead of spending too much time on it, I used a different method: “geometric construction(brute force).

1 Like

Hi there! Thanks for your speedy response! Do you mind posting this with the geometry internalized? I tried adding an input curve and it just remains blank…

1 Like

Here it is with your curve.
I had to reduce the thickness of the ribbon to see something.

PaperFold-baseCurve.gh (16.7 KB)

2 Likes