Вы находитесь на странице: 1из 29

The information-processing cycle in a typical

manufacturing firm.
CAD/CAM
CHAPTER TWO

Computer Aided Design


(CAD)

Dr. Ibrahim Naimi

The Design Process PRODUCT DESIGN AND CAD


Product design is a critical function in the
The process of designing something is production system. The quality of the product
characterized as an interactive procedure, which design (i.e., how well the design department
consists of six identifiable steps or phases: does its job) is probably the single most
1. Recognition of need. important factor in determining the commercial
success and societal value of a product. If the
2. Definition of problem. product design is poor, no matter how well it is
3. Synthesis. manufactured. If the product design is good,
4. Analysis and optimization. there is still the question of whether the product
can be produced at sufficiently low cost to
5. Evaluation. contribute to the company's profits and success.
6. Presentation. Let us begin our discussion of product design by
describing the general process of design.

The Design Process


Recognition of need involves the realization by
someone that a problem exists for which some
corrective action can be taken in the form of a
design solution. This recognition might mean
identifying some deficiency in a current machine
design by an engineer. Problem definition
involves a thorough specification of the item to
be designed. This specification includes the
physical characteristics, function, cost, quality,
and operating performance.

1
The Design Process The Design Process
Evaluation is concerned with measuring the Synthesis and analysis are closely related and
design against the specifications established in highly interactive in the design process.
the problem definition phase. This evaluation Consider the development of a certain product
often requires the fabrication and testing of a design: Each of the subsystems of the product
prototype model to assess operating must be conceptualized by the designer,
performance, quality, reliability, and other analyzed, improved through this analysis
criteria. The final phase in the design procedure procedure, redesigned, analyzed again, and so
is the presentation of the design. Presentation on. The process is repeated until the design has
is concerned with documenting the design by been optimized within the constraints imposed
means of drawings, material specifications, on the designer. The individual components are
assembly lists, and so on. In essence, then synthesized and analyzed into the final
documentation means that the design data base product in a similar manner.
is created.

Application of Computers in Design Application of Computers in Design


Fundamental reasons for implementing CAD Computer-aided design (CAD) is defined
system: as any design activity that involves the
effective use of the computer to create,
1. To increase the productivity of the designer.
modify, analyze, or document an
This is accomplished by helping the engineering design. CAD is most
designer to conceptualize the product and commonly associated with the use of an
its components. In turn, this helps reduce interactive computer graphics system,
the time required by the designer to referred to as a CAD system.
synthesize, analyze, and document the There are several good reasons for using a
design. CAD system to support the engineering
design function:

Application of Computers in Design Application of Computers in Design


Fundamental reasons for implementing CAD Fundamental reasons for implementing CAD
system: system:
3. To improve Documentation 2. To improve the quality of design.
The graphical output of a CAD system The use of a CAD system with appropriate
results in better documentation of the hardware and software capabilities permits
design than what is practical with manual the designer to do a more complete
drafting. The engineering drawings are engineering analysis and to consider a
superior, and there is more standardization larger number and variety of design
among the drawings, fewer drafting errors, alternatives. The quality of the resulting
and greater legibility. design is thereby improved.

2
Application of Computers in Design Application of Computers in Design

The design related tasks performed by CAD Fundamental reasons for implementing CAD
system are: system:
1. Geometric modeling. 4. To create a data base for manufacturing.
2. Engineering analysis. In the process of creating the
documentation for the product design
3. Design review and evaluation.
(geometric specification of the product,
4. Automated drafting. dimensions of the components, materials
specifications, bill of materials, etc.), much
of the required data base to manufacture
the product is also created.

Geometric Modeling
Geometric modeling involves the use of a CAD
system to develop a mathematical description of
the geometry of an object. The mathematical
description, called a geometric model, is contained
in computer memory. This permits the user of the
CAD system to display an image of the model on a
graphics terminal and to perform certain operations
on the model. These operations include creating
new geometric models from basic building blocks
available in the system, moving the images around
on the screen, zooming in on certain features of the
image, and so forth. These capabilities permit the
designer to construct a model of a new product (or
its components) or to modify an existing model.

Geometric Modeling Geometric Modeling


There are various types of geometric models used in CAD.
Geometric models in CAD can also be classified One classification distinguishes between two-
as being either wire-frame models or solid dimensional (2-D) and three-dimensional (3-D)
models. A wire-frame model uses models. Two-dimensional models are best utilized for
interconnecting lines (straight line segments) to design problems in two dimensions, such as flat objects
depict the object as illustrated in the following and layouts of buildings. In the first CAD systems
Figure (a). Wire-frame models of complicated developed in the early 1970s, 2-D systems were used
principally as automated drafting systems. They were
geometries can become somewhat confusing often used for 3-D objects, and it was left to the designer
because all of the lines depicting the shape of or draftsman to properly construct the various views of
the object are usually shown, even the lines the object. Three-dimensional CAD systems are capable
representing the other side of the object. of modeling an object in three dimensions. The
Techniques are available for removing these so operations and transformations on the model are done
called hidden lines, but even with this by the system in three dimensions according to user
instructions. This is helpful in conceptualizing the object
improvement, wire-frame representation is still since the true 3-D model can be displayed in various
often inadequate. views and from different angles.

