Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Lec6 PDF

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

Curves - Basics

Explicit, Implicit and Parametric Representation


Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Lec6 - Curve Representations

ME308 Computer Aided Design & Analysis

Arun Shal U B
Department of Mechanical Engineering
Govt. Engineering College Kozhikode

March 4, 2020
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Outline

Curves - Basics

Explicit, Implicit and Parametric Representation

Algebraic and geometric forms

Straight lines, conics

Cubic splines, Bezier curves and B-spline curves.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Classification of curves

I Analytic curves
I Represented by simple mathematical equation such as a circle
or an ellipse.
I Has a fixed form and can not be modified to achieve a shape
that violates mathematical equation.
I Very compact forms to represent shapes and simplify
computation of related properties such as areas and volumes
I Examples are : - Line , Arc , Circle, Ellipse , Parabola ,
Hyperbola.
I Synthetic curves

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Classification of curves

I Analytic curves
I Synthetic curves
I An interpolated curve drawn by interpolating given data points
and has a fixed form, dictated by the data points
I Greater flexibility and control of a curve shape by changing the
positions of data points.
I Examples are : - Hermite cubic spline , Bezier curve , B-spline
curve

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Curve representation methods

I Mathematical representation of curves can be classified as


I Non-parametric
I Explicit
I Implicit
I Parametric

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Explicit and Implicit Representations


I Explicit representation :
I For a point (x, y, z) on a curve, the coordinates y and z can be
expressed with two real-valued functions of x as

y = f (x), z = g (x), Where a ≤ x ≤ b

I There is a unique single value of dependent variable for each


value of independent variable.
I To represent curves with multiple values of y for the same
value of x (for eg, A Circle), it should be represented as
multiple segments.
p
C1 : y = r 2 − x 2 , Where − r ≤ x ≤ r
p
C2 : y = − r 2 − x 2 , Where − r ≤ x ≤ r
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Explicit and Implicit Representations

I Implicit Representation:
I A planar curve can be represented by an implicit equation of
the form
f (x, y ) = 0
I A circle with radius r centered at the origin can be represented
in implicit form as

x 2 + y 2 = r 2 Or x 2 + y 2 − r 2 = 0

I Here, no distinction is made between dependent and


independent variables
I To express only the half circle where y ≥ 0, this constraint
must be added to the equation above.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Explicit and Implicit Representations- Limitations

I With explicit form, closed curves (Circles) and multi valued


curves (Parabolas) are difficult to represent.
I Implicit form can solve this problem and is given by the
intersection of two surfaces

F (x, y , z) = 0, G (x, y , z) = 0

I However, equation must be solved to find its roots (y and z)


for certain values of x

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Explicit and Implicit Representations- Limitations

1. If the slope of a curve at a point is vertical or near vertical, its


value becomes infinity or very large, a difficult condition to
deal with both computationally and programming-wise. Other
ill-defined mathematical conditions may result.
2. Shapes of most engineering objects are intrinsically
independent of any coordinate system. What determines the
shape of an object is the relationship between its data points
and not the relationship between these points and some
arbitrary coordinate system.
3. If the curve is to be displayed as a series of points or
straight-line segments, the computations involved could be
extensive.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Curves


I In parametric form, each point on a curve is expressed as a
function of a parameter u
I The parameter acts as a local coordinate for points on the
curve.
I The parametric equation for a 3D curve in space takes the
following vector form:
   T
P(u) = x y z = x(u) y (u) z(u) umin ≤ u ≤ umax
I Equation implies that the coordinates of a point on the curve
are the components of its position vector.
I The parametric curve is bounded by two parametric values
umin and umax (Conveniently, umin =0 and umax =1)
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Curves

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Curves - Tangents

I To evaluate the slope of a parametric curve at an arbitrary


point on it, the concept of the tangent vector must be
introduced.
I The tangent vector is defined as vector P0 (u) in the cartesian
space such that:
dP(u)
P 0 (u) =
du
T T
P 0 (u) = x 0 y 0 z 0 = x 0 (u) y 0 (u) z 0 (u)
  

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Curves - Tangent Vector


