cad/cam - philadelphia university › academics › inaimi › uploads › cad cam... ·...
TRANSCRIPT
1
CAD/CAM
Dr. Ibrahim Al-Naimi
Chapter two
Computer Aided Design
(CAD)
2
The information-processing cycle in a typical
manufacturing firm.
PRODUCT DESIGN AND CAD
Product design is a critical function in the production system. The quality of the product design (i.e., how well the design department
single most does its job) is probably the important factor in determining the commercial
. If the success and societal value of a productproduct design is poor, no matter how well it is manufactured. If the product design is good, there is still the question of whether the product can be produced at sufficiently low cost to contribute to the company's profits and success. Let us begin our discussion of product design by describing the general process of design.
3
The Design Process
The process of designing something is
characterized as an interactive procedure, which
consists of six identifiable steps or phases:
1. Recognition of need.
2. Definition of problem.
3. Synthesis.
4. Analysis and optimization.
5. Evaluation.
6. Presentation.
4
The Design Processinvolves the realization by Recognition of need
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
Problem definitiondesign by an engineer.
involves a thorough specification of the item to
be designed. This specification includes the
physical characteristics, function, cost, quality,
and operating performance.
The Design Process
are closely related and Synthesis and analysishighly interactive in the design process. Consider the development of a certain product design: Each of the subsystems of the product must be conceptualized by the designer, analyzed, improved through this analysis procedure, redesigned, analyzed again, and so on. The process is repeated until the design has been optimized within the constraints imposed on the designer. The individual components are then synthesized and analyzed into the final product in a similar manner.
5
The Design Process
is concerned with measuring the Evaluationdesign against the specifications established in the problem definition phase. This evaluation often requires the fabrication and testing of a prototype model to assess operating performance, quality, reliability, and other criteria. The final phase in the design procedure
Presentationis the presentation of the design. is concerned with documenting the design by means of drawings, material specifications, assembly lists, and so on. In essence, documentation means that the design data base is created.
Application of Computers in Design
is defined aided design (CAD)-Computeras any design activity that involves the effective use of the computer to create, modify, analyze, or document an engineering design. CAD is most commonly associated with the use of an interactive computer graphics system, referred to as a CAD system.
There are several good reasons for using a CAD system to support the engineering design function:
6
Application of Computers in Design
Fundamental reasons for implementing CAD
system:
1. To increase the productivity of the designer.
This is accomplished by helping the
designer to conceptualize the product and
its components. In turn, this helps reduce
the time required by the designer to
synthesize, analyze, and document the
design.
Application of Computers in Design
Fundamental reasons for implementing CAD
system:
2. To improve the quality of design.
The use of a CAD system with appropriate
hardware and software capabilities permits
the designer to do a more complete
engineering analysis and to consider a
larger number and variety of design
alternatives. The quality of the resulting
design is thereby improved.
7
Application of Computers in Design
Fundamental reasons for implementing CAD
system:
3. To improve documentation
The graphical output of a CAD system
results in better documentation of the
design than what is practical with manual
drafting. The engineering drawings are
superior, and there is more standardization
among the drawings, fewer drafting errors,
and greater legibility.
Application of Computers in Design
Fundamental reasons for implementing CAD
system:
4. To create a data base for manufacturing.
In the process of creating the
documentation for the product design
(geometric specification of the product,
dimensions of the components, materials
specifications, bill of materials, etc.), much
of the required data base to manufacture
the product is also created.
8
Application of Computers in Design
The design related tasks performed by CAD
system are:
1. Geometric modeling.
2. Engineering analysis.
3. Design review and evaluation.
4. Automated drafting.
9
Geometric Modeling involves the use of a CAD Geometric modeling
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
an image of the model on a displayCAD system to graphics terminal and to perform certain operations
creating on the model. These operations include 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
. These capabilities permit the image, and so forthdesigner to construct a model of a new product (or its components) or to modify an existing model.
Geometric Modeling There are various types of geometric models used in CAD.
-One classification distinguishes between twoD) -3dimensional (-D) and three-2dimensional (
dimensional models are best utilized for -Twomodels.design problems in two dimensions, such as flat objects and layouts of buildings. In the first CAD systems developed in the early 1970s, 2-D systems were used principally as automated drafting systems. They were often used for 3-D objects, and it was left to the designer or draftsman to properly construct the various views of the object. Three-dimensional CAD systems are capable of modeling an object in three dimensions. The operations and transformations on the model are done by the system in three dimensions according to user instructions. This is helpful in conceptualizing the object since the true 3-D model can be displayed in various views and from different angles.
10
Geometric Modeling Geometric models in CAD can also be classified
frame models or solid -either wireas being uses frame model-wireA models.
interconnecting lines (straight line segments) to depict the object as illustrated in the following
of complicated frame models-WireFigure (a). geometries can become somewhat confusing because all of the lines depicting the shape of the object are usually shown, even the lines representing the other side of the object. Techniques are available for removing these so called hidden lines, but even with this improvement, wire-frame representation is still often inadequate.
Geometric Modeling are a more recent development in Solid models
, Figure solid modelinggeometric modeling. In (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.
11
Engineering Analysis
After a particular design alternative has been developed, some form of engineering analysis often must be performed as part of the design process. The analysis
strain calculations, heat -stressmay take the form of The transfer analysis, or dynamic simulation.
computations are often complex and time consuming, and before the advent of the digital computer, these analyses were usually greatly simplified or even omitted
The availability of software for in the design procedure.engineering analysis on a CAD system greatly increases the designer's ability and willingness to perform a more thorough analysis of a proposed design. The term
is often used for aided engineering (CAE)-computerengineering analyses performed by computer. Examples of engineering analysis software in common use on CAD systems include:
12
Engineering Analysis
• Mass properties analysis, which
involves the computation of such features
of a solid object as its volume, surface
area, weight, and center of gravity. It is
especially applicable in mechanical
design.
• Interference checking
• Tolerance analysis
Engineering Analysis• Finite element analysis. Software for finite element
analysis (FEA), also known as finite element modeling(FEM), is available for use on CAD systems to aid in stress strain, heat transfer, fluid flow, and other engineering computations. Finite element analysis is a numerical analysis technique for determining approximate solutions to physical problems described by differential equations that are very difficult or impossible to solve. In FEA, the physical object is modeled by an assemblage of discrete interconnected nodes (finite elements), and the variable of interest (e.g., stress, strain, temperature) in each node can be described by relatively simple mathematical equations. By solving the equations for each node, the distribution of values of the variable throughout the physical object is determined.
13
Engineering Analysis
• Kinematic and dynamic analysis. Kinematic
analysis involves the study of the operation of
mechanical linkages to analyze their motions. A
typical kinematic analysis consists of specifying
the motion of one or more driving members of
the subject linkage, and the resulting motions of
the other links are determined by the analysis
package. Dynamic analysis extends kinematic
analysis by including the effects of the mass of
each linkage member and the resulting
acceleration forces as well as any externally
applied forces.
Design Evaluation and Review
Design evaluation and review procedures can be augmented by CAD. Some of the CAD features that are helpful in evaluating and reviewing a proposed design include:
• Automatic dimensioning routines that determine precise distance measures between surfaces on the geometric model identified by the user.
• 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.
14
27
Standards for dimensioning
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 the basic rules that should be observed in dimensioning any drawing:
1. Show enough dimensions so that the intended sizes and shapes can be determined without calculating or assuming any distances.
2. State each dimension clearly, so that it can be interpreted in only one way.
3. Show the dimensions between points, lines, or surfaces that have a necessary and specific relation to each other or that control the location of other components or mating parts.
Standards for dimensioning
4. Select and arrange dimensions to avoid
accumulations of tolerances that may
permit various interpretations and cause
unsatisfactory mating of parts and
failure in use.
5. Show each dimension only once.
6. Where possible, dimension each feature
in the view where it appears in profile,
and where its true shape appears.
15
Conventional tolerance
Since it is impossible to produce the exact dimension specified,
a tolerance is also used to show the acceptable variation in a
dimension. The higher the quality a product has, the smaller the
tolerance value specified. Tighter tolerances are translated into
more careful production procedures and more precise inspection.
There are two types of tolerances: bilateral tolerance and unilateral
tolerance (as shown in the following Figure). Unilateral tolerances,
such as , specify dimensional variation from the basic size
(i.e., decrease) in one direction in relation to the basic size; for
example,
The basic location where most dimension lines originate is the
reference location (datum). For machining, the reference location
provides the base from which all other measurements are taken. By
stating tolerance from a reference location, cumulative errors can be
eliminated.
00.0
05.000.1
00.195.000.1 00.0
05.0
Conventional tolerance
16
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.
Conventional toleranceSurface control symbols
17
Dimensioning
TOLERANCE
18
TOLERANCE
1. Check that the tolerance & dimension specifications are reasonable
for assembly.
2. Check there is no over or under specification.
TOLERANCE
19
TOLERANCE
TOLERANCE GRAPH
20
CAD Systems Architecture
Modeling objects
The model of an engineering object consists of geometry, topology, and auxiliary information. Geometry includes points, lines, circles, planes, cylinders and other surfaces. It defines the basic shape characteristics. Topology represents the relationships of the geometry of an object. In addition to its shape, an engineering object also possesses some other attributes. Dimensions, tolerances, and surface finish are some important attributes.
CAD Systems Architecture
Functions of CAD Systems
CAD is a tool not only to represent an
engineering model, but also to manipulate it. To
construct or display a model, geometric
transformations and view transformations are
needed.
21
Modeling
Many properties of products have to be
modeled, including form, dimension,
tolerance and structure. In all of these areas
geometry, images and spatial manipulation are
very important. For this reason, CAD is
founded on computational geometry and
computer graphics.
Defining the ModelRepresentation of Models
There are two types of models:
Models of form typically represented by drawings of components and their arrangement in assemblies.
Models of structure normally represented by diagrams that show the components of a system and how they are connected.
22
Defining the Model
The representation of form using drawings
The technique of representing three-dimensional forms in two-dimensional space by means of engineering drawings -on paper or on a computer screen- is formally known as descriptive geometry.
Defining the ModelThe representation of structure using diagrams
In engineering diagrams the logical or physical structure of a system, in terms of the assembly of the primitive parts and the relationship between these, is shown by a series of symbols joined by connections. The rules for the symbols, and for the connections, are governed by conventions that have been established in standards.
23
Defining the ModelExamples of Electrical and Fluid Power Symbols
Defining the ModelBlock Diagrams
• 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 diagrammay be most appropriate.
• As a design is prepared for construction and manufacture, detailed wiring or piping diagrams are required.
24
Defining the ModelBlock diagram of injection system
Defining the ModelTop-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.
25
Defining the ModelExample: Top-Down Design “A hierarchical
arrangement of diagrams”
Defining the Model
computer representation of drawings and 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.
26
Defining the ModelBasic geometry
A component must be modeled before it can be drawn.
Defining the ModelMethods 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.
27
Defining the Model
Defining the ModelLines
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.
28
Defining the Model
Defining the ModelArcs 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.
29
Defining the Model
Defining the Model
The curves and the surfaces should be
discussed at notebook
30
Fundamentals of Solid Modeling
Fundamentals of Solid Modeling
31
Fundamentals of Solid Modeling
Fundamentals of Solid Modeling
32
Fundamentals of Solid Modeling
Fundamentals of Solid Modeling
33
Fundamentals of Solid Modeling
Fundamentals of Solid Modeling
34
Fundamentals of Solid Modeling
Fundamentals of Solid Modeling
35
Fundamentals of Solid Modeling
Fundamentals of Solid Modeling
36
Fundamentals of Solid Modeling
Constructive Solid Geometry
37
Fundamentals of Solid Modeling
Constructive Solid Geometry
38
Fundamentals of Solid Modeling
Constructive Solid Geometry
39
Constructive Solid Geometry
Constructive Solid Geometry
40
Fundamentals of Solid Modeling
Fundamentals of Solid Modeling
Boundary Representations
Objects are rep. by a collection of bounding faces plus topological information, which defines relationship:
Between faces, edges and vertices
Hierarchy:
Faces are composed of edges
Edges are composed of vertices
B-Reps are difficult to create but provide easy graphics interaction and display.
41
Fundamentals of Solid Modeling
Boundary Representation
A solid composed of faces, edges and vertices
E1F3
E2
E3
E4
E5E6
E7E8
V1
V2
V3V4
F1
F2
F4
F5
Fundamentals of Solid ModelingB.Rep. Models
42
Fundamentals of Solid ModelingB.Rep. Model of Tetrahedron
Fundamentals of Solid Modeling
Validity of an Engineering Part or Object
Polyhedron: a part which has flat or planar polygonal surfaces
only.
For the validity test of solids, Euler’s formula can be used.
For Polyhedrons without holes:
(Number of faces) + (Number of vertices) = Number of edges +2
F+V = E+2,
where F, E and V are number of faces, edges and vertices.
43
Fundamentals of Solid Modeling
Validity of an Engineering Part or Object
For Polyhedrons with through – holes:
F+V = E+2+R-2H,
where R is the number of disconnected interior edge
rings in faces,
H is the number of holes in the body
Fundamentals of Solid Modeling
Validity of an Engineering Part or Object
Example: Euler’s formula
F+V = E+2,
F = 6, V = 8, E = 12
6 + 8 = 12 + 2
14 = 14 (valid object)
44
Fundamentals of Solid Modeling
Validity of an Engineering Part or Object
Example: Object with through-hole
F+V = E+2+R-2H,
F = 10(6 plus additional 4)
V = 16, E = 24
R = 2 (as its through hole)
H = 1
10 + 16 = 24 +2 +2 –2(1)
26 = 26
Fundamentals of Solid Modeling
Validity of an Engineering Part or Object
Example: Part with blind hole
Formula check: F+V = E+2+R
F = 6+5 = 11
V = 16, E = 24
R = 1(as its blind hole)
H = 0
11 +16 = 24 +2 +1 – 2(0)
27 = 27
45
Fundamentals of Solid Modeling
Validity of an Engineering Part or Object
Example: Part with Projection
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
11 +16 = 24 +2 +1-2(0)
27 = 27
For 2 projections on a part,
F=16, V=24, E=36, R=2, H=0
16+24 = 36 +2+2
40 = 40
Fundamentals of Solid Modeling
Validity of an Engineering Part or Object
Example: Projection and Blind Hole
F + V = E + 2 +R –2H
F=5+11 (from previous slide) =16
V=8+16=24
E=12+24=36
R=1+1 (at base of projection and top
of hole)
F+V = E+2+R-2H
16+24 = 36+2+2-2(0)
40 = 40
46
Fundamentals of Solid Modeling
Validity of an Engineering Part or Object
Example: Projection and Through Hole
F + V = E + 2 +R –2H
F=4+11 (from previous slide) =15
V=8+16=24
E=12+24=36
R=1+2 (at base of projection and top
of hole)
F+V = E+2+R-2H
15+24 = 36+2+3-2(1)
39 =39
Fundamentals of Solid Modeling
47
Fundamentals of Solid Modeling
Fundamentals of Solid Modeling
48
Fundamentals of Solid Modeling
Fundamentals of Solid Modeling
49
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
1. Those that apply the transformations of translation, rotation and
scaling to elements of the model (moving the geometry, copying
the geometry to create one or more duplicate sets of entities in
the data structure.
2. Those that allow the user to make changes to individual
geometric elements to trim or extend them to their intersections
with other elements.
3. Functions for the temporary or permanent deletion of entities
from the model.
4. Miscellaneous functions that, for example, allow entities to be
grouped together.
50
Entry Manipulation and Data Storage
Transformations
1. Object transformations
Object transformations mathematical operations of
the manipulation.
When the entities of a CAD model are manipulated by
moving them around, or by taking one or more
copies at different locations and orientations, we
image the coordinate system to be stationary, and
the object to move.
Entry Manipulation and Data Storage
Transformations
2. Coordinate system transformations
we image the object to be stationary, and the coordinate
system to move.
Coordinate system transformations = Viewing
transformation.
51
Entry Manipulation and Data Storage
TransformationsThe main task:
Define the new object (Transformed)
How?
where,
is the object new coordinates matrix (new object)
is the object original coordinates matrix, or points matrix
(original object)
is the transformation matrix
]][[*][ TPP
*][P
][P
][T
Transformations
TRANSFORMATIONS• The aim of these lectures and notes is to give an
understanding of what is happening within CAD
systems.
• By understanding how something works allows us
to use it more effectively.
52
Transformations
TRANSFORMATIONSCAD and Geometry
The simplest CAD systems are 2D or 3D drafting tools. They
allow geometry to be created, stored and manipulated.
Example: A line might be stored as two points:
L→P1P2→(x1,y1; x2y2)
Or in matrix notation:
Where:
The graphical representation:
22
11
2
1
yx
yx
P
PL
222111 , yxPyxP
Transformations
TRANSFORMATIONSCAD and Geometry
Example: Representation of a Triangle: (in 2D ordinary
coordinates)
Graphical representation:
33
22
11
3
2
1
yx
yx
yx
P
P
P
P
53
Transformations
TRANSFORMATIONSCAD and Geometry
In this format it is not easy to do matrix manipulation in 2D or 3D
(which is what we want to do). Thus we want homogeneous
coordinates.
Homogeneous Coordinates:
Presents a unified approach to describing geometric
transformations.
:
TransformationsHomogeneous Coordinates
Assume a 2D point lies in 3D space.
Any 2D point can be represented in such a 3D space as:
P(x, y, z) = P(hx1, hy1, hz)
That is, along a ray from the origin (called homogeneous space).
:
54
TransformationsHomogeneous Coordinates
For instance, consider point P(2, 4) in ordinary coordinates. This
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:
Why? To help with transformations.
1
1
1
33
22
11
yx
yx
yx
P
TransformationsTRANSFORMATIONS
Transformation is the backbone of computer graphics, enabling
us to manipulate the shape, size, and location of the
object.
It can be used to effect the following changes in a geometric
object:
1. Change the location
2. Change the shape
3. Change the size
4. Rotate
5. Copy
6. Generate a surface from a line
7. Generate a solid from a surface
8. Animate the object
55
Transformations
Types of transformations1. Modeling Transformation/ Object Transformation
This transformation alters the coordinate values of the object. Basic
operations are scaling, translation, rotation and combination of one
or more of these basic transformations.
Object transformation = Move (transform) an object in the 3D space.
2. Visual/ Viewing Transformation (Coordinate System
Transformation)
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
desired sight, without changing the coordinate values of the object.
Coordinate system transformation = Move (transform) the coordinate
system. View the objects from the new coordinate system.
Transformations
Examples
56
Transformations
Examples
Transformations
Examples
Coordinate System Transformation
57
Transformations
Basic Modeling/Object Transformations
Scaling, translation, and Rotation.
Other transformations, which are modification or
combination of any of the basic transformations,
are Shearing, Mirroring, Copy, etc.
Transformation can be expressed as:
where, is the new coordinates matrix
is the original coordinates matrix, or points matrix
is the transformation matrix
]][[*][ TPP
*][P
][P
][T
TransformationsScaling
58
Transformations
Scaling
Or in matrix form:
This is object scaling about the origin.
If sx = sy → → uniform scaling → → Magnify command
yx ysyxsx
yxPyxP
*,*
*)*,(*),(
1100
00
00
11*** yxy
x
ysxss
s
yxyxP
TransformationsScaling
1. Uniform Scaling
For uniform scaling, the scaling transformation matrix is given as:
• In ordinary 3D coordinate system:
Here, s is the scale factor
• In homogeneous 3D coordinates:
s
s
s
Ts
00
00
00
][
1000
000
000
000
][s
s
s
Ts
59
TransformationsScaling
2. Non-Uniform Scaling
• Scaling transformation matrix in 3d ordinary coordinates:
• In 3d Homogeneous Coordinates:
where, , are the scale factors for the x, y, and z coordinates
of the object.
z
y
x
s
s
s
s
T
00
00
00
][
1000
000
000
000
][z
y
x
ss
s
s
T
zyx , sss ,
Transformations
Example: If the triangle A(1, 1), B(2, 1), C(1, 3) is
scaled by a factor 2, find the new coordinates of
the triangle.
Solution:
Writing the points (original) matrix in homogeneous 3D
coordinates, we have
1031
1012
1011
][P
60
TransformationsThe scaling matrix is:
The new points matrix can be evaluated by the equation:
1000
0200
0020
0002
][ sT
]][[*][ TPP
1062
1024
1022
*][P
Transformations
Translation Transformation
61
Transformations
Translation Transformation
Or in matrix form (homogeneous coordinates):
You can now see that homogeneous coordinates are needed
for translation transformation.
This is what the Move command does in CAD systems.
yyy
xxx
*
*
1
010
001
11***
yx
yxyxP
Transformations
Translation Transformation
In translation, every point on an object translates exactly the
same distance. The effect of translation transformation is
that the original coordinate values increase or decrease by
the amount of the translation along the x, y, and z-axes.
The translation transformation matrix has the form:
In 3D Homogeneous Coordinates:
where are the values of translation in the x, y, and z direction,
respectively.
For translation transformation, the matrix equation is:
1
0100
0010
0001
][
zyx
Tt
]][[*][ tTPP
zyx ,,
62
Transformations
Translation TransformationExample: Translate the rectangle (2, 2), (2, 8), (10, 8), (10, 2) 2 units
along x-axis and 3 units along y-axis.
Solution: Using the matrix equation for translation, we have:
Substituting the numbers, we get
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.
]][[*][ tTPP
10512
101112
10114
1054
1032
0100
0010
0001
10210
10810
1082
1022
*][P
TransformationsRotation
• 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.
63
TransformationsRotation
Derivation of the Rotation Transformation Matrix
Original coordinates of point P:
sin ,cos ryrx
TransformationsRotation
Derivation of the Rotation Transformation Matrix
The new coordinates:
Using the trigonometric relations, we get:
We get:
In matrix form:
)sin(* ),cos(* ryrx
cossin)cossinsin(cos*
sincos)sinsincos(cos*
yxry
yxrx
cossin
sincos** yxyx
sincoscossin)sin(
sinsincoscos)cos(
64
TransformationsRotation
Derivation of the Rotation Transformation Matrix
In general, the points matrix and the transformation matrix are re-written
as (For 2D objects): [In Homogeneous Coordinates]
OR:
1000
0100
00cossin
00sincos
1010**
yxyx
100
0cossin
0sincos
11**
yxyx
TransformationsRotation
Derivation of the Rotation Transformation Matrix
• For 3D geometry: Rotation about z-axis
1000
0100
00cossin
00sincos
11***
zyxzyx
65
TransformationsRotation
Derivation of the Rotation Transformation Matrix
• Transformation matrix for rotation about y-axis:
1000
0cos0sin
0010
0sin0cos
yRT
TransformationsRotation
Derivation of the Rotation Transformation Matrix
• Translation matrix for rotation about x-axis:
1000
0cossin0
0sincos0
0001
xRT
66
TransformationsRotation
Derivation of the Rotation Transformation Matrix
• For use with 2D geometry:
• For use with 3D geometry:
This is what the Rotate command does in CAD system.
10***][ ,10][ yxPyxP
1****][ ,1][ zyxPzyxP
TransformationsRotation of an Object about an Arbitrary Axis
Rotation of a geometric model about an arbitrary axis, other than
any of the coordinate axes, involves several rotational and
translational transformations. When we rotate an object
about the origin (in 2D), we in fact rotate it about z-axis.
Every point on the object rotates along a circular path, with
the center of rotation at the origin. If we wish to rotate an
object about an arbitrary axis, which is perpendicular to the
xy-plane, we will have to first translate the axis to the origin
and then rotate the model, and finally, translate so that the
axis of rotation is restored to its initial position.
67
TransformationsRotation of an Object about an Arbitrary Axis
Thus, the rotation of an object about an arbitrary axis, involves
three steps:
Step 1: Translate the fixed axis so that it coincides with the z-axis
Step 2: Rotate the object about the axis
Step 3: Translate the fixed axis back to the original position
(reverse translation)
Note: When the fixed axis is translated, the object is also
translated. The axis and the object go through all the
transformations simultaneously.
TransformationsRotation 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.
68
Rotation of an Object about an Arbitrary Axis
Rotation of an Object about an Arbitrary Axis
69
Rotation of an Object about an Arbitrary Axis
Transformations
Rotation about an Arbitrary Point (in xy-plane)In order to rotate an object about a fixed point, the point is first moved
(translated) to the origin. Then, the object is rotated around the
origin. Finally, it is translated back so that the fixed point is
restored to its original position. For rotation of an object about an
arbitrary point, the sequence of the required transformation
matrices and the condensed matrix is given as:
OR:
where is the angle of rotation and the point (x, y) lies in the xy-plane.
]][][[][ cond trt TTTT
10
0100
0010
0001
1000
0100
00cossin
00sincos
10
0100
0010
0001
][ cond
yxyx
T
70
Transformations
Rotation about an Arbitrary Point (in xy-plane)Solution: We first translate the point (3, 2) to the origin, then rotate the rectangle
about the origin, and finally, translate back so that the original point is
restores to its original position (3, 2). The new coordinates of the rectangle
are found as follows:
These are the new coordinates of the rectangle after the rotation.
1063.063.2
1037.263.1
1087.177.0
1013.077.1
1023
0100
0010
0001
1000
0100
00866.05.0
005.0866.0
1023
0100
0010
0001
1031
1032
1012
1011
]][][][[*][ trt TTTPP
Transformations
Mirroring (Reflection)
• In modeling operations, one frequently used operation is mirroring an
object. Mirroring is a convenient method used for copying an object
while preserving its features. The mirror transformation is a special
case of a negative scaling, as will be explained below.
• Let us say, we want to mirror the point A(2, 2) about the x-axis (i.e.,
xz-plane). The point matrix [P*]=[2 -2] can be obtained with the
matrix transformation given below:
71
Transformations
Mirroring (Reflection)
The transformation matrix above is a special case of non-uniform scaling
with sx=1 and sy=-1.
1022
1000
0100
0010
0001
1022*][
P
Transformations
Mirroring (Reflection)
Transformation Matrix for Mirroring about x-axis:
Transformation Matrix for Mirroring about y-axis:
1000
0100
0010
0001
xmT
1000
0100
0010
0001
ymT
72
Transformations
Mirroring about an Arbitrary Plane
If mirroring is required about an arbitrary plane, other
than one defined by the coordinate axes, translation
and/or rotation can be used to align the given plane
with one of the coordinate planes. After mirroring,
translation or rotation must be done in reverse order to
restore the original geometry of the axis.
We will use the figure shown below, to illustrate the
procedure for mirroring an object about an arbitrary
plane. We will mirror the given rectangle about a plane
passing through the line AB and perpendicular to xy-
plane.
TransformationsMirroring about an Arbitrary Plane
73
TransformationsMirroring 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
Mirroring about an Arbitrary Plane
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.
74
Transformations
Coordinate System Transformation
Coordinate frame moves to a new location.
Transformations
Coordinate System Transformation
The origin has been translated (moved) from (0, 0, 0) to (a, b, c)
Or:
For coordinate system:
For the object:
zyxP
czbyax , ,
czbyax , ,
]][[*][ TPP
1
0100
0010
0001
cba
Tt
75
Transformations
Coordinate System Transformation
Note: The sign in the T matrix need to be changed
1*][ czbyaxP
Transformations
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
[x y z] in the new coordinate system?
76
Transformations
Example: Coordinate Transformation
Solution:
1***
1
0100
0010
0001
1000
0100
0030cos30sin
0030sin30cos
1*][
zyx
cba
zyxPoo
oo