You are on page 1of 54

MODELLING OF CURVES

Dr. Anshul Sharma (AS)


Department of Mechanical Engineering
INTRODUCTION
• The need to study the mathematical basis of geometric modeling is manifold.

• Provides a good understanding of terminology encountered in the CAD/CAM field as


well as CAD/CAM system documentation.

• Enables users to decide intelligently on the types of entities necessary to use in a


particular model to meet certain geometric requirements such as slopes and/or
curvatures.

• In addition, users become able to interpret any unexpected results they may encounter
from using a particular CAD/CAM system.

• Moreover, those who are involved in the decision-making process and evaluations of
CAD/CAM systems become equipped with better evaluation criteria.

Dr. Anshul Sharma


ME-412
INTRODUCTION
• Curves is defined as the locus of a point moving with one DoF.
• A curve can be described by arrays of coordinate data or by an analytic equation.

storage required can


provides data points
be excessively large
on curve behavior,
control, continuity
difficult to redesign shapes and curvature
of existing objects via the
coordinate array method.

• Curves is a 1D continuous point set embedded in 2D or 3D space.

Dr. Anshul Sharma


ME-412
INTRODUCTION
• Curves can be described mathematically by • Is a one to- one
relationship.
Explicit • Cannot be used to
Nonparametric represent closed (e.g.,
Equations Ex. y = m x + c circles) or multivalued
curves (e.g., parabolas)
• Equation must be solved
Implicit
• Inconvenient and lengthy
Ex. ax +by + c = 0
Additional Limitations of Nonparametric
Parametric • If the slope of a curve at a point is
Equations vertical or near vertical, its value
becomes infinity or very large
Benefits of Parametric • If the curve is to be displayed as a
• Allows closed and multiple-valued functions to be easily series of points or straight line
defined. segments, the computations involved
• Replaces the use of slopes with that of tangent vectors. could be extensive
• Eq. of curve depends on Coordinates
ME-412 Dr. Anshul Sharma
Parametric Representation of a Three-dimensional Curve

To evaluate the slope

The direction cosines of the vector


Example
The nonparametric implicit equation of a circle with a center at the origin and
radius R is given by

Find the circle parametric equation.

The parametric equation of the circle becomes

ME-412 Dr. Anshul Sharma


Example
The nonparametric implicit equation of a circle with a center at the origin and
radius R is given by

Find the slopes at the angles 0, 45 and 90°.

ME-412 Dr. Anshul Sharma


Curves
Explicit
Nonparametric
Implicit

Analytic
• Can be described by analytic equations
Parametric
• Ex: Line, Circle, Conics
• Simplify the computation

Synthetic
• Described by a set of data points (control points)
• Ex: Splines, Bezier Curves
• Provide designers with greater flexibility and control

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF ANALYTIC CURVES
 LINE y P2 - P1 P2
Line connecting 2 points (endpoints) P1 and P2 u= 1
P1 P
u= 0

P1 P P2

O x
The independence of the tangent vector from u
reflects the constant slope of the straight line.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF ANALYTIC CURVES
 LINE y P
Line passing through point P1 in a direction defined L
P1
by the unit vector
The vector equation of the line becomes
P1 P

To calculate P
O x
The line has the two endpoints P1 and P2 with u
values of 0 and 1 as discussed in the previous slide

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF ANALYTIC CURVES
 LINE (Example)
Find the equations and endpoints of two lines, one horizontal and the
other vertical. Each line begins at and passes through a given point.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF ANALYTIC CURVES
 Circle y u = π/2 Pn+1 (xn+1, yn+1, zn+1)
Δu Pn (xn, yn, zn)
P (x, y, z)
R u= 0
u= π u
Pc (xc, yc, zc) u = 2π

Assuming there is an increment Δu between two consecutive u = 3π/2


points Pn (xn, yn, zn) and Pn+1 (xn+1, yn+1, zn+1)
O x

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF ANALYTIC CURVES
 Circle (Example)
