Download as pdf or txt
Download as pdf or txt
You are on page 1of 11

ME F318: Computer Aided Design

Tutorial/Assignment - 4

BITS Pilani
Hyderabad Campus
Tutorial Problems
T1. For the quadratic B-spline curve developed for 4 control points, (a) find the parametric equation of the B-spline curve, and (b) prove that
the curve is tangent to the mid-point of the internal control polygonal segment. The control points are given by:
1 4 10 8
P0   , P1   , P2   , P3   
1 4 5 1

T2. A Bezier curve is defined for the following four control points.

1 4 10 8


P0   , P1   , P2    P3   
1 4 5 1
By estimating the mid-point of the curve before and after transformation, prove that the Bezier curve remains invariant
under affine rotational transformation by 60 about the z-axis.

BITS Pilani, Hyderabad Campus


T1 Solution
(a) n+1=4; n=3; k-1=2, k=3.

umax = n-k+2 = 3-3+2 = 2.

n+k+1=3+3+1=7

Knot vector uj =u 0 u1 u 2 u 3 u 4 u 5 u 6  = [0,0,0,1,2,2,2]

Pu    Pi N i.k (u )   Pi N i.3 (u )


n 3

i 0 i 0
 P0 N 0,3 (u )  P1 N 1,3 (u )  P2 N 2,3 (u )  P3 N 3,3 (u )
N 0, 2 (u ) N 1, 2 (u ) N 2, 2 (u ) N 3, 2 u  N 4, 2 u 
N 0,1 (u ) N 1,1 (u ) N 2,1 (u ) N 3,1 u  N 4,1 u  N 5,1 u 

BITS Pilani, Hyderabad Campus


T1 Solution
N i , k 1 (u ) N i 1, k 1 (u )
N i , k (u )  (u  ui )  (ui  k  u )
(ui  k 1  ui ) (ui  k  ui 1 )
where
1, ui  u  ui 1
N i ,1  
0, otherwise

1 u0 1 0  u  1
N 0,1  N 1,1  N 2,1 
0 elsewhere 0 elsewhere
1 1  u  2 1 u2
N 3,1   N 4,1  N 5,1  
0 elsewhere 0 elsewhere

BITS Pilani, Hyderabad Campus


T1 Solution

N i , k 1 (u ) N i 1, k 1 (u )
N i , k (u )  (u  ui )  (ui  k  u )
(ui  k 1  ui ) (ui  k  ui 1 )
where
1, ui  u  ui 1
N i ,1  
0, otherwise
N 0,1 (u ) N 1,1 (u ) N 0,1 (u ) N 1,1 (u )
N 0, 2 (u )  (u  u 0 )  (u 2  u )  (u  0)  (0  u ) 0
(u1  u 0 ) (u 2  u1 ) (0  0) (0  0)
N 1,1 (u ) N 2,1 (u ) N 1,1 (u ) N 2,1 (u )
N 1, 2 (u )  (u  u1 )  (u 3  u )  (u  0)  (1  u )  1  u N 2,1 (u )
(u 2  u1 ) (u 3  u 2 ) (0  0) (1  0)
N 2,1 (u ) N 3,1 (u ) N 2,1 (u ) N 3,1 (u )
N 2, 2 (u )  (u  u 2 )  (u 4  u )  (u  0)  (2  u )  uN 2,1 (u )  2  u N 3,1 (u )
(u 3  u 2 ) (u 4  u 3 ) (1  0) (2  1)
N 3,1 (u ) N 4,1 (u ) N 3,1 (u ) N 4,1 (u )
N 3, 2 (u )  (u  u 3 )  (u 5  u )  (u  1)  (2  u )  u  1N 3,1 (u )
(u 4  u 3 ) (u 5  u 4 ) (2  1) (2  2)
N 4,1 (u ) N 5,1 (u ) N 4,1 (u ) N 5,1 (u )
N 4, 2 (u )  (u  u 4 )  (u 6  u )  (u  2)  (2  u ) 0
(u 5  u 4 ) (u 6  u 5 ) (2  2) (2  2)

