Vous êtes sur la page 1sur 22

Exercise On Wire Frame Modeling Of Various

Synthetic Curves

- Introduction

Wireframe modeling systems were popular when geometric modeling was first
introduced. Wireframe modeling systems represent a shape of the object by its
characteristic lines, curves, and end points. It uses these lines and points to display
three dimensional shapes and allow manipulation of the shape by modifying the
lines and points. The visual model is simply the wireframe drawing of the shape. The
figure shows wireframe model and different views of an object.



The mathematical description of wireframe model includes the list of curve
equation, coordinates of the points and connectivity information for the shapes
curves and points. Wireframe modeling systems require only simple user input to
create a shape and that it is relatively easy for users to develop systems themselves.
- Types of curves

The curves used in geometric modeling can be classified as follows.
1. Analytic Curves
2. Synthetic Curves

1. Analytic Curves- This type of curve can be represented by a simple
mathematical equation, such as a circle or an ellipse. They have a fixed and
cannot be modified to achieve a shape that violates the mathematical equation.
The types of analytic curves are
1-Line
2-Circle
3-Ellipse
4-Parabola
5-Hyperbola

2. Synthetic curves- Synthetic curves are represented by set of data points which
defines and controls the trajectory of curves. Parametric curves are not sufficient
to fulfill the geometric requirements for the design of object such as impeller
casing, car bodies, aircraft wings, turbine blade etc. Synthetic curves are used for
such type of object with complex geometric shape.

Synthetic curve passes through defined data points and can be represented by
polynomial equation. Synthetic curves can be generated by two ways
1. Interpolation
2. Approximation







- Mathematical representation of various curves

Curve is defined as the locus of a point moving with one degree of freedom. A
curve can be represented by its analytical equation or its coordinate array.
Mathematically curves can be represented in two forms;
1. Non-parametric Representation
2. Parametric Representation
Non-parametric Representation:-
Non-parametric representation is also known as generic representation
In non-parametric representation, the object is described by its coordinates with
respect to the current reference frame.

The curve is represented by the relationship between the coordinates x, y and z
which satisfy the function f(x, y, z) = 0.

Non-parametric representation can be further classified in two forms:
1. Explicit form
2. Implicit form


1. Explicit form
In explicit non-parametric representation of curve, any two coordinates(y and z)
of a point are expressed as two separate functions of the third coordinates(x) as
the variable.

If a point P(x, y) is to be represented by position vector P as shown in fig then
P=[x y]
P=[x f(x)]
Where, y=f(x) = function of x
Example:
1. For line y=m x + c, the position vector of any point can be represented by

P = [ x y ] = [ x f(x) ] = [x m x +c]

2. For circle having radius r and center at origin the explicit representation can be:

P= [ x y ] = [ x f(x) ]= [
2 2
x r x ]

The explicit representation of a three dimensional curve can be as below,

P = [ x y z ] =[ x f(x) g(x)]

Where, f(x) and g(x) are the functions of x

The explicit representation is not useful in geometric modeling because it is
unusable for closed curves having more than one dependent variable.

2. Implicit form
The implicit non parametric form represents the curve as locus of point that
satisfy an equation. The implicit representation in two dimension is of the form:

F(x, y) = 0
Where f(x, y) is the function of both x and y coordinates

Example:
1. For line, the implicit form of representation is:

ax + by + c = 0

2. The curves of second degree(conics) can be represented as the loci of point
which satisfy the general equation:


2 2
ax by cxy dx ey f + + + + + =0

The implicit representation of a three dimensional curve can be as below:

P = [ x y z] = [ x f(x) g(x) ]
Where, f(x) and g(x) are the functions of x
Disadvantages of Non-parametric Representation:
Non-parametric representation is not suitable for closed and multivalued curves.

In case of non parametric representation, the solution of simultaneous equation is
lengthy process.

When the tangent of curve is vertical the slope of tangent is infinite. Such conditions
cannot be handled by non-parametric representation.

The curve equations in non-parametric representation are coordinates system
dependent which is not preferable for geometric modeling because most
engineering curves are independent of coordinate system.


Parametric Representation
The parametric representation of curve is done by set of equations made up of a
common independent variable known as parametric variable. The coordinates x, y
and z of any point on curve are expressed as a function of a independent variable u
which acts as local variable. A point P(x, y, z) on curve may be represented by
P = [ x y z ]
P(u) = [ x(u) y(u) z(u) ]
Where
X, y, z are coordinates of the curve points.

u is parametric variable which is constrained in definite interval [
i
u ,
f
u ]. Where are
initial and final values of parameter u.
Fig represents the parametric representation of a curve in cartesian space and curve
components in parametric space.

The slope of tangent vector at any point on curve in parametric space can be defined as:
'
( )
( )
( )
dP u
P u
d u
=

' ' '
[ ( ), ( ), ( )]
[ ]
d x u y u z u
x y z
du
= =
'
( ) [ ]
dx dy dz
P u
du du du
=
The magnitude and direction of the slope at any point on curve is given by:
|
'
( ) P u |=
' 2 ' 2 ' 2
x y z + + and
n =
'
'
( )
( )
p u
p u
=
' ' '
' 2 ' 2 ' 2 ' 2 ' 2 ' 2 ' 2 ' 2 ' 2
x y z
x y z x y z x y z
(
(
+ + + + + + (


Example
The point p( x y ) lying on circle having center at origin can be represented parametrically by
:
P = [ x y ]
= [ ( ) ( )] x y u u
=[ cos sin ] r r u u
Where, r is radius of circle and u is parametric variable which is angle between radius
vector of point and X-axis. For circle the range of u is 0su s360.
Advantages of Parametric representation-
1. Separation of variable allows each variable to be treated separately.
2. The transformation of parametric equations can be done easily.
3. Infinite slops of tangents can be handled without computational breakdown.
4. Vector representation is easy.
5. Closed and multi-valued curves can be represented easily.

- Wire frame models and entity representation
All the existing CAD/CAM systems provide users with basic wire-frame entities. Most
of the wire-frame models consists of points, lines and arcs, which are the basic
entities of model. The entities can be divided into analytical entities and synthetic
entities. Analytical entities include points, lines, arcs and circles, fillets and chamfers
and conics such as ellipse, parabola and hyperbola. Various types of splines such as
cubic spline, -spline, and -splines and Bezier curves are synthetic entities.
Entities are building blocks of geometric models hence mathematical treatment of
entities would provide insight into CAD/CAM. Mathematical representation of these
entities are given as follows
(1) Absolute coordinate system point by its coordinates P (x, y, z).

(2) Point by its polar co-ordinates


(2) Point as an centre point of an existing entity

Defining lines




Defining arcs and circles


Define synthetic entities


- Parametric representation of various curves
1. Line
The simplest fixed-form curve is a straight line. Parametric equation of a straight
line is given as,

P(t) = A + (B-A) t

The parametric equation of line AB can be derived as,


x = x
1
+ (x
2
- x
1
) t
y = y
1
+ (y
2
- y
1
) t
.
where, 0 t 1

The point P on the line is sweeped from A to B, as the value of t is varied from 0
to 1.

Example - Parametric Representation of a Straight Line
For the position vectors P
1
[1 2] and P
2
[4 3], determine the parametric
representation of the line segment between them. Also determine the slope and tangent
vector of the line segment.

Solution

A parametric representation is

P (t) = P
1
+ (P
2
P
1
) t = [1 2] + ([4 3] [1 2]) t 0 < t < 1
P (t) = [1 2] + [3 1] t 0 < t < 1

Parametric representations of the x and y components are
x (t) = x
1
+ (x
2
x
1
) t = 1 + 3t 0 < t < 1
y (t) = y
1
+ (y
2
y
1
) = 2 + t

The tangent vector is obtained by differentiating P (t). Specifically,

P' (t) = [x' (t) y' (t)] = [3 1]

Or Vt = 3i+j
where, Vt is the tangent vector and i, j are unit vectors in the x, y directions, respectively.
The slope of the line segment is


'( )
'( )
1
3
y t
x t
dy
dy
dt
dx
dx
dt
= = =

2.Circle

The non-parametric equation of a circle is,
(x x
c
)
2
+ (y y
c
)
2
= r
2
(4.2)
Where, x
c
, and y
c
are coordinates of the center, and r is radius of the circle.

If we were to use this form of the equation for plotting a circle or a circular curve, we will
first calculate several values of x and y along the circumference of the circle, and then plot
them. The curve thus generated will be of a poor quality, unless we plot a very large number
of data points, which will result in a significant demand for storage of these data points.
Therefore, as stated earlier, in CAD programs, we use a parametric equation, which avoids
the need for storage of the data points, and provides a smooth curve. The parametric equation
of the above circle can be written as,

x
i
= x
c
+ r cos
y
i
= y
c
+ r sin

This equation is converted into a matrix form so that a computer can solve it. We will now
convert this equation into a matrix form.

Let us assume that the plot starts at the point (x
i
, y
i
), and the center lies at the origin. We
increment to ( +), giving us the new point on the circle (x
i+1
, y
i+1
), or

x
i+1
= r cos( +)
y
i+1
= r sin( +)

Expanding it by the use of
trigonometric identities, we get:


x
i+1
= r cos cos - r sin sin
y
i+1
= r sin cos + r cos sin

Substituting the values: x
i
= r cos, and y
i
= r sin, we get

x
i+1
= x
i
cos - y
i
sin
y
i+1
= y
i
cos + x
i
sin

In matrix form, these equations can be written as,


[x
i+1
y
i+1
0 1 ] = [x
i
y
i
0 1]
cos sin 0 0
sin cos 0 0
0 0 1 0
0 0 0 1
u u
u u
A A | |
|
A A
|
|
|
\ .
(A)


Equation (A) is valid for a circle that has center at the origin. To find the
equation of a circle that has center located at an arbitrary point (x
c
, y
c
), we
can use the translation transformation. Note that the equation (4.4) can be
interpreted as rotational transformation of points x
i
and y
i
about the origin.
Now, instead of rotation about the origin, we wish to rotate the point about
the fixed point (x
c
, y
c
). This can be accomplished by the three-step approach,
discussed in chapter 2, i.e., first translate the fixed point to the origin, rotate
the object, and finally translate it so that the fixed point is restored to its
original position. Using this procedure we will get:

[x
i+1
y
i+1
0 1] =
[x
i
y
i
0 1]
1 0 0 0
0 1 0 0
0 0 1 0
0 1
Xc Yc
| |
|
|
|
|

\ .
cos sin 0 0
sin cos 0 0
0 0 1 0
0 0 0 1
u u
u u
A A | |
|
A A
|
|
|
\ .
*



1 0 0 0
0 1 0 0
0 0 1 0
0 1
Xc Yc
| |
|
|
|
|
\ .
(B)



Simplifying the equation we get,

x
i+1
= x
c
+ (x
i
x
c
) cos - (y
i
y
c
) sin
y
i+1
= y
c
+ (x
i
x
c
) sin + (y
i
y
c
) cos

Even though, equations (B)can be used as an iterative formula to plot a circle or a circular
curve, using the EXCEL or MATLAB, or any other plot routines, the matrix equation (A) is
the preferred form for a CAD program. The original CAD programs used iterative formulas
to generate curves. The BASIC and FORTRAN languages were used to write the CAD codes.


3.Ellipse

Following the procedure outlined in the previous section, we can derive the parametric
equations of an ellipse. Parametric equation of an ellipse is given by the equation

x
i
= a cos
y
i
= b sin


For a point on the ellipse, in general, the equation is

x
i+1
= x
i
cos (a/b) y
i
sin 2a
y
i+1
= y
i
cos (b/a) x
i
sin

For a more general case, when the axes of the ellipse are not parallel to the coordinate axes,
and the center of the ellipse is at a distance x
c
, y
c
from the origin, the equation of the ellipse is
given below. Let be the angle that the major axis makes with the horizontal (x-axis), as
shown. The equation of the ellipse can be derived as

x
i
= x
c
+ x
i
cos y
i
sin
y
i
= y
c
+ x
i
sin + y
i
cos


Where, x and y are the coordinate values of a Point on the ellipse, in term of the rotated
axes x and y.

Equations can be used to write either as an iterative formula or as a matrix equation for
creating an elliptical curve.


4.Parabola














- Review of vector algebra-

The basics of vector algebra are required in order to represent the curves in
parametric form. For geometric modeling of any object the matrices consisted of
various points are required to be handled in vector form.

Scalar
A scalar is a quantity that can be represented by a single real number. Scalar has only
magnitude and has no direction. The example of scalar quantities are mass, speed,
time, electric charge energy etc.

Representation of vector
Vector is an order set of numbers from which we can derive properties of magnitude
and direction. Vector can be denoted by writing the symbol of that property with
bold letters.












- Parametric representation of synthetic curves

Hermite cubic spline curve

The main idea of the Hermite cubic spline is that a curve is divided into segments. Each
segment is approximated by an expression, namely a parametric cubic function. The reasons
for using cubic functions to approximate the segments are

cubic polynomial is the minimum-order polynomial function that generates C
0
, C
1
and C
2
continuity curves.

A cubic polynomial is the lowest-degree polynomial that permits inflection within a curve
segment and allows representation of non-planar (twisted) space curves.

Higher-order polynomials have some drawbacks, such as oscillation about control points,
and are uneconomical in terms of storing information and computation.

The general form of a cubic function can be written as


where the point v

where the point vector r of the cubic curve is defined by the parametric equation V (t). The
segment defined by the equation has highest-degree polynomial t
3
. The parameter t is
traditionally bounded by the parameter interval 0 < t < 1.

The general form represents the whole family of cubic curves. We can define any particular
curve by specifying the four coefficient vectors (that is, a
0
, a
1
, a
2
, a
3
). However, the
coefficients do not all have direct physical significance and are not convenient handles for
adjusting the segment shape or incorporating it into a composite curve.

The Hermite cubic spline presents a way to define the coefficients more meaningfully. That
is, we want to define a curve by V (0) and V (1), V (0) and V (1), where V (0) and V (1) are
the position vectors at the ends of the segment and V (0) and V (1) are the tangent vectors
at the endpoints. The geometric meaning is that the two endpoints of the Hermite cubic curve
are at V (0) and V (1) and the two tangent vectors at the two endpoints are V (0) and V (1).
This gives users a way to connect two curves and assure a certain degree of continuity. An
example of a Hermite cubic spline is shown in Figure . We next derive the parameter
equation, given that V (0), V (1), V (0) and V (1) are known.
A



Upon differentiation of above Equation of V (t), we have


Applying the boundary conditions to the above Equations

At t = 0; V (0) = a
0
, V (0) = a
1

At t = 1; V (1) = a
0
+ a
1
+ a
2
+ a
3
V (1) = a
1
+ 2a
2
+ 3a
3

On solving these four equations simultaneously for the coefficients, we get

a
0
= V (0)
a
1
= V (0)
a
2
= 3 [V (1) V (0)] 2V (0) V (1)
a
3
= 2 [V (0) V (1)] + V (0) + V (1)

Substituting these coefficients into above equation of V (t) and rearranging gives

2 3 2 3 ' 2 3 ' 2 3
( ) (0)(1 3 2 ) (1)(3 2 ) (0)( 2 ) (1)( ) V t V t t V t t V t t t V t t = + + + + + +
' 2 3 2 ' 2 ' 2
( ) (0)( 6 6 ) (1)(6 6 ) (0)(3 4 1) (0)(3 2 ) V t V t t V t t V t t V t t = + + + + +

The equation can be represented in matrix form as


r=T.M.P. = [1 t
2
t
3
t ]
1 0 0 0
0 0 1 0
3 3 2 1
2 2 1 1
(
(
(
(
(



'
'
(0)
(1)
(0)
(1)
V
V
V
V
(
(
(
(
(




t = [1 t
2
t
3
t ]

M=
1 0 0 0
0 0 1 0
3 3 2 1
2 2 1 1
(
(
(
(
(


, P=
'
'
(0)
(1)
(0)
(1)
V
V
V
V
(
(
(
(
(



This form can be conveniently adjusted to yield various shapes of curve segment by altering
one or more of V (0), V (1), V (0) and V (1) appropriately. The Hermite form of a cubic
spline is determined by defining positions and tangent vectors at the data points. Hermite
cubic curves are also called as Fergusons cubic curves. The equation of V (t) is a power basis
representation and is good for computation.

There are some disadvantages of this method which are given below,


-First-order derivatives are needed; it is not convenient for a designer to provide first-order
derivatives.

-There is not local control support.

- The order of the curve is constant regardless of the number of data points.

- Physically, the values of parameters a
0
, a
1
, a
2
and a
3
do not have any intentive meaning. If
you know these values, you cant guess the shape of the curve.



B-spline curve

Imagine that you need to represent a very complex, curved shape approximated by, say, 20
points. If we design this shape using a Bezier, we will need a degree 19 curve. Such curves
are difficult to maintain/modify and compute. We would prefer to work with lower degree
functions for computational reasons. Further, depicting a curve by a single high degree
function is not good when we modify shapes since each control point has some effect on
the shape of the curve. Thus, changing the location of P
18
will change the shape (a little) near
the control point P
2
. But often, in design, we would like more localized control on shape
modification. We now study a method to solve both of the above problems.

The solution to the problem is the following: divide the entire shape into smaller segments,
and represent each segment with a low order polynomial. The maths of this simple idea is
not too simple, but we shall look at the basics at least. The figure below shows this idea,
where the curve C (u) is made up of 3 segments, defined as C
i
(u), i = 1, 2, 3, the domain of C
i
is over ui 1 X__Xi, and u
0
= 0 < u
1
< u
2
< u
3
. Now we can use any of the conventional (e.g.
power basis, or Ferguson, Bezier etc.) mechanisms to describe each curve segment C
i
, but to
be useful, we must ensure that at the intermediate vertices, called the breakpoints, the
curves maintain some level of continuity

There are many ways to implement the above idea. We shall look at B-Splines, which are a
general form of Bezier. B-splines provide functions of the form



1
( )
0
( )
t
n
f u P
t
c u
=
=




where P
i
are the control points, and the {f
i
(u), i = 0, . . . , n} are piecewise polynomial
functions that form a basis for the vector space of all piecewise polynomial functions of some
given degree and continuity at a given set of breakpoints {u
i
, i = 1, . . . , m}. Note that
continuity (at least with respect to the parameter u) is dictated purely by the basis functions f
i
(u) the control points can be modified without affecting the continuity. Further, we would
like C (u) to possess the convex hull property, as well as the coordinate frame invariance
property. Another property we wish our f
i
(u)s to have is that of local support each f
i
(u) is
non-zero in only a (given) small number of intervals, but not over the entire domain [u
0
, u
m
].
Since P
i
is multiplied by f
i
(u), moving P
i
will only affect the curve shape in the range where f
i
(u) is non-zero.

All these, and other beautiful properties are possessed by B-splines. To understand B-splines,
we need to first study the B-spline basis functions. Let U = {u
0
, . . ., u
m
} be a non-decreasing
sequence of real numbers, that is, u
0
_ X1 _ X2 _ Xm. The ui are called knot points, or
simply knots, and U is the knot vector.



Properties of the B-spline Functions

-Local Support Property : N
i, p
(u) = 0 for u outside the interval [u
i
, u
i + p+1
). This property can
be deduced from the observation above that N
i, p
(u) is a linear combination of N
i, p1
(u) and
N
i + 1, p1
(u).

- In any given knot span, at most p + 1 of the basis functions are non-zero. Which basis
functions can be non-zero in the knot span [u
j
, u
j+1
)?

-Non-negativity : N
i, p
(u) for all i, p and u. This is proved easily using induction on p. i

- Partition of Unity : For any knot span, [u
i
, u
i+1
), sum of N
j, p
(u) = 1.

-Continuity : All derivatives of N
i, p
(u) exist in the interior of any knot span (since it is a
polynomial).

-At a knot, N
i, p
(u) is (p k) times differentiable, where k is the multiplicity of the knot (that
is, the number of knots of the same value is the multiplicity of the knot at that value).




Bezier curve

Bezier curves are used in CAD and are named after a mathematician working in the
automotive industry. Bezier curves are based on approximation techniques that produce
curves that do not pass through all the given data points except the first and the last control
point. A Bezier curve does not require first-order derivative; the shape of the curve is
controlled by control points.

As in the previous section, we consider one segment of the curve. For n + 1 control points,
the Bezier curve is defined by a polynomial of degree n as follows


where V (t) is the position vector of a point on the curve segment and Bi, n are the Bernstein
polynomials, which serve as the blending or basis function for the Bezier curve.

The Bernstein polynomial is defined as



where C (n, i) is the binomial coefficient given by






Here V
0
, V
1
, . . . , V
n
are the position vectors of n + 1 points that form the so-called
characteristic polygon of the curve segment.




The Bezier curve has the following properties :

- Since Bezier curves are polynomial functions, they are easily computed, and infinitely
differentiable (so tangents and curvatures are easily computed).

- The curve begins at the first control point, P
0
, and ends at the last control point, P
n
. It does
not pass through any of the intermediate control points.

-The tangent at the start point (u = 0) lies along the vector from P
0
to P
1
; the tangent at the
end point (u = 1) lies along the vector from P
n 1
to P
n
.

-The entire curve lies in the interior of the convex hull of the control points. This is called the
convex hull property, and is extremely useful for many CAD/CAM routines.

-Bezier curves are invariant over affine transformations of the control points. In other words,
if the control points are translated, or rotated, the curve moves to the corresponding new
coordinate frame without changing its shape.

Vous aimerez peut-être aussi