I Slope of the curve are given by the ratio of the components of
tangent vector
dy dy /du y0 dy y0 dx x0
= = 0, = 0 and = 0
dx dx/du x dx x dz z
I The tangent vector has the same direction as the tangent to
the curve, hence the name tangent vector. The magnitude of
the vector is given by:
p
|P(u)| = x 02 + y 02 + z 02
I The direction cosines of the tangent vector are given by:
P 0 (u)
n̂ =
|P 0 (u)|
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Algebraic form

I A parametric cubic (pc) curve segment is expressed by the


three polynomials

x(u) = a3x u 3 + a2x u 2 + a1x u + a0x


y (u) = a3y u 3 + a2y u 2 + a1y u + a0y
z(u) = a3z u 3 + a2z u 2 + a1z u + a0z
Where, 0 ≤ u ≤ 1

I The 12 coefficients in above system are called algebraic


coefficients.
I Each unique set of algebraic coefficient determines a unique pc
curve.
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Algebraic form

I The equation can be written more compactly in vector


notation as

P(u) = a3 u 3 + a2 u 2 + a1 u + a0

I Alternatively, P(u) may be written in the matrix form as


 
a3x a3y a3z
 a2x a2y a2z 
P(u) = u u 2 u 1 
 3 

 a1x a1y a1z 
a0x a0y a0z

P = UA

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Geometric form

I The algebraic form has the drawback that it is not easy to get
an intuitive sense of the shape of the curve when choosing the
coefficients.
I The pc curve can also be defined in terms of the coordinates
and tangent vectors at the end points.
I A cubic curve defined in this way is called a Hermite cubic
curve.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Geometric form

I We have,
P(u) = a3 u 3 + a2 u 2 + a1 u + a0
I and
P0 (u) = 3a3 u 2 + 2a2 u + a1
I Using above equations, we get

P(0) = a0
P(1) = a3 + a2 + a1 + a0
P0 (0) = a1
P0 (1) = 3a3 + 2a2 + a1

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Geometric form
I Which has the solution

a0 = P(0)
a1 = P0 (0)
a2 = −3P(0) + 3P(1) − 2P0 (0) − P0 (1)
a3 = 2P(0) − 2P(1) + P0 (0) + P0 (1)

I Substituting this in P(u) = a3 u 3 + a2 u 2 + a1 u + a0 , and


rearranging, we get,

P(u) = 2u 3 − 3u 2 + 1 P(0) + −2u 3 + 3u 2 P(1)


 

+ u 3 − 2u 2 + u P0 (0) + u 3 − u 2 P0 (1)
 

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Geometric form - Hermite Cubic Curve

P(u) = 2u 3 − 3u 2 + 1 P(0) + −2u 3 + 3u 2 P(1)


 

+ u 3 − 2u 2 + u P0 (0) + u 3 − u 2 P0 (1)
 

Where, 0 ≤ u ≤ 1

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Geometric form - Hermite Cubic Curve

P(u) = 2u 3 − 3u 2 + 1 P(0) + −2u 3 + 3u 2 P(1)


 

+ u 3 − 2u 2 + u P0 (0) + u 3 − u 2 P0 (1)
 

I The above equation can be written as.

P(u) = F1 (u)P(0) + F2 (u)P(1) + F3 (u)P0 (0) + F4 (u)P0 (1)

I Where P(0), P(1), P0 (0) and P0 (1) are called Geometric


coefficients. F1 (u), F2 (u), F3 (u) and F4 (u) are called
blending functions
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Geometric form - Hermite Cubic Curve

I The blending functions F1 , F2 , F3 , and F4 are given by

F1 (u) = 2u 3 − 3u 2 + 1


F2 (u) = −2u 3 + 3u 2


F3 (u) = u 3 − 2u 2 + u


F4 (u) = u 3 − u 2


I At u = 0, F1 = 1 and F2 = F3 = F4 = 0, thus
P(0) = 1 × P(0)
I At u = 1, F2 = 1 and F1 = F3 = F4 = 0, thus
P(0) = 1 × P(0)

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Geometric form - Hermite Cubic Curve

I The tangent to the curve can be obtained as

P0 (u) = F10 (u)P(0) + F20 (u)P(1) + F30 (u)P0 (0) + F40 (u)P0 (1)
F10 (u) = 6u 2 − 6u