BITS Pilani, Hyderabad Campus


T1 Solution

Pu   P0 N 0,3 (u)  P1 N1,3 (u)  P2 N 2,3 (u)  P3 N 3,3 (u)


Pu   P0 (1  u ) 2 N 2,1 (u )  P1 u 1  u N 2,1 (u ) 
2  u  uN (u )  2  u N (u ) 
2 ,1 3,1 
 2 
u 
P2  uN 2,1 (u )  2  u N 3,1 (u ) 2  u (u  1) N 3,1 (u )  P3 u  1 N 3,1 (u )
2

2 
Writing N2,1 and N3,1 terms separately, we get the parametric equation in
two segments.
  u 2  u  u 2 
 P0 (1  u )  P1 u 1  u  
2
  P2  , 0  u  1
  2  2
Pu   
P  2  u 2


 u 2  u  
 2  u (u  1)  P3 u  1 , 1  u  2
2

  2 
1  P2
  2 

BITS Pilani, Hyderabad Campus


T1 Solution

(b) For four control points, there is only one internal control polygonal segment from P1 to P2. Its midpoint is = (P1+P2)/2
= ([4;4]+[10;5])/2 = [7, 4.5], which should occur on the curve at u = 1. We may use either of the two segments of the B-
spline to prove it. Using the second segment:

4 2  12  1012  1  8


P1    
    2  1(1  1)    1  1 , 1  u  2
2

4 2   5  2  1
1 4 1 10 7
       0    proved.
2 4  2  5  4.5
The tangent vector along the control polygonal segment is P2-P1 = [10;5]-[4;4]=[6;1]. To prove that the curve is tangent at
this point, find the tangent vector on the B-spline curve at u = 1.

  2 P0 (1  u )  P1 2  3u   P2 u, 0  u  1
P' u   
 P1 2  u   P2 (1  u )  3  2u   2 P3 u  1, 1  u  2

BITS Pilani, Hyderabad Campus


T1 Solution
Using the second segment again:

4 10 8


P' u  1   2  1   (1  1)  3  2 * 1  2 1  1
4 5 1
4 10 6
         proved
4  5  1

BITS Pilani, Hyderabad Campus


T2 Solution

Bezier curve remains invariant in shape hence transformation of the control points is sufficient to transform the whole curve.

Hence, the location of the midpoint before transformation:


P(u=0.5) = (1-0.5)^3*[1,1]+3*(0.5)*(1-0.5)^2*[4,4]+3*(0.5)^2*(1-0.5)*[10,5]+( 0.5)^3*[8,1]
=[6.3750, 3.6250].

The location of the point with transformed control points with [T] as the rotational transformation is:

P*(u=0.5) = (1-1/3)^3*[T]*[P0] +3*(1/3)*(1-1/3)^2*[T]*[P1]+3*(1/3)^2*(1-1/3)*[T]*[P2]+(1/3)^3*[T]*[P3]


Taking [T] common:

P*(u=0.5) = [T]*P(u=0.5)= [T]* [6.3750, 3.6250]

BITS Pilani, Hyderabad Campus


T2 Solution

cos60  sin 60 0 0
 sin 60 cos60 0 0
[T ]  
 0 0 1 0
 
 0 0 0 1

P*(u=0.5) = [cosd(60), -sind(60),0,0;sind(60), cosd(60),0,0;0,0,1,0;0,0,0,1]* [6.3750; 3.6250;0;1]


= [0.0482; 7.3334; 0; 1.0000]

BITS Pilani, Hyderabad Campus


Assignment Problem

(A) The first three of the four control points of a Bezier curve are as given below. At a value of the parameter u in its range the
point is [6.83, 4.72]. The sum of the first three Bernstein polynomials is 0.65. Find the point and tangent vector at u/m, where
m is the average of the last three digits in your ID number.

2 3 7


P0   , P1   , P2   
2 4 5

BITS Pilani, Hyderabad Campus

You might also like