Sweep in RhinoCommon vs the Sweep 1 Rail Command

How can I achieve the clean sweep with Brep.CreateFromSweepSegmented in RhinoCommon?

BuggySweep.zip (9.6 MB)

Both trials achieved poor results.

				sweep = Brep.CreateFromSweepSegmented(
						   railCrv,
						   sectionCrvs,
						   true,
						   RhinoDoc.ActiveDoc.ModelAbsoluteTolerance
						   );
			var sweep = Brep.CreateFromSweepSegmented(
					railCrv,
					sectionCrvs,
					Point3d.Unset,
					Point3d.Unset,
					SweepFrame.Freeform,
					Vector3d.Unset,
					true,
					SweepBlend.Local,  //most set to Local, otherwise it messes up the sweep.
					SweepMiter.Untrimmed,
					RhinoDoc.ActiveDoc.ModelAbsoluteTolerance,
					SweepRebuild.None,
					0,
					0.0
					);

I noticed it has been asked before.

Sweep1SegmentedBug.gh (7.5 KB)

I’ve also attached a buggy sweep gh test file.

Hi @Wiley,

Try simplifying your rail curve (polycurve with 6 linear NURBS curves) into a simple polyline curve.

Does this help?

– Dale

Thanks @dale
But why did the Sweep command work while the RhinoCommon Sweep did this weird twisting thing?

When you run Sweep, take note of the direction and location of the seams of the shape curves.

– Dale

So how would you change the script I have?

Since the two shape curves are identical, why not delete one?

1 Like

Yes. Actually using just one profile curve at start is much stabler than trying to orient profile curves manually.