You are on page 1of 16

Chapter 3

Graphical
Representation

Prof. Abdel-Nasser Zayed , CAD/CAM , 1271


Chapter 3
Graphical Representation
This chapter represents the method of how the CAD
software implement the illustration of the geometric
shapes in two-dimension drawing.
The data required for each shape will be mentioned as
an input to the CAD software, then explanation of the
processes of how the software illustrates the required
shape.

2
Prof. Abdel-Nasser Zayed , CAD/CAM , 1271
3.1 Straight Line

Any straight line is represented by its starting point “Po” of


coordinates (xo , yo) and its end point “Pn” of coordinates
(xn , yn).
CAD software draws the straight line as (n + 1) points,
starting with (xo , yo) and ending with (xn , yn)

Prof. Abdel-Nasser Zayed , CAD/CAM , 1271 3


The coordinates of the intermediate and incremental points (Pi) are
calculated as:

xi = xo + i ∆x
yi = yo + i ∆y
where i = 1, 2, 3, / , n

xn − x o yn − y o
∆x = ∆y =
n n

“n” is the number of increments which depends on the resolution of the


CAD software and the resolution of the computer screen.

Prof. Abdel-Nasser Zayed , CAD/CAM , 1271 4


3.2 Rectangle

A rectangle is represented in CAD by two points (corners), the first


point is the lower-left point (corner) “L” (xL , yL) and the second point is
the upper-right point “R” (xR , yR).

5
Prof. Abdel-Nasser Zayed , CAD/CAM , 1271
(xL , yR)


(xR , yL)

CAD software represents the rectangle as four straight lines:


● 1st line: from (xL , yL) to (xR , yL)
● 2nd line: from (xR , yL) to (xR , yR)
● 3rd line: from (xR , yR) to (xL , yR)
● 4th line: from (xL , yR) to (xL , yL)

6
Prof. Abdel-Nasser Zayed , CAD/CAM , 1271
3.3 Triangle
Any triangle is represented by its three vertices A(xA , yA), B(xB , yB),
C(xC , yC). By knowing the coordinates of the three vertices, CAD
software represents the triangle as three straight lines.

● 1st line: from A(xA , yA) to B(xB , yB)


● 2nd line: from B(xB , yB) to C(xC , yC)
● 3rd line: from C(xC , yC) to A(xA , yA)

7
Prof. Abdel-Nasser Zayed , CAD/CAM , 1271
3.4 Circle

A circle is represented by its center O(xo , yo) and its radius “R”. To
plot a circle in CAD software, the coordinates of Pi(xi , yi) should be
calculated from θi = 0o to θi = 360o, as

xi = xo + R cos θi
yi = yo + R sin θi

8
Prof. Abdel-Nasser Zayed , CAD/CAM , 1271
3.5 Ellipse

An ellipse is defined by its center O(xo , yo) , its major “a” and its
minor “b”. To plot an ellipse in CAD, the coordinates of Pi(xi , yi) are
calculated as yi is a function of xi for all values of “x” from (xo – a) to
(xo + a) :
2
2 b 2
yi = y o ± b − 2 ( xi − x o )
a

9
Prof. Abdel-Nasser Zayed , CAD/CAM , 1271
3.6 Regular Polygons
A polygon is a geometric shape of N sides. The polygon is called
regular polygon when all sides are equal. In CAD, a regular polygon is
represented by its number of sides “N”, its center O(xo , yo), and the
radius of its exterior circle “R”.

N=4 N=5 N=6

By knowing (xo , yo), N and R,


1- calculate the coordinates of vertixe “1” as x1 = xo + R & y1 = yo
2-

10
Prof. Abdel-Nasser Zayed , CAD/CAM , 1271
N=4 N=5 N=6

By knowing (xo , yo), N and R,


1- calculate the coordinates of vertex “1” as x1 = xo + R & y1 = yo
2- calculate the coordinates of vertex “2” from vertex “1” and vertex “3”
from vertex “2” and vertex “4” from vertex “3” and so on.

