You are on page 1of 31

ME/MF F342:

COMPUTER AIDED DESIGN

M2-4: Geometric Modeling of


Synthetic Curves: HCC
BITS Pilani Dr. Srinivasa Prakash Regalla
Department of Mechanical Engineering
Hyderabad Campus
Learning OBJECTIVES
 Geometric modeling of Hermite Cubic Curve:
 Derivative of parametric equation
 Matrix representation of the parametric equation
 Tangent vector and normal vector
 Computer evaluation of HCC
 Affine transformations of HCC

BITS Pilani, Hyderabad Campus


Hermite Cubic Spline Curve Segment
P’1
• “Splines” is a derivative from
“French curves or splines”. P1
• They are used to interpolate the
given cloud (or control) point P’0
data to design free-form curves.
• Hermite cubic spline is a Hermite-1

parametric cubic spline – with P0


degree equal to 3 and being
determined by two data points P4
Hermite-3
and tangent vectors at the data P2
points.
Hermite-4
• Hermite Cubic Spline can be a 3-
Hermite-2
P3
D planar curve or 3-D twisted P1
curve. Hermite-1

P0

Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 3
Simplified case: 3-D Planar Hermite Cubic Spline
• Z-component of both points is the same; P’1
similarly that of both tangent vectors is the
same. P1
• The XWYW plane of the current WCS is used
to define the data points and plane of curve P’0
• Then WCS data is transferred to MCS using
[T] Hermite-1

• The HCS curve segment is always cubic


P0
(fixed degree)
• It connects two data (end) points and utilizes
a cubic equation.
• Four conditions are required to determine
the coefficients of the equation – two end
points and the two tangent vectors at these
two points

Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 4
Parametric Equation of Hermite Cubic Spline Segment

3 P’1
P (u )   Ci u , i
0  u 1 P1
i 0

u  parameter
P’0
Ci  Polynomial(or algebraic) coefficeints
Hermite-1

P0

Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 5
In scalar form this equation is written as
x(u )  C3 x u 3  C2 x u 2  C1x u  C0 x
P’1
y (u )  C3 y u  C2 y u  C1 y u  C0 y
3 2

P1
z (u )  C3 z u 3  C2 z u 2  C1z u  C0 z
In expanded vector form P’0

P (u )  C3u 3  C2u 2  C1u  C0 Hermite-1

In matrix form P0

P (u )  [U ]T [C ]
where

[U ]  u 3
u 2
u 1  T
and [C ]  C3 C2  C1 C0 
T

[C ]  Coefficients vector

Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 6
The tangent v ector to the curve at any point is
3
P (u )   Ci iu i 1 , 0  u 1 P’1
i 0

Consider the cubic spline curve segment with the two endpoints Po and P1. P1
Applying the boundary conditions, Po , Po at u  0 and P1 , P1 at u  1, giving :
Po  Co P’0
Po  C1 Hermite-1

P1  C3  C2  C1  Co
P1  3C3  2C2  C1 P0

Solving the four equations simultaneously for the coefficients


Co  Po
C1  Po
C2  3P1  P0   2Po  P1
C3  2Po  P1   Po  P1
Substituting in the parametric equation and rearranging
     
P (u )  2u3 - 3u 2  1 Po  - 2u3  3u 2 P1  u 3 - 2u 2  u Po  u 3 - u 2 P1 
Po , P1 , Po and P1 are called as geometriccoefficients.
Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 7
Exercise:
A Hermite cubic curve is construted for the following control
points and tangent vectors. Estimate the point and
tangent vector at u=0.25.
P0=[1,1,1], P1=[8,5,4], P0’=[2,3,1], P1’=[4,1,3].

P (u )  2u3 - 3u 2  1Po  - 2u3  3u 2 P1  u 3 - 2u 2  u Po  u 3 - u 2 P1 P’1


Po , P1 , Po and P1 are called as geometriccoefficients. P1

P’0

Hermite-1

P0

BITS Pilani, Hyderabad Campus


P (u )  2u3 - 3u 2  1Po  - 2u3  3u 2 P1  u 3 - 2u 2  u Po  u 3 - u 2 P1
P’1
Po , P1 , Po and P1 are called as geometriccoefficients. P1

P’0

Hermite-1

P0

Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 9
P (u )  2u3 - 3u 2  1Po  - 2u3  3u 2 P1  u 3 - 2u 2  u Po  u 3 - u 2 P1
Po , P1 , Po and P1 are called as geometriccoefficients.

Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 10
Exercise: Find the matrix form of Hermite Cubic Curve.
Solution:
    
P (u )  2u 3 - 3u 2  1 Po  - 2u 3  3u 2 P1  u 3 - 2u 2  u Po  u 3 - u 2 P1   

[V ]  Po P1 
Po P1  geometric coefficient vector or boundary condition vector
F1 (u)  2u 3 - 3u 2  1 P’1

F2 (u)  -2u  3u 
3 2
P1
These are called blending functions.
F3 (u)  u - 2u  u 
3 2


F4 (u)  u - u
3 2
 P’0
