Você está na página 1de 256

CAD/CAM/CIM

UNIT: 1COMPUTER AIDED DESIGN


Computer Aided Design (CAD) design process (Shigley model) role of computer in design process benefits of CAD, graphic
primitives (point, line, circle drawing algorithms DDA, Midpoint and Bresenhams), 2-D transformation (Translation, scaling,
rotation), windowing - view ports clipping transformation, 3D transformation, hidden - line - surface - solid removal algorithms
(Priority, z-buffer, ray-tracing), shading (shading surfaces), coloring, wire frame modeling wire frame entities- parametric
representation of Bezier, cubic spline and B-spline curves, Surface modeling surface entities, Solid modeling solid entities solid
representation Constructive Solid Geometry (CSG) - sweep representation - Boundary Representation (B-Rep).
UNIT: 2 COMPUTER AIDED PLANNING AND CONTROL
Group technology -part families-parts classification and coding (OPTIZ and MICLASS), Computer Automated Process
Planning (CAPP) retrieval and generative process planning systems benefits of CAPP, computer integrated production management
system - master production schedule capacity planning - cost planning and control, shop floor control, factory data collection system,
inventory management - Material Requirement Planning (MRP) - Manufacturing Resource Planning (MRPII) Enterprise Resource
Planning (ERP)
UNIT: 3 COMPUTER AIDED QUALITY CONTROL
Computer process interfacing - monitoring, types of production monitoring systems-structure model of manufacturing process-process
control & strategies direct digital control-supervisory computer control, Computer Aided Quality Control (CAQC) - contact inspection
methods Coordinate Measuring Machine (CMM) - optical inspection methods - non contact inspection methods, machine vision
image processing and analysis, computer aided testing, integration of CAQC with CAD/CAM.
UNIT: 4 COMPUTER INTEGRATED MANUFACTURING
Computer Integrated Manufacturing (CIM) hardware and software, data base requirements of CIM, data base models, DBMS
architecture, integration requirements of CAD/CAM, types of manufacturing systems, machine tools, materials handling system Automated Storage and Retrieval System (AS& RS) - Automated Guided Vehicles (AGV), computer control system, DNC systems
manufacturing cell, Flexible Manufacturing Systems (FMS), human labour in the manufacturing system, CIM Benefits, Lean
manufacturing, artificial Intelligence and expert system in CIM.
Text Book:
M. Groover and E. Zimmers, "CAD/CAM: Computer Aided Design and Manufacturing", Prentice Hall of India, New Delhi, 2003.
Reference Books:
Ibrahim Zeid, R. Sivasubramanian CAD - CAM Theory and Practice", Tata McGraw Hill Publishing Co. Ltd., New Delhi, 2009
P.Radhakrishnan, S.Subramanyan and V.Raju "CAD/CAM/CIM", New Age International Ltd., 2007.
Yoram Koren, Computer Control of Manufacturing Systems", McGraw-Hill Book
Company, 2005.
David Bedworth, "Computer Integrated Design and Manufacturing", Tata McGraw Hill Publishing Co. Ltd., New Delhi, 1998.

What is CAD/CAM?
CAD/CAM
(computer-aided
design
and
computer-aided
manufacturing) refers to computer software that is used to both design
and manufacture products.
CAD is the use of computer technology for design and design
documentation.
CAD/CAM applications are used to both design a product and program
manufacturing processes, specifically, CNC machining.

CAM software uses the models and assemblies created in CAD


software to generate tool paths that drive the machines that turn the
designs into physical parts.
CAD/CAM software is most often used for machining of prototypes
and finished parts.
2

Computer Aided Design (CAD)

CAD is the integration of computer science techniques for engineering


design.
CAD is also defined as the use of computer systems to assist in the
Creation
Modification
Analysis or optimization of a design.
The computer system consist of the hardware and software to
perform the design functions.
The CAD hardware includes
Workstations (Graphic display terminal, CPU)
Mouse, Keyboards, plot pen, printers, plotters etc.,

The CAD software consists of


Computer programs to facilitate the engineering functions
Examples Stress strain analysis of components
Heat transfer calculations
Numerical control part programming

2D/3D drafting.
3D modelling
An aid to visualization.
Represents curves and surfaces
and solids.

Three aspects of CAD


1. Modelling
2. Display/Visualization
3. Application
1. Stress analysis (FEA)
2. CAD/CAM integration

Interactive Computer Graphics (ICG)


Modern CAD systems are based on ICG.
ICG denotes a user oriented system in which the computer is
employed to create, transform and display data in the form
of pictures or symbols.
The user in the design system is the designer who
communicates data and commands to the computer through
any of several input devices.
The computer communicates with the user via a cathode ray
tube.

Reason for implementing CAD


To increase the productivity of the designer
Reduces the time required to synthesize, analyze and
document the design.

To improve the quality of design


Thorough engineering analysis within a short time.
Design errors are also reduced.
To improve communications through documentation:
Better Engineering drawings
More standardization in the drawings
Better documentation of the design
Fewer drawing errors.
To create a database for manufacturing:
Geometry and dimension of components
Bill of materials
Used in CNC programming, programming of robots.

Design Process
Design is an original solution to a
problem.
Design process is the pattern of
activities that is followed by the
designer in arriving at the solution of
a technological problem.
Models of the design process
Shigley
Pahl
Beitz
Ohsuga
Earle

Shigley- Design Process


Shigley model involves six basic steps:

Cont..
1. Recognition of need:
It involves the realization by someone that a problem exists for which
some feasible solution is to be found.
Historical Information
Collected from the literature,
marketing surveys.
This should be able to answer
questions like
The current technology
Existing solutions
Requirement Specification
Clear definition of the requirements is specified.
This helps in understanding the product from the current practices and
manufacturing resources of the plant.
Market forces
Consider the various market forces that will affect the product in one
way or the other.
9

General solutions
Specify general solution, which will be broad and would not
contain too many details.
This can be done by resorting to past designs, engineering
standards, technical reports, handbooks, patterns.
This helps in its further evaluation and refinement at a later
stage.
2. Definition of problem
It involves a thorough specification of the item to be
designed.
The specification include functional and physical
characteristics, cost, quality, performance, etc.
3. Synthesis
During this phase various preliminary ideas are developed
through research of similar products or designs in use.

10

4. Analysis and optimization:


The preliminary designs are subjected to the appropriate analysis
to determine their suitability for the specified design constraints.

If these designs fail to satisfy the constraints, they are then


redesigned or modified on the basis of the feedback from the
analysis.

5. Evaluation:
The evaluation of the design against the specifications
established during the problem definition phase.
This often requires the fabrication and testing of a prototype
model to evaluate operating performance quality, reliability, etc.

6. Presentation:
It is the final phase, which includes documentation of the design
through drawings, material specifications, assembly lists and so
on.
11

Why Computers in Design?


Engineering design has traditionally been accomplished on
drawing boards.
The process is iterative and time consuming.
The design tasks are performed by a CAD system rather
than a single designer working over a drawing board.

12

Application of Computers to the Design Process

13

Various Design Tasks by CAD


1.
2.
3.
4.

Geometric Modeling
Engineering Analysis
Design Review and Evaluation
Automated Drafting

1. Geometric modeling
It deals with the mathematical description of the geometry of
an object.

Using the description the image


manipulated on a graphics terminal.

is

displayed

and

Softwares are used for provide the geometric modeling.

14

Three types of commands in Geometric modeling


Basic Geometric elements generates from:
Points, Lines, Circles.
Scaling, Rotation, transformations.
Assembly to join various elements.
Different methods of Representing the object in Geometric
modeling

Wire Frame Modeling


Displayed by interconnected lines.
Solid Modeling
15

Three types wire frame modeling


2D representation
21/2D
3D

flat object
no side wall details
more complex geometry.

Hidden line removal

16

Wire frame modeling


3D wire frame inadequate for
complicated shapes.
The CAD system have automatic
hidden line removal feature.

Solid Modeling
Advance method of geometric modeling
in three dimensions.
It can be seen from various directions
and in various views.
CAD systems provide colour graphics
capability.
Colour images
dimensioning.

useful

in

assembly,
17

2. ENGINEERING ANALYSIS
Stress-strain calculations
Heat transfer computations
Commercial general purpose programs can be used to perform the
analysis.
Analysis of mass properties

Surface area

Weight

Volume

Centre of gravity and moment of inertia


Finite Element Analysis
Object is divided into a large number of finite elements.
Usually Rectangular or Triangular shapes
Determining the interrelating behaviors of all the nodes in the system,
the behaviour of the entire object can be assessed.
Stress strain analysis, heat transfer.
18

Finite Element Analysis of a Component

19

3. DESIGN REVIEW AND EVALUATION

The designer can check the accuracy of the design to reduce the
dimensioning errors.

The designer can zoom in on part design details for close scrutiny.

Checking the assembly of the components.

Kinematics-Animate the motion of components and linkages.


20

