1
226-332 Basic CAD/CAM
CHAPTER
2
Chapter 5:
Geometric Transformation
Geometric transformation is a change in geometric characteristics such as
position, orientation, and size of a geometric entity (point, line, body). Examples of geometric transformations are
translation change in position
rotation change in orientation
scaling change in size
x y
3
Chapter 5:
Geometric Transformation
Transformation function is a mapping of a geometric entity from one condition to another. For example, if an egg is to be transformed to a boiled egg, it needs a transformation function which is boiling with transformation parameters such as temperature and time.
P* = f(P, transformation parameters) x y P1* P2* P1 P2
4
Chapter 5:
Geometric Transformation
Translation
When every entity of a geometric model remains parallel to its initial position, the rigid body transformation of the model is defined as translation. Translating a model implies that every point on it moves an equal given distance in a given direction.
x y y x d d P1 P2 P*1 P*2 P P*
5
Chapter 5:
Geometric Transformation
Example
x y d P1 P2 P* 1 P*2 When P1 = [5 1], P2 = [1 4], and d =[1 2] what is an equation of the line after being translated by d? P*1 = P1 + d = [5 1]+[1 2] = [6 3] P*2 = P2 + d = [1 4]+[1 2] = [2 6] x(t) = -4t+6 y(t) = 3t+36
Chapter 5:
Geometric Transformation
Rotation
When every entity of a geometric model moves around one point on the same plane, the rigid body transformation of the model is defined as rotation. Rotating a model implies that every point on it moves an equal given angle around a given axis.
7
Chapter 5:
Geometric Transformation
Rotation around the origin and a given principal axis
R P* Px = R cos Py = R sin P*x = R cos ( + ) P*y = R sin ( + )
P*x = R(cos cos - sin sin ) P*y = R(sin cos + sin cos )
P
2-D Rotation around Z axis
x y
8
Chapter 5:
Geometric Transformation
R
P*
P*x = R cos cos - R sin sin P*y = R cos sin + R sin cos P*x = Px cos - Py sin
P*y = Px sin + Py cos P = Py Px cos sin sin cos y * P x * P P* = [R]P x y
9
10
Chapter 5:
Geometric Transformation
11
Chapter 5:
Geometric Transformation
12
13
14
Chapter 5:
Geometric Transformation
R
P*
P*x = R cos cos - R sin sin P*y = R cos sin + R sin cos
P*x = Px cos - Py sin P*y = Px sin + Py cos P = Pz Py Px 1 0 0 0 cos sin 0 sin cos z * P y * P x * P P* = [Rz]P x y P*z = Pz P*z = Pz
15
Chapter 5:
Geometric Transformation
R
P*
P*x = R cos sin + R sin cos P*y = Py
P*z = R cos cos - R sin sin P*x = Pz cos + Px sin P*y = Py P*z = Pz cos - Px sin P = Pz Py Px cos 0 sin 0 1 0 sin 0 cos z * P y * P x * P P* = [Ry]P z x
16
Chapter 5:
Geometric Transformation
R
P*
P*x =Px
P*y = R cos cos - R sin sin P*z = R cos sin + R sin cos P*x = Px
P*y = Py cos - Pz sin P*z = Py sin + Pz cos P = Pz Py Px cos sin 0 sin cos 0 0 0 1 z * P y * P x * P P* = [Rx]P y z
17
Chapter 5:
Geometric Transformation
Rotation around an arbitrary point and a given principal axis
The Rx, Ry and Rz developed previously can be used but the object must be moved to the origin before making a rotation around a given axis. Then move it back by the same translational vector.
18
Chapter 5:
Geometric Transformation
Rotation around an arbitrary point and a given principal axis
R P x y x y R P x y R P* R P* y x
19
Chapter 5:
Geometric Transformation
Example
Where is [1 5] located after being rotated around [0 3] by 30 degree and the axis of rotation is a vector parallel to Z?
PT1 = P - d = [1 5] - [0 3] = [1 2] PT2 = [R z]PT1 = = PT3 = PT2 + d =[ ] + [0 3] =[ ] 2 1 30 cos 30 sin 30 sin 30 cos
20
21
22
Chapter 5:
Geometric Transformation
Multiple transformations
In reality, an object is always transformed by a series of
transformations. Please note that, translations are commutative where rotations are not. The order of transformations involving rotations
cannot be switched. For example,
ftran1(ftran2(P)) = ftran2(ftran1(P)) frot1(frot2(P)) frot2(frot1(P)) ftran(frot(P)) frot(ftran(P))
23
Chapter 5:
Geometric Transformation
ZXY & XZY
Z X Y
24
25
26
Chapter 5:
Geometric Transformation
Exercises
Find a final position of P [2 1 0] after rotation about Q [1 1 0] by 90 degree when the axis of rotation is Y.
Find a final position of P [3 0 1] after
rotation by 60 degree with X axis as an axis of rotation, followed by rotation about by 30 degree with Y axis as an axis of rotation.
Centers of both rotations are located on the origin.
DEFGHIJGKLMIGNMHOPQRSTUVWPXDFWGNMHSYZQP[\TXHRDHGNMHHYZH] ^I[LMIGNMHJGKP[\TXHWVHFX _I`[aDYXLMIb`c_WFSKPQDFWLVGNMH (decQDfghPWVHFXb`cSYZQiFDDYXRDHGNMHgTV)
27
Chapter 5:
Geometric Transformation
28
29
30
Chapter 5:
Geometric Transformation
STEP1 Rotate about X 60 degree Solution for Q2
31
32
Chapter 5:
Geometric Transformation
33
34
Chapter 5:
Geometric Transformation
x y
25°
[10 3] [5 1]