You are on page 1of 94

# B-spline and NURBS Curves

Marko uleji c
Universitt Salzburg
FB Computerwissenschaften
A5020 Salzburg, Austria
8. Juli 2011
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back
c Marko uleji c: Geometric Modelling 1
B-spline and NURBS Curves
Introduction
Basis functions
B-spline curves
The de Boor algorithm
Knot insertion
Periodic B-spline
B-spline surface
NURBS
Conic sections
Further topics
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 2
Recommended literature
Les A. Piegl and Wayne Tiller. The Nurbs Book. Springer, 1997.
N. M. Patrikalakis, T. Maekawa. Shape Interrogation for Computer Aided Design
and Manufacturing. Springer, 2002
H. Prautzsch, W. Boehm, M. Paluszny. Bzier and B-spline techniques. Springer,
2002.
Saxena, Anupam / Sahay, Birenda. Computer Aided Engineering Design.
Springer, 2005
Michael Mortenson. Geometric Modeling, 2nd Edition. John Wiley & Sons, 1997.
Carl de Boor. A Practical Guide to Splines. Springer, 1994.
R. H. Bartels, J. C. Beatty, B. A. Barsky. An Introduction to Splines for Use in
Computer Graphics and Geometric Modeling. Morgan Kaufmann, 1995.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 3
Introduction
Mathematical splines were rst mentioned in the 1946 paper by Isaac Jacob
Schoeneberg.
The term spline was used for wooden strips in the shipbuilding industry, passed
through given constrained points called ducks.
Curves/surfaces consisting of just one segment have several drawbacks:
To satisfy all given constraints, often a high polynomial degree is required
The number of control points is directly related to the degree
Interactive shape design is inaccurate or requires high computational costs
The solution is to use a sequence of polynomial or rational curves to form one con-
tinuous curve (spline).
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 4
Introduction
e.g. problems with Bzier curves:
P0
P1
P2
P3
P4
P5
P6
Control points
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 5
Introduction
e.g. problems with Bzier curves:
P0
P1
P2
P3
P4
P5
P6
Two joined cubic Bzier curves
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 6
Introduction
e.g. problems with Bzier curves:
P0
P1
P2
P3
P4
P5
P6
Control polygon with collinear points P
2
, P
3
, P
4
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 7
Introduction
e.g. problems with Bzier curves:
P0
P1
P2
P3
P4
P5
P6
Change of P
3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 8
Introduction
e.g. problems with Bzier curves:
P0
P1
P2
P3
P4
P5
P6
Change of Bzier curve degree
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 9
Introduction
e.g. problems with Bzier curves:
P0
P1
P2
P3
P4
P5
P6
Change of P
3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 10
Introduction
e.g. problems with Bzier curves:
P0
P1
P2
P3
P4
P5
P6
Cubic B-spline curve
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 11
Introduction
e.g. problems with Bzier curves:
P0
P1
P2
P3
P4
P5
P6
Change of P
3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 12
Introduction
Curvature continuity is an important requirement in many applications.
Joining two Bzier curves with C
2
continuity is cumbersome.
All B-spline (basis spline) curves have inherently C
2
continuity.
B-splines do not necessarily interpolate the endpoints like Bzier curves.
clamped
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 13
Introduction
Curvature continuity is an important requirement in many applications.
Joining two Bzier curves with C
2
continuity is cumbersome.
All B-spline (basis spline) curves have inherently C
2
continuity.
B-splines do not necessarily interpolate the endpoints like Bzier curves.
unclamped
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 14
Introduction
Denition 1 (spline)
A curve s(t) consisting of m n
th
-degree polynomial segments is called a spline of
degree n with the parameter values t
0
, ..., t
m
and t
i
t
i+1
and t
i
<t
i+n+1
for all
possible i.
We refer to a spline of degree n as a spline of order n+1.
The parameter values {t
i
} are called breakpoints.
We denote the polynomial segments by s
i
(t) and 1 i m.
These segments join with some level of continuity at their breakpoints.
The s
i
(t) can be any regular polynomial function:
f (x) = a
n
x
n
+a
n1
x
n1
+ +a
2
x
2
+a
1
x +a
0
for all arguments x, where n is a non-negative integer
and a
0
, a
1
, a
2
, ..., a
n
are constant coefcients.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 15
Introduction
t
0
t
1
t
2
t
3
t
4
t
5
= t
m
s(t)
s
1
(t)
s
2
(t)
s
3
(t)
s
4
(t)
s
5
(t)
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 16
Introduction
We want a curve denition of the form:
C(t) =
m