4. AUTOMATED DRAFTING
Creation of hardcopy engineering drawings directly from CAD data
base.

It increases productivity five times over manual drafting.

Automatic dimensioning, crosshatched areas, scaling of the drawing

Sectional views and enlarged views of particular part details.

Rotating the part to view the image

Oblique

Isometric

Perspective

21

Engineering Drawing with four views


22

CREATING THE MANUFACTURING DATA BASE


CAD system develops the data base needed to manufacture the
product.
In conventional manufacturing
Engineering drawing prepared by design draftsmen and used by
manufacturing engineer to develop the process plan.
In integrated CAD/CAM system
Direct link established
manufacturing.

between

product

design

and

Manufacturing data base is an integrated CAD/CAM data base.


It includes all the data on the product generated during design
Geometry data, Bill of materials, Part lists, Material
specifications and additional data required for manufacturing.
23

CAD/ CAM data base


24

Benefits of computer aided design


1.

Productivity improvement in design

Complexity of the engineering drawing

Level of detail required in the drawing

Degree of repetitiveness in the designed parts

Degree of symmetry in the parts

2.

Shorter lead time


Speeds up the task of preparing reports and lists (assembly lists)
Preparation of component drawings takes short time

3. Design Analysis
Conventional:
Designers drawing board to design analysts queue
CAD system:
Same person can perform analysis.

25

4. Fewer design errors


Capability for avoiding design, drafting and documentation
errors.
Bill of materials are eliminated.

5. Greater accuracy in design calculations


Dimensional control.
Change in a single part, effecting the change on all drawings.
6.

Standardization of design, drafting and documentation procedure


The single data base and operating system is common to all
workstation in the CAD system.
System provides a natural standard for design.

7.

Drawings are more understandable


Creating and maintaining isometrics and oblique drawings .

26

Improvement in visualization of images

8.

Improved Procedures for engineering changes


Control and implementation of engineering changes is
significantly improved with CAD.
Data base can be checked against new information.
Easy to compare with the current design.
27

Benefits in Manufacturing

Tool and fixture design for manufacturing

Numerical control part programming

Computer aided process planning

Assembly lists for production

Computer aided inspection

Robotics planning

Group Technology

Shorter manufacturing lead times through better scheduling


28

The Graphic Output Primitives


Graphics programming packages provide functions to describe a scene
in terms of the basic geometric structures, as referred to as output
primitives.
Complex structures formed by group set of output primitives.
Points and straight line segments are the simplest geometric
components of picture.

A drawing is created by an assembly of


Point
Line
Arc
Circle
Ellipse
Spline
Polygon
29

Pixels
In computer graphics, pictures or graphics objects are presented as a
collection of discrete picture elements (rows and columns) called pixels.

The pixel is the intersection area of the rows and columns (smallest
addressable screen element), which we can control.
The control is achieved by setting the intensity and colour of the pixel
which compose the screen.
For example, to display point P1
whose coordinates are (4.2, 3.8)
and point P2 whose coordinates
are (4.8, 3.1) then P1 and P2 are
represented by only one pixel
(4,3) .
In general, a point is represented
by the integer part of X and
integer part of Y, i.e., (int (X), int
(Y)).

Pixel display area of 6 x 530

Rasterization and Scan conversion


The special procedures determine which pixel will provide the best
approximation to the desired picture or graphics object.
The process of determining the appropriate pixels for representing
picture or graphics object is known as rasterization.
The process of representing continuous picture or graphics object as
a collection of discrete pixels is called scan conversion.
Converting a line vector into its
equivalent pixel positions involves a large
amount of computation.
Each drawing consists of a large amount of
vectors to be displayed.
Hence, there is a need to have a simplified
method by which these could be done at a
faster rate with little computing overhead.
31

Line Drawing
Line drawing is accomplished by calculating intermediate positions
along the line of path between two specified endpoint positions.
An output device is then directed to fill in these positions between the
endpoints.
For a raster display, the line colour (intensity) is then loaded into the
frame buffer at the corresponding pixel coordinates.

A computed line position of (10.48, 20.51) would be converted to pixel


position (10, 21).
This rounding of coordinate values to integers causes lines to be
displayed with a stairstep appearance.

32

Line Drawing Algorithm- Analog Devices


The Cartesian slope intercept equation for a straight line is
Y = m. x + b
m representing the slope of the line, b as the y intercept.

y2 y1 y

x2 x1 x

b y1 m.x1

For any given x interval x along a line, the


corresponding y interval y can be computed from the
equation

y mx

Similarly for x
If
If

If

y
m

m 1 Vertical deflection is calculated from y mx


m 1 Horizontal deflection is calculated from x y
m
m 1 x y Smooth line is generated between the endpoints.
33

Line Drawing Algorithm- Raster System


On raster systems, lines are plotted
with pixels and step sizes in the
horizontal and vertical directions are
constrained by pixel separations.
We must sample a line at discrete
positions and determine the nearest
pixel to the line at each sampled
positions.

Scan conversion line algorithms


1. Digital Differential Analyzer (DDA) algorithm
2. Bresenhams algorithm
34

Digital Differential Analyser (DDA) Algorithm/ Vector Algorithm


DDA is one of the incremental scan conversion methods.
This approach is characterized by calculating each step using the
results obtained in the previous step.
In DDA algorithm, either x or y, which ever is larger is chosen as
one raster unit.

35

Digital Differential Analyser (DDA) Algorithm/ Vector


Algorithm
DDA is a scan conversion line algorithm based
on calculating either x or y.
Case 1: Line with positive slope
If m 1 sample at unit x intervals (x = 1)

yk 1 yk m

Where k is integer starting from 1, for the


first point and increases by 1 until the final
endpoint is reached.
m can be any real number between 0 and 1
The calculated y values must be rounded to the nearest integer.
If

m 1 sample at unit y intervals (y = 1)

1
xk 1 xk
m
36

Case 2: Line with negative slope


If

If

m 1
m 1

x = -1

yk 1 yk m

y = -1

1
xk 1 xk
m

The DDA algorithm is a faster method for calculating pixel


positions than the direct use of line equation.

Appropriate increments are applied in x and y direction to step to


pixel positions along the line path.

37

To draw a straight line from connecting two points (2, 7) and (15,10)
X1 = 2, X2 = 15 x=X2 - X1 = 13
Y1 = 7, Y2 = 10 y= (Y2 - Y1) = 3
m= y/x = 3/13 =0.23

m 1 sample at unit x intervals (x = 1)

yk 1 yk m
The initials values of X and Y are
X = 2.5 Y = 7.5

Pixel values

Plotting a line

38

x1=0
y1=0

x = x2-x1= 6-0 = 6
y = y2-y1 = 7-0 = 7

x2=6
y2=7

m=y/ x=7/6=1.16, m>1


Therefore , y=1

xk 1 xk 1/ m 0 1/1.16 0.862
x

0.5

0.5

1.362

1.5

2.224

2.5

3.086

3.5

3.948

4.5

4.81

5.5

5.672

6.5

6.534

7.5

39

x1=0
y1=0

x = x2-x1= -5-0 = -5
y = y2-y1 = 5-0 = 5

x2=-5
y2=7

m= y/ x = 5/-5 = -1, m<1


Therefore , x = -1

yk 1 yk m
x

-0.5

0.5

-1.5

1.5

-2.5

2.5

-3.5

3.5

-4.5

4.5

-5.5

5.5

40

Drawbacks of DDA Algorithm


Although DDA is fast, the accumulation of round off error in
successive additions of floating point increment, however can cause
the calculated pixel positions to drift away from the line path for
long line segments.
Floating point operations and rounding off in DDA is time
consuming.
These drawbacks have been overcome in Bresenhams line drawing
algorithm.

41

Bresenhams Line Algorithm


An accurate and efficient raster line
generating algorithm.
Scan converts lines using only incremental
integer calculations.

We need to decide which of two possible


pixel positions is closer to the line path at
each sample step.
Determine the next sample position whether
to plot the pixel at position (11,11) or the one
at (11,12).
This is decided by calculating the difference
between the separations of the two pixel
positions from the actual line path.
42

For Positive slope


m 1
Pixel positions along a line path are then
determined by sampling at unit x intervals.

Starting from the left end point (x0 , y0) of a


given line and step to each successive x position
and plot the pixel whose scan line y value is
closest to the line path.
Assuming that the pixel at (xk, yk) is determined,
we need to decide which pixel to plot in column
xk+1.
Our choices are the pixels at positions (xk+1, yk)
and (xk+1, yk+1).
At sampling position xk+1, we label vertical
separations from the line path as d1 and d2.
The y coordinate on the line at pixel column position xk+1 is calculated as

y m xk 1 b
43

y m xk 1 b

d1 y yk

m xk 1 b yk

d2 yk 1 y
yk 1 m xk 1 b
The difference between these two separations is

