B Spline vs Bezier curves
In CAGD applications, a curve may have a so complicated shape that it cannot
be represented by a single Bézier cubic curve since the shape of a cubic
curve is not rich enough. Increasing the degree of a Bézier curve adds
flexibility to the curve for shape design. However, this will significantly
increase processing effort for curve evaluation and manipulation. Furthermore,
a Bézier curve of high degree may cause numerical noise in computation.
For these reasons, we often split the curve such that each subdivided segment
can be represented by a lower degree Bézier curve. This technique is known
as piecewise representation. A curve that is made of several Bézier
curves is called a composite Bézier curve or a Bézier spline
curve. In some area (e.g., computer data exchange), a composite Bézier
cubic curve is known as the PolyBézier. If a composite Bézier
curve of degree n has m Bézier curves, then the composite Bézier curve
has in total m×n+1 control vertices.
A curve with complex shape may be represented by a composite Bézier curve
formed by joining a number of Bézier curves with some constraints at the
joints. The default constraint is that the curves are jointed smoothly. This
in turn requires the continuity of the first-order derivative at the joint,
which is known as the first-order parametric continuity. We may relax
the constraint to require only the continuity of the tangent directions at the
joint, which is known as the first-order geometric continuity. Increasing
the order of continuity usually improves the smoothness of a composite Bézier
curve. Although a composite Bézier curve may be used to describe a complex
shape in CAGD applications, there are primarily two disadvantages associated
the use of the composite Bézier curve:
- It is considerably involved to join Bézier curves with some order
of derivatives continuity.
- For the reason that will become clear later, a composite Bézier curve
requires more control vertices than a B-spline curve.
These disadvantages can be eliminated by working with spline curves.
Originally, a spline curve was a draughtsman's aid. It was a thin elastic wooden
or metal strip that was used to draw curves through certain fixed points (called
nodes). The resulting curve minimizes the internal strain energy in the splines
and hence is considered to be smooth. The mathematical equivalent is the cubic
polynomial spline. However, conventional polynomial splines are not popular
in CAD systems since they are not intuitive for iterative shape design. B-splines
(sometimes, interpreted as basis splines) were investigated by a number
of researchers in the 1940s. But B-splines did not gain popularity in industry
until de Boor and Cox published their work in the early 1970s. Their recurrence
formula to derive B-splines is still the most useful tool for computer implementation.
It is beyond the scope of this section to discuss different ways of deriving
B-splines and their generic properties. Instead, we shall take you directly
to the definition of a B-spline curve and then explain to you the mathematics
of B-splines. Given M control vertices (or de Boor points) di
(i = 0,1,¼,M-1), a B-spline curve of order k (or degree
n = k-1) is defined as
| r(u) = |
M-1
å
i = 0
|
di Ni,k(u), |
|
where, Ni,k(u) are polynomials of degree n and known as B-splines
of order k. Analogous to Bézier curves, Ni,k(u) are also called
the B-spline basis functions. In most practical applications, the B-spline
basis functions are derived from the following knot vector (or knot
sequence):
| u0 = u1 = ¼ = un, uk £ ¼ £ uj £ ¼ £ uM-1, uM = uM+1 = ¼ = uM+n |
|
where, ui are called knots. The reason to select the first and
last k knots to be equal is that the control vertices d0
and dM-1 are the points on the curve. Furthermore, the tangent
direction of the curve at d0 is from d0 to
d1 and the tangent direction at dM-1 is from
dM-2 to dM-1. Due to these properties, the
shape of a B-spline curve resembles the shape of its control polygon formed by
the control vertices di, although such resemblance is not as
intuitive as that of a Bézier curve. In the literature, the M-k knots uk,
uk+1, ¼, uM-1 are sometimes called
the interior knots. If the interior knots are all distinct, then the B-spline
curve has M-k non-vanishing spans (i.e., the arc length of each span is not zero).
As we said previously, there are several methods to derive the B-spline basis
functions Ni,k(u) in terms of the knot vector. We present only the
recursive formula derived by de Boor and Cox as follows:
| Ni,k(u) = |
u-ui
ui+k-1-ui
|
Ni,k-1(t)+ |
ui-u
ui+k-ui+1
|
Ni+1,k-1(u), |
|
with
These basis functions have the following properties:
- The basis functions sum to 1, i.e., åi = 0M-1Ni,k(u) = 1. This means that, similar
to a Bézier curve, a B-spline curve lies also within the convex hull.
- Ni,k(u) > 0 for ui < u < ui+k
and, elsewhere, Ni,k(u) = 0. This is known as the local support
property of B-splines. In other words, a change of the control vertex
di affects the B-spline curve locally only for ui
< u < ui+k.
- If the interior knots are distinctive, Ni,k(u) has continuity
of order k-2. This implies that a B-spline curve has parametric continuity
of order k-2 across all the spans.