// Make a 2-rail sweep
ON_SimpleArray<ON_Brep*> output_breps;
bool rc = Rhino1RailSweep(output_breps, rail0, shapes, bClosed, context.m_doc.AbsoluteTolerance());
if (rc)
{
for (int i = 0; i < output_breps.Count(); i++)
{
ON_Brep* brep = output_breps[i];
if (nullptr != brep)
{
CRhinoBrepObject* brep_obj = new CRhinoBrepObject();
brep_obj->SetBrep(brep);
brep = nullptr;
context.m_doc.AddObject(brep_obj);
}
}
context.m_doc.Redraw();
}
return CRhinoCommand::success;
}
The original Rhino2RailSweep worked as expected, and the stock Sweep1 command gives me a correct result, but Rhino1RailSweep gives me a disjointed output whenever it’s invoked on a polycurve (see bottom pic):
I’ve tried every other variant of the command with similar results (RhinoSweep1, RhinoSweep1Ex, Rhino1RailSweepSegmented etc.). Am I missing something?
Hi @dale, sorry, I should clarify: I omitted part of the code that generates a randomized NURBS profile curve for each rail curve in the document. Here’s a file with both curves present, and the code in its entirety: test curve 2.3dm (21.3 KB) cmdFNK_RandomRail.cpp (8.9 KB)
@dale Did you perform the sweep using the SDK here? The initial orientation wasn’t ideal, but it still produces a valid sweep using Rhino’s sweep1 command. My concern is that the SDK commands produce an entirely incorrect result even when profiles are oriented correctly.