d1 d2 2m xk 1 2 yk 2b 1
A decision parameter pk for the kth step in the line algorithm can be obtained
by rearranging the above equation and substituting m= y/ x.

pk x d1 d2

Pk 2y xk 2x yk 2y x(2b 1)

44

Pk 2y xk 2x yk 2y x(2b 1)
pk 2y xk 2x yk c
Where C is

C 2y x(2b 1)

Parameter c is constant and has the value 2y x 2b 1


which is
independent of pixel position and will be eliminated from the calculations for
pk.
If the pixel at yk is closer to the line path than the pixel at yk+1 (that is,
d1<d2), then decision parameter pk is negative.

In that case, we plot the lower pixel; otherwise we plot the upper pixel.
At step k+1, the decision parameter is evaluated from

pk 1 2y xk 1 2x yk 1 c
pk 1 pk 2y 2x yk 1 yk

45

pk 2y xk 2x yk c

pk 1 2y xk 1 2x yk 1 c
pk 1 pk 2y( xk 1 xk ) 2x( yk 1 yk )
But, xk+1 is the same as xk+1 so:
pk 1 pk 2y 2x( yk 1 yk )
If pk value negative(lower pixel),

yk 1 yk

pk 1 pk 2y 2x( yk yk )

pk 1 pk 2y

yk 1 yk 1
pk 1 pk 2y 2x( yk 1 yk )

If pk value positive(upper pixel),

pk 1 pk 2y 2x
If |m|>1 then interchange x and y in the above equations.

46

If

m 1

Input the two line endpoints and store the left endpoint in (x0,y0) .
Load (x0,y0) into the frame buffer; that is plot the first point.
Calculate constants x, y, 2y and 2y- 2x and obtain the starting value
for the decision parameter as

p0 2y x
At each xk along the line, starting at k=0, perform the following test:
If pk<0, the next point to plot is (xk+1,yk) and

pk 1 pk 2y
Otherwise, the next point to plot is (xk+1,yk+1) and

pk 1 pk 2y 2x
Repeat the above step for x times.
47

The end points of a line are (20,10) and (30,18). The line has a slope of 0.8 with
x = 10, y = 8.

The initial decision parameter has the value


p0 = 2y - x
= 16 10 = 6
Pk >1 , therefore the next pixel position is
calculated from

pk 1 pk 2y 2x

48

Circle Generating Algorithms


A circle is defined as the set of points that are all at a
given distance r from the center position (xc,yc).
It is expressed in Pythagorean theorem in Cartesian
coordinates as

x xc y yc r 2
2

This equation is used to calculate the position of


points on a circle circumference by stepping along
the x axis in unit steps from xc- r to xc+r and
calculating the corresponding y values at each
position as

y yc r xc x
2

This is not the best method for generating a circle.


It involves considerable computation at each step.

The spacing between plotted pixel position is not


uniform.
49

Cont

Another way to eliminate the unequal spacing is to calculate points


along the circular boundary using polar coordinates r and .
Expressing circle equation in parametric polar form yields the pair
of equations

x xc r cos
y yc r sin

Display is generated with these equations using a fixed angular step


size, a circle is plotted with equally spaced points along the
circumference.
The step size chosen for depends on the application and the display
device.
Larger angular separations along the circumference can be
connected with straight line segments to approximate the circular
path.
50

Computation can be reduced by considering the symmetry of circles.


The shape of the circle is similar in each quadrant.

We can generate the circle section in second quadrant of the xy plane


by noting that the two circle sections are symmetric with respect to the y
axis.
Circle sections in the third and fourth quadrants can be obtained from
sections in the first and second quadrants by considering symmetry
about the x axis.

There is also symmetry between octants. Circle sections in adjutant


octants within one quadrant are symmetric with respect to the 45 line
dividing the two octants.
The Cartesian equation contain multiplications and square root
calculations, while the parametric equations contain multiplications
and trigonometric calculations.

51

Bresenhams Circle Algorithm


More efficient circle algorithms are based on incremental calculation of
decision parameters, as in the Bresenham line algorithm, which involves
only simple integer operations.
Bresenhams line algorithm for raster display is adapted to circle
generation by setting up decision parameters for finding the closest pixel to
the circumference at each sampling step.
Bresenhams circle algorithm avoids the
square-root calculations by comparing the
pixel separation distances.
A method for direct distance comparison is
to test the halfway position between two
pixels to determine if this midpoint is
inside or outside the circle boundary.

52

Mid Point Circle Algorithm


As in the raster line algorithm, sample at unit intervals and determine the
closest pixel position to the specified circle path at each step.
Radius r and screen center position (xc,yc).

The each calculated position (x, y) is moved to its proper screen position by
adding xc to x and yc to y.
For m 1 , take unit step in the positive x direction over the octant and use
a decision parameter to determine which of the two possible y positions is
closer to the circle path at each step.
Positions in the other seven octants are then obtained by symmetry.
Circle function for midpoint method is

fcircle x, y x2 y 2 r 2

53

The circle function tests are performed for the


midpositions between pixels near the circle
path at each sampling step.
The circle function is the decision parameter
in the midpoint algorithm.
Figure shows the midpoint between the two pixels at sampling position xk+1.
Decision parameter at the midpoint between these two pixels

pk f circle xk 1, yk
2

2
2
1
pk xk 1 yk
r2
2

If pk < 0, this midpoint is inside the circle and the pixel on yk is closer to
the circle boundary.

Otherwise, the midpoint is outside or on the circle boundary and we select


the pixel on yk-1.
54

Successive decision parameters are obtained using incremental calculations.

pk xk 1 yk 1
2

r2

pk 1 f circle xk 1 1, yk 1
2

The difference between these two


pk 1 pk 2 xk 1 y 2k 1 yk2 yk 1 yk 1
The initial decision parameter is obtained by evaluating the circle function at
the start position (x0, y0) = (0, r)

p0 f circle 1, r
2

2
1

1 r r2
2
5
r
4

1 r

55

Mid Point Circle Algorithm- Steps


1. Input radius r and circle center (xc, yc), and obtain the first point on the
circumference of a circle centered on the origin as
(x0, y0) = (0, r)
2. Calculate the initial value of the decision parameter as

p0 1 r
3. If pk < 0, the next point along the circle is (xk+1, yk) and

pk 1 pk 2 xk 1 1

Otherwise, the next point along the circle is (xk+1, yk -1) and

pk 1 pk 2 xk 1 1 2 yk 1
4. Determine symmetry points in the other seven octants.
5. Move each calculated pixel position (x, y) onto the circular path centered on
(xc, yc) and plot the coordinate values.
x= x +xc, y = y +yc
6. Repeat steps 3 through 5 until x y.
56

Example-Midpoint circle algorithm


A circle radius is 10cm, demonstrate the midpoint circle algorithm by
determining positions along the circle in the first quadrant from x=0 to x=y.
The initial value of the decision parameter is p0 1 r 1 10 9
Initial point is (x0,y0) = (0,10), the initial increment terms for calculating the decision
parameters are 2x0 = 0, 2y0 =20.
Pk <0
Next position
pk 1 pk 2 xk 1 1

Pk >0

pk 1 9 2 xk 2 1 6

pk 1 pk 2 xk 1 1 2 yk 1

57

Given a circle of radius r=15cm, determine the pixel positions along the circle
octant using mid point algorithm in the first quadrant from x=0 to x=y
R=15

p0 1 r 1 15 14

Initial point is (x0,y0) = (0,15), the initial increment terms for calculating the decision
parameters are 2x0 = 0, 2y0 =30.
Pk <0
Next position
pk 1 pk 2 xk 1 1
pk 1 14 2 xk 2 1 11

58

Transformation
Plays a central role in model construction and viewing
Used to achieve the effect of different viewing positions and
directions

Used to create animated files of geometric models to study


their motion
Commonly used transformations are
TRANSLATION
ROTATION
SCALING AND REFLECTION

59

Cont..

Geometric Transformations are mappings from one coordinate


system onto itself.
The description of a geometric model of an object can change
within its own model coordinate system (MCS).

This would imply that the geometric model must undergo motion
relative to its MCS.
Relative distance between object particles remain constant; i.e.,
the object does not deform during the motion.
Transformations can be applied directly to the parametric
representations of objects such as points, curves, surfaces and
solids.
Concatenation or combination of transformations must be possible
60

Transformation of a point
Transformation can be applied directly to the parametric
representations of objects such as points, curves, surfaces and
solids.

A point P belongs to a geometric model undergoes a rigid-body


motion, find corresponding point P* in the new position such that
P* = f(P, transformation parameters)
To implement into graphics software it is expressed in matrix
notation as
P*=[T]P

[T] is the transformation matrix whose elements are functions of


the given transformation parameters.
The transformation matrix is applicable to both 2D and 3D
graphics applications

61

Representation of points in matrix form


In two dimensional coordinate system any point is represented in terms of x
and y coordinates.
The point (x,y) can be converted into matrix in the following two ways:

The above two matrices are frequently called position vectors.

