You are on page 1of 170

Lecture on

B-Spline Curves

Prof.(Dr.)- Kailash Jha


Dept. of Mech. Engg.
Needs of B-Spline curves
1. The degree of a B-Spline polynmial can be
set independently of the number of control
points.

2. B-Splines allow local control over the


shape of a spline curve
3. Better control on shape of the curve
4. Any curves can be represented by B-Spline
5. No overshooting problem
B-Splines
• The equation for a B-Spline is
n
P (t )   N i ,k (t ) Pi , t min  t  t max
i 0
• Ni,k(t) is the basis function of control point Pi.
Ni,k(t) is defined recursively(Cox De-Boor
equation):

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 ik
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

2. Uniform and Periodic knot_vector is given as


T =[0 1 2 3 4 5 6 --------n+k+1]
Where n is one less than the number control
Points and k is the degree of the curve

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

Open uniform basis function for n=2, k=2


and knot vector is [0 0 0 1 1 1]
Basis function calculation For n=3, k=2,Knot_vector[0001222]

t  ti tik 1  t
Ni,k (t)  Ni,k 1(t)  Ni1,k 1(t)
0  u 1 tik  ti tik 1  ti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(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)  tik1  t N (t)
i ,k i,k 1 i 1,k 1
tik  ti tik 1  ti1
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

Open uniform basis function for n=3, k=2


and knot vector is [0 0 0 1 2 2 2]
Find points on different ordered open uniform 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 3 9 0

3 6 3 0

4 9 6 0

u=.2, k =3, u=1.5, k =3


n
P(t )   N i ,k (t ) Pi , t min  t  t max
i 0

P(.2)  (1 0.2) )P0  .2(4  3*.2 ) / 2P2  (.2 / 2)P2


2 2

P(0.2)  (.64)P0  .34P1  .02P2


P(0.2)  (1.14, 3. 22)
P(1.5)  (2 1.5) / 2)P1  (3*1.5  8*1.5  4) / 2P2  ((1.5 1) )P3
2 2 2

u=.2, k =3, p(0.2) = ( 1.14 , 3.22 )


u=1.5 k =3, p(1.5) = ( 6.6 , 4.4 )
n
P' (t )   N 'i ,k (t ) Pi , t min  t  t max
i 0

P' (.2)  2(u 1) )P0  (4  6*u ) / 2P2  (u)P2

P(0.2)  (.64)P0  .34P1  .02P2


P(0.2)  (1.14, 3. 22)
P' (1.5)  (2 1.5) / 2)P1  (3*1.5  8*1.5  4) / 2P2  ((1.5 1) )P3
2 2 2

u=.2, k =3, p(0.2) = ( 1.14 , 3.22 )


u=1.5 k =3, p(1.5) = ( 6.6 , 4.4 )
Non-uniform Basis function for knot vector(00011333), n=4, k=2
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)
N[2][0]=1 N[1][2]=(1-u)(u-0)/(1-0)+u(1-u)/(1-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 tik 1  t
N[5][0]=0
Ni,k (t)  Ni,k 1(t)  Ni1,k 1(t)
tik  ti tik 1  ti1
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 tik 1  t
Ni,k (t)  Ni,k 1(t)  Ni1,k 1(t)
tik  ti tik 1  ti1
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[1][0]=0 N[0][2]= ]=(1-u)(1-u)


N[1][1]=(1-u)
N[2][0]=1 N[1][2]=(1-u) ( u-0)/(1-0) + u(2-u)/(2-0)
N[2][1]=(u)
N[3][0]=0 N[2][2]= u *(u-0)/(2-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] 2u3
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

5 6 0 u=.2, k =2, u=1.5, k =2


n
P (t )   N i , k (t ) Pi , t min  t  t max
i 0
P(.2)  (1 0.2) )P0  .2(4  3*.2 ) / 2P2  (.2 / 2)P2
2 2

P(0.2)  (.64)P0  .34P1  .02P2


P(0.2)  (.64)(0,0)  .34(.41,1.38)  .02(3,2.87)
P(0.2)  (0. 2, 0. 5226)
P(1.5)  (2 1.5)2 / 2)P1  (2*1.52  6*1.5  3) / 2P2  ((1.5 1)2 / 2)P3
P(1.5)  (.125)P1  (.75)P2  (.125) )P3
u=.2, k =3, p(0.2) = ( 1.14 , 3.22 )
u=1.5, k =3, p(1.5) = ( 3.0 , 2.5 )
u=2.5, k =3, p(2.5) = ( 5.5 , 1.0 )
n
P (t )   N i , k (t ) Pi , t min  t  t max
i 0

