Professional Documents
Culture Documents
Process data
Computer Process
Process data
Computer Process
Control signals
Process data
Computer Mfg
Control signals operations
Marketing
Geometric model
Documentation
Interface algorithms
To CAM Process
IITK ME 761A Dr. J. Ramkumar 8
CAD Tools Required to Support the Design Process
Interface algorithms
Assembly
NC programs
To shipping and marketing
IITK ME 761A Dr. J. Ramkumar 10
CAM Tools Required to Support the Design Process
Manufacturing phase Required CAM tools
Computer graphics
concepts
CAD
tools
Geometric modeling
Design tools
Hardware
Design tools + Computer (control unit; display terminals; = CAD tools
I/O devices
Software (graphics;
modeling; applications
programs
Networking
concepts
CAM
tools
CAD
Mfg tools
Hardware
(control unit; display terminals;
I/O devices
Networking
IITK ME 761A Dr. J. Ramkumar 15
Definitions of CAD/CAM Tools Based on Their
Constituents
CAD/CAM
tools Geometric
Networking modeling
Computer
graphics
concepts
IITK ME 761A Dr. J. Ramkumar 16
Definition of CAD/CAM Tools Based on Their Implementation in an
Engineering Environment
Hardware
Networking
IITK ME 761A Dr. J. Ramkumar 17
Typical Utilization of CAD/CAM Systems in an Industrial Environment
Geometric modeling and graphics package
Process planning
Geometric modeling
of conceptual design CAPP package
Is design evaluation
Yes Are there manufacturing
No discrepancies in CAD
Possible with available
Standard software? databases?
Design
package Yes
Develop customized No
Design testing
programs and packages
And evaluation NC programming NC
package
Programming
No Is final design package
Applicable? Machining
Yes
Inspection
Drafting Inspection
And Robotics
Assembly package
Documentation IITK ME 761A Dr. J. Ramkumar 18
Automation and CAD/CAM
Automation can be defined as the technology concerned
with the application of complex mechanical, electronic,
and computer-based systems in the operation and control
of manufacturing systems.
Job shop
production
Product variety
P2 = R P1 .
P2 = P 1 + T
Ty
P1 = ( x1 ) T = ( tx )
Tx ( y1 ) ( ty )
P2 = (x1 + tx)
(y1 + ty)
.
P2 = S P1
S = (sx 0) P1 = ( x1 )
(0 sy) ( y1 )
P2 = (sxx1)
(syy1)
In order to represent a translation as a matrix operation we use 3 x 3 matrices and pad our points to
become 1 x 3 matrices.
cos ø -sin ø 0
Rø = sin ø cos ø 0
(x)
0 0 1 Point P = (y)
(1)
Sx 0 0
S = 0 Sy 0
0 0 1
1 0 Tx
T = 0 1 Ty
0 0 1
34
IITK ME 761A Dr. J. Ramkumar
Composite Transformations - Scaling
Given our three basic transformations we can create other transformations.
0 1 2 3 4 5 6 7 8 9 10
(2 0 0) =
(0 1 0) (0) (0)
(0 0 1) (1) (1)
(1) (1)
(2 0 0) =
(0 1 0) (2) (0)
(0 0 1) (1) (1) Bef ore
0 1 2 3 4 5 6 7 8 9 10
(0,0) is known as a fixed point for the basic scaling transformation. We can used composite
transformations to create a scale transformation with different fixed points.
(1 0 2) (2 0 0) (1 0 -2) = (2 0 -2)
(0 1 1) (0 1 0) (0 1 -1) (0 1 0)
(0 0 1) (0 0 1) (0 0 1) (0 0 1)
Afte r
(2 0 -2) (4)= (6)
(0 1 0) (1) (1)
(0 0 1) (1) (1) 0 1 2 3 4 5 6 7 8 9 10
(1 0 3) (2 0 0) (1 0 -3) = (2 0 -3)
(0 1 1) (0 1 0) (0 1 -1) (0 1 0)
(0 0 1) (0 0 1) (0 0 1) (0 0 1)
(2 0 -3) =
(2) (1)
Bef ore
(0 1 0) (1) (1)
Afte r
(0 0 1) (1) (1)
(2 0 -3) =
(4) (5) 0 1 2 3 4 5 6 7 8 9 10
(0 1 0) (1) (1)
(0 0 1) (1) (1)
IITK ME 761A Dr. J. Ramkumar 38
Rotation about a Fixed Point
Rotation of ø Degrees About Point (x,y)
• Translate (x,y) to origin
• Rotate
• Translate origin to (x,y)
(x,y) (x,y)
1 0 0 1 b 0
a 1 0 0 1 0
0 0 1 0 0 1
-1 0 0 1 0 0
0 1 0 0 -1 0
0 0 1 0 0 1
-1 0 0 0 1 0
0 -1 0 1 0 0
0 0 1 0 0 1
• Concatenating
– affine transformations by multiplying together
– sequences of the basic transformations
➔ define an arbitrary transformation directly
– ex) three successive transformations
p1 p2
p A B C q
• Associative properties
M1 M2 M3 = M1 (M2 M3 ) = (M1 M2 ) M3
• Composite transformation
– A sequence of transformations
– Calculate composite transformation matrix rather than applying individual transformations
P' = M2 M1 P
• CompositeP'= MP
two-dimensional translations
– Apply two successive translations, T1 and T2
T1 = T (t1x , t1 y )
T2 = T (t 2 x , t 2 y )
= T2 (T1 P)matrix
P' transformation
– Composite = (Tin2 coordinate
T1 ) P form
– Composite ( coordinates
r , y r ) Rin
T( x matrix ) = R( x r , y r , )
) T( − x r ,− y rform
T (x f , y f ) S (sx , s y ) T (− x f ,− y f ) = S (x f , y f , sx , s y )
1 0 x f s x 0 0 1 0 − x f s x 0 x f (1 − s x )
0 1 yf 0 sy 0 0 1 − yf = 0 sy y f (1 − s y )
0 0 1 0 0 1
0 0 1 0 0 1
IITK ME 761A Dr. J. Ramkumar 50
Two-dimensional composite transformation (7)
s2
IITK ME 761A Dr. J. Ramkumar 51
General Scaling Directions
• Converted to a parallelogram
y y
(1/2,3/2) (2,2)
(0,1) (1,1)
(3/2,1/2)
(0,0) (1,0) x (0,0) x
Scale
s1 cos 2 + s2 sin 2 ( s2 − s1 ) cos sin 0 y s2
R −1 ( ) S ( s1 , s2 ) R ( ) = ( s2 − s1 ) cos sin s1 sin 2 + s2 cos 2 0
0 0 1 xs
1
rotation of a cube about the z axis rotation of a cube about the y axis
?
rotation of a cube about the x axis
53
IITK ME 761A Dr. J. Ramkumar
General Rotation (2/2)
R = Rx R y Rz
x
z
58
Right-handed Coordinate System
x y = z; y z = x; z x = y
x
z Left hand coordinate system
Not used in this class and
Not in OpenGL
59/94
3D Transformation
◼ Very similar to 2D transformation
◼ Translation transformation
x 1 0 0 t x x
y 0 1 0 t y y
z = 0 0 1 t x z
1 0 1 1
0 0
Homogenous coordinates
60
3D Transformation
◼ Very similar to 2D transformation
◼ Scaling transformation
x s x 0 0 0 x
y 0 sy 0 0 y
z = 0 0 sz 0 z
1 0 1 1
0 0
Homogenous coordinates
61
3D Transformation
◼ 3D rotation is done around a rotation axis
◼ Fundamental rotations – rotate about x, y, or z axes
◼ Counter-clockwise rotation is referred to as positive rotation
(when you look down negative axis)
+ x
z
62
3D Transformation
◼ Rotation about z – similar to 2D rotation
x' = x cos − y sin
y ' = x sin + y cos
z' = z
x cos − sin 0 0 x y
y sin cos 0 0 y
z = 0 0 1 0 z
+
1 0 1 1
x
0 0 z
63
3D Transformation
◼ Rotation about y: z -> y, y -> x, x->z
z
x cos 0 sin 0 x y
y 0 1 0 0 y
z = − sin 0 cos 0 z
1 0 1 1
x
0 0 z
64
3D Transformation
◼ Rotation about x (z -> x, y -> z, x->y)
x
x 1 0 0 0 x y
y 0 cos − sin 0 y
z = 0 sin cos 0 z
1 0 1 1
x
0 0 z
65
Inverse of 3D Transformations
◼ Invert the transformation
◼ In general, X= AX’->x’=A-1X
x 1 − t x x'
x 1 0 0 t x x
0 0
y 0 1 0 − t y y '
y 0 1 0 t y y z = 0
z = 0 − t x z '
t x z
0 1
0 1
1 0 1
1 0 0 0 1
0 0 1
1
T(tx,ty,tz) T(-tx,-ty,-tz)
Rz ( − )
Rz ( )
3D Rotation about Arbitrary Axes
◼ Rotate p about the by the
r angle
r
z
p = ( x, y, z )
67
3-D Rotation
◼ General rotations in 3-D require rotating about an arbitrary
axis of rotation
68
3D Rotation about Arbitrary Axes
◼ Rotate p about the by the
r angle
r
z
p = ( x, y, z )
69
3-D Rotation
◼ General rotations in 3-D require rotating about an arbitrary
axis of rotation
70
Composing Canonical Rotations
◼ Goal: rotate about arbitrary vector r by θ
◆ Idea: we know how to rotate about x,y,z
71
Composing Canonical Rotations
◼ Goal: rotate about arbitrary vector r by θ
◆ Idea: we know how to rotate about x,y,z
72
3D Rotation about Arbitrary Axes
◼ Rotate p about the by the
r angle
r
z
p = ( x, y, z )
73
3D Rotation about Arbitrary Axes
◼ Translate so that rotation axis passes through the origin
r
z
x
T −1 Rz ( ) Ry ( ) Rz ( ) Ry (− ) Rz (− )T
74
3D Rotation about Arbitrary Axes
◼ Rotation by − z-axis
about
z
r
y
x
T −1 Ry ( ) Ry ( ) Rz ( ) Ry (− ) Rz (− )T
75
3D Rotation about Arbitrary Axes
◼ Rotation by − y-axis
about
z
r
x
T −1 Ry ( ) Ry ( ) Rz ( ) Ry (− ) Rz (− )T
76
3D Rotation about Arbitrary Axes
◼ Rotation by z-axis
about
z
r
x
T −1 Ry ( ) Ry ( ) Rz ( ) Ry (− ) Rz (− )T
77
3D Rotation about Arbitrary Axes
◼ Rotation by y-axis
about
z
r
x
T −1 Ry ( ) Ry ( ) Rz ( ) Ry (− ) Rz (− )T
78
3D Rotation about Arbitrary Axes
◼ Rotation by z-axis
about
z
r
y
x
T −1 Rz ( ) Ry ( ) Rz ( ) Ry (− ) Rz (− )T
79
3D Rotation about Arbitrary Axes
◼ Translate the object back to original point
r
z
y
x
T −1 Rz ( ) Ry ( ) Rz ( ) Ry (− ) Rz (− )T
80
3D Rotation about Arbitrary Axes
◼ Final transformation matrix for rotating about an arbitrary
axis
r
z
y
x
T −1 Rz ( ) Ry ( ) Rz ( ) Ry (− ) Rz (− )T
81
3D Rotation about Arbitrary Axes
◼ Final transformation matrix for rotating about an arbitrary
axis
r
z
y
x
T −1 Rz ( ) Ry ( ) Rz ( ) Ry (− ) Rz (− )T
82
3D Rotation about Arbitrary Axes
◼ Final transformation matrix for rotating about an arbitrary
axis
T −1 Rz ( ) Ry ( ) Rz ( ) Ry (− ) Rz (− )T
T −1 Rz ( ) Ry ( ) Rz ( ) Ry (− ) Rz (− )T
85
Rotation Matrices
◼ Orthonormal matrix:
◆ orthogonal (columns/rows linearly independent)
−1 T
r11 r12 r13 r11 r12 r13
r21 r22 r23 = r21 r22 r23
r r33 r r33
31 r32 31 r32
86
Rotation Matrices
◼ Orthonormal matrix:
◆ orthogonal (columns/rows linearly independent)
−1 T
r11 r12 r13 r11 r12 r13
r21 r22 r23 = r21 r22 r23
r r33 r r33
31 r32 31 r32
87
Examples
spline
knots
(a)
(b)
(c)
umin u0
un
u u1 u n −1
u max
u2
A parametrically defined curve
u min = u0 u1 u n −1 u n = u max
x (u ) (u0 , u1 , , u n −1 , u n )
Q (u ) =
y (u ) knot sequence
z (u )
knot vector
If ui = i, then uniform knot sequence
Y1 (u ) Y (u )
Y0 (u )
Y2 (u )
u0 u1 u2 u3 u i u i +1 um
i i +1
Y (u ), ui u ui+1 non-uniform
u − ui
Yi (u ) = Y ( ), i = 0,1, 2,, n
ui+1 − ui
0 u 1
Interpolation
V3
V2 V4
Approximation V4
V3
V0
V6
V2 V5
V1
u
u =0 1 2 3 4 5 u =6
Yi (u ) = ai + bi u + ci u 2 + d i u 3
0 u 1 i = 0,...,5
Yi ( 0) = ai ≡ yi ai = yi
Y (1) = a + b + c + d ≡ y
i i i i i i +1 bi = Di
Yi (1) (0) = bi ≡ Di ci = 3( yi +1 − yi ) − 2 Di − Di +1
Y (1) (1) = b + 2c + 3d ≡ D d i = 2( yi − yi +1 ) + Di + Di +1
i i i i i +1
Computing D i automatically
e.g.fitting a parabola through yi-1 , yi , and yi +1
(2) (y i − yi −1 ) + (1 − )( yi +1 − yi )
weighted avrage 0 1
(3) specifyingdirectly
• Rearranging gives:
x = x1 ( −2t 3 + 3t 2 ) or − 2 3 0 0 t 3
2
+ x0 ( 2t 3 − 3t 2 + 1) −3 0 1 t 2
x = x1 x0 x1 x0
+ x1 (t 3 − t 2 ) 1 −1 0 0 t
+ x0 (t 3 − 2t 2 + t )
1 −2 1 0 1
− 2 3 0 0 t 3
x x1 x1 x0 2
1
x0
y = y 2 −3 0 t
1 y0 y1 y0
1 −1 0 0 t
z z1 z0 z1 z0
1
−2 1 0 1
IITK ME 761A Dr. J. Ramkumar 141
Basis Functions
• A point on a Hermite curve is obtained by multiplying each control
point by some function and summing
• The functions are called basis functions
1.2
0.8
0.6 x1
x0
0.4
x'1
0.2
x'0
0
-0.2
-0.4
V0 V6
V1 V5
V3
V2 V4
Qi (u ) = ( xi (u ), yi (u ))
Vi = ( xi , y i )
Natural Spline
IITK ME 761A Dr. J. Ramkumar 144
Deriving Natural Cubic Splines
(4) 2ci −1 + 6d i −1 = 2ci
yi = ai + bi t + ci t 2 + di t 3
(1) Yi −1 (1) = yi ai = yi
(2) Yi (0) = yi bi = Di
1 i m −1
(3) Yi −(11) (1) = Yi (1) (0) ci = 3( yi +1 − yi ) − 2 Di − Di +1
(4) Yi −( 21) (1) = Yi ( 2 ) (0) d i = 2( yi − yi +1 ) + Di + Di +1
(5) Y0 (0) = y0
(6) Ym −1 (1) = ym By substitution and simplification,
(7) Y0( 2 ) (0) = 0 Di −1 + 4 Di + Di +1 = 3( yi +1 − yi −1 )
1 i m −1
(8) Ym( 2−1) (1) = 0
Applying end - conditions
From (7),
2c0 = 0
By substituti on and simplifica tion,
2 D0 + D1 = 3( y1 − y0 )
Similarly, from (8)
Dm −1 + 2 Dm = 3( ym − ym −1 ) 145
2 1 D0 3( y1 − y0 )
1 4 1 D 3( y − y )
1 2 0
1 4 1
1 4 1 =
. . . .
1 4 1 3( y m − y m − 2 )
1 2 Dm 3( y m − y m −1 )
P2
P0
P1 Pm
Di −1 + 4 Di + Di +1 = 3( yi +1 − yi −1 )
4 1 1 D0 3( y1 − y m )
1 4 1 D 3( y − y )
1 2 0
1 4 1
1 4 1 =
. . . .
1 4 1 3 ( y m − y m−2
)
1
1 4 Dm 3( y0 − y m −1 )
R1 R4
P4 P4
P1 P1
Instead of providingR1 and R4 , providetwo additionalcontrol points ! ! !
P2 and P3
Approximation
1− t
P3
P0 P0
1− t
(1− t ) P0 + tP1 1− t
t (1− t ) 2 P0 + 2(1− t )tP1 1− t (1− t ) 3 P0
P1 1− t t +t 2 P2 + 3(1− t ) 2 tP1
P3
IITK ME 761A Dr. J. Ramkumar 160
Now,
−1 3 3 1 P1
3 0 P2
3
3 i
Q (t ) = t 3 t2 t
1
−6 3
i
i =0
t (1 − t ) 3− i
=1
− 3 3 0 0 P3
1 0 0 0 P4
What does it mean ?
= T M b Gb
1 (1 − t ) 3
Q (t ) = (1 − t ) P1 + 3t (1-t ) P2 + 3t (1-t ) P3 + t P4
3 2 2 3 t3
3t (1-t ) 2
3
3 i
= t (1 − t ) 3−i Pi , 0 t 1
i =0 i 3t 2 (1-t )
(t + (1 − t )) 3
0 1
n! n −i
Bin (t ) = .t .(1 − t )
i
i!(n − i )!
Ai is the control points (xi, yi)
n
y (t ) = yi .Bin (t )
i =0
P4
P1
P3
IITK ME 761A Dr. J. Ramkumar 171
Bezier Curve Properties
• The first and last control points are interpolated
• The tangent to the curve at the first control point is along the line joining the
first and second control points
• The tangent at the last control point is along the line joining the second last
and last control points
• The curve lies entirely within the convex hull of its control points
– The Bernstein polynomials (the basis functions) sum to 1 and are everywhere positive
• They can be rendered in many ways
– E.g.: Convert to line segments with a subdivision algorithm
“knot”
P0,0
P1,3
P0,3
P1,0
P1,2
P1,1
P0,0
P1,3
J
P1,2
P1,1
Disclaimer: PowerPoint curves are not Bezier curves, they are
interpolating piecewise quadratic curves! This diagram is an
approximation.
0.8 B0
B1
0.6
B2
0.4 B3
0.2