A series of points, each of which is a position vector relative to some


coordinate system, is stored in a computer as a matrix or array of numbers.
The position of these points is controlled by manipulating the matrix which
defines the points.
Lines are drawn between the points to generate lines, curves or pictures.

62

Representation of points in matrix form


Represent any rectangle in matrix form.
Let (x1, y1) and (x2,y2) be the opposite vertices of a rectangle.
Then , the four vertices of the rectangle will be: (x1,y1), (x2, y1),
(x2,y2), (x1,y2).
Matrix form

63

TRANSLATION
Every entity of the geometric model remains parallel to its initial
position, the rigid body transformation of the model is defined as translation.
Every point on it moves an equal given distance in a given direction
Translation can be specified by a vector, a unit vector and a distance or two
points that denote the initial and final positions of the model to be translated.

Final position vector P* of a point P


to its initial position vector P after
being translated by a vector d.
P* = P+d
Scalar form for 3-D case
x* = x+xd
y* = y+yd
z* = z+zd
Translating a curve does not change its tangent vector at any point
64

TRANSLATION OF A PLANE FIGURE

This is normally the operation used in


CAD systems as the MOVE command.

65

TRANSLATION- EXAMPLE

66

67

TRANSLATION- EXAMPLE
Translate the outline of a house by (3, -4)

68

SCALING
Scaling is used to change, increase or decrease the size of an entity or
a model.
Point wise scaling can be performed by

Where [S] is a diagonal scaling matrix.


In three dimension it is given by

Can be expanded to give


The elements sx, sy, sz of the scaling matrix [S] are the scaling factors in
the X, Y, Z directions respectively.
69

UNIFORM SCALING
Scaling factors are always positive.
If the scaling factor are smaller than
1, the geometric model or entity to
which scaling is applied is compressed.
If the factors are greater than 1, the
model is stretched.
If the scale factors are equal, that is,
sx=sy=sz=s, the model changes in size
only not in shape. This is the case of
uniform scaling.

Uniform scaling does not change the slope at


any point.
70

DIFFERENTIAL SCALING
Differential scaling occurs when

Different scaling are applied in


different directions.

Differential scaling changes


both the size and shape of a
geometric model.

71

SCALING OF A PLANE FIGURE

72

SCALING-EXAMPLE

73

74

75

76

ROTATION
Rotation is an important form of geometrical transformation.
It enables the users to view geometric models from different angles.
Rotation of a point through an angle about x or y or z is sometimes
referred to as rotation about the origin.
A rotation in the counter clockwise direction is considered as positive.

The final position of P after


rotation is shown as point P*.

77

The coordinates of P* are given by:

where

78

ROTATION OF A 2D PLANE

79

80

3D -Transformations
A 3D object has a three dimensional geometry and therefore it requires
a three dimensional coordinate transformation.
The scaling and translation transformations are essentially the same as
two dimensional transformations.
However, the matrix will have a non zero third column.

81

The rotational matrix about the x- axis is

82

83

Reflection
Reflection is a transformation that produces a mirror image of an
object.
Mirror image generated by rotating the object 180 about the reflection
axis.

Reflection about x axis

Reflection about y axis

Reflection about xy axis

84

Concatenated Transformation
A series of transformations is applied to a geometric model.
It is also called as combination of transformations.
Concatenated transformations are simply obtained by multiplying the
[T] matrices of the corresponding individual transformations.

Where [Ti] are any combination of

Translation

Scaling

Rotation

Reflection

85

86

Windowing and Clipping


A world coordinate area selected for display is called a window.
An area on a display device to which a window is mapped is called a
viewport.

The window defined what is to be viewed, the viewport defined where it is to


be displayed.
The process of selecting the area is called windowing.
The process which divides each element of the area into its visible and
invisible portions, allowing the invisible portion to be discarded is called
clipping.

87

Viewing Transformation
The picture stored in the computer memory using any convenient cartesian coordiante system, referred to as world coordinate system (WCS).
When picture is displayed on the display device it is measured in physical device
co-ordinate system (PDCS).

Displaying an image of a picture involves mapping the coordinates of the points


and lines that form the picture into the appropriate physical device coordinate
where the image is displayed.
This mapping of coordinates is achieved with the use of co-ordinate
transformation known as viewing transformation.

88

Viewing Transformation
The mapping of a part of a world coordinate scene to device coordinates is
referred to as a viewing transformation.
Viewing transformation is simply referred to as the window-to-viewport
transformation or the windowing transformation.
In the mapping process the world coordinates are transformed into normalized
coordinates (0 to 1) and transformed to display device.

89

Window to Viewport Transformation

A point at position (xw, yw) in a


designated window is mapped to
viewport coordinates (xv,yv) so
that relative positions in the two
areas are the same.

90

91

REALISM IN 3D GRAPHICS
Many computer graphics applications involve the display of 3D
objects.
CAD systems allow their users to manipulate models of machined
components, automobile bodies and aircraft parts.

In applications like simulation, a high degree of realism of display


of objects may be essential to the programs success.
Producing a realistic image of a 3D scene on a 2D display presents
many problems.
How is depth, the third dimension, to be displayed on the
screen?
How are parts of objects that are hidden by other objects to be
identified and removed from the image?
How can lighting, colour, shadows contribute to the
rendering?
92

Techniques for Achieving Realism


It is impractical to produce an image that is a perfectly realistic
representation of an actual scene.

Instead, we need techniques that take into account


The different kinds of realism needed by applications.
The amount of processing required to generate the image.
The capabilities of the display hardware.
The amount of detail recorded in the model of the scene.

93

Depth Cueing
The basic problem addresses by visualization techniques is called
depth cueing.

When a 3D scene is projected onto a 2D display screen,


information about the depth of objects in the images tends to be
reduced or lost entirely.
Techniques that provide depth cues are designed to restore or
enhance the communication of depth to the observer.

94

Modeling Information and Realism


Adding details to a model increases the realism of the image.
Excessive detail may become confusing.

95

Hidden Line Removal


Removal of the hidden parts, that wouldnt be seen if objects were
constructed from opaque material in real life.

Dependent on viewing direction.


Determination of hidden edges and surfaces is one of the most
challenging task in computer graphics.

Requires a lot of computer time and memory space.

96

Hidden Line Elimination


The lines that are hidden from view are removed from the image.
Techniques used:
1. MINIMAX TEST (Overlap or bounding box test)
This test checks if two polygons overlap.
It surrounds each polygon with a box by finding its extents (minimum
and maximum x and y coordinates).
Then checks for the intersection for any two boxes in both X and Y
directions.

97

Minimax test for typical polygon and edges

98

Containment Test (Surroundedness)


The containment test checks whether a given point lies inside a given
polygon.

Draw a line from the point, is intersected with the polygon edges.
If the intersection count is even, the point is outside the polygon.
If it is odd, the point is inside.

99

Computing Silhouettes
A set of edges that separates visible faces from invisible faces
of an object with respect to a given viewing direction is called
silhouette edges or silhouettes.

An edge that is part of the silhouette is characterized as the


intersection of one visible face and invisible face.
An edge that is intersection of two visible faces is visible, but
does not contribute to the silhouette.

The intersection of two invisible faces produces an invisible


edge.

100

Hidden Line Removal Algorithm- Three Approaches


1. Edge oriented approach.
Test of all edges against all surfaces.
It is inefficient because it tests all the edges, whether they
intersect or not.
2. Silhouette approach
Testing all the edges against all the silhouette edges only.

3. Area oriented approach.


It calculates the silhouette edges and connects them to form
areas.

101

Priority Algorithm- Hidden Line Removal


Priority algorithm is also called the depth or z- algorithm.
ASSIGNMENT OF PRIORITIES: sorting the faces (polygons)
according to the largest z co-ordinate value of each.
If a face intersects more than one face other visibility tests are used.
1.

Utilize the proper orthographic projection to obtain the


desired view (whose hidden lines are to be removed)
of the scene. To perform the depth test, the plane
equation of any face (polygon) in the image can be
obtained by

102

2.

Face list will be stored to assign priorities. For the given figure, six
faces F1-F6 form such a list.

3.

Assign priorities to the faces in the face list. Priority assignment is


determined by comparing two faces at any one time. The priority list
is continuously changes, and the final list is obtained after few
iterations.
The first face in the face list is assigned the highest priority 1.

F1 is intersected with the other faces in the list, that is, F2-F6.

The intersection between F1 and F4 is an area A.

The intersection between F1 and F2 is an edge.

No intersection or empty set between faces F1 and F6.

103

2.

F1 intersects F2 and F3 in edges. Therefore both faces are assigned priority 1.

3.

F1 and F4 intersect in an area. The depth of F4 is less than that of F1. F4 is


assigned priority 2.

4.

No intersection between F1 and F5, no priority assignment is possible for F5.

5.

Face F1 is moved to the end of the face list, and the sorting process to
determine priority started all over again.

6.