P(2.5)  (3  3.5)2 / 2)P1  (3*2.52 14*2.5 15) / 2P2  ((2.5  2)2 )P

P(2.5)  (.125)P1  (.625)P2  (.25)P3

P(2.5)  (.125)(3,2.874)  (.625)(5.591,1.38)  (.25)(6,0)

P(2.5)  (.125)(3,2.874)  (.625)(5.591,1.38)  (.25)(6,0)

u=2.5, k =2, p(2.5) = ( 5.369 , 1.222 )


Basis function for n=5, k+1 =3
Knot Vector = [0 0 0 12 3 4 4 4] 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)
N[1][1]=(1-u)
N[2][0]=1 N[1][2]=(1-u) ( u-0)/(1-0) + u(2-u)/(2-0)
N[2][1]=(u)
N[3][0]=0 N[2][2]= u *(u-0)/(2-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
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) = (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
2u3
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
3u  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

Periodic basis function for n=3, k=2 and


knot vector is [0 1 2 3 4 5 6]
5-13. Find the four order Uniform
BSpline Curves defined by the
following four control
points((0,0), (3,9), (6,3), (9,6)).
The uniform knot_vector for
above case will be [0 1 2 3 4 5 6 7
]
k  u  n 1
where k is degree of the curve
3  u  4
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]=(4-u)(4-u)/2 *(4-u)/(3-0)
N[2][0]=0 N[1][2]=(4-u)(4-u)/(4-2)
N[2][1]=(4-u) N[1][3]=]=(4-u)(4-u)/2 *(u-1)/(4-
1)+(]=(4-u)(u-2)/(4-2)+ (u-3)*(5-
u)/(5-3)) *(5-u)/(5-2)
-N[3] N[2][2]=(4-u)(u-2)/(4-
[0]=1 2)+ (u-3)*(5-u)/(5-3)
N[3][1]=(u-3) N[2][3]=(]=(4-u)(u-2)/(4-2)+ (u-
3)*(5-u)/(5-3))*(u-2)/(5-2) +(]=(4-
u)(u-2)/(4-2)+ (u-3)*(5-u)/(5-3))
*(6-u)/(6-3)

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

(a) Uniform (b) non-uniform with knot proportional to chord


Length (c) non-uniform same as (b) with double vertex at B2
Non-Uniform B-Spline Example 5-14
Non-Uniform B-Spline Example 5-14
Non-Uniform B-Spline Example 5-14
Non-Uniform B-Spline Example 5-14
Non-Uniform B-Spline Example 5-14
Non-Uniform quadratic B-Spline
Example 5-14(Fig 5-50(b)
Non-Uniform B-Spline Example 5-14
Non-Uniform B-Spline Example 5-14
Uniform B-Spline Example 5-14

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]

3rd order Uniform B-


Spline
Curves for knot=
[0 1 2 3 4 5 6 7 8]
B-Spline Basis Functions
(Important Properties )
1 if ti  u  ti 1
N i , 0 (0)  
0 otherwise
u  ti ti  k 1  u
N i ,k (u )  N i ,k 1 (u )  N i 1,k 1 (u )
ti  k  ti ti  k 1  ti 1
1. Ni,p(u) is a degree k polynomial in u.

2. Nonnegativity -- For all i, p and u, Ni,k(u) is non-


negative

3. Local Support -- Ni,k(u) is a non-zero polynomial


on [ti, ti+k+1)
B-Spline Basis Functions
(Important Properties )
4. On any span [ti, ti+1), at most k+1 degree p basis
functions are non-zero, namely: Ni-k,k(u), Ni-k+1,k(u),
Ni-k+2, k(u), ..., and Ni,k(u) .

5. The sum of all non-zero degree k basis functions on


span [ti, ti+1) is 1.

6. If the number of knots is m+1, the degree of


the basis functions is k, and the number of
degree p basis functions is n+1, then m = n
+ k+ 1
B-Spline Basis Functions
(Important Properties )
7. Basis function Ni,k(u) is a composite curve of
degree k polynomials with joining points at
knots in [ti, ti+k+1 )

