Computer Aided Engineering
Dr Mervin Herbert
1
Chapter-2 CAD/CAM
Data Structure :
- set of data items/elements related to each
other by a set of relations
- Applying relations to elements of set
results in meaningful object
- from CAD/CAM point of view, data
structure is a scheme, logic and sequence of
steps developed to achieve certain
garphics/nongraphics/programming goal.
2
a) Object
Three types of data structures have been identified to
construct the object
They are based on edges, vertices or blocks
- Set of edges, vertices or blocks are set of data items for each
type
- edges, vertices and blocks are data items
- Connectivity vertices for the first, edge information for the
second and set operators for the third form the set3 of
relations
4
Database:
Casually- files are collection of files
Formally:
Therefore can be viewed as art of storing or
implementation of data structure into computer
from software development point of view:
- First decision on data structure
- next choice of database to implement
such a structure 5
Objective of Database:
to collect and maintain data in central storage that
will be available for operations and decision
making.
1)
- important for integrated CAD/CAM functions
and CIM applications
- database be rich enough to support various phases
of design and manufacturing
- easy access to same database
- inconsistent and conflicting decisions are
inherently eliminated
6
- data is shared by all applications
2)
- with central control both national/
international standards are followed
eg: Dimensioning and tolerancing
- company can develop its internal
stadards
- standards are desirable for data
interchange or migration between systems
7
3)
- access to sensitive data and projects can be
checked and controlled by assigning the user
the proper access code to various parts of
database
4)
- Integrity assures accuracy
- Integrity precedes consistency
- lack of database integrity results in inputting
inconsistent data
8
5)
- compromises can be made while designing
cenralised database to give overall best
performance.
- software designed for design & modeling would
be inadequate for manufacturing functions
9
10
1) Relational database
- data is stored in tables, called relations that
are related to each other
- relations are stored in files which can be
accessed sequentially or in random access
mode
- object is represented by three relations
POINTS, LINE/CURVE, SURFACE
- data structure shown in figure determines
which relations are to be entered by user
and which are calculated automatically
11
12
1) Hierarchical database
- data is represented by tree structure
- top of the tree is root and the superiority or
hierarchy of tree levels
- four levels are required to represent the
object completely
- drawback is asymmetry of tree structure
which makes database programmers to
devote time and effort to solving problems,
introduced by the hierarchy
13
14
1) Network database
- This approach permits modelling of many
to many correspondence more directly than
hierarchical approach.
- disadvantage is its undue complexity both in
the database structure itself and the
associated programming of it
15
Sample network database 16
1) Object oriented database
- Unlike conventional database CAD/CAM requires object
oriented accessing and manipulations.
- coz units of retrieval and storage are design objects and not
individual records in files.
- These design objects also form the basis for ensuring
database integrity upon the insertion, deletion or
modification of component objects
- object oriented model should capture all the relevant
semantics of objects which in turn results in rich well
oriented and complete database readily accessible for
applications
- Object oriented database models include: entity relationship
model, complex object representation, molecular object
representation and abstract data model
17
- abstarct data models close to solid modeling database.
1) Object oriented database
- it employs abstract objects as premitives in
the design of database
18
19
Database Management System
DBMS:
- a software that allows access to use and/
or modify data stored in a database
- DBMS is a layer of software between the
physical database and the users
- DBMS protects the database from users
abuse.
- also shields users from having to deal with
hardware level details by interpreting their
commands and requests 20
21
Database Management System
- Retrieve a line involves few lower level
steps to execute
- DBMS is responsible for all database
related activities such as creating files,
checking for illegal users of database and
synchronizing users access to the database.
22
Database Management System
- DBMS designed for commercial business systems are
too slow for CAD/CAM.
- Handling of graphics data is the are where Commercial
DBMSs tend to break down under shear volume of data
and demand for quick display
- Commercial data mostly contains alphanumeric data
and the objects which are not complex.
- DBMS is directly related to the model it is supposed to
manage
- Relation DBMS requires large CPU time for searching
and sorting data stored in relations/tables
23
Database Management System
- Therefore, concept of database machines wher
DBMS is implemented into hardware that can lie
between CPU and computer exists
24
Database Management System
- requirement of DBMS for CAD are different
from those required for commercial data
processing
- DBMS designed for commercial purpose are not
applicable to CAD/CAM
- CAD/CAM is characterized by many different
data types, and also large number of instsnces of
each type
- CAD/CAM should also support complex
relationship between data items
- CAD/CAM DBMS must support iterative nature
of the design 25
Coordinate systems
- Three types of coordinate systems are needed
in order to input, store, and display model
geometry and graphics
These are
• the model coordinate system (MCS),
( database or world coordinate system)
• The working coordinate system (WCS), and
• the screen coordinate system (SCS).
(device coordinate system )
26
Model coordinate system
- The model coordinate system is defined as the reference
space of the model with respect to which all the model
geometrical data is stored.
- the only cartesian(default) coordinate system that software
recognizes when storing or retrieving geometrical information
in or from a model database.
• Many existing software packages allow the user to input
coordinate information in Cartesian (x, y, z), cylindrical (r,θ ,
z), and/or spherical (r,θ ,φ )
• The X, Y, and Z axes of the MCS can be displayed on the
computer screen.
• The origin of the MCS can be arbitrarily chosen by the user
while its orientation is established by the software.
27
Model coordinate system
• The three default sketch planes of a CAD/CAM system
define the three planes of the MCS, and their intersection
point is the MCS origin.
• When a CAD designer begins sketching, the origin
becomes a corner point of the profile being sketched.
• The sketch plane defines the orientation of the profile in
the model 3D space.
28
Model coordinate system
• In order for the user to communicate properly and
effectively with a model database, the relationship between
the MCS orthogonal (sketch) planes and the model views
must be understood by the user.
• Typically, the software chooses one of two possible
orientations of the MCS in space
• the XY plane is the horizontal plane and defines the model
top view. The front and right side views are consequently
defined by the XZ and YZ planes, respectively. Figure b
shows the other possible orientation of the MCS where
the
• XY plane is vertical and defines the model front view. As a
result, the XZ and the YZ planes define the top and the
right side views, respectively. 29
Model coordinate system
• Existing CAD/CAM software uses the MCS as the default
WCS.
• In both orientations, the XY plane is the default
construction (sketch) plane. If the user utilizes such a
plane, the first face of a model to be constructed becomes
the top or front view, depending on which MCS is used.
• The MCS is the only coordinate system that the software
recognizes when storing or retrieving graphical
information in or from a model database. Many existing
software packages allow the user to input coordinate
information in cartesian (x, y. z) and cylindrical (r, θ, z)
coordinates. This input information is transformed to (x, y.
z) coordinates relative to the MCS before being stored in
the database.
30
Model coordinate system
• Obtaining views is a form of retrieving graphical
information relative to the MCS. If the MCS orientation
does not match the desired orientation of the object being
modeled, users become puzzled and confused.
• Another form of retrieving information is entity
verification. Coordinates of points defining the entity are
given relative to MCS by default. However, existing
software allows users to obtain the coordinates relative to
another system (WCS) by using the proper commands or
modifiers
31
Working coordinate system
32
Working coordinate system
• It is often convenient in the development of geometric
models and the input of geometric data to refer to an
auxiliary coordinate system instead of the MCS.
• This is usually useful when a desired plane (face) of
construction is not easily defined as one of the MCS
orthogonal planes, as in the case of inclined faces of a
model.
• The user can define a Cartesian coordinate system whose
XY plane is coincident with the desired plane of
construction.
• That system is the Working Coordinate System, WCS. It is
a convenient user-defined system that facilitates geometric
construction.
33
Working coordinate system
• It can be established at any position and orientation in
space that the user desires.
• While the user can input data in reference to the WCS, the
CAD software performs the necessary transformations to
the MCS before storing the data.
• The ability to use two separate coordinate systems within
the same model database in relation to one another gives
the user great flexibility.
• Some commercial software refers to the WCS as is
Unigraphics offers an example.
• Other software refers to it as a sketch plane (Pro/E and
SolidWorks) or construction plane.
34
Working coordinate system
• A WCS requires three noncollinear points to define its
XYplane.
• The first defines the origin, the first and the second define
the X axis, and the third points with the first define the Y
axis.
• The Z axis is determined as the cross product of the two
unit vectors in the directions defined by the lines
connecting the first and the second (the X axis), and the
first and the third points (Y axis).
• We will use the subscript w to distinguish the WCS axes
from those of the MCS. The Xw, Ywplane becomes the
active sketch (working) or construction plane if the user
defines a WCS
35
Working coordinate system
• In this case, the WCS and its corresponding Xw,Yw plane
override the MCS and the default sketch plane,
respectively.
• the MCS with its default sketch plane is the default WCS
with its Xw,Yw plane.
• All CAD/CAM software packages provide users with three
standard WCSs {sketch planes) that correspond to the
three standard views: Front, Top, and Right sides.
• The user can define other WCSs or sketch planes.
• There is only one active WCS (sketch plane) at any one
time. If the user defines multiple WCSs in one session
during a model construction, the software recognizes only
the last one and stores it with the model database if the
user stores the model. 36
Working coordinate system
• The model tree displayed by the CAD software shows the
last selected (activated) sketch plane.
• Once a WCS is defined, user coordinate inputs are
interpreted by the software in reference to this system. The
software calculates the corresponding homogeneous
transformation matrix between the WCS and the MCS to
convert these input values into coordinates relative to the
MCS before storing them in the database.
• The transformation equation can be written as:
Pm =[ T ] Pw
where Pm is the position vector of a point relative to the
MCS and Pw is the vector of a point relative to the active
WCS. 37
Working coordinate system
38
Working coordinate system
• Each vector is given by
The matrix [T] is the homogeneous transformation matrix. It
is a 4 x 4 matrix and is given by:
Where [R]mw is the rotation matrix that defines the orientation of the WCS
relative to the MCS and [P]mw org is the position vector that describes the
origin of the WCS relative to the MCS. The columns of[R]mw: give the
direction cosines of the unit vectors in the Xw, Yw and Zw directions
relative to the MCS as shown in Figure .These direction cosines are the 39
components of the unit vectors along the axes of the MCS.
Working coordinate system
• If the WCS axes are along the MCS axes, then the
direction cosines become 1, -1, or 0, and if Xw and Yw are
aligned along the Z and X axes of the MCS, respectively,
the transformation between the WCS and MCS is given
by:
• Observe that one of the matrix in eqn. is inverse of the
other; their manipulation produces the identity Matrix, I.
40
Screen coordinate system
41
Screen coordinate system
• In contrast to the MCS and WCS, the screen coordinate system (SCS)
is defined as a 2D device-dependent coordinate system whose origin is
usually located at the lower left comer of the graphics display, as
shown in Figure.
• The physical dimensions of a device screen (aspect ratio) and the type
of device (raster) determine the range of the SCS. The SCS is mostly
used in view-related clicks such as definitions of view origin and
window or clicking a view to select it for graphics operations.
• A 1024 x 1024 display has an SCS with a range of (0, 0) to (1024,
1024). The center of the screen has coordinates of (512,512).
• This SCS is used by the CAD/CAM software to display relevant
graphics by converting directly from MCS coordinates to SCS
(physical device) coordinates.
• A normalized SCS can also be utilized. The range of the SCS can be
42
chosen from (0, 0) to (I, 1).
Screen coordinate system
• Such representation can be translated by device-dependent codes to the
appropriate physical device coordinates. The third method of defining
an SCS is by using the drawing size that the user chooses.
• If a size A drawing is chosen, the range of the SCS becomes (0,0) to
(11,8.5) while size B produces the range (0,0) to (17,11).
• The rationale behind this method stems from the conventional drawing
board so that the drafting paper is represented by the device screen
• A transformation operation from MCS coordinates to SCS coordinates
is performed by the software before displaying the model views and
graphics. Typically, for a geometric model, there is a data structure to
store its geometric data (relative to MCS), and a display file to store its
display data (relative to SCS).
43
OUTPUT DEVICES
Graphics display- important component- coz quality of displayed
image influences the perception of generated designs on the
CAD/CAM system.
Graphic display- in addition to viewing images, also allows user to
communicate with displayed image by adding, deleting, blanking
and moving graphics entities on the display screen.
- this communication process gives its name Interactive Computer
Graphics(ICG)
- Passive graphics: TV
44
• Various display technologies are now
available to the user to choose from.
• They are based on concept of converting the
computer’s electrical signals, controlled by
the the corresponding digital information,
ito visible images at high speeds.
• Among the available technologies, the CRT
(Cathode Ray Tube) is the most dominating
and one of the effective graphical displays.
45
Other technologies - Laser
- flat panel display
- plasma panel displays
Laser beam - instead of an electron beam traces an image in a film
Flat panel display - Liquid Crystal Display(LCD) and Light
Emitting Diodes(LEDs) used to generate images.
Plasma Panel Displays – Neon bulb bulbs arranged in a panel
which provides medium resolution display.
46
47
Operation of CRT
• Operation is based on the concept of energizing an electron
beam that strikes the phosphor coating at very high speed.
• The energy transfer from the electron to the phosphor coating
due to the impact causes it illuminate anad glow
• A heated cathode emits a high speed electron beam onto a
phosphor coated glass screen.
• The electrons energize the phosphor coating, causing it to
glow at points where the beam makes contact.
• By focusing the electron beam, changing its intensity and
controlling the point of contact against the phosphor coating
through deflector system, beam can be made to generate a
picture on the CRT screen.
48
• The deflection system of the CRT controls the x and y, or
the horizontal and vertical positions of the beam which in
turn are related to the graphics information thro the display
controller which sits between computer and CRT
• The controller receives information from the computer and
converts it into signals acceptable to CRT
Display controller is also called as display processor, display
logical controller or display processing unit
Display Processor performs
- voltage level convergence between computer and CRT
- The compensation for the difference in speed between the
computer and the CRT and
- the generation of graphics and texts
49
• Display processors are furnished with additional
hardware to implement standard graphics
software functions into hardware to improve the
speed of response.
• Such functions include transformations(Scaling
rotation and translation)
50
TYPES OF SCAN TECHNOLOGY
Two types- Based on scan technology used to
control electron beam when generating
graphics on screen. They are
• Random scan , Stroke writing/ line drawing/
random position/ vector writing/ directed
beam.
• Raster scan/ digital TV/ scan graphics
51
• Random scan drawings generated by
drawing vectors/line segments on the creen
in a random fashion
52
STROKE WRITING
• Here electron beam operates
likes a pencil to create a line
image.
• Image is constructed out of a
sequence of straight line
segments.
• Each line segment is drawn by
directing the beam to move Figure: 1 Stroke writing for
from one point to the next generating images in computer
point.
graphics
• Images consists only straight
lines.
RASTER SCAN
• Viewing screen is divided into a large no.
of phosphor picture elements, called
pixels.
• No. of pixels depends on resolution of the
screen.
• No. of pixels ranges from 256X256
(65000points) to 1024X1024(1,000,000
points).
• Each pixel can be made into glow with
different brightness.
Figure: 2 Raster scan approach for
generating images in computer
• Color screens provide different colors and graphics
brightness for pixels.
• Digital scan
• The three existing CRT displays that are based on these
techniques are
1) refresh display
2) Direct View Storage Tube (DVST)
3) Raster display
55
Refresh Display
56
- The deflection system of the CRT is controlled and driven
by the vector and character generators and DACs
- Refresh buffer stores the display file which contains points
lines etc..
- Commands are interpreted and processed by the display
processor
- Electron beam accordingly excites phosphor, which glows
for a short period
• Utilizes stroke writing approach to generate image on CRT
screen.
• The name “REFRESH” denotes the need to regenerate the
image many times per second to avoid flickering.
• Phosphor coating retains the brightness only for short
time.
• To avoid flickering, the picture tubes must be refreshed by
erasing the electron beam to retrace the image repeatedly. 57
DIRECTED BEAM REFRESH
• On densely filled screen it is difficult to avoid
flickering.
• To maintain a steady flicker free image, the screen
must be refreshed at 3least 30 to 60 times per
second, that is, at the rate of 30 to 60 Hz.
• Changes made to the display file by the software
must be synchronized with the display refresh
cycle to prevent the display of an incomplete
picture.
• If the software updates file fast enough animation
to simulate movements is possible, 58
DIRECTED BEAM REFRESH
• On densely filled screen it is difficult to avoid
flickering.
• Advantage of the system is that selective
erasure is possible since the image is
continuously refreshed.
• Animation of the image is also possible with
refresh tube.
• Other names are vector refresh or stroke
writing refresh.
59
DIRECTED BEAM REFRESH
• High resolution 4096x4096 and thus generation
of high quality pictures.
• But need to refresh the picture places a limit on
the number of vectors
• Present limit is many thousand lines which is
adequate for many users but it requires expensive
circuitry
• In addition, being a binary display, the refresh
display is able to generate only two levels of color
intesity
60
Direct View Storage Tube
• Raster Displays-1960s- costly due to required
refresh buffer memory and fast display processor
• Could only display few hundred vectors on the
screen without flicker.
• 1960s DVST was introduced
• It is believed that the emergence of the DVST in
that time had a significant impact on making
CAD/CAM systems affordable for both users and
programmers.
61
Direct View Storage Tube
62
Direct View Storage Tube
• DVST eliminates refresh processors and
consequently refresh buffer used with refresh
display
• It also uses a special type of phosphor that has
a long-lasting glowing effect.
• The phosphor is embedded in a storage tube.
• In addition, the speed of the electron beam in
the DVST is slower than in the refresh display
due to elimination of the refresh cycle.
63
Direct View Storage Tube
• In the DVST. the picture is stored as a charge in
the phosphor mesh located behind the screen’s
surface
• Complex pictures could be drawn without flicker
at high resolution
• Once displayed. the picture remains on the screen
until it is explicitly erased. This is why the
“storage tube” was suggested
• New picture items can be added and displayed
rapidly. However. if a displayed item is erased,
the entire screen must be refreshed and the new
picture displayed.
64
Direct View Storage Tube
• In addition to the lack of selective erasure, the
DVST cannot provide colors, animation and
use of a lightpen as an input device.
• Due to its main advantages of inexpensive
price and high resolution, early turnkey
CAD/CAM systems used storage tubes for
their displays.
65
Raster Display
66
• The inability of the DVST to meet the
increasing demands by various CAD/CAM
• During the late 1970s raster displays based on
standard television technology
• The drop in memory price due to advances in
solid states made large enough refresh buffers
available to support high-resolution displays.
• A typical resolution of a raster display is l280
x 1204 with a possibility to reach 4096 x 4096
as the DVST.
67
In raster displays, the display screen area is divided
horizontally and vertically into a matrix of small
elements called picture elements or pixels, as shown in
Fig.
A pixel is the smallest addressable area on a screen.
An N x M resolution defines a screen with N row's and
M columns. 68
Each row defines n scan line.
A rasterization process is needed in order to display
either a shaded area or graphics entities.
In this process, the area or entities are converted into
their corresponding pixels whose intensity and color are
controlled by the image display system.
Figure shows a schematic of a typical color raster
display. images (shaded areas or graphics entities) are
displayed by converting geometric information into pixel
values which are then converted into electron beam
deflection through the display processor and the
detection system shown in the figure.
69
• If the display is monochrome, the pixel value is
used to control the intensity level or the gray level
on the screen.
• For color displays, the value is used to control the
color by mapping it into a color map.
• The creation of raster-format data from geometric
information is known as scan conversion or
rasterization.
• A rasterizer that forms the image-creation system is
mainly a set of scan-conversion algorithms.
• Due to the universal nod for these algorithms, the
scan conversion or rasterization process is now
hardware implemented and is done locally in the
workstation
70
• There are standard algorithms such as the DDA
(Digital Differential Analyzer) and Bresenham’s
method which are used to draw a line by generating
pixels to approximate the line.
• Similar algorithms exist to draw arcs. text and
surfaces.
• This is why it is possible to create images with
different colors and hollow areas on raster displays.
71
Once CAD/CAM is acquired
- installation
- training
- use
- support
- support
- maitenance
72
Computer Technology in Automation
Most of the automated production systems implemented today
make use of computers. CAD/CAM in addition to its particular
emphasis on the use of computer technology, is also
distinguished by the fact that it includes not only the
manufacturing operations but also the design and planning
functions that precede manufacturing.
To emphasize the differences in scope between automation and
CAD/CAM, consider the following mathematical model:
73
Graphic Standards
CAD/CAM software -------- Application
program supported by graphics system
74
Graphics system performs all graphic related
graphics technique.
In the actual source code –application program-
embedded in the form of subroutine calls
Therefore software becomes inevitably device
dependent
If Input/output device becomes change/obsolete-
associated software also becomes obsolete
This approach was costly- for vendors/ users
75
Need for graphics standard
• Application program portability- Avoids
hardware dependence of program
For eg: program written for DVST can be
transported to support a raster display
• Picture data portability : description and
storage of pictures should be independent of
graphics devices
76
Need for graphics standard
• Text portability- Ensures text associated with
graphics can be represented independent of
hardware
• Object database portability : transporting
design and manufacturing data is of interest to
CAD/CAM users
Eg: Company- cad database- outside vendors
77
Need for graphics standard
• Search for standards-1974- GSPC
• Graphics Standard Panning Committee
• Focus : application program should be
device independent and should interface to
I/P device thro’ device handler and to
graphic display thro’ device driver
• This leads to conceptual organization of
CAD/CAM software
78
Need for graphics standard
• Graphics system devided into two parts
1) Kernel /core system, which is hardware
independent
2) Device driver/ handler which is hardware
dependent
• Kernel system acts as a buffer between
application program & specific hardware to
ensure independence and portability of
79
program
Need for graphics standard
• At Interface A the application program calls
standard functions and subroutines provided by
kernel system thro’ what is called language bindings
• These functions and subroutines call device handler/
driver functions and subroutines at interface B to
complete the task required by application program
• Now CAD/CAM software serves several
generations
• Only the device/ handler/driver is to be written when
80
device becomes obsolete
Need for graphics standard
• 1981- ANSI- American National Standards Institute
ISO GIN
GKS – Graphics Kernel System
-ANSI & ISO standard
- device independent, host system independent
and application independent
- supports both 2D and 3D data & Viewing
- interfaces application program and graphics
81
package at A
PHIGS -
- Intended to support high function
workstation related CAD/CAM applications
- Beyond GKS-3D it offers segmentation
-Defines functions needed to describe a picture
-Such description can be stored and transmitted
from one graphic device to another
82
- lies between GKS / PHIGS & device
handler/driver
- Lowest device independent interface
- Shares many characteristics of CGM
- Designed to interface plotters to GKS / PHIGS
- Not suitable to interface intelligent workstation
83
• Approved in 1981 as ANSI standard
• Enables exchange of model databases among CAD/CAM
systems
• Fuctions at the level of object database
• Accepted by Canada and ANSI in 1983
• Describes test and graphics in the form of sequence of bytes in
ASCII code
84