[vtk-developers] Class design for spline visualizations

David Thompson david.thompson at kitware.com
Mon Jun 22 18:54:17 EDT 2015


Hi Lin,

> 1. The definition of knot vector seems to be a little different from the NURBS book. In the NURBS book, a knot vector is defined as U = {a,...,a,u_{p+1},...,u_{m-p-1},b,...,b} where a and b are repeated p+1 times (p is the degree of NURBS curve). And since NURBS cruve  is defined as C(u) = sum_{i,n}(N_{i,p}(u)*P_{i}),  the endpoints seems to be interpolated as well.

NURBS do not require any knot vector entries to be repeated. Many examples in the NURBS book *happen* to have repeated entries, but it is not a requirement.

> ...
> 2. The previous section of the wiki page writes "The number of knots is always equal to the number of control points plus curve degree plus one (i.e. number of control points plus curve order)." Should it be degree + N  + 1 = K ?

From the wikipedia entry: "Some modelers that use older algorithms for NURBS evaluation require two extra knot values for a total of (degree+N+1) knots.[7]"  You can use whichever you like. I would advise sticking with the NURBS book because it has many examples worked out in detail. (The NURBS book appears to use the degree + N + 1 = K formulation.)

> 3. I think the inference is only for a single patch.  If there are several patches in the vtkStructuredGrid, we can not get the number of control points for a certain patch by vtkStructuredGrid->GetDimension() unless we know the number of patches and the number of control points are the same for all these patches.


Nope, you can use GetDimension() to discover the number, N, of control points for all patches. That is related to the degree by the number of knot vector entries for all patches. We have not specified how the knot vector would be stored. If stored as an array in vtkFieldData, then   we would also have to store the number entries along each axis (the equivalent information as GetDimension() returns for the control points). Or we could store the degree along each axis and use that to determine the size of the knot vector along each axis... whichever you prefer.

	David


More information about the vtk-developers mailing list