Trying to reproduce Rhino's native Sweep1 behavior with RhinoCommon

Hi all,

I am trying to sweep 2 profiles along one planar polyline rail - using native Rhino Sweep1, checking “untrimmed miters” gives a good result (file below).

However, I have tried various ways to reproduce this behavior in a script using RhinoCommon, but it always fails either to trim or extend… I have tried 3 different sweep methods:

  • Brep.CreateFromSweep()
  • Brep.CreateFromSweepSegmented()
  • Rhino.Geometry.SweepOneRail()

Haven’t got any of them to work correctly so far - what am I missing?

Sweep1PL.3dm (120.6 KB) (1.1 KB) (786 Bytes) (795 Bytes)


Any idea?

Apparently, Rhino needs a looser tolerance to extend/trim-miter this particular sweep.

By increasing the model tolerance, or just modifying it for Brep.CreateFromSweep, to at least about 0.08, miters will be created at all the kinks.

At the increased tolerance, _Sweep1 is also able to create all miters with Untrimmed miters disabled. (Notice how the vertices do not match those of the Untrimmed miters version.)

Rhino.Geometry.SweepOneRail seems to still have mitering problems:

Hmm, that’s too bad… 80x the file tolerance. So I guess the fact that the native Rhino command succeeds in this case is because it has some sort of adaptive tolerance loosening?

Hi @Helvetosaur,

This is a shortcoming for sure.

– Dale

RH-56247 is fixed in the latest WIP