Professional Documents
Culture Documents
B-Spline Curves
1, ti t ti 1
N i , 0 (t )
0, otherwise
t ti ti k 1 t
N i ,k (t ) N i ,k 1 (t ) N i 1,k 1 (t )
ti k ti ti k 1 ti 1
• Build the definition of a B-Spline from:
– n+1, the number of control functions
– k, the degree of the curve
– {P0…Pn}, a list of n+1 control points
– [t0,t1,…,tk+n+1], a knot vector of parameter values
• n intervals → n+1 control points
• k is the degree of the curve, so k+1 is the number of
control points which influence a single interval. k
must be at least 1 (two control points linked by each
linear line segments) and no more than n (the
number of intervals.)
• There are k+n+2 knots, and ti ≤ ti+1 for all ti.
Elaborating the terms of B-Spline
n
P (t ) N i ,k (t ) Pi , t min t t max
i 0
n=2 ,k=2
P (t ) N 0, 2 (t ) P0 N1, 2 (t ) P1 N 2, 2 (t ) P2 t min t t max
n=3 ,k=2
P(t ) N 0, 2 (t ) P0 N1, 2 (t ) P1 N 2, 2 (t ) P2 N 0,3 (t ) P3
t min t t max
n=4 ,k=2
P(t ) N0, 2 (t ) P0 N1, 2 (t ) P1 N 2, 2 (t ) P2 N0,3 (t ) P3 N 0, 4 (t ) P4
t min t t max
Type of knot vectors
1. Open Uniform, 2. Uniform, 3. Non-uniform
1. Open Uniform
Ti 0 ik
Ti i k k t n
Ti n k 1 i n
T=[0 0 1 1] if n=k=1
T=[0 0 0 1 1 1] if n=k=2
T=[0 0 0 1 2 2 2] if n=3, k=2
B-Spline Knot vectors
3. Non-uniform
T =[0 2 3 3 5 6 --------n+k+1]
Where n is one less than the number control
Points and k is the degree of the curve
t[i] <= t[i+1]
Basis function calculation For n=2,
k=2, Knot_vector[000111]
0 u 1
K=0 K=1 K=2
N[0][0]=0
N[0][1]=0
N[1][0]=0 N[0][2]=(1-u) (1-u)/(1-0)
N[1][1]=(1-u)/(1-0)
N[2][0]=1 N[1][2]=(1-u)(u-0)/(1-0) +u(1-u)/(1-0)
N[2][1]=(u-0)/(1-0)
N[3][0]=0 N[2][2]=u(u-0)/(1-0)
N[3][1]=
N[4][0]=0 N[3][2]= 0
N[4][1]=0
Open Uniform BSpline Curves
t ti tik 1 t
Ni,k (t) Ni,k 1(t) Ni1,k 1(t)
0 u 1 tik ti tik 1 ti1
K=0 K=1 K=2
N[0][0]=0
N[0][1]=0
N[1][0]=0 N[0][2]=(1-u) (1-u)/(1-0)
N[1][1]=(1-u)/(1-0)
N[2][0]=1 N[1][2]=(1-u)(u-0)/(1-0) +u(2-u)/(2-
0)
N[2][1]=(u-0)/(1-0)
N[3][0]=0 N[2][2]=u(u-0)/(2-0)
N[3][1]= 0
N[4][0]=0 N[3][2]= 0
N[4][1]=0
1 u 2, k (0,0,0,1,2,2,2) N (t) t ti N (t) tik1 t N (t)
i ,k i,k 1 i 1,k 1
tik ti tik 1 ti1
K=0 K=1 K=2 N’(u)
N[0][0]=0
N[0][1]=0
N[1][0]=0 N[0][2]=0
N[1][1]=0
N[2][0]=0 N[1][2]=0 +(2-u)(2-u)/(2-0) U-2
N[2][1]=(2-u)/(2-1)
N[3][0]=1 N[2][2]=(2-u)(u-0)/(2-0) +(u- -3u+4
1)/(2-u)/(2-1)=(-3u*u+8u-
4)/2
N[3][1]= (u-1)/(2-1)
N[4][0]=0 N[3][2]= (u-1)(u-1)/(2-1) 2(u-1)
N[4][1]=0
Open Uniform Basis functions
CP x y Z
1 0 0 0
2 3 9 0
3 6 3 0
4 9 6 0
N[2][1]=u
N[3][0]=0 N[2][2]=u(u-0)/(1-0)
N[3][1]= 0
N[4][0]=0 N[3][2]= 0
N[4][1]=0
t ti tik 1 t
N[5][0]=0
Ni,k (t) Ni,k 1(t) Ni1,k 1(t)
tik ti tik 1 ti1
1 u 2
K=0 K=1 K=2
N[0][0]=0
N[0][1]=0
N[1][0]=0 N[0][2]=0
N[1][1]=0
N[2][0]=0 N[1][2]=0
N[2][1]=0
N[3][0]=0 N[2][2]=(3-u)/(2)*(3-u)/(3-1)
N[3][1]= (3-u)/(3-1)
N[4][0]=1 N[3][2]=
((3-u)/2)(u-1)/(3-1)+(u-1)/2*(3-u)/(3-1)
N[4][1]=(u-1)/(3-1)
N[5][0]=0 N[4][2]= (u-1)/2 (u-1)/2
N[5][1]=0
N[6][0]=0
t ti tik 1 t
Ni,k (t) Ni,k 1(t) Ni1,k 1(t)
tik ti tik 1 ti1
Basis function for n=4, k+1 =3
Knot Vector = [0 0 0 1 2 3 3 3] 0 u 1
K=0 K=1 K=2
N[0][0]=0
N[0][1]=0
N[4][0]=0 N[3][2]= 0
N[4][1]=0
N[5][0]=0 N[4][2]=0
N[5][1]=0
N[6][0]=0
Basis function for n=4, k+1 =3
Knot Vector = [0 0 0 1 2 3 3 3]
1 u 2
K=0 K=1 K=2
N[0][0]=0
N[0][1]=0
N[1][0]=0 N[0][2]= ]= 0
N[1][1]=0
N[2][0]=0 N[1][2]= ]= (2-u)(2-u)/(2-0)
N[2][1]= (2-u)
N[3][0]=1 N[2][2]= (2-u)(u-0)/2+ (u-1)(3-u)/(3-1)
N[3][1]= (u-1)/(2-
1)
N[4][0]=0 N[3][2]= (u-1)(u-1)/(3-1)
N[4][1]=0
N[5][0]=0 N[4][2]=0
N[5][1]=0
Basis function for n=4, k+1 =3
Knot Vector = [0 0 0 1 2 3 3 3] 2u3
K=0 K=1 K=2
N[0][0]=0
N[0][1]=0
N[1][0]=0 N[0][2]= ]= 0
N[1][1]=0
N[2][0]=0 N[1][2]= ]= 0
N[2][1]= 0
N[3][0]=0 N[2][2]= (3-u)(3-u)/2
N[3][1]= (3-u)/(3- 2)
N[4][0]=1 N[3][2]= (3-u)(u-1)/(3-1)+(u-2)*(3-u)/
(3-2) =((-3*u*u)+14*u-15)/2
N[4][1]=(u-2)/(3-2)
N[5][0]=0 N[4][2]=(u-2)(u-2)/(3-2)
N[5][1]=0
Find points on open uniform quadratic B-Spline
Curves for given Control Points(CP)
n
P (t ) N
i 0
i ,k (t ) Pi , t min t t max
CP x y Z
1 0 0 0
2 .409 1.378 0
3 3 2.874 0
4 5.591 1.377 0
N[4][0]=0 N[3][2]= 0
N[4][1]=0
N[5][0]=0 N[4][2]=0
N[5][1]=0
N[6][0]=0
1u 2
K=0 K=1 K=2
N[0][0]=0
N[0][1]=0
N[1][0]=0 N[0][2]= 0
N[1][1]= 0
N[2][0]=0 N[1][2]= (2-u) *(2-u)/(2-0) = (2-u) * (2-
u)/2
N[2][1]=(2-u)
N[3][0]=1 N[2][2]= (2-u)(u-0)/(2-0) +( u-1)(3-u)/(3-1)
= ( -2u*u+6u-3)/2
N[3][1]=(u-1)/(2-1)
N[4][0]=0 N[3][2]= (u-1)(u-1)/(3-1) = (u-1)*(u-1)/2
N[5][0]=0 N[4][2]=0
N[5][1]=0
N[6][0]=0
2u3
K=0 K=1 K=2
N[0][0]=0
N[0][1]=0
N[1][0]=0 N[0][2] =o
N[1][1]= 0
N[2][0]=0 N[11][2] =0
N[2][1]=0
N[3][0]=0
N[3][1]=(3-u)/(3-2)
N[4][0]=1
N[3][1]=(u-2)/(3-2)
N[5][0]=0
N[5][1]=0
N[6][0]=0
3u 4
K=0 K=1 K=2
N[0][0]=0
N[0][1]=0
N[1][0]=0 N[0][2]= 0
N[1][1]= 0
N[2][0]=0 N[0][2]= 0
N[2][1]=(2-u)
N[3][0]=0 N[0][2]= 0
N[3][1]=0
N[4][0]=0 N[0][2]= (4-u)(4-u)/2
N[4[[1] =(4-u]
N[5][0]=1 N[0][2]= (4-u)(u-2)/(4-2) +(u-3)(4-u)/(4-
3)
N[5][1]=(u-3)
N[6][0]=0 N[0][2]= (3-u)*(3-u)
BSpline Curves
Knot Vector = [0 0 0 12 3 4 4 4]
B-Spline Blending functions
BSpline Curves
n=5, k =3,t=(0000123333), 0<=u<1
K=0 K=1 K=2 K=3
N[0][0]=0
N[0][1]=0
N[1][0]=0 N[0][2]=0
N[1][1]=0 N[0][3]= (1-u)(1-u)(1-u)
N[2][0]=0 N[1][2]= (1-u)(1-u)
N[2][1]= 1-u N[0][3]= u(1-u)(1-U)+u(1-
u)+u/2(u-2)(u-2)/2
N[3][0]=1 N[2][2]=(1-u)( )+u( )
N[3][1] =u N[0][3]= u/2((1-
u)u+u/2(2-u))+(3-
u/)3(u*u)/2
N[4][0]=0 N[3][2]=u*u/2
N[4][1]=0 N[0][3]= u*u*u/6
N[5][0]=0 N[4][2]=0
N[5][1]=0
N[6][0]=0
1<=u<2
K=0 K=1 K=2 K=3
N[0][0]=0
N[0][1]=0
N[1][0]=0 N[0][2]=0
N[1][1]=0 N[0][3]= 0
N[2][0]=0 N[1][2]= 0
N[2][1]= 0 N[1][3]= (2-u)(2-u)(2-u)/4
N[3][0]=0 N[2][2]=(2-u)(2-u)/2
N[3][1] =2-u N[2][3]= (2-u)(2-u)(u)/4+(3-
u)/6[(2-u)(u)+(3-u)(u-1)]
N[4][0]=1 N[3][2]=(2-u)(u)/2+(u-
1)(3-u)/2
N[4][1]=(u-1) N[3][3]=(u/3)[u(2-u)/2+(2-u)
(u-1)/2] +(3-u)/2(u-1)(u-1)/2
N[5][0]=0 N[4][2]=(u-1)(u-1)/2
N[5][1]=0 N[5][2]=0 N[4][3]=(u-1)(u-1)(u-1)/4
N[6][0]=0 N[6][1]=0 N[6][2]=0
K=0 K=1 K=2 K=3
N[0][0]=0 2<=u<3
N[0][1]=0
N[1][0]=0 N[0][2]=0
N[1][1]=0 N[0][3]= 0
N[2][0]=0 N[1][2]= 0
N[2][1]= 0 N[1][3]= 0
N[3][0]=0 N[2][2]=0
N[3][1] =0 N[2][3]= (3-u)(3-u)(3-u)/6
N[4][0]=0 N[3][2]= (3-u)(3-u)/2
N[4][1]=3-u N[3][3]= t/6(3-u)(3-u)+(3-u)/2((u-
1))(3-u)/2+(3-u)(u-2))
N[5][0]=1 N[4][2]=(u-1)(3-
u)/2+(3-u)(u-2)
N[5][1]=u-2 N[4][3]=(u-1)/2((u-1)(3-u)/2+(3-
u)(u-2))+(3-u)(u-2)(u-2)
N[6][0]=0 N[5][2]= (u-2)(u-2)
N[5][3] (u-2)(u-2)(u-2)
Open uniform B-Spline cubic basis
functions for seven control points having
knot_vector(0 0 0 0 1 2 3 4 4 4 4)
Cubic B-Spline Curves for 7 control points
Uniform BSpline Curves
k u n 1
N[4][0]=0 N[3][2]=(u-3)(u-3)/(5-3)
N[5][1]=0 N[3][3]= (u-3)(u-3)/2 *(u-3)/(6-3)
k = order = degree +1(effect of varying order)
k = order = degree +1=4
k = order = degree +1
k = order = degree +1
u x y
3 3.03 6.514
3.25 3.66 6.51
3.5 4.5 5.875
3.75 5.13 5.216
4.0 5.97 4.515
k = order = degree +1
k = order = degree +1
u x y
3 3.03 6.514
3.25 3.66 6.51
3.5 4.5 5.875
3.75 5.13 5.216
4.0 5.97 4.515
Uniform B_Spline with another control pts
u x y
3 1.717 8.383
3.25 2.973 9.191
3.5 5.0 9.583
3.75 6.544 9.363
4.0 8.283 8.383
Non-Uniform B-Spline Example 5-14(Fig5-50(a)
Quadratic Uniform and non-uniform B-Spline
P(2.5)=(2,4.87) P(4.25)=(5.518,5.185)
4th order Uniform B-Spline Curves for knot=[0 1 2 3 4 5 6 7 8 9]
Bézier Curve
Clamped B-Spline
(degree 10!)
Curve
B-Spline Curves Important Properties
2. Equality m = n + k + 1 must be satisfied.
3. Clamped B-spline curve C(u) passes
through the two end control points P0 and
Pn.
4. Strong Convex Hull Property: A B-
spline curve is contained in the
convex hull of its control polyline.
More specifically, if u is in knot span
[t, ti+1), then C(u) is in the convex hull
of control points Pi-k , Pi-k+1, ..., Pi.
B-Spline Curves Important Properties
Each curve segment
a b
Closed quadratic Periodic B-Spline
If N is not
square matrix
Techniques to find parametric value of
input points
1. Proportional Technique
2. Chord length approximation
3. Centripetal
0 u 1 1 u 2
N[2][2]= (3-u)(3-u)/2
N[3][2]= (3-u)(u-1)/(3-1)+(u-
2)*(3-u)/(3-2)
N[4][2]=(u-2)(u-2)/(3-2)
Basis functions
u=0 u=0.918 u=1.5
N 0, 2 (u ) 1 N 0, 2 (u ) 0.007 N1, 2 (u ) 0.125
N1, 2 (u ) 0 N1, 2 (u ) 0.571
N1, 2 (u ) 0.75
N 2, 2 (u ) 0.422
N 2, 2 (u ) 0 N 3, 2 (u ) 0.125
u=2.07 u=3
N 2, 2 (u ) 0.422 N 2, 2 (u ) 0
N 3, 2 (u ) 0.571 N 3, 2 (u ) 0
N 4, 2 (u ) 0.007 N 4, 2 (u ) 1
B-Spline Curve Fit by four control points
Knot vector=[0 0 0 1 2 2 2]
O<=u<1 1<=u<2
N[0][2]=(1-u) (1-u)/(1-0) N[1][2]=0 +(2-u)(2-u)/(2-0)
1 0.15 0 0 0
0 0.662 0.5 0.188 0
0 0.188 0.5 0.662 0
0 0 0 0 1
B-Spline Curve Fit
N T D N T N Bi
1 0.15 0 0 0
0 0.662 0.5 0.188 0
0 0.188 0.5 0.662 0
0 0 0 0 1
1 0.15 0 0 0
0 0.662 0.5 0.188 0
0 0.188 0.5 0.662 0 Bi
0 0 0 0 1
B-Spline Curve Fit
B1x B1 y 0.788 2.4139
B 2 x B2y 5.212 2.4139
0.0
0.788 2.414
Bi
5.213 2.414
6.0 0.0
B-Spline Curve Fit
B-Spline Curve Fit Question
n
P (t ) Ri ,k (t ) Pi , t min t t max
i 0
wi N i ,k (t )
Ri ,k (t ) n
N
j 0
j j ,k (t )
Non-Uniform third order Rational
Bspline basis fns for five control ponts
having weights for B3 (0, 0.25, 1.0, 5.0)
and other vertices have unit weight
Find points on non-uniform third order Rational B-
Spline curves at parmetric value 1.5. The curve is
defined by the five control points(B1(0 0), B2(1,2),
B3(2.5,0), B4(4,2), b5(5,0). The vertex B3 have weights
(0, 0.25, 1.0, 5.0) respectively other vertices have unit
weight.
Knot vector[0 0 0 1 2 3 3 3]
Final B-Spline curves
K=6 and n=8
Non-Uniform third order Rational B-Spline curves for
three control points having weights for B2 (0, 0.25, 1.0,
5.0) and others having weight 1.0, indicate straight line,
elliptical , parabolic and hyperbolic curves
2 2
P (t ) N i , 2 (t ) Pi wi / N i , 2 (t ) wi , t min t t max
i 0 i 0
2 2
P (t ) Pi N i , 2 (t ) wi / N i , 2 (t ) wi , 0 t 1
i 0 i 0
n
P' ' (u ) N ' 'i , p (u ) Pi , t min u t max
i 0
Derivatives of pth degree B-Spline
Curves
p p
N 'i , p (t ) N i , p 1 (t ) N i 1, p 1 (t )
ui p t i ui p 1 ui 1
Derivatives of Cubic B-Spline Curves
Curvature for B-Spline curves
k || P (u )XP (u ) || / || ( P (u )) ||
' '' ' 3
Derivatives of NURBS curves
wi N i ,k (t ) f1 (t )
Ri ,k (t ) n
f 2 (t )
N
j 0
j j ,k (t )
n
P ' (t ) R'i ,k (t ) Pi , t min t t max
i 0
Derivatives of NURBS curves
f '1 (t ) * f 2 (t ) f 2 ' (t ) * f1 (t )
R'i ,k (t )
f 2 (t ) * f 2 (t )
Derivatives of NURBS curves
• as a genuine generalizations of non-
rational B-spline forms
as well as rational and non-rational Bezier
curves and surfaces
• Offer a common mathematical form for
representing both standard
analytic shapes (conics, quadratics,
surface of revolution, etc) and
free-from curves and surfaces precisely. B-
splines can only
approximate conic curves.
Advantages of NURBS Curves
• Provide the flexibility to design a large
variety of shapes by using
control points and weights. increasing the
weights has the effect of
drawing a curve toward the control point.
• Have a powerful tool kit (knot
insertion/refinement/removal, degree
elevation, splitting, etc.
• Invariant under scaling, rotation, translation,
and projections.
• Reasonably fast and computationally stable.
• Clear geometric interpretations
Advantages of NURBS curves
• Serve as a genuine generalizations of
non-rational B-spline forms
as well as rational and non-rational Bezier
curves and surfaces
• Offer a common mathematical form for
representing both standard
analytic shapes (conics, quadratics,
surface of revolution, etc) and
free-from curves and surfaces precisely. B-
splines can only
approximate conic curves.
Advantages of NURBS curves
Advantages of NURBS curves
Advantages of NURBS curves
NURBS curves
NURBS curves representing circle
NURBS curves degree 3, degree 2
K=3
K=2
NURBS curve with degree 2
weight for point_2 2, 5
weight for point_2 10
Advantages of NURBS curves
Weight of p2 =0
Weight of p2 =.25
Weight of p2 =1
Advantages of NURBS curves
Weight of p2 =0
Weight of p2 =.25
Weight of p2 =1
Advantages of NURBS curves
Weight of p2 =5
NURBS representing uniform curve
NURBS Close to half circle
Weight of p2 is 0.707
NURBS
NURBS represented Half circle
Rational Uniform B-Spline
u x y
3 1.234 2.653
3.25 2.138 3.803
3.5 3.789 4.947
3.75 4.949 5.032
4.0 5.97 4.516
Rational Uniform B-Spline
u x y
3 1.234 2.653
3.25 2.138 3.803
3.5 3.789 4.947
3.75 4.949 5.032
4.0 5.97 4.516
Rational Uniform B-Spline have knot(0 1 2 3 4 5 6 7 )
u x y
3 0.6999 3.414
3.25 1.737 5.3690
3.5 4.211 8.07
3.75 6.313 9.032
4.0 8.383 8.383
Different between Bezier and B-Spline curves
Sr Bezier curve B-Spline curves
No.