You are on page 1of 27

30

B-Spline Theory

A spline function is a piecewise polynomial function of a single variable.


That is, it is a function dened over a partitioned domain, and the denition
within each piece of the domain is polynomial1 .
B-spline functions are a particularly convenient basis for the space of spline
functions.
This chapter surveys existing B-spline theory. It does not claim to present
anything new or original. The material is presented in a way which mirrors my own
encounters with the theory, and is stated in a notation which I nd convenient for
the later chapters.
Although the B-spline functions were known earlier, the modern work on them
was carried out rst by Schoenberg, who identied them in 2.1]2.2] and gave them
the name `B-splines' (for basic-splines) in 2.3], and then by deBoor, whose papers
are rather more accessible 2.4]2.5].
My own sources of knowledge were originally my undergraduate course for the
beam theory, and Arnold Roberts of British Aerospace, Weybridge, for the B-spline
ideas2 .
The chapter starts by describing spline functions, at rst the equal interval
cubics, but then expanding to other orders and unequal intervals.
It then applies the function theory rst to curves, and then to surfaces and
volumes.
Finally, a summary section identies the specic points on which later arguments
are built.

1 This denition introduces two ideas new to one who previously expected a function to have a
single equation. The rst idea is that the function might be dened only over part of the real line
(a partial function), and the other that there might be discontinuities either of the function itself
or of some derivative. While professional mathematicians might smile at such naivete, it is only
about 150 years since such ideas were accepted.
2 It is a great pity that Arnold published so little of his own novel approach. He always gave
the impression at the time that he was just passing on standard results. One found out only later
that many were his own inventions.

B-Spline Theory

2.1

31

Equal Interval Cubic Spline Functions

A cubic spline is a spline in which the individual pieces are cubic polynomials.
These are extremely widely used in CAD/CAM systems and graphics packages as
a way of providing a smooth curve through a number of empirical points. This
popularity stems from an earlier way of achieving the same function used in the
design of ships.
In the mould lofts, above the actual fabrication shops, the plan of an entire
ship was drawn out to full scale using Descriptive Geometry techniques 2.6], in the
form of the cross sections parallel to the coordinate planes. The curves did not have
equations, and much of the work involved making the curves smooth.
The technique used was to take long pieces of wood (pliable enough to follow
the bend required in a curve, but sti enough not to accept kinks), and push them
into the overall form required with lead weights.
These pieces of wood were called splines, and the name has been transferred to
the mathematical techniques which have replaced them. (The leaden weights were
called ducks, but the mathematics has found no use for this term. The modern
term is knot, which no self respecting loftsman would allow in his splines.)
Simple beam theory shows that where such a piece of wood is bent only through
vanishingly small angles, its shape must consist of a cubic between each weight and
the next, and that adjacent cubics must join with continuity of second derivative.
This approach assumes that the spline is of constant cross-section (often, but not
always true), that weights act at innitesimal points, and that the friction between
the spline and the oor prevents lateral motion under a duck, but not twisting.
Under these assumptions the equations of equilibrium tell us that the shear force
across the spline at any point between two ducks must be constant, though it can
change from span to span, and that the bending moment varies linearly between
ducks and must be continuous. Simple beam theory then shows that the curvature
at any point is proportional to the bending moment, and the actual sideways displacement is given by twice integrating the second derivative, which for small angles
of bend is closely approximated by the curvature.
A more sophisticated variant, which did not make the small angles assumption,
was the basis of the Mehlum's AUTOKON system 2.7], which was extremely widely
used in shipyards throughout the world during the 1960's and 1970's.
Exactly the same results can be demonstrated by use of Calculus of Variations
to minimise the bending energy, the integral of the square of the curvature.

B-Spline Theory

32

Actually calculating the shape of the curve interpolating a given set of duck
points can take any of four approaches.
The rst approach is the `method of three moments', taught in my undergraduate course (Cambridge University Mechanical Sciences Tripos, c 1960) in which the
values of the bending moment in the spline under each duck were taken as unknowns.
The equations of continuity of rst derivative at the ducks formed a linear system,
which was then solved to give the moments, from which all the other parameters
were determined.
The second views the spline as a dierentiation operator. When I developed
the Numerical Master Geometry (NMG) surface modelling system 2.8] at British
Aerospace Ltd. in the late 1960's, I chose to use as unknowns the rst derivatives and
use continuity of second derivative to give the equations. This had the advantage
that it was possible to replace one of the continuity equations by a constraint setting
the rst derivative to a required value.
We used equal interval splines, in which the ducks were deemed to be equally
spaced. (The abscissa was in fact a parameter rather than one of the coordinates,
but the basic theory is easier to describe without that complication.)
The linear system turned out to be
2
2
66 1
66
66
66
4

1
4 1
1 4 1
:::
1 4 1
1 4 1
1 2

32 3 2
y1
;3 3
7
6
7
6
;3 0
y
7
6
6
27
7
6
7
6
;3
7
6
7
6
7
6
7
6
=
y
7
6
i 77 66
7
6
7
6
54 7
5 6
4
yn
0
0

3
0

3
:::
;3 0
3
;3 0 3
;3 3

32 3
y1
7
6
7
66 y2 7
7
7
7
7
6
7
7
6
yi 77
7
6
7
6 7
7
56
4 7
5
yn

