0% found this document useful (0 votes)
24 views80 pages

CADCAM Notes Clean

The document provides an introduction to Computer-Aided Design (CAD) and Computer-Aided Manufacturing (CAM), detailing their definitions, applications, and historical evolution. It outlines the architecture of CAD systems, including hardware, operating systems, and application software, as well as the various display technologies used in CAD/CAM systems. The document emphasizes the integration and automation of design and manufacturing processes and the advancements in CAD/CAM technologies over the decades.

Uploaded by

baraka.eb19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
24 views80 pages

CADCAM Notes Clean

The document provides an introduction to Computer-Aided Design (CAD) and Computer-Aided Manufacturing (CAM), detailing their definitions, applications, and historical evolution. It outlines the architecture of CAD systems, including hardware, operating systems, and application software, as well as the various display technologies used in CAD/CAM systems. The document emphasizes the integration and automation of design and manufacturing processes and the advancements in CAD/CAM technologies over the decades.

Uploaded by

baraka.eb19
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 80

1

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

4. Analysis: Modeling and simulation, FEM (Geometric data)

5. Optimize: shape/ structure/topology/ stresses etc

6. Evaluate testing/ Inspection/ Comparison

7. Communicate prepare drawings and details (documentation)

Assistance of Computers in Design:

• Geometric models

• Animation/ Visualization

• Use Analysis tools and software

• Optimize Maximize / minimize the objective functions: Structure, Shape, Topology

• Evaluate test and check the model

• Documentation: Drafting and detailing

Common applications of CAD include:

• Mechanical systems design

• Architectural design

• Electrical and electronic circuit design

• Structural design

• Aerospace design
EMT 2501: 1.2 History and Evolution of CAD/CAM 2

• Fashion design

• Garment layout design

In most of these applications, CAD is used to model product geometries and to record non-
geometric design specifications.

1.1.2 CAM

Computer-aided manufacturing (CAM) can be defined as the effective utilization of computers in


manufacturing. Computers may be used for direct manufacturing process control and monitoring
or indirect manufacturing operations control.

Applications of direct manufacturing process control and monitoring include:

• numerical control (NC) machine tools

• robotics

• manufacturing systems control (such as flexible manufacturing systems, FMS and automated
manufacturing cells)

Applications of indirect manufacturing operations support include:

• computer-aided facility planning and design

• scheduling manufacturing resource planning (MRP-II)

• Computer-aided process planning (CAPP)

• Computer-aided part programming

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.

1.2 History and Evolution of CAD/CAM

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.

1.3 The Architecture of CAD

A CAD system consists of three major parts:

1. Hardware: computer and input/output (I/O) devices

2. Operating system software

3. Application software: the CAD package

1.3.1 CAD Hardware System

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)

• means of storing programs

• the display screens

• 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 organization of a typical computing system is shown in Figure 1.1.

Figure 1.1: Organization of a typical computing system

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.

The main memory is divided into,

• 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:

• Cathode ray tube (CRT) display

• Plasma panel display

• Liquid crystal display


EMT 2501: 1.3 The Architecture of CAD 6

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

Figure 1.3: A raster scan display system

Plasma Panel Display

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

Figure 1.4: AC Plasma display panel

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

EMT 2501: 1.3 The Architecture of CAD 8


For outdoor applications, the displayed images of a transmissive LCD can be washed out by sunlight.
A reflective LCD would be a better choice. However, such a reflective display is unreadable in dark
ambient. Therefore, a transflective LCD which combines the features of a transmissive display and a
reflective display seems an ideal choice. In dark ambient the backlight is on and the display works as a
Liquid Crystal Display
transmissive (LCD)
one; in bright ambient the backlight is off and only the reflective mode is operational.
Several monographs have been dedicated to advanced projection displays,4 reflective displays5 and
A liquid crystal
flexible display
displays.6 (LCD) is ahere
Therefore, thin, flat focus
we will electronic
on the visual display
mainstream that useswide-view
TFT-addressed the light modulating
trans-
missive LCDs. We will start by introducing twisted nematic (TN), in-plane switching (IPS) and fringe
properties of liquid crystals (LCs).
field switching (FFS) displays, and then multidomain vertical alignment (MVA). Phase compensation
methods for achieving wide viewing angles are also addressed.
Basically, LCD panels are made of two layers of transparent material, which are polarized, and
are ”glued” together. One of the layers is coated with a special polymer that holds the individual
4.2 Transmissive
liquid crystals. Current is thin-film
then passed transistor
through liquid crystal crystals,
individual displays which allow the crystals to
Figurelight
pass or block 4.1 shows the deviceimages.
to create structure of a TFTcrystals
LCD LCD usingdo amorphous
not emit silicon (a-Si)
their transistors.
own light,An soLCDan external
is a nonemissive display, i.e. it does not emit light; instead, it functions as a two-dimensional spatial
light source
light(back-light),
modulator. Thus,such as florescent
a backlight bulb
is needed. A is needed
diffuser is used to for the image
homogenize createdin by
the backlight the
order to LCD to
avoid hot spots. Some
become visible to the viewer. optical films are stacked to steer the Lambertian backlight to the middle ±40 ◦
for
improving display brightness. Since most LCDs require linearly polarized light in order to exhibit a high
contrast ratio, two sheets of stretched dichroic polarizers are used for large-size direct-view displays. The
A thin film transistor liquid crystal display (TFT-LCD) is a variant of liquid crystal display (LCD)
first glass substrate contains TFT arrays, which serve as independent light switches. Each display pixel
which uses thin filmbytransistor
is controlled a TFT. Since(TFT)
TFTs aretechnology
sensitive and to control
should each from
be shielded display pixel.
backlight TFT LCDs are
illumination,
the actual aperture ratio (the transparent indium tin oxide (ITO) electrode area) is reduced to ∼80 %,
used in television sets, computer monitors, mobile phones, hand-held video game systems, personal
depending on the pixel density. As the pixel density increases, the aperture ratio decreases. The LC layer is
digital assistants,
sandwichednavigation
between two ITOsystems, projectors,
substrates etc. is coated with a thin (80–100 nm) polyimide
whose inner surface
layer. Some LCDs (TN, IPS and FFS) require rubbing but some (MVA and patterned vertical alignment)
Figure 1.5 shows the device structure of a TFT LCD using amorphous silicon (a-Si) transistors.

