Sweep fail - How to robustly model swept profiles?


Hello fellow modelers -

This is my first post.

Swept profiles are abundant in architecture. I and a good friend model classical architecture. Classical architecture consists mainly of swept profiles, in one way or another. First, we tried Sketchup. Now, we are giving Rhino a chance. After a good two hundred work hours, Rhino continues to unfold admirably. With one exception. We have searched the forums to no avail.

Rhino’s sweep commands

Rhino’s sweep commands should be able to handle a simple 2d profile swept along a simple 2d rail. At least according to the book.

However, Sweep1 and Sweep2 often produce discouraging results. One illustration of a simple case:

The image above is merely an illustration of how Rhino behaves at tight inner corners. Our question is how to solve the general case.

In the more general case, the rails may have hundreds of curving and straight subcurves at many tight corners, and the profile may have several curving and straight subcurves.

Intended satisfactory output
• Exactly one (poly)surface
• Profile swept along every part of rails
• Result contained by all rails
• Profile keeps orientation to rail direction
• Not overlapping itself
• Single solid shell

Typical input
• Rails with 20 to 200 subcurves
• Profile with 10 to 30 subcurves
• Rails with both curved and straight subcurves
• Profile with both curved and straight subcurves

Reasonable input constraints
• Rails planar
• Profile planar
• Good geometry (fair curves, no microkinks, no colinear subcurves, etc)

Typically problematic input
• Rails with tight inner corners
• Rails whose corners’ bisecting normals cross close to rail
• Profiles wider than shortest rail subcurve
• Rails that have hundreds of subcurves

One way to think of the desired outcome would be like dragging the profile along the entire rail, as if it were countinually setting a plaster cast. The profile should automatically be extended at junctions and corners to meet the extensions from adjacent rail subcurves, the excess trimmed away, and then joined into one.

This behaviour seems like a user’s default expectation. This is how real wall mouldings look. This is exactly what sweep does - sometimes.

But only sometimes.

In other cases, sweeping, even with simple input, fails spectacularly. With apparently trivial, planar input, sweeping may introduce gaps, loops, split surfaces, self-intersecting surfaces, missed rails and overshoots. For some self-explanatory examples, please see .3dm attachment below.

Why and when does sweep fail?

• Rhino’s sweep command may be based on some kind of rail offset. At inner corners (reentrant angles), offsetting produces latent gaps or loops. This occurs where offset’s bisecting corner normals from two inner corners extend to cross each other. How could one make Rhino also in this case simply extend and trim, as at outer corners?

• Profiles wider than the length of a rail subcurve usually go awry around that short subcurve. An updated sweep algorithm could likely resolve this. Or is there already another way?

• Rails with many ins and outs seem to cause problems. But if the profile is manually swept over just two or three rail subcurves at a time, and then manually trimmed and joined, it often works. How is this done in one go for a rail that has some hundred subcurves?

• Offsetting a rail manually and running Sweep2 on both rails usually improves results compared to Sweep1, but it still yields gaps and undesired artifacts. We have tried a host of sweep settings, rebuilding curves, multiplying profiles along rails.

If a command gives odd results in an exotic case or two, that is fine. There are workarounds. But look at real buildings - in Rome, Paris, London, or Washington, anything upscale from 1500 to 1940. They boil down to thousands of profiles and rails. They are everywhere and their complexity often goes beyond the simple cases that makes Rhino fail. What is the way forward here?

– How do you robustly model complex swept profiles in Rhino?

Please see attached .3dm file for some self-explanatory examples.

// Matheron

(post edited for clarity)

SweepFail.01.3dm (934.9 KB)
(using Rhino 64-bit 5.9.40617.14345 for Windows)

(Lowell Walmsley) #2

Maybe I can help with the understanding part even if that won’t make for better results.

When there are kinks in the rail, each segment of the rail between kinks is used to make a separate sweep surface which is extended a little ways past the kink. Then the surfaces from adjacent segments are intersected and trimmed to form a miter.
If the intersections don’t work right or if they remove enough of a surface that the next intersection doesn’t work, you get the us trimmed surfaces to try to make into something you can use.

To make it work on your example would require a more global approach that looked at more than the two adjacent segments.

There are other things that can complicate this in the general case like rails that are highly curved or not coplanar in the area of the kink.
Maybe special casing the easier ones like only straight coplanar rail segments would make those cases more likely to work.


Thus, examples of this kind will never work?
Rhino is impossible to make these sweep?
You should try with other modelers / CAD …


Sorry for my stupid question: witch one’s is the Rail and witch the Section?
Because at firs glance look you simple has to invert the selection step.


What other CAD software did You try to sweep this profiles? Especially Nurbs modelers like Rhino? I tried with MOI - it fails, AutoCAD 2014 - fails! In my opinion this is normal with this kind of curves - I can tell You it is gonna fail even before I try.


@skysurfer - The profile (= cross-section) is black, the rail is purple.
I have updated the post image above for greater clarity.

@davide76 - I do hope there is a better way than abandoning Rhino. Anyone modeling traditional wall mouldings, cornices etc wants to be able to sweep multiple tight corners in the blink of an eye.

@cadmaster - Thank you for comparing. I do not have access to the programs you mention. My point is not about the competition, but what the desirable (geometrically consistent) output is. Regardless of program used. But please do let me know if another modeler comes closer in this matter.

@lowell - Tank you for listening. What you explain makes sense. If you by “special casing” mean updating Rhino’s native sweep algorithm to accomodate for coplanar re-entrant angles, then yes, that probably would solve the problem.