Find the radius and the center of a circle whose diameter is
given by two points.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF ANALYTIC CURVES
 Ellipse

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF ANALYTIC CURVES
 Ellipse major axis is inclined with an angle

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF ANALYTIC CURVES
 Ellipse (Example)
Find the center, the lengths of half the axes
and the orientation in space of an ellipse
defined by its circumscribing rectangle.

The orientation of the ellipse in space can be defined by the unit vectors

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
• Analytic curves are usually not sufficient to meet geometric design requirements of
mechanical parts.

• Products such as car bodies, ship hulls, airplane fuselage and wings, propeller blades,
shoe insoles and bottles are a few examples that require free-form, or synthetic, curves
and surfaces

• The need for synthetic curves in design arises on two occasions:


─ when a curve is represented by a collection of measured data points
─ when an existing curve must change to meet new design requirements

• Mathematically, synthetic curves represent a curve-fitting problem to construct a smooth


curve that passes through given data points.

• Therefore, polynomials are the typical form of these curves.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
• Various continuity requirements can be specified at the data points to impose various
degrees of smoothness of the resulting curve.

Zero-order continuity (C0)


yields a position continuous curve.

First-order continuity (C1)


yields a slope continuous curve.

Second-order continuity (C2)


yields a curvature continuous curve.

A cubic polynomial is the minimum-order polynomial that


can guarantee the generation of C0, C1 , or C2 curves.
ME-412 Dr. Anshul Sharma
PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
• Major CAD/CAM systems provide three types of synthetic curves
cubic spline curve passes through the data
 Hermite cubic spline
points and therefore is an interpolant
 Bezier curve
in general approximate the data points, that
 B-spline is, they may or may not pass through them

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Hermite Cubic Splines
• The most commonly used spline curve is a three-dimensional
planar curve.

• The parametric cubic spline curve connects two data (end)


points and utilizes a cubic equation.

• Four conditions are required


 positions of the two endpoints
 two tangent vectors

• The parametric equation of a cubic spline segment is given by

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Hermite Cubic Splines

• The tangent vector to the curve at any point is given by

• Applying BC’s
Simultaneously
Solving

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Hermite Cubic Splines

• The tangent vector becomes


The functions of u are
called blending functions

• Can be written in a matrix form as

Hermite Matrix Geometry (or boundary


conditions) vector
ME-412 Dr. Anshul Sharma
PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Hermite Cubic Splines

Geometry vector
Hermite Matrix

• Similarly,

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Hermite Cubic Splines

Change of End Points Change of Tangent Vector

Control of Cubic Spline Curve

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Bezier Curve
• Another alternative to create curves is to use approximation techniques which produce
curves that do not pass through the given data points.
• Instead, these points are used to control the shape of the resulting curves.
• Most often, approximation techniques are preferred over interpolation techniques in
curve design due to the added flexibility and the additional intuitive feel provided by the
former.
• Bezier curves and surfaces are credited to P. Bezier of the French car firm Renault who
developed (about 1962) and used them in his software system called UNISURF.
• These curves, known as Bezier curves, were also independently developed by P.
DeCasteljau of the French car company Citroen (about 1959) which used it as part of its
CAD system.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Bezier Curve
• Major differences between the Bezier curve and the cubic spline curve are:

 The shape of Bezier curve is controlled by its defining points


only. First derivatives are not used in the curve development as in
the case of the cubic spline.

 The order or the degree of Bezier curve is variable and is related


to the number of points defining it.

 The Bezier curve is smoother than the cubic spline because it has
higher-order derivatives.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Bezier Curve
• The Bezier curve is defined in terms of the locations of n + 1 points.

• These points are called data or control points.

• They form the vertices of what is called the control or Bezier characteristic polygon
which uniquely defines the curve shape

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Bezier Curve
• Only the first and the last control points or vertices of the polygon actually lie on the
curve.
• The other vertices define the order, derivatives and shape of the curve.
• The curve is also always tangent to the first and last polygon segments.

• In addition, the curve shape tends to follow the polygon