In iteration 4, faces F4 to F6 are assigned the priority 1 first. When F4 is


intersected with F1, the F1 has higher priority. Thus, F1 is assigned priority 1
and the priority of F4 to F6 is dropped to 2.

7.

Reorder the face and priority lists so that the highest priority is on top of the
list. In this case, the face and priority lists are [F1,F2,F3,F4,F5,F6] and
[1,1,1,2,2,2] respectively.

104

105

Hidden Surface Removal


1.
2.
3.
4.

Z- buffer algorithm
Watkins algorithm
Wornocks algorithm
Painters algorithm

Z- buffer algorithm
This is also known as the depth buffer algorithm.

z values can be stored for each pixel in the frame buffer.

For each polygon in the scene, find all the pixels (x,y) that lie
inside or on the boundaries of the polygon when projected onto
the screen.

For each of theses pixels, calculate the depth z of the polygon


at (x,y).

If z > depth (x,y), the polygon is closer to the viewing eye than
others already stored in the pixel.

106

Hidden Solid Removal


In the hidden solid removal, display of solid models with hidden lines or
surfaces removed.
Ray Tracing Algorithm
Ray tracing algorithm for solid models consists of three main modules.
Ray / Primitive intersection
Ray / Primitive classification
Ray / Solid classification

107

Ray/Primitive intersection
Ray enters and exists the solid via the faces and the surfaces of the
primitives.
Possible outcomes are:
No intersection-ray misses the primitives.
Ray is tangent to the primitives touches at one point.
Ray intersects the primitive at two different points.

108

Ray / Primitive classification

Ray/primitive intersection points, the in, out and on segments of


the ray can be found.
If the ray intersects the primitive in two different points, it is divided
into three segments.
out - in out.
If the ray lies on a face of the primitive, it is classified as
out on out.
109

Ray / Solid classification


Ray / Solid classification produces the in and out segments of the
ray with respect to the solid.

110

111

The combine operation is a three step process:


First, the ray/primitive intersection points from left and right
subtrees are merged , forming a segmented ray.

Second, the segments of the ray are classified according to the


boolean operator and the classification.
Third, the ray is simplified by merging segments with the same
classification.

112

Shading
Line drawings are limited in their ability to represent complex shapes.
Hence we adopt shaded images.
Shaded color images convey shape information that cannot be
represented in line drawings.

Shaded images can also convey features other than shape such as surface
finish or material type (plastic or metallic look).
In shading a scene , a pin hole camera model is used.
Shading process must take into account the position and color of the light
sources and the position, orientation and surface properties of the
visible objects.

113

Shading models simulate the way visible


surfaces of objects reflect light.
They determine the shade of a point of
an object in terms of light sources,
surface characteristics, and the positions
and orientations of the surfaces and
sources.

114

115

Light source in shading


Two types of light sources can be identified:
Point light source and Ambient light.
Objects illuminated with point light sources appear harsh, because
they are illuminated from one direction only.
Ambient light is a light of uniform brightness and is caused by the
multiple reflections of light from many surfaces.
The input to a shading model is intensity and color of light source,
surface characteristics at the point to be shaded, and the positions
and orientations of surfaces and sources.

The output from a shading model is an intensity value at the


point.
Shading models are applicable to points only. To shade an object, a
shading model is applied many times to many points on the object.

116

Interaction of light with matter


Consider point light sources shining on surface of objects. (Ambient
light adds a constant intensity value to the shade at every point.)

The light reflected off a surface can be divided into two parts- diffuse
& specular.
When light hits an ideal diffuse surface, it is re-radiated equally in all
directions, so that the surface appears to have the same brightness from
all viewing angles.
Ideal specular surfaces re-radiate light in only one direction, the
reflected light direction.
Physically, the difference between these two components is that diffuse
light penetrates the surface of an object and is scattered internally
before emerging again while specular light bounces off the surface.
Real objects contain both diffuse and specular components, and
both must be modeled to create realistic images.
117

Specular Reflection

Specular reflection is a characteristic of shiny surfaces.

Shiny surface appears depend on the directions of the light source and
the viewing eye.

118

Shading Surfaces
Once we know how to shade a point, we can consider how
to shade a surface.
Relevant points on the surface have the same location in
screen coordinates as the pixels of the raster display.
The important shading algorithms are

Constant shading,
Gourand shading or first derivative shading and
Phong or second derivative shading.

119

Constant Shading:
This is the simplest and least realistic shading algorithm. An entire
polygon has a single intensity. Constant shading makes the polygonal
representation obvious and produces unsmooth shaded images.

This type of shading is also called flat shading or faceted shading.


Surface normal is determined, illuminated.
Assumptions are:
The object is modeled using plane polygonal surfaces only.

The light sources are only at infinity.

The view point is also at infinity.

120

Gourand Shading:

It is a popular form of intensity interpolation or first-derivative shading. It


proposed a technique to eliminate intensity discontinuities caused by
constant shading. The steps involved are:
1. Calculation of surface normals.
2. Calculation of vertex normals.
3. Computation of vertex intensities using the vertex normals.
4. Computation of the shade of each polygon by linear interpolation of
vertex intensities.
Gourand shading takes longer than constant shading and requires more planes
of memory to get the smooth shading for each color.

Surface normals

Intensity interpolation along polygon edges

121

Surface normal to different polygonal faces

Vertex normal

122

12 bit of colour output for shading

While Gourand shading produces


smooth
shades,
it
has
some
disadvantages.
If it is used to produce shaded
animation (motion sequence), shading
changes in a strange way because
interpolation is based on intensities
and not surface normals that actually
change with motion.
Highlights are distorted due to the
linear interpolation of vertex intensities.
123

Phong Shading:
Phong Shading overcomes all the problems
of Gourand Shading, although it requires
more computational time.

The basic idea behind this is to interpolate


normal vectors at the vertices instead of the
shade intensities and to apply the shading
model at each point (pixel).
To perform the interpolation to obtain an
average normal vector at each vertex.

124

Coloring
The use of colors in CAD/CAM has two main objectives:

Facilitate creating geometry


Display images
Colors can be used in geometric construction. In this case various
wireframe, surface, or solid entities can be assigned different colors to
distinguish them.
Color is one of the two main ingredients (the second one being texture) of
shaded images produced by shading algorithms.
In some engineering applications such as finite element analysis, colors
can be used effectively to display contour images such as stress or
heat- flux contours.

125

Color Properties
Color descriptions and specifications generally include three properties:
Hue, Saturation and Brightness.
Hue

Associates a color with some position in the color


spectrum . Red, Green and Yellow are Hue names.
The frequency that is dominant for any picture or surface is
called the dominant frequency or wavelength or hue of the
light.

Saturation Describes the clarity or purity of a color or it describes how


diluted the color is by white light.

Pure spectral colors are fully saturated and grays are desaturated colors.
Brightness It is related to the intensity value, or lightness of the color.
126

Color Models
A color model or a space is a 3D color coordinate system to allow
specifications of colors within some color range.

Each displayable color is represented by a point in the color model.


These models are based on the red, green, and blue (RGB) primaries.
For all the models, coordinates are translated into three voltage values in
order to control the display.

Some of the popular color models are:

RGB model

CMY model

YIQ model

HSV model

HSL model

127

RGB Color Model

The RGB color space uses a Cartesian coordinate system.


Any point (color) in the space is obtained from the three
RGB primaries; that is, the space is additive.
The main diagonal of the cube is the locus of equal amounts
of each primary and therefore represents the gray scale or
levels.
Thus in the RGB model, the lowest intensity (0 for each
color) produces the black color and the maximum
intensity (1 for each color) produces the white color.
128

RGB Color Model

129

CMY Model
The CMY (cyan, magenta, yellow) model is
the complimentary of the RGB model.

The cyan, magenta, and yellow colors are the


compliments of the red, green and blue
respectively.
The white color is at the origin (0,0,0) of the
model and the black color is at the point
(1,1,1) which is the opposite of the RGB
model.

The CMY is considered a subtractive model because the model primary colors
subtract some color from white light.
For example, a red color is obtained by subtracting a cyan color from white light
(instead of adding magenta and yellow).

The unit column vector represents white in the RGB model or black in the
CMY model.
130

CMY Model

CMY model is used in printing technology.

131

YIQ Model
The YIQ space is used in raster color graphics.
It was designed to be compatible with black and white television broadcasts.

The Y axis of the color model corresponds to the luminance (the total amount
of light).
The I axis encodes chrominance information along a blue-green to orange
vector and the Q axis encodes chrominance information along a yellow-green
to magenta vector.
The conversion from YIQ coordinates to RGB coordinates is defined by the following
equation:

+
132

HSV (hue, saturated, value) Model


This color model is user oriented because it is based in what artists use
to produce colors (hue, saturation, and value).

It is contrary to the RGB, CMY and YIQ models which are hardware
oriented. The model approximates the perceptual properties of hue,
saturation, and value.
The conversion from HSV coordinates to RGB coordinates can be defined
as follows:

