Problems with MakePeriodicUniformKnotVector -> problems with GetSpanVector

I instantiate a nurbs surface with ON_NurbsSurface(3, false, 5, 5, 37, 37); Then I call MakePeriodicUniformKnotVector();

When I print the knot vector I get numbers going from 0 to 33 and 6 zeros at the end. This makes 40 values which is 37 + 5 - 2 so it is ok. I would have expected to get values from -3 to 36, because I could find such values on other examples.

Do I have a regular behavior? What means the 6 zeros at the end?

Because of those zeros, all my calculations are going wrong.

I could find what was wrong.

It was not MakePeriodicUniformKnotVector() but GetSpanVector() that I used to display the knot vector. GetSpanVector() doesn’t gives you the knot vector.

To get the knot vector, it is better to use the fields m_knot[0][i] and m_knot[1][i] for the two axes of the surface…

:grin:

1 Like