Contents

4  Geometry
    4.1  BSplines
        4.1.1  Terminology
        4.1.2  Formulae
        4.1.3  Class definition

Chapter 4
Geometry

4.1  BSplines

4.1.1  Terminology

Parametric and Sampled Curves

Parametric and sampled curves represent ordered sets of points in 2-D or 3-D space.

In the case of a parametric curve, it is possible to navigate along all its points with a path parameter defined in a continuous interval. We use C(t) to denote a point in such a curve. We call path parameter domain the values which can be assumed by the parameter t.

In the case of a sampled curve only some points are represented and they are considered as linked with straight lines. We use c[j] to denote a vertex in such curve, j being the index in a vector of sampled points.

Parametric and sampled curves may be open or closed.

One type of parametric curve is called piecewise polynomial curve. In this case each segment of the overall curve is given by two functions (or three, in 3D) which are polynomials of degree d of the path parameter t.

Ex: polynomials for a 2D cubic piecewise polynomial parametric curve:


x(t) = ax t3 + bx t2 + cx t + dx
y(t) = ay t3 + by t2 + cy t + dy

A list of real values called knots define the space for the path parameter t.

The coefficients a, b, c, d are computed from given information (ex: control points) using a specific algorithm (or model).

Splines

Splines are parametric piecewise polynomial curves defined with a model (the recipe) and control parameters (the ingredients). They can be implemented with different methods to construct different types of curves. Examples: interpolating spline curves, B-spline curves, Beta-spline curves, NURBS, etc.

B-Spline curves

We are actually interested in B-spline curves (see Figure 4.1), which are splines implemented as a linear combination of basis functions (see Figure 4.2).

We adopt the following terminology and notation:

figures/BSplineCurveA.png
figures/BSplineCurveB.png
Figure 4.1: Examples of closed cubic B-Spline curves (degree=3). Left: Curve with four control points and uniformly spaced knots. Manipulation of one control point affects the whole curve. Right: A control point is added (knots become unevenly spaced). Manipulation of one control point affects only a curve interval.

figures/BSplineBasisA.png
figures/BSplineBasisB.png
Figure 4.2: Basis functions for the curves in Figure 4.1. Left: Uniformly spaced knots. Right: Unevenly spaced knots.

4.1.2  Formulae

Introductory sources of information about B-splines are [1] and [2], which we used as we used as an intermediate step. Later we adopted [3] and [4]. The code follows the algorithm and notation as indicated in the comments. Below we shortly present the most important formulae used in its implementation.

Keep in mind the following notation:

A curve point C(t), t Î [ll,ll+1), is evaluated as follows:


x(t) = l
å
i=l-d 
Xi Bi, d+1(t)
y(t) = l
å
i=l-d 
Yi Bi, d+1(t)
(4.1)

The value of a ith basis function of order o at position t - Bi, o(t), t Î [li,li+1) - is computed with the recursive method proposed by de Boor (see equation 1.24 in [3]):


Bi, o(t)
=
t - li
li+o-1 - li
Bi, o-1(t) + li+o - t
li+o - li+1
,Bi+1, o-1(t)
(4.2)
Bi, 1(t)
=
ì
í
î
1
,    \sf if  t Î [li,li+1),
0
,    \sf if  t Ï [li,li+1).

The nth derivative of the curve at the path parameter t - t Î [ll,ll+1), is also computed with recursion (see equations 1.39 and 1.40 in [3]):


C(n)(t) = n
Õ
i=1 
(d + 1 - l) i
å
i=l-d+n 
Pi(n) Bi, d+1-n(t)
(4.3)

with


Pi(n) = ì
ï
ï
í
ï
ï
î
Pi
,    \sf if  n = 0,
Pi(n-1) - Pi-1(n-1)
ll+d+1-n - ll
,    \sf if  n > 0.
(4.4)

The value of the nth derivative of the ith basis function of order o the path parameter t, t Î [li,li+1), is derived from equation 1.25 in [3] and computed as follows:


Bi, o(n) (t)
=
(o-1) ì
í
î
Bi, o-1(n-1) (t)
li+o-1 - li
- Bi+1, o-1(n-1) (t)
li+o - li+1
ü
ý
þ
(4.5)
Bi, o(0)(t)
=
Bi, o (t)

4.1.3  Class definition

The class design for the implementation is given in Figure 4.3.

figures/BSplineClass.png
Figure 4.3: BSpline curve classes

HxBSplineBasis

Class to represent the B-Spline basis functions, which correspond to the ``model.''

Internal Representation:

HxBSplineCurve

A HxBSplineCurve results from the association of a HxBSplineBasis with a vector of control points used to instantiate it in 2-D.

Internal Representation:

This curve is called continuous because its manipulation is valid for any value of t Î [minT, maxT).

HxSampledBSplineCurve

A HxSampledBSplineCurve consists of a HxBSplineCurve and a vector of t values indicating the path positions where the continuous curve is sampled. This is meant to facilitate the manipulation of sampled curves. Potentially, the implementation of a sampled curve allows for the pre-computation of values to increase performance (e.g. curve points and basis). The current implementation does not take advantage of this.

Internal Representation:

Bibliography

[1]
T. PAVLIDIS. Algorithms for Graphics and Image Processing, chapter B-splines. Springer-Verlag, 1982.

[2]
J.D. FOLEY, A. VAN DAM, S.K. FEINER, and J.F. HUGHES. Computer Graphics - Principles and Practice, chapter Representing Curves and Surfaces, pages 471-532. Addison-Wesley, 1990.

[3]
P. DIERCKX. Curve and Surface Fitting with Splines, chapter Univariate Splines. Oxford, 1993.

[4]
L. PIEGL and W. TILLER. The NURBS book, chapter Curve and Surface fitting, pages 361-454. Springer, 1997.




File translated from TEX by TTH, version 2.89.
On 04 Feb 2003, 13:16.