Help needed for Sweeping a Rectangle profile

Hi all.

Sweeping a rectangle along a spiral that has been created around a freeform curve is causing some problems. The RoadLike option does not really help…

The more profiles there are, the closer we get to the desired result.
The problem is that having to manage so many profiles is not an elegant method.

Below are some tested scenarios.
The third one is close to the goal but involves the use of 11 profiles which must first be adjusted in space to stabilize the resulting orientations.

Best would be to use one or two profiles max.

What is wanted is :

Does anyone know of a python script (win/Mac compatible ) allowing to better manage such a scenario ?
No plugin wanted
No Grasshopper wanted

HelixSweep.3dm (119.0 KB)

Thanks in advance for any help.

Rodolfo Santos.

hi Rodolfo, yes that is a bit of a pain. one work around could be to watch the chronology of your steps.

first create a helix, if needed and the helix should bulge in the middle pull it to a loft as in 2 maybe use RebuildCrvNonUniform on that curve with a tight tolerance and maybe 40 points depending on your actual task to minimise the points. now make a profile line (option both sides) from an end of the curve and sweep that up roadlike. use bend (turn history on to adjust the curve as needed). finally OffsetSrf. maybe its a little easier.

edit: you can of course also use flow if the surface should follow a specific curve, the important step is to offset only in the end otherwise the continuity of the thickness would be compromised.


Thank you for your contribution.

There are naturally many ways to work around that problem, your suggestion is one and has the disadvantage of taking the user away from the initial intent :

Create a polysurface starting from a easily modifiable 2D profile.

If for some reason it becomes necessary to modify the rectangular profile later on, with so many steps to be repeated, the modification becomes laborious.

That’s why I am looking for a scripted solution for this specific scenario.

Rodolfo Santos.

if you want to keep all parameters adjustable at any time while excluding grasshopper you will reach the limits of rhino pretty soon.

Rhino is not a parametric software per se, if you need any curve any shape and every step adjustable with a few clicks rhino may not be your tool.

sometimes workarounds are not bad and absolutely neccessary, relying on a strict path to achieve your goal or relying on scripts and what not may lead you into the wall at the end.

my workaround is pretty adaptable and should not lead you too astray and was meant to make it a bit easier, not to solve it with a one click magic solution.

sweeps are generally a pain in this exact matter and i also would not mind if one could set an up vector for instance to keep the profile direction predictable.

A scripted solution is the right path in this case.

Rodolfo Santos.

pls share it when its finished.

Well, to be honest a ‘scripted solution’ can now also be a Grasshopper definition packaged as a script…

That being said, I did some playing around with some basic Python scripted routines and I cannot come up with much that works well.

Your curve is not a clean spiral I see, so it will be difficult to script it. Otherwise there is a clear relation between a spiral pitch and amount of needed twist.
for more info take a look at this thread:

Yes, I am fully aware that this is a tricky special case.

Thanks for the link, I will take a look on the content.

Rodolfo Santos.

Does that mean that this special cannot be managed via a Python script ?

Thanks for your contribution.
Regards Rodolfo.

No, it just means that my scripting abilities are maybe not up to the task… :stuck_out_tongue_winking_eye:

Right, then, may I ask you what would be an elegant logic to apply in order to better manage such a situation.

I am not skilled to write a scripted solution with Python so I won’t be able to improve your scripts.
But if there’s no other option for me, I may try to develop something in GH that I better master.

Your advises may help me to write a pseudo code before starting with GH.

  • I guess we have to start by calculating the BB of the profile in case it is not perfectly rectangular…

Then find a strategy to force the profile to remain perp from the rail in one dir.

It will probably be necessary to evaluate the curve and take into account the changes in speed in order to obtain an accurate approximation.

I suppose that the better the alignment and orientation of the profile on the rail will be maintained, the more accurate will be the resulting thicknesses…

Any advise will be appreciated.

Rodolfo Santos.

If you could explain the rules for the spiral itself it would help as well to come up with some logic. Or explain how it is constructed. I think the base geometry for construction will help in constructing the section curves too.
For example, the square you draw is perp to the curve but also seems to be aligned to an imaginary hull around the spiral. If you have this hull surface you can use it to align the remaining axis of the section.