F20 (u) = −6u 2 + 6u




F30 (u) = 3u 2 − 4u + 1


F40 (u) = 3u 2 − 2u


I At u = 0, F30 = 1 and F10 = F20 = F40 = 0, thus


P0 (0) = 1 × P0 (0)
I At u = 1, F40 = 1 and F10 = F20 = F30 = 0, thus
P0 (1) = 1 × P(1)
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Geometric form - Hermite Cubic Curve

Figure: Blending functions F3 and F4

Figure: Blending functions F1 and F2

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Geometric form - Hermite Cubic Curve


I The equation

P(u) = F1 (u)P(0) + F2 (u)P(1) + F3 (u)P0 (0) + F4 (u)P0 (1)


can be represented in matrix form asas,
P = FB
I F is a matrix of blending functions and B denotes geometric
coefficients
   
P(0) x(0) y (0) z(0)
   P(1)   x(1) y (1) z(1) 
F = F1 F2 F3 F4 B= P0 (0) = x 0 (0) y 0 (0) z 0 (0)
  

P0 (1) x 0 (1) y 0 (1) z 0 (1)

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Geometric form - Hermite Cubic Curve


I The matrix of blending functions, F , can be written as a
product of the U matrix and a 4 x 4 matrix M
 
2 −2 1 1
 −3 3 −2 −1
F = u3 u2 u 1 


0 0 1 0
1 0 0 0
I Hence,
  
2 −2 1 1 P(0)
 −3 3 −2 −1  P(1) 
P(u) = u 3 u 2

u 1 
0  P0 (0)
 
0 0 1
1 0 0 0 P0 (1)

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Geometric form - Hermite Cubic Curve

I The equation for P(u) describes the Hermite cubic spline


curve in terms of its two end points and their tangent vectors.
I The equation shows that the curve passes through the end
points (u=0 and 1).
I The curve’s shape can be controlled by changing its end points
or its tangent vectors.
I If the two end points P0 and P1 are fixed in space, the designer
can control the shape of the spline by changing either the
magnitudes or the directions of the tangent vectors P0 and P1
I The use of cubic splines in design applications is not very
popular due to the need for tangent vectors or slopes to define
the curve.
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Geometric form - Hermite Cubic Curve

Figure: Control of Hermite Cubic Spline Curve

I The control of the curve is not very obvious from the input
data due to its global control characteristics.
I For example, changing the position of a data point or an end
slope changes the entire shape of the spline, which does not
provide the intuitive feel required for design.
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of analytic curves - Lines

1. A line connecting two end points.


I Defining a parameter u such
that it has values 0 and 1 at
P1 and P2 respectively.
P = P1 + (P − P1 )
P − P1 = u (P2 − P1 )
I The equation of line
becomes,
P = P1 + u (P2 − P1 )
0≤u≤1

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of analytic curves - Lines

1. A line connecting two end points.


I P = P1 + u (P2 − P1 ),
0≤u≤1
I In scalar form,

x = x1 + u (x2 − x1 )
y = y1 + u (y2 − y1 )
z = z1 + u (z2 − z1 )

I A tangent vector of the line


is,
P0 = P2 − P1
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of analytic curves - Lines


1. A line connecting two end points.
I A unit vector along the tangent is given by

P2 − P1
n̂ =
L
I Where, L is the length of the line,
q
L = |P2 − P1 | = (x2 − x1 )2 + (y2 − y1 )2 + (z2 − z1 )2

I The endpoints are enough to provide all geometric and


characteristics of the line
I A line database stores its two end points and additional
information such as its font, width, color and layer.
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of analytic curves - Lines

1. A line passing through a point P1 in a direction defined by


unit vector n̂
I Consider a general point P
on the line at a distance L
from P1 .
I The vector equation of the
line becomes

P = P1 + Ln̂, 0 ≤ L ≤ Lmax

L = |P − P1 |
I n̂ is the tangent vector

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Lines - Example

Given the two lines L1 and L2 and


their end points shown on the
right;
a. Find the equations of the lines.
Show the parametrization
directions.
b. Are the two lines parallel or
perpendicular?
c. Find the coordinates of the
intersection point.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Lines - Example


I For L1 ,
  