Gate or row electrode a-Si TFTs


Common electrode ITO
Color filter

TFT substrate

Polarizer

240 µm

Backlight
Diffuser

R Data or column
G electrode
B
Gate or row electrode
80 µm
LC
Polarizer Common substrate

Figure 4.1 Device structure of a color pixel of a transmissive TFT LCD.


Figure 1.5: Device structure of a color pixel of a transmissive TFT LCD.

Advantages of LCDs over CRT and Plasma displays:

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.

Secondary Storage Devices

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

1.3.2 Output Devices

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.

1.3.3 Operating System

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.

1.3.4 CAD Software Systems

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.

c) Visualization: Visualization refers to computer graphics, which includes: rendering a model,


creation of pie charts, contour plots, shading a model, sizing, animation, etc.
EMT 2501: 1.3 The Architecture of CAD 13

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.

• Analysis module: Used for analyzing 3D object properties.

Engineering analysis that can be conducted within CAD environment:

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

3. Kinematic simulation: simulation of interaction between moving parts in a mechanical sys-


tem e.g mechanisms, gears, etc.

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.

5. Interference check in assemblies and subassemblies.


Commercial CAD systems
Figure 1.6 shows windows of some commercial CAD softwares.

Fig. 7 Commercial CAD systems


Figure 1.6: Commercial CAD softwares
15

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

user through a Graphics User Interface (GUI).


1 Introduction to Graphics
Graphics Devices: The standard interactive graphics device today is called a raster display. As
1.1 Raster Displays
with a television, the display consists of a two-dimensional array of pixels.
The screen is represented by a 2D array of locations called pixels.

Zooming in on an image made up of pixels

The convention in these notes will follow Figure


that of2.1:
OpenGL, placing the origin in the lower left
corner, with that pixel being at location (0, 0). Be aware that placing the origin in the upper left is
another common convention.

There are two common types of


One of 2N intensities raster
or colors are displays used
associated with eachinpixel,
CAD systems.
where N is the number of bits per
pixel. Greyscale typically has one byte per pixel, for 28 = 256 intensities. Color often requires
one byte per channel, with three color channels per pixel: red, green, and blue.
• Video displays:
Color data consist
is stored inof a screen
a frame buffer. with a phosphor
This is sometimes coating,
called an image mapthat allows each pixel to be
or bitmap.
illuminated momentarily when struck by an electron beam. A pixel is either illuminated
Primitive operations:
(white) or not (black). The level of intensity can be varied to achieve arbitrary gray values.
• setpixel(x, y, color)
Because the phosphor
Sets the pixel only holds
at position (x, y)its color
to the given briefly,
color. the image is repeatedly rescanned, at a
rate of at least 30 times per
• getpixel(x, y) second.
Gets the color at the pixel at position (x, y).
• Liquid crystal displays (LCDs): use an electronic field to alter polarization of crystalline
Scan conversion is the process of converting basic, low level objects into their corresponding
moleculespixel
in map
each pixel. The
representations. Thislight
is oftenshining through
an approximation to thethe pixel
object, since is
the already
frame bufferpolarized
is a in some
direction.discrete
By changing
grid. the polarization of the pixel, it is possible to vary the amount of
light which shines through, thus controlling its intensity.

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.

CPU I/O Devices

System bus

Memory Frame Video Monitor


Buffer Controller

Simple Raster Graphics System

CPU
I/O Devices

System bus

System Memory Frame Video


Display Monitor
Memory Processor Buffer Controller

Raster Graphics with Display Processor

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:

Color: The Transformations:


method chosen Rotations and scalings used
for representing for depends
color moving objects and the
on the viewer’s location.
characteristics of the graphics
Clipping: Removing elements that lie outside the viewing window.
output device (e.g., whether
Projection: it appropriate
Applying the is additiveperspective
as are video displays or subtractive as are printers). It
transformations.
Shading and Coloring: The color of a pixel may
also depends on the number of bits per pixel that are provided,be altered by called
increasing
theitspixel
brightness.
depth.Simple shading in-
For example,
volves smooth blending between some given values. Modern graphics cards support more complex proce-
the most method duralused currently in video and color LCD displays is a 24-bit RGB representation.
shading.
Each pixel is represented asobjects
Texturing: Coloring by “painting”
a mixture of red,textures
green onto
andtheir
bluesurface. Textures may
components, andbeeach
generated by images
of these threeor
by procedures.
colors is represented
Hidden-surfaceas elimination:
a 8-bit quantity (0 for
Determines black
which and
of the 255 objects
various for thethat
brightest
project to color).
the same pixel is closest
to the viewer and hence is displayed.
Example 2.1.1. Examine the properties of a colour graphics display of 1280 × 800 resolution
An example of this architecture is shown in Fig. 5. These operations are often pipelined, where each processor
with 256 colour display with a refresh rate of 75 Hz.
on the pipeline performs its task and passes the results to the next phase. Given the increasing demands on
Solution a top quality graphics accelerator, they have become quite complex. Fig. 6 shows the architecture of existing
accelerator.
256 colours require (Don’t
8 bits worry about per
(1 Byte) understanding
pixel. the various elements just now.)

Lecture Notes 6 CMSC 427


Buffer memory size = 1280 × 800 = 1024 kB = 1.024 MB
The memory read rate = 1.024 × 75 = 76.8 MB/s
1
Time to display 1 line = = 16.67µs
75 × 800
1
Time to reading 1 byte = = 13.02 ns
1.024 × 106 × 75

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.