8. At a knot of multiplicity p, basis function


Ni,k(u) is Ck-p continuous.
Increasing multiplicity decreases the
level of continuity, and increasing
degree increases continuity.
B-Spline Curves
Important Properties
B-Spline Curves
Important Properties

1. B-spline curve C(u) is a piecewise curve with


each component a curve of degree k.
 ٍExample: where n = 10, m = 14 and k =

3, the first four knots and last four knots are


clamped and the 7 internal knots are
uniformly spaced. There are 8 knot spans,
each of which corresponds to a curve
segment.
B-Spline Curves Important Properties

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

If u is in knot span [ui, ui+1), there are only k+1 basis


functions (i.e., Ni,k(u), ... , Ni-k+1,p(u), Ni-k, k(u)) non-
zero on this knot span. Since Np,k(u) is the
coefficient of control point Pp, onlyk+1 control
points Pi, Pi-1, Pi-2, .., Pi-k have non-zero
coefficients. Since on this knot span the basis
functions are non-zero and sum to 1, their
"weighted" average, C(u), must lie in the convex
hull defined by control points Pi, Pi-1, Pi-2, .., Pi-k.
The meaning of "strong" is that while C(u) still lies
in the convex hull defined by all control points, it
B-Spline Curves Important Properties

5. Local Modification Scheme:


changing the position of control point
Pi only affects the curve C(u) on
interval [ti , ti+k+1).
 The right figure shows the result of moving P2 to
the lower right corner. Only the first, second and
third curve segments change their shapes and all
remaining curve segments stay in their original
place without any change.
B-Spline Curves Important Properties
 A B-spline curve of degree 4 defined by 13 control points
and 18 knots .
 Move P6.
 The coefficient of P6 is N6,4(u), which is non-zero on [u6,
u11). Thus, moving P6 affects curve segments 3, 4, 5, 6
and 7. Curve segments 1, 2, 8 and 9 are not affected.
B-Spline Curves Important Properties

6. C(u) is Ck-p continuous at a knot of multiplicity


p:
If u is not a knot, C(u) is in the middle of a
curve segment of degree k and is therefore
infinitely differentiable. If u is a knot in the
non-zero domain of Ni,k(u), since the latter is
only Ck-pcontinuous, so does C(u).
The above B-spline curve has 18 control points
(i.e., n = 17), degree 4, and the following
clamped knot vector

t0 to t4 t5 t6 and t7 t8 t9 to t11 t12 t13 to t16 t17 t18 to t22


0 0.125 0.25 0.375 0.5 0.625 0.75 0.875 1
6. Thus, t6 is a double knot, t9 is a triple knot
and t13 is a quadruple knot. Consequently, C(u) is
of C4 continuous at any point that is not a
knot, C3 continuous at all simple
knots, C2continuous at t6, C1 continuous
at t9, C0 continuous at t13. All points on the curve
that correspond to knots are marked with little
triangles. Those corresponding to multiple knots
are further marked with circles and their
multiplicities. It is very difficult to visualize the
difference between C4, C 3 and even C2 continuity.
For the C1 case, the corresponding point lies on a
leg, while the C0 case forces the curve to pass
through a control point.
7. Affine Invariance: The affine invariance property
also holds for B-spline curves. If an affine
transformation is applied to a B-spline curve, the
result can be constructed from the affine images
of its control points. This is a nice property.
When we want to apply a geometric or even
affine transformation to a B-spline curve, this
property states that we can apply the
transformation to control points, which is quite
easy, and once the transformed control points
are obtained the transformed B-spline curve is
the one defined by these new points. Therefore,
we do not have to transform the curve.
B-Spline Curves Important Properties
8. Variational diminishing property The
variation diminishing property also
holds for B-spline curves. If the curve
is in a plane (resp., space), this
means no straight line (resp., plane)
intersects a B-spline curve more times
than it intersects the curve's control
polyline.
In the above figure, the blue line intersects
both the control polyline and the B-spline
curve 6 times, while the yellow line also
intersects the control polyline and the B-
spline curve 5 times. However, the orange
line intersects the control polyline 6 times
and the curve 4 times.
Techniques to control BSpline
Curves
1. Move the control points.
2. Add or remove control points.
3. Use multiple control points.
4. Change the order, k.
5. Change the type of knot vector.
6. Change the relative spacing of
the knots.
7. Use multiple knot values in the
knot vector.
Effect of moving control points B5
Effect of moving control points B4 on
closed quadratic B-Spine curves
Effect of inserting control points
Effect of deleting a control points
Effect of order on B-Spline Curves
 A B-spline curve that is defined by 6