shape.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Bezier Curve
• Mathematically, for n + 1 control points, the Bezier curve is defined by the following
polynomial of degree n:
where P(u) is any point on the curve
and Pi is a control point. Bi,n are the
Bernstein polynomials.

• Thus, the Bezier curve has a Bernstein basis.


• The Bernstein polynomial serves as the blending or
basis function for the Bezier curve and is given by

ME-412 Dr. Anshul Sharma


Effect of Bernstein Polynomials

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Bezier Curve (Characteristics)
• The characteristics of the Bezier curve are based on the properties of the Bernstein
Polynomials.
 The curve interpolates the first and last control points.
 The curve is tangent to the first and last segments of the characteristic polygon.

First Segment Last Segment of Curve

 Reversing the direction of parametrization does not


change the curve shape.

 Each control point is most influential on the curve


shape. Therefore, each control point is weighed by
its blending function for each u value.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Bezier Curve (Characteristics)

 The curve shape can be modified by either


changing one or more vertices of its polygon or
by keeping the polygon fixed and specifying
multiple coincident points at a vertex

 A closed Bezier curve can simply be generated


by closing its characteristic polygon or choosing
P0 and Pn to be coincident.

 For any valid value of u, the sum of the Bi,n


functions associated with the control points is
always equal to unity for any degree of Bezier
curve.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Bezier Curve (Blending)
 In practical applications, the need may arise to deal with composite curves where various
curve segments arc blended or joined together.
 In these applications maintaining continuity of various orders between the segments might
be desired.

C0 Continuity C1 Continuity
(Ensured by common point P4) (Tangent vectors are constant)

 C1 Continuity requires that the last segment of the first polygon and the first segment of
the second polygon form a straight line (Points P3, P4 and P5 must be collinear).
ME-412 Dr. Anshul Sharma
PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Bezier Curve (Convex Hull Property)
 A most desirable feature for any curve defined by a polygon such as the Bezier curve is
the convex hull property.
 This property relates the curve to its characteristic polygon.
 This is what guarantees that incremental changes in control point positions produce
intuitive geometric changes.
 A curve is said to have the convex hull property if it lies entirely within the convex hull
defined by the polygon vertices.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 Bezier Curve (Example)
A cubic spline curve is defined by the equation
Assuming these coefficients are known, find the four control points that define an
identical Bezier curve.

Comparing the coefficients,

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves
• B-spline curves provide another effective
method, besides that of Bezier of generating
curves defined by polygons.
• B-spline curves are the proper and
powerful generalization of Bezier curves.
• In addition to sharing most of the Bezier Curve
characteristics of Bezier curves, they provide
local control of the curve shape as opposed to
global control by using a special set of
blending functions that provide local
influence.
• They also provide the ability to add control
points without increasing the degree of the
curve.
ME-412 Dr. Anshul Sharma B-Spline Curve
PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves

• Similar to Bezier curves, the B-spline curve defined by n + 1 control points

Ni,k (u) are the B-spline functions

• There are two major differences


─ the parameter k controls the degree (k − 1) of the resulting B-spline curve and is
usually independent of the number of control points (n).

─ the maximum limit of the parameter u is no longer unity as it was so chosen


arbitrarily for Bezier curves.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (Properties)
 The B-spline functions have the following properties:
relationship between the curve and its
Partition of Unity:
defining control points is invariant

curve segment lies completely within


Positivity:
the convex hull

each segment of a B-spline


Local support: curve is influenced by only k
control points

Continuity:

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (Open or Non-Periodic)
• The B-spline function also has the property of recursion which is defined as

• Because Ni,1 is constant for k = 1, a general value of k produces a polynomial in u of


degree (k − 1) and therefore a curve of order k and degree (k − 1).

• The ui are called parametric knots or knot values.


• The values of the ui depend on whether the B-spline curve is an

─ open (non-periodic) curve

─ closed (periodic) curve


(n + k + 1) knots are needed to create a (k − 1)
ME-412 degree curve defined by (n + 1) control points
PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (Open or Non-Periodic)
• The degree of the resulting B-spline curve is controlled by k, the range of the parameter
u implies that there is a limit on k that is determined by the number of the given control
points.

