Hi everyone, this produce a flat curve on z and it should not …
if some one can confirm that bug ?
Compiling code:
const int nPoints = 3;
int degree = 2;
ON_3dPoint* ptList = new ON_3dPoint[nPoints];
ON_NurbsCurve crv;
//Create some points
ptList[0] = ON_3dPoint(1, 0, 1);
ptList[1] = ON_3dPoint(2, 1.5, 2);
ptList[2] = ON_3dPoint(3, 2, 3);
crv.CreateClampedUniformNurbs(degree, degree + 1, nPoints, ptList);
context.m_doc.AddCurveObject(crv);
context.m_doc.Redraw();
delete[] ptList;
return CRhinoCommand::success;
dale
(Dale Fugier)
2
Hi @JulienPoivret,
This seems to work:
CRhinoCommand::result CCommandTest::RunCommand(
const CRhinoCommandContext& context
)
{
const int dimension = 3;
const int degree = 2;
const int order = degree + 1;
ON_3dPoint points[order]; // 3
points[0] = ON_3dPoint(1.0, 0.0, 1.0);
points[1] = ON_3dPoint(2.0, 1.5, 2.0);
points[2] = ON_3dPoint(3.0, 2.0, 3.0);
ON_NurbsCurve nurb;
nurb.CreateClampedUniformNurbs(dimension, order, order, points);
if (nurb.IsValid())
{
ON_Plane plane;
bool bIsPlanar = nurb.IsPlanar(&plane); // return true
context.m_doc.AddCurveObject(nurb);
context.m_doc.Redraw();
}
return CRhinoCommand::success;
}
– Dale
Thanks @dale the mistake was on me 