i=0
f
i
(t)P
i
P
i
are the the control points
f
i
(t) are piecewise polynomial functions
For a xed breakpoint sequence {t
i
} with 0 i m the f
i
are forming a basis for the
vector space of all piecewise polynomial functions.
The degree and the continuity are determined by these basis functions.
The control points can be freely modied without changing the continuity of the curve.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 17
B-spline Basis Functions
We dene the B-spline basis functions by the recurrence formula due to de Boor, Cox
and Manseld:
Denition 2 (B-spline basis function)
Let a vector known as the knot vector be dened T = (t
0
, ..., t
m
) where T is a
nondecreasing sequence of real numbers with t
i
t
i+1
and i = 0, ..., m1.
The t
i
are called knots. The i
th
B-spline basis function of n
th
-degree is dened by
N
i,0
(t) =
_
1 if t
i
t <t
i+1
0 otherwise
N
i,n
(t) =
t t
i
t
i+n
t
i
N
i,n1
(t) +
t
i+n+1
t
t
i+n+1
t
i+1
N
i+1,n1
(t)
For n > 0 the N
i,n
(t) are a linear combination of two (n1) degree basis functions.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 18
B-spline Basis Functions
N
0,0
N
1,0
N
2,0
N
3,0
N
4,0
N
0,1
N
1,1
N
2,1
N
3,1
N
0,2
N
1,2
N
2,2
N
0,3
N
1,3
Triangular table of recursive B-spline basis functions
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 19
B-spline Basis Functions
N
0,0
N
1,0
N
2,0
N
3,0
N
4,0
N
0,1
N
1,1
N
2,1
N
3,1
N
0,2
N
1,2
N
2,2
N
0,3
N
1,3
Triangular table of recursive B-spline basis functions
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 20
B-spline Basis Functions
N
0,0
N
1,0
N
2,0
N
3,0
N
4,0
N
0,1
N
1,1
N
2,1
N
3,1
N
0,2
N
1,2
N
2,2
N
0,3
N
1,3
[t
0
, t
1
)
[t
1
, t
2
)
[t
2
, t
3
)
[t
3
, t
4
)
[t
4
, t
5
)
Triangular table of recursive B-spline basis functions
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 21
B-spline Basis Functions
Properties of B-spline basis functions:
Non-negativity:
N
i,n
(t) 0, for all i, n, t
Local support:
N
i,n
(t) = 0, if t / [t
i
, t
i+n+1
)
Partition of unity:
i