• This limit is found by

This relation shows that a minimum of two, three and four


control points are required to define a linear, quadratic and
cubic B-spline curve respectively.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (characteristics that are useful in design)
1. The local control of the curve can be achieved by changing the position of a control
point(s), using multiple control points by placing several points at the same location, or by
choosing a different degree (k − 1).

Local Control of B-spline Curves (P3 Point Only)


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (characteristics that are useful in design)
2. A non-periodic B-spline curve passes through the first and last control points P0 and Pn+1
and is tangent to the first (P1 − P0) and last (Pn+1 − Pn) segments of the control polygon,
similar to the Bezier curve.

ME-412
Dr. Anshul Sharma
PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (characteristics that are useful in design)
3. Increasing the degree of the curve tightens it. In general, the less the degree, the closer
the curve gets to the control points.
─ When k =1, a zero-degree curve results. The curve then becomes the control points
themselves.
─ When k = 2, the curve becomes the polygon segments themselves.

4. A second-degree curve is always tangent to the midpoints of all the internal polygon
segments. This is not the case for other degrees.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (characteristics that are useful in design)
5. If k equals the number of control points (n + 1), then the resulting B-spline curve becomes
a Bezier curve. In this case the range of u becomes zero to one.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (characteristics that are useful in design)
6. Multiple control points induce regions of high curvature of a B-spline curve. This is useful
when creating sharp corners in the curve

7. Increasing the degree of the curve makes it more difficult to control and to calculate
accurately. Therefore, a cubic B-spline is sufficient for a large number of applications.
ME-412 Dr. Anshul Sharma
PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (Closed or Periodic)
• The only difference between open and closed curves is in the choice of the knots and
the basic functions.

determine the knots and


the spacing between them
for open curves

• Closed curves utilize periodic B-spline functions as their basis with knots at the integers.

• These basis functions are cyclic translates of a single canonical function with a period
(interval) of k for support.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (Closed or Periodic)
• For example, for a closed B-spline curve of order 2 (k =
2) or a degree 1 (k − 1), the basis function is linear, has a
nonzero value in the interval (0, 2) only and has a
maximum value of one at u = 1.
• The knot vector in this case is [0 1 2]
• Quadratic and cubic closed curves have quadratic and cubic basis functions with
intervals of (0, 3) and (0, 4) and knot vectors of [0 1 2 3] and [0 1 2 3 4] respectively.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (Closed or Periodic)
• The closed B-spline curve of degree (k − 1) or order k defined by (n + 1) control points
is given by

Same as Open Curve

• The B-spline function is defined as

• The values of the ui depend on • The mod (n + 1) is the modulo function

and the range of u is

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (Closed or Periodic)

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (Example)
Find the equation of a cubic B-spline curve defined by the following control points as

How does the curve compare with the Bezier curve?

• This cubic spline has k = 4 and n = 3. Eight knots are needed to calculate the B-spline functions.

using

• The range of u is 0 ≤ u ≤ 1.

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (Example Cont…)
Find the equation of a cubic B-spline curve defined by the following control points as

How does the curve compare with the Bezier curve?

• Calculation of B-spline functions

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (Example Cont…)
Find the equation of a cubic B-spline curve defined by the following control points as

How does the curve compare with the Bezier curve?

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (Example Cont…)
Find the equation of a cubic B-spline curve defined by the following control points as

How does the curve compare with the Bezier curve?

ME-412 Dr. Anshul Sharma


PARAMETRIC REPRESENTATION OF SYNTHETIC CURVES
 B-Spline Curves (Example Cont…)
Find the equation of a cubic B-spline curve defined by the following control points as

How does the curve compare with the Bezier curve?

Therefore,

Substituting N3,1

This equation is the same as the one for the Bezier curve. Thus the cubic B-spline curve
defined by four control points is identical to the cubic Bezier curve defined by the same points.
ME-412 Dr. Anshul Sharma

You might also like