Hi,
i have noticed a difference in the evaluated curve points of a NURBS curve with a unclamped uniform knot vector.
The curve is defined by:
- Control points: CP1(0, 1, 0), CP2(1, 1, 0) and CP3 (1, 0, 0)
- Degree: 2
- Knots (incl superfluous knots): 0, 0.2, 0.4, 0.6, 0.8 and 1
Code:
ON_NurbsCurve curve;
curve.m_order = 3;
curve.m_is_rat = true;
curve.m_dim = 3;
curve.m_cv_stride = curve.m_dim + 1;
curve.m_cv_count = 3;
curve.ReserveCVCapacity(curve.m_cv_count * curve.m_cv_stride);
curve.ReserveKnotCapacity(4);
curve.SetCV(0, ON_4dPoint(0, 1, 0, 1));
curve.SetCV(1, ON_4dPoint(1, 1, 0, 1));
curve.SetCV(2, ON_4dPoint(1, 0, 0, 1));
curve.SetKnot(0, 0.2);
curve.SetKnot(1, 0.4);
curve.SetKnot(2, 0.6);
curve.SetKnot(3, 0.8);
When i evalutate the curve point with the openNurbs SDK at t = 0 I get :
C(t= 0) = P(-3.5, -1.0, 0), which I don’t want to.
auto point = curve.PointAt(0); // P(-3.5, -1.0, 0)
When i check the same curve with Rhino, i get the correct value:
ON::Begin();
auto fp = ON::OpenFile("clamped.3dm", "wb");
if (curve.IsValid()) {
ON_BinaryFile archive(ON::write3dm, fp);
ON_WriteOneObjectArchive(archive, 0, curve);
}
ON::CloseFile(fp);
ON::End();
Do I need to add some operations in the openNurbs SDK?
Thanks!