j=in
N
j,n
(t) = 1, for all t [t
i
, t
i+1
)
Derivative: (Cox-de Boor formula)
d
d t
N
i,n
(t) =
n
t
i+n
t
i
N
i,n1
(t)
n
t
i+n+1
t
i+1
N
i+1,n1
(t)
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 22
B-spline Basis Functions
0.2 0.4 0.6 0.8 1.0
0.2
0.4
0.6
0.8
1.0
Plot of basis functions with degrees 0, 1, 2, 3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 23
B-spline Basis Functions
Let knot vector T = (0, 0, 0, 0,
1
3
,
2
3
, 1, 1, 1, 1) and basis function degree n = 0:
0.2 0.4 0.6 0.8 1.0
0.2
0.4
0.6
0.8
1.0
Plot of basis functions N
3,0
, N
4,0
, N
5,0
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 24
B-spline Basis Functions
Let knot vector T = (0, 0, 0, 0,
1
3
,
2
3
, 1, 1, 1, 1) and basis function degree n = 1:
0.2 0.4 0.6 0.8 1.0
0.2
0.4
0.6
0.8
1.0
Plot of basis functions N
2,1
, N
3,1
, N
4,1
, N
5,1
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 25
B-spline Basis Functions
Let knot vector T = (0, 0, 0, 0,
1
3
,
2
3
, 1, 1, 1, 1) and basis function degree n = 2:
0.2 0.4 0.6 0.8 1.0
0.2
0.4
0.6
0.8
1.0
Plot of basis functions N
1,2
, N
2,2
, N
3,2
, N
4,2
, N
5,2
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 26
B-spline Basis Functions
Let knot vector T = (0, 0, 0, 0,
1
3
,
2
3
, 1, 1, 1, 1) and basis function degree n = 3:
0.2 0.4 0.6 0.8 1.0
0.2
0.4
0.6
0.8
1.0
Plot of basis functions N
0,3
, N
1,3
, N
2,3
, N
3,3
, N
4,3
, N
5,3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 27
B-spline Basis Functions
Let knot vector T = (0,
1
9
,
2
9
,
3
9
,
4
9
,
5
9
,
6
9
,
7
9
,
8
9
, 1) and basis function degree n = 3:
0.2 0.4 0.6 0.8 1.0
0.1
0.2
0.3
0.4
0.5
0.6
Plot of basis functions N
0,3
, N
1,3
, N
2,3
, N
3,3
, N
4,3
, N
5,3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 28
B-spline Basis Functions
Let knot vector T = (0,
1
9
,
1
9
,
1
9
,
1
3
,
1
3
,
2
3
, 1, 1, 1) and basis function degree n = 3:
0.2 0.4 0.6 0.8 1.0
0.2
0.4
0.6
0.8
1.0
Plot of basis functions N
0,3
, N
1,3
, N
2,3
, N
3,3
, N
4,3
, N
5,3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 29
B-spline Basis Functions
The multiplicity of a knot is the number of times a knot value is repeated.
Let T = (a, . . . , a
. .
n+1
, t
n+1
, . . . , t
ln1
. .
kn interior knots
, b, . . . , b
. .
n+1
) be a knot vector,
with n as a xed curve degree of the basis functions, l +1 the number of knots,
where end knots a and b are repeated with multiplicity n+1:
The knot vector T is called uniform, if all interior knots are equally spaced and
there exists r R with r =t
i+1
t
i
, for all n i l n1 .
Otherwise T is called nonuniform.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 30
B-Spline Curves
Denition 3 ((nonuniform) B-spline curve)
A n
th
-degree B-spline curve (of order n+1) is dened by
C(t) =
k