(2:1)
where the yi are the given ordinates, and the yi are the derivatives to be determined.
The solution of these equations is very fast. Because of the triband structure,
the computing time required grows only proportionally to the number of points
interpolated.
Once the rst derivatives at the knots are known, each span has four pieces of
information, enough to determine whatever coecients are required to represent an
entire cubic piece.
This approach leads to viewing the spline algorithm as a dierentiation operator.
de Boor, in 2.9] describes the use of this approach in a surface description system
almost identical to that which I built independently some 5-6 years later.
0

B-Spline Theory

33

Cardinal (Interpolating) Spline Functions


It is of theoretical interest that the equations above can be solved for a series of
y-vectors, each containing a single unit value and all other values zero.
This gives a set of functions each of which takes unit value at `its own' data
abscissa and zero values at the others. These are called the cardinal splines.
A linear combination of these functions with coecients ai is a spline function
which takes the values ai at the data points. It is thus mathematically trivial to get
from the required ordinates to the function which interpolates them.
However, this is irrelevant in practice because the computational complexity of
setting up the cardinal functions grows as the square of the number of points to be
interpolated. To avoid this would require a very large database of cardinal solutions
to be stored.
What is of interest is that the cardinal splines have a form which reects the eect
of a small perturbation of a data point. They show clearly that the rippling eect
of such a perturbation, while never quite disappearing, damps out very quickly3 .

Figure 2.1 Cardinal cubic spline basis function

B-Spline Functions
If one is not trying to interpolate given points exactly, but rather to nd a curve
close in the least squares sense to dense data, the solution methods described above
are not so obviously available, and the cardinal splines, which could be used in a
classic least squares t, still have the problem of being global functions.
Far better are functions whose support is of minimum width.

3 This should be contrasted with the behaviour of the high order Lagrange polynomials over
equally spaced data points, where the ripples grow signicantly away from a perturbed data value.

B-Spline Theory

34

If we superimpose the cardinal splines of three adjacent points, with weights 1,


4 and 1, the ripples cancel out completely, except over a small interval of four spans.

Figure 2.2 Cubic B-spline basis function


Use of these composite functions in place of the cardinal functions gives much
faster computation, because most of the functions are zero at any given data point,
and so the formulation of the system matrix is faster. The solution is also faster,
because two basis functions four or more spans apart have no coupling, and so the
system matrix has only a narrow band instead of being full.
These composite functions are cubic B-splines.
The curve itself can be recovered from the composite function amplitudes as
easily as from the cardinal functions. Both the values and the rst derivatives at
the knots are just the sum of terms derived from three adjacent B-splines.
Once these nite width functions were identied, it became obvious that there
is a fourth method of interpolation. (The rst three were the method of three
moments, the solution of the continuity of curvature equations, and the summation
of cardinal splines.)
Just determine by collocation the B-spline amplitudes which give the required
values at each of the data abscissae, and then recover the derivatives as before.
This leads to the equation
2 3 2
y
;3 3
66 y1 77 66 ;3 0
66 2 77 66
;3
66 y 77 = 66
66 i 77 66
4 5 4
yn
0
0

3
0

3
:::
;3 0
3
;3 0 3
;3 3

32
2
7
6
1
7
6
7
6
7
6
7
6
7
6
7
6
7
56
4

1
4 1
1 4 1
:::
1 4 1
1 4 1
1 2

3
7
7
7
7
7
7
7
7
5

12

6
6
4

7
7
5

y1
6
y2 77
6
6
7
6
7
6
7
6 yi 7

yn
(2:2)
which is subtly dierent from the earlier equation(2.1), although the matrices involved are the same. It gives, of course, the same values for the yi.
0

B-Spline Theory

2.2

35

Other Order B-Spline Functions

Odd Order B-Spline Functions


Using calculus of variations to minimize the integral of the square of higher
derivatives gives solutions consisting of piecewise polynomials of higher odd order
with continuity of order one less.
Thus minimising the square of the third derivative gives a piecewise quintic, with
pieces joining with continuity of the rst four derivatives: minimising the square of
the fourth derivative gives a piecewise 7th order function with pieces meeting with
continuity of the rst 6 derivatives, and so on.
Using lower derivatives in the integral gives solutions consisting of piecewise
polynomials of lower order, again with continuity order one less than the polynomial
order. I am not aware that anybody noticed this until the whole B-spline picture
had been developed4 .
For each odd polynomial order, n, it is possible to construct a B-spline basis
consisting of polynomial functions of order n,
meeting with continuity of all derivatives less than the nth,
non-zero only within an interval of n + 1 spans,
and positive in the non-zero range.

Even Order B-Spline Functions


Such a construction can be made equally easily for even values of n, thus opening
the possibility of a piecewise quadratic slope-continuous function. Much of the work
in later chapters of this dissertation focusses on the use of quadratic B-spline basis
functions.

Figure 2.3 Quadratic B-spline basis function

4 These are just the piecewise linear functions, so familiar that they did not need to be explained
by making them members of a more general family.

B-Spline Theory

36

The novelty in the even order B-splines is that such a basis function takes its
maximum value half way between the points where pieces join. Trying to interpolate
given data by quadratics joining at the data points is doomed to failure because of
ill-conditioning. B-spline theory suggested putting the breaks between the data
points, and solved that problem.

2.3

Unequal Interval B-Spline Functions

At this stage it is appropriate to provide a general theory of B-splines, covering


all orders and the case of unequally spaced knots.

Denition
A B-spline basis function of order n is a piecewise polynomial whose pieces
are dened over the spans between abscissa values called knots. Each piece is a

polynomial of order n. The pieces meet with continuity of all derivatives below
the nth and with (possible) discontinuities of the nth derivative. The function is
identically zero outside a range of n + 1 spans, and positive within its non-zero
domain.
When B-splines are used for CAD purposes, it is important that the complete set
of basis functions sum to unity identically. This provides a normalisation criterion.
The knots need not be equally spaced, and the sequence of abscissa values in
ascending order is termed the knot vector.

Construction
Consider the B-spline of order n, Bn (t), over a particular (n+1)-span part of
the knot vector t0 : : : tn+1 ]. We assume for the moment that ti+1 > ti for all i in
f0 : : : ng, though in a later section we shall see that the strict inequality can be
loosened to include equality.
Let Bn(j) (t) denote the j th derivative of Bn (t).

Bn(0)(t) = Bn(t)
Bn(j+1) (t) = dtd Bn(j) (t)
Zt
(j 1)
Bn (t) =
Bn(j) (y)dy
;

;1

(2:3)
(2:4)
(2:5)

Extend the notation by setting

Bn( 1)(t) =
;

Zt
;1

Bn(0)(y)dy =

Zt
;1

Bn(y)dy

(2:6)

The lower limit of integration may, of course be replaced by t0 throughout.

B-Spline Theory

37

Because a spline of order n is a sequence of polynomials of order n, meeting with


continuity of all derivatives up to n ; 1 inclusive, at the knots, the nth derivative is
piecewise constant, and the n + 1th derivative takes the form of a sequence of delta
functions, centred at the knots, each multiplied by a value equal to the amount of
discontinuity in nth derivative.
This conguration of delta functions is loosely called a comb, for fairly obvious
reasons.
We can therefore express the spline as the n + 1th integral of the weighted sum
of these delta functions. This is in turn equal to the weighted sum of the integrals
of the delta functions. The n + 1th integral of a unit delta function is 1=(n + 1)!
times the truncated power


xn+ = x0nxx>00
(2:7)
In the notes that follow we shall ignore the (n + 1)! factor, in order to keep the
algebra simpler.
The B-spline is dened to be a spline function of minimum support. i.e. It is
zero except over a minimal nite piece of the real line.
Consider a B-spline whose support starts at the knot t0, and suppose that its
support extends up to the knot tm.
There are m + 1 non-zero discontinuities of n + 1th derivative. Call these values
i  i = 0 m.
To the right of tm the function Bn (t) is identically zero, and in that region t > tm
all the truncated powers are just normal powers, so we have the equation
m
X
i=0

i (t ; ti )n = 0

(2:8)

This can be expanded as a polynomial in t, and the coecients of all the terms
must be equal to zero.
Hence, expressing the sum over i as matrix multiplication
2
1 
66 ..
66 t.j   
66 .0
4 ..
tn0   

1
...
tji
...
tni





1 3 2 0 3 2 0 3
... 77 66 .. 77 6 .. 7
6.7
.
tjm 777 666 i 777 = 666 0 777
... 75 64 .. 75 4 ... 5
.
0
tnm m

(2:9)

B-Spline Theory

38

This has the trivial solution i = 0 i = 0 m and to avoid this we note that we
are looking for a function with a non-zero integral. We add a row
h

tn0 +1



tni +1



tnm+1  ] = tm ; t0

(2:10)

which essentially controls the integral of Bn(t) to have a positive value.


The resulting system is of full rank provided that all the ti are distinct. Therefore
the i are underdetermined when m > n +1 and exactly determined when m = n +1.
For m < n + 1 it is in general impossible to nd i satisfying all the equations.
Note: that if m = n + 2 any solution can be expressed as a weighted sum of just
two independent solutions, and we can take these two to be the functions whose
supports are 0 : : : m ; 1 and 1 : : : m respectively. This result will be applied in the
later sections on hodographs and knot insertion.
Solution of the system when m = n + 1 gives the i explicitly in terms of the
dierences between the ts, and thence the exact form of the B-spline for a given
knot-set may be determined by integration.
The general case solution has

i = (tm ; t0)=j=i (ti ; tj )


6

2.4

(2:11)

B-spline Curves

The discussion so far has been of B-spline functions. These are used in CAD/CAM
to support representations of curves and surfaces.
In the CAD/CAM context, because we want to be able to rotate objects without
changing their shape, or the form of their representation, we do not use explicit
curves y = f (x), but parametric curves where all three of the coordinates x, y
and z are functions of a parameter t. We usually use the letters t or u to denote the
parameter, just as by convention we use x, y and z to denote space coordinates, or
the letters near P to denote 3-vectors containing those coordinates as components.
A B-spline curve is one in which x, y and z are spline functions of our parameter t, expressed in the B-spline basis over a common knot vector5 .

5 In fact, in the industry-standard NURBS (Non Uniform Rational B-Spline) format, the `Rational' means that the coordinates x, y and z are ratios of spline functions with a common
denominator, the denominator and the three numerators all sharing a common knot vector. This
complication is quite unnecessary in the context of this dissertation.