3 2
P = P1 + u (P2 − P1 ) =  4  + u  2 
7 −6

I For L2 ,
   
1 1
P = P3 + v (P4 − P3 ) =  5  + v  4 
−2 2

I The parametrization directions for L1 and L2 go from P1 to


P2 , and P3 to P4 , respectively.
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Lines - Example

I If lines L1 and L2 are perpendicular, the dot product of their


tangent vectors should be zero, P0 L1 · P0 L2 = 0
I (2i + 2j − 6k) · (i + 4j + 2k) = −2 6= 0, hence, not
perpendicular.
I If L1 and L2 are parallel, the cross product of their tangent
vectors should be zero, P0 L1 × P0 L2 = 0.
I The cross product is equal to 28i − 10j + 26k. Thus L1 and
L2 are not parallel.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Lines - Example

I To find the intersection point of two lines, we solve,

3 + 2u = 1 + v

4 + 2u = 5 + 4v
I On solving these, we get u = −1.5 and v = −1. Substituting
u and v in L1 and L2 equations respectively, yield two different
points (0, 1, 16) and (0, 1, −4) hence the lines do not intersect.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Circle

I Circles and circular arcs are among the most common entities
used in geometric modeling.
I Circles, and circular ares together with straight lines, are
sufficient to construct many existing mechanical parts and
components in practice.
I A circle database stores its radius and center as its essential
geometric data.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Circle


x = xc + R cos u 
y = yc + R sin u 0 ≤ u ≤ 2π
z = zc

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Circle


Recursive relation for circle generation

x = xc + R cos u

y = yc + R sin u
xn+1 = xc + R cos(u + ∆u)
yn+1 = yc + R sin(u + ∆u)
Expanding xn+1 and yn+1 equation gives,

xn+1 = xc + (xn − xc ) cos ∆u − (yn − yc ) sin ∆u

yn+1 = yc + (yn − yc ) cos ∆u + (xn − xc ) sin ∆u


zn+1 = zn
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Circular arc

I Circular arcs are considered special


cases of circles,

x = xc + R cos u 
y = yc + R sin u us ≤ u ≤ ue
z = zc

I Where us and ue are starting and


ending angles of the arc
respectively.
I The arcs always connect its
beginning and ending points in a
counter clockwise direction.
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Ellipses

I Ellipse can be represented by



x = xc + A cos u 
y = yc + B sin u 0 ≤ u ≤ 2π
z = zc

I Where A and B are major and


minor radii respectively.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Ellipses

I If the ellipse major axis is inclined at an angle α with respect


to the x- axis, the equations can be obtained as

x = xc + A cos u cos α − B sin u sin α 
y = yc + A cos u sin α + B sin u cos α 0 ≤ u ≤ 2π
z = zc

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Ellipses

Recursive relation for generation of ellipse.


A
xn+1 = xc + (xn − xc ) cos ∆u − (yn − yc ) sin ∆u
B
A
yn+1 = yc + (yn − yc ) cos ∆u + (xn − xc ) sin ∆u
B
zn+1 = zn

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Parabolas

I Parabola can be represented


by

x = xv + Au 2 

y = yv + 2Au −∞ ≤ u ≤ ∞
z = zv

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Parabolas

Recursive relationship to generate parabola are obtained as

xn+1 = xn + (yn − yv )∆u + A(∆u)2

yn+1 = yn + 2A∆u
zn+1 = zn

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Hyperbolas

I Hyperbola can be represented by



x = xv + A cosh u 
y = yv + B sinh u −∞ ≤ u ≤ ∞
z = zv

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Synthetic curves

I Analytic curves, are usually not sufficient to meet the


geometric design requirements of mechanical parts.
I Products such as car bodies, ship hulls, airplane fuselages and
wings, propeller blades, shoe insoles, and bottles are a few
examples that require free-form, or synthetic, curves and
surfaces.
I The need for synthetic curves in design arises when a curve is
represented by a collection of measured data points.
I Mathematically, synthetic curves represent the problem of
constructing a smooth curve that passes through given data
points.
I Therefore the typical form of these curves is a polynomial.
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Synthetic curves


Order of continuity

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Synthetic curves


Order of continuity

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Synthetic curves - Order of


continuity

I Various continuity requirements can be specified at the data