i=0
N
i,n
(t) P
i
, with t [a, b]
The P
i
are k +1 control points. They are also called de Boor points.
The N
i,n
(t) are the n
th
-degree B-spline basis functions dened over the
non-periodic and nonuniform knot vector
T = (a, . . . , a
. .
n+1
, t
n+1
, . . . , t
ln1
. .
kn
, b, . . . , b
. .
n+1
)
with l +1 knot elements with l = n+k +1.
The knot vector T is commonly normalized to cover the interval [0, 1].
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 31
Knot Vector Generation
Suppose we have k +1 control points P
i
and degree n.
We need l +1 knots, where l = k +n+1.
If the curve is clamped, we get t
0
=t
1
= . . . =t
n
= 0 and t
ln
=t
ln+1
= . . . =t
l
= 1.
The remaining k n knots can be uniformly spaced or chosen individually.
For uniformly spaced internal knots the interval [0, 1] is divided into
k n1 subintervals. Therefore the knots are
t
0
=t
1
= . . . =t
n
= 0
t
j+n
=
j
k n1
for j = 1, 2, . . . , k n
t
ln
=t
ln+1
= . . . =t
l
= 1
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 32
Knot Vector Generation Example
We have 7 control points P
0
, . . . , P
6
(k = 6) and want a clamped curve of degree
n = 3 (cubic). So we have in total l +1 = k +n+2 = 6+3+2 = 11 knots
with 3 internal knots ( j = 1, 2, 3), then T = (0, 0, 0, 0
. .
n+1=4
,
1
4
,
2
4
,
3
4
, 1, 1, 1, 1
. .
n+1=4
).
For P
0
, . . . , P
6
={
_
0
0
_
,
_
0.2
2
_
,
_
2
3
_
,
_
3
2
_
,
_
3
0
_
,
_
5
0
_
,
_
7
1
_
} we get:
P0
P1
P2
P3
P4 P5
P6
Clamped, cubic and C
2
continuous B-spline curve
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 33
B-Spline Curves
Properties of B-spline curves:
Continuity:
A B-spline curve of order k has in general C
k2
continuity.
Knot Continuity:
Increasing the multiplicity m of a knot reduces the continuity
of the curve to C
km1
at that knot.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 34
Knot Vector Example
Let T = (0, 0, 0, 0,
1
4
,
1
4
..
m=2
,
3
4
, 1, 1, 1, 1). Now we have C
1
continuity at knot value 1/4.
For P
0
, . . . , P
6
={
_
0
0
_
,
_
0.2
2
_
,
_
2
3
_
,
_
3
2
_
,
_
3
0
_
,
_
5
0
_
,
_
7
1
_
} we get:
P0
P1
P2
P3
P4 P5
P6
B-spline with C
1
continuous knot
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 35
Knot Vector Example
Or let T = (0, 0, 0, 0,
1
4
,
1
4
,
1
4
. .
m=3
, 1, 1, 1, 1). Now we have C
0
continuity at knot value 1/4.
For P
0
, . . . , P
6
={
_
0
0
_
,
_
0.2
2
_
,
_
2
3
_
,
_
3
2
_
,
_
3
0
_
,
_
5
0
_
,
_
7
1
_
} we get:
P0
P1
P2
P3
P4 P5
P6
B-spline with C
0
continuous knot
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 36
B-Spline Curves
Properties of B-spline curves:
Continuity:
A B-spline curve of order k has in general C
k2
continuity.
Knot Continuity:
Increasing the multiplicity m of a knot reduces the continuity
of the curve to C
km1
at that knot.
Strong convex hull:
The curve is contained in the convex hull of its control polygon,
and each curve section lies within the control polygon of the control points
that affect this section, i.e. if t [t
i
, t
i+1
) and n i < mn1, than C(t)
is in the convex hull of control points P
in
, . . . , P
i
.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 37
Convex Hull Property
P0
P1
P2
P3
P4 P5
P6
Convex hull of the control points / control polygon
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 38
Convex Hull Property
P0
P1
P2
P3
P4 P5
P6
First knot span contained in the convex hull of P
0
, . . . , P
3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 39
Convex Hull Property
P0
P1
P2
P3
P4 P5
P6
Second knot span contained in the convex hull of P
1
, . . . , P
4
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 40
Convex Hull Property
P0
P1
P2
P3
P4 P5
P6
Third knot span contained in the convex hull of P
2
, . . . , P
5
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 41
Convex Hull Property
P0
P1
P2
P3
P4 P5
P6
Fourth knot span contained in the convex hull of P
3
, . . . , P
6
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 42
Convex Hull Property
P0
P1
P2
P3
P4 P5
P6
Union of convex hulls yields tighter curve boundary
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 43
B-Spline Curves
Properties of B-spline curves :
Endpoint interpolation:
If C(0) = P
0
and C(1) = P
k
, than the curve interpolates between
the endpoints P
0
and P
k
.
Geometry invariance:
The shape of the B-spline curve is invariant under all afne
transformations (translation, rotation, shear, scaling).
B-spline to Bzier:
A B-spline curve where the number of control points and the
curve degree n equals, and T = ( 0, . . . , 0
. .
n
, 1, . . . , 1
. .
n
),
degenerates into a Bzier curve.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 44
B-spline to Bzier Example
Let P
0
, . . . , P
4
be ve control points and the curve degree should be n = 5.
For T = (0, 0, 0, 0, 0, 1, 1, 1, 1, 1) we get:
P0
P1
P2
P3
P4
A quartic B-spline curve on T, i.e. a quartic Bzier curve
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 45
B-Spline Curves
Properties of B-spline curves :
Local support:
From the local support property of the B-spline basis functions follows
that moving control point P
i
changes C(t) only in the interval [t
i
, t
i+n+1
).
Also a single curve section is controlled by n+1 control points.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 46
The de Boor Algorithm
Fast and numerically stable algorithm for evaluating or splitting a B-spline curve C(t)
at a specic parameter value t.
It is a generalization of the de Casteljau algorithm used for Bzier curves.
The de Boor algorithm is dened as follows:
C(t) =
k+j

i=0
N
i,nj
(t) P
j
i
for j = 0, 1, . . . , n
where
P
j
i
= (1
j
i
) P
j1
i1
+
j
i
P
j1
i
for j > 0
with