2.2 Basic Graphical Elements

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.

2.3 2D Computer Graphics

2.3.1 Straight Lines

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:

1.2 Basic Line Drawing


Thus a series of calculations is required to find all the appropriate pixels to be lit between the two
Set thecolor
endsof
of pixels to approximate
a line. This can be achievedthe appearance
using the followingof
twoa methods
line from (x0 , yon0 )the
all based (x1 , y1 ).
to definition;
t should be
• “straight” and pass through the end points.
EMT 2501: 2.3 2D Computer Graphics 18

1. The general equation of a line in 2D space is,

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:

A ratio p can be defined as;


L
p=
Lt
From similarity of triangles we have;
L x − x1 y − y1
p= = =
Lt x2 − x 1 y2 − y1
which gives the coordinates of the generalized point lying along the line as;

x = x1 (1 − p) + px2
y = y1 (1 − p) + py2

These equations can be simplified to a parametric form as;

x = x1 + (x2 − x1 )p
y = y1 + (y2 − y1 )p

The value of p ranges between 0 and 1. If;


EMT 2501: 2.3 2D Computer Graphics 19

• 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

Consider a circle of radius R in 2D plane centered at a point with coordinates (x1 , y1 ).

( x, y )
R
θ
y1

x1 x

Figure 2.5:

The parametric form of the equation of a circle is given as;

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;

• center of the circle and the radius/diameter of the circle

• 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

2.3.3 Circular Arcs

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

2.3.4 2D Draughting Techniques

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 technique

The colour intensity of each pixel is defined individually by the user.

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)

2.3.5 2D Graphical Transformations

All design models are set in a coordinate system. In computer graphics, there are two coordinate
systems:

1. the object coordinate system

2. the view coordinate system.

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.

There are three major transformations:

1. translation - involves moving a point (or the view coordinate frame) linearly from an origin.

2. rotation - an object is rotated about a point (origin), and

3. scaling - in which an object is enlarged or reduced with reference to a point.

The principle and mathematical process behind these transformations are therefore explained in
this section.

In 2D space;

• a point P with coordinates (x1 , y1 ) is represented as,


 
~ x1
P =
y1
where (x1 , y1 ) is a 2 × 1 matrix.

• 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

• the transformation process can be represented by a matrix.

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

This can be represented in matrix form as;


     
x2 x1 ∆x
= +
y2 y1 ∆y
For translation of a point, the transformation matrix is represented as;
 
∆x
T =
∆y
Therefore, translation involves a process of addition or subtraction
EMT 2501: 2.3 2D Computer Graphics 23

Example 2.3.1. Consider a line represented as,


 
~ = 1 2
L
1 3

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

Hence the new line is at,


     
1 2 2 2 3 4
=⇒ + =
1 3 1 1 2 4

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

This can be represented in matrix form as;


    
x2 x1 Sx 0
=
y2 y1 0 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.

Scaling thus involves a process of multiplication.

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

Hence the new line is at,


    
1 2 2 0 2 4
=⇒ =
1 3 0 2 2 6

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 θ

which can be written in matrix form as,


    
x2 cos θ − sin θ x1
=
y2 sin θ cos θ y1

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;

cos 600 − sin 600


 
T =
sin 600 cos 600

Hence the new line is at,


    
0.5 −0.866 1 2 −0.366 −1.598
=⇒ =
0.866 0.5 1 3 0.366 3.232

Many a times, it becomes necessary to combine the aforementioned transformations in order to


achieve the required results. In such cases, combined transformation matrix can be obtained by
multiplying the respective transformation matrices. Care should be taken that the order of the
matrix multiplication be done in the same way as that of the transformation as follows:

[P ] = [Tn ][Tn−1 ]...[T2 ][T1 ] (2.1)


EMT 2501: 2.4 3-D Computer Graphics 25

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

Hence the translation matrix in multiplication form can be given as


 
1 0 dx
TT =  0 1 dy  (2.3)
0 0 1

The scaling matrix becomes  


Sx 0 0
TS =  0 Sy 0  (2.4)
0 0 1
and the rotation matrix becomes
 
cos θ − sin θ 0
TR =  sin θ cos θ 0  (2.5)
0 0 1

2.4 3-D Computer Graphics

2.4.1 Generating basic 3D graphical elements

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;

x = (1 − s − t)x1 + sx2 + tx3


y = (1 − s − t)y1 + sy2 + ty3
z = (1 − s − t)z1 + sz2 + tz3

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

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

Examples of free-form curves:

1. Ferguson curve

2. Hermite curve

3. Bezier curve

4. B-spline curve

5. NURB curve (Non-uniform rational basis spline)

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.

2.4.2 3D Graphical Transformation

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

This can be represented in matrix form as;


     
x2 x1 ∆x
 y2  =  y1  +  ∆y 
z2 z1 ∆z

For translation of a point, the transformation matrix in 3D is represented as;


T
T = ∆x∆y ∆z
EMT 2501: 2.4 3-D Computer Graphics 28

Scaling

Similarly scaling can be applied to each axis independently, that is,

   
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

Rotations are similarly treated, This reduces a 3D rotation to a sequence of 2D rotations.

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

For rotation about the y-axis, the new coordinates are,

x2 = x1 cos θ + z1 sin θ
z2 = z1 cos θ − x1 sin θ
y2 = y1

For rotation about the x-axis, the new coordinates are,

z2 = z1 cos θ + y1 sin θ
y2 = y1 cos θ − z1 sin θ
x2 = x1
EMT 2501: 2.4 3-D Computer Graphics 29

To combine all 3 transformations into one matrix, a homogenous transformation is used. A


homogenous transformation matrix is a 4 × 4 matrix. A point is represented by a 4D vector such
as:  
x
y
P =z
 (2.6)