points to impose various degrees of smoothness upon the
resulting curve.
I The order of continuity becomes important when a complex
curve is modeled by several curve segments pieced together
end-to-end.
I Zero-order continuity C 0 yields a position-continuous curve.


I First- C 1 and second C 2 order continuities imply


 

slope-and curvature-continuous curves, respectively.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Synthetic curves


Cubic curves

I A cubic polynomial is the minimum-order polynomial that can


guarantee the generation of C 0 , C 1 , or C 2 curves.
I In addition, the cubic polynomial is the lowest-degree
polynomial that allows representation of nonplanar (twisted)
3D curves in space.
I Higher-order polynomials are not commonly used in CAD
because
I they tend to oscillate about control points,
I they are computationally inconvenient,
I they are uneconomical in storage

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Synthetic curves


Cubic curves

I Major CAD/CAM systems provide three types of synthetic


curves:
I cubic spline
I Bezier curve
I B-spline curve.
I The cubic spline curve passes through the data point and
therefore is an interpolant.
I Bezier and B-spline curves can approximate (do not pass
through) or interpolate (pass through) the data points.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Cubic splines

I Cubic splines use cubic polynomials.


I A cubic polynomial has four coefficients and thus requires four
conditions to evaluate.
I These conditions could be a combination of points and
tangent vectors.
I A cubic spline uses four data points.
I The Hermite cubic spline uses two data points at its ends and
two tangent vectors at these points.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Cubic splines

I The parametric equation of a cubic spline segment is given By:


3
X
P(u) = ai u i , 0≤u≤1
i=0

I where u is the parameter and ai are the polynomial (also


called algebraic) coefficients

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Cubic splines

I Scalar form this equation is written as

x(u) = a3x u 3 + a2x u 2 + a1x u + a0x


y (u) = a3y u 3 + a2y u 2 + a1y u + a0y
z(u) = a3z u 3 + a2z u 2 + a1z u + a0z

I In an expanded vector form

P(u) = a3 u 3 + a2 u 2 + a1 u + a0

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Cubic splines

I Geometric Form : Vector

P(u) = 2u 3 − 3u 2 + 1 P(0) + −2u 3 + 3u 2 P(1)


 

+ u 3 − 2u 2 + u P0 (0) + u 3 − u 2 P0 (1)
 

Where, 0 ≤ u ≤ 1

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Cubic splines


I Geometric Form : Scalar

x(u) = 2u 3 − 3u 2 + 1 x(0) + −2u 3 + 3u 2 x(1)


 

+ u 3 − 2u 2 + u x 0 (0) + u 3 − u 2 x 0 (1)
 

y (u) = 2u 3 − 3u 2 + 1 y (0) + −2u 3 + 3u 2 y (1)


 

+ u 3 − 2u 2 + u y 0 (0) + u 3 − u 2 y 0 (1)
 

z(u) = 2u 3 − 3u 2 + 1 z(0) + −2u 3 + 3u 2 z(1)


 

+ u 3 − 2u 2 + u z 0 (0) + u 3 − u 2 z 0 (1)
 

Where, 0 ≤ u ≤ 1
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Cubic splines


I Four point form
I Starting point (x(0), y (0), z(0))
I End point (x(1), y (1), z(1))
I Two intermediate points (x(1/3), y (1/3), z(1/3)) and
(x(2/3), y (2/3), z(2/3))
x(u) = a3x u 3 + a2x u 2 + a1x u + a0x
y (u) = a3y u 3 + a2y u 2 + a1y u + a0y
z(u) = a3z u 3 + a2z u 2 + a1z u + a0z

x(u) = (−4.5u 3 +9u 2 −5.5u+1)x(0)+(13.5u 3 −22.5u 2 +9u)x(1/3)


+ (−13.5u 3 + 18u 2 − 4.5u)x(2/3) + (4.5u 3 − 4.5u 2 + u)x(1)
y (u) and z(u) can be written in similar manner.
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Cubic splines

I Four Point Form

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Bezier curve


