//Logo Image
Last updated: Yeh-Liang Hsu (2010-10-19).
Note: This is the course material for “ME550 Geometric modeling and computer graphics,” Yuan Ze University. Part of this material is adapted from CAD/CAM Theory and Practice, by Ibrahim Zeid, McGraw-Hill, 1991. This material is be used strictly for teaching and learning of this course.

B-spline curves

1.    Properties of the B-spline curve

B-spline curves are powerful generalization of Bezier curves. They provide local control of the curve shape as opposed to global control by using a special set of blending functions that provide local influence. They also provide the ability to add control points without increasing the degree of the curve.

B-spline curves have the ability to interpolate or approximate a set of given data points. Interpolation is useful in displaying design or engineering results such as stress or displacement distribution in a part while approximation is good to design free-form curves. Interpolation is also useful if the designer has measured data points in hand that must lie on the resulting curve.

Assignment 1

Use your CAD software to draw several B-spline curves. Use the same control points to draw both approximation curves and interpolation curves. Report your observations.

The theory of B-spline curves separates the degree of the resulting curve from the number of the given control points. The B-spline curve defined by n+1 control points Pi is given by

                                                                    (1)

where  are the B-spline functions suggested by Cox and de Boor in 1972. First, the parameter k controls the degree (k-1) of the resulting B-spline curve and is usually independent of the number of control points. The B-spline functions have the following properties:

Partition of unity:

Positivity:

Local support:  if

Continuity:  is (k-2) times continuously differentiable

The first property ensures that the relationship between the curve and its defining control points is invariant under affine transformations. The second property guarantees that the curve segment lies completely within the convex hull of Pi. The third property indicates that each segment of a B-spline curve is influenced by only  control points or each control point affects only  curve segments, as shown in Figure 1. It is useful to notice that the Bernstein polynomial,  has the same first two properties mentioned above.

Figure 1. Local control of B-spline curves.

Assignment 2

Assume a set of 4 two-dimensional control points Pi in the x-y plane, the B-spline curve defined by this set of control points is . Assume the following affine transformation discussed in Chapter 1 to transform P(u) to get :

       

Use the same affine transformation to transform Pi to get , and the B-spline curve defined by this set of control points is . Show that = using “partition of unity” discussed above. This also ensures that the relationship between the curve and its defining control points is invariant under affine transformations.

This is a hard question. You do not have to “prove” it for general cases. You just have to assume a set of control points and coefficients for the affine transformation, and “show” that this is true for the numbers you assumed.

Assignment 3

Use your CAD software to draw curves similar to those in Figure 1. Indicate the local control of the curves.

2.    The B-spline function

The B-spline function also has the property of recursion, which is defined as

                                         (2)

where

                                                                                (3)

The  are called parametric knots or knot values. For an open curve,

                                                                            (4)

where

                                                                                                  (5)

and the range of u is

                                                                                             (6)

Relation (5) shows that (n+k+1) knots are needed to create a (k-1) degree curve defined by (n+1) control points.

                                                                                                   (7)

This relation shows that a minimum of two, three, and four control points are required to define a linear, quadratic, and cubic B-spline curve respectively. A cubic B-spline is sufficient for a large number of applications. Figure 2 shows the shapes of the B-spline functions.

Figure 2. B-spline functions.

3.    An Example for Deriving the B-spline Function

To understand the recursive nature of the B-spline function, the B-spline function for a cubic spline curve defined by 4 control points is derived. This cubic spline has  and  Eight knots are needed to calculate the B-spline functions. Equation (4) gives the knot vector

 as

The range of u (Equation (6)) is  Equation (1) gives

                                     (8)

To calculate the above B-spline functions, use Equation (2) and (3) together with the knot vector as follows:

Substituting  into Equation (8) gives

 

Substituting  into this equation gives the curve equation as

 

This equation is the same as the one for the Bezier curve with the same control points. Thus the cubic B-spline curve defined by four control points is identical to the cubic Bezier curve defined by the same points. This fact can be generalized for a (k-1)-degree curve defined by k control points.

Assignment 4

Derive the B-spline functions for k=2, n=1, and k=3, n=2. Do it once in your lifetime. Derive the B-spline functions for k=4, n=4, and shows its local control capability.

The gap between the neighboring knot values define in Equation (4) is always uniform, with the value of 1. These knots are called uniform knots and a B-spline curve based on uniform knots is called a uniform B-spline curve. As we modify the shape of a curve, we often add or delete knot values and so produce non-uniform gaps between the knots, which result in non-uniform B-spline curves. Non-uniform B-splines are considered the general form of B-spline curves. Thus most CAD systems provide the capability of creating and modifying non-uniform B-splne.

4.    Rational Curves

A rational curve is defined by the algebraic ratio of two polynomials while a nonrational curve is defined by one polynomial. In a rational curve, the control points  are given in homogeneous coordinates . Thus the coordinates of a point on a rational curve in the homogeneous space,  is obtained from

                                                                                 (9)

                                                                                 (10)

                                                                                  (11)

                                                                                              (12)

Thus a rational B-spline curve can be expressed as

                                                                   (13)

where  are the rational B-spline basis functions and are given by

                                                                                (14)

The above equation shows that  are a generalization of the nonrational basis functions If we substitute  in the equation,  The rational basis functions  have nearly all the analytic and geometric characteristics of their nonrational B-spline counterparts.

Assignment 5

Show that the rational B-spline basis functions  have the following properties: partition of unity and positivity.

The main difference between rational and nonrational B-spline curves is the ability to use  at each control point to control the behavior of the rational B-splines. Note that ’s do not have to be integers. The greater the value of a particular , the closer the curve is pulled toward the control point .

Rational splines provide an exact representation for quadric curves (conics), such as circles and ellipses. Nonrational splines, which are polynomials, can only approximate conics. This allows graphics packages to model all curve shapes with one representation, rational splines, without needing a library of curve functions to handle different design shapes.

For example, using three control points , ,  and their homogeneous coordinates h0=h2=1, , we can define a circular arc as follows:

                                         (15)

And                

                                                                   (16)

Then we can easily show that , that is,  is an exact circular arc.

Assignment 6

Write a program in Matlab to draw a full circle using Equations (15) and (16). Show your Matlab program too.