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

COMPUTER AIDED ANALYSIS &

DESIGN
BITS Pilani Dr. Kurra Suresh
Pilani Campus
Hermite Cubic Spline Curve
Segment

 Interpolation curve

 It can be represented in three different forms


– Algebraic form

– Geometric form

– Four point form

BITS Pilani, Pilani Campus


Parametric Equation of
Hermite Cubic Spline Segment

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

u  parameter
Ci  Polynomial(or algebraic) coefficein ts

BITS Pilani, Pilani Campus


Parametric Equation of
Hermite Cubic Spline Segment
In scalar form this equation is written as
x(u )  C3 x u 3  C2 x u 2  C1x u  C0 x
y (u )  C3 y u 3  C2 y u 2  C1 y u  C0 y
z (u )  C3 z u 3  C2 z u 2  C1z u  C0 z
In expanded vector form
P (u )  C3u 3  C2u 2  C1u  C0
In matrix form
P (u )  [U ]T [C ]
where

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

[C ]  Coefficien ts vector
BITS Pilani, Pilani Campus
Parametric Equation of
Hermite Cubic Spline Segment
The tangent vector to the curve at any point is
3
P (u )   Ci iu i 1 , 0  u 1
i 0

Consider the cubic spline curve segment wi th the two endpoints Po and P1.
Applyingthe boundary conditions , Po , Po at u  0 and P1 , P1 at u  1, giving :
Po  Co
Po  C1
P1  C3  C2  C1  Co
P1  3C3  2C2  C1
Solving the four equations simultaneously for the coefficien ts
Co  Po
C1  Po
C2  3P1  P0   2Po  P1
C3  2Po  P1   Po  P1
Substituting in the parametric equation and rearrangin g
       
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 coefficien ts.
BITS Pilani, Pilani Campus
Parametric Equation of
Hermite Cubic Spline Segment

       
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 coefficien t vector or boundary condition vector
F1 (u)  2u 3 - 3u 2  1

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

These are called blending functions.


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

F4 (u)  u 3 - u 2 

P(u)  F1 (u)P0  F2 (u)P1  F3 (u)P0  F4 (u)P1
P (u)  [U]T [M H ][V], 0  u 1
[M H ]  Hermite matrix

BITS Pilani, Pilani Campus


Parametric Equation of
Hermite Cubic Spline Segment

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 ]

BITS Pilani, Pilani Campus


Parametric Equation of
Hermite Cubic Spline Segment
[V ]  M H  [C ]
1

0 0 0 1 
1 1 1 1
M H   
1 
0 0 1 0 
 
 3 2 1 0 
Similarly the tangent vector is written as
       
