CADCAM Notes Clean
CADCAM Notes Clean
Chapter 1
Introduction to CAD/CAM
1.1 Definitions
1.1.1 CAD
Computer-aided design (CAD) is the process of utilizing computers to create and edit design
models and drawings. CAD is a subset of the design Process which involves:
1. Need
2. Concept
3. Detailed design
• Geometric models
• Animation/ Visualization
• Architectural design
• Structural design
• Aerospace design
EMT 2501: 1.2 History and Evolution of CAD/CAM 2
• Fashion design
In most of these applications, CAD is used to model product geometries and to record non-
geometric design specifications.
1.1.2 CAM
• robotics
• manufacturing systems control (such as flexible manufacturing systems, FMS and automated
manufacturing cells)
CAD/CAM involves the use of CAD to create a physical model of the product that will be used
in manufacturing instead of translating the product from a paper drawing or text streams into a
CAM system.
The real development of CAD/CAM systems started in the 1950s and went through four major
phases of development in the last century.
• The 1950’s was known as the era of interactive computer graphics. MIT’s Servo Mechanisms
Laboratory demonstrated the concept of numerical control (NC) on a three-axis milling
machine. Development in this era was slowed down by the shortcomings of computers at the
time. During the late 1950’s the development of Automatically Programmed Tools (APT)
began and General Motors explored the potential of interactive graphics.
EMT 2501: 1.3 The Architecture of CAD 3
• The 1960s was the most critical research period for interactive computer graphics. Ivan
Sutherland developed a sketchpad system, which demonstrated the possibility of creat-
ing drawings and altercations of objects interactively on a cathode ray tube (CRT). The
term CAD started to appear with the word ’design’ extending beyond basic drafting con-
cepts. General Motors announced their DAC-1 system and Bell Technologies introduced the
GRAPHIC 1 remote display system. In the late 1960s, CNC, DNC concept and minicom-
puters, PLC were introduced.
• During the 1970’s, the research efforts of the previous decade in computer graphics had
begun to be fruitful, and potential of interactive computer graphics in improving productiv-
ity was realized by industry, government and academia. The 1970’s is characterized as the
golden era for computer drafting and the beginning of ad hoc instrumental design applica-
tions. National Computer Graphics Association (NCGA) was formed and Initial Graphics
Exchange Specification (IGES) was initiated.
• In the 1980’s, new theories and algorithms evolved and integration of various elements of
design and manufacturing was developed. The major research and development focus was to
expand CAD/CAM systems beyond three-dimensional geometric designs and provide more
engineering applications. Solid modeling and integration of CAD and CAM was introduced.
In the 1990s: PDM(Product Data Management), CALS(Computer-Aided Acquisition and
Logistics Support), VR (Virtual Reality) concepts were introduced.
The present day CAD/CAM development focuses on efficient and fast integration and automation
of various elements of design and manufacturing along with the development of new algorithms.
There are many commercial CAD/CAM packages available for direct usages that are user-friendly
and very proficient.
The term hardware is used to refer to all those pieces of equipment which are used to implement
computer programs. The majority of todays CAD/CAM systems utilizes open hardware archi-
tecture and standard operating systems. Open hardware architecture implies that CAD/CAM
vendors no longer design and manufacture their own hardware platforms. Instead the CAD/CAM
EMT 2501: 1.3 The Architecture of CAD 4
industry relies upon the giant general-purpose computer companies and smaller firms that spe-
cialize in engineering workstations.
Hardware includes
• the computer with its memory and central processing unit (CPU)
• devices for inputting instructions to the computer, e.g. keyboards, digitizers and tablets
• output devices which gives hard copy from the computer, e.g. printers and plotters.
Computer System
The term computer is used to refer to the processor which controls the operation of a CAD
program.
The heart of a computing system is the CPU. The main functions performed in the CPU are
arithmetic and logic operations. The CPU communicates with the external world through in-
put/output (I/O) devices. The CPU regulates the action of the computer, controlling the input,
storage, manipulation and output of all information and data.
Another important unit of a computer is the memory unit. These are areas where the neces-
sary data or program (sequence of instructions) is stored. The type of memory and its amount
determines the capabilities of a computing system.
EMT 2501: 1.3 The Architecture of CAD 5
The information received from the input devices or retrieved from secondary storage media is
temporarily held in the computer’s memory which is called main memory or internal memory.
The arithmetic logic unit (ALU) of the CPU performs addition, subtraction, comparison and data
transfer between itself and the main memory.
Instructions, numbers and characters are stored in the main memory and manipulated by the
ALU as binary coded words. A word consists of a series of binary digits or bits, each of which has
two states 1 or 0. These states are represented in the microprocessor as on or off.
The control of the computer microprocessor and the way it communicates with the input and
output devices are organized by the operating system software, and program instructions are
converted into binary code by a compiler or interpreter.
The operating system software and compiler occupy space in the memory, reducing the space
available to store other programs and data.
• Read Only Memory (ROM) - This is non-volatile memory which is used to permanently store
instructions. When the computer is switched off, the instructions remain in the memory
ready for use the next time the computer is switched on. Instructions in the ROM cant be
overwritten or erased.
• Random Access Memory (RAM) - This is a volatile memory suitable for storing a variety
of information, provided that the computer remains on. It is RAM which allows the the
user to operate application softwares and temporarily store data in the computer. As soon
as the the computer is switched off, all the information stored in RAM is lost, hence any
information that has to be retained for future use must be stored in an alternative medium,
such as hard disk or secondary storage devices.
Display Devices
The display device forms the most important element in a CAD/CAM system, since on this, most
of the design work and simulation of manufacturing can be graphically displayed. The display
media that are used are:
CRT display
In a CRT display, the heated cathode (electron gun) emits electrons, which are formed into a
stream, accelerated and focused onto a point on the display screen. The display screen contains
a phosphor-coated surface (Figure 1.2) which gets illuminated when speeding electrons hit the
surface, displaying the point on the surface of the screen.
Figure 1.2:
There are basically two types of image drawing techniques that are used in graphic displays:
• Stroke writing
• Raster scan
In stroke writing, the electron gun directly draws the vectors on the screen to generate the image
whereas in raster scan, the whole display surface is divided into a matrix of small dots called pixels
(picture elements) and the electron beam scans the whole surface area line by line, as in that of
a television.
The beam starts at the top left-hand corner and traverses from left to the right of the screen. At
the right-hand end of the screen, the beam moves back along the dotted path to the left-hand
end and starts to refresh the next line. This continues until the bottom right corner of the screen
is reached, when the beam flies back to the top left corner to start all over again. As the beam
traverses along the line, the computer continually turns the beam on or off to create the picture
elements called pixels.
The number of pixels is called the resolution of the monitor. A low resolution professional CAD
screen has 256 lines or information and 312 addressable points on each line, that is 312 × 256 =
79872pixels. High resolution screens have 512 × 512pixels, 1024 × 1024pixels, 1280×1024 and
4096 × 4096 pixels.
CRT is already a mature technology which has the advantages of self-emission, wide viewing
angle, fast response, good color saturation, long lifetime and good image quality. However, a
major disadvantage is its bulky size which makes it unsuitable for portable applications.
EMT 2501: 1.3 The Architecture of CAD 7
The operating principle of plasma display panels (PDPs) is similar to that of fluorescent lamps.
The display itself consists of cells. Within each cell two glass panels are separated by a narrow gap
in which neon-xenon gas is injected and sealed in plasma form (ionized) during the manufacturing
process. The gas is electrically charged at specific intervals when the Plasma set is in use. The
charged gas then emits ultraviolet light which then excites red, green, and blue phosphors to emit
visible light, thus creating a display image. Each group of red, green, and blue phosphors is called
a pixel (picture element).
Although Plasma display technology eliminate the need for the bulky picture tube and electron
beam scanning of traditional televisions, because it still employs the burning of phosphors to gen-
erate an image, Plasma televisions still suffer from some of the drawbacks of traditional televisions,
such as heat generation and screen-burn of static images.
58 Introduction to Flat Panel Displays
TFT substrate
Polarizer
240 µm
Backlight
Diffuser
R Data or column
G electrode
B
Gate or row electrode
80 µm
LC
Polarizer Common substrate
1. Unlike standard CRT and Plasma displays, since there are no phosphors that light up, less
power is needed for both operation and standby modes
2. the light source in an LCD display generates less heat than a Plasma or CRT display
3. Also, because of the nature of LCD technology, there is no radiation emitted from the screen
itself
EMT 2501: 1.3 The Architecture of CAD 9
4. Lighter weight (when comparing same screen sizes) than Plasma and CRT counterparts.
5. No burn-in of static images unlike the Plasma displays which are more susceptible to burn-in
of static images.
These are used to store information for future use. The main categories are as follows,
1. Hard disk - This is located in the CPU of the computer. Hard disks occur in various memory
sizes commonly; 10GB, 20GB, 40GB, 80GB and 160GB - 500GB. The hard disk should be
partitioned to at least two partitions; such as Local Disk C and Local Disk D. The operating
system and application softwares are loaded in one partition, say Local Disk C, while the
other partition is used for storing information. If in case the computer crashes, the partition
with softwares is formatted and softwares are reloaded, hence the information which is stored
in the other partition is not lost.
2. Floppy Disks - These are made of flexible mylar and can be found in sizes such as 3.5”,
5.25” and 8.0”. They are protected with with a stiff plastic outer casing, and a shuttered
aperture in the outer casing allows the magnetic disk to be exposed only when it is inserted
in the floppy disk drive which is located in the CPU of the computer. They are very cheap,
but currently they are not commonly used due to their smaller storage capacity of 1.44M B
and unreliability.
3. Optical Disks - Are suitable for CAD systems where large amounts of information are stored.
They are divided into three types;
(a) Write Once Read Many (WORM) - Are also called CD ROMS (Compact Disk Read-
Only Memory).They are made of clear polycarbonate material coated with material
which changes permanently when heated by LASER. They are restricted to those ap-
plications where information does not need to be erased or modified. Information is
read by an optical read head that moves close to the disk surface.
(b) Magneto-Optic Disk (Rewritable CD) - Uses the heat of a laser in the locality of a
variable magnetic field to alter the magnetic polarity of the coating material. The
direction of polarization is sensed in the reading head and interpreted as a 1 or 0.
These discs can be erased and used for re-recording.
(c) DVD (Digital Video Disk) - Are used for storing multi-media data which is a combi-
nation of sound, graphics and texts. They are able to accommodate large amount of
data.
4. USB Flash drive - This is a more recent addition to the range of secondary storage media. It
consists of a NAND-type flash memory data storage device integrated with a USB (universal
serial bus) interface. USB flash drives are typically removable and rewritable, much smaller
EMT 2501: 1.3 The Architecture of CAD 10
than a floppy disk. Storage capacities ranges from 64 MB to 8 GB with steady improvements
in size and price. USB flash drives offer potential advantages over other portable storage
devices. They have a more compact shape, operate faster, hold much more data, have a more
durable design, and operate more reliably due to their lack of moving parts. Additionally,
it has become increasingly common for computers to be sold without floppy disk drives.
USB ports, on the other hand, appear on almost every current mainstream PC and laptop.
A flash drive consists of a small printed circuit board protected inside a plastic, metal, or
rubberised case, robust enough for carrying with no additional protectionin a pocket or on a
key chain, for example. The USB connector is protected by a removable cap or by retracting
into the body of the drive, although it is not likely to be damaged if exposed. Most flash
drives use a standard type-A USB connection allowing plugging into a port on a personal
computer.
5. Portable hard disks with capacities of up to 500 GB that can be attached to a USB port
drive.
Input Devices
These are devices through which the user/operator communicates with the computer in feeding
it with the necessary information, both graphical and alphanumeric as required. In CAD the
following are some of devices commonly used as input devices;
1. Keyboard - As it will be seen later, the keyboard can be used to draw objects by typing
commands and the specifying the coordinates of each point by typing their values using a
keyboard. This type of input system is very slow and tedious for complex drawings.
2. Mouse - This is a small block with a ball underneath which drives two potentiometers, placed
mutually perpendicular, to record the x and y motions of the mouse on the table. Wires
from the mouse feed the signals to the computer. Its very efficient and inputs data on the
display screen very fast.
3. Graphics tablet system - This is a board that can be placed on the table in front of a display
screen so that it acts as a mimic of the screen area. Selecting a position on the tablet
provides a signal to the computer so that the cursor is driven to a corresponding position on
the screen. Its advantage is that it can have the whole surface curved with menu instructions
hence leaving the screen free for drawing. The tablets x and y-coordinates are represented
as analogue values and so an analogue/digital (A/D) converter is required. The following
common systems are used to obtain the x and y locations on the tablets;
(a) Pantograph - This has two jointed links clamped to the tablet at one end and the
pointer moved over the board at the other. Potentiometers at the joints are calibrated
to give the x and y coordinates of the pointer in terms of the joint angles.
EMT 2501: 1.3 The Architecture of CAD 11
(b) Stylus and Puck - The pen like stylus is used to point at a location on the tablet. Wire
underneath the tablet surface creates a magnetic field that is sensed by a receiver built
into the stylus. A puck is similar to a stylus but uses a magnifying glass for accuracy
(c) Light pen - This is a small pen-sized device with a light sensitive diode at its tip and
connected to the computer by a cable. If the pen is pointed at a glowing spot on the
display screen, the diode detects this and passes a signal to a computer.
(d) Digitizers - The tablet and a stylus can also be used to input data from existing draw-
ings. Since the x and y coordinates of a position on a tablet are captured using the
stylus, the stylus can be used to trace over a drawing and input lines to the computer as
a series of vectors stored in digital form. When used in this way, the tablet is referred
to as a digitizing tablet
The output devices receive data from the computer and provide an output, in form of a hard copy.
There are two main types of output devices, namely printers and plotters.
Printers
The printers may be impact, where images are formed by a striking action or non-impact;
1. Impact printers - Are capable of printing a whole line at a time. They have to come in
contact with the paper and they work in the principle of a type writer in that there is a
physical tool that strikes on a carbon paper (ribbon). The printing head has got an array
of pins, that protrude depending on the character be printed. Example include Dot-matrix
printer.
2. Non-Impact Printers - The printing head does not come into contact with the paper. Ex-
amples include;
(a) Ink-Jet Printers - Are similar to dot-matrix printers except that each dot is formed from
a tiny jet of ink sprayed through a hole and no by striking through a ribbon. They use
a printhead which directs a jet of ink at the paper to create the required shapes
(b) Electrostatic Printers - They create shapes by burning away a thin metallic coating
placed on electrostatically charged dots on the surface a special printing paper.
(c) Laser Printers - They use a fine beam of laser light to create the required shapes.
Plotters
Small x,y plotters have been used for a long time for drawing graphs, but plotters working on the
same principle can be used for producing high quality and accurate engineering drawings. There
are two basic types of plotter, i.e.
EMT 2501: 1.3 The Architecture of CAD 12
1. Flat-bed Plotters - have a flat area on which the paper of any type and thickness is held
either by suction or electrostatic attraction. The pens of various thicknesses and ink colours
are free to move in any direction with plot head providing all the motion
2. Drum Plotters - have a rotating drum over which the paper can move in two directions and
pens are limited to move only across the drum and, with a combination of pen movement
and drum rotation, provides the required motion. Drawings of longer length but sometimes
of lower precision are produced when compared with flatbed plotters.
The operating system software is the interface between the CAD application software and the
hardware. It supervises the operation of the hardware and provides basic functions, including
creating and removing operating tasks, controlling the progress of tasks, allocating hardware
resources among tasks and providing access to software resources such as files, editors, compilers,
and utility programs.
CAD application softwares allow specific tasks such as draughting, modeling and analysis to be
carried out. Without an operating system and A CAD application softwares, the computer is of
little value to the CAD user.
The CAD application software is the collection of programs written to make it convenient for
a user to operate the computer graphics system.It includes programs to generate images on the
display screen, to manipulate the images, and to accomplish various types interaction between the
user and the system. It enables the user to do 2-D and 3-D modeling, drafting and engineering
analysis. The CAD application software is the collection of programs written to make it convenient
for a user to operate the computer graphics system.It includes programs to generate images on the
display screen, to manipulate the images, and to accomplish various types interaction between the
user and the system. It enables the user to do 2-D and 3-D modeling, drafting and engineering
analysis. In general, a Computer Aided Design (CAD) package has three components: a) Design,
b) Analysis, and c) Visualization. A brief description of these components follows.
a) Design: Design refers to geometric modeling, i.e., 2-D and 3-D modeling, including, drafting,
part creation, creation of drawings with various views of the part, assemblies of the parts, etc.
b) Analysis: Analysis refers to finite element analysis, optimization, and other number crunching
engineering analyses. In general, a geometric model is first created and then the model is
analyzed for loads, stresses, moment of inertia, and volume, etc.
Application software is usually operating system dependent. Below are some of the commercial
CAD software systems in the present market.
• AutoCAD and Mechanical Desktop are some low-end CAD software systems, which are
mainly used for 2D modeling and drawing.
• Mid-range 3D CAD system: Low performance system for design techniques: Inventor of
Autodesk, SolidWorks of SolidWorks Corporation, SolidEdge of UGS
• NX, Pro-E, CATIA and I-DEAS (Integrated Design Engineering Analysis Software) are high-
end modeling and designing software systems that are costlier but more powerful. These
software systems also have computer aided manufacturing and engineering analysis capabil-
ities.
• Ansys, Abaqus, Nastran, Fluent and CFX are packages mainly used for analysis of structures
and fluids. Different software are used for different proposes. For example, Fluent is used
for fluids (CFD) and Ansys is used for structures.
• Alibre and CollabCAD are some of the latest CAD systems that focus on collaborative
design, enabling multiple users of the software to collaborate on computer-aided design over
the Internet.
CAD systems are made up of modules which define the functionality of the software. These
modules include:
• 2D basic module: Present on all CAD systems. Used for basic 2D drafting
• Basic 3D/Wireframe module: Describes the edge and outline of curves. It is ambiguous.
• Sculptured surface module (surface modeling): For modeling analytical and free-form sur-
faces
• 3D solid module: This defined the surface and interior details of drawings.
1. Finite Element Analysis: FEA allows for the analysis of complex components by splitting a
shape into smaller, simpler Finite elements, also referred to as a discrete, and the process of
generating them as discretizing the component shape.
2. Volumetric and mass property analysis: Determination of mass, weight, volume, center of
gravity, moment of inertia.
Pro/Engineer of PTC, CATIA of Dassault, Unigraphics NX of
UGS
EMT 2501: 1.3 The Architecture of CAD 14
4. Circuit analysis and simulation: Simulation of network, electronic circuits drawn within a
CAD environment to check for correctness in choice of components and possible conflicts.
Chapter 2
Computer Graphics
2.1 Introduction
Definition: Methods and Technologies for converting data to and from graphics devices via a
computer.
The CAD applications handles the creation, modification and manipulation of geometric models
and the data base that
CSC418 stores
/ CSCD18 the model. The CAD application (CAD
/ CSC2504 system)
Introduction interacts with the
to Graphics
Irrespective of the display hardware, the computer program stores the image in a two-dimensional
Copyright c 2005 David Fleet and Aaron Hertzmann 1
array in RAM of pixel values (called a frame buffer).
A hardware device called a video controller constantly reads the frame buffer and produces the
image on the display. The frame buffer is not a device. It is simply a part of RAM memory that
has been allocated for this purpose. A program modifies the display by writing into the frame
buffer, and thus instantly altering the image that is displayed.
Irrespective of the display hardware, the computer program stores the image in a two-dimensional array in
RAM of pixel values (called a frame buffer). The display hardware produces the image line-by-line (called
EMT 2501: 2.1
raster A hardware device called a video controller constantly reads the frame buffer and produces16
Introduction
lines). the
image on the display. The frame buffer is not a device. It is simply a chunk of RAM memory that has been
allocated for this purpose. A program modifies the display by writing into the frame buffer, and thus instantly
altering the image that is displayed. An example of this type of configuration is shown below.
System bus
CPU
I/O Devices
System bus
Fig. 5: Figure
Raster display
2.2: architectures.
More sophisticated graphics systems, which are becoming increasingly common these days, achieve great speed
by providinggraphics
More sophisticated separate hardware
systems, support,
whichinare
the form of a display
becoming processor (more
increasingly commonly
common theseknown
days,asachieve
a graph-
ics accelerator or graphics card to PC users). This relieves the computer’s main processor from much of the
great speed by providing
mundane separate
repetitive effort hardware
involved support,
in maintaining in the
the frame form
buffer. of a display
A typical processor
display processor will (more
provide
commonlyassistance
known as for aa number
graphics accelerator
of operations or graphics
including card to PC users).
the following:
In some low cost display devices, decreasing the refresh rate to half reduces the cost of the monitor,
a technique known as Interlacing. This gives rise to flickering of the image as only half the screen
EMT 2501: 2.2 Basic Graphical Elements 17
image is refreshed per cycle. This reduces the overhead cost on display control but is not suitable
for dynamic displays where the images changes fast.
The CAD application (CAD system) interacts with the user through a Graphics User Interface
(GUI), a software package that handles both event driven and activities associated with input
devices and display functions such as windows, menus, dialogs and 2-D and 3-D graphics. The
CAD application calls functions in the GUI to accomplish the I/O graphics interactions. At the
same time, the CAD applications handles the creation, modification and manipulation of geometric
models and the data base that stores the model. Certain geometric functions are used in both GUI
and CAD applications. Such functions include, but not limited to coordinate transformations. To
develop a CAD system or applications based on it, knowledge of geometric modeling becomes
crucial.
Graphics programming languages describe objects in terms of basic geometric structures (building
blocks) referred to as output primitives and then group these sets of output primitives into more
CSC418 / complex structures.
CSCD18 / CSC2504Each output primitive is specified with input coordinate data and other
Introduction to Gra
information about the way that object is to be displayed. In CAD these output primitives are the
point, line, circle, arc, polyline and area (rectangular, circular, etc). These primitives are usually
provided by the graphics software which speeds up the process of generating the image.
This section outlines the mathematical principles used in generating these elements.
When drawing a straight line, the computer must generate a series of points between the two ends
of the line corresponding to eachScan
pixel conversion ofturned
that needs to be a circle
on.
Figure 2.3:
y = mx + c
where m is the gradient of the line and c is the point where the line crosses the y-axis. If
we increment in the x-direction by ∆x, a pixel at a time then the corresponding increment
in y-direction is ∆y = m∆x.
The computational accuracy reduces as the line to be drawn moves towards the vertical,
since the slope becomes very large.
2. An alternative and more usual treatment is to consider a point (x,y) which lies along a line
from point (x1 , y1 ) to point (x2 , y2 ) as shown in figure 2.4.
( x2 , y 2 )
Lt
L ( x, y )
( x1 , y1 )
Figure 2.4:
x = x1 (1 − p) + px2
y = y1 (1 − p) + py2
x = x1 + (x2 − x1 )p
y = y1 + (y2 − y1 )p
• p = 0, then x = x1 and y = y1
• p < 0, then the generalized point lies on the opposite side of (x1 , y1 ) from (x2 , y2 )
• p = 1, then x = x2 and y = y2
• p > 1, then the generalized point lies on the opposite side of (x2 , y2 ) from (x2 , y2 ), and
this concept is useful when extending lines.
When calculating which pixels are to be lit to display the line on the graphics screen, the
values of ∆x and ∆y can be calculated by varying ratio p in increments of ∆p. Hence;
∆x = x1 + (x2 − x1 )∆p
∆y = y1 + (y2 − y1 )∆p
The size of ∆p can be optimized by inspection of points (x1 , y1 ) and (x2 , y2 ) to minimize the
number of calculations required to ensure that all pixels between the two points are lit.
This type of calculation takes place in a microchip which is part of the graphics processor
contained in display screens with graphics capability.
Whenever a draw line command is given in a CAD software, this calculation and the asso-
ciated pixel fill are followed.
2.3.2 Circles
( x, y )
R
θ
y1
x1 x
Figure 2.5:
x = x1 + R cos θ
y = y1 + R sin θ
The coordinates of a point on the circle are represented in polar form using the parameter θ, i.e.,
the angle subtended at the center of the circle.
EMT 2501: 2.3 2D Computer Graphics 20
If θ is incremented equally, and the points are joined by a series of straight lines, then a good
representation of a circle is obtained. Also if θ is sufficiently small an almost smooth curve is
formed, however a balance between time spend in processing the routines and accuracy of the
representation is needed.
Just as for straight lines, routines to achieve this calculation are part of a special graphics mi-
crochip.
In CAD softwares the circle can be drawn by defining a complete circle using the positions of two
control points, which are;
• the center of the circle (x1 , y1 ) and a point anywhere on the circumference of the circle (x, y).
In this case, the radius of the circle is calculated by using equation;
p
R = (x − x1 )2 + (y − y1 )2
If a circular arc was to be represented merely by its end points and its radius, the curve could
either be concave or convex. An arc is fully described if its center, its radius and the angles
corresponding to the two end points are specified.
This representation uses the same parametric form as for a full circle, where the end points are
given by;
( x3 , y3 )
( x2 , y 2 )
R
θ2
θ1
( x1 , y1 )
Figure 2.6:
x2 = x1 + R cos θ1
y2 = y1 + R sin θ1
x3 = x1 + R cos θ2
y3 = y1 + R sin θ2
EMT 2501: 2.3 2D Computer Graphics 21
In 2D draughting, its a common practice to define just the positions of the three control points
(x1 , y1 ), (x2 , y2 ) and (x3 , y3 ). The radius of the arc would then be calculated by using the expression
defined for full circles, and the angles θ1 & θ2 are determined using expressions;
− y2 − y1
h i
θ1 = tan
x −x
h y2 − y 1 i
3 1
θ2 = tan−
x3 − x1
The main aim of using a CAD system is to generate a computer based representation of an object.
This is achieved by using one of the following techniques;
Pixel painting graphics package have a number of facilities for drawing pictures quickly on the
screen by use of input devices such as a mouse, stylus or light pen for spreading colour across the
screen in a freehand manner.
This technique is suitable for technical illustrations where the user is more of an artist than an
engineer or draughtsman. More so this approach for representing an object is limited.
Vector-based technique
This is a far more structured approach and uses the software routines discussed in section 2.2
above for generating lines and curves.
For 2D objects, the vertical screen direction is used as the y-axis and the horizontal screen direction
as the x-axis. For CAD systems the (x,y) coordinates of a point on the screen is defined simply
by typing the values of each ordinate , or by fixing the position of the cursor (e.g. by left clicking
a point on the screen using the mouse)
All design models are set in a coordinate system. In computer graphics, there are two coordinate
systems:
The object coordinate system is where the object is defined. The view coordinate system defines
the angle from which to observe the object. An object in the view coordinate system is at a
EMT 2501: 2.3 2D Computer Graphics 22
position and orientation different from that of the same object in the object coordinate system.
Viewing an object from different directions and distances can be achieved by moving the view
coordinate system around using coordinate system transformation.
1. translation - involves moving a point (or the view coordinate frame) linearly from an origin.
The principle and mathematical process behind these transformations are therefore explained in
this section.
In 2D space;
• a line L from point (x1 , y1 ) to point (x2 , y2 ) can be represented in a 2 × 2 matrix as,
~ = x 1 x 2
L
y1 y2
Translation
This is also called dragging. Point (x1 , y1 ) is said to be translated if the x coordinate and y
coordinate are displaced by ∆x and ∆y respectively so that the point moves to a new position
with coordinates (x2 = x1 + ∆x, y2 = y1 + ∆y). That is, the final coordinates of a point after
translation is;
x2 = x1 + ∆x
y2 = y1 + ∆y
The line is translated by two units in the x direction and one unit in the y direction. Determine
the new coordinates of the line.
Solution: The translation values for both ends of the line are the same (which is the case when
translating a line). Hence the new line will be parallel to the old.
The translation matrix for both end points of the line is,
2
T =
1
Scaling
This transformation enlarges or reduces the size of graphical object. If the x coordinate of a point
is scaled by a factor Sx and the y coordinate scaled by Sy , then if the original point is (x1 , y1 ),
the final point is given by,
x2 x1 S x
=
y2 y1 Sy
Hence the transformation matrix for scaling a point about the origin is given as,
Sx 0
T =
0 Sy
If the scaling factors are greater that 1, the transformation also translates the point further from
the origin, while if the factors are less than 1, the transformation also translates the point nearer
to the origin.
Example 2.3.2. Suppose the line in Example 2.3.1 above is scaled by doubling its length, deter-
mine the coordinates of the new line.
EMT 2501: 2.3 2D Computer Graphics 24
Solution: The scaling transformation matrix for each point of the line is;
2 0
T =
0 2
Rotation
If a point (x1 , y1 ) is rotated about the origin of a coordinate axis anticlockwise by angle θ, then
from simple geometry the new point has coordinates given given as,
x2 = x1 cos θ − y1 sin θ
y2 = x1 sin θ + y1 cos θ
Hence the transformation matrix for rotating a point about the origin is given as,
cos θ − sin θ
T =
sin θ cos θ
Example 2.3.3. Suppose the line in Example 2.3.1 above is rotated about the origin of the coor-
dinate axis, determine the coordinates of the new line.
Solution: The rotation transformation matrix for each point of the line is;
In order to concatenate the transformations as shown in equation 2.1, all the transformation
matrices should be multiplicative type. However, as seen earlier, the translative matrix is vector
additive while others are matrix multiplications. The following form could be used to convert the
translation into a multiplication form.
∗
x 1 0 dx x
∗
[P ] = y = 0 1 dy y (2.2)
1 0 0 1 1
Straight lines
A straight line in 3D space can be represented using the same parametric expressions defined for
a 2D line, based upon the positions of the two end points (x1 , y1 , z1 ) and (x2 , y2 , z2 ).
The position of a generalized point (x, y, z) on a 3D line can be determined in terms of the
parameter p (already defined) where;
x = x1 + (x2 − x1 )p
y = y1 + (y2 − y1 )p
z = z1 + (z2 − z1 )p
The parametric value p has the same significance in 3D space as it has in 2D space. This also
applies for pixel generation.
EMT 2501: 2.4 3-D Computer Graphics 26
Circles
A complete circle cannot be uniquely defined in 3D space by the position of its center (x1 , y1 , z1 )
and a point on its circumference (x2 , y2 , z2 ) alone. An infinite number of circles could be defined
using just two control points, therefore the plane in which the 3D circle lies must also be specified
to fully define the circle. Its usually normal to define a third control point denoted as (x3 , y3 , z3 )
which is a point lying on the plane of the circle.
A generalized point on the 3D circle can be defined in terms of two parametric values denoted as
s and t,as;
The parameters s and t can take any value which when applied to above equations define a point
in the plane of the circle.
Circular Arcs
The technique used to define a full circle in 3D space can be used to define a circular arc.
The three control points, that is, the arc center and the two end points can be used to define the
plane of the arc provided that the three are not collinear.
Curves and curved surfaces are more difficult to handle than lines and circles. Curves might be
limited to two dimensions or defined in 3. Surfaces are always in 3-d.
Curves
Curves can be classified as analytical curves or free-form curves. Analytical curves are those curves
defined by an algebraic equation and its coefficients. For example a 2-D parabola has the form
y 2 − 4ax = 0. In order to define a parabolic shape, one selects the equation and the value of the
coefficient a
On the contrast, a free-form curve is drawn free-hand by the designer. For example, there is no
algebraic formula that defines the profile of a sports car.
The most commonly used analytical curves are conic sections: the ellipse, the parabola and the
hyperbola. Equations for conic sections are:
x2 y2
1. Ellipse: a2
+ b2
−1=0
EMT 2501: 2.4 3-D Computer Graphics 27
2. Parabola: y 2 − 4ax = 0
x2 y2
3. Hyperbola: a2
− b2
−1=0
1. Ferguson curve
2. Hermite curve
3. Bezier curve
4. B-spline curve
Surfaces
Surfaces are also classified into analytical surfaces and free-form surfaces.
Assignment: Using examples, describe the two categories of surfaces used in CAD modeling.
The addition of a third dimension of the previously defined 2D transformations adds some com-
plications particularly for rotations.
Translation
Pure linear transformation is little affected by the introduction of the z-axis. In this case the
separate translation values ∆x, ∆y and ∆z can be added independently to each axis to achieve
the new translated coordinates (x2 , y2 , z2 ). Hence;
x2 = x1 + ∆x
y2 = y1 + ∆y
z2 = z1 + ∆z
Scaling
x2 x1 Sx
y2 = y1 Sy
z2 z1 Sz
This can be represented in matrix form as;
x2 Sx 0 0 x1
y2 = 0 Sy 0 y1
z2 0 0 Sz z1
Hence the transformation matrix for scaling a point in 3D about the origin is given as,
Sx 0 0
T = 0 Sy 0
0 0 Sz
Rotation
The rotation about the z-axis is as previously described for a 2D case. This implies if a point
in 3D space is rotated about the z-axis, then there will be no change in the z-coordinate, that is
z2 = z1 . This gives the coordinates of a new point (x2 , y2 , z2 ) when the old point (x1 , y1 , z1 ) is
rotated about the z-axis to be,
x2 = x1 cos θ − y1 sin θ
y2 = x1 sin θ + y1 cos θ
z2 = z1
x2 = x1 cos θ + z1 sin θ
z2 = z1 cos θ − x1 sin θ
y2 = y1
z2 = z1 cos θ + y1 sin θ
y2 = y1 cos θ − z1 sin θ
x2 = x1
EMT 2501: 2.4 3-D Computer Graphics 29
1 0 0 0
0 C −S 0
Rx =
0
(2.8)
S C 0
0 0 0 1
C 0 S 0
0 1 0 0
Ry =
−S
(2.9)
0 C 0
0 0 0 1
C −S 0 0
S C 0 0
Rz =
0
(2.10)
0 1 0
0 0 0 1
Sx 0 0 0
0 Sy 0 0
S= 0
(2.11)
0 Sz 0
0 0 0 1
where C = cos θ, S = sin θ Note: Transformation matrices must be applied in the same order as
the transformation. Otherwise the result will be incorrect.
Example 2.4.1. Point A=[1 3 1]T is translated by Tr=[1 1 1]T , rotated about X-axis, 90o and
then rotated about Y-axis 45o . What is the A’ in the coordinate frame?
Cx = cos 90 = 0
Sx = sin 90 = 1
Cy = cos 45 = 0.707
Sy = sin 45 = 0.707
EMT 2501: 2.4 3-D Computer Graphics 30
1
3
A=
1
Chapter 3
3.1 Introduction
Curves and surfaces are mathematically represented either explicitly, implicitly or parametrically.
Explicit representations of the form y = f (x), although useful in many applications, are axis
dependent, cannot adequately represent multiple-valued functions, and cannot be used where a
constraint involves an infinite derivative. Hence, they are little used in computer graphics or
computer aided design. Implicit representations of the form f (x, y) = 0 and f (x, y, z) = 0 for
curves and surfaces, respectively, are capable of representing multiple-valued functions but are
still axis dependent. However, they have a variety of uses in computer graphics and computer
aided design.
3.1.1 Derivatives
Differentiation is a method to compute the rate at which a dependent output y changes with
respect to the change in the independent input x. This rate of change is called the derivative of
y with respect to x. The derivative of y with respect to x is written
dy
dx
In calculus, the chain rule is a formula for the derivative of the composition of two functions.
dy dy dt
Then = ·
dx dt dx
3.1.3 Interpolation
Interpolation is a method of constructing new data points within the range of a discrete set of
known data points. There are various methods of Interpolation:
2. Linear interpolation
3. Polynomial interpolation
4. Spline interpolation
The general parametric curve representation of a curve (Figure 3.1) is given as:
P = p(t) (3.1)
where t is the parameter, which can have a value from -1 to +1. Generally, 0 ≤ t ≤ 1
P = P (t) = f (t) g(t) h(t) (3.2)
Parametric curves are axis independent, easily represent multiple-valued functions and infinite
derivatives, and have additional degrees of freedom compared to either explicit or implicit formu-
lations and hence, parametric form is the most common form of curve representation in geometric
modeling.
EMT 2501: 3.3 Free-form Curves 33
Free form curves are always represented by parametric polynomial equations. For most engineering
applications, a 3rd degree (cubic) polynomial is sufficient. In this case, point coordinates are
represented by:
x = ax t3 + bx t2 + cx t + dx
y = ay t3 + by t2 + cy t + dy (3.3)
z = az t3 + bz t2 + cz t + dz
where,
T
P (t) = x y z
T = power basis vector
A = coefficient matrix
The tangent property of a curve is important in designing the curve. The tangent to the curve
can be obtained from the derivative of the curve:
3t2
dP dT 2t
Ṗ = =A = A
1
(3.5)
dt dt
0
Introduced by Ferguson in 1964. A long complex curve can be defined by several shorter curve
segments, each having a parametric equation given in Eq. 3.4.
To connect these curve segments together, one must be able to control the starting point, end
point and tangents at these two points.
Substituting the values of the parameter in Eq. 3.4 and Eq. 3.5, 4 equations can be obtained from
which;
2 −3 0 1
−2 3 0 0
A = a b c d = P0 P1 t0 t1 1 −2 1
(3.6)
0
1 −1 0 0
3
2 −3 0 1 t
−2 3 0 0 t2
P (t) = P0 P1 t0 t1 (3.7)
1 −2 1 0 t
1 −1 0 0 1
2
2 −3 0 1 3t
dT −2 3 0 0 2t
Ṗ (t) = A = P0 P1 t0 t1 (3.8)
dt 1 −2 1 0 1
1 −1 0 0 0
Example 3.3.1. A Ferguson curve is defined by two points P0 (0, 0, 0) and 4, 0, 0 and two tangents
t0 = 1 4 0)T and t1 = 1 − 4 0)T .
Solution
3
2 −3 0 1 t
0 4 1 1 −2 3 0 0 t2
P (t) = 0 0 4 −4
1 −2
1 0 t
0 0 0 0
1 −1 0 0 1
3
t
−6 9 1 0 2
t
= 0 −4 4 0 t
0 0 0 0
1
3 2
−6t + 9t + t
= −4t2 + 4t
0
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
0 0.5 1 1.5 2 2.5 3 3.5 4
2
2 −3 0 1
3t
0 4 1 1 −2 3 0 0 2t
Ṗ = 0 0 4 −4
1 −2 1 0 1
0 0 0 0
1 −1 0 0 0
2
3(0.5)
−6 9 1 0 5.5
2(0.5)
= 0 −4 4 0 1 = 0
0 0 0 0 0
0
One shortcoming of the Ferguson curve is that it is difficult to determine the tangents that will
yield the desired shape and especially to decide on the magnitude of the vectors. This shortcoming
was overcome by Bezier.
EMT 2501: 3.3 Free-form Curves 36
In 1972s, the French engineer P. Bezier, while working for the Renault automobile manufacturer,
developed a system of curves that combine the features of both interpolating and approximating
polynomials. In this curve, the control points influence the path of the curve and the first two and
last two control points define lines which are tangent to the beginning and the end of the curve.
Several curves can be combined and blended together.
A cubic Bezier curve is a cubic curve defined by 4 control points. The relationship bewteen the
control points and the curve is given by:
P (0) = P0
P (1) = P3 o
(3.9)
Ṗ (0) = 3(P1 − P0 )
Ṗ (1) = 3(P3 − P2 )
P0 = P (0) = d
P3 = P (1) = a + b + c + d
3(P1 − P0 ) = Ṗ (0) = c
3(P3 − P2 ) = Ṗ (1) = 3a + 2b + c
3
−1 3 −3 1 t
3 −6 3 0 t2
P (t) = P0 P1 P2 P3
−3
(3.10)
3 0 0 t
1 0 0 0 1
and the tangent vector is:
2
−1 3 −3 1 3t
3 −6 3 0 2t
Ṗ (t) = P0 P1 P2 P3
−3
(3.11)
3 0 0 1
1 0 0 0 0
Example 3.3.2. A Bezier curve is defined by 4 control points (3,0,1), (4,0,4), (8,0,4) and
(10,0,1).
(ii) Using the equation from (i), show how the starting point and end point of the curve relate
with the control points.
(iv) Using the equation from (iii), show how the tangent at the starting point and end point relate
with the control points.
Solution
= 0
2
−9t + 9t + 1
At t = 0 and t = 1,
3
P (0) = 0 = P0
1
10
P (1) = 0
1
EMT 2501: 3.3 Free-form Curves 38
Ṗ (t) = 0
−18t + 9
At t = 0, and t = 1,
3 4 3
Ṗ (0) = 0 = 3 0 − 3 0 = 3(P1 − P0 )
9 4 1
6
Ṗ (1) = 0 = 3(P3 − P2 )
−9
Two or more Bezier curves can be blended to provide a desired curve of a complex nature. When
joining curves, slope continuity is maintained by having three collinear points, the middle one
being common to the adjoining curves, as shown.
Figure 3.5: Point P3 is the middle point of the common points P2 , P3 and P4 of curves A and B.
B-spline curves use a blending function, which generates a smooth, single parametric polynomial
curve through any number of points. To generate a Bezier curve of the same quality of smoothness,
we will have to use several pieces of Bezier curves. Unlike the Bezier curve, the degree of the
polynomial can be selected independently of the number of control points. The degree of the
blending function controls the degree of the resulting B-spline curve. The curve has good local
control, i.e., if one vertex is moved, only some curve segments are affected, and the rest of the
curve remains unchanged.
EMT 2501: 3.3 Free-form Curves 39
1. The curve has good local control, i.e., if one vertex is moved, only some curve segments are
affected, and the rest of the curve remains unchanged.
2. The degree of a B-spline can be set independently of the number of control points.
The mathematical derivation of the B-spline curve is complex and beyond the scope of this course.
The equation is of the form:
X
P (t) = Ni,k (t)Pi (3.12)
where
3
−1 3 −3 1 t
1 3 −6 3 0 t2
P (t) = P0 P1 P2 P 3 (3.13)
6 −3 0 3 0 t
1 4 1 0 1
The NURB curve is an extension of the B-spline. The difference between NURB and non-uniform
B-spline introduced in the previous section is the rational feature, denoted by R. A rational
function is defined by the ratio of two functions (a rational number has the form ab .
w i xi
wi yi
Qi
wi zi
(3.16)
wi
In CAD application softwares, the user often defines a set of points the curve must pass through,
and curve fitting algorithms are used to obtain control points, weights and knots.
• Offer a common mathematical form for representing both standard analytic shapes (conics,
quadratics, surface of revolution, etc) and free-from curves and surfaces precisely. B-splines
can only approximate conic curves.
• Provide the flexibility to design a large variety of shapes by using control points and weights.
Increasing the weights has the effect of drawing a curve toward the control point.
The Spline tool in AutoCAD enables you to draw a smooth NURBS (Non-Uniform Rational
B-Spline) curve that passes through or near a given set of points.
3.4 Fractals
Short for fractional dimensional, to define such repetition mathematically. The term fractal is
used to describe graphics of randomly generated curves and surfaces that exhibit a degree of self-
similarity. Fractal geometry has led to the development of computer-based fractal design tools
that can produce very complex random patterns.
n tro d ucti o n
C ha o t i c S ys te ms
5/27/2010 5:24 PM
The mathematics involved is much more complex than for curves. Like curves, surfaces can be
classified as analytical and free-form surfaces.
2. Parametric surfaces: Those defined by parametric equations, examples are surfaces of revo-
lution, ruled surfaces and tabulated cylinder.
Nonparametric Surfaces
1. Planar surface: Is the simplest nonparametric surface. Equation has the general form:
ax + by + cz = 1
2. A cylindrical surface with axis on the z-axis is basically a circle in the X-Y Plane. Equation
has the form:
(x − a)2 + (y − b)2 = r2
3. A spherical surface is defined by its centre (x0 y0 z0 and radius r. Its equation has the form:
p
(x − x0 )2 + (y − y0 )2 + (z − z0 )2 = r2
4. A torus is defined by its center (x0 , y0 , z0 ) and the radius of the meridian and the distance
c from the center of the meridian to the center of the torus.. Its equation has the form:
p
c− (x − x0 )2 + (y − y0 )2 + (z − z0 )2 = r2
Figure 3.8:
Parametric surfaces
1. Tabulated cylinder: A tabulated cylinder is a surface created with the use of a curve P (t)
and a vector V . The equation is:
2. Ruled surfaces: A ruled surface is as a result of blending two curves P1 (t) and P2 (t). This
kind of surface is defined by:
Free-form surfaces are based on free-form curves. The Bezier, B-spline, and NURB surfaces are
formed from the Bezier, B-spline and the NURB curve respectively. To blend points together to
EMT 2501: 3.5 Surfaces 44
form a surface, two parameters t and s are needed. In their most basic form, they are created by
displaying longitudinal spline curves between points defined in 3D space.
Chapter 4
4.1 Introduction
Since engineering objects are mostly 3-dimensional, the model in the form of a drawing must
capture all the details of the design in a two dimensional medium. There are three distinct types
of 3D modeling techniques, namely;
3. Solid modeling
Wire Frame
This method of representing 3D geometry of the edges and vertices merely extends 2D drafting
into 3D drafting.
The model is constructed from a collection of 3D lines and curve segments, and has an appearance
of a frame constructed from wires because none of the faces of the 3D object is fully represented.
Since the model is formed by 3D graphical elements, then the geometry of the model is represented
by the (x, y, z) coordinates of each of the control points. This data is stored in vertex list, which
lists records the vertex identities of the control points required to define each edge fully.
Modification to the position or orientation of the 3D model can be easily done using 3D transfor-
mation and only affects the geometrical data stored in the edge-vertex list.
Since this modeling technique allows easy manipulation and quick display, it is sometimes used
with surface and solid modelers to display the object without waiting for a complete surface
representation which takes a long time to generate.
Advantages:
elopment
power demanded
enation
Figure 4.1: Ambiguity in wireframe models
ut solid object
ls applicable
This method has the following disadvantages;
• A 3-D wire-frame model lacks face information and does not have the volume property.
• Hidden lines in wire frame models cannot be removed, hence it is difficult to interpret
complex objects. However, the use of different colours to differentiate various items or edges
can significantly improve the understanding of a complex wire frame image.
• Since surface features and contour lines are not represented, the wire frame image is am-
biguous and can be misinterpreted.
Surface Models
They utilize the edge vertex definition of the wire frame model as a basis for defining the geometry
Free--form Surface II
Free
of the surface patches which are used to represent the faces of the object.
The surface model has an additional list called the face list which stores the identities of the edges
used to define each surface patch.
The figure 4.3 shows a wire frame image of a cubic block with its associated edge-vertex-face
listing in table 4.1. The model has 8 vertices, 12 straight line edges and six faces.
V6 E10
V7
E9
F6
E12 E11
V5 E7
V8 F4
F3 E6
E8 F5
F2 E2
E5
E1 V3 X
V2 F1
E3
V1 E4 V4
Z x = 60
y = 45
z = 25
Figure 4.3:
Table 4.1:
Vertices Edges Faces
V1 = (0,0,25) E1 = V1 ,V2 F1 = E1 , E 2 , E3 , E 4
V2 = (0,0,0) E 2 = V2 ,V3 F2 = E 4 , E5 , E12 , E8
V3 = (60,0,0) E3 = V3 ,V4 F3 = E1 , E5 , E9 , E 6
V4 = (60,0,25) E 4 = V4 ,V1 F4 = E 2 , E 6 , E10 , E 7
V5 = (0,45,25) E5 = V1 ,V5 F5 = E3 , E 7 , E11 , E8
V6 = (0,45,0) E 6 = V2 ,V6 F6 = E9 , E1 , E11 , E12
V7 = (60,45,0) E 7 = V3 ,V7
V8 = (60,45,25) E8 = V4 ,V8
E9 = V5 ,V6
E10 = V6 ,V7
E11 = V7 ,V8
E12 = V5 ,V8
Each face is defined by four edges. Once the faces have been represented by surface patches, it
becomes possible to display the object with hidden edges. Patterns and colour tones are often
incorporated to enhance the image.
Generating surface models takes significantly longer time than generating wire frame models,
although the routines involved can be undertaken by even the smallest business computers and
therefore all 3D CAD systems provide this option of modeling.
EMT 2501: 4.1 Introduction 48
Surface models are often capable of representing the solid from the manufacturer’s point of view
but have the following limitations:
1. No information regarding the interior of the solid model would be available which would be
relevant for generating the NC cutter data.
2. There is no geometric definition of points that lie inside or outside the surface.
3. The calculation of properties such as mass and inertia would be difficult or impossible.
• Ship hulls
• Telephone handsets
3D Solid Modeling
The model is defined by the volumetric shape it occupies and provides a full and unambiguous
description of 3D shape.
Not only does the solid model represent the full surface geometry of an item, but also the internal
structure which is not usually represented by a surface model.
If a solid model of an object is cut in half as if the item is being fully sectioned, the model would
display new faces where the sectioning plane cuts. If the same operation is done on a surface
model of the object , only a series of new edges would be created where surface patches have been
cut by the sectioning plane.
This method is superior to other modeling techniques for the following reasons:
• Analytical advantage, including automatic display of accurate mass properties and efficient
construction of finite elements.
• Improved simulation of mechanism dynamics, tool path procedures and robot handling.
EMT 2501: 4.1 Introduction 49
In classifying a solid model, its internal representation is usually used. The internal representation
is how a computer stores the model. The external representation is how the picture or image is
displayed. There are six different types of solid internal representation schemes:
1. Primitive instancing
3. Cell decomposition
6. Sweeping
1. Primitive instancing
In this scheme, a composite model for the entire family of objects is parametized and features
on the model can be turned on or off. The dimensions of each feature are set as variables
(parameters). It explains how objects interrelate in terms of dimensions.
An object instance can be defined by assigning values to the parameters and can be used to
represent standard parts which have different dimensions.
• Requires• large
Space is described as a regular array of cells
memory. • Pros
(usually cubes). Each cell is called a Voxel
• Resolution is limited to size and shape of voxel. –E
• A 3D object is represented as a list of filled
o
Used in Biomedical
voxelsengineering e.g for mapping and illustration of living cell structures.
–B
• Con
–M
–R
v
3. Cell decomposition
Is a general class of SOE. A solid is decomposed into simple solid cells with no holes and
Quadtrees
formed as a result of attaching component cells that satisfy certain boundary conditions.
(a) Primitive based. A collection of primitives forming the boundary (polygons, for exam-
ple)
(b) Freeform based (splines, parametric surfaces, implicit forms)
• Vertices V
• Edges E
• Faces F
Each edge must connect two vertices and be shared by exactly two faces. At least three
edges must meet at each vertex
A simple polyhedron must satisfies Euler’s formula:
V −E+F =2
V=8
E = 12
F=6
EMT 2501: 4.1 Introduction 52
V – E + F – H = 2 (C - G)
V=8 V=5 V=6
E = 12 E=8 E = 12
24 – 36 + 15 – 3 = 2 (1 - 1)
F=6 F=5 F=8
• Tolerances
Each CAD system has its own proprietary data format. To transfer data from one CAD system
to another, or between CAD and CAM packages, a translational software has to be written.
A standard data exchange format (intermediate data format) will reduce the need for multiple
translators.
When such a data file is used, each CAD systems needs only one preprocessor and one post-
processor (one set of translators). The preprocessor imports the data into the system and the
postprocessor outputs the file into standard format (Figure 4.11). The most widely accepted
formats are IGES, DXF and STEP.
4.2.1 IGES
IGES (Initial Graphics Exchange Specification) was the first specification for CAD data exchange
published in 1980 as a NBS (National Bureau of Standards) report in USA. IGES version 1.0 was
accepted and released in 1981 as an ANSI standard. All major CAD vendors support IGES and
it is currently by far the most widespread standard for CAD/CAM/CAE data exchange.
4.2.2 DXF
DXF (Data eXchange Format) was originally developed by Autodesk, Inc., the vendor of Au-
toCAD. It has become a ”de-facto” standard among most CAD vendors and is in wide use to
exchange 2D/3D wireframe data. All implementations of AutoCAD accept this format and are
able to convert it to and from their internal representation. A DXF file is a complete represen-
tation of the AutoCAD drawing database thus some features or concepts can’t be used by other
CAD systems. The DXF version R13 supports wireframe, surface, and solid representations.
4.2.3 STEP
STEP (STandard for the Exchange of Product model data) is a new International Standard (ISO
10303) for representing and exchanging product model information. It includes an object-flavored
data specification language, EXPRESS, to describe the representation of the data. STEP defines
also implementation methods, for instance, a physical transfer file, and offers different resources,
e.g. geometric and topological representation.
54
Chapter 5
5.1 Introduction
Another important application of CAD software is carrying out engineering analysis. Checking the
designed object for its functionality is called as engineering analysis. In almost all the engineering
design related projects some or the other analysis is required. It can be stress-strain calculations,
heat transfer measurements, or using differential equations to find the dynamic behavior of the
system, which is being designed.
One of the most common examples of engineering analysis is finite element analysis or FEA. FEA
is one of the most commonly used and powerful feature of the CAD software. To carry out the
analysis of an object by using FEA, the object is divided into finite number of small elements
(usually rectangular or triangular shapes). FEA configures a model for analysis using a complex
system of points or nodes which are connected into a grid called a mesh. This mesh has defined
properties or characteristics, such as material, structural properties, elasticity, etc..
To carry out the analysis of whole object each and every node of the network is analyzed and
their results are synthesized to get the complete analysis of the object. Each and every node
can be analyzed for various properties like stress-strain, heat transfer or any other characteristics
depending upon the type of application. The interrelating behavior of all the nodes gives the
behavior of the whole object.
The CAD software has the option of defining the nodes and network structure as per the designers
requirements or automatically. In the automatic method the user has to merely define certain
elements for finite the finite element model, while the CAD software does the job of computations.
The output of the finite element analysis can be seen on the monitor. If the user finds that the
output results are undesirable, they can change the shape and dimensions of the object and carry
out FEA again.
1. Preprocessing: The user constructs a model of the part to be analyzed in which the geometry
is divided into a number of discrete subregions, or “elements,” connected at discrete points
EMT 2501: 5.2 Finite Element Analysis 55
called “nodes.” The support and loading conditions and material properties are specified in
this stage.
There are different methods that can be used for preprocessing while using CAD system in
conjunction with a FEM software:
(a) Direct linkage in which the geometric model from the CAD system is imported into
the preprocessing part of the finite element software. In this case, some neutral data
format such as DXF, STEP or IGES are used.
(b) A preprocessor being present within the CAD software, which will convert the geometric
model into the finite element mesh and then transmit that data into the preprocessor
of the FEM software which can then assemble the rest of the options such as boundary
conditions. In this case, the element types must be the same.
2. Finite Element Analysis: The dataset prepared by the preprocessor is used as input to
the finite element code itself, which constructs and solves a system of linear or nonlinear
algebraic equations,
Kij uij = fij (5.1)
where u and f are displacements and externally applied forces at the nodal points respec-
tively. The formation of the K matrix is dependent on the type of problem being analyzed.
3. Postprocessing: In the earlier days of finite element analysis, the user would go through reams
of numbers generated by the code, listing displacements and stresses at discrete positions
within the model. It is easy to miss important trends and hot spots this way, and modern
codes use graphical displays to assist in visualizing the results. A typical postprocessor
display overlays colored contours representing stress levels on the model, showing a full-field
picture similar to that of photoelastic or moire experimental results.
• Geometry: geometric model, nodal coordinates, variation of mesh intensity. This is done by
direct entry or from CAD drafting.
• Material properties: Young’s modulus, Poisson’s ratio, density, coefficient of friction, coeffi-
cient of expansion.
The type of elements to be used depend on the actual geometry and the type of problem being
considered. Typical elements available in commercial softwares are given in Figure 5.1.
Stress Analysis in Autodesk Inventor Simulation is an add-on to the Autodesk Inventor assembly,
part, and sheet metal environments.
Static Analysis provides the means to simulate stress, strain, and deformation. Modal Analysis
provides means to find natural frequencies of vibration and mode shapes of mechanical designs.
You can visualize the affects in 3D volume plots, create reports for any results, and perform
parametric studies to refine your design.
2. Apply a force, pressure, bearing load, moment, or body load to vertices, faces, or edges of
the model, or import a motion load from dynamic simulation.
6. View the analysis results in terms of equivalent stress, minimum and maximum principal
stresses, deformation, safety factor, or modal frequency.
7. Add or suppress features such as gussets, fillets or ribs, re-evaluate the design, and update
the solution.
8. Animate the model through various stages of deformation, stress, safety factor, and frequen-
cies.
3. Assign materials. If you define a modal simulation, you can run it now. There is enough
information to see the natural frequencies.
4. Add Constraints.
5. Add Loads.
Safety factor was calculated by using the maximum equivalent stress failure theory for ductile materials. The
stress limit was specified by the tensile yield strength of the material.
Figure 5.4: Typical Equivalent stress contour plot for a cantilever beam using Inventor
3 of 7 5/24/2010 9:58 PM
Importance of performing an analysis of a mechanical part or assembly in the design phase:
1. Determine if the part or assembly is strong enough to withstand expected loads or vibrations
without breaking or deforming inappropriately.
2. Gain valuable insight at an early stage when the cost of redesign is small.
3. Determine if the part can be redesigned in a more cost-effective manner and still perform
satisfactorily under expected use.
EMT 2501: 5.3 Stress Analysis Tool in CAD Sofwares 59
The table below lists all structural results generated by the analysis. The following section provides figures
showing each result contoured over the surface of the part.
Safety factor was calculated by using the maximum equivalent stress failure theory for ductile materials. The
stress limit was specified by the tensile yield strength of the material.
TABLE 6
Structural Results
Name Minimum Maximum
Equivalent Stress 3.613e-002 MPa 237.8 MPa
Maximum Principal Stress -99.66 MPa 167.1 MPa
Minimum Principal Stress -355.7 MPa 60.37 MPa
Deformation 0.0 mm 1.218 mm
Safety Factor 1.156 N/A
FIGURE 1
Equivalent Stress
Chapter 6
6.1 Introduction
Numerical control (NC) refers to the automation of machine tools that are operated by abstractly
programmed commands encoded on a storage medium, as opposed to manually controlled via
handwheels or levers, or mechanically automated via cams alone.
An NC machine tool is functionally the same as a conventional machine tool. The technological
capabilities NC machine tools in terms of machining are no different from those of conventional
ones. The difference is in the way in which the various machine functions and slide movements
are controlled.
The major advantages of NC over conventional methods of machine control are as follows:
• higher precision: NC machine tool are capable of machining at very close tolerances, in some
operations as small as 0.005 mm;
• better quality: NC systems are capable of maintaining constant working conditions for all
parts in a batch thus ensuring less spread of quality characteristics;
• higher productivity: NC machine tools reduce drastically the non machining time. Adjusting
the machine tool for a different product is as easy as changing the computer program and
tool turret with the new set of cutting tools required for the particular part.
• multi-operational machining: some NC machine tools, for example machine centers, are
capable of accomplishing a very high number of machining operations thus reducing signifi-
cantly the number of machine tools in the workshops.
• low operator qualification: the role of the operation of a NC machine is simply to upload the
workpiece and to download the finished part. In some cases, industrial robots are employed
for material handling, thus eliminating the human operator.
EMT 2501: 6.2 CNC Systems 61
The first NC machines were built in the 1940s and ’50s, based on existing tools that were modified
with motors that moved the controls to follow points fed into the system on paper tape. These
early servomechanisms were rapidly augmented with analog and digital computers, creating the
modern computed numerically controlled (CNC) machine tools that have revolutionized the design
process. CNC Machine Tools 343
COLUMN
SPINDLE MOTOR
SPINDLE HEAD
Z
TOOL
X-AXIS TABLE
SERVO
MOTOR X
Y-AXIS SERVO
MOTOR
needed to operateequalsatheparticular
programmed machine
values, thevia
slideamovement
post processor, andisthen
stops. The input loaded
then given to theinto the CNC
machines for production.
Z-axis servomotor Since any particular
to perform the drillingcomponent
operation. The might requireonthe
system switches the use
motor of a number of
driving the spindle carrying the drill and commands the Z-axis servomotor to move at the
different tools such as drills,
programmed saws,
feedrate intomilling cutters
the workpiece etc.,
till the modern machines
programmed depth is reached.oftenThecombine
Z- multiple
axis feedback transducer ensures the correct depth and feedrate. The drill is
tools into a single ”cell”. In other cases, a number of different machines are used with an external then withdrawn
to the desired height and the machine starts the positioning movements to the next location
controller and human orThis
of the drill. robotic operators
procedure that
thus ensures move the
production component
of accurate workpieces.from machine to machine.
In either case, the complex series of steps needed to produce any part is highly automated and
produces a part that closely matches the original CAD design
• Part program
• Drive system
EMT 2501: 6.2 CNC Systems 62
• Machine tool
• Feedback system
The machine control unit (MCU) is further divided into two elements:
1. Data Processing Unit (DPU) which processes the coded data that is read from the tape or
other medium. It tells the CPU specific information such as the position of each axis, its
direction of motion feed and its auxiliary–function control signals.
2. Control-loop unit (CLU) which operates the drive mechanisms of the machine, receives
feedback signals about the actual position and velocity of the axes, and communicates when
operation has been completed
hough the directions of axes for a particular machine tool are generally agreed as shown in the figure,
coordinate system origin is individual for each part to be machined and has to be decided in the very
inning of the process of CNC part programming (Section 9.2).
Control of the travel rate in two or more directions, which is proportional to the distance
moved is called linear interpolation. If Vf is the desired velocity along the line of motion,
the velocities along the two axes Vx and Vy , are:
∆x
Vx = p Vf
∆x2 + ∆y 2
∆y
Vy = p Vf
∆x2 + ∆y 2
When there is position feedback, the NC system is a closed-loop system; otherwise it is an open
loop system. The advantage of a closed-loop system is its positioning accuracy. Majority of NC
systems use a closed loop control system due to the high precision required in NC systems. Most of
these systems control servo-motors (either DC or AC). A position transducer returns the current
table position and when the table reaches the programmed position, the motor stops running.
Open loop control can be found in some light-application NC machines. Open-loop control NC
systems normally use stepper motor drives, where the stepper motor is controlled through a digital
signal. Each pulse of the signal turns the motor a small fixed angle (step angle). This movement is
translated to the table to move a distance of one basic length unit (BLU)- smallest programmable
move of each axis. No feedback to check how close the actual machine movement comes to the
exact movement programmed.
Most modern NCs use a DC or AC servomotor to drive the axes and spindle. Some advantages
of servo-motors are:
• easy to control,
• low cost.
In some large machines, hydraulic drives are used. A hydraulic motor has a larger power/size
ratio. For the same size as a DC motor, it can drive a much larger load at a greater acceleration.
Disadvantages of hydraulic motors:
• increased noise
EMT 2501: 6.2 CNC Systems 65
• difficult maintenance
Pneumatic drives are normally used to drive auxiliary devices attached to the machine. They are
rarely used for motion control due to the difficulty of maintaining a precise continuous motion
and position. Rotational motors use a lead screw and a nut mechanism to convert rotary motion
into linear motion.
The NC system was built using a dedicated vacuum-tube circuit, transistor and relay technology.
Every NC function had to be designed and implemented in the hardware circuits. There was little
system software.
Many of today’s CNC controllers are based on existing micro-computers. The computer operating
system, the development environment and existing software are used in an NC controller. Since
1980, no hard-wired NCs have been produced and NC normally refers to CNC.
• Accuracy
• Repeatability
Accuracy measures how closely an NC machine moves the tool to the programmed position.
NC machine accuracy results from a combination of the control instrumentation, resolution and
hardware accuracy. The control resolution is the minimum length distinguishable by the control
unit. It is called the Basic Length Unit (BLU) and is determined primarily by the axis transducer
and lead screw that are used.
• Tool deflection
• Thermal errors
Repeatability is another measure of machine accuracy. It measures how closely a machine repeats
a given position command. Repeatability is measured as the diameter of a circle enclosing a target
area produced by many repeated experiments.
6.2.6 Interpolation
The method by which contouring machine tools move from one programmed point to the next is
called interpolation. The interpolator controls multiple axes simultaneously to move the tool on a
line, a circle, or a curve. The ability to merge individual axis points into a predefined tool path is
built into most of todays MCUs. There are five methods of interpolation: linear, circular, helical,
parabolic, and cubic. All contouring controls provide linear interpolation, and most controls are
capable of both linear and circular interpolation. Helical, parabolic, and cubic interpolation are
used by industries that manufacture parts which have complex shapes, such as aerospace parts
and dies for car bodies.
1. Linear Interpolator
Linear Interpolation consists of any programmed points linked together by straight lines,
whether the points are close together or far apart (Figure 6.7). Curves can be produced
with linear interpolation by breaking them into short, straight-line segments. This method
has limitations, because a very large number of points would have to be programmed to
describe the curve in order to produce a contour shape. A contour programmed in linear
interpolation requires the coordinate positions (XY positions in two-axis work) for the start
EMT 2501: 6.3 NC Programming 67
and finish of each line segment. Therefore, the end point of one line or segment becomes the
start point for the next segment, and so on, throughout the entire program.
2. Circular Interpolation
The development of MCUs capable of circular interpolation has greatly simplified the process
of programming arcs and circles. To program an arc (Figure 6.8), the MCU requires only
the coordinate positions (the XY axes) of the circle center, the radius of the circle, the start
point and end point of the arc being cut, and the direction in which the arc is to be cut
(clockwise or counterclockwise). The information required may vary with different MCUs.
Figure 6.8: For two-dimensional circular interpolation the MCU must be supplied with the XY
axis, radius, start point, end point, and direction of cu
3. Helical Interpolation
Combines circular and linear motion.
6.3 NC Programming
1. Program start: This includes; program number, input units (mm/inches), tool definition,
cancel canned cycles, return to reference point.
EMT 2501: 6.4 NC Programming Formats 68
5. Tool retract: To clearance height, spindle stop, return to reference point, program reset and
rewind.
Whether a machine uses all incremental or absolute positioning systems depends on the position
transducers used.
Absolute coordinates use the origin as the reference point. This means that any point on the
Cartesian graph can be plotted accurately by measuring the distance from the origin to the point,
first in the X direction, then in the Y direction, and then, if applicable, in the Z direction.
In absolute programming, the G90 command indicates to the computer and MCU that the pro-
gramming is in the absolute mode.
Figure 6.9:
Incremental coordinates use the present position as the reference point for the next movement.
This means that any point in the Cartesian graph can be plotted accurately by measuring the
distance between points, generally starting at the origin.
In incremental programming, the G91 command indicates to the computer and MCU (Machine
Control Unit) that programming is in the incremental mode.
The program format is the arrangement of the data that make up the program. Commands are
fed to the controller in units called blocks or statements.
• Requires each NC block to be of the same length and contain the same number of
characters
• This restriction enables the block to be divided into substrings corresponding to each
of the NC data types.
• Because the block length is invariant, all values must appear even if they are redundant.
• The words are listed in a fixed sequence and separated by pressing the tab key (TAB)
when typing the code.
• Two or more tabs immediately following one another indicate that the data would
normally occupy the null locations are redundant and have been omitted, e.g.
T0010 T01 T07500 T06250 T T T612 EOB
T002 T T08725 T06750 T T T T EOB where T represents a tab character and EOB
is the end of block character.
EMT 2501: 6.4 NC Programming Formats 70
• Places a letter preceding each word and is used to identify the word type and to address
the data to a particular location in the controller.
• The X prefix identifies an X-coordinate word, S identifies spindle speed etc.
• The standard sequence of words in a block for a 3-axis machine is:
N G X Y Z F S T M EOB
e.g
N001 G01 X07500 Y0625 Z1000 F612 S718 EOB
Example: Word Address Format
• Linear interpolation
G01 G94 X050.0 Y086.5 Z100.0 F40 S800
• Circular interpolation
G02 G17 X088.0 Y040.0 R028.0 F30
• Cutter offset
G42 G01 X100.0 Y040.0 D05
6.4.1 NC Words
A block of an NC program consists of several words. A part program written in this data format
is called a G-code program. A G-code program contains the following words:
N, G, X, Y, Z, A, B, C, I, J, K, F, S, T, R, M
EMT 2501: 6.4 NC Programming Formats 71
Each data item must be preceded by the address word, which indicates to which register the item is
to be assigned. For example, a feedrate command of 1.2 inches per minute might be encoded F012;
a cutting tool change command might select tool number 8 by encoding T08; the miscellaneous
command to turn the coolant off would be encoded M09.
The G-codes are grouped into categories such as Group 01, containing codes G00, G01, G02, G03.
which cause some movement of the machine table or head. Group 03 includes either absolute or
incremental programming, while Group 09 deals with canned cycles.
M or miscellaneous codes are used to either turn ON or OFF different functions which control
certain machine tool operations, Several codes may control the same type of operations such as
M03, M04, and M05 which control the machine tool spindle.
1. N-code. The N word specifies the sequence number. It is used to identify the block within
the program. It is useful for program editing. e.g when format is 4, N0010
Note: It is good practice to program N values in increments of 10 or greater to allow
additional blocks to be inserted between two existing blocks.
EMT 2501: 6.4 NC Programming Formats 72
2. G-code. The G-code is called preparatory code or word. It is used to prepare the MCU for
control functions.
3. X-, Y-, Z-, A-, B- and C- Codes. These words provide coordinates positions of the tool. X,
Y and Z define the three translational (cartesian) axis of a machine. A, B and C are used
for rotational axis about X, Y and Z axes.
For circular motion, a circular arc is defined by the start and end points, the center and
the direction. Because the start is always the current tool position, only the end point, the
center and the direction are to be specified. I, J and K are used to specify the center. In
the X-Y plane, X and Y specify the end point. Clockwise or counter-clockwise motions are
specified by G02 and G03 respectively.
4. F-Code. The F-code specifies the feed rate of the tool motion. The F-code must be given
before G01, G02 or G03 can be used. To specify a 150 mm/minute feed rate for the cutting
motion in Figure 6.12, the program would read:
N0100 G02 X7.000 Y2.000 I5.000 J2.000 F150.00
5. S-Code. The S-code specifies the cutting speed/ spindle speed. To specify a 1000 rpm
spindle speed, the program block is:
N0010 S1000
The spindle is turned on by an M-code.
EMT 2501: 6.4 NC Programming Formats 73
6. T-Code. The T-code is used to specify the tool number. It is used only when an automatic
tool changer is present. It specifies the slot number on the tool magazine in which the next
tool is located. Actual too change does not occur until a tool-change M-code is specified.
7. R-code. The R-code is used for cycle parameter. When a drill cycle is specified, the clearance
height (R Plane) must be given. The drill cycle consists of five operations (Figure 6.13).
8. M-Code. The M-code is called the miscellaneous word and is used to control miscellaneous
functions of the machine. such functions include:
In manual part programming, the machining instructions are recorded on a document, called a
part program manuscript (Table 6.4).
Because a part program records a sequence of tool motions and operations to produce the final
part geometry, a process plan must be prepared before writing the program.
EMT 2501: 6.4 NC Programming Formats 74
Cutter compensation (Positioning the tool further away from the desired cutting surface) is nec-
essary in order to allow for the radius of the cutting tool. Cutter compensation allows you to
Understanding Cutter Compensation
program
Cutter the geometry
compensation and
is one of notuseful
the most the things
toolpath. It also
to know when allows you to adjust the size of your part,
CNC machining.
Cutter compensation allows you to program the geometry and not worry about the
basedtoolpath.
on the tool radius used to cut your part. This is useful when you cant find a cutter of the
It also allows you to adjust the size of your part, based on the tool radius used to
cut
proper your part.
diameter. This isThis
useful is
when you can’t
best find a cutterinof Figure
explained the proper 6.14(a).
diameter. This is
best explained in the graphic below.
Cutter path must be offset from actual part outline by a distance equal to the cutter radius.
G41-left, G42 - right.
Example 6.4.1. Figure 6.15 shows a part that is to be machined from a 100×80 × 40 mm billet.
A three axis CNC is to be used for the process. Write a part program that can be use to effectively
machine the part. The cutting parameters are given below:
Milling Drilling
Cutter φ20mm flat end mill φ16mm drill bit
Spindle speed (rpm) 3000 500
Feed (mm/min) 500 240
EMT 2501: 6.4 NC Programming Formats 75
Figure 6.15:
Solution
Process plan:
1. Set the upper left corner of the part as the machine zero point.
3. Locate the coordinates of the contours (tool path) and the holes (Figure 6.16).
4. Mill the slot with the end mill (select suitable spindle speed and feed rate from machinability
data handbook)
5. Drill two holes φ16mm using suitable spindle speed and feed rate.
EMT 2501: 6.4 NC Programming Formats 76
Figure 6.16:
Input in mm 0010 21
Tool Definition 01 20
02 16
Feed to P2 0090 01 80
To P3 0100 01 60
To P4 0110 01 20
To P6 0130 01 0
Example 6.4.2. A square 2.0 in. x 2.0 in. is to be milled using a 1/2 in. end milling cutter.
Write an NC part program to make the square.
Solution
Let us set up the lower left corner of the square at (6.0,6.0). Using tool-radius compensation, the
square can be produced.
Figure 6.17:
Figure 6.18:
EMT 2501: 6.5 Computer-Aided Part Programming 78
2. Decide which machining operations and cutter-path directions are required (computer as-
sisted).
Components of APT:
• APT processor checks the source file for errors in defined geometry, errors in required tool
motions
APT NC
Source APT Post
CL file Code
file processor processor
file