rs.AddSweep2 unexpeted results


The surface being created does not follow the rails

noseRail1 = rs.AddCurve(noseOffsets)

cLplane = Rhino.Geometry.Plane.WorldZX
cLxform = Rhino.Geometry.Transform.Mirror(cLplane)
noseRail2 = rs.TransformObject(noseRail1, cLxform, copy=True)

rails = [noseRail2, noseRail1]
noseShape = [noseCircle]
noseSurf = rs.AddSweep2(rails, noseShape)

The cross section is a single circle and the rails are quarters of an ellipse.


I fixed it by reversing the curve before it was mirrored. Now I need to figure why. I am guessing it has to do with the directional the rails with respect to the cross section. It is interesting that there is some inconsistency between manually creating the surface in Rhino and through scripting.

(Dale Fugier) #3

Hi Ben,

This method does not perform any curve sorting or direction matching on the input shape curves. This is the responsibility of the script writer.

For best results:

  • The shape curves should all be oriented in the same direction.
  • The starting point of each shape curve should either intersect with or be close to the rail curve.
  • The shape curves should be passed in order, starting with the curve closest to the starting point of the rail.

– Dale