P (u )  6u 2  6u Po   6u 2  6u P1  3u 2  4u  1 Po  3u 2  2u P1
 [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 

BITS Pilani, Pilani Campus


Parametric Equation of
Hermite Cubic Spline Segment
 Four point form
 P0 ,P1/3, P2/3 , P1 .

 Find the blending functions ?

BITS Pilani, Pilani Campus


Parametric Equation of
Hermite Cubic Spline Segment
Chord length approximated Hermite curve

BITS Pilani, Pilani Campus


Blending of curve segments
with C2 continuity

BITS Pilani, Pilani Campus


BITS Pilani, Pilani Campus
BITS Pilani, Pilani Campus
BITS Pilani, Pilani Campus
BITS Pilani, Pilani Campus
BITS Pilani, Pilani Campus
Hermite curve – End
conditions

BITS Pilani, Pilani Campus


BITS Pilani, Pilani Campus
BITS Pilani, Pilani Campus
BITS Pilani, Pilani Campus
Properties of Hermite curves

 If you plot the


blending
functions on
the parameter
‘u’

BITS Pilani, Pilani Campus


Properties of Hermite curves

Disadvantages with PC curves.

Slopes = tangent vectors in case of planar PC curves.

 Blending of curve segments?

BITS Pilani, Pilani Campus


Properties of Hermite curves

Effect of Magnitude of tangent vectors on curve shape?

BITS Pilani, Pilani Campus


Outline of rooster
Observe feet and comb-
Chord length method reduces
looping in feet and smoother
and rounded representation of
comb.

BITS Pilani, Pilani Campus


Sample Hermite Curves

BITS Pilani, Pilani Campus


BITS Pilani
Pilani Campus

Lecture # 7

Bezier Curve
OBJECTIVES

 Bezier Curves

 Characteristics of Bezier Curve

BITS Pilani, Pilani Campus


Bezier Curves

 Approximator – Adds flexibility and intuitive feel in mechanical


design
 Credited to P. Bezier; P. De Casteljau also developed
independently
 Only control points (not necessarily only 2 per segment) form
the input, no specification of tangent vectors – provides more
direct relation between input (points) and output (curve)
 The order of the Bezier is variable (unlike HCC) and depends on
the number of control points, (n+1)
 (n+1) number of control points define an nth degree curve (we
will term degree of curve as (k-1)
 Bezier curve can be smoother than HCC
BITS Pilani, Pilani Campus
Bezier Curves

 The Bezier curve is defined in terms of (n+1) control


points, called as control points
 These control points form the vertices of the control
or Bezier characteristic polygon
 The control or Bezier characteristic polygon uniquely
defines the curve

BITS Pilani, Pilani Campus


Bezier Curves

 The curve shape tends to follow the polygon shape


and thus easy to guess and sketch

 Order of the control points is very essential because


changing the order can change the shape of the
curve

BITS Pilani, Pilani Campus


Bezier Curves

The user supplies (n+1) control points, Pi


Write the curve as:
n
Pu    Pi Bi ,n u  0  u 1
i 0

n i
Bi ,n u   C  u 1  u 
n i
 
i
where the binomial coefficien t
n n!
C   or C (n, i ) 
i i!n  i !
BITS Pilani, Pilani Campus
Bezier Curves
 The functions Bi,n are the Bernstein polynomials of
degree (k-1)=n
 We can write the complete form of Bezier curve while
observing that C(n,0)=C(n,n)=1
P(u )  Po (1  u ) n  P1C (n,1)u (1  u ) n1  P2C (n,2)u 2 (1  u ) n2 
...  Pn1C (n, n  1)u n1 (1  u )  Pnu n 0  u 1
Special case, 3 control points

B(u) = P0 * ( 1 - u ) 2 + P1 * 2 * u ( 1 - u ) + P2 u2

Special case, 4 control points

B(u) = P0 * ( 1 - u )3 + P1 * 3 * u * ( 1 - u )2 + P2 * 3 * u2 * ( 1 - u ) + P3 * u3
BITS Pilani, Hyderabad Campus
Bezier Curves
P(u )  Po (1  u ) n  P1C (n,1)u (1  u ) n1  P2C (n,2)u 2 (1  u ) n2 
...  Pn1C (n, n  1)u n1 (1  u )  Pnu n 0  u 1
 Substitute u=0 and u=1,…?
 The curve is tangent to the first and last segments of
control polygonal segments…proof?
 Deriving the parametric form “r” times
r
Pr (u  0) 
n!
  1r i
C (r , i ) Pi
n  r ! i 0
r
P (u  1) 
r n!
  1 C (r , i) Pni
i

n  r ! i 0
BITS Pilani, Hyderabad Campus
Bezier Basis Functions for
(n+1)=4

1.2

0.8 B0
B1
0.6
B2

0.4 B3

0.2

BITS Pilani, Hyderabad Campus


Some Bezier Curves
 What did you observe?

What did
you
observe?

BITS Pilani, Hyderabad Campus


Characteristics of Bezier Curve

1) The curve interpolates the first and last control


points.

 It passes through Po and Pn if we substitute u=0 and


u=1

BITS Pilani, Hyderabad Campus


Characteristics of Bezier Curve
2) The curve is tangent to the first and last curve
segments of the control polygon.
r
Pr (u  0) 
n!
  1r i
C (r , i ) Pi
n  r ! i 0
n! r
P (u  1) 
r
  1i