1

Transformation matrices may be written as:


 
1 0 0 dx
0 1 0 dy 
Tr = 
0
 (2.7)
0 1 dz 
0 0 0 1

 
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

Transformation matrices are:  


1 0 0 1
0 1 0 1
Tr = 
0

0 1 1
0 0 0 1
   
1 0 0 0 1 0 0 0
0 Cx −Sx 0   0
  0 −1 0
Rx = 
0 = 
Sx Cx 0   0 1 0 0
0 0 0 1 0 0 0 1
   
Cy 0 Sy 0 0.707 0 0.707 0
 0 1 0 0  0 1 0 0
Ry = 
 −Sy
= 
0 Cy 0   −0.707 0 0.707 0 
0 0 0 1 0 0 0 1
A0 = Ry Rx Tr A = [4.242 − 2 1.414 1]T
A’=[4.242 − 2 1.414]T
31

Chapter 3

Curves and Surfaces

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

In calculus (a branch of mathematics) the derivative is a measure of how a function changes as


its input changes. The derivative of a function at a chosen input value describes the best linear
approximation of the function near that input value. For a real-valued function of a single real
variable, the derivative at a point equals the slope of the tangent line to the graph of the function
at that point.

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

3.1.2 Chain Rule

In calculus, the chain rule is a formula for the derivative of the composition of two functions.

If x = f (t) and y = g(t)

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:

1. Piecewise constant interpolation


EMT 2501: 3.2 Parametric Curves 32

2. Linear interpolation

3. Polynomial interpolation

4. Spline interpolation

5. Interpolation via Gaussian processes

3.2 Parametric Curves

The general parametric curve representation of a curve (Figure 3.1) is given as:

P = p(t) (3.1)

Figure 3.1: 3D curve

and the cartesian coordinates will be represented as:

x = f (t); y = g(t); z = h(t)

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

3.3 Free-form Curves

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 a, b, c, d are coefficients and the parameter t has a range of 0 ≤ t ≤ 1.

The curve model can be written in matrix form as:


 t3
   3
 t
ax b x c x d x  2    t2 
t
P (t) =  ay by cy dy   t  = a b c d  t  = AT
   (3.4)
az bz cz dz
1 1

where,

T
P (t) = x y z
T = power basis vector
A = coefficient matrix

The coefficients can be evaluated from the control points.

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

To design a curve is to determine its coefficients. There are several methods:

3.3.1 Ferguson Curve

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.

Therefore, a Ferguson curve is constructed by defining:


EMT 2501: 3.3 Free-form Curves 34

1. two end points of the curve (P0 , P1 )

2. end tangent vectors (t0 , t1 )

Figure 3.2: A Ferguson curve segment

P0 = P (0); P (1); t0 = Ṗ (0); t1 = Ṗ (1)

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 .

(i) What is the equation of the curve?

(ii) Plot the curve.

(iii) What is the vector tangent to the curve at t = 0.5


EMT 2501: 3.3 Free-form Curves 35

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

Figure 3.3: Curve plot

 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

Figure 3.4: A cubic Bezier curve

3.3.2 Bezier Curve

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 )

where P0 , P1 , P2 , P3 are 4 (user-defined control points).

Substituting Eq. 3.9 into Eqs. 3.4 and 3.5,

P0 = P (0) = d
P3 = P (1) = a + b + c + d
3(P1 − P0 ) = Ṗ (0) = c
3(P3 − P2 ) = Ṗ (1) = 3a + 2b + c

Solving for a, b, c, d gives:

a = −P0 + 3P1 − 3P2 + P3


b = 3P0 − 6P1 + 3P2
c = −3P0 + 3P1
d = P0
EMT 2501: 3.3 Free-form Curves 37

  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).

(i) Find the equation of the curve.

(ii) Using the equation from (i), show how the starting point and end point of the curve relate
with the control points.

(iii) Determine the tangent of the curve.

(iv) Using the equation from (iii), show how the tangent at the starting point and end point relate
with the control points.

Solution

From Eq. 3.10,


  3 
  −1 3 −3 1 t
3 4 8 10 
3 −6 3 0   t2 
 
P (t) =  0 0 0 0    −3 3

0 0  t 
1 4 4 2
1 0 0 0 1
 3
  t
−5 9 3 3  2 
t 
=  0 0 0 0   t 
0 −9 9 1
1
−5t3 + 9t2 + 3t + 3
 

=  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

The tangent vector equation,


−15t2 + 18t + 3
 

