//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

**◇****Assignment 1**

**◇****Assignment 2**

**◇****Assignment 3**

## 2.
The B-spline function

## 3.
An Example for Deriving the
B-spline Function

**◇****Assignment 4**

## 4.
Rational Curves

**◇****Assignment 5**

**◇****Assignment 6**

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.

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 **P*** _{i}* is given by

_{} _{} (1)

where ** _{} are the B-spline
functions suggested by Cox and de Boor in 1972.**
First, the parameter

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 **P*** _{i}*.
The third property indicates that each segment of a B-spline curve is
influenced by only

Figure 1. Local control of B-spline curves.

Assume a set of 4
two-dimensional control points **P*** _{i}* in the

_{}

Use the same affine transformation to transform **P*** _{i}*
to get

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

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

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.

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.

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.

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

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

**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 *h*_{0}=*h*_{2}=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.

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