P(u)  F1 (u)P0  F2 (u)P1  F3 (u)P0  F4 (u)P1 Hermite-1

P (u)  [U] T [M H ][V], 0  u 1


P0
[M H ]  Hermite matrix
2  2 1 1
3  3  2  1
Hermite matrix  [ M H ]   
0 0 1 0
 
 1 0 0 0 
Comparing P (u )  [U ]T [C ] and P (u )  [U ]T [ M H ][V ],
we obtain C  [ M H ][V ]
Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 11
Exercise: Find the tangent vector at any “u” and its
matrix form for Hermite cubic curve.
Solution: P’1
[V ]  M H  [C ]
1
P1
0 0 10
1 1 1
1
M H   
1
P’0
0 0 01
 
3 2 01
Similarly the tangent vector is written as
P (u )  6u  6u Po   6u  6u P1  3u  4u  1Po  3u  2u P1
P0
2 2 2 2

 [U ]T [ M H ]u [V ]
where
0 0 0 0
 6 6 3 3 
[M H ]  
u 
  6 6  4  2
 
 0 0 1 0 

Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 12
Exercise:
Prove that the basis functions of the Hermite cubic spline curve P’1
are symmetric. What is the consequence of this symmetry?
       
P1
P (u )  2u 3 - 3u 2  1 Po  - 2u 3  3u 2 P1  u 3 - 2u 2  u Po  u 3 - u 2 P1
Po , P1 , Po and P1 are called as geometric coefficients. P’0

P0

BITS Pilani, Hyderabad Campus


Solution Blank Space:

       
P (u )  2u 3 - 3u 2  1 Po  - 2u 3  3u 2 P1  u 3 - 2u 2  u Po  u 3 - u 2 P1
Po , P1 , Po and P1 are called as geometric coefficients.

P’1
P1
P1
u2
u2
P’0 -P’1
u1
u1

P0
P0
-P’0
BITS Pilani, Hyderabad Campus
P (u )  2u3 - 3u 2  1Po  - 2u3  3u 2 P1  u 3 - 2u 2  u Po  u 3 - u 2 P1
Po , P1 , Po and P1 are called as geometriccoefficients.

Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 15
Solution to Exercise: Prove that the basis functions of the Hermite cubic
spline curve are symmetric. What is the consequence of this
symmetry? P’1
3 2
Solution:F1(u1)=2 u1 -3 u1 +1; F2(u1)=-2 u1 +3 u1 3 2
P1
3 2 3
F3(u1)= u1 -2 u1 + u1; F4(u1)= u1 - u1 2 P 1

P(u)=F1(u1)P0+F2(u1)P1+F3(u1)P’0+F4(u1)P’1 u2 u2

Using linear reparameterization: P’0 -P’1


u1
u2=1- u1 or u1=1- u2 u 1

F1(u1)=2 (1-u2)3-3 (1-u2)2+1 = F2(u2) P0


3 2
F2(u1)=-2 (1-u2) +3 (1-u2) = F1(u2) P 0
-P’0
F3(u1)= (1-u2)3-2 (1-u2)2+ (1-u2)
=1-u23-3u2 +3u22 -2-2u22+4u2+1-u2 = - u23+ u22 = - F4(u2)
F4(u1)= (1-u2)3- (1-u2)2 = 1 – u23 - 3u2 + 3u22 -1- u22 + 2u2
= – u23 + 2 u22 - u2 = - F3(u2)
Substituting: P(u)= F2(u2)*P0+ F1(u2)*P1 - F4(u2)*P’0 - F3(u2)*P’1
= F1(u2)*P1 + F2(u2)*P0 - F3(u2)*P’1 - F4(u2)*P’0
Proved: Reversing the direction of parameterization preserves the shape of
the Hermite cubic curve, but only the end points get interchanged and
tangent vectors get reversed.
Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 16
Exercise: Why Hermite “Cubic”
Spline is not curvature
continuous at joint or blend
points between segments?

Hermite-2

Hermite-1

Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 17
Blank Space for Solution:

       
P (u)  2u 3 - 3u 2  1 Po  - 2u 3  3u 2 P1  u 3 - 2u 2  u Po  u 3 - u 2 P1
P (u)  6u  6u P   6u  6u P  3u  4u  1P  3u  2u P 
Hermite-1
2 2 2 2
Hermite-2
o 1 o 1

Hermite-2
Hermite-1

BITS Pilani, Hyderabad Campus


Solution:
Let for the first curve segment’s data be
Po, P’o, P1 and P’11
And the second curve segment’s data be Hermite-1
Hermite-2

P1, P’12, P2, P’2.


Also given is, P’11=R and P’12=KR, where K is
a constant. Hence at the JOINT,
P’11=R=[Rx Ry Rz]T, P’12 = KR=[KRx KRy
KRz]T
Slopes at joint are S11x=Ry/Rx, S11y=Rz/Ry,
S11z=Rz/Rx, and
S12x=KRy/KRx=Ry/Rx =S11x, and so on.
Thus the two curves have C1 or slope
continuity at P1.
Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 19
       
