Dear all,
I have developed a c++ Rhino plug-in and now I need to write a command to enlarge planar curves of a specific offset value, on a 2D plane.
The expected result is a 2D surface.
I’m able to reach exactly the target using the Rhino user interface, in particular the command “_ExtrudeCrvAlongCrv”.
I simply create a circle with radius equal to the required offset at an end of the curve to be offset, then I use the circle as shape and the curve as drive curve.
The result i simply perfect, as show in figure “Input.png”
and “UI_brep.png”
The problems occur when I try to reach the same result using Rhino SDK API:
In particular I use “Rhino1RailSweep” function, expecting the same results, but instead the output is the one shown in figure “API_brep.png”.
Top-left and top-right example are completely wrong but there are moreover less evident errors:
A) Some corners are not rounded:
B) In one case, the surface does not end with the circle center at the end of the line, but just before
C) In general the algorithm seems to be less precise
The code I wrote is the following:
const double in_offset;
const ON_Curve& in_drive_curve;
const ON_Circle shape(ON_xy_plane, in_drive_curve.PointAtStart(), in_offset);
ON_NurbsCurve shape_nurb;
const int is_nurb_correct =
shape.GetNurbForm(shape_nurb);
if (!is_nurb_correct)
{
return;
}
ON_SimpleArray<const ON_Curve*> shapes;
shapes.Append(&shape_nurb);
ON_SimpleArray<ON_Brep*> breps;
Rhino1RailSweep(
breps,
&in_drive_curve,
shapes);
Can you please supply to me help for my purpose?
@Dale usually is great with this problems.
Thank you,