226-332 Basic CAD/CAM CHAPTER 5: Geometric Transformation 1
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 y x 2
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. y P 2 P 2 * P* = f(p, transformation parameters) P 1 P 1 * x 3
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. y P* 2 P 2 d P* 1 y d P P* P 1 x x 4
Example y When P 1 = [5 1], P 2 = [1 4], and d =[1 2] what is an equation of the line after being P* 2 translated by d? P 2 d P* 1 P 1 x P* 1 = P 1 + d = [5 1]+[1 2] = [6 3] P* 2 = P 2 + d = [1 4]+[1 2] = [2 6] x(t) = -4t+6 y(t) = 3t+3 5
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. 6
Rotation around the origin and a given principal axis y P* R P 2-D Rotation around Z axis x 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 ) 7
y P* R P 2-D Rotation around Z axis x 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 * P * x cos = y sin P* = [R]P sinpx cos Py 8
9
How are the formula? 10
http://www.clowder.net/hop/cos(a+b).html 11
12
13
y P* R P 3-D Rotation around Z axis x P*x = R cos cos - R sin sin P*y = R cos sin + R sin cos P*z = Pz P*x = Px cos - Py sin P*y = Px sin + Py cos P*z = Pz P * x P * y P * z = cos sin 0 sin cos 0 P* = [R z ]P 0Px 0Py 1 Pz 14
x P* R P 3-D Rotation around Y axis z 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 * x P * y P * z = cos 0 sin 0 1 0 P* = [R y ]P sin Px 0 Py cos Pz 15
z P* R P 3-D Rotation around X axis y 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 * x 1 P * y = 0 P * z 0 0 cos sin P* = [R x ]P 0 Px sin Py cos Pz 16
Rotation around an arbitrary point and a given principal axis The R x, R y and R z 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. 17
Rotation around an arbitrary point and a given principal axis y y R P x R P x y P* R y P* R x x 18
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? P T1 = P - d = [1 5] - [0 3] = [1 2] cos 30 sin 30 sin 301 cos 30 2 P T2 = [R z ]P T1 = = P T3 = P T2 + d =[ ] + [0 3] =[ ] 19
20
21
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, f tran1 (f tran2 (P)) = f tran2 (f tran1 (P)) f rot1 (f rot2 (P)) f rot2 (f rot1 (P)) f tran (f rot (P)) f rot (f tran (P)) f tran (f rot1 (f rot2 (P))) f rot1 (f rot2 (f tran (P))) 22
ZXY & XZY Z X Y X Z Y 23
24
25
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) 26
Solution for Q1 27
28
29
Solution for Q2 STEP1 Rotate about X 60 degree 30
31
STEP2 Rotate about Y 30 degree 32
33
25 y [5 1] [10 3] x How is the robot gripper transformed so that it can firmly grasp the object? 34