Ṗ (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

Blending Two or More Bezier Curves

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.

3.3.3 B-Spline Curve

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

B-splines have two advantages over Bezier curves:

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

P (t) is a point on the curve


i indicates the position of the control point
k is the order of the curve
Ni,k (t) are blending functions
Pi are the control points

The matrix form of the uniform cubic B-spline curve is:

  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

3.3.4 NURB Curves

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 .

A NURB curve has the form:  


x(t)
 y(t) 
P (t) =  
 z(t)  (3.14)
h(t)
In homogeneous form,  
x(t)/h(t)
 y(t)/h(t) 
p(t) =  
 z(t)/h(t)  (3.15)
1
To obtain a NURB curve, homogeneous control points are used. Each control point is assigned a
weight wi
EMT 2501: 3.4 Fractals 40

 
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.

Advantages of NURB curves:

• Serve as a genuine generalizations of non-rational B-spline forms as well as rational and


non-rational Bezier curves and surfaces

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

• Reasonably fast and computationally stable.

• Offer clear geometric interpretations

• Invariant under scaling, rotation, translation, and projections.

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.

Commonly used in artistic and architectural work.


Appeared in Interface Magazine, December 1990

Written by Paul Bourke


EMT 2501: 3.5 Surfaces 41

n tro d ucti o n

Computer graphics using CAD software is


ypically good at creating representations of
man-made objects using primitives such as
ines, rectangles, polygons, and curves in 2 D
or boxes and surfaces in 3D. These geometric
primitives and usual tools for manipulating
hem typically prove inadequate when it
omes to representing most objects found in
nature such as clouds, trees, veins, waves,
nd a clump of mud. There has been
onsiderable interest recently in chaos theory
nd fractal geometry as we find that many
processes in the world can be accurately Figure 3.6: Fractal
described using that theory. The computer Figure 1
graphics industry
3.5 is Surfaces
rapidly incorporating
hese techniques to generate stunningly
A as
beautiful images surface can
well as be considered
realistic natural as a continuous set of points approximating a small elemental surface
ooking structures. Free--form Surface II
Free
in the neighborhood of each of the point.

n what follows a description of a few of the


more commonly used techniques will be
given along with an example of each. It
hould be appreciated that usually the
xample is one from an image with a large if
not infinite variation depending on the
parameters, scale, and viewing position.

C ha o t i c S ys te ms

5/27/2010 5:24 PM

Figure 3.7: Common applications of surfaces in CAD

The mathematics involved is much more complex than for curves. Like curves, surfaces can be
classified as analytical and free-form surfaces.

3.5.1 Analytical Surfaces

Analytical surfaces can be divided into two groups:

1. Nonparametric surfaces: Those defined by non-parametric equations, examples are planar


surfaces, cylindrical surfaces, spherical surfaces, conical surfaces and torus.
EMT 2501: 3.5 Surfaces 42

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

(a) Torus (wireframe) (b) Torus (shaded)

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:

P (t, s) = P (t) + sV 0 ≤ t, s ≤ 1 (3.17)


EMT 2501: 3.5 Surfaces 43

Figure 3.9: Tabulated cylinder

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:

P (t, s) = P1 (t) + s[P2 (t) − P1 (t)] 0 ≤ t, s ≤ 1


or r(t, s) = (1 − s)P1 (t) + sP2 (t) 0 ≤ t, s ≤ 1

Figure 3.10: Ruled surface

3. Surface of revolution: A surface of revolution is defined by a curve P (t) with a rotational


sweep around an axis. If a line is used instead of a curve, the result will be a cylindrical or
a conical surface.

3.5.2 Free-form Surfaces (Sculptured)

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.

Figure 3.11: Characteristic polygon and surface of a bicubic Bezier surface


45

Chapter 4

Geometric Modeling Systems

4.1 Introduction

4.1.1 3-D Modeling Techniques

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;

1. Wire frame models

2. Surface models - which can take two forms;

(a) Analytical surface models


(b) Free-form surface models

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:

• it can be created quickly and easily to verify a concept of an object.

• low level hardware and software requirements.

• the data storage requirement is low.


me Modeling Systems
EMT 2501: 4.1 Introduction 46
ented by defining points in space and
y lines

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.

Figure 4.2: Common applications of surface modeling


EMT 2501: 4.1 Introduction 47

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.

Surface models are useful for representing surfaces such as:

• Thin containers such as bottles

• Ship hulls

• Aircraft fuselages and wings

• 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:

• It provides complete definition of a volumetric 3D shape, indicating outside and inside of an


object. This makes it easy to detect interference, especially in assembly.

• Analytical advantage, including automatic display of accurate mass properties and efficient
construction of finite elements.

• Ability to incorporate color choice and tone control.

• 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

2. Spatial occupancy enumeration (SOE)

3. Cell decomposition

4. Constructive solid geometry (CGS)

5. Boundary representation (B-rep)

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.

Figure 4.4: Primitive instancing

2. Spatial Occupancy Enumeration (SOE)


Space is described as a regular array of cells (usually cubes). Each cell is called a Voxel. A
3D object is represented as a list of filled voxels
advantages:

• Easy to verify if a point (a voxel) is inside or outside an object.


• General Sweep: object swept along any
trajectory and transformed along the sweep

EMT 2501: 4.1 Introduction 50

• Boolean operations are easy to apply.


Spatial Occupancy Enumeration Spa
limitations:

• 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

Figure 4.5: SOE

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 Quadtree is a data structure enabling efficient


• An O
storage of 2D data
• Each
Solid Modeling:
• Completely Modeling
full or empty Functions
regions are represented by than
one cell; recursive subdivision is used on the others • Des
• Primitive creation functions. Predefined simple shapes into
1 2
Figure 4.6: Cell decomposition
3 4 1 2 3 4

4. Constructive solid geometry


This method uses primitive shapes (blocks, cylinder, sphere, wedge, torus, cone, prism
etc) as building blocks and employs boolean set operators (union, difference and difference
(subtract)) to construct
• Boolean complex/composite object. The boolean operations and primitives
operators
and stored in a tree type of data structure.

UNION INTERSECTION DIFFERENCE

Figure 4.7: Boolean Operations


• Constructive Solid Geometry (CSG) representation
EMT 2501: 4.1 Introduction 51
– Application of boolean operations on primitives and stored in a
tree type of data structure

Figure 4.8: Constructive solid geometry


– Data structure is simple and compact
5. – The solid
Boundary stored(B-rep)
representation is alwais valid
A–closed
Easy 2Dparametric
surface definesimplementation
a 3D object. This method represents objects by their boundary
faces.
– OnlyThe bounding
booleanfaces are further
operators divided and
allowed: represented
shape by edges
definition and vertices.
severely limited
A–setItofrequires
operators lots
known ofascomputation
Euler operatorsto
is available to build the B-rep
derive information from ground surface,
of boundary up.
Mostedges,
B-rep models are derived from CSG model through boundary evaluation.
connectivity
Boundary representations can be defined in two ways:

(a) Primitive based. A collection of primitives forming the boundary (polygons, for exam-
ple)
(b) Freeform based (splines, parametric surfaces, implicit forms)

A polyhedron is a solid bounded by a set of polygons and is constructed from:

• 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

esentations Boundary Representations


Boundary Representations
ed by a set of polygons • A simple polyhedron is one that can be deformed
om: • Euler’s formula can be generalized to a polyhedron with
into a sphere (contains no holes) holes and multiple components
• A simple polyhedron must satisfies Euler's formula:
V-E+F-H=2(C-G)
Where:
V-E+F=2 • H is the number of holes in the faces
vertices and be shared • C is the number of separate components
• G is the number of pass-through holes (genus if C=1)
et at each vertex • V, E and F are respectively vertices, edges and faces

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

(a) Polyhedron without holes (b) Eulers formula generalized to a polyhedron


with holes and multiple components
esentations
to a polyhedron with
Figure 4.9:
G)
faces
mponents
h holes (genus if C=1)
6. Sweeping
ices, edges and faces
This involves sweeping a 2D area along a trajectory creates a new 3D object. There are two
E + F – H = 2 (C - G) types of sweep.
36 + 15 – 3 = 2 (1 - 1)

