Professional Documents
Culture Documents
Figure 1.1 CAD and CAM Processes 1.2. Product Cycle
Figure 1.1 CAD and CAM Processes 1.2. Product Cycle
Figure 1.2 shows the life cycle of a typical product. The product undergoes the following
two main processes from inception to finished product,
Introduction 1.3
(a) Design process and
(b) Manufacturing process.
The analysis of sub-proces•s starts with the careftll design of each assembly and each
component of the assembly. The design department creates these designs through a top
down approach or a bottom up approach. In top down approach, the entire assembly is first
designed and individual designs are done latter. In bott01n up approach, the component
design is first done and the product is realized by assembling the components suitablv A
detailed design analysis and optilnization are also carried out at this stage. It requires the
design modeling and simulation. The final stage of the analysis sub-process is the design
documentation in the form of detailed engineering drawings. This detailed design of the
product is given to the process planning department.
some cases, a special Inanufacturing method is required such as jigs and fixtures or
inspection gauges which may be planned. Based on the process Plan' a production schedule
will be prepared and actual production of the product begins• This scheduling Provides a
plan to the company that certain quantities of the product should be manufactured
withi1Hhe specified time period. The production -is followed by quality testing. The Parts
which pass the quality check are assembled, packages, labeled and delivered to the
Marketing department will carry out appropriate product launch activities as well as
planning the sales and service network, advertising and training of sales and service In
actual Practice, the product cycle activities form a closed-loop cycle. The product goes
through a series of continuous refinement and improvemcnts, additions by Obtaining the
feedback from marketing and services leads,
The analysis of sub-process starts with the careftll design of each assembly and each
component of the assembly. The design department creates these designs through a top
down approach or a bottom up approach. In top down approach, the entire assembly is first
designed and individual designs are done latter. In bottmn up approach, the component
design is first done and the product is realized by assembling the components suitably. A
detailed design analysis and optimization are also carried out at this stage• It requires the
design modeling and simulation. The final stage of the analysis sub-process is the design
documentation in the forn of detailed engineering drawings. This detailed design of the
product is given to the process planning department.
(b) Manufacturing process:
-The manufacturing process begins with the process planning and ends with the
product. A process plan is formulated which specifies the sequences of production
operations to be carried out to produce the new product. Sometimes, for the manufacturing
of new product, new equipment and tools may be required which will be ordered at this
stage. In some cases, a special tnanufacturing method is required such as jigs and fixtures or
inspection gauges which may be planned. Based on the process plan, a production schedule
will be prepared and actual production of the product begins. This scheduling provides a
plan to the company that certain quantities of the product should be manufactured within-the
specified time period. The production is followed by quality testing. The parts which pass
the quality check are assembled, packages, labeled and delivered to the
customer. Marketing department will carry out appropriate product launch activities. as well
as planning the sales and service network, advertising and training of sales and service
personnel. In actual practice, the product cycle activities form a closed-loop qycle. The
product goes through a series Of continuous refinement and improvements, additions etc. by
obtaining the feedback from marketing and services leads.
The probleng in the existing product or specification of the new product is »ecified
as to the designers. It includes the specification of physical and
functional characteristic* æt, quality, performance requirements etc.
Cornputer Aided Design and Manufacturing
Step 3: Synthesis:
In this stage, the designer develops a number of designs to meet the requirement of
design brief.
Step 6: Presentation:
After the product design passing through the evaluation stage, drawings, diagrams'
material specification, assembly lists, bill of materials etc. are prepared for the product
manufacturing requirement and given to the process planning department and productio•n
department.
This phase involves the establishment of functions to be included in the design, and
identification and development of suitable solution.
Introduction
(c) Embodiment design:
In this phase, the conceptual solution is developed in more detail, problems are
resolved and weak aspects are eliminated.
Ohsuga describes the design as a series of stages progressing from requirements through
the conceptual design and preliminary design to a detail design. However, the various stages
of design process are generalized into a common form in which models are developed
through a process of analysis and evaluation leading to modification and refinement of
model. At the beginning stage of dese a tentative solution is proposed by the desiY1er. This
tentative solution is evaluated from a number of viewpoints to establish the fitness of a
proposed design in relation to given requirements. If the proposal is unsuitable, then it is
modified. This process is repeated at a point where it can be developed in more depth and the
preliminary design stage starts. In this stage, the design is refined evaluated and modified ata
greater level of details. It is followed by the detailed design which will be more useful for
manufacturing.
The problem identification can be one of the following two general typese
(i) Identification of design need
Design
Process
Marketing gaming
Manufacturirg Q-zllty
All these phases and supporting activities such as quality, testing activities and
marketing activities are carried out one after the other. In Figure 1.9, in each Phase
activities, there is no interaction between them. Therefore, if any changes to be
introdUCed bY the downstream department based on the customer's feedback, the
process has to backtrack and it often involves the additional expenditure as well as
inevitable delay in realizing the
product because each department completes their work and passes over the documentS to the
next department. So, there is no interaction which means a communication barrier existing
between each department. The other name for sequential approach is "over war, or "across
the walP' approach. If a serious mistake in the product•is detected during the final stage, tbe
Introduction 1.13
revision process has to start from design which may result the materials wastage and loss of time.
Therefore, the reduced product life cycles appear a sequential engineering approach which may not
be suitable in the resent lobal scenario.
time.
(3) Because of above reas2ns, the product quality will be low.
(4) If any modifications to be made on the product by downstream departments, it has to be fed
back and it often involves the additional expenditure and also it results unnecessary delay in
the product cycle.
TO achieve this, in thc product planning stage itself, a cooperation work between design
and manufacturing and othcr specialists has tn be made. It is known as "Concurrent
or "SJngg!gægæE2ßlLß-czins?' or "Pgrallel Engineering". It is a methodology Of
restructuring the product development activity in a manufacturing organization using a cross
functional tcam approach, During a concurrent engineering production cycle, se-ueraL teams
work on tg±nique-is adopted to improve the efficiency of
Organisations involve wherever it is possible convert the sequential workflow into
WOrkflow. For example, a planning activity ig made as concurrent shown in Figure 1.10.
Sinec activities start in parallel, the lead-tinte will tvduee. Unlike sequential engineering, in
eoncun•ent engineering. the destgn decisions ate taken by multidtseiplinavy A t»ieal team eonststs
ot- experts (I) tuatetial, (2) pmcess, (3) assetnblys (4) maintenance, (S) marketing. (6) sen•iee
petsonnel, (7) R & l). (S) end usets and (9) ipeeialists in the product related field example: Noise
and vibration specialists. Now, the work of the designer is to evaluate lus design ideas with this
teatn repeatedly in the conceptualization of stage itself. This teatil follows the pmduct frotn
inception to complete produetion and beyond thetu. After getting the approval ti•otn this tentu. the
design of product can be used for further pmeessing. Thetvtsotv. an intensive tentnwork between
product development, production planning and manufacturing teatns IS essential for effective
implementation of concurrent engineering in an organisation.
4. Most of the modification charges are carried out in thoplanning stage itself.
45. Frequent review of design and development process.
J. Rapid prototyping.
7. More attention will be given to satisfy the customer needs and to include newer
Introduction 1.15
1.5.2. Advantages of Concurrent Engineering
I. As the design decisions are taken by a team of multidisciplinary experts, changes and modifications
on the product design will be faster.
2. It has shortcr lead time because all activities are related to product design and the development is
simultaneously carried out.
3. It ensures better quality.
1.5.3. Features for the Success of Concurrent Engineering
Concurrent engineering can be successfully implemented when the whole organization is
involved in it. Everyone accepts that the problems exist and try to solve them together. The
features of concurrent engineering are as follows.
4. In concurrent engineering, all activities are simultaneously started to decrease the lead
time.
5. Concurrent engineering yields high performance, high quality and reliable products with
less lead time.
Concurrent engineering
Sequential engineering
1. Sequential engineering is the term Concurrent engineering is thc term
used to explain the method of used to explain the method of
production in a linear system. production in a non-linear system.
Figure 1.1 (a). Most products created now are designed and drawn using a CAD system. This
system enables the creation of quality products quickly and economically.
Drawing and designing using CAD .technology was introduced by Dr. Ivan Sutherland
from Massachusetts Institute of Technology in 1963 and marketed in 1964. The development
in
CAD system had contributed to the rapid development in many fields making CAD the
choice of engineers and designers. CAD systems enable the designers to view objects under a
wide variety of representations and to test these objects by simulating real-world conditions.
Doglgn and 1.2 Compulor Aldod Manufacturing
friendly) software packages for modeling, drafting, analysig and optimimtion provides the necessary tools to
autonlatc the design process.
Computer Aided Manufacturing (CAM) is the technology concerned with the use of
computer systems to plan, manage and control manufacturing operations. CAM process ig the
subset of manufacturing process. CAM process consists of three major sub-processes such as
CAD, manufacturing and networking shown in Figure 1.1 (b). CAM uses the geometrical
design data to control the automated machineries. CAM systems are associated with Computer
Numerical Control (CNC) or Direct Numerical Control (DNC) systems. These
systems differ from traditional form of Nunzelical Control (NC) in which the geometrical data
are mechanically encoded. Since both CAD and CAM technologies use computer-based
methods for encoding the geometrical data, it is possible for the processes of design and
manufacture to be highly integrated. Integration of CAD and CAM leads to automation.
Computer-aided design and manufacturing systems are commonly referred as CAD/CAM.
(a)
(b)
Figure 1.1 CAD and CAM Processes
Introduction 1.19
Uniform Rational B-Sline) based systems, employing solid modelling technology and they
are parametric and feature based systems.
The use of CAD systems has also been expanded to all industrial sectors such as
AEC, electronics, textiles, packaging, clothing, leather and shoe, etc. Today, numerous
CAD systems are offered by several vendors in various countries.
iterative in nature and it is time-consuming. The computer can be beneficially used in the design process.
The various design related tasks which are performed by a modern computer aided design
system can be grouped into four functional areas.
1. Geometric modeling
2. Engineering analysis
3. Design review and evaluation
4. Automated drafting.
These four areas correspond to the final four phases of Shigley's general design process
illustrated in Figure 1.11.
1. Geometric modeling:
The geometric modeling is concerned with the computer com atible mathematical description of
geometry of an object. The mathematical description should be such that
a) the image of the object can be displayed and manipulated in the computer terminal.
b) the modification on the geometry of the object can be easily done.
c) it can be stored in the computer memory and
l. used to generate basic geometric entities such as points, lines, circles etc.
2. Commands used to do manipulation work such as scaling, translation, rotation etc.
3. Commands used for Boolean operation to form the image of the Object in the computer screen.
2. Engineering analysis:
The computer can be used to aid the analysis work such as stress-strain analysis, heat
transfer analysis, etc. The analysis can be done either by using a specific program genertited
for it or by using generalpurpose software which are commercially available in the market.
The geometric models generated can be used for the analysis by properly interfacing the
modeling software with the analysis software.
problems, computers with larger memory and computational capabilities are required.
The graphical output of FEA is displayed in the computer terminal for better
understanding of results through visualization. Designer can modify/redesign the model and the
analysis can be easily done by using FEA software.
Another review features available in the modeling software are "interference checking".
The dimensions of the mating parts can be checked. In some cases, two components may occupy
the same position in the assembly. These types of errors can be eliminated before involving in
manufacturing activities. Some of the modeling software is provided with kinematic analysis
feature. It can be used for the evaluation purpose. Suppose a new mechanism is to be designed,
the same. mechanism can be simulated in the computer. By animation, the working of the
mechanism can be checked. It will relieve the designer's work from tedious conventional method
of mechanism checking. Another advantage of animating the complete assembly of product is
that whether any component fouls the other components in its working.
Many commercial software are available. One of which ADAMS (Automatic Dynamic Analysis
of Mechanical Systems) is one of the best software for kinematic analysis.
4. Automated drafting:
Automated drafting is the process of creating hard copies of design drawing. The
important features of a drafting software are automated dimensioning, scaling of the drawing
and capable of generating sectional views, enlargement Of minute part details and ability to
generate differept views of the object such as Ofthographic, oblique, isometric and
Perspective views, Thus, CAD systems can increase productivity on drafting•
Introduction
CAD SYSTEM
1.7. ARC
HITECTURE
The basic architecture of CAD system is shown in Figure 1.12. It is an early model
which was used for the basic geometry construction and modeling purposes. In these
early years, it was a common practice to wait in line to use a dedicated CAD terminal
which was used to be installed in a cold, dark climate-controlled room.
In 1980s and early 1990s, open hardware architecture and standard operating system
were begun to appear. General-purpose hardware suppliers started their business. Later, in
late 1990s and early 2000, the advanced CAD systems with latest and sophisticated
features appeared in the market. The architecture of such CAD system is shown in Figure
1.13.
CAD system comprises of geometry of the drawings, associated data and manufacturing
data. The database and working data together are called data/human knowledge.
Another major segment of CAD architecture is the design engine which is composed of s
elements. Software is the computer program(s) running on the
ComputerAided Manufacturing
1.24
hardware. It includes the basic operating system and application software. Today, most CAD
workstations are Windows@-based PCs and some run on hardware running with one of the
provide
UNIX operating systems and a few with Linux. Some others such as NXTM multiplatform
support including Windows@, LNUX, UNIX and Mac OSX.
Designengine
Introduction 1.25
1.8. COMPUTER GRAPHICS
Computer graphics is the technology which uses the display of the drawing or the
geometric model of the component in CAD. Computer graphics may be defined as the process of
creation, storage and manipulation of drawings and pictures with the aid of a computer. It is an
extremely effective medium for communication between users and computers.
In passive computer graphics, the user has no control over the images occurred in display device. The graphic
images can be watched.
In interactive computer graphics (ICG), the user may interact with the graphics and the
program generating them. The user can create, edit and modify -the images according to his needs. The
images created by using a computer can be modified, enlarged, reduced in size, moved to another
location on the screen, rotated and transformed. The concept of interactive computer graphics is shown
in Figure 1.14.
(i) Modeling:
Modeling is the process of creating an object in the computer by using basic primitives such as
points, lines, arc, circle, edges, areas, surfaccs and volumes.
(ii) Storage:
Storage means that the process of storing the created data i.e., model in the memory of the
computer.
1.26
(iii) Manipulation:
CorputerAided Manffactu-og
(iv) Viewing:
Viewing refers the looking of the model in tanous angles, zooming, orthographie
isometric views.
Paintprograms: It allows to create rough freehand drawings. The images are stored
as bit maps and it can easily be edited.
programs particularly for drawing curved lines. The images are usually stored
vector-based formats. Illustration/design programs are often called dråwPrOgr
Presentation graphics software: Bar charts, pie charts, graphics and Other typ
images for slide shows and reports are created. The charts are based on d3tß
imported from spread sheet applications.
Introduction 1.27
Animation soffivare: It enables to chain and sequence a series of images to simulate
the movement. Each image is like a frame in a movie.
CAD software: It enables architects and engineers to draft designs.
Education and training: Training with computer-generated models of specialized systems such
as the training of ship captains and aircraft pilots.
The coordinate system shown in Figure 1.15 (b) is called right handed coordinate system,
since if you place your thumb, index finger and middle finger of the right hand at right angles to
each other they look similar to coordinate axes. The thumb represents the x axis, the index finger
represents the y axis and the middle finger represents the z axis. In
Figure 1.15, if the analysis is done with the left hand, the z axis, is reversed, meaSuring depth
into the page. In this system, z axis is going into the page.
puter Aided Manufacturing
1.28 Com
z z
x
Introduction 1.29
coordinate system. For example, a hand may be positioned relative to an arm and the arm
may be relative to the torso. When the arm moves, the hand will move with it and when
the torso moves, all three objects will move together.
1.10. TRANSFORMATIONS
The transformation actually converts the geometry from one coordinate system to thc
other coordinate system. By means of transformation, the images can be enlarged in size or
reduced, rotated or moved on the screen. It plays a central role in model construction and
viewing the image. Typical CAD commands to translate, rotate, zoom and mirror entities are
based on geometric transformations. They are also used to create animated files of geometric
models to study their motion.
Various display control facilities in computer graphics are (i) vector generation, (ii) windowing aid
viewing transformation (iii) clipping transforlnntion (IV) rclleetion
1.30 Computer Aided Design and Manufacturing
transformation (v) zooming (vi) panning (vii) transmitting information on a network and (viii)
graphics libraries.
h'he aim of a vector display of a curve is to use sufficient display lines for the curve to appear
smooth. The number of lines needed is controlled by the display tolerance which is the
maximum derivation of the vector representation from the true curve shape shown in Figure
1.16. In practice, the lines are drawn between points on the normal curve shape and therefore,
the permissible deviation is inside the curve.
Maximum deviation
Original curve
Figure 1.16 Display tolerance
(ii) Windowing and viewing transformation:
Sometimes, it is necessary-to view only a portion of the drawing in the frill screen if the
draWmg is very large and too crowded in the screen. Different parts of the drawing can thus
be selected for viewing by placing the windows. The window is an imaginary rectangular
frame or boundary through which the looks onto the model: Portions inside the windoW cah
be enlarged, reduced or edited depending upon the requirements. The viewpoint is the area on
the screen in which the contents of the window are to be displayed as an image Figure 1.17
shows a window and a view port. The process of mapping from the model coordinate system
to the screen coordinate system is known as viewing transformation. The viewing
transformation in which no rotation is applied is called windowing transformatim•
The following expressions shows that the transformation of a point (xa, ya) in model co
ordinates to (Xb,Yb) in screen coordinates.
—WX =axa+b
Ya¯Wy +
Figure 1.17 Window and viewport
Drawing
Window
Before clipping
After clipping
Figure 1.18 Clipping transformation
20
(c) Reflection about origin Figure
1.19 Reflection
For getting reflection about X and Y axes (i.e. origin), both the values are negative.
The following Table 1.1 shows the common forms of reflection carried out with their
transformation matrices.
Table 1.1
l. Reflection image about -
Y-axis
O O
1oo
2. 1oo
1
reflection image o
about
X-axis
3.
10
o
5. Reflection image
about liney=—x
0
O
0
0
0 o
1
(v) Zooming transformation:
Zooming transformation is useful for getting the magnified view or enlarged view of particular
part of the drawing. Zooming transformation is a combination of scaling, t•anslation and clipping
transformation processes.
Zooming = Scaling + Translation + Clipping
Screen
(a) Original drawing or Before zooming (b) Zoomed view or After zooming
Generally, the parts of the picture near the observer are bright while those far away are
dim During construction of drawing, the maximum and minimum z co-ordinates are noted.
The z region is then divided into n number of regions. There are n numbers of visible
brightness levels available in the display system. Then, the picture is displayed with the
appropriate intensiiy of brightness along z-axis.
Removing hidden line and surfaces greatly improve the visualization of objects by
displaying clear and more realistic images. A typical example of an object before and after
removal of hidden lines is shown in Figure 1.21. As it is shown, the appearance of the object
is greatly complicated by the visibility of hidden details. Therefore, it is necessary to remove
hidden details such as edges and surfaces. The edges and surfaces which need to be removed
depend on its view port, viewing direction and viewing window. One of the most
challenging problems considered in computervaphics is the determination of hidden edges
and surfaces.
(a) Object before removing hidden lines (b) Object after removing hidden lines
(v) Shading:
This technique is used to display the images a natural way. It is based on the
recognition of distance and shape as a function of illumination. The surface of the solid
model is divided into patches. In regions of large curvature, the patches are reduced in
size, Then each patch is tested for the visibility and required degree of shading. The
hidden lines must be removed before shading.
1.37
Introduction
(pi) Movement:
It leads to a better recognition of displayed objects. When object rotated or translated,
ambiguities that arise due to the superposition of points are eliminated and clear picture are
revealed.
1.11.1. Translation
It is one of the most important. and easily understood transformations in CAD.
Translation is the movement of an object from one position to another position. It is
accomplished by adding the distance through which the drawing is to be moved to the
coordinates of each comer point. Figure 1.22 shows a square object. Let us now consider a
point on the object, represented by P which is translated along x and y axes by added TX and
Ty to a new position P'.
1.11.2. Scaling
Scaling is the transformation applied to change the scale
of an entity. It is done by increasing the distance beFveen
points of the drawing. It means that it can be done by
multiplying the coordinates of the drawing by an enlargement
or reduction factor called scaling factor. The size of the
elitity altered by the application of scaling factor is shown
in Figure 1.23.
Introduction
The new co-ordinates after scaling are given by the following equations:
P= Y'] syxY]
This equation can also represented in a matrix form as
For
1.39
example, Figure 1.24(a) shows a triangle to be scaled before scaling. Figure 1.24(b) shows
the same triangle after scaling. Here, all coordinates of the entity are multiplied by scaling
matrix. Therefore, it is enlarged two times the original one.
1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10
Figure 1.24 Triangle before and after scaling
1.11.3. Reflection
1.11.4. Rotation
rotated Rotation about a is fixed another point. important The final geometric position
transformation and orientation in of CAD. geometry Here, is decided the drawing by theis
angle Of rotation (9) and the base point about which the rotation is to be done. Figure 1.25
shows a rotation transformation of an object about origin O. To develop the transformation
AidedDesignandManufacturin
Computer
g
matrix, consider a point P as the object in XY plane, being rotated in
anticlockwise direction to the new position P 'by an angle 0. The new
position Ptis given by
1.11.5, Shearing
A shearing transformation produces the distortion of an object or an
image. There
(b) Y-Shear
A *shear fransfoms the point (X, Y) to Y') by a shear factor , where
x '-x-Sh Y
10 10
98 9
7 8
6 7
6
5
5
4
3 c 3
2 2
1
1
DI
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
Figure 1.26 X-shear transformation Figure 1.27 Y-shear transformation Figure 1.26
shows X-shear applied to a base drawing represented by A-B-C-D-E. The entity Al-BI-CI-
D I-El represents the X-sheared drawing.
Figure 1.26 shows Y-shear applied to a drawing. Figure 1.27 shows Y-shear applied to a base
drawing represented by A-B-C-D-E. The entity Al-BI-CI-DI-EI represents the Y-sheared drawing.
Translation to A3B3
12345
6789 123456789
(b)
Both scaling and rotation are handled using matrix multiplication which can be
combined. The translations cause a difficulty, however, since they use addition instead of
multiplication. It is essential that all 3 transformations (translation, scaling and rotation)
should be to treat in the same way as multiplications. The solution is to give each point a third
coordinate (X, Y, which will also allow translations to be handled as a multiplication. Two
triples (X, Y, and (X', Y', W') represent the same point if they are multiples of each other. For
example, the homogeneous points (1, 2, 1) and (2, 4, 2) both represent the Cartesian point (l,
2). At least one of the three coordinates must be non-zero. If Wis O, then the point is at
infinity. This situation will rarely occur in practice in computer graphics. If W is non-zero, it
can be divided into triple by W to get the Cartesian coordinates of X and Y which will be
identical for triples representing the same point (X/ W, Y/ W, 1). This step can be considered
as mapping the point from 3D space onto the plane W = 1. Alternatively, if the 2D Cartesian
coordinates of a point are known as (X, Y), then the homogenous coordinates can be given as
(X, Y, l).
The following topics for homogeneous transformation are discussed for the applications
oftranslation, scaling and rotation in 2D coordinates.
In design and picture formation process, the translation process repeatedly needs to be
Performed such as rotations and scaling. It is done for the picture components to exactly fit
into their proper positions. So, the basic transformation process can be expressed by the
generalised matrix form which is given by
1 0 TX
0 1 Ty
ter Aided Design and Manufacturing
1.44 Compu
where Ml = Identity matrix or unit matrix which is denoted by T
M2 = Translation matrix
cos0 sino 0
—sino cos0 0
M2=0
Combining the sequence of various transformations is done by eliminating the matrix addition
associated with the translation terms in M2. So, instead of using 2x2 matrix for Ml' a 3x3 can be
used by introducing the dummy coordinate named as W. This, addition of matrix in coordinate
system is called hontogeneous coordinate system. Theref0ß' all tramsformation equations are
expressed as matrix multiplication. So, this homogenoUS coordinate is represented by a triplet
matrix which is in the form of (Xw, Y'Y,W)
x
where X =—L and Y = w
The value of W should not be zero. So, it is assumed to be non-zero value which may of l. So,
the homogeneous matrix is represented by (X, Y, l). Hence, this approach eliminates
the calculation of intermediate coordinate values and it reduces the memory space required to
store data.
(i) Translation:
The homogeneous coordinates for translation are given by
It can be again
(ii) Rotation:
The homogeneous coordinateSl for rotation are given by
cos O sino O R = —sin0 cos0 () oo
It can be again
written as
1.46
(iii) Scaling:
The homogeneous coordinates for scaling are given by
% 11 = (X Y 11 0 sy O
001
(iv) Shearing:
XP-shear
y-shear
1 2 3 4 5 6 7 8
(i) Translation:
Similar to 2D translation, the translation for 3D is done as follows.
(ii) Scaling:
Introduction
(ii) Reflection:
(iii) Rotation:
1 0o 00
sino
sino —cos0 —cose o o cose sino sino I 0 cose
o 0o o1
Problem
Plane,find
the new coordinatesof it.
O Solution:
1.18. LINE DRAWING straight line forms the basis for the display of all types of shapes
in computer graphics. The following are the requirements for drawing lines.
Suppose, a straight line is to be drawn from point PI (XJ, YD to point P2 (x2, h). For
drawing continuous line, the computer must be able to pick up a number of other pixels
that should be illuminated in addition to two end pixels. The process of turning on the
pixels for a line segment is called vector generation. There are several schemes for
selecting the pixels between the end pixels if the end points of the line segment are
known.
1.18.1. Digital Differential Analyzer (DDA) Algorithm
A popular method uses an algorithm known as "Digital Differential Analyzer" (DDA).
The DDA generates lines from their differential equations. In DDA, the equation of a line
is expressed as a pair ofparametric equations. For a line segment joining two points
Rand P2, a parametric representation is given by
+ -Yi)u
Where the parameter u varies from O to I. If u is incremented by, say 0.2, then the
DDA will generate 4 points in between the two ends of the line. A pixel, however, can
have only Integer CO-ordinates. Therefore, hardware is usually provided which
converts each fractional coordinate into the ncarest integer. Thus, 9.7 is rounded up to
10 and 9.2 is rounded down to 9' Once the address of all the pixels is determined, they
are stored in a frame buffer. The display driver reads the array of addresses and it
illuminates the cozresponding pixels. In order to look a line continuous manner, it is
necessary to increment the parameter u according
x
Figure 1.72 Parametric representing ofa straight line
In thc problem, two given points are (2, 3) and (5, 4). Thcreforc,
Therefore, the parametric representation of x andy components for the given end points
are
x(u) = 2 + 3u Ans.
y(u) 3 + u Ans.
The slope of the line segment can be calculated by
dy dy/du _ y'(u) dx
dx/du x (u)
1
Slope, m = — Ans.
Problem 1.31
Explain DDA algorithm for drawing a straight line connecting two points (4, 9) and (18,
15).
O Solution:
- Il 8-41 = 14
IY2 -yd = 115 91
— 6 = 0.428 x, 14
IYI ¯Y21 6
Y-Ay=
Length 14
+ 0.428
For
16 14.136
14
14.564 15
18 14.992 15
1018.3. Bresenham's Line Algorithm
Brescnham's method is an improvement over DDA algorithm as it completely eliminates
the floating point arithmetic except for initial computations. All other computations arc fully
integer arithmetic and therefore, it is more efficient for raster conversion. The disadvantages
O
fDDA line drawing algorithm are eliminated by a Bresenham's line algorithm.
The basic principle of Bresenhamts line algorithm is to select the optimum raster
IOCations to represent a straight line. To achieve optimum raster scan, the algorithm always
increments cither x ory by one unit depending on the slope of line. The increment in the other
Variable is determined by examining the distance between actual line location and nearest
Pixel. This distance is called decision variable or error.
As shown in Figure 1.74, the line does not pass through all raster points (pixels). It
Passes through raster point (0, 0) and subsequently crosses three pixels. The. intercept of line
1.132 Computer Aided Design and Manufacturing
with the line x = 1 is closer to the liney = 0, i.e. pixel (l, 0) than to the line y = l, i.e. pixel (l
l). Therefore, in this case, the raster point at (l, 0) better represents the path of the line than
that at (l, I). The intercept of the line with the line x = 2 is closer to the line y = I, i.e. pixel
(2, l) than to the line y = O, i.e. pixel (2, 0). Therefore, the raster point at (2, 1) better
represents the path of the line shown in the Figure 1.74. In mathematical terms, a decision
variable or error is defined as
DA = Distance aboe
DB = Distance below
Figure 1.74
Let us consider e = db — da. If e > 0, it means that db > da, i.e., the pixel above the line
is closer to the true line. Similarly, if e < O, it means that db < 'la, i.e., the pixel below the
lineis closer to the true line. Thus, by only checking the sign of etror term, it is possible to
determine the better pixel to represent the line path.
Then according to value Ofe the following actions are taken as mentioned below• when
e 2 0, error is initialized with enew=e + 2 d}' — 2 Ax. It is continued till error 15
negative. In each iteration, x and y are incremented by l .
when e < O, error IS initialized with e
new = e + 2 Ay. In this case, only incremented by
I.
6
11 6 5 5 10
11
11 5 s 5 5 11
11 11 11 5
5 5
11 11
10 10 5
5 5 6 6 11
12 9 9 4 4 7 7 12
12 8 8 4 4 8 8 12
From the above obtained (x, y) points, the circle can be drawn.
1.19. CLIPPING
Many algorithms have been developed for clipping various yaphical elements. The
algorithm determines which points, lines or proportions of lines lie within the
Computer
clipping window. These points, lines or portions of lines are already retained for diéplay All
others are discarded shown in Figure I .77 (b).
PIO
Figure 1.77 (a) Before Clipping
pt5
pt8
where the edges of the clip window (xw xw YW min, mm) can be either the world'
coordinate window boundaries or viewport boundaries. If any one of these four
inequalities f
Aided Design and Manufactun•ng
satisfied, the point will be clipped. The equal sign indicates that the points on the window boundary
completely inside the clipping window or completely outside the window or partially inside
the window. Figure j.77(a) illustrates possible relationships between line positions with the
clipping window. The lines are considered as completely inside the clipping window and
hence, it is visible if both end points of the lines are inside to the window. For example, the
line is completely inside the clipping window. Similarly, lines P3P4 and P9P10 are
completely outside the clipping window and hence, it is invisible. When a line, such as P5P6
is crossing the clipping window boundary, it is essential to calculate the intersection point of
the line (P6') with the clipping boundary to find which part of the line is inside the clipping
window,
The line which crosses more than one clipping boundaries such as line P7P8 requires the
calculation of multiple intersection points to decide the visible portion of them. Figure 1.77(b)
shows the resultant display after clipping. To minimize the intersection calculations and
increase the efficiency of the clipping algorithm, at the beginning, it is completely visible and
invisible lines are identified and then the intersection points are calculated for remaining
lines.
For a line segment with endpoints (Xl, YD and (x2, h) and one or both endpoints outside
and
y *Yl+uCh-Yl)
where 0 S u I
Thi s representation could be used to determine values of parameter u for intersections the
clipping boundary coordinates. If the value of u for an intersection with the clipping
undali
Value ofes is outside the range O to l, then the line is not inside the clipping window. If the u
is Within the range from 0 to l, then the line is inside the clipping window. This can be
applied to each clipping boundary edge to determine the position of lines. Line ents that are
parallel to window edges can be handled as special cases.
1.144 Co mputer
A number of efficient clipping algorithms have been developed in the past. A famous
algorithm is developed by Dan Cohen and Ivan Sutherland which will be discussed here.
example, consider the object shown in Figure 1.77 (a) within the window. The full of the line
end points with reference to the window are shown in Figure 1.78. After assigned 4-digit region
codes for all line endpoints, the system first examines whether the line is fully inside or outside of
the window by the following conditions.
> The line is inside the window if both end points are equal to "0000"
> The line is outside the window if both the end points are not equal to "0000" and a I in the
same bit position for both ends.
For those lines which are partly inside the window, they are split at the window edge and
discard the line segment outside the window.
There may be a possibility when the line may be crossing two regions as shown a line P7P8
in Figure I .77 (a). In this case, the intersection point is found and the line segment outside
the window is discarded.
1.19.3.
Polygon
Clipping
Figure 1.79
Figure 1•79 shows an ambiguity of the above described algorithm. The clipping of two rent
geometries produces same results. This ambiguity can be removed by using developed
by Sutherland and Hodgeman.
Polygon can be clipped by processing its boundary as a whole against each
window is accOmplished by processing all polygon vertices against each
clip rectangle Computer
1.14
6
boundary one after the other. Beginning with the initial set of polygon vertices, the polygon
is initially clipped against the left rectangle boundary to produce a new sequence of vertices.
The new set of vertices could then be successively passed to a right boundary clipper, a
bottom boundary clipper and a top boundary clipper as shown in Figure 1.79. At each step, a
new set of output vertices is generated and it is passed to the next window boundary clipper,
Sutherland - Hodgeman polygon clipping algorithnt:
There are four possible cases when processing vertices in the sequence around the
perimeter of a polygon as follows.
If the first vertex of the edge is outside the window boundary and the second vertex of
the edge is inside shown in Figure 1.80(a), then both the intersection point of the polygon
edge with the window boundary and the second vertex are added to the output vertex list.
If both input vertices of the edge are inside the window boundary shown in Figure 1.80
(b), then only the second vertex is added to the output vertex list..
Ifthe first vertex of the edge is inside the window boundary and the second vertex of the
edge is outside shown in Figure 1.80(c), then only the edge intersection with the window
boundary is added to the output vertex list.
Ifboth input vertices are outside the window boundary shown in Figure 1.80(d), nothing
is added to the output list.
In•case (a), VI is outside the boundary and V2 is inside the boundary shown in Figure
So, V '1 and V2 are saved because the lines on the boundary and inside the boundary
are saved as per the algorithm rule.
Similarly, both VI and V2 are inside the boundary shown in Figure 1.81 (b). So, both are
saved in case (b).
In case (c), VI is inside the boundary and V2 is outside the boundary shown in Figure
1.81 (c). So, V '1 and VI are saved.
In case (d), both VI and V2 are outside the boundary shown in Figure 1.81 (d). So,
nothing is saved.
(a) (b)
V2
(d) (c)
Figure 1.81 Processing of edges ofthe polygon against the left window boundmy
1.148 Computer Aided Design and Manufacturing
Once all vertices have been processed for one clip window boundary, the output list
vertices is clipped against the next window boundary. The main advantage of this
is that it can be used tor a clipping window that needs not be a rectangle.
Another is that it can be easily extended to 3D.
Consider the clipping window and lines shown in Figure 1.82. Find the region codes for
each end point and identify whether the line is completely visible, partially visible or
completely invisible.
O Solution:
Figure 1.83 illustrates the clipping window and lines with codes. These codes are
logically checked for ANDing to see the visibility of the line.
Aided Design and Manufactun•ng
Sutherland-Cohen
comparing
can be removed
lines
inside the
1.149
,toduction
10
Figure 1.83
Table 1.5
s. Line Endpoint codes Logical Result
No. ANDing
Displaying an image of a picture involves in mapping the coordinates of the picture into
2PPr0Priate coordinates on the device where the image is to be displayed. It is done tile
use of coordinate transformations known as viewing transformation. In general,
Computer Aided Design and
Manufacturing
Y Wmox
Wmin
YWmax
Window
Aided Design and Manufactun•ng
XWmin XWmax
(a) World coordinates (b) Device coordinates
2, Workstation transformation (W) which maps Normalized Device Coordinate System (NDCS) to
Physical Device Coordinate System (PDCS).
The different display devices may have different screen sizes which are measured in number
ofpixels. The resolution of a screen increases when the number ofpixel in screen is increased.
The sarne size picture is displayed large in size in low resolution screen and small size in high
resolution screen. Our program should be device independent to avoid this Therefore, the
picture coordinates are defined in some other units than pixels.
An intemreter these coordinates to aooropriate Pixel values for the