3
Geometric Modeling
Solid models are a more recent development in
geometric modeling. In solid modeling, Figure
(b), an object is modeled in solid three
dimensions, providing the user with a vision of
the object very much like it would be seen in real
life. More important for engineering purposes,
the geometric model is stored in the CAD
system as a 3-D solid model, thus providing a
more accurate representation of the object. This
is useful for calculating mass properties, in
assembly to perform interference checking
between mating components, and in other
engineering calculations.

Engineering Analysis Engineering Analysis


Mass properties analysis, which After a particular design alternative has been developed,
some form of engineering analysis often must be
involves the computation of such features performed as part of the design process. The analysis
of a solid object as its volume, surface may take the form of stress-strain calculations, heat
transfer analysis, or dynamic simulation. The
area, weight, and center of gravity. It is computations are often complex and time consuming,
especially applicable in mechanical and before the advent of the digital computer, these
analyses were usually greatly simplified or even omitted
design. in the design procedure. The availability of software for
Interference checking engineering analysis on a CAD system greatly increases
the designer's ability and willingness to perform a more
Tolerance analysis thorough analysis of a proposed design. The term
computer-aided engineering (CAE) is often used for
engineering analyses performed by computer.
Examples of engineering analysis software in common
use on CAD systems include:

Engineering Analysis Engineering Analysis


Finite element analysis. Software for finite element
Kinematic and dynamic analysis. Kinematic analysis (FEA), also known as finite element modeling
analysis involves the study of the operation of (FEM), is available for use on CAD systems to aid in
mechanical linkages to analyze their motions. A stress strain, heat transfer, fluid flow, and other
typical kinematic analysis consists of specifying engineering computations. Finite element analysis is a
numerical analysis technique for determining
the motion of one or more driving members of approximate solutions to physical problems described by
the subject linkage, and the resulting motions of differential equations that are very difficult or impossible
the other links are determined by the analysis to solve. In FEA, the physical object is modeled by an
assemblage of discrete interconnected nodes (finite
package. Dynamic analysis extends kinematic elements), and the variable of interest (e.g., stress,
analysis by including the effects of the mass of strain, temperature) in each node can be described by
each linkage member and the resulting relatively simple mathematical equations. By solving the
acceleration forces as well as any externally equations for each node, the distribution of values of the
variable throughout the physical object is determined.
applied forces.

4
Automated Drafting Design Evaluation and Review
Design evaluation and review procedures can
be augmented by CAD. Some of the CAD
The fourth area where CAD is useful (step 6 features that are helpful in evaluating and
in the design process) is presentation and reviewing a proposed design include:
documentation. CAD systems can be used Automatic dimensioning routines that
as automated drafting machines to determine precise distance measures between
surfaces on the geometric model identified by
prepare highly accurate engineering the user.
drawings quickly. Error checking. This term refers to CAD
algorithms that are used to review the accuracy
and consistency of dimensions and tolerances
and to assess whether the proper design
documentation format has been followed.

A FREE-HAND SKETCH DESIGN REPRESENTATION


Design Representation Manufac-
turing

Verbal
Sketch
Multiview orthographic drawing (drafting)
CAD drafting
CAD 3D & surface model
Solid model
Feature based design

. Requirement of the representation method


precisely convey the design concept
easy to use

SOLID MODEL DESIGN DRAFTING


Y

top

Pr o f i l e p lan e
f
b c d e

I I Z
H o r iz o n t a l I

h i side X
j I V
I I I

Fr o n t a l p la n e
front

Third angle projection


Drafting in the third angle

5
Standards for dimensioning DESIGN DRAFTING
A drawing is expected to convey a complete
description of every detail of a part. However,
dimensioning is as important as the geometric
information. According to the American National
Standards Institute (ANSI) standards, the following are A

the basic rules that should be observed in dimensioning Partial view A

any drawing:
1. Show enough dimensions so that the intended sizes and
shapes can be determined without calculating or 2.0000.001

assuming any distances.


2. State each dimension clearly, so that it can be A-A
interpreted in only one way. A

3. Show the dimensions between points, lines, or surfaces


that have a necessary and specific relation to each other Cut off view and auxiliary view
or that control the location of other components or
Provide more local details
32
mating parts.

Conventional tolerance Standards for dimensioning


Since it is impossible to produce the exact dimension specified, 4. Select and arrange dimensions to avoid
a tolerance is also used to show the acceptable variation in a
dimension. The higher the quality a product has, the smaller the accumulations of tolerances that may
tolerance value specified. Tighter tolerances are translated into permit various interpretations and cause
more careful production procedures and more precise inspection.
There are two types of tolerances: bilateral tolerance and unilateral unsatisfactory mating of parts and
tolerance (as shown in the following Figure). Unilateral tolerances, failure in use.
such as 1.0000..0005 , specify dimensional variation from the basic size
(i.e., decrease) in one direction in relation to the basic size; for 5. Show each dimension only once.
example, 1.00 0.95 1.00
0.00
0.05

