Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 64

(a) (b)

Figure 1.1 CAD and CAM Processes

1.2. PRODUCT CYCLE


The cycle through which a product goes from development to retirement is called
product life cycle or simply, product cycle. The product cycle includes all activities starting
from identification for product to deliver the finished product to the customer. The product
cycle starts with developing the product concept, evolving the design, engineerino the
product, manufacturing the part, marketing and serviéini.

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.

(a) Design process:


The product cycle begins with the design process. Synthesis and analysis are the two
important sub-processes of the design process. The design process starts with the identification of
need for the particular product. It may be obtained frotn a patent, suggestion of customcrs»
feedback of sales and service department, and market researgh carried out by the marketing
department or from R&D departinent itself. The working principle, mechanisms implied,
functionality and uniqueness of the product are determined during synthesis process. The overall
design in terms of sketches and drawings, shape, functional specifications, ergonomics, aesthetics
etc. arc considered in detail and finalized at this stage.
Design Process

Figure 1.2 Productlife

Design and 1.4 Computer Aided Manufacturing

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.

(b) Manufacturing process:


The manufacturing process begins with the process_planning and ends v./ith the real
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 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.

1.3. DESIGN PROCESS


According to Pahl and Beilz, "Design is the hwnan power to conceive, plan and realize
products that serve human beings in the acconplishmenl of any individual or collective
purpose." Design refers to the process of originating and developing a plan for a product'
structure, system or component. In recent years, several attempts provide a fötlhal description of
stages or elements of the design process, Because ofthe range in design Situation, there has
been someavariation in their•déscriptions but in generål, it is agreed that theidekign progresses
in a step by step manner from identification Of need'f& the problem, ae for solutions
Introduction 1.5
and development of chosen solution to manufacture, test and use. These descriptions of design
are often called models of the design process. The following models are considered namely
Shigley, Pahl and Beitz, Ohsuga and Earle to illustrate them.

1.3.1. Shighely Model


In Shighely's model design process, there are 6z steps to be followed as shown in Figure
1.3.

Step 1: Recognition ofneed:

Problems in the existing products (or)


potential for new products in the
market have to be identified.
Figure 1.3 General design procedure defined by Shigley

Step 2: Definition ofproblem:

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 4: Analysis and Optimization:


Each design from the synthesis stages is analysed and the optimum one is selected. Both
synthesis and analysis are highly iterative. A certain component or subsystem of the overall
system conceived by the designer in the synthesis stage is subjected to analysis. Based on the
analysis, improvements are made and redesigned.
The process is repeated until the design is optimized within all constraints imposed by
designer.
Step 5: Evaluation:
In this stage, optimized design from the previous stage is checked for all specifications
mentioned in the "Design Brief'. Usually, a prototype of the product is developed and
experimentally checked for its performance, quality, reliability and other aspects of product
If any discrepancies/problems are faced, it is recommend to redesign the product which
should be fed back to the designer at the synthesis stage.

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.

1.3.2. Pahl and Beitz Model


Pahl and Beitz model of design process is described in Figure 1.4.

(a) Classification oftask:


This phase involves the collection of information about the design requirements and
the constraints on the design as well as describing them as design specification.

(b) Conceptual design:

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.

(d) Detail design:


In this phase, dimensions, tolerance, materials and form of each individual components of the
design are specified in detail which will be useful for manufacturing.
Figure 1.4 Design process according to Pam and Beitz

Computer Aided Design


and Manufacturing
1.3.3. Ohsuga Model
The Ohsuga model of design process is shown in Figure 1.5. According to Ohsuga desigl,
it is an iterative process.

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.

Figure 1.5 Design process according to Ohsuga model

1.3.4. Earle Model


The steps in the design process prepared by Earle are shown in Figure

1•.6. (i) Problem identification:

The problem identification can be one of the following two general typese
(i) Identification of design need

1.12 Coc-pder%ed Desgn end


(v) Decision:
At this gage, a single design is accepted as solution to the design problea.u By
comparing the cost of manufacturing, weights, ope:ztioazl characteristics and other
data decision will be arrived at the ecd(vi) Implementation:
It is the presentation of the final design concept in workable form as working drawing
and specifications that can be used for the actual production of product.

IA. SEQUENTIAL ENGINEERING


