How to make orientation of sweep and array curve the same in Grasshopper?

roller coaster test 2(1)(1).gh (530.4 KB)

I’m trying to make this roller coaster track along any given input curve:

For the ribs and the plates I just input them as breps; the three main pipes I input as profiles. I thought this would be a relatively simple exercise in just sweeping three times and arraying along the curve but I must be setting my base points wrong or have some misconception about how the two commands work in Grasshopper because I keep getting stuff like this, which is misaligned:

I tried array-curving the profiles of the pipe and then sweeping through multiple section profiles, but that didn’t work either. Also, if the curve is closed the sweep doesn’t work, and I tried changing the seam but it still wouldn’t sweep…

How do I draw the rail for the two small pipes based on the rail for the big pipe, so that it will work with sweep or pipe?

How can I sweep closed curves properly?

What am I doing wrong that is preventing everything from lining up?

Some of your geometry is not internalized.

Looks like you have discovered “torsion” that causes pFrames to rotate on curves (even though you aren’t using pFrames).

internalized geometry roller coaster.gh (556.3 KB)
Sorry, here is the file with internalized geometry.

Is there some way to control the rotation? I’m a bit fuzzy but my intuition in that case is I should probably use orient component and make some pframes that are oriented correctly. I don’t have a clear understanding of what I’m trying to orient to though…

I don’t have more time right now, sorry. Using pFrames doesn’t look so bad. Sweep2 (using an offset curve for the second rail) works fine on closed curves.



roller coaster_2025Apr16a.gh (8.6 KB)

This is a quick demo of Orient. Again, I’m sorry I don’t have more time now.


roller coaster_2025Apr16b.gh (35.4 KB)

1 Like

I had some trouble finding your geometry because it was so far from the origin. But I found that if you do this:


you get this:

which looks like this closer up:

What if you divided each of the track’s edge curves into the same number of points, then made a line between each corresponding pair of points, found the ruled surface’s closest point to each of these, and then found the normal to the ruled surface at each of these points.

I remember reading an article about designing roller coaster paths that dealt with the G forces at various points. The idea was to not exceed a G force higher than about 5, because higher ones can result in heart attacks and/or blackouts. The key to the article was that the method used, as it’s points of reference, were points called “heart points”, which are where rider’s hearts would be relative to the track, and not the standard method of “head points”, which are where their heads would be. Apparently that made a significant difference to the final track design.
internalized geometry roller coaster-bb1.gh (546.0 KB)

Do this:

Ahh, that makes sense - I’ve been trying something similar but I guess there is some kind of difference between Perp Frame and Perp Frames. Very helpful, thanks!!

“Frame” is singular, one pFrame at a designated location.
“Frames” is plural, it divides the curve evenly with multiple “frames”. (planes)