P (u)  2u 3 - 3u 2  1 Po  - 2u 3  3u 2 P1  u 3 - 2u 2  u Po  u 3 - u 2 P1
P (u)  6u  6u P   6u
2
o
2
 6u P  3u  4u  1P  3u  2u P 
1
2
o
2
1

Looking at the curvature continuity,


P’’(u)=(12u-6)Po+(-12u+6)P1+(6u-4)P’o+(6u-
2)P’1
This equation gives the curvature vector for
the two segments at P1 as
P’’11=P’’(1)=6Po- 6P1+2P’o+4R, and
P’’12=P’’(0)=-6P1+6P2 - 4KR - 2P’2 Hermite-1
Hermite-2

Which evidently are not same.


Thus, the Hermite cubic spline curve
segments do not offer C2 continuity at the
joints or blending points, though they have
C2 continuity elsewhere on each segment.
Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 20
Exercise
Find the normal unit vectors for a given tangent vector
which is two-dimensional.
Consider 2 - D.
X - Y plane rotation only. Y

x*  r cos     r cos cos  r sin  sin 


 x cos  y sin 
y*  r sin     r sin  cos  r cos sin  n2
θ=90 n1
 x sin   y cos α
 x * cos  sin  0  x 
 y *    y
    sin  cos 0   X
1   0 1 1 
 0

BITS Pilani, Hyderabad Campus


BITS Pilani, Hyderabad Campus
Normal at a point on Hermite Cubic
Spline
n2
n3 P1

P2

n1
Po

n1=(P1 – Po)/|P1 – Po| and n2=P’2/|P’2|


n4=n1×n2/|n1×n2| and the normal vector therefore
is n3=n4×n2/|n4×n2|
Another simpler method using our thumb rule is
n3x=-n2y and n3y=n2x
Because n2 and n3 form a anti-clockwise pair of
perpendicular unit vectors.
Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 23
Exercise: For points A=[1,2] and B=[3, 1] with corresponding
slopes 600 and 300, write the formulation of Hermite cubic spline.

x(0)  1 x(1)  3 x' (0)  cos 60 x' (1)  cos 30


y (0)  2 x(1)  1 y ' (0)  sin 60 y ' (1)  sin 30

 2 2 1 1  1 
 3 3  2  1  3 

x(u )  u u u 1 
3 2
0
 0 1
 
0  cos 60
  
1 0 0 0  cos 30
 2 2 1 1  2 
 3 3  2  1  1 

y (u )  u u u 1 
3 2
0
 0 1
 
0  sin 60 *
  
1 0 0 0  sin 30
*
x(u )  1  0.5u  4.13u 2  2.63u 3
y (u )  2  0.86u  5.23u 2  3.36u 3
P(u )  [ x(u ) y (u )]T

Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 24
Generating the hermit curve in Excel

Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 25
Exercise:

Suggest suitable set of control points and tangent vectors to


generate each of the following shapes of Hermite cubic
curves. Verify by writing Matlab program.

BITS Pilani, Hyderabad Campus


Exercise:
Plot the four blending functions of the Hermite cubic curve
using a Matlab code and comment on their behaviour.
Solution:
P(u)  F1 (u)P0  F2 (u)P1  F3 (u)P0  F4 (u)P1 0  u 1

F1 (u)  2u 3 - 3u 2  1

F2 (u)  -2u  3u 
3 2

F3 (u)  u - 2u  u 
3 2


F4 (u)  u 3 - u 2 

BITS Pilani, Hyderabad Campus


Exercise:
Y
Evaluate by writing a computer
program and find the shape of the P0
planar Hermite curve if
P(0) = [2, 3,0], P(1) = [4, -2,0], slope at
P0 is 30 and slope at P1 is -45.
X
P1

BITS Pilani, Hyderabad Campus


Exercise:

Show that the HCC is invariant in affine translational


transformation and also that translational
transformation does not change the shape of HCC.
Solution:
P  U  M H V  P *  P  U  [ M H ]D  
T T


[U ]T  u 3 u2 u 1  2  2 1 1  d 
  3  2  1  
[V ]  Po Po P1  d 
T
T 3
P1 P  P  U 
*
0 0 1 0  0 
P *  U  M H V    
T *
 1 0 0 0  0 
V *  V   D 0 
P *  U  M H   V   D  
T

D  d d 0 0T
 
T 0 
 P  u u u 1   P d
3 2

0 
P *  U  M H V   U  M H D  d 
T T

 P  U  M H D  P '*  P '


T

BITS Pilani, Hyderabad Campus


Exercise:

Show that the scaling transformation does not change


the shape of HCC.

Solution:

P *  U  M H V 
T *

V *  sV   uniform scaling


V *  sP0 sP1 sP0 ' sP1 '
P *  U  M H V   sU  M H V   sP
T * T

BITS Pilani, Hyderabad Campus


End of the topic
• Any questions?

Dr. Srinivasa Prakash Regalla, Professor, Mechanical Engineering, BITS-Pilani Hyderabad Campus 31

You might also like