B-Spline Theory

39

A B-spline curve is typically dened by rst specifying a knot vector. A sequence


of control points are then used as coecients of the B-spline functions over that
knot vector. The x, y and z components of each control point provide the coecients
of the corresponding B-spline basis function in the representations of x(t), y(t) and
z(t).

P (t) =

PiBn i (t)

(2:12)

where the notation Bn i (t) denotes the B-spline basis function of order n whose
non-zero domain is from ti < t < ti+n+1 , and the subscripts indicate position in the
knot-vector6 .
The coecients Pi are known as the control points. They form a sequence
which is known as the control polygon, which is often visualised by joining them
in sequence by straight lines. This set of straight lines is in fact the B-spline curve
of order 1 dened by that set of control points.
Properties important in CAD/CAM are that the curve crosses any given plane
no more often than the control polygon, and that any point on the curve may be
viewed as a weighted mean (whose weights are the values of the non-zero basis
functions) of a subsequence of the control polygon. Because the weights are positive
and sum to unity, the point must lie within the convex hull of the control points in
that subsequence.

Hodograph
The hodograph is the derivative of a parametric curve. This is of geometric
importance because the derivative of a parametric curve is a vector tangent to the
curve. We can study the curve derivative by looking at the derivatives of the basis
functions.

d X P B (t) = X P dBn i
i dt
dt i i n i
i