Three major phases of conventional manufacturing process are design, process
planning and manufacturing- All these ph2ses are sequentially carried out. In
of the conventional manufacturing process, the is designed on the basis
of specifications/requirements and methods of manufacturing are decided. In the
process planning phase, manufacturing insü•uctions are given on the basis of rnnhQd--
Qf manufacturing and decoded in the design phase. These instructions are interpreted
ard production works are carried out in the manufacturing phase.

Design
Process
Marketing gaming
Manufacturirg Q-zllty

Errors changes and correctjor•s

Figure 1.9 Sequential engineering approach

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.

1.4.1. Advantages and Disadvantages of Sequential Engineering


Advantages ofsequentialproduct development:
(1) It is very simple and well-defined method and also it allows everyone to remain on the same
page.
(2) It is an enforced-discipline approach.

Disadvantages ofsequential product development:


As the decisions are taken by individuals, product modifications/changes will be slow.
(2) Since each activity is seqygp@iglly carried out, this approach requires longer lead

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.

1.5. CONCURRENT ENGINEERING


In the conventional manufacturing method, bovh design and manufacturing are separated.
Because of this, quality may be lost and design modifications cannot bc possible at the last
stage of production. Global competition pressurizes' the firrfis to produce products with high
performance, reliable and low cost with less lead time.

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.

CcvttputerAKittd Oosign and Manutactuting

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.

Figure 1.10 Concurrent h•orkfl0i1' in the planning stage

I.S.I. Characteristics of Concurrent Engineering


l . Product responsibilities lie on the team of multi-disciplinal)' group.
2. Integration ofdesign, process planning and production will be achieved.
3. Product lead time will be less because cross-functional activities are started

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.

I . In sequential engineering, designers were involved in the design of product. In

concurrent engineering, designer's duty is getting changed. They


are helping to design the product and getting the approval of the design from a product
team.

2. In sequential engineering, everyone is trying to implement the designer idea. But in


concurrent engineering, everyone in the team is involved in the product design and
development activities.
3. Concurrent engineering eliminates the conflicts between departments (such as design,
process Ian and production and inspection departments).

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.

1.5.4. Comparison between Concurrent Engineering and Sequential Engineering


A comparison between concurrent engineering and sequential engineering is madc on the
basis of the following ways.

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.

1.1. INTRODUCTION TO CAD/CAM


Computer Aided Design (CAD) is the technology concerned with the use of computer
systems to assist the creation, modification, analysis and optimization of a design. CAD
process is the subset of the design process. CAD process consists of three major subprocesses
such as design engineering, computer graphics and geometric modeling shown in

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.

1.6.3. CAD Process /


The conventional design process has been accomplished on drawing boards with the design
being documented in the form of a detailed engineering drawing. This process is

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

d) it can also be retrieved back. on the computer screen for review,


analysis or alteration.
In geometric modeling, three types of commands will bc used. They are as follows.

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.

1.2 Computer Aided Design and Manufacturing


0
Convention design process Computer aided design

Figure 1.11 CAD process

The geometric modeling is classified into the following three types.


l. Wire-frame modeling
2. Surface modeling
3. Solid modeling.
Description of each modeling in detail is discussed in later chapters.

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.

Two types of important engineering analysis are as follows.


I. Analysis for mass properties.
2. Finite element analysis (FEA).
By using the mass properties analysis, properties of solid object can
be determined such as surface area, W*ht volume, centre of gravity and moment of inertia.
Similarly, for Plane
Introduction 1.21
surfaces perimeter, area and moment of inertia can be determined. FEA is the most powerful
feature of a CAD system. Here, the object is divided into large number of finite elements. The
entire object can be analysed for stress-analysis, heat transfer analysis etc. For solving FEA

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.

3. Design review and evaluation:


The accuracy of the design can be checked and rectified if it is required in the computer
screen itself. Layering features available in software are very useful for the design review
purpose. For example, by layering procedure, the finish product can be placed over the casting
image of the same product, it is easy to visualize that the allowance given in the casting are
enough or not. Similarly, using the layer procedure, every stage of production can be checked.

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.

Figure 1.12 Basic architecture of CAD system


The architecture of CAD system consists of four major components such as database,
operating system, input-output devises and user interface. Database is composed of CAD
component models, drawings, drawing standards and library data. The working data of the

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

Figure 1.13 Architecture ofadvanced CAD system