(a) Translation (extrusion) e.g translation of a rectangle produces a box.


(b) Rotation (revolve) - rotation of the same rectangle about an edge produces a cylinder.

Solid Modeling: Modeling Functions


This method can produce highly complicated shapes. One manufacturing application of
sweeping is NC cutter simulation.
• Sweeping: translational or rotational

• Skinning: multiple cross section perimeter interpolation


Figure 4.10: Sweeping

A design model needs the following information to completely describe it:


• Rounding
• Geometry

• Tolerances

• Volume (for some applications)

• Annotation and dimensions.


EMT 2501: 4.2 Standard CAD Data Exchange Formats 53

4.2 Standard CAD Data Exchange Formats

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.

Figure 4.11: CAD data exchange

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

Finite Element Analysis as a CAD Tool

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.

5.2 Finite Element Analysis

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.

FEA finds applications in a range of engineering problems such as:

 Stress analysis  Heat transfer


 Dynamic analysis  Acoustic studies
 Deformation studies  Magnetic flux studies
 Fluid flow analysis

In practice, a finite element analysis usually consists of three principal steps:

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.

The main inputs in FEA programming are:

• Geometry: geometric model, nodal coordinates, variation of mesh intensity. This is done by
direct entry or from CAD drafting.

• Loading characteristics: Magnitudes, positions, directions of actions of point loads, pres-


sures, thermal loads, centrifugal loads, frequency dependent forces.

• Boundary conditions: Positions of supports/fixtures, rotational axes, frictional resistances,


prescribed displacements.

• Material properties: Young’s modulus, Poisson’s ratio, density, coefficient of friction, coeffi-
cient of expansion.

Relevance of CAD to FEM:


EMT 2501: 5.2 Finite Element Analysis 56

• Generation of accurate geometric model

• Printed nodal displacements

• Printed element stress values

• Graphical deflections display

• Graphical display of stress contours

• Colour variation of elemental display according to stress range.

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.

Figure 5.1: One dimensional elements

Figure 5.2: Two dimensional elements

Figure 5.3: Three dimensional elements


EMT 2501: 5.3 Stress Analysis Tool in CAD Sofwares 57

5.3 Stress Analysis Tool in CAD Sofwares

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.

With the stress analysis tools, one can:

1. Perform a structural static or modal analysis of a part or assembly.

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.

3. Apply fixed or non-zero displacement constraints to the model.

4. Model various mechanical contact conditions between adjacent parts.

5. Evaluate the impact of multiple parametric design changes.

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.

9. Generate a complete and automatic engineering design report in HTML format.

Typical Stress Analysis workflow

1. Create Simulations and specify their properties.

2. Exclude components not required for simulation.

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.

EMT 2501: 5.3 Stress Analysis


TABLETool
6 in CAD Sofwares 58
Structural Results
Name Minimum Maximum
Equivalent Stress 3.613e-002 MPa 237.8 MPa
6. Maximum Principal Stress
Specify contact conditions, -99.66 MPa
an optional 167.1
step.MPa
Minimum Principal Stress -355.7 MPa 60.37 MPa
7. Deformation
Specify and preview the mesh, 0.0 mman optional
1.218 step.
mm
Safety Factor 1.156 N/A
8. Run the simulation.

9. View and Interpret the Results


FIGURE 1
Equivalent Stress

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

Figure 5.5: Typical deformation contour plot using Inventor


3 of 7 5/24/2010 9:58 PM
60

Chapter 6

Computer Numerical Controlled Machines

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 functions and motions such as;

• turning the spindle on and off

• setting cutting speeds

• setting feed rate

• turning coolant on and off

• moving tool with respect to workpiece

are performed by Machine Control Unit (MCU) in NC machine tools.

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;

• machining of complex three-dimensional shapes:

• 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

Z-AXIS SERVO MOTOR

COLUMN

SPINDLE MOTOR

SPINDLE HEAD
Z

TOOL

X-AXIS TABLE
SERVO
MOTOR X
Y-AXIS SERVO
MOTOR

Fig. 12.1 Sketch of a Numerically Controlled Machine Tool


Figure 6.1: Sketch of a Numerically Controlled Machine Tool
In order to carry out the milling operation on the workpiece the coordinate information
(X, and Y coordinates) of the starting point and the ending point has to be coded in the NC
6.2 CNC Systems
program. Similarly, the information regarding the direction of rotation and speed of the
spindle, use of coolant, and the feed rate is also coded suitably. The CNC controller decodes
the positioning
In CNC (Computer Numerical information codedthe
Control), in the NC program and
instructions are the slide is
stored asmoved to the in a micro-
a program
programmed position at the required feed rate. Each slide is fitted with a feedback
computer attached to thewhich
transducer, machine. The monitors
continuously computer the will
slide also handle
position much ofwith
and compares thethecontrol logic of
programmed position as well as the feedrate. The feedback transducer is mounted either
the machine, making it more adaptable than earlier hard-wired controllers.
on the slide or on the servomotor and measures the displacement or position of the slide.
For example, let us assume that a hole is to be drilled at the location X = 100.0 and Y =
In modern CNC systems, end-to-end component design is highly automated using CAD/CAM
150.0. The corresponding block of the program is read by the control system and the
programs. Thenecessary
programs inputsproduce
are sent toathecomputer
X and Y-axis file that isThese
servomotors. interpreted
motors drive totheextract
respectivethe commands
slides to the commanded position. When the distance information from the feedback devices
Chapter 12

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

