[vtk-developers] Class design for spline visualizations
David Thompson
david.thompson at kitware.com
Mon Jun 22 17:31:33 EDT 2015
Hi Lin,
> I think one of my problem now is that I'm not sure how patches connecting with each other.
Yes, it is not straightforward.
> Originally I thought patches in a shape are irrelevant with each other. For example in the ellipse, we need 4 patches for each quadrant and I generate four patches independently only that they share same end points, but from your previous email I think for NURBs it's not exactly true.
Correct. The difference is that NURBS do not always interpolate their endpoints and can have regions whose parameter value ranges are non-uniform (the "NU" in "NURBS"), while Bézier patches interpolate their endpoints. NURBS only interpolate their control-polygon when a value in the knot vector is repeated the same number of times as the degree of the curve -- e.g., a quadratic NURBS curve with a knot vector of [0, 0, 1, 2, 2] will interpolate the endpoints of its control polygon. But the same control polygon could have a knot vector [0, 1, 2, 3, 3] and only the final control polygon point would be interpolated.
See https://en.wikipedia.org/wiki/NURBS#Comparison_of_Knots_and_Control_Points for some more information.
> Another is that if a NURBs shape is given by a vtkStructuredGrid and a know vector, how to infer the number of patches, degree of interpolant and number of control points.
The wikipedia link above discusses this: "In general, the knots break the domain up into knot spans, but each control point corresponds to one basis function which spans a range of (degree+1) knot spans." So, knowing the length, K, of the knot vector (along one axis) and the number, N, of control-polygon points (along the same axis), you can get the degree of the interpolant: degree + N - 1 = K. In the wikipedia example, degree = 3, N = 7, and the knot vector is length K = 9.
What all of this means is that there is a relationship between the NURBS control points and the corresponding Bézier control points, but they are not identical except for the special case where the knot values are always repeated degree-times. The knot insertion algorithm provides a way to obtain a NURBS curve that meets this condition, and then we can use its control points in the Bézier interpolation algorithm.
So, the first step toward NURBS interpolation is to get knot insertion working.
David
> On Fri, Jun 19, 2015 at 7:30 PM, David Thompson <david.thompson at kitware.com> wrote:
> Hi Lin,
>
> I've just realized that the control points for Bézier patches will not have the same coordinates as the NURBs control points. That's because the Bézier patches interpolate their corner control points. So, we cannot just use a mapped data array to provide access to a subset of the NURBS control polygon.
>
> This site:
>
> http://www.mactech.com/articles/develop/issue_25/schneider.html
>
> describes the conversion process for curves in its "CONVERTING NURB TO BÉZIER CURVES" section. Basically, we need to implement knot insertion, which is described in Piegl's NURBS Book in Chapter 5.
>
> The adaptor class shouldn't need to change much, but it might be better not to use a vtkMappedDataArray for the NURBS adaptor since it will have to generate new control points.
>
> David
>
>
> > On Jun 19, 2015, at 7:04 PM, David Thompson <david.thompson at kitware.com> wrote:
> >
> > Hi Lin,
> >
> >> Does different patches in one vtkStructuredGrid have same order of interpolant and same number of control points?
> >
> > No, all the patches in a NURBs control polygon should have the same degree and control-point topology.
> >
> >> Each patch should have its own knot vector, so number of patches = number of knot vectors.
> >
> > Not quite. Each patch has a range of knot values. Those ranges overlap more as the degree increases.
> >
> > David
>
>
More information about the vtk-developers
mailing list