SweepOneRail.PerformSweep seems to have hardwired Refit = true. How do I select Refit = false?

Hello

I’m a bit baffled by one aspect of SweepOneRail.PerformSweep that I’m using in my command in the plug-in I’m developing for v5.
(I see the same results when I choose the Brep.CreateFromSweep option, by the way)

The resulting brep is self-intersecting at a few points, which baffled me because, given the shape, it shouldn’t. So I performed the same action using Sweep1 in the regular Rhino interface and the result was as I expected - perfect, no intersects in the surface.

The only way I could reproduce the self-intersections in the regular Rhino interface is to use Sweep1 with refit ticked! So it appears that SweepOneRail.PerformSweep has internally refit set to true. How do I set it to false?

I’m happy to add the 3dm file and C# code but I thought I’d first ask - is this a known issue? Is there something obvious that I’m missing from what I’ve said so far?

Thanks in advance

Nic

Hi @nicolaasburgers

We’ll need some geometry along with source code we can run here.

Thanks,

– Dale

Hi @dale

I’ve attached a 3dm file and the source code in a zip to this message.

If you open the file in Rhino and perform a Sweep1 command with the curve that’s on the X-Y plane as the rail, without Refit set, then the internal vertical corners of the resulting surface perfectly non-self-intersecting.

Using the TestSweepOneCommand (in the plugin when you build the attached source code) on the same curves, when you zoom into the corners you’ll see this:

Any help you can give on how I could code my plugin to achieve the same result for these curves as Sweep1 (without refit set) can offer in the regular interface would be greatly appreciated!

Cheers

Nic

TestSweepOne.3dm (39.7 KB)
TestSweepOne.zip (182.0 KB)

Hi @nicolaasburgers,

Thanks for the model and code. This isn’t a refit issue. However, we’ll take a look and see if we can figure out what’s gong on.

– Dale

Thanks in advance @dale.

Cheers

Nic

Hi @dale

I’m curious - have you had a chance to look into this yet?

Cheers

Nic

Hi @nicolaasburgers,

Thanks for reminding me. I’ve logged the issue here:

https://mcneel.myjetbrains.com/youtrack/issue/RH-50636

Basically, the Sweep functionality in RhinoCommon is insufficient for what you want to do. I plan on adding a fix to Rhino 6.

– Dale

Thanks for the update @dale - could that be updated in v5 of Rhinocommon too so that it matches the capability of the corresponding sweep in regular Rhino v5 UI?

Hi @nicolaasburgers,

Sorry, no, we are no longer making updates to Rhino 5.

Since you’ve got curves in the document, you might consider just scripting the Loft command.

– Dale