ME6501 Computer Aided Design ME6501 Computer Aided Design
ME6501 Computer Aided Design ME6501 Computer Aided Design
Design and
procurement of
Process Quality
new tools Packaging
planning Production control Shipping
Order
materials
Marketing
PRODUCT CYCLE IN CONVENTIONAL MACHINING
PROCESS
COMPUTER AIDED PRODUCT CYCLE
DESIGN PROCESS
In general it is agreed that the
design progresses in a step by step
manner from identification of need for
the problem, a search for solutions and
development of chosen solution to
manufacture, test and use.
There descriptions of design are often
called as models of the design process
and to illustrate these we shall consider
following models namely Shigley, Pahl
and Beitz, Ohsuga and Earle.
SHIGLEY DESIGN PROCESS
THE DESIGN PROCESS
Research
Design
Manufacture
Quality Control
Distribution
Sales
DISADVANTAGES OF SEQUENTIAL ENGINEERING
Commercial
Design Process Competitors Idea
Generation Marketing
Feasibility
Study
Performance Specifications
Linear Process
Preliminary
Form Design
Design
Revising and testing
prototypes
Functional Production
Design Design
Design Manufacturing
Specifications Specifications
Product Launch
Concurrent Engineering
Techniques:
•Perceptual mapping
•Benchmarking
•Reverse Engineering
Concurrent Engineering
Benchmarking
•Get the best product available
•Base performance specifications for new product on it
Reverse Engineering
•Dismantle and inspect competitors product(s)
•Select features to incorporate into new product
Concurrent Engineering
•Prototype produced
•Adjustments made
•Final specification agreed
Concurrent Engineering
Method:
Quality Function Deployment (QFD)
Concurrent Engineering
CG than technology
Focus on interactivity
Cost effective solutions
Nanomanipulator, UNC
Joe Kniss, Utah Gordon Kindelman, Utah
WHAT DRIVES COMPUTER GRAPHICS?
ProEngineer, www.ptc.com
WHAT DRIVES COMPUTER GRAPHICS?
y
x x t x , y y t y
P
x x t x
T P , P , T
y y t y
P x P P T
46
2D SCALING
x x s x , y y s y
Sx
x s x 0 x
y 0 s y y
Sy
P S P
y
x f , yf
x
47
2D ROTATION
y
Rotation in angle about a
x, y
xr , yr x
48
Rotation
49
Derivation of the rotation equation
x r cos
y r sin y
P’(x’, y’)
x ' r cos( ) rsin(+)
x cos sin 0 x
2D Rotation y sin cos 0 y , P R P
1 0 0 1 1
x S x 0 0 x
2D Scaling y 0 Sy 0 y , P S S x , S y P
1 0 0 1 1
52
2D REFLECTIONS
y y y
x x
1 0 0 1 0 0 1 0 0
0 1 0 0 1 0 0 1 0
0 0 1 0 0 1 0 0 1
53
yx y x
0 1 0 0 1 0
1 0 0 1 0 0
0 0 1 0 0 1
54
3D TRANSFORMATIONS
TRANSLATION
Very similar to 2D. Using 4x4 matrices rather than 3x3.
Translation
x x t x
y
y y t y
z z t z
x, y, z x 1 0 0 tx x
x, y , z y 0
1 0 t y y
z 0 0 1 tz z
z x
1 0 0 0 1 1
55
3D SCALING
y y
x x S x
y y S y
z x S z
z x z x
Enlarging object also moves it from origin
x S x 0 0 0 x
y 0 Sy 0 0 y
P SP
z 0 0 Sz 0 z
1 0 0 0 1 1
58
Scaling with respect to a fixed point (not necessarily of object)
y y y
x f , yf , zf x f , yf , zf x f , yf , zf
z x z x z x
x f , yf , zf
z x
59
ROTATION
ROTATION
ROTATION
Parallel to one of the Coordinate Axis
In special cases where an object is to be rotated
about an axis that is parallel to one of the coordinate axis,
we can obtain the desired rotation with the following
transformation sequence.
1. Translate the object so that the rotation axis coincides with
the parallel coordinate axis (for simplicity, let us take x-axis).
2. Perform the specified rotation about that axis.
3. Translate the object so that the rotation axis is moved back
to its original position.
ROTATION
SCALING
The matrix expression for the scaling
transformation of a position P = (x, y, z) relative to
coordinate origin can be written as:
SCALING
Cartesian equation:
y = mx + c y2
where y1
m – slope x1 x2
c – y-intercept
y 2 y1 y
m
x2 x1 x
67
SLOPE
+ve -ve
if |m| = 1 45°
45°
= 45°
if |m| 1
-45° < < 45° °
°
if |m| 1
45° < < 90° or °
x y 8
0 0 7
1 1 6
2 2 5
3 3 4
4 4
3
5 5
2
6 6 1
7 7 0
8 8 x
0 1 2 3 4 5 6 7 8
69
|m| 1
y=½x+1
m=½
y
c=1 x y round(y)
0 1 1 8
1 1.5 2 7
6
2 2 2 5
3 2.5 3 4
3
4 3 3
5 3.5 4 2
1
6 4 4 0
7 4.5 5 0 1 2 3 4 5 6 7 8 x
8 5 5
70
|m| 1
y = 3x - 2
m=3
c = -2 y
x y round(y
) 8
0 -2 -2 7
1 1 1 6
2 4 4 5
3 7 7 4
4 10 10
3
5 13 13 2
6 16 16 1
0
7 19 19
0 1 2 3 4 5 6 7 8 x
8 22 22
71
BRESENHAM LINE ALGORITHM
A MORE EFFICIENT APPROACH
A
B
Start position
True line
ti
si
Decision parameter
di = (si - ti)
If di 0, then closest pixel is below true line (si smaller)
If di 0, then closest pixel is above true line (ti smaller)
74
EXAMPLE:
dy
Let gradient(slope) 0.5 (i.e. 0.5 or 2dy dx )
dx
Start pixel at (x0,y1)
y5 At x1 :
s1 = dy t1 = dx - dy
y3 d1 = (si - ti) = dy - (dx - dy) = 2dy - dx
but 2dy dx di 0 y stays the
same
y2 hence next pixel is at (x1,y1)
3dy 4dy At x2 :
2dy s2 = 2dy t2 = dx - 2dy
y1 dy
d2 = (s2 – t2) = 2dy - (dx - 2dy) = 4dy -
dx
y0 Suppose d2 0 y is incremented
x0 x1 x2 x3 x4 x5 hence next pixel is at (x2,y2)
At x3 :
s3 = 3dy - dx t2 = 2dx - 3dy
d3 = (s2 – t3) = 6dy - 3dx 0
so y stays the same
hence next pixel is at (x3,y2)
75
IN GENERAL For a line with gradient ≤ 1
d0 = 2dy – dx
if di 0 then yi+1 = yi
di+1 = di + 2dy
if di ≥ 0 then yi+1 = yi + 1
di+1 = di + 2(dy –
dx)
xi+1 = xi + 1
For a line with gradient 1
d0 = 2dx – dy
if di 0 then xi+1 = xi
di+1 = di + 2dx
if di ≥ 0 then xi+1 = xi + 1
di+1 = di + 2(dx – dy)
yi+1 = yi + 1
Note: For |m| ≤ 1 the constants 2dy and 2(dy-dx) can be calculated
once,
76
so the arithmetic will involve only integer addition and subtraction.
EXAMPLE – DRAW A LINE FROM (20,10) TO (30,18)
(30,18)
dx = 10
dy = 8
initial decision d0 = 2dy – dx = 6
Also 2dy = 16, 2(dy – dx) = -4
(20,10)
i di (xi+1,yi+1)
0 6 (21,11)
1 2 (22,12)
2 -2 (23,12)
3 14 (24,13)
4 10 (25,14)
5 6 (26,15)
6 2 (27,16)
7 -2 (28,16)
8 14 (29,17)
9 10 (30,18)
77
void LineBres(int x0, int y0, int x1, int y1) // line for |m| < 1
{
int dx = abs(x1 – x0), dy = abs(y1 – y0);
int d = 2 * dy – dx, twoDy = 2 * dy, twoDyMinusDx = 2 * (dy – dx);
int x, y;
if (x0 > x1) { // determines which point to use as start, which as
end
x = x1;
y = y1;
x1 = x0;
}
else {
x = x0;
y = y0;
}
setPixel(x,y);
while (x < x1) {
x++;
if (d < 0) d += twoDy;
else {
y++;
d += twoDyMinusDx;
}
setPixel(x, y);
}
}
78
SPECIAL CASES
79