control point, and shows the effect of
varying the degree of the polynomials
(2,3, and 4)
 Q3 is defined by P0,P1,P2,P3
 Q4 is defined by P1,P2,P3,P4
 Q5 is defined by P2,P3,P4,P5


Each curve segment

shares control points.


Effect of degree on B-Spline Curves
Effect of multiplicity of Control Points on
open uniform B-Spline curves
Effect multiplicity of Control Points in uniform B-Spline curves
Effect multiplicity of knot vectors
Effect multiplicity of knot vectors and
control points(5-14)
Effect multiplicity of knot vectors and
control points
Technique to impose the end
conditioning in uniform Bspline curve
Closed B-Spline Curves

 To construct a closed B-spline curve C(u)


of degree p defined by n+1 control
points ,the number of knots is m+1, We
must:
1. Design an uniform knot sequence of m+1
knots: u0 = 0, u1 = 1/m, u2 = 2/m, ..., um =
1. Note that the domain of the curve is [ up,
un-p].
2. Wrap the first p and last p control points.
More precisely, let P0 = Pn-p+1, P1 = Pn-
Closed B-Spline Curves
Closed B-Spline Curves
 Example. Figure (a) shows an open B-spline
curve of degree 3 defined by 10 (n = 9)
control points and a uniform knot vector.
 In the figure, control point pairs 0 and 7,
Figure (b), 1 and 8, Figure (c), and 2 and 9,
Figure (d) are placed close to each other to
illustrate the construction.
Closed B-Spline Curves

a b
Closed quadratic Periodic B-Spline

Control points B1B2B3B4B5B6B7B8B1B2


B-Spline Curve Fit
n
P(t )   N i ,k (t ) Pi , t min  t  t max
i 0
B-Spline Curve Fit
B-spline Curve Fit formulation

 
 
If N is not
 
square matrix
 
Techniques to find parametric value of
input points
1. Proportional Technique
2. Chord length approximation
3. Centripetal

In the first technique parametric value of


points is uniformly increasing for
minimum value( Umin) of knot to
maximum its maximum value(Umax).
Knot_vector = (Umin, Umin+1, Umin+2,
Umin+3, ------- Umax)
Determination of parametric value continue

In second technique the parametric value is in


proportional to the chord length of the input points.
U0 =0;
Ui = Ui-1 +li/Σli (li = Chord lengh between i+1 to i point)

In third technique the parmetric value of input point


is in order of square roots of the chord length
U0 =0;
Ui = ui-1 + sqrt(li) /Σsqrt(li)
B-Spline Curve Fit Problem

Given quadratic B-Spline curves with five control points


Assume Open uniform knot vectors (0 0 0 1 2 3 3 3)
Use chord length approximation for parameterisation
Parametric value of input points will be
multiplied by rang of u(3), t0 =0, t1= .
918, t2=1.5, t4 = 2.07 and t5 =3)

0  u 1 1 u  2

N[0][2]= ]=(1-u)(1-u) N[1][2]= ]= (2-u)(2-u)/(2-


0)
N[1][2]=(1-u) ( u-0)/(1-0) + N[2][2]= (2-u)(t-0)/2+ (u-1)
u(2-u)/(2-0) (3-u)/(3-1)
N[2][2]= u *(u-0)/(2-0) N[3][2]= (u-1)(u-1)/(3-1)
2u3

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)

N[1][2]=(1-u)(u-0)/(1-0) +u(2-u)/(2-0) N[2][2]=(2-u)(u-0)/(2-0)


+(u-1)/(2-u)/(2-1)

N[2][2]=u(u-0)/(2-0) N[3][2]= (u-1)(u-1)/(2-1)


U=0 U=1.0
U=1.62
N 0, 2 (0)  1 N1, 2 (u )  0.0
N1, 2 (u )  0.188
N 1, 2 ( 0 )  0 N1, 2 (u )  0.5
N 2, 2 (u )  0.622
N1, 2 (u )  0.5
N 2, 2 (u )  0 N 3, 2 (u )  0.15
U=0.62
N 0, 2 (u )  0.15 U=2.0
N1, 2 (u )  0.622 N1, 2 (u )  0
N 2, 2 (u )  0.188
N 2,2 (0)  0
N 3, 2 (0 )  1
B-Spline Curve Fit by four control points