The hue value H (range from 0 to 360) defines the angle of any point
on or inside the single hexacone.
Each side of the hexacone bounds 60.

133

HSV Model

134

HSL Model
The HSL (hue, saturation, lightness)
color model forms a double
hexacone space.
The saturation here occurs at V = 0.5
and not 1.0 as in the HSV model.
The HSL model is as easy to use as
the HSV model.

The conversion from HSL to RGB is


possible by using the geometry of the
double hexacone as in the HSV
model.

135

136

Geometric Model
Three types of geometric models

Wireframe Model
Surface Model
Solid Model

The user construct geometric model of an object on a CAD/CAM


system by inputting the object data via the user interface provided by
the software.

Current geometric models offered by CAD/CAM systems have


adequate and enough geometric and visualization attributes.
Based on these attributes, they are utilized successfully in applications
such as mass property calculations, mechanical analysis, finite
element modeling and NC.
137

Wireframe Model
A wireframe model of an object is the simplest geometric model that
can be used to represent it mathematically in the computer.
It is some times refereed to as an edge representation of the object.
The word wireframe is related to the fact that one may imagine a wire
that is bent to follow the object edges to generate the model.
Typically a wire frame model consists entirely of points, lines, arcs
and circles, conics and curves.

Early wireframe modeling techniques developed in the 1960s were


two dimensional and were designed to automate drafting and simple
NC.
Later in the early 1970s, the 3D wireframe modeling was introduced.
138

Wireframe Model

139

Wireframe Model
Advantages
Simple to construct.
Does not require as much computer time and memory as does surface and
solid modeling.
Surface algorithms require wireframe entities to generate surfaces.
Disadvantages
Unambiguous representation of real objects.
Complex design having many edges become very confusing.
Lack of information to determine the object profile.
Both topological and geometrical data are needed to construct wireframe
models while solids require only geometrical data.
Volume, mass properties, NC tool path generation, cross sectioning are not
possible.
140

Wireframe Entities
Wire frame entities can be divided into analytic and synthetic entities
Analytic entities are :
Points, Lines, Arcs, Circles, fillets, and chamfers, and conics.
Synthetic entities are:
Splines (cubic spline, B-spline), Bezier curves.

Method of defining points:

141

Wireframe Entities
Method of defining Lines:

Method of defining Arcs and circles:

142

Wireframe Entities
Method of defining Ellipses and parabolas:

143

Wireframe Entities
Method of defining Synthetic curves:

Cubic spline

Bezier curve

B-Spline curve

144

Representation of Curves
Generally shape representation have two uses
Analytic use.
Synthetic use.
In Analytical, representation are used analytically to describe
shapes that can be measured.

In synthetic, the designer interactively creates or modifies a


model of a shape, examining and improving the design until it is
acceptable.

145

Important properties for designing curves


Control Points:
Locate points through which the curve must pass or
points that control the curve shape.

Axis independence:
The shape of an object must not change when the control
points are measured in a different coordinate system.
Global or local control:
As a designer manipulates a control point, a curve may
change shape only in the region near the control point
or it may change shape throughout.
146

Variation diminishing property:


A curve that oscillates about its control points is
usually undesirable.
Variation diminishing curves tend to smooth out a
sequence of control points.
Versatility:
A curve representation that allows a limited variety of
shapes may frustrate a designer.
The control of a curve representation, often by adding
or removing control points.
Order of continuity:
A complex shape is usually not modeled by a single
curve, but by several curves pieced together end to end.
When creating joints, the designer often wants to control
the order of continuity at the joint.
147

SYNTHETIC CURVES

Need of synthetic curves in design arises:


When a curve is represented by a collection of measured
data points and

When an existing curve must change to meet new design


requirements.
Data points are called control points for the curve.
Various continuity requirements can be specified at the data
points to impose degree of smoothness of the resulting curve.

148

Order of Continuity
The order of continuity becomes important when a complex
curve is modeled.
Zero order continuity (C0) yields a position continuous curve
(same end point).

149

First (C1) and second (C2) order continuities imply slop and
curvature continuous curves respectively.

First order continuity

Second order continuity

The type of input data and its influence on the control of the
resulting synthetic curve determine the use and effectiveness of the
curve in design.

150

Most commonly used Synthetic Curves


Cubic Spline
It passes through the control points.
It has only upto C1 continuity.

Bezier Curve
It does not pass through the control points but only approximates the
trend.
It also has only upto C1 continuity.

B-Spline Curve
It is also most generally an approximator.
It has upto C2 continuity.

151

Cubic Spline
Parametric spline curves are defined as
piecewise polynomial curves with a
certain order of continuity.
Parametric cubic splines are used to
interpolate to given data.
Cubic spline is determined by defining positions and tangent
vectors at the data points.

The parametric cubic spline connects two data points and utilizes a
cubic function.
Therefore four conditions (positions of the two end points and two
tangent vectors at the points) are required to determine the
coefficients of the equation.
152

Parametric equation of cubic spline is given by

Where u is the parameter and Ci is the polynomial coefficients


Expanded vector form of above equations is
In scalar form it can written as for x, y and z components

Matrix form it can be written as

153

The tangent vector to the curve at any point is given


differentiating the equation with respect to u to give

by

Inorder to find the coefficients Ci, consider the cubic spline curve with
two endpoints P0 and P1.
Applying the boundary conditions

154

Solving these four equations simultaneously for the coefficients gives

Substituting in the below equation and rearranging gives

are called geometric coefficients.


Tangent Vector becomes

The function of u called blending functions


155

Equation can be written in a matrix form as


Where

is the Hermite matrix and V is the geometry vector.

The curves shape can be controlled by changing its endpoints or its


tangent vectors.
If the two end points are fixed in space, the designer can control the
shape of the spline by changing either the magnitudes or the direction
of the tangent vectors.
156

The use of the cubic splines in design applications is not popular


compared to Bezier or B-spline curves.
The control of the curve is not very obvious from the input data due
to its global control characteristics.
The order of the curve is always constant (cubic).

157

BEZIER CURVES
Bezier curves and surfaces are credited to P. Bezier of the French car
firm Regie Renault who developed (1962).
A Bezier curve is defined by a set of data points. The curve may
approximate the data points.

The data points are used to control the shape of the resulting
curves.
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 shape tends to follow the polygon shape.


158

BEZIER CURVE

The figure shows the order of defining the control points


changes the polygon definition, which changes the resulting
curve shape.
The arrow shown on each curve shows its direction.

159

BEZIER CURVES FOR VARIOUS CONTROL POINTS

160

BEZIER CURVES FOR VARIOUS CONTROL POINTS

161

BEZIER CURVE
Mathematically for n+1 control points, the Bezier curve is defined by the
following polynomial of degree n:

Where P(u) is a point on the curve and Pi is a control point.


Bi,n are the Bernstein polynomials .

162

Characteristics of the Bezier Curve


The curve interpolates the first and last control points; that is,
it passes through P0 and Pn.

The curve is tangent to the first and last segments of the


polygon.
Slope at P0 should be P0P1, at Pn it is Pn-1 Pn . It has C1 continuity.
The curve is symmetric: the sequence of control points defining
the curve can be reversed without change of the curve shape.

163

Cont..

The curve shape can be modified by either changing one or more


vertices of its polygon.
A closed Bezier curve can simply be generated by closing its
characteristics polygon.

The curve lies entirely within the convex hull formed by four
control points.
The curve will never oscillates widely.

164

Modifications of cubic Bezier Curve

165

166

CONVEX HULL OF A BEZIER CURVE

Bezier curve has the convex hull property.

A curve is said to have convex hull


property if it is lies entirely within the
convex hull defined by the polygon
vertices.
In a plane, the convex hull is a closed
polygon and in 3D it is a polyhedron.
The hull is formed by connecting the
vertices of the characteristic polygon.

This is a useful property for graphics


functions such as displaying or clipping the
curve.
167

Some Bezier Curves

168

Bezier Curves- Disadvantages


Bezier curve seems superior to a cubic spline curve, it still
has some disadvantages.
The curve does not pass through the control points which
may be inconvenient to some designers.
The curve lacks local control. It only has the global control
nature.

If one control point is changed, the whole curve changes.


Therefore, the designer cannot selectively change parts of the
curve.

169

Cubic Bezier Curves or 3rd degree Bezier curve


n =3 and four control points 1,2,3,4

170

171

172

Plotted Bezier Curve

173

B Spline Curve
B-splines are a powerful tool for generating curves with many
control points and provide many advantages over Bezier
curves.
A long, complicated curve can be specified as a single Bspline.
A curve designer has much flexibility in adjusting the
curvature of a B-spline curve.

B-splines can be designed with sharp bends and even


corners.
B-spline curves can interpolate or approximate a set of given
data points.
174

B Spline Curve
Similar to Bezier curves, the B-spline curve defined by n+1 control points
Pi is given by