The basic location where most dimension lines originate is the


6. Where possible, dimension each feature
reference location (datum). For machining, the reference location in the view where it appears in profile,
provides the base from which all other measurements are taken. By and where its true shape appears.
stating tolerance from a reference location, cumulative errors can be
eliminated.

Conventional tolerance Conventional tolerance


- Most mechanical parts contain both working surfaces
and nonworking surfaces. Working surfaces are those for
items such as bearings, pistons, and gear teeth, for which
optimum performance may require control of the surface
characteristics. Nonworking surfaces, such as the exterior
walls of an engine block, crankcase, or differential
housings, seldom require surface control. For surfaces
that require surface control, control surface symbols can
be used.
- In the symbol, several surface characteristics are
specified. The roughness height is the roughness value
as normally related to the surface finish. It is the average
amount of irregularity above or below an assumed
centerline. It is expressed in micro inches or, in metric
system, in micrometers.

6
Dimensioning Conventional tolerance
Surface control symbols

TOLERANCE TOLERANCE
1. Check that the tolerance & dimension specifications are reasonable
for assembly.
2. Check there is no over or under specification.

TOLERANCE TOLERANCE

7
CAD systems can be classified in several ways: TOLERANCE GRAPH
1. By the system hardware: Minicomputer,
Engineering workstation, Microcomputer.
2. By the application area: Mechanical
engineering, Circuit design and board
layout, Architectural design and construction
engineering, Cartography.
3. By the modeling method: 2-D drafting, 3-D
drafting, Sculptured surface, 3-D solid
modeling.

CAD Systems Architecture CAD Systems Architecture


CAD systems comprise:
1. Hardware: the computer and associated peripheral
equipment.
2. Software: the computer program(s) running on the
hardware.
3. Data: the data structure created and manipulated
by the software.
4. Human knowledge and activities.
CAD systems are no more than computer programs. The software
comprises a number of different elements or functions that
process the data stored in the database in different ways.

CAD Systems Architecture CAD Systems Architecture


Main Functions of CAD Systems/Cont. Main Functions of CAD Systems
6. Applications: these elements of the software do not
modify the design model, but use it to generate
information for evaluation, analysis or manufacture. 1. Model definition: for example to add geometric
elements to a model of the form of a component.
7. Utilities: a "catch-all" term for parts of the software that
do not directly affect the design model, but modify the 2. Model manipulation: to move, copy, delete, edit or
operation of the system in some way (for example, to otherwise modify elements in the design model.
select the color to be used for display, or the units to be 3. Picture generation: to generate images of the
used for construction of a drawing). design model on a computer screen or on some
hard-copy device.
These features may be provided by multiple programs 4. User interaction: to handle commands input by the
operating on a common database, or by a single user and to present output to the user about the
program encompassing all of the elements. operation of the system.
5. Database management: for the management of
the files that make up the database.

8
CAD Systems Architecture CAD Systems Architecture
Structure of CAD Systems
Structure of CAD Systems
Sometimes, a CAD system can be considered as
consisting of three major parts:
1. Hardware: computer and input/output (I/O) devices
2. Operating system software
3. Application software: CAD package

CAD Systems Architecture CAD Systems Architecture


Modeling objects
Functions of CAD Systems
The model of an engineering object consists of
CAD is a tool not only to represent an geometry, topology, and auxiliary information.
engineering model, but also to manipulate it. To Geometry includes points, lines, circles, planes,
construct or display a model, geometric cylinders and other surfaces. It defines the basic
shape characteristics. Topology represents the
transformations and view transformations are
relationships of the geometry of an object. In
needed. addition to its shape, an engineering object also
possesses some other attributes. Dimensions,
tolerances, and surface finish are some
important attributes.

Modeling
Defining the Model
Representation of Models Many properties of products have to be
There are two types of models: modeled, including form, dimension,
tolerance and structure. In all of these areas
Models of form typically represented by drawings geometry, images and spatial manipulation are
of components and their arrangement in
assemblies. very important. For this reason, CAD is
Models of structure normally represented by founded on computational geometry and
diagrams that show the components of a system computer graphics.
and how they are connected.

9
Defining the Model Defining the Model
The representation of structure using diagrams

In engineering diagrams the logical or physical The representation of form using drawings
structure of a system, in terms of the assembly of The technique of representing three-dimensional
the primitive parts and the relationship between forms in two-dimensional space by means of
these, is shown by a series of symbols joined by engineering drawings -on paper or on a computer
connections. The rules for the symbols, and for the screen- is formally known as descriptive geometry.
connections, are governed by conventions that
have been established in standards.

Defining the Model Defining the Model


Block Diagrams Examples of Electrical and Fluid Power Symbols

At an early stage in the design process it may


only be possible to define overall relationships
between parts of a system, and a block diagram
may be most appropriate.

As a design is prepared for construction and


manufacture, detailed wiring or piping diagrams are
required.

Defining the Model


Defining the Model Block diagram of injection system
Top-Down Design

By exploiting representations such as block diagrams, the


designer is able to subdivide a design problem into smaller
elements. These in turn may be subdivided, such that a
hierarchical decomposition of the problem is obtained. This
technique is known as "top-down" design.

10
Defining the Model Defining the Model
computer representation of drawings and diagrams Example: Top-Down Design A hierarchical
arrangement of diagrams
Defining the graphic elements
The user has a variety of different ways to call a
particular graphic element and position it on the
geometric model. There are several ways of
defining points, lines, arcs, and other components
of geometry through interaction with the ICG
(interactive computer graphics) system. These
components are maintained in the database in
mathematical form and referenced to a 3D
coordinate system.

Defining the Model


Defining the Model Basic geometry
A component must be modeled before it can be drawn.
Methods of defining elements in interactive computer
graphics
Points
Methods of defining points in computer graphics include:
1. Pointing to the location on the screen by means of
cursor control.
2. Entering the coordinates via the alphanumeric
keyboard.
3. Entering the offset (distance in x, y, and z) from a
previously defined point.
4. The intersection of two lines.

Defining the Model Defining the Model


Lines
Methods of defining lines include:
1. Using two previously defined points.
2. Using one point and specifying the angle of the line with
the horizontal.
3. Using a point and making the line either normal or
tangent to a curve.
4. Using a point and making the line either parallel or
perpendicular to another line.
5. Making the line tangent to two curves.
6. Making the line tangent to a curve and parallel or
perpendicular to a line.

11
Defining the Model Defining the Model
Arcs and circles
Methods of defining arcs and circles include:
1. Specifying the center and the radius.
2. Specifying the center and a point on the circle.
3. Making the curve pass through three previously defined
points.
4. Making the curve tangent to two lines.
5. Specifying the radius and making the curve tangent to
two lines or curves.

Defining the Model Defining the Model


Surfaces
one of the methods for generating
surfaces is using a surface of revolution
formed by rotating any lines and/ or curves
around a specific axis.

QUADRIC POLYNOMIAL FUNCTIONS Defining the Model


Represents a conic section curve
2
x2 + y 1 = 0
Ellipse a 2 b2

Parabola y 2 4 a x= 0
x 2 y2 1 = 0
Hyperbola a2 b2
Ellipse

Parabola Hyperbola Circle

12
Fundamentals of Solid Modeling

The curves and the surfaces are at


notebook

Fundamentals of Solid Modeling Fundamentals of Solid Modeling

Fundamentals of Solid Modeling Fundamentals of Solid Modeling

13
Fundamentals of Solid Modeling Fundamentals of Solid Modeling

Fundamentals of Solid Modeling Fundamentals of Solid Modeling

Fundamentals of Solid Modeling Fundamentals of Solid Modeling

14
Fundamentals of Solid Modeling Fundamentals of Solid Modeling

Fundamentals of Solid Modeling


Constructive Solid Geometry

Fundamentals of Solid Modeling Constructive Solid Geometry

15
Constructive Solid Geometry Constructive Solid Geometry

Fundamentals of Solid Modeling


Constructive Solid Geometry

Fundamentals of Solid Modeling


Fundamentals of Solid Modeling

Boundary Representation Boundary Representations


A solid composed of faces, edges and vertices
Objects are rep. by a collection of bounding
faces plus topological information, which
F5
defines relationship:
Between faces, edges and vertices
F4
E8
E7
Hierarchy:
E5 F2
E6
E3 Faces are composed of edges
V4
E4 V3 Edges are composed of vertices
B-Reps are difficult to create but provide easy
V1 E2
E1 graphics interaction and display.
F3 V2
F1

16
Fundamentals of Solid Modeling Fundamentals of Solid Modeling
B.Rep. Model of Tetrahedron
B.Rep. Models

Fundamentals of Solid Modeling Fundamentals of Solid Modeling

Validity of an Engineering Part or Object


Validity of an Engineering Part or Object
Polyhedron: a part which has flat or planar polygonal surfaces
For Polyhedrons with through holes: only.

F+V = E+2+R-2H, For the validity test of solids, Eulers formula can be used.

For Polyhedrons without holes:


where R is the number of disconnected interior edge
rings in faces, (Number of faces) + (Number of vertices) = Number of edges +2
H is the number of holes in the body
F+V = E+2,

where F, E and V are number of faces, edges and vertices.

Fundamentals of Solid Modeling Fundamentals of Solid Modeling


Validity of an Engineering Part or Object
Example: Object with through-hole
Validity of an Engineering Part or Object
F+V = E+2+R-2H, Example: Eulers formula
F+V = E+2,

F = 10(6 plus additional 4)


V = 16, E = 24
R = 2 (as its through hole)
F = 6, V = 8, E = 12
H=1
6 + 8 = 12 + 2
10 + 16 = 24 +2 +2 2(1)
14 = 14 (valid object)
26 = 26

17
Fundamentals of Solid Modeling Fundamentals of Solid Modeling
Validity of an Engineering Part or Object
Validity of an Engineering Part or Object Example: Part with blind hole
Example: Part with Projection Formula check: F+V = E+2+R
F + V = E +2 +R-2H
F =11(6 + 4 +1)
V = 16, E = 24, H = 0
R = 1 (at base of projection)
F + V = E + 2 +R 2H F = 6+5 = 11
11 +16 = 24 +2 +1-2(0) V = 16, E = 24
27 = 27 R = 1(as its blind hole)
H=0
For 2 projections on a part,
11 +16 = 24 +2 +1 2(0)
F=16, V=24, E=36, R=2, H=0
16+24 = 36 +2+2 27 = 27
40 = 40

Fundamentals of Solid Modeling


Fundamentals of Solid Modeling

Validity of an Engineering Part or Object Validity of an Engineering Part or Object


Example: Projection and Through Hole Example: Projection and Blind Hole
F + V = E + 2 +R 2H F + V = E + 2 +R 2H

F=4+11 (from previous slide) =15 F=5+11 (from previous slide) =16
V=8+16=24 V=8+16=24
E=12+24=36 E=12+24=36
R=1+2 (at base of projection and top R=1+1 (at base of projection and top
of hole) of hole)
F+V = E+2+R-2H F+V = E+2+R-2H
15+24 = 36+2+3-2(1) 16+24 = 36+2+2-2(0)
39 = 39 40 = 40

Fundamentals of Solid Modeling Fundamentals of Solid Modeling

18
Fundamentals of Solid Modeling Fundamentals of Solid Modeling

Fundamentals of Solid Modeling


Entry Manipulation and Data Storage
Manipulation of the Model
Manipulation Modification of drawings, erase unwanted parts,
move some geometry around the drawing, or to copy some repeated
detail.

The facilities that typically provided for manipulation of the


model: Four groups of functions:

Entry Manipulation and Data Storage Entry Manipulation and Data Storage
Transformations 1. Those that apply the transformations of translation, rotation and
scaling to elements of the model (moving the geometry, copying
1. Object transformations the geometry to create one or more duplicate sets of entities in
Object transformations mathematical operations of the data structure.
the manipulation. 2. Those that allow the user to make changes to individual
geometric elements to trim or extend them to their intersections
with other elements.
When the entities of a CAD model are manipulated by 3. Functions for the temporary or permanent deletion of entities
moving them around, or by taking one or more from the model.
copies at different locations and orientations, we 4. Miscellaneous functions that, for example, allow entities to be
image the coordinate system to be stationary, and grouped together.
the object to move.

19
Entry Manipulation and Data Storage Entry Manipulation and Data Storage

Transformations Transformations
The main task: 2. Coordinate system transformations
Define the new object (Transformed) we image the object to be stationary, and the coordinate
How? system to move.
[P*] [P][T ]
where,
Coordinate system transformations = Viewing
[P*] is the object new coordinates matrix (new object)
[P] is the object original coordinates matrix, or points matrix
transformation.
(original object)
[T ] is the transformation matrix

Transformations Transformations
TRANSFORMATIONS TRANSFORMATIONS
CAD and Geometry The aim of these lectures and notes is to give an
The simplest CAD systems are 2D or 3D drafting tools. They understanding of what is happening within CAD
allow geometry to be created, stored and manipulated. systems.
Example: A line might be stored as two points:
By understanding how something works allows us
LP1P2(x1,y1; x2y2)
to use it more effectively.
L 1 1 1
Or in matrix notation: P x y
P2 x2 y 2
Where: P1 x1 y1 , P2 x2 y 2

The graphical representation:

Transformations Transformations
TRANSFORMATIONS TRANSFORMATIONS
CAD and Geometry
In this format it is not easy to do matrix manipulation in 2D or 3D CAD and Geometry
(which is what we want to do). Thus we want homogeneous Example: Representation of a Triangle: (in 2D ordinary
coordinates. coordinates)
P1 x1 y1
P P2 x2 y 2
Homogeneous Coordinates: Graphical representation: P3 x3 y 3
Presents a unified approach to describing geometric
transformations.

20
Transformations Transformations
Homogeneous Coordinates Homogeneous Coordinates
For instance, consider point P(2, 4) in ordinary coordinates. This Assume a 2D point lies in 3D space.
can be considered as:
P(4, 8, 2), where h=2; or P(6, 12, 3), where h=3; or P(2, 4, 1),
where h=1 in homogeneous space.
In general, P(m, n, h) in homogeneous space is P(m/h, n/h, 1) in
ordinary coordinates.
Thus, the triangle in 2d space can be represented in
homogeneous coordinates as:
x1 y1 1
Any 2D point can be represented in such a 3D space as:
P x 2 y2 1
P(x, y, z) = P(hx1, hy1, hz)
x3 y3 1

Why? To help with transformations. That is, along a ray from the origin (called homogeneous space).

Transformations Transformations
TRANSFORMATIONS
Types of transformations
Transformation is the backbone of computer graphics, enabling
1. Modeling Transformation/ Object Transformation us to manipulate the shape, size, and location of the
This transformation alters the coordinate values of the object. Basic object.
operations are scaling, translation, rotation and combination of one It can be used to effect the following changes in a geometric
or more of these basic transformations. object:
Object transformation = Move (transform) an object in the 3D space. 1. Change the location
2. Visual/ Viewing Transformation (Coordinate System 2. Change the shape
Transformation)
3. Change the size
In this transformation there is no change in either the geometry or the
coordinates of the object. A copy of the object is placed at the 4. Rotate
desired sight, without changing the coordinate values of the object. 5. Copy
Coordinate system transformation = Move (transform) the coordinate 6. Generate a surface from a line
system. View the objects from the new coordinate system. 7. Generate a solid from a surface
8. Animate the object

Transformations Transformations
Examples Examples

21
Transformations Transformations
Basic Modeling/Object Transformations Examples
Scaling, translation, and Rotation. Coordinate System Transformation
Other transformations, which are modification or
combination of any of the basic transformations,
are Shearing, Mirroring, Copy, etc.

Transformation can be expressed as:


[P*] [P][T ]
where, [P*] is the new coordinates matrix
[P] is the original coordinates matrix, or points matrix
[T ]
is the transformation matrix

Transformations Transformations
Scaling Scaling

P( x, y ) P * ( x*, y*)
x* xs x , y* ys y

Or in matrix form:
s x 0 0
P* x * y * 1 x y 1 0 sy
0 xs x ys y 1
0 0 1

This is object scaling about the origin.

If sx = sy uniform scaling Magnify command

Transformations Transformations
Scaling Scaling
2. Non-Uniform Scaling 1. Uniform Scaling
Scaling transformation matrix in 3d ordinary coordinates: For uniform scaling, the scaling transformation matrix is given as:
sx 0 0 In ordinary 3D coordinate system:
[Ts ] 0 sy 0 s 0 0
0 0 sz [Ts ] 0 s 0
0 0 s
In 3d Homogeneous Coordinates:
sx 0 0 0
0 sy 0 0
[Ts ] Here, s is the scale factor
0 0 sz 0 s 0 0 0
0 s 0 0
0 0 0 1
In homogeneous 3D coordinates: [Ts ]
0 0 s 0
where, s x , s y , s z , are the scale factors for the x, y, and z coordinates
of the object. 0 0 0 1

22
Transformations Transformations
The scaling matrix is:
2 0 0 0
Example: If the triangle A(1, 1), B(2, 1), C(1, 3) is
0 2 0 0 scaled by a factor 2, find the new coordinates of
[Ts ]
0 0 2 0 the triangle.

0 0 0 1

The new points matrix can be evaluated by the equation:


Solution:
2 2 0 1
[ P*] [ P][T ] [P*] 4 2 0 1
Writing the points (original) matrix in homogeneous 3D
2 6 0 1 coordinates, we have

1 1 0 1
[P] 2 1 0 1
1 3 0 1

Transformations Transformations
Translation Transformation Translation Transformation
x* x x
y* y y
Or in matrix form (homogeneous coordinates):
1 0 0
P* x * y * 1 x y 1 0 1 0
x y 1

You can now see that homogeneous coordinates are needed


for translation transformation.
This is what the Move command does in CAD systems.

Transformations Transformations
Translation Transformation Translation Transformation
Example: Translate the rectangle (2, 2), (2, 8), (10, 8), (10, 2) 2 units In translation, every point on an object translates exactly the
along x-axis and 3 units along y-axis. same distance. The effect of translation transformation is
Solution: Using the matrix equation for translation, we have: that the original coordinate values increase or decrease by
the amount of the translation along the x, y, and z-axes.
[ P*] [ P ][Tt ]
The translation transformation matrix has the form:
In 3D Homogeneous Coordinates: 1 0 0 0
Substituting the numbers, we get 0 1 0 0
[Tt ]
0 0 1 0
2 2 0 1 1 0 0 0 4 5 0 1
2 8 0 1 0 1 0 0 4 11 0 1 x y z 1
[P*] where x, y, z are the values of translation in the x, y, and z direction,
10 8 0 1 0 0 1 0 12 11 0 1
respectively.
10 2 0 1 2 3 0 1 12 5 0 1
For translation transformation, the matrix equation is:

Note that the resultant coordinates are equal to the original x and y
values plus the 2 and 3 units added to these values, respectively. [ P*] [ P ][Tt ]

23
Transformations Transformations
Rotation Rotation
Derivation of the Rotation Transformation Matrix We will first consider rotation about the z-axis, which passes through the
origin (0, 0, 0), since it is the simplest transformation for understanding the
rotation transformation. Rotation about an arbitrary axis, other than an
axis passing through the origin, requires a combination of three or more
transformations.
When an object is rotated about the z-axis, all the points on the object
rotate in circular arc, and the center of the arc lies at the origin. Similarly,
rotation of an object about an arbitrary axis has the same relationship with
the axis, i.e., all the points on the object rotate in circular arc, and the
center of rotation lies at the given point through which the axis is passing.

Original coordinates of point P:

x r cos , y r sin

Transformations Transformations
Rotation Rotation
Derivation of the Rotation Transformation Matrix
Derivation of the Rotation Transformation Matrix
The new coordinates:
In general, the points matrix and the transformation matrix are re-written
as (For 2D objects): [In Homogeneous Coordinates]
x* r cos( ), y* r sin( )
cos sin 0 0
sin Using the trigonometric relations, we get:
cos 0 0
x * y * 0 1 x y 0 1 cos( ) cos cos sin sin
0 0 1 0
sin( ) sin cos cos sin
0 0 0 1
OR:
We get:
x* r (cos cos sin sin ) x cos y sin
cos sin 0
y* r (cos sin sin cos ) x sin y cos
x * y * 1 x y 1 sin cos 0
0 0 1 cos sin
In matrix form:
x * y * x y
sin cos

Transformations Transformations
Rotation Rotation
Derivation of the Rotation Transformation Matrix Derivation of the Rotation Transformation Matrix

Transformation matrix for rotation about y-axis: For 3D geometry: Rotation about z-axis

cos sin 0 0
cos 0 sin 0 sin cos 0 0
0 x * z * 1 x z 1
0
y* y
1 0 0 0 1 0
TR y
sin 0 cos 0 0 0 0 1

0 0 0 1

24
Transformations Transformations
Rotation Rotation
Derivation of the Rotation Transformation Matrix Derivation of the Rotation Transformation Matrix
Translation matrix for rotation about x-axis:
For use with 2D geometry:

[ P] x y 0 1, [ P*] x * y * 0 1
1 0 0 0
For use with 3D geometry: 0 cos sin 0
TR x
0 sin cos 0
[ P] x y z 1, [ P*] x * y * z * 1
0 0 0 1

This is what the Rotate command does in CAD system.

Transformations Transformations
Rotation of an Object about an Arbitrary Axis Rotation of an Object about an Arbitrary Axis
Thus, the rotation of an object about an arbitrary axis, involves Rotation of a geometric model about an arbitrary axis, other than
three steps: any of the coordinate axes, involves several rotational and
Step 1: Translate the fixed axis so that it coincides with the z-axis translational transformations. When we rotate an object
Step 2: Rotate the object about the axis about the origin (in 2D), we in fact rotate it about z-axis.
Step 3: Translate the fixed axis back to the original position Every point on the object rotates along a circular path, with
(reverse translation) the center of rotation at the origin. If we wish to rotate an
object about an arbitrary axis, which is perpendicular to the
Note: When the fixed axis is translated, the object is also xy-plane, we will have to first translate the axis to the origin
translated. The axis and the object go through all the and then rotate the model, and finally, translate so that the
transformations simultaneously. axis of rotation is restored to its initial position.

Transformations
Rotation of an Object about an Arbitrary Axis Rotation of an Object about an Arbitrary Axis
Example:
Rotate the rectangle (0, 0), (2, 0), (2, 2), (0, 2) shown
below, 30o ccw about its centroid and find the
new coordinates of the rectangle.

25
Rotation of an Object about an Arbitrary Axis Rotation of an Object about an Arbitrary Axis

Transformations Transformations
Rotation about an Arbitrary Point (in xy-plane) Rotation about an Arbitrary Point (in xy-plane)
Solution: We first translate the point (3, 2) to the origin, then rotate the rectangle In order to rotate an object about a fixed point, the point is first moved
about the origin, and finally, translate back so that the original point is (translated) to the origin. Then, the object is rotated around the
restores to its original position (3, 2). The new coordinates of the rectangle origin. Finally, it is translated back so that the fixed point is
are found as follows:
restored to its original position. For rotation of an object about an
[ P*] [ P][Tt ][Tr ][Tt ] arbitrary point, the sequence of the required transformation
1 1 0 1 1 0 0 0 0.866 0.5 0 0 1 0 0 0
matrices and the condensed matrix is given as:
2 1 0 1 0 0 0 0.5 0.866 0 0 0 1 0 0

2 3 0 1 0
1
0 1 0 0 0 1 0 0 0 1 0
[Tcond ] [Tt ][Tr ][T t ]

1 3 0 1 3 2 0 1 0 0 0 1 3 2 0 1 OR:
1.77 0.13 0 1 1 0 0 0 cos sin 0 0 1 0 0 0
0.77 1.87 0 1 0 1 0 0 sin cos 0 0 0 1 0 0

[Tcond ]
1.63 2.37 0 1
0 0 1 0 0 0 1 0 0 0 1 0
2.63 0.63 0 1
x y 0 1 0 0 0 1 x y 0 1
These are the new coordinates of the rectangle after the rotation.
where is the angle of rotation and the point (x, y) lies in the xy-plane.

Transformations Transformations
Mirroring (Reflection) Mirroring (Reflection)
In modeling operations, one frequently used operation is mirroring an
object. Mirroring is a convenient method used for copying an object
1 0 0 0 while preserving its features. The mirror transformation is a special
0 1 0 0 case of a negative scaling, as will be explained below.
[ P*] 2 2 0 1 2 2 0 1 Let us say, we want to mirror the point A(2, 2) about the x-axis (i.e.,
0 0 1 0
xz-plane). The point matrix [P*]=[2 -2] can be obtained with the
0 0 0 1 matrix transformation given below:

The transformation matrix above is a special case of non-uniform scaling


with sx=1 and sy=-1 .

26
Transformations Transformations
Mirroring about an Arbitrary Plane Mirroring (Reflection)
Transformation Matrix for Mirroring about x-axis:
If mirroring is required about an arbitrary plane, other
than one defined by the coordinate axes, translation 1 0 0 0
0 1 0 0
and/or rotation can be used to align the given plane Tm x
with one of the coordinate planes. After mirroring, 0 0 1 0

translation or rotation must be done in reverse order to 0 0 0 1
restore the original geometry of the axis. Transformation Matrix for Mirroring about y-axis:

We will use the figure shown below, to illustrate the 1 0 0 0


procedure for mirroring an object about an arbitrary 0 1 0 0
Tm y
plane. We will mirror the given rectangle about a plane 0 0 1 0

passing through the line AB and perpendicular to xy- 0 0 0 1
plane.

Transformations Transformations
Mirroring about an Arbitrary Plane Mirroring about an Arbitrary Plane

It should be noted that in each of the


transformations, the plane and the rectangle
have a fixed relationship, i.e., when we move
the plane (or line AB), the rectangle also moves
with it.
Note: We are using line AB to represent the
plane, which passes through it. Mirroring can be
done only about a plane, and not about a line.

Transformations Transformations
Coordinate System Transformation Mirroring about an Arbitrary Plane
Coordinate frame moves to a new location. Procedure for mirroring the rectangle about the plane:
Step 1: Translate the line AB (i.e., the plane) such that it passes through
the origin, as shown by the dashed line.
Step 2: Next, rotate the line about the origin (or the z-axis) such that it
coincides with x or y axes (we will use the x-axis).
Step 3: Mirror the rectangle about the x-axis.
Step 4: Rotate the line back to its original orientation.
Step 5: Translate the line back to its original position
The new points matrix, in terms of the original points matrix and the five
transformation matrices is given as:
[P*] = [P][Tt][Tr][Tm][T-r][T-t]
Where, the subscripts t, r, and m represent the translation, rotation, and
mirror operations, respectively.
Note: A negative sign is used in the subscripts to indicate a reverse
transformation.

27
Transformations Transformations
Coordinate System Transformation Coordinate System Transformation
P x y z
[ P*] x a y b z c 1
The origin has been translated (moved) from (0, 0, 0) to (a, b, c)
Or:
Note: The sign in the T matrix need to be changed
For coordinate system: x a, y b, z c

For the object: x a, y b, z c


[P*] [P][T ]

1 0 0 0
0 1 0 0
Tt
0 0 1 0

a b c 1

Transformations Transformations
Example: Coordinate Transformation Example: Coordinate Transformation
If the coordinate system has been rotated about z-axis by -30o, then
translated to [a b c], what is the coordinates of the point
Solution:
[x y z] in the new coordinate system?
cos 30o sin 30o 0 0 1 0 0 0

sin 30o cos 30o 0 0 0 1 0 0
[ P*] x y z 1
0 0 1 0 0 0 1 0

0 0 0 1 a b c 1
x * y * z * 1

Transformations Transformations
Coordinate system transformation-Viewing Coordinate system transformation-Viewing

We need to understand that our CAD model is defined


within a world or global coordinate system (WCS),
usually 3D, but we view it through a flat screen
which will have its own device coordinate system
(DCS).

This is usually done through a neutral stage or a


virtual or normalized coordinate system (NCS).
Thus we map as follows:

28
Transformations Transformations
Coordinate system transformation-Viewing Coordinate system transformation-Viewing
We will not see all the component at one time. Thus
we need to define a window.

Transformations Transformations
Coordinate system transformation-Viewing Coordinate system transformation-Viewing
When the Aspect Ratio (AR) of both is equal no We can map this to the viewport by:
distortion (scaling occurs).
xv xv min x x w min
w
x max x min xv max xv min x w max x w min
AR And
y max y min
y v y v min y w y w min

y v max y v min y w max y w min
By mapping a smaller window on the viewport, we can
get a zooming effect.

29

Вам также может понравиться