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

Modeling Synthetic Curves

(Hermite cubic spline)

Computer-aided design
P–representation of H-Cubic Spline curve in Vector Matrix Form

P(u) = (2u3–3u2+1)P0 + (–2u3+3u2)P1 + (u3–2u2+u)P0' + (u3–u2)P1'


In vector-matrix form: P(u) = U[MH]VT wherein, [MH] is called as Hermite
Matrix and V is called as Geometry Coefficient Matrix.

P(u) = U [MH] V

Computer-aided design Slide #1


Model Solution | Shape Control of HCS Curve
Generate HCS curves using end points: P [1 1]T and P [5 1]T for the
following Geometric Coefficient Matrix (GCM)

 P0 
P 
 1
 P0' 
 '
 P1 
G.C.M (1,1) (5,1)
(Geometry Coefficient Matrix)

Computer-aided design Slide #2


Variation of Blending Functions

P0 P1 P(u) =
(2u3–3u2+1)P0+
(–2u3+3u2)P1 +
(u3–2u2+u)P0'+
(u3–u2)P1'

P’0

P’1

Computer-aided design Slide #3


Blending of HCS segments | Composite HCS
Pn
P’n
Pn-1
Pn-2

P4
P’0
P3
P2
P1

P0

What do we require to create this curve out of HCS?


Data points: P0, P1,…. Pn-1, Pn and Tangent vectors:
P’0, P’1, …., P’n-1, P’n
Computer-aided design Slide #4
Blending of HCS segments
Consider eliminating intermediate tangent vector P’1 in the first 2
segments. P’2
P’1
P2
u2
P’0 P1
u1

P0

We will impose C2 condition at joining point P1

P’’(u1=1) = P’’(u2=0)
Computer-aided design Slide #5
Blending of HCS segments
P(u) = (2u3–3u2+1)P0 + (–2u3+3u2)P1 + (u3–2u2+u)P0' + (u3–u2)P1'
P’(u) = (6u2–6u)P0 + (–6u2+6u)P1 + (3u2–4u+1)P0' + (3u2–2u)P1'
P’’(u) = (12u–6)P0 + (–12u+6)P1 + (6u–4)P0' + (6u–2)P1'
P’2 P’’(u1=1) = P’’(u2=0)
P’1
P2 P’’(u1=1) P’’(u2=0)
u2 6P0 – 6P1 + 2P’0 + 4P’1 –6P1 + 6P2 – 4P’1 – 2P’2
P’0 P1
u1 6P0 – 6P1 + 2P’0 + 4P’1 = –6P1 + 6P2 – 4P’1 – 2P’2

P’1 =–1/4(3P0 + P’0 – 3P2 + P’2)


P0

For more than 2 segments a matrix equation can result by


repeating the same procedure.
Computer-aided design Slide #6
Blending of HCS segments
Pn
P’n
Pn-1
Pn-2
P’0 = known
P’1 =–1/4(3P0 + P’0 – 3P2 + P’2)
P4
P’0 P’2 =–1/4(3P1 + P’1 – 3P3 + P’3)
P3
P2 P’3 =–1/4(3P2 + P’2 – 3P4 + P’4)
P1
P’n-1 =–1/4(3Pn-2 + P’n-2 – 3Pn + P’n)
P0
P’n = known

By internal evaluation of all tangent vectors, user can specify


only data points and end tangent vectors.
Computer-aided design Slide #7
Shape Control of Hermite Cubic Spline Curve

 Changing the data points (end points) and the slope, changes the entire
shape of the spline.
 This does not provide an intuitive feel required for design, not very popular.

Computer-aided design Slide #8


Tutorial 1

Find equation of a cubic spline which connects P0 and P2 and that is


tangent to the two line segments as shown below.

P1

P2

P0

Computer-aided design Slide #9


Solution

P1

P2

P0

P(u) = (2u3–3u2+1)P0 + (–2u3+3u2)P1 + (u3–2u2+u)P0' + (u3–u2)P1‘

With P0‘ = P1 – P0 & P1‘ = P2 – P1

P(u) = (u3–u2–u+1)P0 – u(u-1)P1 + u2(–u+2)P2

Computer-aided design Slide #10


Tutorial 2

Find equation of a Hermite cubic spline that passes through points: [1 2] &
[3 4] and whose tangent vectors are 2 lines connecting these two points
with [2 7] as shown.

2,7

3,4

1,2

Computer-aided design Slide #11


Tutorial 2 | solution

2,7

3,4

1,2

Computer-aided design
Tutorial 3