C (r , i ) Pn i
n  r ! i 0
Substituting r  1, the first derivatives at the endpoints are
P' (u  0)  n(P1 Po )
P' (u  1)  n(Pn  Pn1 )
• Can you find the second derivative at P0? What do you
observe?
Ans: It is determined by Po, P1 and P2. In general, the rth derivative at an endpoint
is determined by its “r” neighbouring control points.
BITS Pilani, Hyderabad Campus
Characteristics of Bezier Curve

3) The curve is symmetric with respect to u and (1-u).


 That is, reversing the direction of parametrization
does not change the curve shape. To check this
property substitute 1-u = v.
 The symmetry of the Bezier curve is due to the
symmetry (NOT equality) of the Bernstein basis,
which in turn is due to the property of the binomial
functions: C(n, i) = C(n, n-i)
 Which makes Bi,n(u) and Bn-i,n(u) to be symmetric
when plotted with respect to u.
Be careful, Bi,n(u) ≠ Bn-i,n(u), never, except at u=0.5.

BITS Pilani, Hyderabad Campus


Characteristics of Bezier Curve

4) The polynomial Bi,n has a maximum value of


C(n,i)(i/n)i(1 – i/n)n-i occuring at u=i/n

This can be obtained by setting dBi,n/du = 0

This means that each ith control point is most influential


on the shape of the curve at u=i/n, where (n+1) are
the total control points.

For example in a cubic Bezier curve defined by Po, P1, P2


and P3, these points are most influential at u=0, 1/3,
2/3 and 1.
BITS Pilani, Hyderabad Campus
Characteristics of Bezier Curve
5) The shape of the curve (for a given set of control vertices) can
be changed by two methods.

 By moving a control point


 By providing multiple control points at a vertex of control
polygon. Multiplicity of control points makes the curve pulled
towards that point.

K=3
K=2
K=1

BITS Pilani, Hyderabad Campus


Characteristics of Bezier Curve

 6) A closed Bezier curve can be obtained by making


Po and Pn coincident. Will the degree of the curve
change?

By making the
last point co-
incide with the
first point

By adding additional
control point at the
first point

BITS Pilani, Hyderabad Campus


Characteristics of Bezier Curve

7) Partition of Unity Property:


For any valid value of u, for any degree of given curve:
n

B
i 0
i ,n 1

This provides for


* invariance of Bezier curve (or invariance of the relationship
between the Bezier curve and its control polygon) under
affine transformations.

* Method to check numerical computation and software


developments.
BITS Pilani, Hyderabad Campus
Characteristics of Bezier Curve
8) Positivity:
For any value of u, given any degree of curve, each
Bernstein polynomial satisfies
Bi , n  0

This ensures that the Bezier curve lies entirely in


its convex hull.

BITS Pilani, Hyderabad Campus


The Convex Hull Property of
Bezier Curve
 A curve is said to have convex hull property if it
entirely lies in its convex hull defined by its control
polygon.

 The Bezier curve defined with Bernstein polynomial


basis possesses the convex hull property

BITS Pilani, Hyderabad Campus


How to get the Convex Hull of a
Bezier curve?
 The convex hull of a Bezier curve is the maximum area
obtained by joining all control points to all control
points.

Example – 1 Convex Hull Example – 2


Degree = 3 (Hatched region) Degree = 3

BITS Pilani, Hyderabad Campus


Convex Hull
(Hatched region)
Example – 3
Degree = ?

BITS Pilani, Hyderabad Campus


Consequences of Convex Hull
Property
There are three important aspects:

1) Degeneration to a straight line: useful

2) Wild oscillations of the curve about any control point


is avoided

BITS Pilani, Hyderabad Campus


Conversion of Hermite to its
equivalent Bezier

BITS Pilani, Hyderabad Campus


Subdividing the Bezier Curve

ME C382 – COMPUTER AIDED DESIGN BITS Pilani, Hyderabad Campus


Degree elevation

BITS Pilani, Pilani Campus


Reparameterization

BITS Pilani, Pilani Campus


Blending of Bezier Curves

BITS Pilani, Pilani Campus

You might also like