175

The Characteristics of B- Spline Curve

The local control of the curve can be achieved by changing the


position of a control points, using multiple control points by placing
several points at the same location, or by choosing a different degree.

B-spline curve passes through the first and last control points P0 and
Pn+1 and is tangent to the first and last segments of the control
polygon.
176

The Effect of Degree of B- Spline Curve on its shape

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.
A second degree curve is always tangent to the midpoints of all the
internal polygon segments. This not in the case for other degrees.

177

Identical B-spline and Bezier Curves


If k equals the number of
control points, then the
resulting B-spline curve
becomes a Bezier curve.
Multiple control points
induce regions of high
curvature of a B-spline
curve. This is useful when
creating sharp corners in
the curve.

178

Multiple Control point B-Spline curve

179

An Closed B-spline curve with P0 and P5 coincident


In representing closed curves, closed polygons are used where the
first and last control points are connected by a polygon segment.

180

INTRODUCTION TO SURFACE MODELING

Surface modeling is required in Shape design and representation of


complex objects such as car, ship and aircraft bodies as well as
castings.

Surface creation on existing CAD/CAM systems usually requires


wireframe entities (lines, curves, points, etc.) as a start.

To create a surface model, the user begins by constructing wireframe


entities and then connecting them appropriately with the proper
surface entities.

Surface models are generated by using surface primitives such as


plane surface, ruled surface, surface of revolution, tabulated
cylinder, fillet surface, offset surface, Bezier surface, B-spline
surface and coons patch.

A surface model of an object is a more complete and less ambiguous


representation than its wireframe model.
181

Surface Modeling

In order to visualise surfaces on a graphic


display, a mesh say m x n in size is usually
displayed; the mesh size, is controlled by the
user.

A wire frame model can be extracted from a


surface model by deleting all surface entities.

Database of surface models are centralised and


associative, manipulation of surface entities in
one view is automatically reflected in the other
views.

Surface model can be used for mass properties


calculation, finite element mesh, NC tool path
machining.

Surface models can be shaded and represented


with hidden lines.
182

Mesh in Surface Models

Finer the mesh size of surface entities in a model, the longer the CPU
time to construct the entities and to update the graphics display and the
longer it takes to plot the surface model.

183

Surface Entities
Major surface entities provided by CAD/CAM systems.
1. Plane Surface
This is the simplest surface.
The plane surface can be used to generate cross sectional
views by intersecting a surface model with it.

184

2. Ruled (lofted )Surface


This is a linear surface. It interpolated linearly between two
boundary curves that define the surface (rails).

Rails can be any wireframe entity. This entity is ideal to


represent surfaces that do not have any twists or kinks.

185

3. Surface of revolution
This is an axisymmetric surface that can model axisymmetric
objects. It is generated by rotating a planar wireframe entity
in space about the axis of symmetry a certain angle.

186

4. Tabulated Cylinder
This is a surface generated by translating a planar curve a
certain distance along a specified direction (axis of the
cylinder)

It is used to generate surfaces that have identical curved cross


sections.

187

5. Bezier Surface

This is a surface that approximates given input data.

Similar to Bezier curve, it does not pass through all given


data points.
It is a synthetic surface that permits, twists and kinks.
It allows only the global control of the surface.

188

6. B-spline surface
It is a synthetic surface, can approximate or interpolate
given input data.
It permits local control of the surface.

189

7. Coons Patch
Coons patch is used to create
surface using curves that form
closed boundaries.
8. Fillet surface
Surface that blends two surfaces
together.

190

9. Offset surface
Existing surface can be offset to create new ones
identical in shape but may have different dimensions.

191

SURFACE REPRESENTATION

The treatment of surfaces in computer graphics and CAD/CAM


requires developing the proper equations and algorithms for both
computation and programming purposes.
Moreover, surface description is usually related to machining
requirements to manufacture the surface.
The surface description must successfully drive a tool to generate its
path.
Surface can be described mathematically in three dimensional space
by nonparametric or parametric equations.

where P is the position vector of a point on the surface.


192

Solid Modeling-Introduction
Solid Modeling (Volumetric modeling) techniques begun to develop in the late
1960s and early 1970s.

It is developed to eliminate all kinds of ambiguities in representation and


manipulations of the objects.

The completeness of the information contained in a solid model allows


the automatic production of realistic images of a shape.

The model can also serve as a means of geometric input for finite element
analysis or even manufacturing tasks as the generation of instructions for
numerically controlled machining.

It produces accurate designs

It provides complete three dimensional definition. It improves the


quality of the design

It improves visualization. It has potential for functional automation and


integration.
193

Are a more complete representation than its surface model.

Contain geometric data as well as topological information unlike


wireframes or surfaces.

194

Use of Solid Modeling in design and manufacturing increasing due to


Reduced computing costs
Fast computing hardware
Improved user interface
Software improvements

Solid modeling is the solution to automating and integrating design


and manufacturing.
The complete definition of part shape through solid models is a key to
CIM.
Solid modeling store more information than wire frame or surface
modelers.
195

Geometry and Topology in Solid Models

The data base for a solid


model should have two types
of information.

The first is the metric or


geometric data which relate
to
the
3D
coordinate
positions of the object in
space.

Second is the connectivity or topological data which relate


objects with each other.

Both information are necessary, as different shapes can result with


Same geometry- different topology
Different geometry-same topology
196

Geometry and Topology in Solid Models

The geometry is the actual


dimensions that define the entities
of the object.

The length of lines L1, L2, L3 and


the angles between the lines, and
the radius R and the center P1 of
the half circle.

Topology is the connectivity of the object entities.

L1 shares a vertex with L2 and C1 , L2 shares a vertex with L1 and L3,


L3 shares a vertex with L2 and C1, L1 and L3 do not overlap, and P1 lies
outside the object.
197

Solid Models-Primitives Approach

Using primitive approach, one can construct the solid model of the object by
dividing it into blocks and cylinders.
198

Solid Models-Features Approach

In feature approach the designer can create different cross sections and
extrude them.

199

Solid Entities
Primitives (building blocks) are simple basic shapes and are
considered the solid modeling entities which can be combined by a
mathematical set of Boolean operations to create the solid.
The most common primitives are: Block
Cylinder
Cone
Sphere
Wedge
Torus

A primitives requires a set of location data, a set of geometric


data and a set of orientation data.

Primitives are usually translated or rotated to position and


oriented properly before applying Boolean operations.
200

Various Solid Modeling Primitives

201

Most Common Primitives

202

Primitives
Two or more primitives can be combined to form the desired solid.
The relationships between primitives are achieved via Boolean
operations.
Boolean operations are

Union

Intersection

Difference

203

Boolean Operations of a Block A and Cylinder B

204

205

Solid Modeling using 3D Primitives

206

Solid Representation

A solid model of an object is defined


mathematically as a point set S in 3-D
Euclidean space.

The interior, the boundary and


exterior of the solid is denoted by iS,
bS and cS respectively

Then the object is represented by the


relation

S bS iS

The universal set W is represented by

W bS iS cS

S kS

kS bS iS

Where kS is the geometric closer, which implies that the interior of the
solid is geometrically closed by its boundary.
207

Solid Model-Properties
Rigidity- shape of model is invariant and does not depend on the model location or
orientation in space.
Homogenous Three Dimensionality boundaries must be in contact with interior.
No isolated or dangling boundaries should be permitted.
Finiteness and Finite Describability Size of the solid is not infinite and a limited
amount of information can describe the solid.
Closure Under Rigid Motion and Regularized Boolean
Operations
Manipulation of solids by moving them in space or
changing them via Boolean operations must produce other
valid solids.

Boundary Determinism
The boundary of a solid must contain the solid and hence
must determine distinctively the interior of the solid.
208

The properties of representation schemes


Domain
Class of objects that the scheme can represent or it is the geometric
coverage of the scheme.

Validity
Validity of a representation scheme is determined by its range, i.e.,
the set of valid representations or models it can produce.
Completeness or Unambiguousness
This properties determines the ability of the scheme to support
analysis and other engineering applications.
Uniqueness
Used to determine object equality.

209

Solid Representation
Representation scheme is defined as a relation that maps a valid point set
into a valid model.
One model produced by the
scheme represents only one
object.
More than one model
represent the object.
One model can represent
more than one object.

210

Positional and permutational nonuniqueness

211

Other properties of representation schemes


Conciseness
Measure of the size of data a scheme requires to describe an
object.
The scheme generates compact databases, convenient to store
and efficient to transmit from one system to another.

Ease of operation
Determines the user-friendliness of a scheme.
Efficacy
Measures how accessible a representation is by downstream
applications.
Good representation schemes should permit the use of a
wide variety of application algorithms for evaluating
various functions.

212

Various representation schemes


The nine solid representation schemes are
Half-spaces
Boundary Representation (B-rep)
Constructive Solid Geometry (CSG)
Sweeping
Analytical Solid Modeling (ASM)
Cell decomposition
Spatial enumeration
Octree encoding and
Primitive instancing