j
i
=
t t
i
t
i+n+1
t
i
and P
0
j
= P
j
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 47
De Boor Example
P
0
P
1
P
2
P
3
Control points P
0
, . . . , P
3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 48
De Boor Example
P
0
P
1
P
2
P
3
Control polygon
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 49
De Boor Example
P
0
0
P
0
1
P
0
2
P
0
3
We apply the rule P
0
j
= P
j
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 50
De Boor Example
P
0
0
P
0
1
P
0
2
P
0
3
The resulting B-spline curve
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 51
De Boor Example
Lets say we want to calculate the value of P
1
1
.
We get P
1
1
= (1
1
1
) P
0
0
+
1
1
P
0
1
We see the point P
1
1
must lie between the point P
0
0
and P
0
1
and
is calculated recursively.
That observation leads to a similar triangular calculation table as we saw
from the de Casteljau algorithm.
As we will see, the de Boor algorithm can be used for subdividing a spline curve.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 52
De Boor Example
P
0
0
P
0
1
P
0
2
P
0
3
P
1
1
P
1
2
P
1
3
P
2
2
P
2
3
P
3
3
Recursive triangular table
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 53
De Boor Example
P
0
0
P
0
1
P
0
2
P
0
3
P
1
1
P
1
2
P
1
3
P
2
2
P
2
3
P
3
3
Recursive triangular table
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 54
De Boor Example
P
0
0
P
1
1
P
0
1
P
1
2
P
0
2
P
1
3
P
0
3
The new calculated points P
1
1
, P
1
2
, P
1
3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 55
De Boor Example
P
0
0
P
1
1
P
0
1
P
1
2
P
0
2
P
1
3
P
0
3
The new calculated points P
1
1
, P
1
2
, P
1
3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 56
De Boor Example
P
0
0
P
0
1
P
0
2
P
0
3
P
1
1
P
1
2
P
1
3
P
2
2
P
2
3
P
3
3
Recursive triangular table
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 57
De Boor Example
P
0
0
P
1
1
P
0
1
P
1
2
P
0
2
P
1
3
P
0
3
P
2
2
P
2
3
The new calculated points P
2
2
, P
2
3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 58
De Boor Example
P
0
0
P
1
1
P
0
1
P
1
2
P
0
2
P
1
3
P
0
3
P
2
2
P
2
3
The new calculated points P
2
2
, P
2
3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 59
De Boor Example
P
0
0
P
0
1
P
0
2
P
0
3
P
1
1
P
1
2
P
1
3
P
2
2
P
2
3
P
3
3
Recursive triangular table
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 60
De Boor Example
P
0
0
P
1
1
P
0
1
P
1
2
P
0
2
P
1
3
P
0
3
P
2
2
P
2
3
P
3
3
The new calculated point P
3
3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 61
De Boor Example - Subdivision
The new calculated point P
3
3
splits the B-spline curve into two new segments of same
degree. We get two new control polygons P
0
0
, P
1
1
, P
2
2
, P
3
3
and P
3
3
, P
2
3
, P
1
3
, P
0
3
.
P
0
0
P
1
1
P
0
1
P
1
2
P
0
2
P
1
3
P
0
3
P
2
2
P
2
3
P
3
3
Subdivision by P
3
3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 62
De Boor Example - Subdivision
The new calculated point P
3
3
splits the B-spline curve into two new segments of same
degree. We get two new control polygons P
0
0
, P
1
1
, P
2
2
, P
3
3
and P
3
3
, P
2
3
, P
1
3
, P
0
3
.
P
0
0
P
1
1
P
0
1
P
1
2
P
0
2
P
1
3
P
0
3
P
2
2
P
2
3
P
3
3
Convex hull of P
0
0
, P
1
1
, P
2
2
, P
3
3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 63
De Boor Example - Subdivision
The new calculated point P
3
3
splits the B-spline curve into two new segments of same
degree. We get two new control polygons P
0
0
, P
1
1
, P
2
2
, P
3
3
and P
3
3
, P
2
3
, P
1
3
, P
0
3
.
P
0
0
P
1
1
P
0
1
P
1
2
P
0
2
P
1
3
P
0
3
P
2
2
P
2
3
P
3
3
Convex hull of P
3
3
, P
2
3
, P
1
3
, P
0
3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 64
De Boor Example - Subdivision
P
0
0
P
0
1
P
0
2
P
0
3
P
1
1
P
1
2
P
1
3
P
2
2
P
2
3
P
3
3
Subdivision on the triangular table
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 65
Knot Insertion
Knot insertion allows adding an additional knot into a B-spline curve without changing
the curves shape. The existing basis of the curve
k