Isolating the simple coplanar case, the problem seems to arise whenever the extended normals from two or more adjacent re-entrant angles (0 to 180 degrees) cross. They cross whenever the profile is wide enough. This behaviour can be easily observed by making a manual offset, choosing “FromPoint” and watching offsets cross as the cursor moves. At outer angles (between 180 and 360 degrees) normal crossing should not occur. So even if the original rails do not intersect, the offsets often do at some point, creating a latent gap or loop. An updated sweep algorithm would have to check the entire sweep for cases where offset would create a gap or a loop, and treat them specially. This might work without interference as long as rails are coplanar. In practice, it would yield a beautiful result and make Rhino’s sweep commands more robust.

Algorithms notwithstanding - from the answers so far, there seems to be an agreement on what the desired output is. There also seems to be agreement that the examples above show that Rhino does not at present deliver that desired output.

If this question has not come up in Rhino’s fifteen years, I am a little surprised. Sweeping wide mouldings at sharp angles does not seem esoteric.

Anyway, if it can be solved somehow, everybody gains.

What do you think? What is the way forward?

(Lowell Walmsley) #7

Its a long-standing and pretty well understood problem. That’s why I could explain what was happening off the top of my head. It irritates me too.

The problem is like almost all of the problems we have with Rhino. There is more to do than we have immediate resources for doing.

The way forward is that this floats to the top of some programmer’s list of things to do.
We like to think that we manage that by doing the things that will do the most good with the resources we have, but that’s very hard to be accurate about.

The idea of isolating some set of easier cases is something that hasn’t been tried as far as I know. If we take rails with only straight segments and only with one shape curve so there is no taper in the result, it might be possible to make some more things work.

The analogy you used about offset may help in thinking about the shapes, but its not really how sweep works as far as making the geometry. Its more like moving the shape curve along the rail than pushing the rail sideways around the shape.


Just for the sake of trying, I gave this a shot in SolidThinking Evolve. It wasn’t able to do any better than Rhino.


Also for the sake of trying SolidEdge- Fail and Sketchup- Failed, even Cinema4D failed.


Gave it a try with GeoMagic and was quite supprised that it worked on a couple of the examples I tried.



Have you thought about using 2 extrusions instead. If you use the inner profile and copy it to the highest level, then offset both curves with cap set to yes you have 2 closed curves. Then extrude and Boolean unite. You could script this and it would be as quick as a sweep.



That is impressive. GeoMagic has always impressed me, but I doubt my company would ever allocate the funds for its purchase. It’s rather pricey, the last time I checked!


You could try Cubify Design, one of my customers has it and although some functions are missing I think it would do this ok. One drawback with cubify, there’s no maintenance so you need to just buy a new version every few years if you wanted to keep it up to date. Link http://cubify.com/en/Products/Design
Also here’s the Rhino file done using extrusions.SweepFail.02.3dm (678.8 KB)



Well, given that there is at least a software that is able to solve this kind of situations (therefore not impossible), try to improve as much as possible, rhino, in its new version (Rhino 6), in such a way that the sweep, and not only these, are resolved in a more robust and satisfying!

(Margaret Becker) #15

This shape is easy to do with two extrusions and a Boolean and hard to do with sweeps.


The extrusion method appears to be a good approach for this along with a solid boolean difference.


Ok all this is correct, it is an alternative route. But if some important CAD unable to resolve this kind of situation using only a simple command (sweep 1 or 2), why complicate your life?
It could not be addressed by the developers and solve everything with something more immediate?
You should try to perform the same exercise with the software type, UGS NX or Catia; if they fail to provide a viable solution using only the command sweep, then Rhino should try to resolve the problem as best he can.
What do you think? I ask too much?


I forgot, someone could try to achieve this kind of examples with other Cad, type Catia? Geomagic seems to give good results: it is already a good starting point on which to work!


@lowell - Thank you for recognizing the problem as real. If sweep could be modified natively or through an add-on script, limited to planar but curving rails and single cross section, the problems indicated above could be solved.

Solving also for non-planar curves and non-planar subcurves would of course be elegant (and they do exist in real structures) but is not as necessary in practice.

Good to know that sweep is not technically dependent on the offset function.

As things look, we might try writing a custom script for resolving some of Rhino’s present sweep limitations. So, if anyone knows a recommended approach or previous scripts to this end, please let us know.

@mcramblet & @djnelson75 - Thanks for comparing.

@davide76 - Yes, if another program performs these sweep operations successfully, the idea seems even more attractive. In sum, if the posters above are correct, then:

These sweeps fail in
• Rhino 5
• Solid Thinking Evolve
• Solid Edge
• Sketchup (native)
• AutoCad 2014
• Cinema4D
• Moi

These sweeps succed in
• Geomagic Design
• Sketchup (with plugin Followfy)

@margaret & @Hughes_Tooling & @Steve_S - Thank you. I should have been clearer in the original post, my fault. The original post has now been edited for greater clarity.

Your solutions may work in this specific simplified case. But the image in the first post does not at all attempt to sum up the problem. It merely illustrates one of its many consequences.

The real question is how to solve the more general case in one go. Consider:

• Profiles with 20+ subcurves (curved and straight)
• Rails with 100+ subcurves (curved and straight)

Cases like these are very real. There are thousands of e. g. baroque structures whose entablatures feature this kind of tightly controlled mouldings in stucco, wood or marble. Their geometry can be exhaustively described as swept in one go by one set of principles.

Yet four hundred years later, Rhino appears unable to emulate them.

So far.


It is interesting to know that a program like SketchUp (with its plug-in) is able to perform this kind of sweep. Rhino: wake up!
I’d be curious to know how it behaves Catia, UGS NX, SpaceClaim, SolidWorks and company!