I Bezier curve is an approximation curve - The curve do not pass
through all the given data points.
I The data points are used to control the shape of the curve.
I Most often, approximation curves are preferred over
interpolating curves in curve design.
I Bezier curves and surfaces are credited to P. Bezier of french
car firm Renault
I P. Bezier used them in 1960’s in his software system called
UNISURF.
I The curve was first used to define sculptured surfaces of
automobile bodies.
I A Cubic Bezier curve is defined by four control points.
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Bezier curve


I The curve is defined by points: the initial position and the
terminating position (which are called "anchors") and middle
points (which are called "handles or control points").
I The shape of a Bezier curve can be altered by moving the
control points.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Bezier curve

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Parametric representation of Bezier curve


I Mathematically, for (n + 1) points, the Bezier curve is defined
by the following polynomial of degree n
n
X
P(u) = Pi Bi,n (u), 0≤u≤1
i=0
I Where,
I P(u) is any point on the curve
I Pi is a control point
I Bi,n (u) are Bernstein Polynomials.
I Bernstein polynomials serve as blending or basis function for
Bezier curve and are given by
   
n i n−i n n!
Bi,n (u) = u (1 − u) Where, =
i i i!(n − i)!
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Bezier curve - Properties


I The curve interpolates the first and last points; that is it
passes through P0 and Pn if we substitute u = 0 and u = 1 in
defining equation.
I The curve is tangent to first and last segment of characteristic
polygon.
I The curve is symmetric with respect u and 1 − u. This means
that the sequence of control points defining the curve can be
reversed without changing the curve shape.
I The closed Bezier curve can be generated by closing its
characteristic polygon or choosing P0 and Pn to be coincident.
I For any valid value of u, the sum of Bi,n (u) associated with
control points is always equal to unity for any degree of Bezier
curve.
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Bezier curve - Properties

I They generally follow the shape of the control polygon, which


consists of the segments joining the control points.
I They always pass through the first and last control points.
I They are contained in the convex hull of their defining control
points.
I The degree of the polynomial defining the curve segment is
one less that the number of defining polygon point. Therefore,
for 4 control points, the degree of the polynomial is 3, i.e.
cubic polynomial.
I A Bezier curve generally follows the shape of the defining
polygon.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Bezier curve - Properties

I The direction of the tangent vector at the end points is same


as that of the vector determined by first and last segments.
I The convex hull property for a Bezier curve ensures that the
polynomial smoothly follows the control points.
I No straight line intersects a Bezier curve more times than it
intersects its control polygon.
I They are invariant under an affine transformation.
I Bezier curves exhibit global control means moving a control
point alters the shape of the whole curve.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Bezier curve - Example

The coordinates of four control points relative to a current WCS


are given by P0 = [2, 2, 0]T , P1 = [2, 3, 0]T , P2 = [3, 3, 0]T , and
P3 = [3, 2, 0]T .
Find the equation of the resulting Bezier curve. Also find the points
on the curve for u = 0, 14 , 21 , 34 and 1

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Bezier curve - Example

3
X
P(u) = Pi Bi,3 (u), 0≤u≤1
i=0

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Bezier curve - Example

3
X
P(u) = Pi Bi,3 (u), 0≤u≤1
i=0

P(u) = P0 B0,3 + P1 B1,3 + P2 B2,3 + P3 B3,3


 
n i
Bi,n (u) = u (1 − u)n−i
i

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Bezier curve - Example

3
X
P(u) = Pi Bi,3 (u), 0≤u≤1
i=0

P(u) = P0 B0,3 + P1 B1,3 + P2 B2,3 + P3 B3,3


 
n i
Bi,n (u) = u (1 − u)n−i
i

P(u) = P0 (1 − u)3 + 3P1 u(1 − u)2 + 3P2 u 2 (1 − u) + P3 u 3

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Bezier curve - Example

P(u) = P0 (1 − u)3 + 3P1 u(1 − u)2 + 3P2 u 2 (1 − u) + P3 u 3

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Bezier curve - Example

P(u) = P0 (1 − u)3 + 3P1 u(1 − u)2 + 3P2 u 2 (1 − u) + P3 u 3

P(0) = P0 = [2, 2, 0]T


 
1 27 27 9 1
P = P0 + P1 + P2 + P3 = [2.156, 2.563, 0]T
4 64 64 64 64
 
1 1 3 3 1
P = P0 + P1 + P2 + P3 = [2.5, 2.75, 0]T
2 8 8 8 8
 