Three composite HCS segments are to be used to form a HCS curve for a
particular application. Seg-1 with P0 [3 3] & P1 [5 4] | Seg-2 with P1 [5 4]
& P2 [7 6] | Seg-3 with P2 [7 6] & P3 [9 7]. If TVs at P0 and P3 are [3 0]
and [3 0], respectively, then evaluate intermediate TVs in terms of data
points and associated TVs.

9,7

7,6

5,4
3,3

Computer-aided design Slide #13


Tutorial 3 | solution

9,7 P’3
P3
P’2
P27,6
P’1
5,4
3,3 P1
P0 P’
0

Computer-aided design
Assignment – Matlab exercise

Write a Matlab code to generate a composite Hermite Cubic


Spline curve with ‘n’ points (position vectors) and the first and
last tangent vectors. Ensure C-2 continuity at all joints.

Computer-aided design Slide #15


Thought experiment

What would be the best HCS curve to design a water slide in a theme park ?

Computer-aided design Slide #16


Drawback of Hermite cubic spline

1. Degree remains cubic irrespective of number of data points. Therefore,


maximum order of continuity is
2. In order to increase flexibility of the curve more points must be input,
thus creating more splines which are of still cubic order.

Computer-aided design Slide #17


Drawback of Hermite cubic spline

3. Global shape control characteristics:


 The use of HCS curve in design applications is limited as compared to
Bezier and Bspline curve because of global shape control.
 Changing the position of end points or end slopes changes the entire
shape of the spline which doesn’t give ‘required feel’ in the design.

Computer-aided design Slide #18


Drawback of Hermite cubic spline

4. Tangent Vectors in Equation: NOT INTUITIVE


P(u) = (2u3–3u2+1)P0 + (–2u3+3u2)P1 + (u3–2u2+u)P0' + (u3–u2)P1‘

Computer-aided design Slide #19


Modeling Synthetic Curves
(Bezier curve)

Computer-aided design
Who is Bezier?

Computer-aided design Slide #21


Bezier Curve (Bz)
 As an engineer at Renault, he became a leader in the transformation of design
and manufacturing, through mathematics and computing tools, into computer-
aided design and three-dimensional modeling.
 Bézier patented and popularized the Bézier curves and Bézier surfaces that are
now used in most computer-aided design and computer graphics systems.

Computer-aided design Slide #22


Bezier Curve | Graphical Representation
P2

P1
u

P0 P3
u=0 u=1

n+1 = No of control points, n is degree


Computer-aided design Slide #23
Bezier curves (Bz) of various degrees

n+1 = 3, n =2 n+1 = 4, n=3 n+1 = 5, n=4 n+1 = 6, n=5 n+1 = 7, n=6


Quadratic Bz Cubic Bz Quartic Bz Pentic Bz Hexic Bz

n+1 = No of control points, n is degree


Computer-aided design Slide #24
Bezier Curve | [4 control points Cubic Bz curve]

Computer-aided design Slide #25


More examples of Bz curves

4 control points Cubic 4 control points Cubic


(3rd degree) Bz curve (3rd degree) Bz curve

5 control points quartic 6 control points pentic


(4th degree) Bz curve (5th degree) Bz curve
Computer-aided design Slide #26
End segments dictate the end tangent

Computer-aided design Slide #27


Bezier Curve | Key Points

 The data points of the Bezier curve are called control points.
 Only the first and the last control points lie on the curve. The other
points define the shape of the curve.
 The curve is always tangent to the first and the last polygon segment.
 The curve shape tends to follow the polygon shape.

Computer-aided design Slide #28


Bezier Curve Characteristics

 The slope and shape of the Bezier curve is controlled by its data points
unlike the Hermite cubic curve.
 This provides the designer with a much better feel for the relationship
between the input points and the output curve.
 Hermite cubic spline is always a cubic curve, whereas the degree of the
Bezier curve is defined by the number of data points and is variable.
 n + 1 data points define nth degree curve , which permits higher order
continuity. CAD systems limit the degree of the curve.

Computer-aided design Slide #29


Bezier Curve | Parametric Equation

P(u): any point on the curve


Pi: control point or vertex of characteristic control polygon
Bi,n(u): Basis function or Bernstein function

n
P (u )   Pi Bi ,n (u ) 0  u 1
i 0
Computer-aided design Slide #30
Bezier Curve | Parametric Equation

n
P(u )   Pi Bi ,n (u ) 0  u 1
i 0

for 3th degree curve, i.e. a cubic Bz curve,

for nth degree curve,

Computer-aided design
Bezier Curve | Parametric Equation

n
P(u )   Pi Bi ,n (u ) 0  u 1
i 0

……

Computer-aided design
THANK YOU !

Computer-aided design

You might also like