(2:13)

The typical B-spline function consists of polynomial pieces of order n, meeting


with continuity of all derivatives up to but not including the nth, and non-zero only
in a region n + 1 spans wide.

6 Strictly speaking, the basis functions also depend on the values in the knot vector, but making
this explicit complicates the notation too much. In what follows, therefore, the knot vector will
be implicit. Until we come to consider adaptivity, the equal interval knot vector, where the knots
are just consecutive integers, will be quite sucient.

B-Spline Theory

40

Its derivative must consist of pieces of order n ; 1, meeting at the same knots
as the original curve, with continuity of all derivatives up to the n ; 1th, and must
therefore (as was noted two pages ago) be describable as a weighted sum of two
B-splines of order n ; 1.

dBn i(t) =  B (t) +  B


(2:14)
i n 1i
i n 1 i+1 (t)
dt
We can determine the values of i and i by noting that the values of the delta
functions (the comb values) must be the same for the original function and for the
left hand derivative function. Let j be the amplitudes of the delta functions for
Bn i at ti+j , and j the amplitudes for Bn 1 i at ti+j .
;

0 = n (t1 ; t )
k=1 k 0

(2:15)

0 =

(2:16)

nk=11(tk ; t0)
;

Hence  = 1=(tn ; t0 )
This appears asymmetric until it is noted that (tn ; t0 ) is the width of the left
hand derivative B-spline, Bn 1 i (t)
By symmetry  = ;1=(tn+1 ; t1 )
We can substitute this result into the previous equation (2.14)
;

dBn i (t) =  B (t) ;  B


i n 1i
i n 1 i+1 (t)
dt
= Bn 1 i (t) ; Bn 1 i+1 (t)
x ;x
x ;x
;

n+1

(2:17)

Substituting again into equation (2.13),

d X P B (t) = X P dBn i
i dt
dt i i n i
i

!
X
B
B
n
1 i (t)
n
1 i+1 (t)
= Pi
xi+n ; xi ; xi+n+1 ; xi+1
i
;

(2:18)

B-Spline Theory

41

Grouping the left and right hand terms of the right hand side together by second
subscript, we get
=P0 Bn 1 0 (t)
t n ; t0
N
X
+ (Pi ; Pi 1 ) Bn 1 i (t)
(2:19)
ti+n ; ti
i=1
Bn 1 N +1 (t)
; PN
tN +1 ; tN +1 n
where N is the number of spans in the curve.
However, the rst and last terms of this series are identically zero because the
B-spline of order n ; 1 dened over the n coincident knots at the beginning or end
of the curve is identically zero everywhere of interest.
;

=
where

Pi Bn

1i

(t)

Pi
Pi = Pti+1 ;
;t
i+n

(2:20)
(2:21)

Multiple Knots
If we take the limit as two knots approach each other, all the values of i in
equation (2.11) except the approaching ones have well dened nite limits. The two
increase without bound, but one becoming more positive, the other more negative,
the algebraic sum having a nite, well dened limit.
Thus the rst integral of the comb has, in the limit, a delta function at the
double knot, and the second integral a step discontinuity.
The actual shape of the basis functions stays well-dened. All that happens in
the limit is that the order of continuity falls by one when two knots are coincident.
If three knots are coincident, the order of continuity falls by two, and so on. Only
when n + 1 knots coincide do we nd that the functions themselves lose continuity.
This is regarded as a useful way of controlling the shape of a curve being designed, to be able to introduce deliberately any required discontinuities of some
derivative. At the ends of a piece of curve, it is now the preferred method of casting
on and o neatly to have n + 1 coincident knots.

B-Spline Theory

42

