Professional Documents
Culture Documents
CAD/CAM Principles and Applications: CH 3 Computer Graphics
CAD/CAM Principles and Applications: CH 3 Computer Graphics
Applications
Ch 3 Computer Graphics
y2
y1
X
x1
x2
No
ST = |dy|
dx = dx / ST
dy = dy / ST
X = xi
Y = yi
Set pixel at X, Y
X = X + dx
Y = Y + dy
End of Loop?
No
Yes
STOP
i+1
y d2
d1
i
i i+1
X
using Bresenham
p1 = 2 dy - dx
procedure
x=x+1
P(i+1) = Pi + C2
If Pi < 0 No
Y(i+1) = y(i) + 1
Yes
P(i+1) = P(i) + C1
y(i+1) = y(i)
No End of loop?
Yes
STOP
8
7
6
5
4
3
2
1
1 2 3 4 5 6 7 8
60
40
120
40
20
30
15
0
Z
Y
Z'
Y'
Z
Y
X'
TOP
Z
Y
20
90
X
TOP
Z
50 60
120
20
40
Z Z
30
X Y
150
Y X
FRONT RIGHT SIDE
EDGE
VERTEX SURFACE
VERTEX
SURFACE
Assembly
Dimensions Attributes
Single parts
Solid body
Faces
Edges
Vertices
X Y Z
dY
dX
X X
Translation Scaling
Y
Y
25
30
X
°
25
X
Rotation
Reflection
CAD/CAM Principles and 29
Applications by P N Rao, 2nd Ed
Fig. 3.18 Translation of geometry
Y'
Y P*
Z'
P X'
Z
P
Y
X
X
Y' P*
dY
P
X'
dX
X
CAD/CAM Principles and 31
Applications by P N Rao, 2nd Ed
Fig. 3.20 Scaling of geometry in 2D
P*
P
sY
Y
X
X
sX
28 28
25
X -X X
25
-X X
-Y
y
X
-y
P*
P*
P
θ
y*
r
y
α
x* X
O x
10
8.66
30°
5
3.66
X
5 8.66
x * 1 0 dX x
[P *] = y * = 0 1 dY y
1 0 0 1 1
P*
r P
θ
r
A
dY
X
O dX
P*
P
θ
C
X
O
CAD/CAM Principles and 42
Applications by P N Rao, 2nd Ed
3.5 3D Transformations
x * 1 0 0 dX x
y * 0 1 0 dY y
=
z * 0 0 1 dZ z
1 0 0 0 1 1
Projector
Drawing Object
Projecting plane
B
E
C
Z
Y
A
X
D
Y
B
E
X
C TOP VIEW
Z Z
Y Z
D A C E
A Y
X X
D LEFT SIDE VIEW FRONT VIEW RIGHT SIDE VIEW REAR VIEW
BOTTOM VIEW
L
R
Y
P
N
X
CAD/CAM Principles and 53
Applications by P N Rao, 2nd Ed
Summary
• In order to display the graphical information, which is vectorial in
nature, it is necessary to convert it into raster format.
• For converting lines into raster format, DDA algorithm is
simplest while Bresenham’s algorithm reduces the computations
into integer format thereby making it a faster alternative.
• It is necessary to modify the pixel information for display to get
more realistic visual experience.
• Depending upon the type of graphic display used, it is
necessary to be familiar with a number of different coordinate
systems to facilitate the graphic construction as well as display.
• In addition to the actual graphic information, a large amount of
additional data such as organizational and technological data is
stored with the product data.