A typical CNC system consists of the following six elements:

• Part program

• Program input device

• Machine control unit

• Drive system
EMT 2501: 6.2 CNC Systems 62

• Machine tool

• Feedback system

Figure 6.2: Elements of a CNC

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

In selecting an NC system, the following factors are considered:

1. Motion control: Point to point and continuous path (contouring)

2. Control loops: open loop and closed loop

3. Power drives: hydraulic, electric, or pneumatic

4. Positioning systems: incremental and absolute positioning

5. Hardwired NC and softwired computer Numerical Control (CNC)


Identification of controlled axes for a lathe (a), vertical spindle milling machine (b),
and horizontal spindle milling machine (c).
EMT 2501: 6.2 CNC Systems 63 in the figu
Although the directions of axes for a particular machine tool are generally agreed as shown
the coordinate system origin is individual for each part to be machined and has to be decided in the
beginning of the process of CNC part programming (Section 9.2).

6.2.1 Motion ControlPoint-to-point vs. continuous systems


The two major types of NC systems are (see the figure):
There are two types of motion control systems for NC machines:
Œ point-to-point (PTP) system, and
 contouring system.
1. Point to Point (PTP)
PTP is a NC system, which controls only the position of the components. In this system, the path of
component
The function of a PTP motion motion relative
control to move
is to the workpiece is not controlled.
the machine table orThe travelling
spindle to between different posit
a specified
is performed at the traverse speed allowable for the machine tool and following the shortest way.
position so that machining operations may be performed at that point. The path taken to
Contouring
reach the specified point NCspecified
is not systems areby capable of controlling not only the positions but also the component
the programmer.
Identification of controlled axes for a motion, i.e., thespindle
lathe (a), vertical travelling velocity
milling machineand
(b),the programmed path between the desired positions:
and horizontal spindle milling machine (c).

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

int-to-point vs. continuous systems


e two major types of NC systems are (see the figure): Schematics of point-to-point (Left) and contouring (Right) NC systems.
Figure 6.3: A point to point NC system
Œ point-to-point (PTP) system, and
 contouring system.
2. Continuous
P is a NC system, which (contouring)
controls only the position ofcontrol system In this system, the path of the
the components.
mponent motion relative to the workpiece is not controlled. The
In continuous control system, the machine travelling between different
controls two or positions
more axis simultaneously. The
erformed at the traverse speed allowable for the machine tool and following the shortest way.
machine controls not only the destination but also the path through which the tools reaches
ntouring NC systems are capable
these of controlling not only the positions but also the component
positions.
tion, i.e., the travelling velocity and the programmed path between the desired positions:

Schematics of point-to-point (Left) and contouring (Right) NC systems.


Figure 6.4: Continuous path control

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

where ∆x and ∆y are displacements along X and Y axes, respectively.


EMT 2501: 6.2 CNC Systems 64

6.2.2 Control Loops

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.

Figure 6.5: (a) Open loop system, (b) Closed-loop system

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.

6.2.3 Power Drives

Most modern NCs use a DC or AC servomotor to drive the axes and spindle. Some advantages
of servo-motors are:

• they are small in size,

• 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

• high power requirements

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.

6.2.4 NC and CNC

The difference between NC and CNC lies in the controller technology.

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.

6.2.5 NC Accuracy and Repeatability

An NC machine is usually rated by the following factors:

• Accuracy

• Repeatability

• Spindle and axis-motor horsepower

• No. of controlled axis

• Dimensions of the workspace

• Features of the machine and the controller.

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.

Hardware inaccuracies are caused by physical machine errors such as

• Inaccuracies in the machine elements


EMT 2501: 6.2 CNC Systems 66

• Machine tool assembly errors

• Spindle run out

• Lead screw backlash

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

Figure 6.6: Accuracy and repeatability

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

Figure 6.7: An example of two-axis linear interpolation

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.

4. Parabolic and Cubic Interpolation


Approximates free form curves using higher order equations

6.3 NC Programming

The major parts of a CNC program are:

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

2. Tool load: Tool load, spindle forward

3. Tool approach: Tool to clearance height

4. Geometry definition: To point blocks

5. Tool retract: To clearance height, spindle stop, return to reference point, program reset and
rewind.

6.3.1 Programming Systems (Positioning systems)

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.

(a) Absolute positioning (b) Incremental positioning

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.

6.4 NC Programming Formats

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.

There are four basic programming formats of NC inputs:


EMT 2501: 6.4 NC Programming Formats 69

1. Fixed sequential format

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

0010 01 07500 06250 00000 00000 612

Figure 6.10: The fixed sequential format

2. Block address format

• Eliminates the need for specifying redundant information in subsequent NC blocks by


specifying a change code.
• The change code follows the block sequence number and indicates which values are to
be changed relative to the preceding blocks.
• All data must contain a predefined number of digits in this format.

3. Tab sequence format

• 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

4. Word address format

• 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

• N001 G00 X07000 Y03000 M03


N002 Y06000

Figure 6.11: Example

• 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

Table 6.1: Address words


A Rotation about the X-axis
B Rotation about the Y-axis
C Rotation about the Z-axis
D Cutter diameter/ radius offset
F Feedrate commands
G Preparatory commands
I Circular interpolation X-axis offset
J Circular interpolation Y-axis offset
K Circular interpolation Z-axis offset
M Miscellaneous commands
N Sequence number
R Arc radius
S Spindle speed
T Tool number
X X-axis data
Y Y-axis data
Z Z-axis data

