I am struggling trying to control the orientation of the cross section when extruding. There is a math term called torsion, which I think describes the underlying math. Does Rhino provide a way to set or control torsion during an extrusion so the “cross sections” end up oriented as desired? As an example, try extruding a planar rectangular cross section perpendicular to and along a curve created by the helix command, but you want the top edge of the rectangular cross section to remain horizontal all along the path. I have to believe this is easy in Rhino, but I cannot figure out the workflow.
Hi Matt,
If you extrude an object along a curve the orientation of the object remains the same throughout which, I imagine, is not what you want.
If you want the object to remain perpendicular to the curve you should use the _Sweep1 command. After selecting the rail (your helix) and the object to sweep you will get an options panel. You need to select the Roadlike option to keep the top edge horizontal.
Extrude:
Sweep:
HTH
Jeremy
Ok Thanks for that. That puts me on the right track.
So, I am only sweeping ~66 deg around the helix, which has a ~53° angle with the axis (reasonably steep), not that this should matter much.
My planar “sweep shape” is perpendicular to the start of the rail curve, and its top edge is horizontal. Using _Sweep1, when I select the “roadlike" option, the far end cross section still is not aligned horizontally. It is a somewhat more horizontal than with “Freeform" selected, but still not right.
So, as an alternate approach, I place a duplicate cross section at the far rail end, placing it perpendicular to the rail curve at that end, and with its top edge horizontal. Also, I adjust the seam points on the end section to line up with the start section - not quite sure yet how the rectangle flipped. Finally, I use the “Global shape blending” option in _Sweep1. That process appears to give me the right geometry.
So, are all these manual steps really needed? Seems like Rhino might be able do some of these steps, if I knew where to look.
Actually, I now see that just putting a sweep shape at each end of the rail does most of the work to torque the sweep correctly. I cannot figure out what the various options are really doing. I see the pixels change, so something is different with each setting, but it is not obvious what the difference is with each of the option settings.
See the help file for more info: Sweep1 | Rhino 3-D modeling (mcneel.com)
I think this is actually a bug (@Gijs ?): Roadlike maintains a horizontal orientation when the rotation is a multiple of 180 degrees, but not other angles. Placing a second cross-section at the end is, as you found, a workaround.
Roadlike sweep issue.3dm (288.4 KB)
Regards
Jeremy
I feel I am chasing my tail on this. I started a model over from scratch, and the end section came out horizontal (I think) repeating a 66 deg sweep of the helix cylinder and with a sweep section on only the start end (using the “roadlike” option), as you recommended earlier. So, not sure what exactly I did wrong previously. Maybe I got one of my CPs oriented wrong earlier. Your study is interesting and adds to my confusion.
Question. The “torsion angle” difference between freeform and roadlike options, is that rotation angle calculated and provided by Rhino somewhere, or do I need to create a dimension to figure it out? That could be an interesting number to know, I think.
I had looked at the embedded help on this, and it was not any help for me at the time. Maybe it will make more sense after struggling with this some more.
hmm, not seeing that here, but I also see a different result than what you are posting:
I’m getting the exact same result with Sweep1 and Railrevolve,
Anyways for helical sweeps I find it more logical to do that with RailRevolve, then you are automatically forced to define the axis.
I did mine in Windows Rhino 8.10.24212.13001, are you using a Mac or on a different release?
On a related subject, does Rhino provide the user with the following curve parameters:
- curve torsion, (speed of rotation of the binormal vector)
- Integral of curve torsion (total torsion) at a point on curve (from each end)
- tangent vector,
- normal vector,
- binormal vector?
I recognize I can draw a “curvature circle” at any point along the curve, so I expect that could lead to a way to construct these. But, if these characteristics are available directly from Rhino, that would be useful.
@jeremy5 I tested that in 8.11, but also in a slightly older version as yours on Windows. I don’t think anything in the code of Sweep1 has changed for long time, but just to be sure. I’m curious how you defined the axis.
These are not (yet) available in Rhinocommon but these
are and
is the dot product of the tangent and normal vector, so can be easily calculated.
I took the default, which was a unit z vector.