xi+1 = xo + [(xi – xo) cos θ – (yi – yo) sin θ] 360o


where θ=
yi+1 = yo + [(xi – xo) sin θ + (yi – yo) cos θ] N

11
Prof. Abdel-Nasser Zayed , CAD/CAM , 1271
Example:
It is required to plot a hexagon (regular polygon of N = 6) where its center
O is at (100, 100) and its exterior circle of radius R = 50. Calculate the
coordinates of its vertices.
Solution:
360o 360o
For N = 6, then θ = = = 60o
N 6
For R = 50 and (xo , yo) = (100, 100), then
the 1st vertex is at (x1 , y1) where
x1 = xo + R = 100 + 50 = 150
Vertex “1”
y1 = yo = 100 (150, 100)
The 2nd vertex
x2 = xo + [(x1 – xo) cos 60o – (y1 – yo) sin 60o]
= 100 + [(150 – 100) cos 60o – (100 – 100) sin 60o]
= 125 Vertex “2”
(125, 143.3)
y2 = yo + [(xo – x1) sin 60o + (y1 – yo) cos 60o]
= 100 + [(150 – 100) sin 60o + (100 – 100) cos 60o]
= 143.3 12
Prof. Abdel-Nasser Zayed , CAD/CAM , 1271
The 3rd vertex
x3 = xo + [(x2 – xo) cos 60o – (y2 – yo) sin 60o]
= 100 + [(125 – 100) cos 60o – (143.3 – 100) sin 60o]
= 100 + [12.5 – 37.5]
= 75

y3 = yo + [(x2 – xo) sin 60o + (y2 – yo) cos 60o]


= 100 + [(125 – 100) sin 60o + (143.3 – 100) cos 60o]
Vertex “3”
= 100 + [25 sin 60o + 43.3 cos 60o]
(75, 143.3)
= 143.3

The 4th vertex


x4 = xo + [(x3 – xo) cos 60o – (y3 – yo) sin 60o]
= 100 + [(75 – 100) cos 60o – (143.3 – 100) sin 60o]
= 100 + [ –25 cos 60o – 43.3 sin 60o]
= 50

y4 = yo + [(x3 – xo) sin 60o + (y3 – yo) cos 60o]


= 100 + [(75 – 100) sin 60o + (143.3 – 100) cos 60o]
= 100 + [–25 sin 60o + 43.3 cos 60o] Vertex “4”
= 100 (50, 100)

13
Prof. Abdel-Nasser Zayed , CAD/CAM , 1271
The 5th vertex
x5 = xo + [(x4 – xo) cos 60o – (y4 – yo) sin 60o]
= 100 + [(50 – 100) cos 60o – (100 – 100) sin 60o]
= 100 + [ –50 cos 60o]
= 75

y4 = yo + [(x3 – xo) sin 60o + (y3 – yo) cos 60o]


= 100 + [(50 – 100) sin 60o + (100 – 100) cos 60o]
= 100 + [–50 sin 60o] Vertex “5”
= 56.7 (75, 56.7)

The 6th vertex


x6 = xo + [(x5 – xo) cos 60o – (y5 – yo) sin 60o]
= 100 + [(75 – 100) cos 60o – (56.7 – 100) sin 60o]
= 100 + [ –25 cos 60o + 43.3 sin 60o]
= 125

y6 = yo + [(x5 – xo) sin 60o + (y5 – yo) cos 60o]


= 100 + [(75 – 100) sin 60o + (56.7 – 100) cos 60o]
= 100 + [–25 sin 60o – 43.3 cos 60o] Vertex “6”
= 56.7 (125, 56.7)

14
Prof. Abdel-Nasser Zayed , CAD/CAM , 1271
15
Prof. Abdel-Nasser Zayed , CAD/CAM , 1271
END OF
CHAPTER 3

You might also like