CS184 Lecture 22 summary

B-Spline Curves

B-Splines are another kind of approximating curve/surface. They are the most common kind of spline in use today. A B-spline curve has a similar form to a Bezier curve, namely:

P(u) = Sk pk Bk,d(u)

where k ranges from 0 to n. But Bezier curves have some undesirable properties. First, their degree can become quite high. Secondly, they are not locally controllable. The functions Bk,d(u) are non-zero on the entire parameter range 0 to 1. That means that a change in a control point changes the curve shape over the whole range of u.

Its easiest to think about B-splines in terms of the blending functions Bk,d(u). Ideally, the kth blending function would fall to zero outside some parameter range, so that the influence of the kth control point is localized to that range. Also, we would hope that the degree of the blending function would not be too high. Finally, we would like the blending functions to have the property that:

Sk Bk,d(u) = 1

as before. That will guarantee that the curve is confined to the convex hull of the control points (in fact the subset of the control points whose blending functions are non-zero somewhere in that range).

These conditions cannot be satisfied with polynomial blending functions Bk,d(u) (e.g. if a polynomial is zero over an interval, it must be zero everywhere). But they can be satisfied using piecewise polynomial blending functions.

First, we divide the parameter range into intervals by defining a knot vector (u0,...,un+d). This vector divides the range of u values into intervals (uk, uk+1). Within an interval, all the blending functions Bk,d(u) are fixed polynomials. The blending functions have a simple recursive definition (Cox-deBoor):

Bk,1(u) = 1 for u in [uk, uk+1], 0 otherwise.

Bk,d(u) = Bk,d-1(u) (u - uk)/(uk+d-1 - uk) + Bk+1,d-1(u) (uk+d - u)/(uk+d - uk+1)

From these definitions it follows that:

Bk,d(u) has degree d-1

Bk,d(u) is non-zero over the interval [uk, uk+d]

Bk,d(u) is Cd-2 continuous, and so is the B-spline curve built from these functions.

These functions do have the property that

Sk Bk,d(u) = 1

for u in the range ud-1 to un+1. Outside of that range, the total weight tapers off. This is the effective domain of a B-spline.

For u values in the range [uk,uk+1] only d of the blending functions Bk,d(u) will be non-zero. So this part of the curve lies in the convex hull of d control points pk-d+1,..., pk.

Uniform, Periodic B-splines

If the knot vector has uniform spacing, i.e. if uk+1 - uk = Du, then the blending functions are particularly simple. For any given d, all the blending functions are translates of each other. That is:

Bk,d(u) = Bk+1,d(u + Du) = Bk+2,d(u + 2Du) ....

Note that the curve does not pass through the first and last control points. Indeed, since the working domain is [ud-1,  un+1], the curve doesnt normally get near those control points.

On the other hand, if we want to start the curve at a particular point p, we can set the first d-1 control points to be equal to p. That will guarantee that the curve starts at p, and then moves in a straight line to the next control point pd-1.

That also guarantees that the geometric tangent of the curve at its endpoint is known, namely pd-1 - pd-2.

Non-uniform B-splines

Non-uniform splines are generated when the knot vector (u0,...,un+d) is not uniformly spaced. Non-uniform splines have more complicated blending functions than uniform splines, but there is more control over the spline shape by spacing the knot points.

Note that changing the knot points does not affect the position of control points. You can think of it instead as changing the parametric "speed" of the curve as it pass through a control point. Therefore, changing knot points can provide a kind of a tension parameter that affects how sharply or loosely the curve turns.

Rational B-splines

Rational B-splines have the form:

P(u) = Sk wk pk Bk,d(u) / Sk wk Bk,d(u)

where wk is a set of weights on the control points, and k ranges from 0,...,n. If all the weights are 1, the rational spline reduces to a B-spline because the denominator sums to 1.

Rational Splines have several important properties. The first is that they can exactly represent conic curves such as circles and ellipses etc which are rational but not polynomial.

Secondly, they are closed under perspective projection. i.e. the perspective projection of a rational spline is another rational spline.

Finally, rational splines are very convenient to represent in homogeneous coordinates. Since all the denominators are the same, they can be defined as the 4th coordinate of a homogeneous vector with polynomial components. So we write the curve in components like this:

X(u) = Sk wk xk Bk,d(u)
Y(u) =
Sk wk yk Bk,d(u)
Z(u) =
Sk wk zk Bk,d(u)
W(u) =
Sk wk Bk,d(u)

where the control points are pk = (xk, yk, zk), and the curve points are P(u) = (X(u), Y(u), Z(u), W(u)) in homogeneous coordinates, or (X(u)/W(u), Y(u)/W(u), Z(u)/W(u)) in 3D coordinates.

Put another way, you can think of rational B-splines as 3D perspective projections of normal (polynomial) B-splines in 4D, where the control points are chosen to be (wkxk, wkyk, wkzk, wk).

The weights provide extra flexibility in defining shape. Increasingly a weight will make the curve pass closer to that control point. Most often, non-uniform knot spacing is allowed. These non-uniform, rational B-splines are usually abbreviated to NURBs.

B-Spline Surfaces

A B-Spline surface is defined analogously to a Bezier surface. It looks like:

P(u,v) = Sj Sk pj,k Bj,d(v) Bk,d(u)

Once again we have a matrix of control points. The control points and P(u, v) can either be 3-vectors for a normal B-Spline surface, or 4-vectors for a rational B-Spline surface.

In each case, the boundary of the surface, which is where u or v attains its maximum or minimum value, will be a B-Spline or a rational B-Spline curve.