i=0
N
i,n
(t) P
i
with T = (t
0
, t
1
, . . . , t
u
, t
u+1
, . . .)
changes to
k+1

i=0

N
i,n
(t)

P
i
with T = (t
0
, t
1
, . . . , t
u
,

t, t
u+1
, . . .).
The new de Boor points are

P
i
= (1
i
)P
i1
+
i
P
i
where

i
=
_

_
1 i uk +1
0 i u+1

tt
i
t
u+k1
t
i
uk +2 i u
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 66
Periodic B-spline curves
A periodic B-spline curve of degree n is one which closes on itself.
This requires that the rst n and last n control points coincide,
and also the rst n and last n parameter intervals are of same length.
Example: n =2 and T = (0,
1
9
,
2
9
, . . . ,
7
9
,
8
9
, 1). We could get the following closed curve:
P0 , 5
P1 , 6
P2
P3
P4
P0 , 5
P1 , 6
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 67
B-spline Surface
Denition 4 ((nonuniform) B-spline surface)
A B-spline surface is dened by
S(t, u) =
k

i=0
s

j=0
N
i,n
(t)N
j,p
(u) P
i, j
, with t, u [0, 1]
The P
i, j
are the bidirectional control points.
The N
i,n
(t) are the n
th
-degree B-spline basis functions dened over
T = (0, . . . , 0
. .
n+1
, t
n+1
, . . . , t
ln1
, 1, . . . , 1
. .
n+1
)
with l +1 knot elements with l = n+k +1.
The N
j,p
(u) are the p
th
-degree B-spline basis functions dened over
U = (0, . . . , 0
. .
p+1
, u
p+1
, . . . , u
mp1
, 1, . . . , 1
. .
p+1
)
with m+1 knot elements with m = p+s +1.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 68
B-spline Surface - Evaluation
Five steps are required to calculate a point on a B-spline patch at (t, u)
1. Find the knot span in which t lies, i.e. t [t
i
, t
i+1
)
2. Compute the nonzero basis functions N
in,n
(t), . . . , N
i,n
(t)
3. Find the knot span in which u lies, i.e. u [u
i
, u
i+1
)
4. Compute the nonzero basis functions N
jp,p
(u), . . . , N
j,p
(u)
5. Multiply the values with the control points P
i, j
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 69
B-spline Surface - Example
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 70
NURBS
Denition 5 (NURBS curve)
A n
th
-degree nonuniform rational B-spline (NURBS) curve is dened by
C(t) =
k

i=0
N
i,n
(t) w
i
P
i
k

i=0
N
i,n
(t) w
i
, with t [a, b]
The P
i
are the control points, the w
i
> 0 are the weights for all i.
The N
i,n
(t) are the n
th
-degree B-spline basis functions dened over the
non-periodic and nonuniform knot vector
T = (a, . . . , a
. .
n+1
, t
n+1
, . . . , t
ln1
. .
kn
, b, . . . , b
. .
n+1
)
with l +1 knot elements with l = n+k +1.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 71
NURBS
We set
R
i,n
(t) =
N
i,n
(t) w
i
k

j=0
N
i,n
(t) w
j
Now we can rewrite the equation for C(t) to:
C(t) =
k

i=0
R
i,n
(t) P
i
where the R
i,n
(t) are the rational basis functions.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 72
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with w
i
= 1 for all i
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 73
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with w
i
= 2 for i = 3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 74
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with w
i
= 3 for i = 3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 75
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with w
i
= 5 for i = 3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 76
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with w
i
= 20 for i = 3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 77
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with w
i
= 1 for all i
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 78
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with w
i
= 0.5 for i = 2
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 79
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with w
i
= 0.2 for i = 2
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 80
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with w
i
= 0.1 for i = 2
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 81
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with w
i
= 0.01 for i = 2
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 82
Conic Sections by NURBS
NURBS can represent all conic curves (circle, ellipse, parabola, hyperbola) exactly.
Conics are 2
nd
degree, or quadratic, curves.
We dene the 2
nd
degree (n = 2) NURBS curve by
C(t) =
2

i=0
N
i,n
(t) w
i
P
i
2

i=0
N
i,n
(t) w
i
with T = (0, 0, 0, 1, 1, 1)
that is a rational Bzier curve.
In expanded form we get
C(t) =
(1t
2
)w
0
P
0
+2t(1t)w
1
P
1
+t
2
w
2
P
2
(1t
2
)w
0
+2t(1t)w
1
+t
2
w
2
that is the equation of a conic curve.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 83
Conic Sections by NURBS
IMPLICIT FORMS: (a, b > 0)
Ellipse: 1 =
x
2
a
2
+
y
2
b
2
Hyperbola: 1 =
x
2
a
2

y
2
b
2
Parabola: y
2
= 4ax
PARAMETRIC FORMS: ( <t <)
Ellipse: x(t) = a
1t
2
1+t
2
and y(t) = b
2t
1+t
2
Hyperbola: x(t) = a
1+t
2
1t
2
and y(t) = b
2t
1t
2
Parabola: x(t) = at
2
and y(t) = 2at
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 84
Conic Sections by NURBS
The following constant ratio called the conic shape factor determines a specic type
of conics
=
w
2
1
w
0
w
2
_
_
_
< 1 elliptic curve
= 1 parabolic curve
> 1 hyperbolic curve
< 1 for weights w
0
= 1, w
1
= 0.5, w
2
= 1
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 85
Conic Sections by NURBS
The following constant ratio called the conic shape factor determines a specic type
of conics
=
w
2
1
w
0
w
2
_
_
_
< 1 elliptic curve
= 1 parabolic curve
> 1 hyperbolic curve
= 1 for weights w
0
= 1, w
1
= 1, w
2
= 1
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 86
Conic Sections by NURBS
The following constant ratio called the conic shape factor determines a specic type
of conics
=
w
2
1
w
0
w
2
_
_
_
< 1 elliptic curve
= 1 parabolic curve
> 1 hyperbolic curve
> 1 for weights w
0
= 1, w
1
= 2, w
2
= 1
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 87
Conic Sections by NURBS
If we want to construct a circular arc, we must apply additional conditions:
The control points P
0
, P
1
, P
2
must form an isosceles triangle.
The weights w
0
and w
2
are set to 1.
w
1
=
dist(P
0
, P
2
)
2dist(P
0
, P
1
)
We can join four quarter-circle curve segments to construct a full circle. Therefore,
the isosceles triangles forming the quarter circles must be rectangular.
It is also possible to construct a circle by a single NURBS curve.
By applying afne transformations to the circle, we can construct an ellipse.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 88
Circular Arc - Example
Let P
0
= (0, 0), P
1
= (1, 1), P
2
= (0, 2)
We set w
0
= w
2
= 1, and get w
1
=
1

2
P0
P1
P2
Circular arc of the rectangular isosceles triangle P
0
, P
1
, P
2
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 89
Circle - Example
Circle as a concatenation of four arcs (the control points are forming a square)
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 90
Circle - Example
We can dene a single NURBS curve of seven control points over
T = (0, 0, 0,
1
4
,
1
2
,
1
2
,
3
4
, 1, 1, 1) and weights w = (1,
1
2
,
1
2
, 1,
1
2
,
1
2
, 1) to form a circle.
P0 , 6
P1
P2 P3 P4
P5
Circle as a single NURBS curve. Note: The control points are forming a square.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 91
Ellipse - Example
If we apply an appropriate afne transformation on our previous circle example, we can
obtain an ellipse.
P0 , 6
P1
P2 P3 P4
P5
Ellipse as a single NURBS curve
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 92
Further topics
Polar forms (alternative approach)
Derivatives of B-splines and NURBS curves or surfaces and their properties
Different algorithms
Knot renement
Knot removal
Degree elevation and reduction
Transformations and projections
...
Interpolation techniques
spline, Hermite spline, Catmull-Rom spline, cardinal spline, ...
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c Marko uleji c: Geometric Modelling 93
Thank you for your attention!
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines