Sie sind auf Seite 1von 410

ME401T

Computer Aided Design


Circle Algorithm
Circle Generating Algorithms
• A circle is defined as the set of points
that are all at a given distance r from
a center point (xc, yc).

• For any circle point (x, y), this distance


is expressed by the Equation
(x − xc)2 + (y − yc)2 = r 2
• We calculate the points by stepping
along the x-axis in unit steps from xc-r
to xc+r and calculate y values as
Circle Generating Algorithms
• There are some problems with this approach:
1. Considerable computation at each step.
2. Non-uniform spacing between plotted pixels as shown in
this Figure.
Circle Generating Algorithms
• 2nd problem can be eliminated using the polar
form:
x = xc + r cos θ
y = yc + r sin θ

• Using a fixed angular step size, a circle is


plotted with equally spaced points along the
circumference.
Circle Generating Algorithms
• Problem 1 can be overcome by considering the symmetry of circles
as in the next figure.
• But it still requires a good deal of computation time.

• From x=0 to x=y - octant

• Efficient Solutions
– Midpoint Circle Algorithm
Mid point Circle Algorithm
• For a given radius r and screen center position
(xc, yc) – setup an algorithm from origin (0, 0).
• Then each calculated position (x, y) is moved
to proper screen position by adding xc to x and
yc to y.
• Octant – x=0 to x=y in 1st quadrant.
• Slope of the curve (circle) varies from 0 to -1.
• Unit steps in x direction.
Mid point Circle Algorithm
• To apply the midpoint method, we define a
circle function:

• Any point (x,y) on the boundary of the circle


with radius r satisfies the equation fcircle(x, y)=
0.
Mid point Circle Algorithm
• If the points is in the interior of the circle, the
circle function is negative.
• If the point is outside the circle, the circle
function is positive.

• To summarize, the relative position of any


point (x,y) can be determined by checking the
sign of the circle function:
Mid point Circle Algorithm

• The circle function tests in (3) are performed for the mid
positions between pixels near the circle path at each sampling
step.

• Thus, the circle function is the decision parameter in the


midpoint algorithm, and we can set up incremental
calculations for this function as we did in the line algorithm.
Mid point Circle Algorithm
• Figure shows the midpoint between the two candidate pixels
at sampling position xk +1. Assuming we have just plotted the
pixel at (xk , yk), we next need to determine whether the pixel
at position (xk +1, yk) or the one at position (xk +1, yk −1) is
closer to the circle.
Mid point Circle Algorithm
• Our decision parameter is the circle function
(2) evaluated at the midpoint between these
two pixels:
Mid point Circle Algorithm
• If pk < 0, this midpoint is inside the circle and
the pixel on scan line yk is closer to the circle
boundary.
• Otherwise, the midpoint is outside or on the
circle boundary, and we select the pixel on
scan line yk −1.
• Successive decision parameters are obtained
using incremental calculations.
Mid point Circle Algorithm
• We obtain a recursive expression for the next decision parameter by
evaluating the circle function at sampling position xk+1 +1 = xk + 2

• where yk+1 is either yk or yk-1,depending on the sign of pk.


Mid point Circle Algorithm
• Increments for obtaining pk+1 are either
– 2xk+1 +1 (if pk is negative) or
– 2xk+1 +1− 2yk+1 (if pk is positive)
• Evaluation of the terms 2xk+1 and 2yk+1 can
also be done incrementally as:
Mid point Circle Algorithm
• At the start position (0, r), these two terms
(2x, 2y) have the values 0 and 2r, respectively.

• Each successive value is obtained by adding 2


to the previous value of 2x and subtracting 2
from the previous value of 2y.
Mid point Circle Algorithm
• The initial decision parameter is obtained by
evaluating the circle function at the start
position (x0 , y0)=(0, r):
Mid point Circle Algorithm
• If the radius r is specified as an integer, we can
simply round p0 to
Algorithm
Example
• Given a circle radius r = 10, we demonstrate
the midpoint circle algorithm by determining
positions along the circle octant in the first
quadrant from x = 0 to x = y . The initial value
of the decision parameter is
Example
• For the circle centered on the coordinate origin, the
initial point is (x0 , y0) =(0,10), and initial increment
terms for calculating the decision parameters are

• Successive decision parameter values and positions


along the circle path are calculated using the midpoint
method as shown in the table.
Example
Example
• A plot of the generated pixel positions in the
first quadrant is shown in Figure.
ME401T

Computer Aided Design


Ellipse Algorithm
Ellipse Generating Algorithm
• Loosely stated, an ellipse is
an elongated circle.
• A precise definition of an
ellipse can be given in terms
of the distances from any
point on the ellipse to two
fixed positions, called the foci
of the ellipse.
• The sum of these two
distances is the same value
for all points on the ellipse
Ellipse Generating Algorithm
• Expressing distances d1 and d2 in terms of the
focal coordinates F1 = (x1, y1) and F2 = (x2, y2), we
have

• By squaring this equation, isolating the remaining


radical, and squaring again, we can rewrite the
general ellipse equation in the form
Ellipse Generating Algorithm
• Ellipse equations are greatly
simplified if the major and
minor axes are oriented to
align with the coordinate
axes.
• In Fig, we show an ellipse in
“standard position” with
major and minor axes
oriented parallel to the x and
y axes.
• rx for this example labels the
semi-major axis, and ry labels
the semi-minor axis.
Ellipse Generating Algorithm
• The equation for the ellipse shown in Fig can
be written in terms of the ellipse center
coordinates and parameters rx and ry as
Midpoint Ellipse Algorithm
• The midpoint ellipse method is
applied throughout the first
quadrant in two parts.

• Figure 3-25 shows the division


of the first quadrant according
to the slope of an ellipse with
rx < r y.
Midpoint Ellipse Algorithm
• R-1: m1  1 L1 ⊥ L2
m1 m2 = −1
L2
m2 = −1/ m1
−1  m2  0
m2  1
L1

0  m1  1
• R-2:
m1 m2 = −1
m2 = −1/ m1
m2  −1
m2  1
Midpoint Ellipse Algorithm
• Regions 1 and 2 (Fig. 3-25) can be processed in
various ways.

• We can start at position (0, ry) and step clockwise


along the elliptical path in the first quadrant, shifting
from unit steps in x to unit steps in y when the slope
becomes less than −1.0.

• Alternatively, we could start at (rx, 0) and select


points in a counterclockwise order, shifting from unit
steps in y to unit steps in x when the slope becomes
greater than −1.0.
Midpoint Ellipse Algorithm
• We define an ellipse function from Eq. 3-37
with (xc , yc) = (0, 0) as

• which has the following properties:


Midpoint Ellipse Algorithm
• Starting at (0, ry), we take unit steps in the x
direction until we reach the boundary
between region 1 and region 2 (Fig. 3-25).
• Then we switch to unit steps in the y direction
over the remainder of the curve in the first
quadrant.
• At each step we need to test the value of the
slope of the curve.
Midpoint Ellipse Algorithm
• The ellipse slope is calculated from Eq. 3-39 as

• At the boundary between region 1 and region 2,


dy/dx = −1.0 and

• Therefore, we move out of region 1 whenever dy/dx


≤ −1.0
Midpoint Ellipse Algorithm
• Figure 3-26 shows the midpoint
between the two candidate pixels
at sampling position xk +1 in the
first region.
• Assuming position (xk , yk) has
been selected, we determine the
next position along the ellipse
path by evaluating the decision
parameter (that is, the ellipse
function 3-39) at this midpoint:
Midpoint Ellipse Algorithm
• If p1k < 0, the midpoint is inside the ellipse
and the pixel on scan line yk is closer to the
ellipse boundary.

• Otherwise, the midpoint is outside or on the


ellipse boundary, and we select the pixel on
scan line yk − 1.
Midpoint Ellipse Algorithm
• At the next sampling position (xk+1 + 1 = xk +
2), the decision parameter for region 1 is
evaluated as
Midpoint Ellipse Algorithm
• Decision parameters are incremented by the
following amounts:
Midpoint Ellipse Algorithm
• At the initial position (0, ry), these two terms evaluate to

• As x and y are incremented, updated values are obtained by


adding 2r 2y to the current value of the increment term in Eq. 3-45
and subtracting 2r 2x from the current value of the increment
term in Eq. 3-46.

• The updated increment values are compared at each step, and we


move from region 1 to region 2 when condition 3-42 is satisfied.
Midpoint Ellipse Algorithm
• In region 1, the initial value of the decision
parameter is obtained by evaluating the
ellipse function at the start position (x0, y0) =
(0, ry):
Midpoint Ellipse Algorithm
• Over region 2, we sample at
unit intervals in the negative
y direction, and the midpoint
is now taken between
horizontal pixels at each step
(Fig. 3-27).
• For this region, the decision
parameter is evaluated as
Midpoint Ellipse Algorithm
• If p2k > 0, the midpoint is outside the ellipse
boundary, and we select the pixel at xk.

• If p2k <= 0, the midpoint is inside or on the


ellipse boundary, and we select pixel position
xk+1.
Midpoint Ellipse Algorithm
• To determine the relationship between successive
decision parameters in region 2,we evaluate the
ellipse function at the next sampling step yk+1 −1 =
yk −2:
Midpoint Ellipse Algorithm
• When we enter region 2, the initial position
(x0, y0) is taken as the last position selected in
region 1 and the initial decision parameter in
region 2 is then
Algorithm
Example
• Given input ellipse parameters rx =8 and ry = 6,
we illustrate the steps in the midpoint ellipse
algorithm by determining raster positions
along the ellipse path in the first quadrant.
• Initial values and increments for the decision
parameter calculations are
Example
• For region 1, the initial point for the ellipse
centered on the origin is (x0, y0) = (0, 6), and
the initial decision parameter value is

• Successive midpoint decision parameter


values and the pixel positions along the ellipse
are listed in the following table.
Example
Example
• We now move out of region 1, since
2r 2 y x > 2r 2 x y.
• For region 2, the initial point is
(x0, y0) = (7, 3)
• and the initial decision parameter is
Example
• The remaining positions along the ellipse path
in the first quadrant are then calculated as
Example
• A plot of the calculated positions for the
ellipse within the first quadrant is shown
bellow:
Finite Element Method – An
introduction by B. J. Gadhvi
ME401T
Engineering problems
• Mathematical models of physical situations
• Like Mechanical vibration problem (MBD)
• Vibration analysis of any structure

• Equivalent spring mass model


• Apply:
➢ Newton’s second law
➢ D’Alembert’s principle
➢ Energy conservation law

[ m] x + [c ] x + [ k ] x = 0
➢ But now what do we do with
this?
Engineering problems
• What is the nature of this
equation?
[ m] x + [c ] x + [ k ] x = 0

• Type:
➢ Algebraic?
➢ Transcendental – Log, Exp,
Trigonometric?
➢ ODE – Functions of single ➢ Parametric?
variable and its derivatives ➢ Differential?
➢ PDE – Multiple independent ➢ Integral?
variable functions and partial
derivatives
Engineering problems
• Now what is the exact nature of
this ODE?
[ m] x + [c ] x + [ k ] x = 0
• Order: Second
• Degree: one
• Linear or nonlinear? – Depends on
power of variable and its
derivatives too.
• Linear
➢ Numerical methods – Is this • Solution techniques:
an IVP or BVP? ➢ Exact methods – applied to simple
➢ IVP: Runge – Kutta, problems (2 parts: homogeneous
Predicator Corrector etc. and particular)
➢ BVP: Shooting methods, ➢ Numerical methods – applied to
FDM, FEM complex problems too
Engineering problems
• If actual structure would have
been replaced by several
pieces or elements – each
continuous structural
member and BVP

• Solution: FDM, FEM

• FEM is also applicable


method to solve Engineering
problems governed by PDEs –
especially elliptical PDEs
Engineering problems
• Some Comments on exact solutions:
➢ In any eng problem there are 2 sets of parameters that
influence the behavior of the system.
➢ 1st – providing info about ‘natural behavior’ – Modulus of
Elasticity, Thermal conductivity, viscosity etc.
➢ 2nd – produce ‘disturbances’ in the system – external forces,
moments, temperature difference across a medium, pressure
difference in a fluid flow etc.
➢ ‘Natural behavior’ – always appear on the homogeneous
part of the solution
➢ ‘Disturbances’ - – always appear on the particular part of the
solution
Engineering problems
• But for many eng problems exact solutions can’t be obtained.

• Due to complex nature of governing differential equations


and complex geometries

• Difficulties with boundary and initial conditions

• Numerical solutions approximate the exact solutions

• Analytical solution shows the exact behavior at any point


within the system where as numerical methods approximate
exact solutions at discrete points called “nodes”.
Engineering problems
• FDM: Differential equations for each node are replaced by
finite differences, easy to understand and employ for simple
problems only, but difficult in complex geometry and
boundary conditions.

• FEM: Uses integral formulation to create a set of algebraic


equations, for each element solution is obtained by
continuous function, then assembly of individual solutions.
FEM Terminologies
• FEM is a numerical method used to obtain approximate
solution of engineering BVPs.

• BVP – Field problems: Mathematical problems in which one


or more dependent variables must satisfy a differential
equation everywhere within a known domain of
independent variables and satisfy specific conditions on the
boundary of the domain
• Continuous Lateral vibration of a beam:
FEM Terminologies
• Field: Domain of interest

• Field variables: the dependent variables of interest governed


by the differential equation.
➢ Depending on the type of problems they may be
displacement, temperature, heat flux, fluid velocity etc.

• Boundary conditions: the specified values of the field


variables (or related variables such as derivatives) on the
boundaries of the field
How does FEM work? & Terminologies
• Figure: Volume of some material
having known physical
properties

• Volume: Domain of the BVP to


be solved

• Problem: 2D, single field


variable to be determined at
every point P (x, y) – such that
the governing equations are
satisfied at every point P.

• Exact solution is difficult –


complex geometry & boundary
conditions
How does FEM work? & Terminologies
• Small triangular element: Finite
sized sub-domain, vertices are
numbered and are known as
‘nodes’.

• Node: a specific point in the finite


element at which the value of the
field variable is to be explicitly
calculated

• Exterior nodes: Nodes on the


boundaries of the finite element.

• Interior nodes: Nodes those don’t


lie on the boundaries of the finite
element and cannot be connected
to any other element.
How does FEM work? & Terminologies
• If the values of the field variable
are computed only at nodes, how
are values obtained at other
points within a finite element? –
Real crux of FEM.

• Field variable values at nodes


approximate at non-nodal points
by interpolation of nodal values

• Interpolation / shape / blend


functions: Mostly polynomial of
independent variables
• 3 DOF – triangular element – DOF: number of nodes × number
scalar problem (temp.) and 6 DOF of values of field variables at each
– 2D vector problem (disp.) node
How does FEM work? & Terminologies
• Elements connect with the other
ones at exterior nodes only.

• Field variables across the inter-


element boundaries are constant
but their gradients (derivatives)
are not generally constant.

• Meshing: The process of


representing a physical domain
with finite elements

Additional elements showing a partial finite


element mesh of the domain
FEM vs Exact solution
FEM vs Exact solution
FEM procedure
• Pre processing:
➢ Define the geometric domain of the problem.
➢ Define the element type(s) to be used.
➢ Define the material properties of the elements.
➢ Define the geometric properties of the elements (length, area,
and the like).
➢ Define the element connectivity (mesh the model).
➢ Define the physical constraints (boundary conditions).
➢ Define the loadings.

• Solution:
➢ finite element software assembles the governing algebraic
equations in matrix form and computes the unknown values of the
primary field variable(s) and then derived variables.
FEM procedure
• Post processing: Analysis and the evaluation of solution results
referred to as post processing.

➢ Sort element stresses in order of magnitude.


➢ Check equilibrium.
➢ Calculate factors of safety.
➢ Plot deformed structural shape.
➢ Animate dynamic model behaviour.
➢ Produce color-coded temperature plots
Element types
• Based on their shapes:

➢ One dimensional – for analysis of 1D problem – line elements


➢ Two dimensional – for analysis of 2D problem – plane stress and
strain
➢ Axi-symmetric
➢ Three dimensional
Element types
Element types
Element types
Element types
• Axi-symmetric:
• Ring type elements

• Useful for the analysis of axi-


symmetric problems such as
analysis of cylindrical storage
tanks, shafts, rocket nozzles

• Axi-symmetric elements can


be constructed from one or two
dimensional elements.
Element types
Coordinate systems

Global Local

Natural
Stresses and Equilibrium
x = [ x y z]T

u = [u v w]T
f = [ fx fy f z ]T

T = [Tx Ty Tz ]T

Pi = [ Px Py Pz ]iT

 = [ x  y  z  yz  xz  xy ]T

 = [ x  y  z  yz  xz  xy ]T
Potential Energy
• Out of two popular approaches (Potential energy approach and
Galerkin’s approach) to present FEM, we adopt the Potential energy
approach throughout the text.

 = Strain Energy+ Work Potential  = U + WP


1 T
Strain energy per unit volume  
2
1 T
2
Total strain energy U: U =   dv
One dimensional problem
Introduction
• Strain, stress, displacement, and
loading depend only on variable x.

• A body force: Distributed load acting


on every elemental volume of the body,
unit – force per unit volume (Self weight
due to gravity)
• Traction force: Distributed load acting
on the surface of the body, unit – force
per unit area
Introduction
• Traction force: For 1D problem
considered, the Traction force is defined
as force per unit length ((Force per unit
area) × perimeter of cross section)

• Frictional resistance, viscous drag, and


surface shear – traction force.

• Point loads Pi – at a point i.

• For stiffness and load concepts –


Potential energy approach and Galerkin’s
approach
Finite element modeling
• Bar as a stepped shaft

• Four finite elements

• Five nodes

• Every element connects


to two nodes

• Element numbers are


circled to distinguish from
node numbers.

• Cross sectional area,


traction and body forces
are treated as constant
within each element
Numbering scheme
• 1D – every node is permitted to
displace only in the ± x direction

• Each node – one DOF

• Total: 5 DOF

• Global displacement and load


vectors
Shape functions

x − x1  + 1
=
x2 − x1 2
• Unknown displacement field within an element will be interpolated
by linear shape function (Good approximation – as number of
elements go up)

• Shape functions
Shape functions

Recalled?

q – Element displacement vector


Shape functions
Strain – displacement & Stress - strain
Strain – displacement & Stress - strain
B – Element strain
displacement matrix

Linear shape functions – Constant B; so


constant strain within an element (Constant
strain element)

Recalled CST?

Displacement, strain and stress relationships; now we will utilize this


in potential – energy expression to obtain element stiffness and load
matrices
Element stiffness matrix

To obtain stiffness matrix, 1 2


because we know U = kx
2
Element stiffness matrix

Not functions of x
Element stiffness matrix

Compare this 1 2
equation with: U = kx
What can be said 2
about K?

Element Stiffness Matrix


Element Body force vector


e
u T fA dx = Ae f  qT N T dx
e
Element Body force vector
Element Body force vector

Work potential due to body force is:


Body force × displacement
Element Traction force vector


e
u T T dx = T  qT N T dx
e
Element Traction force vector
Important equations

Element body load vector Element Stiffness Matrix Element traction load vector

1D point loads on nodes - Pi

Global stiffness matrix


Global load vector
Global displacement vector
Assembly of global stiffness matrix
Assembly of global load vector
Treatment of boundary conditions
Used to solve Qi for i = 1 to N, N – DOF from eqn:
KQ = F
Two approaches:
1. Elimination approach
2. Penalty approach
Elimination approach

N equations and N unknowns - Qi for i = 1 to N


Bound. Cond.: Q1 = a1 i.e. For the first DOF
displacement is constant (fixed node) or
zero if a1 = 0.
K11Q1 + K12Q2 + .... + K1N QN = F1
K 21Q1 + K 22Q2 + .... + K 2 N QN = F2
: In elimination approach disregard the row
for which the DOF is fixed – this will be
:
helpful in finding reaction at a fixed node
K N 1Q1 + K N 2Q2 + .... + K NN QN = FN
Elimination approach

Now we have: N-1 equations and N-1 unknowns - Qi for i = 2 to N, and Q1 = a1


Mostly if node 1 is fixed then we take Q1 = a1 = 0.
And reaction at node 1 can be obtained from:

[First row of K × Q] - F1
Penalty approach
Firstly from unreduced K: N × N, identify ‘max(kij)’, then take modulus of that and
multiply that by 104 and assign it to C

If node 1 is fixed: Q1 = a1:


• Then add C to the first diagonal element of K (because only node 1 is fixed, if 1
and 3 would have been fixed then C should be added to both first and third
diagonal elements of K)
• And add C× a1 to the first member of the load vector F

N equations and N unknowns - Qi for i = 1 to N

Reactions:
One dimensional Finite Element
Examples
• Firstly divide the domain into two 1D elements:
• How? – Averaging the area

• Point load is acting at the middle of the length of


the plate, so divide the plate from P into 2 elements

• Area at the middle section: [(6×1)+(3×1)]/2 = 4.5 in2


• Average area of element 1 is:
[(6×1)+(4.5×1)]/2 = 5.25 in2
• Average area of element 2 is:
[(3×1)+(4.5×1)]/2 = 3.75 in2

(b) Element stiffness matrices and body force


vectors:
(c) Assemble K and F: Remember there is a point load of 100 lb at node 2

(d) Use elimination approach to solve Q


Which node is fixed? – assign Q1 = 0, and discard 1st row and 1st column of K, 1st
member of both Q and F
(e) Evaluation of stresses at each element:
Do we have any equation to solve for stresses?
(f) Reaction at the support (at the fixed node)

[First row of K × Q] - F1
(a) Nodal displacements using penalty approach
Firstly find C; Secondly identify the places in K and F where C and C × ai can be
added respectively

Here 1st and 3rd nodes are fixed and thus a1 and a3 are zero

C should be added to 1st and the 3rd diagonal elements of K; and nothing should be
added to F as a1 and a3 are zero
(b) Stress in each element
(c) Reaction forces:
• Two reactions at two fixed nodes – 1 and 3
• What is the equation to find reaction force for penalty approach?
• What do we consider: is B’ free or fixed?

• Firstly let us assume B’ is free, and find displacement at B’: If it comes to be less
than 1.2 mm – then our assumption is valid; otherwise B’ has to be considered
fixed after being displaced by 1.2 mm.

• Nothing has been said about boundary condition approach: you may use any.

• Use elimination approach and find: QB' QB' = 1.8 mm


• Now C will be added to the 1st and the 3rd diagonal element of K;
• Also C × 0 and C × 1.2 will be added to 1st and the 3rd element of F
One dimensional Problem with
“Temperature Effects”
Temperature Effects
• Now we will consider stresses induced
due to temperature changes in an
isotropic linearly elastic material (i.e. a
thermal stress problem)

• If change in temperature ΔT is known,


then corresponding strain is known as
Initial strain - ε0

• α is the coefficient of thermal


expansion of the material

• So now we have a load due to


temperature change in addition to the
previous three loads: body load,
−1
traction load and a point load  = Ae Ee e T  
e

1
Temperature Effects
• Moreover due to this additional load
we have new equation to find stress:
One dimensional Finite Element
Example with
“Temperature Effects”
(b) Using elimination approach:
• Nodes (DOF) 1 and 3 are fixed – so K reduces to 1×1 value:
For further reading (for examinations)

• Refer to the following points from the 3rd


chapter of the book by Chandrupatla
▪ 3.1
▪ 3.2
▪ 3.3, 3.4, 3.6, 3.8 and 3.10
▪ Examples of multi point constraints and
quadratic shape functions are not in the syllabus
– Solved example 3.6, and 3.7
▪ Examples 3.2, 3.3, 3.4, 3.5 and 3.8 and similar
unsolved examples are the part of syllabus and
should be given more weight.
Thank you
and
Wish you all the best
ME401T

Computer Aided Design


Fundamentals
Computer Aided Design
• Role of computers in Mechanical design
• What are the possible areas where computers
can assist mechanical design?

➢ Engineering drawings and drafting.


➢ Creating complicated geometries with a good
accuracy
Computer Aided Design
➢ In solving structural design, thermal, and fluid
dynamics problems in mechanical engineering
design (known as Computer Aided Simulation and
Analysis).

FEA of Machine components, FEM to solve heat


problems, CFD to solve fluid problems, to solve
coupled structural-heat field problems using
numerical methods.
Computer Aided Design
➢ In optimizing the
existing design for
minimum mass and
maximum strength of
machine parts,
maximum efficiency
and minimum power
consumption of
mechanical
equipment.
Why to study CAD?
• CAE tool users become inefficient in using
them unless, fundamental concepts on which
theses systems are built, are understood
properly.

• Still all the critical shapes can not be modeled


in these tools; so getting the fundamental
knowledge may help them modeling those
shapes.
How can CAD be fit in conventional
design cycle?
Problem identification
and recognition of need

Problem definition
and conceptualisation

Geometric modelling
and spatial analysis
For example Design
of an office chair Engineering analysis
and optimization

Prototype development

Manufacturing process
development

Manufacturing
Implementation
How can CAD be fit in conventional
design cycle?
How can CAD be fit in conventional
design cycle?
How can CAD be fit in conventional
design cycle?
How can CAD be fit in conventional
design cycle?
How can CAD be fit in conventional design cycle?
How can CAD be fit in conventional
design cycle?

Customer CAM
feedback Marketing
cycle
Reasons for implementing a CAD
system
• Computers can store and handle large amount
of eng. Data; that can be utilized for design
and analysis.
• Complex geometrical shapes can be visually
inspected and checked.
• CAD tools make design, simulation, analysis
and optimization an easy task.
• CAD systems can easily be integrated with
CAM systems.
CAD applications
• Applications are numerous in fields like
Mechanical, Electrical and Architectural.
• Geometric engine:
➢Heart of modeling
➢Provides functions to perform modeling and
construction, editing and manipulation,
drafting and documentation.
➢Creating this represents a means and not a
goal for engineers.
CAD applications
• Checking interference between mating parts
in an assembly.
• Deformation, stress and strain analysis of
machine components.
CAD benefits
• Improved productivity
• Shorter lead times
• Customer’s modifications are easier to make
• Improved accuracy of design
• In analysis, easier recognition of component
interactions
• Fewer errors in NC part programming
• Saves materials and machining time by
utilizing optimization algorithms.
CAD benefits: Analysis example
CAD benefits: Analysis example
CAD benefits: Analysis example
CAD benefits: Analysis example
CAD benefits: Analysis example
CAD benefits: Analysis example
CAD benefits: Analysis example
CAD benefits: Analysis example
CAD benefits: Analysis example
CAD benefits: Analysis example
CAD benefits: Analysis example
• Without actual manufacturing of the component,
stress analysis is done.
• How to verify the results???
• Make a prototype and by placing strain gauges
calculate deformations at various section under
loads; and then finding stresses analytically and
compare the same with the software results.
• Saves a good amount of time
• This design can further be optimized
Scope of CAD
• CAD is a subset of the design process (As shown earlier
in design cycle)
• Activities of CAD systems: mass properties, FEA,
dimensioning, tolerancing, assembly modeling,
generating shaded images, documentation and drafting.

Geometric Computer
modeling graphics
CAD

Design
CAD programming
• CAD systems are powerful software applications, they
employ complex geometric modeling concepts,
computer graphics algorithms, software techniques,
design and analysis theories, manufacturing techniques
and database and management concepts.

• CAD systems evolved over the years; and code itself is


very long and complex.

• Modifying and programming CAD systems is difficult but


possible.
CAD programming
• CAD software is written in a variety of languages.
➢ Unigraphics and I-DEAS started as a Fortran code.
➢ Pro/E ad SolidWorks are written in C and C++.
➢ Most of these systems use JAVA especially for Web-
based functionality.
• How often do we need to program?
➢ There is a need for customizing these systems.
➢ There are different levels of customizing and
programming like writing a simple macro to automate
repetitive tasks, the system API (application
programming interface) to extend the system
functionality.
CAD programming
• Programming interested users must be familiar with
system functionality, structure, hierarchy, terminology
and philosophy.

• For example if someone needs to modify spline curve by


programming then the one should have used the spline
command already.
CAD programming
• What does it take to program a CAD system?
➢ Knowledge of programming language, geometry, graphic
concepts, and database techniques.
➢ For a programming language C, C++ or JAVA is good.
➢ The effective use of these requires a good knowledge of
OOP (Object-Oriented Programming).
➢ OOP – is programming paradigm that represents
concepts as “objects” that have ‘data fields’ (attributes
that describe objects) and associated procedures known
as “methods” (Examples: C++, JAVA, VB.NET, Python,
Pascal, Visual Basic, Fortran, COBOL etc..)
CAD Programming elements
• Relational database:
➢ CAD system utilizes relational databases to store
geometric, graphical and other data that defines a CAD
model.
➢ It is conceptually a set of collection of tables and table is
a relation. (database with 4 table means there are 4
relations).
➢ Each table stores data about a given entity.
➢ The data in a table is stored as attributes in rows.
➢ Each row is known as a record.
➢ For example customer name and account numbers.
➢ It is usually a collection of many such tables
CAD Programming elements
• Relational database:
CAD Programming elements
• Relational database:
➢ Another example to store the boundary representation
(B-rep) of the model (i.e. faces, edges and vertices).
CAD Programming elements
• Relational database:
CAD Programming elements
• Object database:
➢ Here the unit of data storage is an object, instead of a
table.
➢ For example: What characterizes a car?
➢ Make, model, year, color, drive, stop, maintain…
➢ Attributes (make, model, year, color) are values those we
specify and behaviors (drive, stop, maintain)
➢ Attributes don’t require any calculations and become
variables in an OOP program.
➢ A behavior is doing something, takes input and produces
output – like an algorithm – becomes a method in OOP.
CAD Programming elements
• The other elements are:
➢ Object concepts
➢ Parametric design and objects
➢ Programming levels
List of few selected CAD software
• Autocad by Autodesk
• CATIA by Dassault Systems (DS)
• IDEA by 4M
• Pro/E by Parametric Technology Corporation (PTC)
• Revit Architecture by Autodesk
• Solid edge by Siemens PLM software
• Solid Works by Solid Works Corp.
ME401T

Computer Aided Design


Introduction
ME401T
ME 401T COMPUTER AIDED DESIGN
Teaching Scheme Examination Scheme
Theory Practical
Hrs/W Total
L T P C LE/Vi Marks
eek MS ES IA LW
va
3 0 0 6 3 30 60 10 -- -- 100

• Total number of weeks = 13 (Approximately)


• Total number of lectures = 39 (Approximately)
ME401T
UNIT I 09
CAD FUNDAMENTALS: Introduction, Reasons for implementing a CAD system, Computer aided
process application, benefits, CAD software’s, Elements of programming, CAD programming ,Need
and scope of computer aided design

COMPUETR GRAPHICS: Scan conversion; Bresenham’s Algorithm for line, circle and Ellipse. Standards
for graphics programming, features of GKS, other graphics standards, PHIGS, IGES, PDES. Standards in
CAD.

UNIT II 09
GEOMETRIC TRANSFORMATIONS: Geometric transformations- 2D and 3D translation, scaling,
rotation, shear and reflection, homogeneous transformations

UNIT III 12
PLANE & SPACE CURVES: Types of mathematical representation of curves, parametric representation
of line, circle, ellipse, parabola, hyperbola. Wire frame models, wire frame entities parametric
representation of synthetic curves Hermit cubic splines, Bezier curves, B-splines, constructive solid
geometry

FINITE ELEMENT METHOD : Introduction, FEM procedure, Types of elements, stiffness matrix,
Boundary conditions, shape functions, 1-D structural problem, effect of temperature.
ME401T
UNIT IV 09
Computer Programming: Use of computer programming in design of machine elements, thermal
system and fluid systems, development of computer program using C, Matlab, etc. for machine
components like shaft, spring, coupling, gears, bearing etc., plotting graphs using programming
language, generalized programming, optimization in design.

Approximate Total : 39
Hrs
Texts and References
1. CAD/CAM: Computer Aided design and Manufacturing by Mikell Groover and Zimmer, Pearson
Education .
2. Computer Aided Engineering & Design by Jim Browne, New Age International Publications.
3. Computer Graphics & design by P. Radhakrishnan, C.P. Kothanadaraman, New age publication.
4. CAD / CAM - Chris McMohan, Jimmie Brown Addison – Wesley.
5. CAD/CAM Theory & Practice by Ibrahim Zeid, Tata Mc Graw Hill.
6. Finite Element Analysis by Chandrupatla, EEE Publication.
7. Computer graphics principles and practice by Hearn and Baker
Subject Learning Objectives
• Understand the nature of CAD systems, their
basic structures, their engineering tasks, and
their use to create geometric models of simple
parts.
• Understand the graphics displays, 2D and 3D
transformations.
• Understand the mathematical representation
of plane and space curves.
• Computer programming in Mechanical Design
In other words
What is CAD?

How CAD entities


What is FEM? are created in a
computer?

ME 401T
How can mechanical
component designs How can these
be programmed? entities be
transformed?

How curves can be


represented
parametrically?
ME401T

Computer Aided Design


Algorithms
Line drawing algorithms
• The Cartesian slope-intercept equation for a straight
line is:

• The slop and y intercept can be calculated from:

• Algorithms for displaying straight lines are based on the above line
equation and the calculations.
• For given Δx interval we can calculate corresponding Δy interval as:
y = m  x voltage difference in analog devices
• For given Δx interval we can calculate corresponding Δy interval as:

x = (1/ m)  y voltage difference in analog devices


Line drawing
• Accomplished by calculating intermediate
positions (discrete points) along the line path
between two specified end points.
• Discrete/pixel coordinates are calculated from the
equation of line.
• Screen locations are integer values:
(10.48,20.51) converted to (10,21).
• Result: a line with stair-step appearance.
Line drawing
• Scan lines are
numbered
consecutively from 0,
starting at the bottom
of the screen.
• Pixel columns are
numbered from 0, and
proceeds from left to
right.
• setpixel (x,y): column x
along scan line y
DDA Line drawing algorithm Logic
• The digital differential analyzer (DDA) is a scan-conversion line algorithm
based on calculating either Δy or Δx using the previous equations.
• Consider a line with the positive slope first:
• If |m| ≤ 1 then we sample Δx = 1 and Δy = m
• Else |m| > 1 then we sample Δy = 1 and Δx = 1/m
• Δx = X-increment and Δy = Y-Increment
• So for lines with |m| ≤ 1: Δx = 1 and Δy = m
xk +1 = xk + x = xk + 1 yk +1 = yk + y = yk + m

• k = integer, and starts from 1, y should be rounded off


• For lines with |m| > 1: Δy = 1 and Δx = 1/m

xk +1 = xk + x = xk + (1/ m) yk +1 = yk + y = yk + 1
DDA Line drawing algorithm Logic
• The previous equations should be used if the line is to be drawn from
left end point to right:
• For the reverse case i.e. from right to the left: Decrement should be
given and not the increment:
• If |m| ≤ 1 then we sample Δx = -1 and Δy = -m
xk +1 = xk + x = xk − 1 yk +1 = yk + y = yk − m

• Else |m| > 1 then we sample Δy = -1 and Δx = -1/m


xk +1 = xk + x = xk − (1/ m) yk +1 = yk + y = yk − 1

• For the lines with negative slope same equations can be used, i.e. If m <
0 but |m| ≤ 1 and a line is to be drawn from left end point to the right
one then we set Δx = 1 and Δy = m and increment in x and y can be
determined as:
xk +1 = xk + x = xk + 1 yk +1 = yk + y = yk + m
DDA Line drawing algorithm
1. Input the two line end points: (x0, y0) and (x1, y1)
2. Calculate the x (Horizontal) and y (Vertical) differences as:
dx = x1 - x0 and dy = y1 - y0
3. steps = abs(dx) if abs(dx) > abs(dy)
steps = abs(dy) if abs(dy) > abs(dx)
i. e. (1, 3) & (8,7) then dx = 7 and dy = 4; so m = 4/7 < 1, so Δx = 1 and
Δy = m and find x and y increment accordingly – 7 (steps) times.
4. Start from (x0, y0)
5. X – increment = dx/steps and Y – increment = dy/steps
6. Repeat step 5 of the algorithm steps times or till you reach the end
point coordinates.
DDA Line drawing algorithm Example
Example 1: Draw a line connecting two points (2, 7) and (15, 10) by DDA
algorithm:
Solution:
1. x0 = 2, y0 = 7, x1 = 15, and y1 = 10
2. abs(dx) = 13; and abs(dy) = 3
3. steps = 13
4. Plot (2,7) – 0th step.
5. X - increment = 1, and Y – increment = 3/13 = 0.23
DDA Line drawing algorithm Example cont…
Sr. No. x y Rounded y (x, Rounded y)
0 2 7 7 (2, 7)
1 3 7.23 7 (3, 7)
2 4 7.46 7 (4, 7)
3 5 7.69 8 (5, 8)
4 6 7.92 8 (6, 8)
5 7 8.15 8 (7, 8)
6 8 8.38 8 (8, 8)
7 9 8.61 9 (9, 9)
8 10 8.84 9 (10, 9)
9 11 9.07 9 (11, 9)
10 12 9.3 9 (12, 9)
11 13 9.53 10 (13, 10)
12 14 9.76 10 (14, 10)
13 15 9.99 10 (15, 10)
DDA Line drawing algorithm Example cont…
(x, Rounded y)
(2, 7)
(3, 7)
(4, 7)
(5, 8)
(6, 8)
(7, 8)
(8, 8)
(9, 9)
(10, 9)
(11, 9)
(12, 9)
(13, 10)
(14, 10)
(15, 10)
DDA Line drawing algorithm drawbacks
• Although DDA is fast, the accumulation of round off error in successive
additions of floating point increment can cause the calculated pixel
position to drift away from the true line path for long line segments.

• Floating point operation and rounding off in DDA is time consuming

• A better approach – Bresenham’s line drawing algorithm


Bresenham’s line algorithm
• More Efficient algorithm
• Uses only incremental integer calculations
• (11,11) or (11,12)? (51,50) or (51,49)?
Bresenham’s line algorithm
• A line with positive slope less than 1:
➢ Unit x intervals
➢ Starting from left point (X0,Y0), step to each
successive column and plot the pixel whose scan
line y value is closest to the line path.
Bresenham’s line algorithm

➢(Xk,Yk) is displayed; but what next?


➢ 2 choices: (Xk+1,Yk) or (Xk+1,Yk+1)??
Bresenham’s line algorithm

y = m( xk + 1) + b
d1 = y − yk d 2 = ( yk + 1) − y
 d1 = m( xk + 1) + b − yk  d 2 = yk + 1 − m( xk + 1) − b
d1 − d 2 = ?
Bresenham’s line algorithm

d1 − d 2 = 2m( xk + 1) − 2 yk + 2b − 1 c = 2y + x(2b − 1)


y
m= A decision A decision parameter at step (k+1)
x
parameter for

pk = x(d1 − d 2 )
the kth step pk +1 = 2y xk +1 − 2x yk +1 + c

pk = 2y xk − 2x yk + c
Bresenham’s line algorithm
pk +1 − pk = 2y ( xk +1 − xk ) − 2x ( yk +1 − yk )
xk +1 = xk + 1
pk +1 = pk + 2y − 2x ( yk +1 − yk )
The first parameter P0 is evaluated as:
P0 satisfies the line equation as:
y0 = m x0 + b
y
y0 = x0 + b
x
pk = 2y xk − 2x yk + 2y + x(2b − 1)
p0 = 2y xo − 2x y0 + 2y + x(2b − 1)
y
p0 = 2y xo − 2x( x0 + b) + 2y + x(2b − 1)
x
p0 = 2y − x
Bresenham’s line algorithm
• For a line with positive slope greater than 1,
interchange the roles of x and y directions.
• That is step along the y direction in unit steps and
calculate successive x.
• For negative slope the procedure is same.
Steps for Bresenhms Line Drawing
Algorithm
1. Input the two end points and store the left end
Point in (x0,y0)
2. Load (x0,y0) into the frame buffer (plot the first
point)

3. Calculate the constants Δx, Δy, 2Δy and 2Δy-2Δx and


obtain the starting value for the decision parameter as
p0 = 2Δy- Δx
Steps for Bresenhms Line Drawing
Algorithm
4. At each xk along the line, starting at k=0, perform the
following test:
If pk < 0 , the next point is (xk+1, yk) and
pk+1 = pk + 2Δy

Otherwise
Point to plot is (xk+1, yk+1)
pk+1 = pk + 2Δy - 2Δx

5. Repeat step 4 (above step) Δx times


Steps for Bresenhms Line Drawing
Algorithm
Example: (20,10) and (30,18)
(Xk+1, yk+1)
(21, 11)
(22, 12)
(23, 12)
(24, 13)
(25, 14)
(26, 15)
(27, 16)
(28, 16)
(29, 17)
(30, 18)
ME401T

Plane Curves and Space Curves


Geometric Modeling
• What is Geo-Modeling?
• Geometric modeling is a branch of applied Geometric Computer
mathematics and computational modeling graphics
geometry that studies methods CAD
and algorithms for the mathematical
description of shapes
Design
• The model should be unique and complete to
all engineering functions, from
documentation to engineering analysis to
manufacturing.

• Analogy:
Governing equilibrium equations : Mechanics and
thermal fluids :: Geometric modeling : CAD/CAM
The Role of Geometric Modeling in
a CAD system
Why study mathematical basis of geo-
modeling?
• Provides a good understanding of terminology
encountered in the CAD/CAM field.
• Enables users to decide which type of entity to use
in a particular model to meet geometric
requirements such as slopes and/or curvatures.
• Users become able to interpret any unexpected
results they may encounter from using a particular
CAD/CAM system.
• Better evaluation criteria
Goal of geo-modeling?
• To create solid or surface models
• Construction of these models begins with points,
lines, and curves
• Complex models, such as bottles and hair dryers,
require surfaces.
• We extend curves to create surfaces
• We then use surfaces to create solids
Curves

Analytic Synthetic
Points, lines, arcs, circles, Various types of spline
conics (ellipses, (Cubic spline, B –
parabolas, hyperbolas), spline), Bezier curve
fillets and chamfers Interpolated (limited
flexibility in shape
Can be represented by creation – from data
simple mathematical points) and
equations approximated (the
most flexibility) curves
Curve representation
A curve descried by coordinate data: impractical
• Large storage
• Computationally intensive
• Exact shape of the curve remains unknown
• No exact calculations can be done – intersection of
curves, physical properties of an object like volume
A curve descried by analytic equation
• Effect of data points on curve behavior, control,
continuity and curvature
Curve Representation
Classification of mathematical representation of
curve:
• Parametric and non-parametric
Explicit Y = a+ bx+ cx2+ dx3
• Nonparametric
Implicit (x-h)2+(y-k)2 = r2
• Explicit: a unique value of dependent variable for
each value of independent variable.
• Implicit: No distinction is made between
dependent and independent variables.
Limitations of non-parametric form
Limitations of non-parametric form:

• If 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.

• 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
Limitations of non-parametric form
Limitations of non-parametric form…:

• If the curve is to be displayed as a series of points or


straight-line segments, the computations involved
could be extensive.

• Parametric representation of curves overcomes all of


these difficulties
Parametric form
Parametric form: Describes the independent and
dependent variables in terms of a parameter.

• Replaces slopes with tangent vectors

• In the case of commonly used curves such as conics


and cubics, these equations are polynomials rather
than equations involving roots.

• Well suited for computations and display.


Parametric form
In parametric form, each point on a curve is expressed
as a function of a parameter u
The parametric equation for a 3D curve in space takes
the following vector form:
Parametric form
To check whether a given
point lies on the curve or
not reduces to finding the
corresponding u value and
checking whether that
value lies in the stated u
range
Geometrical
transformations can be
performed directly on
parametric equations
Parametric form
To evaluate the slope of a
parametric curve at an arbitrary
point on it - the tangent vector
P′(u).
Analytic curves (Lines)
• Parametric equations
will be used
• Case 1: A line
connecting two end
points:
• P1 and P2 as the end
points
• Define a parameter u
such that it has the
values 0 and 1 at P1
and P2 respectively
Analytic curves (Lines)
Utilizing the triangle
OPP1

P-P1 is proportional to
P2-P1 such that
Analytic curves (Lines)
Thus the equation
becomes

In scalar form
Analytic curves (Lines)
Analytic curves (Lines)
Tangent vector of the The independence of the
line is given by: tangent vector from u
reflects the constant slope
In scalar form: of the straight line
Analytic curves (Lines)
The unit vector in the
direction of the line is
given by

where L is the length of


the line
Analytic curves (Lines)
Case 2: A line passing
through a point P1 in a
direction defined by
unit vector n.
• Generating the end
points from user
input or given data
• consider a general
point P on the line at a
distance L from P1.
Analytic curves (Lines)
Case 2:

L is the parameter in
equation
Once the user inputs , P1 ,
Thus the tangent and L, the other end point
vector is n. P2 is calculated using the
equation
Which method do you know to solve this problem?

What are the conditions to have two lines


perpendicular or parallel in vector algebra?

Perpendicular – Dot product of their tangent vectors


should be zero.

Parallel – Cross product of their tangent vectors


should be a null vector
L1 : P = P1 + u ( P2 − P1 )
L2 : P = P3 + u ( P3 − P1 )

L3 : P = P4 + u ( P4 − P3 )

L1 ⊥ L2 : ( P2 − P1 ) • ( P3 − P1 ) = 0
L1 L3 : ( P2 − P1 )  ( P4 − P3 ) = 0
P = P1 + u ( P2 − P1 )

x2 − x1 = 2
y2 − y1 = 2
z2 − z1 = 0
A = P2 − P1 A = P2 − P1
B = P4 − P3 B = P3 − P4

( P2 − P1 ) • ( P4 − P3 ) ( P2 − P1 ) • ( P3 − P4 )
cos  = cos  =
P2 − P1 P4 − P3 P2 − P1 P3 − P4
L1 : P = P1 + u ( P2 − P1 ) L1 : P = ( P2 − P1 )
/

P3 = P1 + 0.5( P2 − P1 )
L2 : P = ( P4 − P3 )
/

L2 : P = P3 + u ( P4 − P3 )
Yes they are constant.
L1 : P = P1 + 0.25( P2 − P1 )
Because tangent vectors of lines are
L2 : P = P3 + 0.25( P4 − P3 )
their slopes, and lines have constant
slopes.
Analytic curves (Circles)
• Circles and circular arcs
are among the most
common entities used in
geometric modeling.

• Circles, and circular arcs


together with straight
lines, are sufficient to
construct many existing
mechanical parts and
components in practice
Analytic curves (Circles)

• Equations are used to


generate points on the
circle’s circumference, for
display purposes, by
incrementing u from 0 to
360.
• But an inefficient way due
to the need to compute
the trigonometric functions
in the equation for each
point
Analytic curves (Circles)
• A less
computational
method is to write
Eq. in an
incremental form

xn +1 = xc + R cos(u + u )
yn +1 = yc + R sin(u + u )
zn +1 = zn
Analytic curves (Circles)
xn +1 = xc + R cos(u + u )
yn +1 = yc + R sin(u + u )
zn +1 = zn

For Arcs:
x = 2 + 2 cos u
y = 2 + 2sin u 0  u  2
z=0 P(u ) = P1 + u ( P2 − P1 )
P / (u ) = ( P2 − P1 )
P1 : u = 
2
P1 =  4 
 0 
Analytic curves (Ellipses)
• Mathematically the ellipse is a curve generated by a
point moving in space such that at any position the
sum of its distances from two fixed points (foci) is
constant and equal to the major diameter

• Development of equations of ellipses, elliptical arcs


and fillets are same as circles, circular arcs and filets
xn = xc + A cos u
yn = yc + B sin u
z n = zc
xn +1 = xc + A cos(u + u )
yn +1 = yc + B sin(u + u )
zn +1 = zc = zn
() − 

B sin u cos 

A cos u sin 

A cos u cos 

Inclined Ellipse
A = Pc − PH = ( xc − xH ) + ( yc − yH ) + ( zc − zH )
2 2 2
Analytic curves (Parabolas)
• The parabola is
defined
mathematically as
a curve generated
by a point which
moves such that
its distance from a
fixed point (the
focus) is always
equal to its
distance to a fixed
line (the directrix).
Analytic curves (Parabolas)
• It is not a closed
curve

• If the range of y
is limited
Analytic curves (Parabolas)
xn = xv + Au 2
yn = yv + 2 Au
z n = zv

xn +1 = xv + A(u + u ) 2

yn +1 = yv + 2 A(u + u )
zn +1 = zv
Analytic curves (Parabolas)

• Go through the examples of Parabolas from


Ibrahim Zeid
Analytic curves (Hyperbolas)
• A hyperbola is
described
mathematically as a
curve generated by a
point moving such,
that at any position
the difference of its
distances from the
fixed points (foci) F
and F' is a constant
and equal to the
transverse axis of
the hyperbola.
Analytic curves (Hyperbolas)

Non-parametric
implicit form:
Synthetic curves
• Analytic curves are usually not sufficient to meet the
geometric design requirements of mechanical parts.

• 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

• The need for synthetic curves in design arises when


a curve is represented by a collection of measured
data points
Synthetic curves
• Mathematically, synthetic curves represent the
problem of constructing a smooth curve that passes
through given data points.

• Therefore the form of these curves is polynomial.


Continuities
• Cn - nth derivative are same at the intersection
Hermite Cubic Spline
• The derivation of the equations was done on the
black board, kindly refer the book by I. Zeid for the
detailed theory.
6.16: Find the normal vector to a cubic spline curve at
any of its points.
Bezier curve
• Curve may interpolate or extrapolate the data points

• Generalizations of Bezier curves to higher


dimensions are called Bezier surfaces

• Bezier curves and surfaces are credited to P. Bezier


of the French car firm Regie Renault, who developed
(about 1962) and used them in his software system
called UNISURF.
Characteristics of the Bezier curve
1. Shape is controlled by its defining points.
Tangent vectors are not used to develop the curve
like in the case of Cubic Spline.
So much better feel for the relationship between
point and the curve.

2. Order or degree is variable and depend on the


number of points defining it.
n+1 points define an nth degree curve – higher
order continuity.
Bezier curve
• Defined by a set of data points
Characteristics of the Bezier curve
• Data points are called control points; they form
control or characteristic polygon.

• Only the first and the last point control points or


vertices of the polygon lie on the curve.
• Other vertices define the order, derivatives and shape
Characteristics of the Bezier curve
• Curve is always tangent to two vertices.
• Curve shape tends to follow the polygon shape.

• n+1 control points – by the following polynomial of


degree n:
Characteristics of the Bezier curve
• P(u) is a point on the curve; Pi is a control point;
Bi,n is the Bernstein polynomials; C(n, i) is the
binomial coefficient.
Characteristics of the Bezier curve
Characteristics of the Bezier curve
• For u = 0 and u = 1; curve interpolates first and
last points of the curve.

• Curve is tangent to the first and last points


• rth derivative of Bezier function
Characteristics of the Bezier curve
• rth derivative of Bezier function

n ! n−r  r
r −i  r  
P (u ) =
r

( n − r ) ! j =0
B j ,n − r (u )   ( −1)   Pi + j 
 i =0 i 
Characteristics of the Bezier curve

First segment of the curve polygon

Last segment of the curve polygon


Convex Hull Property of the Bezier
curve
• Most desirable feature of this curve.
• This property relates the curve to its characteristic
polygon.
• In mathematics, the convex hull or convex envelope of a
set X of points in the Euclidean plane or Euclidean space is
the smallest convex set that contains X.
• In Euclidean space, an object is convex if for every pair of
points within the object, every point on the straight
line segment that joins them is also within the object
Convex Hull Property of the Bezier
curve
• In a plane, the convex hull is a closed polygon, and in
3D it is a polyhedron
B Spline curves
• B-spline curves are the proper and powerful
generalization of Bezier curves
• B-spline curve defined by n + 1 control points Pi is
given by

• Parameter k controls the degree (k − 1) of the


resulting B-spline curve and is usually independent of
the number of control points
Open B Spline curves

• Choose 0/0 = 0 if the denominators in Equation


become zero
Open B Spline curves
• The knot vectors ui are given by:
• Identify k and n; Four control points so n+1 = 4; so n = 3
= degree of the curve. For B-Spline degree = k-1; so k = 4.

• How many knot vectors? i+k; but maximum value of i is


n; so total n+k = 7; starting value of i is 0 and ending is 7;
so total eight knot vectors – to find the eq.
N 0,4 − N 0,3 ; N1,3

N 0,2 N1,2 N 2,2


N 0,1 N1,1 N 2,1 N 3,1

N 0,4 N1,4 N 2,4 N 3,4


N 0,4 − N 0,3 ; N1,3

N 0,2 N1,2 N 2,2


N 0,1 N1,1 N 2,1 N 3,1

N1,4 − N1,3 ; N 2,3 N 2,4 − N 2,3 ; N3,3 N 3,4 − N 3,3 ; N 4,3

N 2,2 N 3,2 N 3,2 N 4,2 N 4,2 N 5,2

N 3,1 N 4,1 N 4,1 N 5,1 N 5,1 N 6,1


• This equation is the same as the one for the Bezier
curve in Example 6.18.
• Thus the cubic B-spline curve defined by four control
points is identical to the cubic Bezier curve defined by
the same points.
• This fact can be generalized for (k − 1) degree curve
as mentioned earlier.
Close B-Spline curves are not in the syllabus
CAD Mid Semester Syllabus
UNIT I
CAD FUNDAMENTALS: Introduction, Reasons for
implementing a CAD system, Computer aided process
application, benefits, CAD software’s, Elements of
programming, CAD programming ,Need and scope of
computer aided design
COMPUETR GRAPHICS: Scan conversion; Bresenham’s
Algorithm for line, circle and Ellipse. Standards for
graphics programming, features of GKS, other graphics
standards, PHIGS, IGES, PDES. Standards in CAD.
UNIT II
GEOMETRIC TRANSFORMATIONS: Geometric
transformations- 2D and 3D translation, scaling, rotation,
shear and reflection, homogeneous transformations

Das könnte Ihnen auch gefallen