Through this words, all NC control functions can be programmed.

Address words are usually assigned to registers as shown in Table 6.1

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.

• M03 turns the spindle on clockwise

• M04 turns the spindle on counterclockwise

• M05 turns the spindle off

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.

Table 6.2: G Codes


G00 Rapid traverse G21/G71 Input in mm
G01 Linear interpolation G28 Return to reference point
G02 Circular interpolation-CW G40 Cutter diameter compensation-cancel
G03 Circular interpolation-CCW G41 Cutter diameter compensation-left
G04 Dwell G42 Cutter diameter compensation-right
G08 Acceleration G43 Tool length compensation (+)
G09 Deceleration G49 Tool length compensation-cancel
G17 X-Y plane G80 Canned cycle cancel
G18 Z-X plane G81 Basic drilling cycle
G19 Y-Z plane G90 Absolute programming mode
G20/G70 Input in inches G91 Incremental programming mode
G94 Feed per minute G92 Set x, y, z locations

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.

Figure 6.12: Cutting a circular arc

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

Figure 6.13: Drilling cycle

The cycle may be programmed in one block such as (Figure 6.13):


N0010 G81 X20.000 Y40.000 Z0.000 R45

8. M-Code. The M-code is called the miscellaneous word and is used to control miscellaneous
functions of the machine. such functions include:

• turning the spindle on and off


• starting and stopping the machine
• turning the coolant on or off
• changing the tool
• rewinding the program (tape)

6.4.2 Manual Part Programming

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

Table 6.3: M-Codes


M00 Program stop M06 Automatic Tool change
M01 Optional program stop M07 Flood coolant on
M02 End of program M08 Mist coolant on
M03 Spindle on CW M09 Coolant off
M04 Spindle on CCW M30 Program reset and rewind
M05 Spindle off M13 Spindle forward and coolant on

Table 6.4: NC part program manuscript


Description N G G G X Y Z R I J K M T D S F

6.4.3 Cutter Compensation

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.

part cut with programmed


part tool radius
part cut with a larger-than-
programmed tool
tool part cut with a smaller-than-
programmed tool
tool path

The solid circle is the nominal sized tool.compensation


(a) Cutter The dashed circle is an undersized tool, and the (b) Cutter offset
dash-dot circle is the oversized tool. With a little imagination, you can see all the
possibilities for tweaking your part, or getting your part made with any size endmill.
Figure 6.14:

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.

2. Clamp the work piece in a vise.

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:

Table 6.5: NC part program manuscript


Description N G G G X Y Z R I J K M T D S F
Program Number 0200

Input in mm 0010 21

Billet size 0020 100 80 40

Tool Definition 01 20
02 16

Cancel cycles 0030 40 49 80

Return to ref. point 0040 90 28 0 0 0

Tool load 0050 06 01

Spindle on CW 0060 03 1500 200

To clearance height at P1 0070 00 42 40 0 5

Down feed to point P1 0080 01 -12

Feed to P2 0090 01 80

To P3 0100 01 60

To P4 0110 01 20

Circular interp to P5 0120 03 60 60 40

To P6 0130 01 0

To clearance height 0140 01 5

Spindle stop 0150 05

Return to ref. point 0160 00 28 0 0 0

Tool change 0170 06 02

Spindle on, new speed & feed 0180 01 03 1000 100

Drill Hole H1 0190 81 20 20 -42 5

Drill Hole H2 0200 81 20 80 -42 5

Spindle stop 0210 05

Return to ref. point 0220 00 28 00 0 0 0

Program reset and rewind 0230 30


EMT 2501: 6.4 NC Programming Formats 77

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

6.5 Computer-Aided Part Programming

In computer-aided part programming, personal computers are used as an aid in programming


complex geometries. The designer imports the CAD geometry from a CAD system or uses the
CAM software modeling tools. The computer does all the calculations and and plots the cutter
paths for verification.

Typical flow of a Computer-Aided CNC programming (Figure 6.19):

1. Develop or obtain the 3D geometric model of the part, using CAD.

2. Decide which machining operations and cutter-path directions are required (computer as-
sisted).

3. Choose the tooling required (computer assisted).

4. Run CAM software to generate the CNC part program.

5. Verify and edit program.

6. Download the part program to the appropriate machine.

7. Verify the program on the actual machine and edit if necessary.

8. Run the program and produce the part.

6.5.1 Automatically Programmed Tool (APT)

APT or Automatically Programmed Tool is a high-level computer programming language used


to generate instructions for numerically controlled machine tools. APT is used to program CNC
machine tools to create complex parts using a cutting tool moving in space. It is used to calculate
a point-to-point path that a tool must follow to generate a desired form. APT is a CAM system
based on a special-purpose language.

Components of APT:

• APT source file: written by user

• APT processor checks the source file for errors in defined geometry, errors in required tool
motions

• CL file means cutter location file

• Post processor converts CL data into final NC codes.

Post processing involves:


EMT 2501: 6.5 Computer-Aided Part Programming 79

Computer-Aided Part Programming:


Figure APT
Standard 6.19:(Automatically
Flow of computer-aided CNC
programmed programing
tools) language:

APT NC
Source APT Post
CL file Code
file processor processor
file

 APT source file: written


Figure by user of APT
6.20: Structure
 APT processor checks the source file for errors in
defined
• Converting the CL data geometry, errors
into m/c tool in required tool
coordinates.
motions
• Check for speed,
 CL file
feed,means cutter
movement location file
limitations.
 Post processor converts CL data into final NC
• Develop motion command using M & G codes.
codes.
EMT 2501: 6.5 Computer-Aided Part Programming 80

• Process machine specific functions.

• Select acceleration, deceleration, etc.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy