Upload
moustafa-mahmoud
View
99
Download
7
Tags:
Embed Size (px)
Citation preview
B-spline and NURBS Curves
Marko ŠulejicUniversität Salzburg
FB ComputerwissenschaftenA–5020 Salzburg, Austria
8. Juli 2011
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back
c© Marko Šulejic: 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 Šulejic: 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 Designand Manufacturing. Springer, 2002
• H. Prautzsch, W. Boehm, M. Paluszny. Bézier 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 inComputer Graphics and Geometric Modeling. Morgan Kaufmann, 1995.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 3
Introduction
• Mathematical splines were first mentioned in the 1946 paper by Isaac JacobSchoeneberg.
• The term spline was used for wooden strips in the shipbuilding industry, passedthrough 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 Šulejic: Geometric Modelling 4
Introduction
e.g. problems with Bézier 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 Šulejic: Geometric Modelling 5
Introduction
e.g. problems with Bézier curves:
P0
P1
P2
P3
P4
P5
P6
Two joined cubic Bézier curves
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 6
Introduction
e.g. problems with Bézier curves:
P0
P1
P2
P3
P4
P5
P6
Control polygon with collinear points P2,P3,P4
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 7
Introduction
e.g. problems with Bézier curves:
P0
P1
P2
P3
P4
P5
P6
Change of P3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 8
Introduction
e.g. problems with Bézier curves:
P0
P1
P2
P3
P4
P5
P6
Change of Bézier curve degree
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 9
Introduction
e.g. problems with Bézier curves:
P0
P1
P2
P3
P4
P5
P6
Change of P3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 10
Introduction
e.g. problems with Bézier 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 Šulejic: Geometric Modelling 11
Introduction
e.g. problems with Bézier curves:
P0
P1
P2
P3
P4
P5
P6
Change of P3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 12
Introduction
• Curvature continuity is an important requirement in many applications.
• Joining two Bézier curves with C2 continuity is cumbersome.
• All B-spline (basis spline) curves have inherently C2 continuity.
• B-splines do not necessarily interpolate the endpoints like Bézier curves.
clamped
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 13
Introduction
• Curvature continuity is an important requirement in many applications.
• Joining two Bézier curves with C2 continuity is cumbersome.
• All B-spline (basis spline) curves have inherently C2 continuity.
• B-splines do not necessarily interpolate the endpoints like Bézier curves.
unclamped
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 14
IntroductionDefinition 1 (spline)
A curve s(t) consisting of m nth-degree polynomial segments is called a spline ofdegree n with the parameter values t0, ..., tm and ti ≤ ti+1 and ti < ti+n+1 for allpossible i.
• We refer to a spline of degree n as a spline of order n+1.
• The parameter values {ti} are called breakpoints.
• We denote the polynomial segments by si(t) and 1≤ i≤ m.
• These segments join with some level of continuity at their breakpoints.
• The si(t) can be any regular polynomial function:
f (x) = anxn+an−1xn−1+ · · ·+a2x2+a1x+a0
for all arguments x, where n is a non-negative integerand a0,a1,a2, ...,an are constant coefficients.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 15
Introduction
t0 t1 t2 t3 t4 t5 = tm
s(t)
s1(t)
s2(t)
s3(t) s4(t)
s5(t)
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 16
Introduction
• We want a curve definition of the form:
C(t) =m
∑i=0
fi(t)Pi
? Pi are the the control points
? fi(t) are piecewise polynomial functions
• For a fixed breakpoint sequence {ti} with 0≤ i≤m the fi are forming a basis for thevector space of all piecewise polynomial functions.
• The degree and the continuity are determined by these basis functions.
• The control points can be freely modified without changing the continuity of the curve.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 17
B-spline Basis Functions
We define the B-spline basis functions by the recurrence formula due to de Boor, Coxand Mansfield:
Definition 2 (B-spline basis function)
Let a vector known as the knot vector be defined T = (t0, ..., tm) where T is anondecreasing sequence of real numbers with ti ≤ ti+1 and i = 0, ...,m−1.The ti are called knots. The ith B-spline basis function of nth-degree is defined by
Ni,0(t) ={
1 if ti ≤ t < ti+1
0 otherwise
Ni,n(t) =t− ti
ti+n− tiNi,n−1(t)+
ti+n+1− tti+n+1− ti+1
Ni+1,n−1(t)
• For n > 0 the Ni,n(t) are a linear combination of two (n−1) degree basis functions.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 18
B-spline Basis Functions
N0,0
N1,0
N2,0
N3,0
N4,0
N0,1
N1,1
N2,1
N3,1
N0,2
N1,2
N2,2
N0,3
N1,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 Šulejic: Geometric Modelling 19
B-spline Basis Functions
N0,0
N1,0
N2,0
N3,0
N4,0
N0,1
N1,1
N2,1
N3,1
N0,2
N1,2
N2,2
N0,3
N1,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 Šulejic: Geometric Modelling 20
B-spline Basis Functions
N0,0
N1,0
N2,0
N3,0
N4,0
N0,1
N1,1
N2,1
N3,1
N0,2
N1,2
N2,2
N0,3
N1,3
[t0, t1)
[t1, t2)
[t2, t3)
[t3, t4)
[t4, t5)
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 Šulejic: Geometric Modelling 21
B-spline Basis Functions
• Properties of B-spline basis functions:
? Non-negativity:
Ni,n(t)≥ 0, for all i,n, t
? Local support:
Ni,n(t) = 0, if t /∈ [ti, ti+n+1)
? Partition of unity:i
∑j=i−n
N j,n(t) = 1, for all t ∈ [ti, ti+1)
? Derivative: (Cox-de Boor formula)
dd t
Ni,n(t) =n
ti+n− tiNi,n−1(t)−
nti+n+1− ti+1
Ni+1,n−1(t)
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: 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 Šulejic: Geometric Modelling 23
B-spline Basis FunctionsLet knot vector T = (0,0,0,0, 1
3,23,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 N3,0,N4,0,N5,0
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 24
B-spline Basis FunctionsLet knot vector T = (0,0,0,0, 1
3,23,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 N2,1,N3,1,N4,1,N5,1
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 25
B-spline Basis FunctionsLet knot vector T = (0,0,0,0, 1
3,23,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 N1,2,N2,2,N3,2,N4,2,N5,2
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 26
B-spline Basis FunctionsLet knot vector T = (0,0,0,0, 1
3,23,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 N0,3,N1,3,N2,3,N3,3,N4,3,N5,3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 27
B-spline Basis FunctionsLet knot vector T = (0, 1
9,29,
39,
49,
59,
69,
79,
89,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 N0,3,N1,3,N2,3,N3,3,N4,3,N5,3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 28
B-spline Basis FunctionsLet knot vector T = (0, 1
9,19,
19,
13,
13,
23,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 N0,3,N1,3,N2,3,N3,3,N4,3,N5,3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: 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
, tn+1, . . . , tl−n−1︸ ︷︷ ︸k−n interior knots
,b, . . . ,b︸ ︷︷ ︸n+1
) be a knot vector,
with n as a fixed 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 andthere exists r ∈ R with r = ti+1− ti , for all n≤ i≤ l−n−1 .
? Otherwise T is called nonuniform.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 30
B-Spline Curves
Definition 3 ((nonuniform) B-spline curve)
A nth-degree B-spline curve (of order n+1) is defined by
C(t) =k
∑i=0
Ni,n(t) Pi , with t ∈ [a,b]
• The Pi are k+1 control points. They are also called de Boor points.
• The Ni,n(t) are the nth-degree B-spline basis functions defined over thenon-periodic and nonuniform knot vector
T = (a, . . . ,a︸ ︷︷ ︸n+1
, tn+1, . . . , tl−n−1︸ ︷︷ ︸k−n
,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 Šulejic: Geometric Modelling 31
Knot Vector Generation
• Suppose we have k+1 control points Pi and degree n.
• We need l +1 knots, where l = k+n+1.
• If the curve is clamped, we get t0 = t1 = . . .= tn = 0 and tl−n = tl−n+1 = . . .= tl = 1.
? The remaining k−n knots can be uniformly spaced or chosen individually.
? For uniformly spaced internal knots the interval [0,1] is divided intok−n−1 subintervals. Therefore the knots are
t0 = t1 = . . .= tn = 0
t j+n =j
k−n−1for j = 1,2, . . . ,k−n
tl−n = tl−n+1 = . . .= tl = 1
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 32
Knot Vector Generation Example
• We have 7 control points P0, . . . ,P6 (k = 6) and want a clamped curve of degreen = 3 (cubic). So we have in total l +1 = k+n+2 = 6+3+2 = 11 knotswith 3 internal knots ( j = 1,2,3), then T = (0,0,0,0︸ ︷︷ ︸
n+1=4
, 14,
24,
34,1,1,1,1︸ ︷︷ ︸
n+1=4
).
• For P0, . . . ,P6 = {(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 C2 continuous B-spline curve
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 33
B-Spline Curves
• Properties of B-spline curves:
? Continuity:
A B-spline curve of order k has in general Ck−2 continuity.
? Knot Continuity:
Increasing the multiplicity m of a knot reduces the continuityof the curve to Ck−m−1 at that knot.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 34
Knot Vector Example
• Let T = (0,0,0,0,14,14︸︷︷︸
m=2
, 34,1,1,1,1). Now we have C1 continuity at knot value 1/4.
• For P0, . . . ,P6 = {(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 C1 continuous knot
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 35
Knot Vector Example
• Or let T = (0,0,0,0,14,14,14︸ ︷︷ ︸
m=3
,1,1,1,1). Now we have C0 continuity at knot value 1/4.
• For P0, . . . ,P6 = {(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 C0 continuous knot
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 36
B-Spline Curves
• Properties of B-spline curves:
? Continuity:
A B-spline curve of order k has in general Ck−2 continuity.
? Knot Continuity:
Increasing the multiplicity m of a knot reduces the continuityof the curve to Ck−m−1 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 pointsthat affect this section, i.e. if t ∈ [ti, ti+1) and n≤ i < m−n−1, than C(t)is in the convex hull of control points Pi−n, . . . ,Pi.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: 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 Šulejic: Geometric Modelling 38
Convex Hull Property
P0
P1
P2
P3
P4 P5
P6
First knot span contained in the convex hull of P0, . . . ,P3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 39
Convex Hull Property
P0
P1
P2
P3
P4 P5
P6
Second knot span contained in the convex hull of P1, . . . ,P4
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 40
Convex Hull Property
P0
P1
P2
P3
P4 P5
P6
Third knot span contained in the convex hull of P2, . . . ,P5
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 41
Convex Hull Property
P0
P1
P2
P3
P4 P5
P6
Fourth knot span contained in the convex hull of P3, . . . ,P6
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: 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 Šulejic: Geometric Modelling 43
B-Spline Curves
• Properties of B-spline curves :
? Endpoint interpolation:
If C(0) = P0 and C(1) = Pk, than the curve interpolates betweenthe endpoints P0 and Pk.
? Geometry invariance:
The shape of the B-spline curve is invariant under all affinetransformations (translation, rotation, shear, scaling).
? B-spline to Bézier:
A B-spline curve where the number of control points and thecurve degree n equals, and T = ( 0, . . . ,0︸ ︷︷ ︸
n
, 1, . . . ,1︸ ︷︷ ︸n
),
degenerates into a Bézier curve.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 44
B-spline to Bézier Example
Let P0, . . . ,P4 be five 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 Bézier curve
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 45
B-Spline Curves
• Properties of B-spline curves :
? Local support:
From the local support property of the B-spline basis functions followsthat moving control point Pi changes C(t) only in the interval [ti, ti+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 Šulejic: Geometric Modelling 46
The de Boor Algorithm
• Fast and numerically stable algorithm for evaluating or splitting a B-spline curve C(t)at a specific parameter value t.
• It is a generalization of the de Casteljau algorithm used for Bézier curves.
• The de Boor algorithm is defined as follows:
C(t) =k+ j
∑i=0
Ni,n− j(t) P ji for j = 0,1, . . . ,n
where
P ji = (1−α
ji ) P j−1
i−1 + αji P j−1
i for j > 0
with
αji =
t− titi+n+1− ti
and P0j = Pj
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 47
De Boor Example
P0
P1
P2
P3
Control points P0, . . . ,P3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 48
De Boor Example
P0
P1
P2
P3
Control polygon
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 49
De Boor Example
P 00
P 01
P 02
P 03
We apply the rule P0j = Pj
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 50
De Boor Example
P 00
P 01
P 02
P 03
The resulting B-spline curve
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 51
De Boor Example
• Lets say we want to calculate the value of P11 .
• We get P11 = (1−α1
1) P00 + α1
1 P01
• We see the point P11 must lie between the point P0
0 and P01 and
is calculated recursively.
• That observation leads to a similar triangular calculation table as we sawfrom 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 Šulejic: Geometric Modelling 52
De Boor Example
P 00
P 01
P 02
P 03
P 11
P 12
P 13
P 22
P 23
P 33
Recursive triangular table
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 53
De Boor Example
P 00
P 01
P 02
P 03
P 11
P 12
P 13
P 22
P 23
P 33
Recursive triangular table
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 54
De Boor Example
P 00
P 11
P 01
P 12
P 02
P 13
P 03
The new calculated points P11 ,P
12 ,P
13
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 55
De Boor Example
P 00
P 11
P 01
P 12
P 02
P 13
P 03
The new calculated points P11 ,P
12 ,P
13
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 56
De Boor Example
P 00
P 01
P 02
P 03
P 11
P 12
P 13
P 22
P 23
P 33
Recursive triangular table
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 57
De Boor Example
P 00
P 11
P 01
P 12
P 02
P 13
P 03
P 22
P 23
The new calculated points P22 ,P
23
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 58
De Boor Example
P 00
P 11
P 01
P 12
P 02
P 13
P 03
P 22
P 23
The new calculated points P22 ,P
23
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 59
De Boor Example
P 00
P 01
P 02
P 03
P 11
P 12
P 13
P 22
P 23
P 33
Recursive triangular table
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 60
De Boor Example
P 00
P 11
P 01
P 12
P 02
P 13
P 03
P 22
P 23
P 33
The new calculated point P33
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 61
De Boor Example - Subdivision
The new calculated point P33 splits the B-spline curve into two new segments of same
degree. We get two new control polygons P00 ,P
11 ,P
22 ,P
33 and P3
3 ,P23 ,P
13 ,P
03 .
P 00
P 11
P 01
P 12
P 02
P 13
P 03
P 22
P 23
P 33
Subdivision by P33
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 62
De Boor Example - Subdivision
The new calculated point P33 splits the B-spline curve into two new segments of same
degree. We get two new control polygons P00 ,P
11 ,P
22 ,P
33 and P3
3 ,P23 ,P
13 ,P
03 .
P 00
P 11
P 01
P 12
P 02
P 13
P 03
P 22
P 23
P 33
Convex hull of P00 ,P
11 ,P
22 ,P
33
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 63
De Boor Example - Subdivision
The new calculated point P33 splits the B-spline curve into two new segments of same
degree. We get two new control polygons P00 ,P
11 ,P
22 ,P
33 and P3
3 ,P23 ,P
13 ,P
03 .
P 00
P 11
P 01
P 12
P 02
P 13
P 03
P 22
P 23
P 33
Convex hull of P33 ,P
23 ,P
13 ,P
03
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 64
De Boor Example - Subdivision
P 00
P 01
P 02
P 03
P 11
P 12
P 13
P 22
P 23
P 33
Subdivision on the triangular table
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 65
Knot Insertion
• Knot insertion allows adding an additional knot into a B-spline curve without changingthe curves shape. The existing basis of the curve
k
∑i=0
Ni,n(t) Pi with T = (t0, t1, . . . , tu, tu+1, . . .)
changes to
k+1
∑i=0
Ni,n(t) Pi with T = (t0, t1, . . . , tu, t, tu+1, . . .).
The new de Boor points are
Pi = (1−αi)Pi−1+αiPi where
αi =
1 i≤ u− k+10 i≥ u+1
t−titu+k−1−ti
u− k+2≤ i≤ u
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: 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 first n and last n control points coincide,and also the first n and last n parameter intervals are of same length.
• Example: n= 2 and T = (0, 19,
29, . . . ,
79,
89,1). We could get the following closed curve:
P0 , 5
P1 , 6 P2
P3
P4P0 , 5
P1 , 6
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 67
B-spline SurfaceDefinition 4 ((nonuniform) B-spline surface)
A B-spline surface is defined by
S(t,u) =k
∑i=0
s
∑j=0
Ni,n(t)N j,p(u) Pi, j , with t,u ∈ [0,1]
• The Pi, j are the bidirectional control points.
• The Ni,n(t) are the nth-degree B-spline basis functions defined over
T = (0, . . . ,0︸ ︷︷ ︸n+1
, tn+1, . . . , tl−n−1,1, . . . ,1︸ ︷︷ ︸n+1
)
with l +1 knot elements with l = n+ k+1.
• The N j,p(u) are the pth-degree B-spline basis functions defined over
U = (0, . . . ,0︸ ︷︷ ︸p+1
,up+1, . . . ,um−p−1,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 Šulejic: 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 ∈ [ti, ti+1)
2. Compute the nonzero basis functions Ni−n,n(t), . . . ,Ni,n(t)
3. Find the knot span in which u lies, i.e. u ∈ [ui,ui+1)
4. Compute the nonzero basis functions N j−p,p(u), . . . ,N j,p(u)
5. Multiply the values with the control points Pi, j
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 69
B-spline Surface - Example
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 70
NURBS
Definition 5 (NURBS curve)
A nth-degree nonuniform rational B-spline (NURBS) curve is defined by
C(t) =
k
∑i=0
Ni,n(t) wi Pi
k
∑i=0
Ni,n(t) wi
, with t ∈ [a,b]
• The Pi are the control points, the wi > 0 are the weights for all i.
• The Ni,n(t) are the nth-degree B-spline basis functions defined over thenon-periodic and nonuniform knot vector
T = (a, . . . ,a︸ ︷︷ ︸n+1
, tn+1, . . . , tl−n−1︸ ︷︷ ︸k−n
,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 Šulejic: Geometric Modelling 71
NURBS
• We set
Ri,n(t) =Ni,n(t) wi
k
∑j=0
Ni,n(t) w j
• Now we can rewrite the equation for C(t) to:
C(t) =k
∑i=0
Ri,n(t) Pi
where the Ri,n(t) are the rational basis functions.
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 72
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with wi = 1 for all i
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 73
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with wi = 2 for i = 3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 74
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with wi = 3 for i = 3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 75
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with wi = 5 for i = 3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 76
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with wi = 20 for i = 3
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 77
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with wi = 1 for all i
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 78
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with wi = 0.5 for i = 2
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 79
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with wi = 0.2 for i = 2
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 80
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with wi = 0.1 for i = 2
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 81
NURBS Example
P0
P1
P2
P3
P4 P5
P6
NURBS curve with wi = 0.01 for i = 2
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 82
Conic Sections by NURBS
• NURBS can represent all conic curves (circle, ellipse, parabola, hyperbola) exactly.
• Conics are 2nd degree, or quadratic, curves.
• We define the 2nd degree (n = 2) NURBS curve by
C(t) =
2
∑i=0
Ni,n(t) wi Pi
2
∑i=0
Ni,n(t) wi
with T = (0,0,0,1,1,1)
that is a rational Bézier curve.
• In expanded form we get
C(t) =(1− t2)w0P0+2t(1− t)w1P1+ t2w2P2
(1− t2)w0+2t(1− t)w1+ t2w2
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 Šulejic: Geometric Modelling 83
Conic Sections by NURBS
IMPLICIT FORMS: (a,b > 0)
• Ellipse: 1 =x2
a2 +y2
b2
• Hyperbola: 1 =x2
a2−y2
b2
• Parabola: y2 = 4ax
PARAMETRIC FORMS: (−∞ < t < ∞)
• Ellipse: x(t) = a1− t2
1+ t2 and y(t) = b2t
1+ t2
• Hyperbola: x(t) = a1+ t2
1− t2 and y(t) = b2t
1− t2
• Parabola: x(t) = at2 and y(t) = 2at
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 84
Conic Sections by NURBS
• The following constant ratio called the conic shape factor determines a specific typeof conics
ρ =w2
1
w0w2
ρ < 1 elliptic curveρ = 1 parabolic curveρ > 1 hyperbolic curve
ρ < 1 for weights w0 = 1,w1 = 0.5,w2 = 1
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 85
Conic Sections by NURBS
• The following constant ratio called the conic shape factor determines a specific typeof conics
ρ =w2
1
w0w2
ρ < 1 elliptic curveρ = 1 parabolic curveρ > 1 hyperbolic curve
ρ = 1 for weights w0 = 1,w1 = 1,w2 = 1
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 86
Conic Sections by NURBS
• The following constant ratio called the conic shape factor determines a specific typeof conics
ρ =w2
1
w0w2
ρ < 1 elliptic curveρ = 1 parabolic curveρ > 1 hyperbolic curve
ρ > 1 for weights w0 = 1,w1 = 2,w2 = 1
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 87
Conic Sections by NURBS
• If we want to construct a circular arc, we must apply additional conditions:
? The control points P0,P1,P2 must form an isosceles triangle.
? The weights w0 and w2 are set to 1.
? w1 =dist(P0,P2)
2∗dist(P0,P1)
• 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 affine 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 Šulejic: Geometric Modelling 88
Circular Arc - Example
• Let P0 = (0,0),P1 = (1,1),P2 = (0,2)
• We set w0 = w2 = 1, and get w1 =1√2
P0
P1
P2
Circular arc of the rectangular isosceles triangle P0,P1,P2
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: 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 Šulejic: Geometric Modelling 90
Circle - Example
We can define a single NURBS curve of seven control points overT = (0,0,0, 1
4,12,
12,
34,1,1,1) and weights w = (1, 1
2,12,1,
12,
12,1) to form a circle.
P0 , 6 P1
P2P3P4
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 Šulejic: Geometric Modelling 91
Ellipse - Example
If we apply an appropriate affine transformation on our previous circle example, we canobtain an ellipse.
P0 , 6 P1
P2P3P4
P5
Ellipse as a single NURBS curve
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines
c© Marko Šulejic: Geometric Modelling 92
Further topics
• Polar forms (alternative approach)
• Derivatives of B-splines and NURBS curves or surfaces and their properties
• Different algorithms
? Knot refinement? 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 Šulejic: Geometric Modelling 93
Thank you for your attention!
Quit Full Screen Previous Page Next Page GoTo Page Go Forward Go Back gm splines