[vtk-developers] Class design for spline visualizations

Lin M majcjc at gmail.com
Mon Jun 22 18:46:15 EDT 2015


I have some questions here.

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.

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.

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.

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 ?
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.

On Mon, Jun 22, 2015 at 5:31 PM, David Thompson <david.thompson at kitware.com>
wrote:

> 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
> >
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150622/30398591/attachment.html>


More information about the vtk-developers mailing list