213

Algorithms
Representation of solids are built and invoked
via algorithms (processors)
Algorithm is a procedure that takes certain
input and produces a desired output.

Three types of algorithms


a: data rep (algorithm a is defined as
taking data and producing representation)
these algorithms build, maintain and manage
representations.
a: rep data (compute property values - by
taking a representation and producing data)
application algorithms belong to this type.

a: reprep (take representations and


produce representations) algorithm that
converts CSG to B-rep.
214

Boundary Representation (B-rep)


It is based on the topological notion that a physical object
is bound by a set of faces.

A boundary model comprised of faces, vertices and edges


linked together.
Each face is bounded by edges and each edge is bounded
by vertices.
The database of a B-rep model consists of both the
geometry as well as the topology of the object.

215

Topology by Euler operations.


Geometry- by Euclidean calculations.

216

Euler operations - to create, manipulate and edit the


faces, edges and vertices.
Geometry includes coordinates of vertices, rigid
motion and transformation (translation, rotation) and
metric information (distances, angles, areas, volumes).

Geometry and topology are interrelated and cannot be


separated.
The primitives used by the B-rep system are faces, edges
and vertices.

217

Basic Elements of B-rep


Primitives are used to create both polyhedral as well as
curved objects.
A polyhedral object consists of planar faces (or sides)
connected by straight (linear) edges, which in turn are
connected at the vertices.
A curved object is like a polyhedron but with curved faces
and edges

Classification of Polyhedral objects

Simple Polyhedron (no inner loops, holes or handles)


Polyhedrons with inner loops.
Polyhedrons that have holes but not through holes.
Polyhedrons with handles or genus
218

Types of polyhedral objects

219

220

Object
No

Faces
(F)

Edges
(E)

Vertices
(V)

Inner
Loop
(L)

Bodies
(B)

Genus
(G)

12

10

24

16

16

36

24

11

24

16

12

24

16

10

24

16

20

48

32

14

36

24

9
221

Eulers Law
Any polyhedron that satisfies the following equation has a
valid topology

F E V L 2( B G)

Any open surface objects satisfies the following equation

F E V L B G

222

Open Polyhedral Objects

223

Exact B-rep of a cylinder and a sphere

224

Approximate B-rep or Faceted B-rep


Curved face is divided
into planar facets.
Faceted
cylinder
is
generated by rotating a
line incrementally about
the axis.

225

General data structure for B-rep


It should have both
topological
and
geometrical information.
Lists for bodies, faces,
loops, edges and vertices
are generated and stored in
tables.

226

Euler Operations

227

228

Topology Creation via Euler Operators

229

230

Create the boundary model of solid S as shown in the figure

231

232

233

Boundary Model of Solid S

234

Rotational Sweep Boundary Model

235

Advantages of B-rep
It is very appropriate to construct solid models of unusual
shapes that are difficult to build using primitives.

e.g., Aircraft and Automobile body


It is relatively simple to convert a B-rep model into a
wireframe model because the models boundary definition is
similar to the wireframe definition.
Disadvantage
The disadvantage of B-rep is that it requires large amounts of
storage because it stores the definition of the model boundaries.

B-rep do not have a CSG compatible user interface.


236

Constructive Solid Geometry (CSG)


CSG and B-rep schemes are very popular schemes and best understood
representations so far.
CSG representations are easy to create, store and easy to check for
validity.
A CSG model is based on the topological notion
physical object can be divided into a set of primitives (basic elements or
shapes) and that can be combined in a certain order following a set of
rules (Boolean operations) to form the object.
Each primitive is bounded by a set of surfaces, it is combined via a
boundary evaluation process to form the boundary of the object.

237

TYPES OF CSG SCHEMES


There are two main types of CSG schemes:

r-sets: Based on bounded solid primitives.

Non r-sets: Based on generally unbounded half spaces.


(lower level primitives)

Half-spaces
It is a basic representation scheme for bounded solids. By
combining half-spaces (using set operations) in a building
block fashion, various solids can be constructed.
Half spaces are usually unbounded geometric entities.
238

Bounded and Unbounded Primitives

The solid model is represented by three bounded primitives and


seven half spaces

239

Data Base of CSG


The Database of CSG model stores its topology and
geometry.

Topology is created via regularized set (Boolean)


operations that combine primitives.
The geometry stored in the database of a CSG model
includes configuration parameters of its primitives and
rigid motion and transformation.
Data structures of CSG representations are based on the
concept of graphs and trees.

240

Graph
A graph is defined as a set of nodes connected by a set of
branches or lines.
Each branch in a graph is specified by a pair of nodes.
The set of nodes is A, B, C, D, E, F , G
The set of branches or pairs is

A, B, A, C,B, C,B, E,B, F ,B, G,C, D,C, E


These pairs are unordered, that is,
no relation exist between the
elements of each pair.
Pair A, B can also be

B, A
241

Directed Graph or Digraph


Pairs of nodes that make up the branches are ordered pairs
Branches have directions and
arrows going from one node
to another.
The tail of each
arrow
represents the first node in the
pair and its head represents the
second node.
The set of ordered pairs are

A, B, A, C,C, B,B, E,F , B,B, G,D, C,E, C


242

Path in Digraph
Each node in digraph has an
Indegree (number of arrow heads entering the
node)
Outdegree (number of arrow tails leaving the
node)

Path (sequence of nodes)


Node B has an indegree of 3 and an outdegree of 2 while node D has a
zero indegree and an outdegree of 1.
Each node in a digraph belongs to a path.
The path from node A to node G is A, B, G or A, C, B, G.
If the start and end nodes of a path are the same, the path is a cycle.

If a graph contains a cycle, it is cyclic; otherwise it is acyclic.


243

Tree
A tree is defined as an acyclic digraph in which only a single
node, called the root, has a zero indegree and every other
node has an indegree of one.
This implies that any node in the tree except the root has
predecessors or ancestors.

Node A is the root of the tree


and nodes E, F, G have node
B as their predecessor.
If the descendants of each
node are in order, then the tree
is an ordered one.
244

Binary and Inverted Binary Tree

If the ordered tree has two descendants, the tree is called a binary
tree.

Any node in a tree that does not have


descendants, that is, with an out degree
equal to zero, is called a leaf node
(D,E,F,G).
Any node that does have descendants
(out degree greater than zero) is an
interior node (B,C).

If the arrow directions in a binary


tree are reversed such that every node,
except the root, in the tree has an out
degree of 1 and the root has a zero out
degree, the tree is called an inverted
binary tree.
245

Sub-Tree
Every node of a tree (T) is a root of another tree, called a sub tree
of T, contained in the original tree T.
The tree consists of seven nodes with
A as its root.

Its left sub tree is rooted at B and its


right sub tree is rooted at C.
The absence of a branch indicates an
empty sub tree.
The binary tree rooted at the leaves D,
E, F, G have empty left and right
sub trees.

246

Typical solid and its primitives

A block and a cylinder primitive are enough to create CSG model of the solid.

247

A user can construct the CSG model using the following steps:
B1= block positioned properly
B2= block positioned properly
B3= block
B4= B3 moved properly in X direction
C1= cylinder positioned properly
C2= C1 moved properly in X direction
C3= cylinder positioned properly
C4= C3 moved properly in X direction

248

S1 B1 *B3
S 2 S1 *C1
S3 S 2 *C3
S 4 B2 *B4
S5 C2 *S 4
S6 C4 *S5
S S3 *S6

249

CSG graph

S1 B1 *B3
S 2 S1 *C1
S3 S 2 *C3
S 4 B2 *B4
S5 C2 *S 4
S6 C4 *S5
S S3 *S6

250

Data structure of a Primitive solid

251

Create the CSG model of solid S as shown in the figure

252

Constructive Solid Geometry

253

Sweep Representation
Sweeping is based on by moving a point, curve, or a surface along a
given path.
There are three types of sweep:
Linear, non linear and hybrid sweeps

In linear sweep, the path is a linear or circular.

In nonlinear sweep, the path is a curve.

Hybrid sweep combines linear and nonlinear sweep.

Extruded solids are created via linear sweep or translational sweep.

Solids of revolution can be created by rotational sweep.


Sweeping is used in B-rep or CSG based modelers.
254

Linear Sweep
Linear sweep can be divided
translational and rotational sweep.

into

In translational sweep, a planar two


dimensional contour can be moved a given
distance in a perpendicular direction called
directrix.
The contour should be closed, otherwise
invalid solids result.

In rotational sweep, the contour is rotated


about an axis of rotation by a given angle.

255

Non linear Sweep


Non linear sweep is similar to linear
sweep. But with the directrix being a
curve .

In hybrid sweep two contours are swept


in two different directions and the two
resulting swept volumes are glued
together to form the final object.
Invalid solids may result if the sweeping
direction is not chosen properly.

256

Você também pode gostar