N is not a square matrix, inverse can not be done,


N can be converted into square matrix by
multiplying both side of equation by
B-Spline Curve Fit
B-Spline Curve Fit

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

0.225   1.0225 0.0993 0.0282 0 


3.339 0.7246  0.993 0.7236 0.4989 0.282 
   
 .0282 0.4989 0.7236 0.993
Bi
4.761 0.4989  
   0 .0282 0.993 1.022 
6.675 0.3 

0.7236 0.4989  B1x


 .4989 .7236  
  B2 x
B1 y 
B2y   3.339 0.7246
 4.761 0.4989
 
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

Interpolate following four points by


Open Uniform quadratic B-Spline
quadratic:
P0(0 0 0), P1(15 20 0), P2(30 25
0), P3(70 20 0).
Assum four contro points
Knot Vector =[0001222] n=3,k=2
First task to Calculate the parametric
Value of input point. There are three
method are available
Non-Uniform Rational B-Spline(NURBS) Curves
n n
P(t )   N i ,k (t ) Pi wi /  N i ,k (t ) wi , t min  t  t max
i 0 i 0

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

P(t )  ((1  t )(1  t ) P0W0  2 * (1  t )(t ) P1W1  (t )t ) P2W2 ) /


((1  t )(1  t )W0  2 * (1  t )(t )W1  (t )tW2 ) )
Weights of B2 create different nature of curves
Non-Uniform Rational Bspline Curves
Knot Vector = [n=6, k=2]

Knot Vector = [n =8, k=2]


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
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
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]=(2-u)(2-u)/(2-1)
N[3][1]= (2-u)/(2-
1)
N[4][0]=1 N[3][2]= (2-u)(u-1)/(2-1)+(u-1)
(2-u)/(2-1)
N[4][1]=(u-1)/(2-
1)
N[5][0]=0 N[4][2]= (u-1)(u-1)/(2-1)
N[5][1]=0
N[6][0]=0
2<=u<3
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]=0
N[3][1]= 0
N[4][0]=0 N[3][2]= 0
N[4][1]=0
N[5][0]=0 N[4][2]= (3-u)(3-u)/(3-2)
N[5][1]=(3-u)/(3-2)
N[6][0]=1 N[5][2]=(3-u)(u-2)/(3-1) + (u-
2)(3-u)/(3-2)
N[6][1] =(u-2)/(3-2)
N[7][0]=0 N[6][2]=(u-2)(u-2)/(3-2)
NURBS Curve
Derivatives of pth degree B-Spline
Curves
n
P' (u )   N 'i , p (u ) Pi , umin  u  umax
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

Knot vector[0 0 0 0.5 0.5 1 1 1


NURBS represented Half circle
NURBS represented 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.

1. Bezier curve is global in nature B-Spline curves are local in


nature
2. Degree of curves is one less than the Degree will be any valyes
number of contro points less than the number of
control poinrs.
3. It is a single curves It is a composite curves

4. It is k times continues It is k-1 time continuous


where k is degree of curve
Difference continue
Sr No. Coons Patch B-Spline Surface
5. It is subset of B-Spline Bezier is a special B-Spline
having order equal to number
of control points
6. Convex hull properties is global Convex hull properties local in
nature
7. All the basis functions is non Only k+1 basis function will be
zero non-zero
8. Modeling of curves not passing It is possible to model a curve
through end points is difficult. non passing through end
points.
9 Less controlling parameters More controlling parameters( knot
vectors, degrees)
References
[1] D.E. Rogers & J.A. Adams, “Mathematical Element for
Computer Graphics” , 2nd Edition, 2002
[2] M.E. Mortenson, “Geometrical Modeling” , 2nd Edition, 1997
[3] The Essentials of CAGD by Gerald Farin & DCH, AK Peters
[4] Ken Joy’s CAGD notes (UC Davis)
http://graphics.cs.ucdavis.edu/CAGDNotes/homepage.html
[5] Jorg Peters’ UFL SurfLab group
http://www.cise.ufl.edu/research/SurfLab/index.html
[6] OpenGL Red Book – Chapter 12

You might also like