Thank you for your answer.

Here is some additional information concerning the problem raised.

1 - Rule of the Spiral.

Freeform curve used as a guide to create a pipe with a square section.
Purpose : Metal casting.
Transformation Needs : MSR

Needed Tolerance for FAB : 0.1
Since the loss of precision after casting varies between 1 and 3 % for the intended purpose, it is necessary to be able to apply precise compensations on the profile at the CAD stage.

2 -The construction of the spiral

Since the shape of the guide curves has to be arbitrarily adjusted for purpose-related reasons, using a parametric spiral model does not seem relevant.

However, if it is possible to set up a spiral parametrically that can conform to two guide curves, this would make the implementation easier.
GH is probably one right path for this…

If we stick to Rhino, one way of creating of such a spiral from manageable guide curves could be focus on easy to control guide curves:

  • Create two clean guide curves
  • Find the average curve
  • Create a spiral around the averaged curve starting @ 50%
  • Rotate/Copy the resulting spiral
  • Use the 3 levels of control offered by the guides to adjust things if needed.

There are naturally many other ways to work around the creation of such a spiral with Rhino.
the method described by @encephalon is one such.

What must prevail is the ability to adjust the profile downstream.
This is why it seems relevant to me to focus on the behaviour of the profile on the rail as well as on the ability to modify the characteristics of that same profile in a second stage.

That the idea, yes.

While understanding this concept is within my grasp, I admit my inability to describe it in the form of a Python script.

Rhino not being parametric, I am facing a certain limit that can probably be crossed with GH.

As far as I’m concerned, not being skilled in coding, I don’t really have any other choice than GH or an existing plugin ( I really don’t like this way ).
But in the absolute, I have the feeling that a Python script would be a more transversal solution…

Rodolfo Santos.

in that case the attached might be a good approach:
Make the hull with loft
Use FlowAlongSrf to transform the spiral to the new hull
Use ArrayCrv (roadlike top) to make sections
Use FlowAlongSrf (rigid) to flow the sections to the transformed spiral
use Sweep1 natural, freeform to generate the transformed square spiral
note: for squares it works, but for trapezoid shapes, Rhino seems to flip the curves in the ArrayCurve

all can be done with History, so basically this makes the whole thing almost parametric, try to modify one of the circles used for loft (red) (not the left one) or the base section (orange) to see it update the rest
flow.3dm (471.5 KB)


Thank you very much for your contribution.

Sounds good except the non linear aspect of the general shape as described above.
Screenshot 2021-03-21 at 11.06.11

I will try to reproduce the described steps to check if there could be a limitation by sticking to the implicit history of Rhino.
Rhino will probably not allow to maintain the history relationship on the circles and on the surface at the same time.

Loft more the 2 circles may solve this…

*Too many nested steps involving the use of too many objects sometimes leads to cascading problems or to a solution which may not be very flexible tu use.

Don’t know why, but the file you posted crashed my Rhino 7 three times ?

Let me explore the suggested approach and I will give you a feedback.

Rodolfo Santos.

maybe I don’t understand this but I can still scale the mid circle non-linear and the shape stays up to date:

just wanted to add, that the sweep commands somehow handle the
the framestyle in an unexpected way: see this post:

please also notice, that the normal of the spiral is not pointing in the same direction as the normal of the (virtual enclosing) surface…

a spiral has torsion, so the resulting surface will also have torsion !


Sure, visually that sounds good…

… but I need to check if the resulting PolySrf is stable enough regrading the directions and compatible with the FAB constraints.

If this is not the case, we will have to increase the number of profiles ( again ) in order to obtain a better approximation.

Let me experiment this…

Rodolfo Santos.

This is why is was focused on the curve and not on a virtual skin which drive to a compromise.

a spiral has torsion, so the resulting surface will also have torsion !

I am well aware of this, but I must admit that the result obtained via Sweep 1 in Rhino is sometimes surprising. These unavoidable ‘twists’ seem uncontrollable at times, although I suppose there are methods to minimise this phenomenon but not with the native tools, right ?

Thank for you contribution.

Rodolfo Santos.