Hello,
I have created a NURBS curve as follows:
ON_3dPointArray cvs;
cvs.Append( ON_3dPoint( 0.0, 1.50, 0.0 ) );
cvs.Append( ON_3dPoint( 0.0, 1.00, 0.0 ) );
cvs.Append( ON_3dPoint( 0.0, 0.50, 0.0 ) );
cvs.Append( ON_3dPoint( 0.0,-0.25, 0.5 ) );
cvs.Append( ON_3dPoint( 0.0, 0.50, 1.0 ) );
ON_NurbsCurve curve( 3, false, 4, cvs.Count() );
curve.MakeClampedUniformKnotVector();
for (int i=0; i<cvs.Count(); ++i)
curve.SetCV( i, cvs[i] );
This code creates the correct curve. However, the domain of the curve is {0.0 , 2.0}
.
I have tried to reparametrize the curve and change the domain of the curve to {0.0 , 1.0}
as follows:
...
...
ON_NurbsCurve curve( 3, true, 4, cvs.Count() );
bool res = false;
res = curve.Reparameterize(1.0);
std::cout<< "Reparameterize res = " << res << std::endl;
res = curve.SetDomain(0.0,1.0);
std::cout<< "SetDomain res = " << res << std::endl;
curve.MakeClampedUniformKnotVector();
for (int i=0; i<cvs.Count(); ++i)
curve.SetCV( i, cvs[i] );
Unfortunately, the curve’s domain remains unchanged even when the result returns true
.
Reparameterize res = 1
SetDomain res = 1
Domain = { 0.00000000000000000 , 2.00000000000000000 }
Can you please suggest what I could be missing?