Knot Insertion
Suppose that we have a spline curve described in terms of its B-spline amplitudes

P (t ) =

PiBn i (t)

(2:22)

This function has discontinuities of some derivative at the knots, but not in
between. However, we can imagine that there is an additional knot, at which the
discontinuity just happens to be zero. The question then appears, How are the
control points of the curve, viewed as having the extended knot vector, related to
those of the original ?
The following situations are of importance:{ the addition of a single knot.
{ the addition of extra knots, coincident with the original knots.
{ the addition of extra knots, coincident with the original end knots.
{ the addition of extra knots, one per span, between the original knots, thus
providing the curve with a regularly subdivided knot vector.
Single Knot Insertion
Suppose that we have a knot vector and B-splines over it, but wish to determine
the B-splines over a knot vector with an additional knot.
When the additional knot is inserted, the support of each original basis function
which includes the knot (those which do not are entirely unaected) becomes m + 1
spans instead of m. It can therefore be expressed in terms of the B-splines over the
new knot set, as a linear combination of exactly two of the rened functions.
Bin(t) = B in(t) +  B in+1 (t)
(2:23)
The coecients  and  in the linear combination are given by the need for the
sum of the two terms to equal the old basis function, and by the need for the s at
the new knot to cancel out.
In this case it is easiest to use the explicit solution, noting that the initial
discontinuity of (n + 1)th derivative is not impacted by  .

0 = (tm ; t0)=m1 (tj ; t0) = 1=m1 1(tj ; t0 )


;

0 = (tm

;1
; t0 )=((t ; t0 )m
(tj ; t0 ))
1

(2:24)
(2:25)

B-Spline Theory

43

Hence

 = (t ; t0)=(tm 1 ; t0 )
 = (t ; tm)=(tm ; t1 )
;

(2:26)

Figure 2.4 Knot insertion


This gives the basis functions after a knot has been inserted, but again, the
important result here is not the eect of knot insertion on the basis functions, but
its eect on the curve built from those basis functions.
The insertion of a knot increases the number of functions in the basis by 1, and
therefore increases the number of control points by 1.
The set of m control points whose basis functions overlap the new knot are
replaced by a set of m + 1, each of which is a linear combination of two adjacent
original control points. In other words, new control points are computed on the
sides of the original control polygon, as linear combination of the original control
points.
X

P (t) = PiBin (t)


X
X
= Pii B in(t) + Pii B in+1(t)
X
= (Pi + i 1 Pi 1)B in
X
= ((t ; ti)Pi=(tm+i 1 ; ti ) + (tm+i
;

(2:27)

 in
; t)Pi;1 =(tm+i;1 ; ti )) B

B-Spline Theory

44

Multiple Knots
Although most of the theory so far has depended on the knots being distinct,
all the results have well-behaved limits as knots accumulate.
If we insert knot after knot at the same point, the eect on the control polygon
is to do repeated construction of chords, chopping o the corners. This causes the
control polygon to converge towards the curve.
When the number of knots at a single place reaches n, the control polygon
becomes tangent to the curve at the point corresponding to the parameter value of
the multiple knot.

Figure 2.5 Multiple knots


When the number of knots at a single place reaches n + 1, we lose all continuity,
and the curve has a set of control points to the left and a set to the right, each set
inuencing only its own half of the curve.
If every knot is given multiplicity n +1, the curve breaks into independent pieces,
each with its own set of n + 1 control points.

B-Spline Theory

45

End Conditions
At the ends of a B-spline it is not clear from the B-spline denition itself, what
to do. If we just truncate the sequence of basis functions included in the equation,
while leaving all the knots distinct, then there are regions at the ends of the domain
where the sum of the basis functions tapers down to zero.
The usual x for this is to dene the valid domain as being the region where
the sum is unity. We then nd that the end control point is not coincident with the
end of the curve, making design harder than it should be.
The best solution is to use (n + 1)fold multiplicity at the ends of the domain.
e.g., there will be four coincident knots at each end of a piecewise cubic spline. The
`taper region' is then totally enclosed in the interval between the rst and the last
of the coincident knots, causing no trouble, and the eect of the multiplicity is to
force the end of the curve to the control point of the rst basis function to extend
into the interior of the domain.
Because a Bezier curve has two ends with exactly this condition, and no interior
knots, this end condition is called the pseudo-Bezier condition.

Figure 2.6 End Conditions


This gure should be compared with gure 2.5.
Regular Subdivision
In the situation where an equal interval B-spline is to have extra knots inserted
in all the spans, to make a denser equal interval B-spline, the construction turns out
to be very simple.
Consider a spline curve of order n. The nth derivatives are piecewise constant,
and in the equal interval case the value in each span is given by the nth dierence
of the control points, divided by the nth power of the interval.
Inserting knots does not alter the curve, and so does not alter the nth derivatives.
Suppose that we divide each interval into k pieces.
Then for the k intervals in one original interval the new nth dierences must be
all the same, and all equal to 1=kn times the original dierences.

B-Spline Theory

46

This gives a simple and fast algorithm for this specic case of knot insertion.
1) Tabulate the nth dierences of the control points
2) Divide all the values by kn
3) Set out a new table of nth dierences by repeating each original k times
4) Complete the new dierence table upwards by summing the known dierences.
Table 2.1 shows an example, using a cubic B-spline and dividing each segment
into four. Scalar control points are used, since each axis is treated independently in
the vector case.
The rst column contains the control point values: the next three are the differences, up to third dierences: the fth column contains the same numbers as
the fourth, but divided by 43. In the sixth column the values from the fth are
replicated out 4 times each, and the remaining columns hold the anti-dierences.
The last column results in control point values for the control polygon over the
subdivided knot vector.
Figures 2.7 and 2.8 show the same curve with the two control polygons.

Figure 2.7 Before regular subdivision

Figure 2.8 After regular subdivision

B-Spline Theory

47

dierencing
1 2 3

=4

0
0
0
0
64
0
0
0
0
0

0
0
0
64
-64
0
0
0
0

0
1
-3
3
-1
0
0

0
0
64
-128
64
0
0
0

0
64
-192
192
-64
0
0

summation
rep 2 1 0

0
0
0
0
0
0
0
0
0
0
1
0
1
0
1
1
2
1
1
3
3
4
1
6
4
10
-3
10
1
20
-3
11
-2
31
-3
9
-5
40
-3
4
-8
44
3
-4
-5
40
3
-9
-2
31
3
-11
1
20
3
-10
4
10
-1
-6
3
4
-1
-3
2
1
-1
-1
1
0
-1
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Table 2.1 Regular subdivision of an equal interval B-spline
This approach is particularly suitable for the quick rendering of B-spline curves,
since as the density of knots increases, the control polygon converges towards the
curve itself.
Because the error between the polygon and the curve depends on the nth dierences, there is a reasonable measure of the density of subdivision required available
in the evaluated dierences.

B-Spline Theory

48

Note that if the 2nd dierences are large, while the third are small, this is an
indication that the curve pieces are all quadratic, and it may be rendered more
accurately by going to a shallower depth in the dierence tables.
Numerically, the subtraction, division and addition process is not stable using
oating point arithmetic. However, if the initial control values are rst rounded to
an appropriate integer grid, and the division is postponed to after the summation
process, there is no cumulative loss of accuracy. The price to be paid for this is
that the dynamic range available (the size of the possible initial control values in
integer grid units) is a lot less than the maximum integer size of the host computer.
However, for graphics purposes, where the dynamic range is of the order of about a
thousand, and the integer word size is of the order of a thousand million, this is an
easy price to pay.
Note the use of leading zero values to set up the constants of integration. Clearly
the rendering only starts when the real data is reached in the summation process.
The trailing zeroes are just included to show that the process must close.
Basis Function Splitting
For FE purposes, there is an additional process, close to but not the same as knot
insertion. This is the splitting of a single basis function into two, by the insertion
of a knot in this basis function only. All the other functions in the basis are to be
left unchanged.
a

Figure 2.9 Knot insertion into a single basis function

B-Spline Theory

49

The equation used is just (2.26), but it is applied to only one basis function.
Because the sum of the two new functions is exactly the previous, replaced function,
the control points for the two new ones are both exactly the same as the original
control point.
Figure 9(b) shows that the basis can be rotated to use functions which are the
sum and dierence of the two new functions. The sum is the original function which
was split: the dierence is a new basis function which adds a dimension to the basis
leaving the original basis spanning a subspace.
This is not of great import in the CAD/CAM context, but will be used in a
later chapter of this dissertation.

2.5

B-Spline Surfaces and Volumes

The full surface analogue of the curve equation is

P (u v) =

Pi i (u v)

(2:28)

where the functions form a basis, but are now bivariate, over the two independent
parameters u and v.
Similarly, the volume analogue (not used in CAD/CAM) is

P (u v) =

Pi i (u v w)

(2:29)

It turns out to be rather hard to form a general theory, because the range of
possible functions has much less structure than the univariate case.
The rst, limited method was to take the tensor product of univariate bases.
This is currently the industry standard in commercial CAD/CAM systems 2.8]2.9].
Those of us who found this excessively rigid looked for other structures. Both
Frederickson 2.10] and Sabin 2.11] independently found a structure on a threedirection grid with a family of piecewise bipolynomial functions whose order, order
of continuity and planform (the analogue in 2D of width in 1D) were tightly related.
These were afterwards called box splines.
We afterwards learnt about a beautiful piece of geometric intuition, attributed
to Schoenberg by de Boor in 2.4], who described there the multivariate version of
a univariate geometric construction pointed out in Curry and Schoenberg 2.12],
though presaged by Sommerfeld 2.13]. This gives a theory spanning both of these
special cases, and predicting a much larger family with rather desirable properties.
This is the theory of multivariate B-splines.

B-Spline Theory

50

Tensor Products
Let k (u v) = Bn ik (u)Bm jk (v), where i and j are row and column numbers of
an array counted through by k.
The surface P (u v) = Pi Pj Pij i(u) j (v) has a topologically rectangular array
of control points.
It is straightforward to show that
X

k (u v) =

XX

i j

i(u) j (v)

=1

(2:30)

and that each k (u v) is non-zero only over a bounded region of the u v plane and
positive where it is not zero.

Figure 2.10 Biquadratic tensor product B-spline basis function7

Box Splines
Consider a regular three-direction triangular grid. Take the function which takes
a unit value in one triangle, and zero elsewhere. The convolution operator in one of
the three grid directions is dened as being the integral of the dierence of a function
and the image of that function shifted through one grid step in that direction.
Apply the convolution operator three times, once in each direction, to the basic
function. The result is a piecewise cubic because there have been three integrations.
It is continuous in value and rst derivative across all the grid lines, because in each
of the three directions, two of the integrations have been across it.
7

This basis function should be compared with those in gures 1.1, 1.2 and 1.3

B-Spline Theory

51

If we start from a pyramid function, with unit value at one vertex of the grid,
dropping linearly to zero at the sides of the hexagon around that vertex, the triple
convolution gives a quartic function with continuity of second derivative.
Clearly applying the triple convolution more than once gives higher order functions of larger planform and higher order continuity. It is also possible to 'mix and
match' to get functions of dierent continuity orders in dierent directions.

Figure 2.11 Box-spline basis function


The box-spline ideas also generalise to functions over regular grids with diagonal
knot-lines as well as lines of constant u and v (as illustrated in gure 2.11), and even
to the trivariate case. Peters2.14] has used these to describe blending surfaces of
the form f (P ) = 0.

Multivariate B-Splines
Consider a body in m + n-dimensional space, which is the outer product of a
simplex in m dimensions with a region of interest in n dimensions. Partition it into
m + n-dimensional simplexes.
At any point of the n-dimensional subspace, each partitioning simplex has a
conjugate cross-sectional `area', which is a function of that point. These `areas' are
piecewise polynomial functions, zero outside the `shadow' of the corresponding simplex, and positive in the non-zero region. Provided that the partitioning nowhere
makes a partitioning hypersurface or hyperedge map into a set of less than dimensionality n, the pieces are of order m, and meet with continuity of all derivatives up
to but not including the mth .
Because the sum of the cross-sectional areas must be the total cross-sectional
area of the m-dimensional simplex, the functions sum to unity identically.
The neatness of this theory is best demonstrated by examples.

B-Spline Theory

52

m = 2 n = 1
The solid is a triangular bar, partitioned into tetrahedra.
The n-dimensional subspace is a straight line, and the functions are the quadratic
B-splines, whose knots are the projections of the vertices of the partitioning tetrahedra.
II

m = 1 n = 2
The solid is a slab of unit thickness.
The n-dimensional subspace is a plane, and the functions are either three-sided
pyramids or four-sided pyramids with linearly sloping sides.
III

m = M + N n = 2
The edges of the partitioning simplexes are grouped into m-dimensional boxes.
M of the hyperplanes bounding these boxes project into lines u = const and N into
lines v = const, thus forming a regular rectangular grid in n-space.
The functions are just the tensor product B-splines described above.
IV

m = M n = 2
The partitioning simplexes are grouped into M + n-dimensional boxes, which
are projected along their diagonal direction into n-space. The functions are the
box-splines described above.
Thus a single elegant theory gives all these examples.
Since its rst publication by deBoor 2.4], this approach has been studied by
Dahmen and Micchelli 2.15,2.16], by Gmelig Meyling 2.17,2.18], by Neamtu 2.19]
and by Seidel 2.20]. Grandine tried to use these functions for Finite Elements, but
found that the cost of element formulation was prohibitive 2.22,2.23,2.24]. A pity.

B-Spline Theory

2.6

53

Non-polynomial Splines

If a weighted sum of bending energy and tension energy is minimised by calculus


of variations, a curve is produced which has not polynomial but exponential basis
functions. This is called a spline in tension. See Cline 2.25] and Schweikert 2.26].
In the parametric cubic case, tinkering with the coecients of the matrix equations, so that the discontinuity of second derivative is not zero, but collinear with
the rst derivative vector, can produce similar operational eects.
My own ideas in this direction 2.27] were completed by Manning 2.28], and
similar ideas were developed independently by Neilson 2.29] as
-splines. Barsky
popularised this approach under the name  -splines, and de Rose produced a full
theory of general order.
Manning also proposed the use of cos4 ( x=4) as a basis function. This has operational properties which are so uncannily like the cubic B-spline that no advantages
ensue except that it ts a circle exactly when the data points are 90 degrees apart.
The quadratic B-spline can be approached by inventing a span consisting of two
quadratic pieces, slope continuous at their junction. This has the same number of
freedoms as a single cubic span, and so it can be used to form an interpolating spline
in exactly the same way as the cubic. Here, however, the condition of continuity of
curvature forces the second half of one span to be the same quadratic as the rst
half of the next, thus reducing to the quadratic interpolating spline with data points
interleaving the knots.
The same principle has been applied using two circular arcs within a span, to
give a bi-arc spline consisting entirely of circular arcs.

2.7

Summary

A B-spline function of order n is a piecewise polynomial whose pieces are of


order n, which meet continuity of all derivatives up to the (n ; 2)th, and which is
identically zero outside a range of n + 1 pieces.
These may be constructed for all orders, the quadratic being particularly relevant for the purposes of this dissertation.
Bivariate and trivariate basis functions may be built using the tensor product
construction.
The knot vector for a given curve may have additional knots inserted, either for
all basis functions or for individual ones, while leaving the curve itself geometrically
unchanged.
Local cardinality can be achieved by knot insertion

B-Spline Theory

54

References
2.1] Schoenberg,I.J.
Contributions to the problem of approximation of equidistant data by analytic
functions. Part A.| on the problem of smoothing or graduation. A rst class
of analytic approximation formulae
Q. Appl Math. vol 4 pp45-99 (1946)
2.2] Schoenberg,I.J.
Contributions to the problem of approximation of equidistant data by analytic
functions. Part B.| on the problem of osculatory interpolation. A second class
of analytic approximation formulae.
Q. Appl Math. vol 4 pp112-141 (1946)
2.3] Schoenberg,I.J.
On spline functions
pp255-291 in Inequalities I (ed O.Shisha) Academic Press (1967)
2.4] deBoor,C.
Splines as linear combinations of B-splines. A survey
pp1-47 in Approximation Theory II (ed I.J.Schoenberg) Academic Press (1969)
2.5] deBoor,C.
On calculating with B-splines
J Approx. Theory vol 6 pp50-62 (1972)
2.6] Robertson,R.G.
Descriptive geometry
Pitman (1966)
2.7] Mehlum,E. and Sorensen,P.
Example of an existing system in the ship-building industry: the Autokon system
Proc Roy Soc Lond A vol 321 pp219-234 (1971)
2.8] Sabin,M.A.
Example of an existing system in the aircraft industry: the BAC Numerical
Master Geometry system
Proc Roy Soc Lond A vol 321 pp197-206 (1971)
2.9] deBoor,C.
Bicubic spline interpolation
J.Maths and Physics vol 41 pp212-218 (1962)
2.10] Frederickson,P.O.
Triangular spline interpolation
Mathematics report 6-70 Dept of Mathematics, Lakehead university (1970)
2.11] Sabin,M.A.
The use of piecewise forms for the numerical representation of shape
Tanulmanyok 60/1977 ISBN 963-311-035-1 (1977)

B-Spline Theory

55

2.12] Curry,H.B. and Schoenberg,I.J.


On Polya frequency functions IV: The fundamental spline functions and their
limits
J d'Analyse Math. vol 17 pp71-107 (1967)
2.13] Sommerfeld,A
Eine besondere anschauliche Ableitung des Gaussischen Fehlergesetzes
pp848-859 in Festschrift Ludwig Boltzmann gewidmet zum Sechzigsten geburtstag (ed S.Meyer) Barth (1904)
2.14] Peters,J.
C2 surfaces built from zero sets of the 7-direction box spline
pp 463-474 in Mathematics of Surfaces VI (ed Mullineux) Clarendon Press ISBN
0-19-851198-1 (1996)
2.15] Dahmen,W. and Micchelli,C.
Recent progress in multivariate splines
RR9969 (# 44209) IBM Research Report (April 1983)
2.16] Dahmen,W., Gmelig Meyling,R. and Ursem,J.
Scattered data interpolation by bivariate C1 piecewise quadratic functions
Memorandum 638, Universiteit Twente, Faculty of Appl. Math, July 1987
2.17] Gmelig Meyling,R.H.J.
Approximation by cubic C1 -splines on arbitrary triangulations
Numerische Math, vol 51 pp65-85 (1987)
2.18] Puger,P.R. and Gmelig Meyling,R.H.J.
An algorithm for smooth interpolation to scattered data in R2
pp469-480 in Mathematical Methods in CAGD (ed T.Lyche and L.Schumaker)
Academic Press ISBN 0-12-460515 (1989)
2.19] Neamtu,M.
Multivariate splines
PhD Thesis University of Twente, ISBN 90-9004534-1 (1991)
2.20] Seidel,H.P and Vermeulen,A.H.
Simplex splines support surprisingly strong symmetric structures and subdivision
pp443{455 in Curves and Surfaces II (ed P.Laurent, A.Le Mehaute and L.Schumaker)
Academic Press 1991
2.21] Dahmen,W., Micchelli,C.A. and Seidel,H-P.
Blossoming begets B-spline bases built better by B-patches
Maths of Computation vol 59 pp97{115 (1992)
2.22] Grandine,T.A.
Private verbal communication
1988

B-Spline Theory

56

2.23] Grandine,T.A.
The evaluation of inner products of multivariate simplex splines
SIAM J Numer Anal vol 24 (1987) pp 882-886
2.24] Grandine,T.A.
Computational cost of simplex spline functions
SIAM J Numer Anal vol 24 (1987) pp 887-890
2.25] Cline,A.K.
Scalar- and planar-valued curve tting using splines under tension
CACM vol 17 pp218-223 (1974)
2.26] Schweikert,D.G.
An interpolation curve using a spline in tension
J Math Phys vol 45 pp312-317 (1966)
2.27] Sabin,M.A.
Parametric splines in tension
VTO/MS/160 British Aircraft Corporation (1970)
2.28] Manning,J.R.
Continuity conditions for spline curves.
Computer Journal vol 17 pp181-186 (1974)
2.29] Nielson,G.
Some piecewise polynomial alternatives to splines under tension
pp209{235 in Computer Aided Geometric Design (ed R.Barnhill and R.Riesenfeld)
Academic Press. 1974 ISBN 0-12-079050-5

You might also like