Application software is CAD modeling and aqalysis software such as AutoCAD'
ANSYS, SOLIDWORKS, CATIA, IDEAS, Pro-Engineer etc, Generally, no special
hardware is required with the exception of perhaps a high-end OpenGL@-based graphics
card. However, machines with high speed CPUs and large amount of RAM are
recommended for the complex product design. Input/output elements are 'the
machine interface components. The input is generally via a computer mouse and keyboard
but it can also be via a pen and a digitizing graphics tablet, Manipulation of. the
view dB model on the screen is also sometimes done with the use of a space
Mouse/Space Balls systems also support stereoscope glasses for viewing 3D models.

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.

There are two types of computer graphics.


1. Passive computer graphics
2. Interactive computer graphics.

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.

Figure 1.14 Concepts ofIGC


The user can communicate the data with computer through a keyboard and computer can communicate with
user through CRT (Cathode Ray Tube) i.e., monitor of computer.
The following are the functions of the IGC.

(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

Manipulation is used in the construction of model from basic in combs with


Boolean algebra.

(iv) Viewing:

Viewing refers the looking of the model in tanous angles, zooming, orthographie
isometric views.

1.8.1. Advantages of Computer Graphics


The object drawings can be denoted by its geometric model in three dimensions i.e
X, Y and Z coordinates.

Various views of the object such as orthographic, isometric, axonotnetric or perspective


projections can be easily created.

Accurate drawings can be made.

Sectional can be easily created.

Modification of geometric model of objects is easy.

It is easy storage and retrieval of drawings.

Coloured representation of geometric models is possible and also it can be viewed in


any angle.
No need to scale the drawings even though the size of the screen is limitcd•

Drawings can be reused as per our convenience.

1.8.2. Applications of Computer Graphics

Paintprograms: It allows to create rough freehand drawings. The images are stored
as bit maps and it can easily be edited.

Illustration/Design programs: It supports more advanced features than paint

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.

Desktop publishing: It provides a full set of word-processing features as well as fine


control over placement of text and graphics so that newsletters, advertisements,
books and other types of documents can be created.

Education and training: Training with computer-generated models of specialized systems such
as the training of ship captains and aircraft pilots.

hnage processing: Image processing is to apply techniques to modify or interpret existing


pictures. It is widely used in medical applications.

- 1.9. COORDINATE SYSTEMS IN COMPUTER GRAPHICS


In general, there are two types of coordinate systems such as Cartesian coordinate ?
system and polar coordinate system. In Cartesian coordinate system, the axes are represented by
linear distances x, y and z whereas polar coordinate system uses angles such as 0, a and (b.
In a 2-D coordinate system, X axis is generally pointed from left to right and axis is
from bottom to top. When the third coordinate Z is added, it refers to a 3-D coordinate
system. In 3D coordinate system, there is a choice as to whether Z-axis points into the
screen or out of the screen.
1.9.1. Left and Right Handed Coordinate Systems
A 3D coordinate system might be drawn shown in Figure 1.15 (a). The three axes
are understood to be at right angles (orthogonal) to each other. In Figure 1.15 (a), x denotes
the horizontal axis, y refers the vertical axis and z axis is for the depth (coming out of the
page). It is the usual right-handed coordinate system seen in Computer Graphics.

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

(a) (b) (c)

Figure 1.15 Left and right handed coordinate systems

1.9.2. Multiple Coordinate Systems


In a typical graphics program, a number of different coordinate systems are dealt and a
good part of the work is the conversion of coordinates from one system to another systelll
The following are the different coordinate systems used in general.

(i) World coordinate system:


It is also known as the "universe" or sometimes "model" of.a coordinate system. This
is the base reference system for the overall model (generally in 3D) to which all Other
model coordinates relate.
(ii) Object coordinate system:
When each object is created in a modelling program, the modeller must pick some
points to be the origin of a particular object and the orientation of the object to a set of
model axes For example, when modelling a desk, the modeller might choose a point in the
center of the desk top for the origin or the point in the center of the desk at floor level or the
bottom of one of the legs of the desk. When this object is moved to a point in the world
coordinate system, it is really the origin of the object (in object coordinate system) which is
moved to the new world coordinates and all other points in the model are moved by an equal
amount. While the origin of the object model is usually somewhere on the model itself, it
does not have to be• For example, the origin of a doughnut or a tire might be in the vacant
space in the middle•

(iii) Hierarchical coordinate system:


Sometimes, objects in a scene are arranged in a hierarchy so that the "position" Of
one object in the hierarchy is relative to its parent in the hierarchy scheme rather than the
world

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.

(iv) Viewpoint coordinate system:


It is also known as the "camera" of the coordinate system. This coordinate system is
based on the viewpoint of the observer and it changes as they change with their view.
Moving an object "forward" in this coordinate system moves it along the direction that
the viewer happens to be looking at the time.

(v) Model window coordinate system:


It does not need to be confused with desktop windowing systems (MS Windows).
This coordinate system refers to the subset of the overall model that is to be displayed on
the screen. Depending on the viewing parameters selected, the model window may be
rectilinear or a distorted viewing frustum of some kind.

(vi) Screen coordinate system:


This 2D coordinate system refers to the physical coordinates of the pixels on the ;computer
screen based on the current screen resolution.

(vii) Viewport coordinate system:


This coordinate system refers to a subset of the screen space Where the model
window is to be displayed. Typically, the viewport will occupy the entire screen
window or even the entire screen but it is also possible to set up multiple smaller
viewports within a single screen window.

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.

1.10.1. Display Transformation in 2D or 2D DJsplay Control Facllftlos

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.

(i) Vector generation:

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

(iii) Clipping transformation:


Clipping is the process of determining the visible portion of a drawing lying within a window
and discarding the rest. In clipping, each graphic element of the display is examined whether it is
completely inside the window or completely outside the window or crosses a window boundary.
Portions outside the boundary are not drawn. If the element of a drawing crosses the boundary, the
point of intersection is determined and only portions which lie insideare drawn as shown in Figure
1.18. Many algorithms have been developed for clipping various graphical elements. A famous
algorithm is developed by Dan Cohen and Ivan Sutherland which will be discussed later.

Drawing

Window

Before clipping
After clipping
Figure 1.18 Clipping transformation

1.32 Computer Aided Design and Manufacturing


(iv) Reflection transformation:
Reflection or mirror transformation is useful in constructing symmetric models. It allows a copy
of the object to be displayed while the object is reflected about a line or a plane. Figure 1.19 shows
typical examples out of which Figure I. 19 (a) is for reflection about X-axis while Figure 1.19 (b) is
for the reflection about Y-axis. The reflection shown in 1.19 (c) is about Xand Y axes or about the
origin.
x

20
(c) Reflection about origin Figure

1.19 Reflection

For getting reflection about X axis,

P' = [x',y'] = [x,-Yl


It can be given in a matrix form as

where reflection matrix,

For getting reflection about Y-axis,


where

Thus, the geneml transformation matrix will be

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.

1.34 Computer Aided Design and Manufacturing


4. Reflection image 0
about line y = x

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

Figure 1.20 Zooming

(iv) Panning transformation:


The panning transformation is used to move the screen across the work page' it is used to shift
a drawing across the screen as if it was a moving window.

(vii) Transmitting information on a network;


It is used to transfer the data from one device to another device. For this purpose' the data
must be encoded using a protocol, Protocol is a set of rules which Fontrol the exchange of data
between the communicating devices.

(Gil) Graphics librario:


Thsc graphic libraries are used to avoid the unnecessary repeated programs when procramming
the operation is described above.

1.102. Display Transformation in 3D or 3D Display Control Facilities


The three dimensional (3D) transformation process is generally more complex than 2D process
The display devices are mostly in 2D, therefore, it makes 3D viewing process as a complex one. The
following are some of the visualimtion aid for the CAD system user to interpret static 2D projections
of 3D objects.

(i) Perspective projection


(ii) Brightness modulation
(iii) Hidden line removal (iv) Hidden surface removal
(v) Shading
(vi) Movement.

(i) Perspective projection:


Perspective projection is often used for the pictorial projection of large objects. It
enhances the realism of displayed image by providing the viewer with a sense of depth. A
perspective projection is used to represent an object which is too large. In the perspective
projecüon, the projections converge to the eye. Therefore, it may be generated by first
transforming points to the eye co-ordinate system using a parallel viewing transformation.
Then, each point is projected onto the plane of the display screen by a projector passing
through the eye co-ordinate system origin. Projected points may then be connected with lines
to generate a vector display.

(ii) Brightness modulation:

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.

ComputerAided Design and Manufacturing


1.36
(iii) Hidden line removal:

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

Figure 1.21 Hidden line removal


The hidden line elimination can be stated as, "For a given three dimensional scene, a
given viewing point and a given direction eliminate from an appropriate two dimensional
projection ofthe edges andfaces which the observer cannot see".

(iv) Hidden surface removal:


It is also called visible surface determination. It is more generally an image space
process. In this process, an image of object is generated at a particular resolution by
manipulating pixels on a raster display and exploding the ability of raster devices to
display shaded areas. A wide variety of algorithms exists. They include z-buffer algorithm,
Watkin'S algorithm, Warnock's algorithm and Painter's algorithm.

(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. TWO DIMENSIONAL (2D) TRANSFORMATION


During modeling of an object, it becomes necessary to transform the geometry many
times. The transformation actually converts the geometry from one coordinate system to
other coordinate system. The main types of 2D transformation which are often come across
are as follows.
Translation
Scaling
Reflection Rotation
Shearing.

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'.

Figure 1.22 Square before and after translation


1.38 Computer Aided Design and Manufacturing

The new co-ordinate after transformation is given by the


following equation.
Tyl
In matrix form, we can write the above equation as
1
=lx' Y' 11=1X Y
11 0

whereT = Translation matrix.


It is normally the operation used in the CAD system as MOVE
command.

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

where = Scaling matrix

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

Refer Chapter 1.10.1 (iv) in this book Page 1.32.

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

From Figure I .25, the original position is


specified by X = r cos 4)
Y = r sin
The new position P' is specified by
X' = rcos@+0) = r cos 0 cos sin 0 sin = x cos 0

—y sin 0 Y' = r sin 0 cos + r cos 0 sin =


x sin 0 + y cos 0
It can be written in a matrix form as
X' cos0 —sine X sine
cos9 Y

cos0 —sin 0 where= Rotation


matrix. sin 9 cose

Figure 1.25 Geometry before and after Rotational


transformation

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.

A Y-shear transforms the point (X, Y) to (X', Y t) by a shear factor Sh ,


where X' = X
Y'=S/J X+Y

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.

1.12. CONCATENATION OR COMBINED TRANSFORMATION


Many times, it becomes necessary to combine the aforementioned transformations in Order to
achieve required results, In such cases, the combined transformqtion matrix can be Obtained by
multiplying the respective transformation matrices. The sequence of
can be combined into a single transformation using the concatenaiion Process. For
example, a line AB shown in Figure 1,28(a) is to be rotated through 450 in

1.42 Computer Aided Design and Manufacturing


clockwise direction about point A. This process can be achieved by the following three
processes:
(a) Inverse translation of AB to AIBI.
(b) AIBI is then rotated through an angle of 45 0 to •A2B2.

(c) The line A2B2 is then translated to A3B3s

The respective transfomation matrices are given by

For inverse translation

For rotation about Aland

Translation to A3B3
12345
6789 123456789
(b)

Figure 1.28 Concatenation process(combine];


The same effect can be achieved using the concatenated or overall transformation given below,
Introductio

1.13. HOMOGENEOUS COORDINATES


Homogeneous coordinates are another way to represent the points to simplify the way in
which affine transformations are expressed. Homogeneous coordinates unify translation,
rotation and scaling in one transformation matrix.

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

P' =P.MI +M2 (i) For


translation:

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

(ii) For rotation:

cos0 sino 0
—sino cos0 0

where Ml = Rotational matrix which is denoted by R

M2=0

(iii) For scaling:

where Ml = Scaling matrix which is denoted by S


1112=0

To perform above-said transformation processes, the transformed coordinate should be first


fixed. Next, the coordinates are translated followed by rotation. Finally, the rotated coordinates are
scaled to the required value but this sequential transformation process is not efficient. So, the next
step is to move fonvard to identify the efficient way of combining many steps in a single step which
should be a more efficient approach. This approach may help us to attain the final transformation
stage directly from initial coordinates. It mainly avoids the unnecessary calculations for finding
intermediate coordinate values.

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.

1.14. HOMOGENEOUS TRANSFORMATION


All previous cases, except translation, it can be represented as a row vector X, Y and a 2x2
matrix. For uniform representation of all transformations, it can be represented as a product of
a row vector and an appropriate 3x3 matrix. The conversion of a 2D coordinate pair (X, Y) into
a 3D vector can be achieved by representing point a [X Y l]. After multiplying this vector by a
3x3 matrix another homogeneous row vector is obtained [Xl Yl I]. This three dimensional
representation of a two dimensional plane is called homogeneous representation and the
transformation using the homogeneous representation is called homogeneous transformation.
The matrix representation of four basic transformations is given below.

(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

Computer Aided Design and Manufacturing

1.46
(iii) Scaling:
The homogeneous coordinates for scaling are given by

It can be again written as

% 11 = (X Y 11 0 sy O

001
(iv) Shearing:

XP-shear
y-shear

1.15. SOLVED PROBLEMS ON 2D TRANSFORMATIONS

Write 3x 3 hontogeneous coordinate transformation matrix for each of the


following translations.
(i) Shift the image to the right 2 units

(ii) Shift the image up 3 units


(iii) Move the intage down 1 unit and right 1.5 units
(iv) Move the image up 1.5 units and left <
Computer Aided Design and Manufacturing
1.116
8 B(2, 5) Original triangle
7
6
5
4
3
2

1 2 3 4 5 6 7 8

Figure 1.68 Triangle after transforntation

1.17. THREE DIMENSIONAL (3D) TRANSFORMATIONS


It is often necessary to display objects in 3D on the graphics screen. The 2D
transformations as explained in earlier sections can bc cxtcndcd into 3D by adding a Z-axis
parameter. The transformation matrix will now be 4x4. This section deals the simple cases Of
3D transformations.

(i) Translation:
Similar to 2D translation, the translation for 3D is done as follows.
(ii) Scaling:
Introduction

(ii) Reflection:

(iii) Rotation:

Rotation about x-axis (yz plane)

1 0o 00
sino
sino —cos0 —cose o o cose sino sino I 0 cose
o 0o o1

Rotation about y-axis (zx plane)

Rotation about z-axis (xy plane)


sine —cose cos0 sino O O
O0
1•17.1. Solved Problems on 3D 1.117
Transformation

Problem

Plane,find
the new coordinatesof it.
O Solution:

From given coordinates, the coordinate's matrix can be written by rn r 2 1 3


11
Introduction

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.

(a) Lines should appear straight

(b) Lines should terminate accurately

(c) Lines should have constant density / brightness


(d) Line density should be independent of length and angle

(e) Line should be drawn rapidly

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

POI) + (P2-Pl)u Oct' 1


Since P(u) is a position vector, each of the components of P(u) has a parametric
representation x(u) andy(u) between PI and P2. Therefore,

X(u) =XV+ (X2 —Xl) u y(u)

+ -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

1.128 Computer Aided Design and Manufacturing

x
Figure 1.72 Parametric representing ofa straight line

Advantages ofDDA Algorithm:


1. It is the simplest algorithm and it does not need special skills for implementation.
2. It is a faster method to calculate pixel positions than the direct use of straight line
equation which is given by y = mx+C. It eliminates the multiplication of necessary
increments applied in x or y directions to find the Pixel Positions along the line path'

Disadvantages ofDDA Algorithm:


l. Floating point arithmetic in DDA algorithm is still time-consuming.
2. The algorithm is orientation dependent. Therefore, the end point accuracy is poor.

1.18.2. Solved Problemson DDAAlgorithm

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:

For the given points (4, 9) and (18, 15)


X2= 18

- Il 8-41 = 14
IY2 -yd = 115 91

Slope of the line, m = =

— 6 = 0.428 x, 14

¯X21 Length = -14


14 x —Ax =
Length
Aided Design Manufacturing
and

IYI ¯Y21 6
Y-Ay=
Length 14

+ 0.428

For

xz=xl+ 1=4+1 and 9 + 0.428 =9.428


1 2 9
34 567 8 1011 12 13 14 15 16 1718

Figure 1.73 Plotting in a straight line


Similarly,

and = 9.428 + 0.428 = 9.856


and = 9.856 + 0.428 = 10.284
and 10.284 + 0.428 =
10.712
and 10.712+0.428 = 11.14
17 = 9+1= 10 and 11.14+0.428 = 11.568
and
and

Xls= 17+ 1 = and


18 = 14.546 + 0.428 = 14.992

x Calculated y Rounded value ofy


4 9 9
5 9.428
9
6 9.856
10
7 10.284
10
8 10.712
11
9 11.14
11
10 1 1.568
12
11 1 1.996
12
12 12.424
12
13 12.852
13
14 13.28 13
15 13.708 14

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.

The error term is initially set as e = 2 Ay


—Ax where by = Y2 —Y) and = —

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

As already explained in Chapter 1.10.1 in Page 1.32, clipping is the process of


determining the visible portion of a drawing lying within a window and discarding the rest.
In clipping process, each graphic element of the display is examined whether it is
completely inside the window or completely outside the window or crosses a window
boundary. Portions outside the boundary are not drawn. If the element of a drawing crosses
the boundary, the point of intersection is determined and only portions which lie inside are
drawn.
addition to extraction of part of the drawing for viewing, clipping is used in the
following applications.

(i) Identifying visible surfaces in three-dimensional views


(ii) Displaying multi-window environment
(iii)Antialiasing line segments or object boundaries
(iv) Creating objects using solid-modeling procedures, and (v) Drawing
and painting operations.
The region against which an object is to be clipped is called clip window or clipping
Window. Depending on the application, the clip window can be a general polygon or it
can even have curved boundaries. But, it is usually a rectangular shape window shown in
Figure 1.776).

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

Figure 1.77 (b) After Clipping

4.19,1. Point Clipping


Assuming that the clip window is a rectangle in standard position, the points are
said to be interior to the clipping window if X"' min X < X and ywmin

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

are included within the window.

1,19.2. Line Clipping


In order to carry out the clipping operation, it is essential to know whether the lines are

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

the clipping rectangle, the parametric representation is given by

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.

Cohen-Sutherland clipping algoritlun


It is one of the oldest and most popular line-clipping algorithms. The Cohen-Sutherland
line-clipping algorithm quickly detects and dispenses with two common and simple cases. In
this method, all lines are classified to see if they are in, out or partially inside the clipping
window by doing an edge test. For example, if both endpoints of a line lie inside the window
the entire line lies inside the window. It is simply accepted and needs no clipping. The end.
points of the line in a picture are assigned a four-digit binary code called a region code. This
code identifies the location of the point relative to the boundaries of the clipping window,
The code is given as TBRL.

1001 1000 1010

Figure 1.78 TBRL codefor nine regions The

code is identified as follows.

If the point is above top of the window T = l , otherwise T = 0


If the point is above the bottom of the window B = l , otherwise B = O
Aided Design and Manufactun•ng
If the point is above the right of the window R I , otherwise R = O If the
point is above the left of the window L = l , otherwise L = O where, T=
Top, B = Bottom, R = Right and L = Left.
1.145
Mtroduction

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

polygon is the collection of


lines. Therefore, the line
clipping algorithm
can be used directly for
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..

(a) Before clipping (b) Clip left (c) Clip right

(d) Clip top


(e) Clip bottom
Figure 1.80 Polygon clipping
Aided Design and Manufactun•ng
1.147
Litoduction

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.

1.19.4. Solved Problem on Clipping

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

So, this process

lines
inside the

1.149

,toduction

10
Figure 1.83
Table 1.5
s. Line Endpoint codes Logical Result
No. ANDing

1. PJ P2 0000 0000 000 Completely visible

2. P3P4 0001 0001 001 Completely visible

3. 0001 0000 000 Partially visible


4.
P7P% 0100 0010 000 Partially visible

1000 0010 000 Partially visible


10. VIEWING TRANSFORMATION

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

the mapping of a part of a world-coordinate scene to device coordinates is referred as a


viewing transformation. To perform a viewing transformation, window and viewport deal.
A world-coordinate area selected for the display is called a window. An area on a display
device to which a vvindow is mapped is called a viewport. The window defines what is to
be viewed and the viewport defines where it is to be displayed. Figure I .84 illustrates the
mapping of a picture section which falls within a rectangular window onto a designated
rectangular viewport.

Y Wmox

Wmin

YWmax
Window
Aided Design and Manufactun•ng
XWmin XWmax
(a) World coordinates (b) Device coordinates

Figure 1.84 Viewing transformation using standard rectangles


for window and viewport
Several different coordinate systems are given
below.

(a) Word coordinate system (WCS):


WCS describes the picture to be displayed with coordinates.

(b) Physical device coordinate system (PDCS):


PDCS corresponds to a device where the image of* particular is to be displayed'

(c) Normalized device coordinate system (NDCS):


NDCS is one of the coordinate systems in which display area of virtual display device
to unit (1 x l) square whose lower left corner is at origin of the coordinate system•
The viewing transformation is performed by the following transformations•

l. Normalized Transformation (N) which maps Word Coordinate System (WCS) to


Normalized Device Coordinate System (NDCS).

2, Workstation transformation (W) which maps Normalized Device Coordinate System (NDCS) to
Physical Device Coordinate System (PDCS).

1.21. NORMALIZED TRANSFORMATION

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

You might also like