Role of Computers in Design. 2. Graphic Primitives: Line & Circle Algorithms 3. Geometric Transformations: Translation, Scaling & Rotation
Role of Computers in Design. 2. Graphic Primitives: Line & Circle Algorithms 3. Geometric Transformations: Translation, Scaling & Rotation
GEOMETRICAL
TRANSFORMATION
1. Role of computers in design.
3. Geometric Transformations :
Translation, scaling & rotation.
1
INTRODUCTION TO CAD
2
INTRODUCTION TO CAD
3
INTRODUCTION TO CAD
CAD is the integration of computer science
techniques for engineering design.
4
INTRODUCTION TO CAD
CAM software uses the models and assemblies
created in CAD software to generate tool paths
that drive the machines that turn the designs into
physical parts.
5
INTRODUCTION TO CAD
The CAD hardware includes
Workstations (Graphic display terminal, CPU)
Mouse, Keyboards, plot pen, printers, plotters
etc.,
6
INTRODUCTON TO CAD
• 2 D Drafting
.
.
7
INTRODUCTION TO CAD
3D modelling
An aid to
visualization.
Represents curves
and surfaces
and solids
8
INTRODUCTION TO CAD
9
CAD- Interactive Computer Graphics
(ICG)
Modern CAD systems are based on ICG.
10
CAD – Reason for Implementation
11
CAD - Implementation
To improve communications through
documentation:
Better Engineering drawings
More standardization in the drawings
Better documentation of the design
Fewer drawing errors.
12
CAD - Design Process
Design is an original solution to a
problem.
13
Shigley- Design Process
14
DESIGN PROCESS
1. Recognition of need:
It involves the realization by someone that a problem
exists for which some feasible solution is to be found.
❑ Historical Information
▪ Collected from the
literature, marketing
surveys.
▪ This should be able to
answer questions like
❖ The current technology
❖ Existing solutions
15
DESIGN PROCESS
❑ Requirement Specification
▪ Clear definition of the requirements is
specified.
▪ This helps in understanding the product from
the current practices and manufacturing
resources of the plant.
❑ Market forces
▪ Consider the various market forces that will
affect the product in one way or the other.
16
❑ General solutions
▪ Specify general solution, which will be broad and would not
contain too many details.
▪ This can be done by resorting to past designs, engineering
standards, technical reports, handbooks, patterns.
▪ This helps in its further evaluation and refinement at a later
stage.
2. Definition of problem
▪ It involves a thorough specification of the item to be
designed.
▪ The specification include functional and physical
characteristics, cost, quality, performance, etc.
3. Synthesis
▪ During this phase various preliminary ideas are developed
through research of similar products or designs in use.
17
4. Analysis and optimization:
▪ The preliminary designs are subjected to the appropriate analysis
to determine their suitability for the specified design
constraints.
5. Evaluation:
▪ The evaluation of the design against the specifications
established during the problem definition phase.
6. Presentation:
▪ It is the final phase, which includes documentation of the design
through drawings, material specifications, assembly lists and so
on. 18
Application of Computers to the Design Process
19
Various Design Tasks by CAD
1. Geometric Modeling
2. Engineering Analysis
3. Design Review and Evaluation
4. Automated Drafting
1. Geometric modeling
It deals with the mathematical description of the geometry of
an object.
20
Three types of commands in Geometric modeling
Solid Modeling
21
Three types wire frame modeling
22
Wire frame modeling
Solid Modeling
Advance method of geometric modeling
in three dimensions.
24
Finite Element Analysis of a Component 25
3. DESIGN REVIEW AND EVALUATION
▪ The designer can check the accuracy of the design to reduce the
dimensioning errors.
▪ The designer can zoom in on part design details for close scrutiny.
In conventional manufacturing
Engineering drawing prepared by design draftsmen and used by
manufacturing engineer to develop the process plan.
29
CAD/ CAM data base
30
Benefits of computer aided design
3. Design Analysis
31
Improvement in visualization of images
8. Improved Procedures for engineering changes
Control and implementation of engineering changes is
significantly improved with CAD.
Data base can be checked against new information.
Easy to compare with the current design.
32
Benefits in Manufacturing
Robotics planning
Group Technology
33
The Graphic Output Primitives
Graphics programming packages provide functions to describe a scene
in terms of the basic geometric structures, as referred to as output
primitives.
34
Pixels
In computer graphics, pictures or graphics objects are presented as a
collection of discrete picture elements (rows and columns) called pixels.
The pixel is the intersection area of the rows and columns (smallest
addressable screen element).
The control is achieved by setting the intensity and colour of the pixel.
For a raster display, the line colour (intensity) is then loaded into the
frame buffer at the corresponding pixel coordinates.
37
Line - Slope
The slope of a line is the rise over the run, or the change in y divided by the
change in x . To find the slope of a line, pick any two points on the line.
38
Example : Find the slope of the line which passes through the points (2, 5)
and (0, 1) :
39
Positive Slope
If a line has a positive slope (i.e. m > 0 ), then y always increases
when x increases and y always decreases when x decreases. Thus, the graph
of the line starts at the bottom left and goes towards the top right.
Negative Slope
Negative slope implies that y always
decreases when x increases and y always
increases when x decreases.
40
Line Drawing Algorithm- Raster System
On raster systems, lines are plotted
with pixels and step sizes in the
horizontal and vertical directions are
constrained by pixel separations.
41
Digital Differential Analyser (DDA) Algorithm/ Vector Algorithm
DDA is one of the incremental scan conversion methods.
42
Digital Differential Analyser (DDA) Algorithm/ Vector
Algorithm
DDA is a scan conversion line algorithm based
on calculating either Δx or Δy.
Case 1: Line with positive slope
If sample at unit x intervals (Δx = 1)
43
Case 2: Line with negative slope
If Δx = -1
If Δy = -1
44
To draw a straight line from connecting two points (2, 7) and (15,10)
X1 = 2, X2 = 15 Δx=X2 - X1 = 13
Y1 = 7, Y2 = 10 Δy= (Y2 - Y1) = 3
m= Δy/Δx = 3/13 =0.23
Pixel values
Plotting a line 45
x1=0 x2=6 Δx = x2-x1= 6-0 = 6
y1=0 y2=7 Δy = y2-y1 = 7-0 = 7
x y
0.5 0.5
1.362 1.5
2.224 2.5
3.086 3.5
3.948 4.5
4.81 5.5
5.672 6.5
6.534 7.5 46
x1=0 x2=-5 Δx = x2-x1= -5-0 = -5
y1=0 y2=5 Δy = y2-y1 = 5-0 = 5
x y
-0.5 0.5
-1.5 1.5
-2.5 2.5
-3.5 3.5
-4.5 4.5
-5.5 5.5
47
Drawbacks of DDA Algorithm
48
Bresenham’s Line Algorithm
An accurate and efficient raster line
generating algorithm.
50
The difference between these two separations is
A decision parameter pk for the kth step in the line algorithm can be obtained
by rearranging the above equation and substituting m= Δy/ Δx.
51
Where C is
If the pixel at yk is closer to the line path than the pixel at yk+1 (that is,
d1<d2), then decision parameter pk is negative.
In that case, we plot the lower pixel; otherwise we plot the upper pixel.
52
But, xk+1 is the same as xk+1 so:
Input the two line endpoints and store the left endpoint in (x0,y0) .
Load (x0,y0) into the frame buffer; that is plot the first point.
Calculate constants Δx, Δy, 2Δy and 2Δy- 2Δx and obtain the starting value
for the initial decision parameter as
At each xk along the line, starting at k=0, perform the following test:
If pk<0, the next point to plot is (xk+1,yk) and
If pk value negative(lower
pixel).
If pk value positive(upper
pixel).
55
Develop the pixel positions for the straight line joining P1 (10, 20) and
P2 (18, 25)
56
Advantage of Bresenham’s Line Algorithm
In DDA both integer and floating point calculations are involved.
57
Circle Generating Algorithms
A circle is defined as the set of points that are all at a
given distance r from the center position (xc,yc).
58
Cont…
Another way to eliminate the unequal spacing is to calculate points
along the circular boundary using polar coordinates r and θ.
The step size chosen for θ depends on the application and the display
device.
60
Bresenham’s Circle Algorithm
61
Mid Point Circle Algorithm
As in the raster line algorithm, sample at unit intervals and determine the
closest pixel position to the specified circle path at each step.
The each calculated position (x, y) is moved to its proper screen position by
adding xc to x and yc to y.
Take unit step in the positive x direction over the octant and use a decision
parameter to determine which of the two possible y positions is closer to the
circle path at each step.
62
The circle function tests are performed for the
midpositions between pixels near the circle
path at each sampling step.
Figure shows the midpoint between the two pixels at sampling position xk+1.
If pk < 0, this midpoint is inside the circle and the pixel on yk is closer to
the circle boundary.
64
Mid Point Circle Algorithm- Steps
1. Input radius ‘r’ and circle center (xc, yc), and obtain the first point on the
circumference of a circle centered on the origin as
(x0, y0) = (0, r)
3. If pk < 0, the next point along the circle is (xk+1, yk) and
Otherwise, the next point along the circle is (xk+1, yk -1) and
5. Move each calculated pixel position (x, y) onto the circular path centered on
(xc, yc) and plot the coordinate values.
x= x +xc, y = y +yc
-3
66
Given a circle of radius r=15cm, determine the pixel positions along the circle
octant using mid point algorithm in the first quadrant from x=0 to x=y
R=15
Initial point is (x0,y0) = (0,15), the initial increment terms for calculating the decision
parameters are 2x0 = 0, 2y0 =30.
Pk <0
Next position
67
Transformation
68
Cont..
This would imply that the geometric model must undergo motion
relative to its MCS.
70
3D Euclidean transformation
3D Homogeneous transformation
71
Transformation of a point
72
Representation of points in matrix form
• In two dimensional coordinate system any point is represented in terms of x
and y coordinates.
• The point (x,y) can be converted into matrix in the following two ways:
73
Representation of points in matrix form
• Represent any rectangle in matrix form.
• Let (x1, y1) and (x2,y2) be the opposite vertices of a rectangle.
• Then , the four vertices of the rectangle will be: (x1,y1), (x2, y1),
(x2,y2), (x1,y2).
• Matrix form
74
TRANSLATION
• Every entity of the geometric model remains parallel to its initial
position, the rigid body transformation of the model is defined as translation.
• Every point on it moves an equal given distance in a given direction
• Translation can be specified by a vector, a unit vector and a distance or two
points that denote the initial and final positions of the model to be translated.
P* = P+d
• Translating a curve does not change its tangent vector at any point
75
TRANSLATION OF A PLANE FIGURE
76
TRANSLATION- EXAMPLE
77
(1,1) & (2,4) 2units x and 3 units y.
78
TRANSLATION- EXAMPLE
Translate the outline of a house by (3, -4)
79
SCALING
Scaling is used to change, increase or decrease the size of an entity or a
model.
Point wise scaling can be performed by
The elements sx, sy, sz of the scaling matrix [S] are the scaling factors in
the X, Y, Z directions respectively.
80
UNIFORM SCALING
81
DIFFERENTIAL SCALING
Differential scaling occurs when
82
SCALING OF A PLANE FIGURE
X1 Y1
P* = X2 Y2
83
84
85
86
ROTATION
Rotation is an important form of geometrical transformation.
It enables the users to view geometric models from different angles.
Rotation of a point through an angle θ about x or y or z is sometimes
referred to as rotation about the origin.
A rotation in the counter clockwise direction is considered as positive.
87
The coordinates of P* are given by:
where
88
(1,1) & (2,4) Rotate 30 degree CCW.
89
Homogeneous Transformation
90
Concatenated Transformation
A series of transformations is applied to a geometric model.
It is also called as combination of transformations.
Concatenated transformations are simply obtained by multiplying the
[T] matrices of the corresponding individual transformations.
91
The line has to be rotated 45 degree ccw about point A.
92
93
94
3D -Transformations
A 3D object has a three dimensional geometry and therefore it requires
a three dimensional coordinate transformation.
The scaling and translation transformations are essentially the same as
two dimensional transformations.
However, the matrix will have a non zero third column.
95
96
97
END
98