3
P = [2.844, 2.563, 0]T
4
P (1) = [3, 2, 0]T
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Bezier curve - Example

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

B-Spline Curves

I The Bezier-curve produced by the Bernstein basis function two


major limitations.
I Degree of curve is fixed by the number of control points
I There is no local control (change of one control point affects
the whole curve)

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

B-Spline Curves
I The Bezier-curve produced by the Bernstein basis function has
two major limitations.
I Degree of curve is fixed by the number of control points
I There is no local control (change of one control point affects
the whole curve)
I B-spline generates a single piecewise parametric polynomial
curve through any number of control points with the degree of
the polynomial selected by the designer.
I B-spline curves have the flexibility of choosing the degree of
the curve irrespective of the number of control points.
I With four control points, it is possible to get a cubic Bézier
curve, while with B-spline curve one can get a linear, quadratic
or cubic curve.
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

B-Spline Curves

Figure: B-spline with control points/control polygon, and marked


component curves
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

B-Spline Curves

I The B-spline curve defined by n + 1 control points Pi is given


by
Xn
P(u) = Pi Ni,k (u), 0 ≤ u ≤ (n − k + 2)
i=0
I Where,
I Ni,k (u) are the B-spline functions
I k is the order of the polynomial segments of the B-spline curve.
I Order k means that the curve is made up of piecewise
polynomial segments of degree k − 1,
I The maximum limit of parameter u is (n − k + 2) instead of 1
as in the case of Bezier

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

B-Spline Curves

I B-Spline functions can be calculated recursively using equation

Ni,k−1 (u) Ni+1,k−1 (u)


Ni,k (u) = (u − ui ) + (ui+k − u)
ui+k−1 − ui ui+k − ui+1
I Where, (
1, ui ≤ u ≤ ui+1
Ni,1 =
0, Otherwise

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Bezier Vs B-Spline

I Bezier Curve (n = 5)

x = (1 − u)5 x0 + 5(1 − u)4 ux1 + 10(1 − u)3 u 2 x2


+ 10(1 − u)2 u 3 x3 + 5(1 − u)u 4 x4 + u 5 x5
0≤u≤1

I B-Spline curve (n = 5, k = 3)

x = N0,3 (u)x0 + N1,3 (u)x1 + N2,3 (u)x2


+ N3,3 (u)x3 + N4,3 (u)x4 + N5,3 (u)x5
0≤u≤4

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

B-Spline Curves - Properties

I Curve is C k−2 continuous


I Curve is made up of (n − k + 2) segments
I Only k control points affect any segment of the curve.
I A given control point affects 1, 2 or... k curve segments.

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations


Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

B-Spline Curves - Properties


I The local control of the curve can be achieved by changing the
position of a control point(s), or by choosing a different degree
(k − 1)
I The curve passes through first and last control points and is
tangent to first and last segments of control polygon
I Increasing the degree of the curve, tightens it. In general, the
less the degree, the closer the curve gets to its control point.
I A second degree curve is always tangent to the midpoints of
all the internal polygon segments.
I If k equals number of control points (n + 1), then the resulting
B-spline curve becomes a Bezier curve
I Multiple control points induce regions of high curvature of a
B-spline curve.
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

B-Spline Curves - Properties


I Increasing degree of the curve makes it more difficult to
control and to calculate accurately. A cubic spline is sufficient
for large number of applications.
I The sum of the B-spline basis functions for any parameter
value is 1.
I Each basis function is positive or zero for all parameter values.
I Each basis function has precisely one maximum value, except
for k=1.
I The maximum order of the curve is equal to the number of
vertices of defining polygon.
I Any affine transformation can be applied to the curve by
applying it to the vertices of defining polygon.
I The curve lies within the convex hull of its defining polygon.
ME308 Computer Aided Design & Analysis Lec6 - Curve Representations
Curves - Basics
Explicit, Implicit and Parametric Representation
Algebraic and geometric forms
Straight lines, conics
Cubic splines, Bezier curves and B-spline curves.

Thank You...
Visit this link to download all presentations...
http://bit.ly/me308cada

ME308 Computer Aided Design & Analysis Lec6 - Curve Representations

You might also like