Tải bản đầy đủ (.pdf) (313 trang)

Computer Aided Manufacturing (CAD/CAM)Computer Hided and Integrated potx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (30.55 MB, 313 trang )


Computer Aided Design /
Computer Aided Manufacturing (CAD/CAM)
Computer Hided
and
Integrated Manufacturing Systems
fl
S-Volume
Set
Cornelius
T
Leondes

Vol.4
Computer Aided Design /
Computer Aided Manufacturing (CAD/CAM)
Compurer Hided
m
Integrated Monuficruring Siisfems
fl
S-Volume
Ser

This page is intentionally left blank

Vol.4
Computer Aided Design /
Computer Aided Manufacturing (CAD/CAM)
Computer Aided and
Integrated Manufacturing Systems
H


S-Volume Set
Cornelius T Leondes
Umrnly
of
California,
Los
Angeks,
USA
fj|)p World Scientific
NEW JERSEY • LONDON • SINGAPORE • SHANGHAI • HONGKONG • TAIPEI * BANGALORE

Published by
World Scientific Publishing Co. Pte. Ltd.
5 Toh Tuck Link, Singapore 596224
USA office: Suite 202, 1060 Main Street, River Edge, NJ 07661
UK office: 57 Shelton Street, Covent Garden, London WC2H 9HE
British Library Cataloguing-in-Publication Data
A catalogue record for this book is available from the British Library.
COMPUTER AIDED AND INTEGRATED MANUFACTURING SYSTEMS
A 5-Volume Set
Volume 4: Computer Aided Design/Computer Aided Manufacturing (CAD/CAM)
Copyright © 2003 by World Scientific Publishing Co. Pte. Ltd.
All rights
reserved.
This
book,
or parts
thereof,
may not be reproduced in any form or by any means,
electronic or

mechanical,
including photocopying, recording or any information storage and retrieval
system now known or to be
invented,
without written permission from the Publisher.
For photocopying of material in this volume, please pay a copying fee through the Copyright
Clearance Center, Inc., 222 Rosewood Drive, Danvers, MA 01923, USA. In this case permission to
photocopy is not required from the publisher.
ISBN 981-238-339-5 (Set)
ISBN 981-238-980-6 (Vol. 4)
Typeset by Stallion Press
Printed by Fulsland Offset Printing (S) Pte Ltd, Singapore

Preface
Computer Technology
This 5 volume MRW (Major Reference Work) is entitled "Computer Aided and
Integrated Manufacturing Systems". A brief summary description of each of the
5 volumes will be noted in their respective PREFACES. An MRW is normally on
a broad subject of major importance on the international scene. Because of the
breadth of a major subject area, an MRW will normally consist of an integrated
set of distinctly titled and well-integrated volumes each of which occupies a major
role in the broad subject of the MRW. MRWs are normally required when a given
major subject cannot be adequately treated in a single volume or, for that matter,
by a single author or coauthors.
Normally, the individual chapter authors for the respective volumes of an MRW
will be among the leading contributors on the international scene in the subject
area of their chapter. The great breadth and significance of the subject of this
MRW evidently calls for treatment by means of an MRW.
As will be noted later in this preface, the technology and techniques utilized in
the methods of computer aided and integrated manufacturing systems have pro-

duced and will, no doubt, continue to produce significant annual improvement in
productivity — the goods and services produced from each hour of work. In addi-
tion, as will be noted later in this preface, the positive economic implications of
constant annual improvements in productivity have very positive implications for
national economies as, in fact, might be expected.
Before getting into these matters, it is perhaps interesting to briefly touch on
Moore's Law for integrated circuits because, while Moore's Law is in an entirely
dif-
ferent area, some significant and somewhat interesting parallels can be seen. In 1965,
Gordon Moore, cofounder of INTEL made the observation that the number of tran-
sistors per square inch on integrated circuits could be expected to double every year
for the foreseeable future. In subsequent years, the pace slowed down a bit, but den-
sity has doubled approximately every 18 months, and this is the current definition
of Moore's Law. Currently, experts, including Moore
himself,
expect Moore's Law
to hold for at least another decade and a
half.
This is impressive with many sig-
nificant implications in technology and economies on the international scene. With
these observations in mind, we now turn our attention to the greatly significant and
broad subject area of this MRW.

VI
Preface
"The Magic Elixir of Productivity" is the title of a significant editorial which
appeared in the Wall Street Journal. While the focus in this editorial was on produc-
tivity trends in the United States and the significant positive implications for the
economy in the United States, the issues addressed apply, in general, to developed
economies on the international scene.

Economists split productivity growth into two components: Capital Deepen-
ing which refers to expenditures in capital equipment, particularly IT (Informa-
tion Technology) equipment: and what is called Multifactor Productivity Growth,
in which existing resources of capital and labor are utilized more effectively. It is
observed by economists that Multifactor Productivity Growth is a better gauge of
true productivity. In fact, computer aided and integrated manufacturing systems
are,
in essence, Multifactor Productivity Growth in the hugely important manufac-
turing sector of global economies. Finally, in the United States, although there are
various estimates by economists on what the annual growth in productivity might
be,
Chairman of the Federal Reserve Board, Alan Greenspan — the one economist
whose opinions actually count, remains an optimist that actual annual productivity
gains can be expected to be close to 3% for the next 5 to 10 years. Further, the
Treasure Secretary in the President's Cabinet is of the view that the potential for
productivity gains in the US economy is higher than we realize. He observes that
the penetration of good ideas suggests that we are still at the 20 to 30% level of
what is possible.
The economic implications of significant annual growth in productivity are huge.
A half-percentage point rise in annual productivity adds $1.2 trillion to the federal
budget revenues over a period of ten years. This means, of course, that an annual
growth rate of 2.5 to 3% in productivity over 10 years would generate anywhere from
$6 to $7 trillion in federal budget revenues over that time period and, of course,
that is hugely significant. Further, the faster productivity rises, the faster wages
climb.
That is obviously good for workers, but it also means more taxes flowing into
social security. This, of course, strengthens the social security program. Further,
the annual productivity growth rate is a significant factor in controlling the growth
rate of inflation. This continuing annual growth in productivity can be compared
with Moore's Law, both with huge implications for the economy.

The respective volumes of this MRW "Computer Aided and Integrated Manu-
facturing Systems" are entitled:
Volume 1: Computer Techniques
Volume 2: Intelligent Systems Technology
Volume 3: Optimization Methods
Volume 4: Computer Aided Design/Computer Aided Manufacturing (CAD/CAM)
Volume 5: Manufacturing Process
A description of the contents of each of the volumes is included in the PREFACE
for that respective volume.

Preface
vn
There is really very little doubt that all future manufacturing systems and pro-
cesses will utilize the methods of CAD/CAM (Computer Aided Design/Computer
Aided Manufacturing), and this is the subject of Volume 4. Key to the processes
of CAD/CAM is the generation of three dimensional shapes, a subject treated at
the beginning of this volume, 2D assembly drawings are what are generally utilized
for conversion to 3D part drawings in the CAD process in order to generate three
dimensional shapes for the CAM process, and this is treated in depth and rather
comprehensively in this volume. The evolution of a design process and product is
often referred to as an adaptive growth representation in the CAD process and this
receives necessary treatment in this volume. Fixture designs for the manufacturing
process utilize modular elements, and the CAD methods for this essential process
are treated rather comprehensively in this volume. Finite element techniques are
becoming a way of life for CADS and CAE (Computer Aided Engineering) and
rather powerful optimization techniques for processes involved here are also treated
in depth in this volume. Rapid prototyping techniques are now a way of life in
manufacturing systems, and CAD techniques for this are presented in this volume.
These and numerous other techniques are treated rather comprehensively in this
volume.

As noted earlier, this MRW (Major Reference Work) on "Computer Aided and
Integrated Manufacturing Systems" consists of
5
distinctly titled and well-integrated
volumes. It is appropriate to mention that each of the volumes can be utilized indi-
vidually. The significance and the potential pervasiveness of the very broad subject
of this MRW certainly suggests the clear requirement of an MRW for a compre-
hensive treatment. All the contributors to this MRW are to be highly commended
for their splendid contributions that will provide a significant and unique reference
source for students, research workers, practitioners, computer scientists and others,
as well as institutional libraries on the international scene for years to come.

This page is intentionally left blank

Contents
Preface v
Chapter 1
Generation of Three-Dimensional Shapes in CAD/CAM Systems
using Art-to-Part Technique 1
C. K. Chua and K. Y. Chow
Chapter 2
Computer Techniques and Applications of Converting 2D
Assembly Drawings into 3D Part Drawings in Computer Aided
Design 35
Masaji Tanaka, Kenzo Iwama, Atsushi Hosoda and Tohru Watanabe
Chapter 3
Computer Techniques and Applications of Adaptive-Growth-Type
Representation in Computer Aided Design (CAD) 73
/. Nagasaka, K. Veda and T. Taura
Chapter 4

Computer-Aided Modular Fixture Design 101
Yiming (Kevin) Rong
Chapter 5
Optimization in Finite Element and Differential Quadrature
Element Analysis Techniques in Computer Aided Design and
Engineering 171
C N. Chen
Chapter 6
Computer Techniques and Applications in Rapid Prototyping 281
Gill Barequet
Index 297

CHAPTER 1
GENERATION OF THREE-DIMENSIONAL SHAPES IN
CAD/CAM SYSTEMS USING ART-TO-PART TECHNIQUE
CHUA C. K. and CHOW K. Y.
School of Mechanical & Production Engineering,
Nanyang Technological University,
50 Nanyang Avenue,
Singapore 639798
In some industries, products have elements of complex engraving or low relief on
them. Traditionally, such work is carried out by skilled engravers working from
2D artwork manually. This process is costly, open to unwanted misinterpretations
and lengthens the design cycle. This research presents the Art-to-Part technique
which relies on computers and automation from the scanning of 2D artwork, to
3D surface and relief generation, and finally to the fabrication of the model by
rapid prototyping. The technique links design to manufacturing stages together
and reduces the whole production time. Furthermore, the quality is increased
and reproducibility and reliability are ensured, as demonstrated in the 3 case
studies.

Keywords: 3D
relief;
Art-to-Part; CAD/CAM; rapid prototyping.
1.
Introduction
There are presently numerous commercially-available software for product design for
a particular range of industries which include ceramics, glassware, bottle making,
both plastic and glass, jewelry, packaging and food processing for molded prod-
ucts and products produced from forming rolls, coins and badges, and embossing
rollers.
1-3
All of these industries share a common problem: most of their products
have elements of complex engraving or low relief on them.
4
Traditionally, such work
is carried out by skilled engravers either in-house or more often by a third-party
sub-contractor, working from 2D artwork. This process is costly, open to unwanted
misinterpretation of the design by the engraver and most importantly, lengthens
the time of the design cycle.
Advances in manufacturing technology allow many industries to upgrade and
change their usual production practices from labor-intensive to automated and
computerized methods. With these changes, the production cycle time and cost
1

2
Chua C. K. and Chow K. Y.
could be reduced tremendously with an improvement in the quality of the prod-
uct. In recent years, computer-aided design and computer-aided manufacturing
(CAD/CAM) have become very popular, especially in the manufacturing indus-
tries.

It links the designing and manufacturing stages together and thus reduces the
whole production time. It is a significant step toward the design of the factory of
the future.
5
2.
Art-to-Part Process
The use of CAD/CAM and Stereolithography Apparatus (SLA) reduces the time
required for design modifications and improvement of prototypes. The steps involved
in the art-to-part process include the following:
1.
Scanning of artwork
2.
Generation of surfaces
3.
Generation of 3D relief
4.
Wrapping of relief on surfaces
5.
Converting triangular mesh files to STL file
6. Building of model by the SLA.
The flow of this series of stages is illustrated using coin design as a case study.
Figure 1 shows the steps involved in the art-to-part process.
2.1.
Scanning of artwork
The function of scanning software is to create a 2D image from 2D artwork automat-
ically or semi-automatically. It would normally be applied in cases where it would
be too complicated and time consuming to model the part from a drawing using
existing CAD techniques.
The 2D artwork is first read into ArtCAM, the CAD/CAM system used for the
project, using a Sharp JX A4 scanner. Figure 2 shows the 2D artwork of a series

of Chinese characters and a roaring dragon. This combination of hardware and
software allows the direct production of a standard image from the artwork, which
can be read directly into ArtCAM. The 2D artwork in such instances represent the
designs to be used on the face of the coin.
In the ArtCAM environment, the scanned image is first reduced from a colour
image to a monochrome image with the fully automatic "Gray Scale" function.
Alternatively, the number of colours in the image can be reduced using the "Reduce
Colour" function. A colour palette is provided for colour selection and the various
areas of the images are coloured, either using different sizes or types of brushes or
the automatic flood fill function. Figure 3 illustrates the touched-up image.

Generation of 3D Shapes in CAD/CAM Systems
Scanning of artwork
_^_
Generation of surfaces
(eg.coin shape)
XL
Relief generation using
ArtCAM
<r
?e
^L
Wrapping of relief onto
surfaces
\l/
Viewing of final model
OK
yes
^L
Model building by SLA

OK?
yes
_^_
Final model
Fig. 1. Steps involved in the Art-to-Part process.
2.2.
Generation of surfaces
The shape of a coin is generated to the required size in the CAD system for model
building. Figure 4 shows the shape of a coin model generated. A triangular mesh
file is produced automatically from the 3D model. This is used as a base onto which
the relief data is wrapped and later combined with the relief model to form the
finished part.

4
Chna C. K. and Chow K. Y
Fig. 2. 21) artwork.
Fig. 3. Touched-up image.
2*3*
Generation of 3D relief
The next stage in creating the 3D relief is to assign each colour in the image a
shape profile. There are various fields which control the shape profile of the selected
coloured region, namely, the overall general shape for the region, the curvatures of

Generation of 3D Shapes in CAD/CAM Systems
5
Fig. 4. Shape of a coin model.


Selected colour J
Plane • Round • Square |

Convex • Concave |
Max. height:
Base height:
Angle :
Scale:
Heij
Calculate
I Apply
I
| 0.0
j 0.0
| 45.0
I
i.o
|ht Array
leset
Zero
Close j
Fig. 5. Control pane! for the shape profile.
the profile (convex or concave), the maximum height, base height, angle and scale.
Figure 5 shows the control panel for the shape profile.
There are three possibilities for the overall general shape; a plane shape profile
will appear completely flat, whereas a round shape profile will have a rounded cross
section and lastly, the square shape profile will have straight angled sides. Figure 6
illustrates the various shapes of the 3D reliefs. For each of these shapes, there is an
option to define the profile as either convex or concave.

6
Chua C. K. and Chow K. Y.
The square and round profiles can be given a maximum height. If the specified

shape reaches this height
?
it will 'plateau' out at this height giving in effect a lat
region with rounded or angled corners, depending on whether a round or square
shape was selected for the overall prolle respectively (see Fig. 6).
The overall prolle height, which covers the respective region, can be controlled
by specifying the required angle of the profile which represents the tangent angle
of the curve at the edge of the region. Figure 7 further illustrates the concept
of the overall profile height. An alternative to control the overall profile height is
to use the 'scale
5
function to flatten out or elevate the height of the shape profile
$qM$*£ p^tm
fmm
SF0*S&
fiat &tQim
***i&
mm
m%r#
i ^
mm m^ht
L
X
mm*
rstight
wdMwnumtwon «?«« pet * ^M*"***
rm
^tlZt
&r*d flft&3s**£t*?8 ftfci|ghl
nod mzk^m^m my$%

Fig. 6. Various shapes of the 3D
relief.
&?$Qk*
* ro-
seate * i .0
aogl&
m
20"
t06
Fig. 7. An illustration of the overall profile height.

Generation of 3D Shapes in CAD/CAM Systems
7
• « fT£$
&3&&
Insight
1
mm
r i round profila
*w$h
angle 30 s*sd
U t^&&
h^gSht
1
mm asd max tw§M ^ mm
r-
r^yr^d
proiiifc
w#H
£^$8 W and

Fig. 8. An illustration of the definition of shape profiles on different regions.
Fig. 9. 3D relief of an artwork.
(see Fig. 7). The relief detail can be examined in a dynamic Graphic Window within
the ArtCAM environment
itself.
Figure 8 shows an illustration of the definition of
shape profiles on different regions. Figure 9 illustrates the 3D relief of an artwork.
2*4. Wrapping of relief on surfaces
The 3D relief is next wrapped onto the triangular mesh file generated from the coin
surfaces using the command Wrap (see Fig. 10). This is a true surface wrap and not
a simple projection. The wrapped relief is also converted into triangular mesh files
(see Fig. 11). The triangular mesh files can be used to produce a 3D model suitable
for colour shading and machining. The two sets of triangular mesh files, of the relief
and the coin shape, are automatically combined (see Fig. 12). The resultant model
file can be colour-shaded and used by the SLA to build the prototype (see Fig. 13).
2.5*
Converting of triangular mesh file into STL file
The STL format is originated by 3D System Inc. as the input format to the SLA,
and has since been accepted as the de facto standard of input for Rapid Prototyping

8
Chua C. K. and Chow K. Y.
Fig. 10. 3D relief wrapped onto coin surface.
Fig. 11. Wrapped relief converted Into triangular mesh lies.
(EP) systems.
6
"
8
Upon conversion to STL, the object's surfaces are triangulated,
which means that the STL format essentially consists of a description of inter-joining

triangles that enclose the object's volume. The triangular mesh files are also trian-
gulated surfaces, however, of a slightly different format (see Fig. 14). Therefore, an
interface programme written in Turbo-C language was developed for the purpose
of conversion. The converted triangular file adheres to the standard STL format as
in Fig. 15. It has the capability of handling triangular files of huge memory size.
2.6.
Building of model by SLA
Californian company 3D System Inc. pioneered the Rapid Prototyping (EP) tech-
nology when they released their commercial EP system in December 1938 — the

Generation of 3D Shapes in CAD/CAM Systems 9
Fig. 12. 2 sets of triangular mesh iiles •- relief and coin shapes are automatically combined.
Fig. 13. Colour-shaded resultant model file.
SLA-250 model of their Stereolithography Apparatus (SLA).
6
'
7
Stereolithography
technology was Irst developed by Chuck Hall, SD's founding president, in 1982.
Stereolithography works by using a low-power Helium-Cadmium laser or an Argon
laser to scan the surface of a vat of liquid photopolymer which solidiies when struck
by a laser beam.
The SLA process chamber consists of a vat containing liquid photopolymer resin,
a platform on which the object is to be built and whose height is controlled by an
elevator mechanism, a re-coating blade wiper and a Helium-Cadmium or Argon
laser subsystem. At the start of the object building process, the platform is posi-
tioned at a depth of one layer's thickness below the resin level The laser will trace
over areas of the resin surface defined by vectors as the cross-section of the first
layer. The area where the resin is struck by the laser beam solidifies to form the
first layer of the object. Subsequently, the platform is lowered by a distance equal

to the layer thickness, pauses for about 15 seconds to allow the resin level to settle
and the re-coating blade wipes over the resin surface to prepare the construction of
the next layer as the process repeats
itself.
When the object has been completely
built, the platform is raised above the vat of the resin to drain off the excess liquid
resin that has adhered to the object. Figure 16 illustrates the building of prototype
using the SLA.

10
Chua C. K. and Chow K. Y.
DUCT 5.2 TRIANGLE BLOCK P
*
1
@1
1
GREEN
Paint Duct @1
1 0
0.00000
0.00000
0.00000
0.00000
0 0
0.00000
0.00000
0.00000
0.00000
0.00000
10.00000

0.00000
0.00000
0.00000
10.00000
0.00000
3
4 2
10.00000
0.00000
0.00000
1.00000
0 0
0.00000
0.00000
0.00000
0.00000
1.00000
0.00000
1.00000
20.00000
1.00000
20.00000
1.00000
1 4
18 AUG 1993 21.43.28
0
0.00000
0.00000
1.00000
0.00000

0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
20.00000
0.00000
1.00000
1.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
0.00000
Fig.
14. The original triangular file format.
solid print
facet normal -0.00000e+00 2.00000e+02 -0.00000e+00
outer loop

vertex
vertex
vertex
end loop
endfacet
0.00000e+00
0.00000e+00
1.00000e+01
0.00000e+00
0.00000e+00
0.00000e+00
2.00000e+01
0.00000e+00
2.00000e+01
facet normal
0.00000e+00
2.00000e+02
0.00000e+00
outer loop
vertex
vertex
vertex
end loop
endfacet
1.00000e+01
0.00000e+00
0.00000e+00 0.00000e+00
1.00000e+01
0.00000e+00
2.00000e+01

0.00000e+00
0.00000e+00
Fig.
15. The converted triangular file to follow the STL format.

Generation of 3D Shapes in CAD/CAM Systems
11
LASER
PLATFORM
ELEVATOR
VAT
RESIN
'///////// s-7-7
Fig. 16. Building of prototype using the SLA.
The object that comes out from the SLA's process chamber is approximately
96%
solidified and there are minute gaps between the laser's cross-hatching vectors
in between the top and bottom layers which hold uncured, liquid resin. A post-
curing apparatus, which comes in the form of an oven containing ultraviolet lamps
and a rotating turntable, is used to post-cure the object to make it totally solid.
Support structures are required at the base of the object so that it does not adhere
directly to the platform. They are also needed to support overhanging features of the
object to prevent them from collapsing during the building process. These support
structures are removed from the object when it has been completely built.
The SLA makes use of a variety of photopolymers with different properties
suited for different requirements. The properties of the cured photopolymers should
allow SLA prototypes to be used for making soft tools like rubber moulds for mass
production. Research has shown that feasible rubber moulds can be made from
SLA-produced jewellery rings.
9

The SLA is capable of a 0.125 mm minimum layer
thickness and an accuracy of within 0.5%.
3.
Advantages of Art-to-Part Process
The introduction of the scanner, the CAD/CAM system and the SLA provides a list
of specific advantages to the art-to-part process: (1) save time, (2) easy to amend
and (3) easy to master and apply.
3.1.
Save time
The existing technique of hand-carving takes about two weeks to complete a plaster
mould. However, relief can be created in the CAD/CAM system in two hours' time
and the prototype will be ready for examination in the next morning after going
through the SLA. Most companies that manufacture a product invest considerable
time and money in developing a prototype or model. Typically, it is common that the
prototyping process could take weeks or months. The time to market has become a
competitive issue in the need to prototype quickly.
10,11
Besides SLA, other methods
are also available for RP.
12-14

12
Chua C. K. and Chow K. Y.
3.2.
Easy to amend
Very often, there is a need to amend the design of the prototype. Serious amend-
ments will result in discarding of the plaster mould and doubling of the time needed
to produce a model. The CAD/CAM system allows amendment to be done quickly
and easily, and rebuilding of the model is also a simple task.
3.3.

Easy to master and apply
The whole package is relatively user friendly and the procedures for generating
relief are short and simple. The fear of making mistakes in the design becomes an
unjustified worry. There is also a high potential in further extending the application
into other areas such as the jewellery and ceramics tableware industries.
4.
Development of STL File Interface
ArtCAM is a 3D CNC engraving software produced by Delcam International and
is used to convert a two-dimensional picture into a three-dimensional relief for-
mat. The two-dimensional picture can be a scanned picture in bitmap format, any
picture file in graphics format like BMP, TIFF, GIF, JPEG or PCX format. The
software converts this picture into a three-dimensional format (file extension *.rlf)
by colouring the picture and assigning different colours to each part of the picture.
The colours are then given an altitude or height so that when a relief is calculated
and displayed each of the colours is transformed into a relief and the whole image
is viewable as a three-dimensional format called the
relief.
The output relief for-
mat
(*.rlf)
is specific to the ArtCAM software which is used for CNC engraving.
However the relief format is not suitable for RP Systems. In order to create the
3D part using RP technology, it is required to transform the relief format into a
STL file.
Rapid prototyping (RP) is a key technology of the 1990s. More than two dozen
RP techniques have emerged since the first RP technique, stereolithography, was
commercialised in 1988.
15
The most commonly used input to a RP system is the
de facto stereolithography file (STL). All vendors of RP systems accept this format

and practically all major suppliers of CAD/CAM systems today provide an interface
between their CAD model and the STL file.
4.1.
Format of relief and STL files
The formats of the relief and STL file, which are the input and the output files, are
respectively discussed in detail. The structure of their internal detail is explained
with the help of figures.

Generation
of 3D
Shapes
in
CAD/CAM Systems
13
4.1.1.
Format
of
relief file (input file)
A relief file consists
of 3D
image
in x, y and z
coordinates.
The x and y
coordinates
represent
the
in-plane data
and the z
coordinate represents height measurements

in pixels.
The 3D
relief image
is
bounded
by a
rectangular frame.
The
height
of the
pixel gives
the z
coordinates, which
is the
most important part
of the relief. The
coordinates represent
the
internal structure
of the relief. The
file extension
is .rlf.
The contents
of the
relief file
can be
binary
or
ASCII.
A relief

is
represented internally
as a 2
dimensional array
of 16 bit
signed inte-
gers along with
a
scaling factor used
to
transform
the
integer value into
a
floating
point height. This representation halves
the
memory requirements
of a
relief when
compared
to
storing
the
values
as
floats.
4.1.2.
Format
of STL

file (output file)
The
STL
file format
is the
most commonly used file format
for
input
in
rapid
prototyping technologies
and is
also
the de
facto industry standard.
The STL
file
defines
the
surface
of an
object
as a set of
interfacing triangles
or
facet.
Each facet
as
shown
in Fig. 17 is

defined with three vertices
and a
normal, which
identifies which side faces
out and
which side faces
in. In the STL
file, solid models
are represented
as an
unordered collection
of
facets
and
each facet
has an
outward
directed facet normal associated with
it.
16
The generation
of
these facets depends
on the
information contained
in the
STL file.
It
should
be

noted that
in the
format
of the STL
file,
the
coordinates
of
the
vertices
are
ordered according
to the
right hand screw rule. That
is in an
V2
Edge
yj \
/
V
1
Vertex
^^srV
Facet 1
\/
Direction
of
Facet Normal
—7
V4

Edge
V3
r
Fig.
17.
Description
of
facet.

14
Chua C. K. and Chow K. Y.
anti-clockwise direction such that the normal of the facet is being directed away
from the model as shown in the Fig. 18.
Another important information that can be derived from the STL file is that for
every facet edge, there must be another facet and only that facet sharing the same
edge.
Since the vertices of a facet are ordered, the direction on one facet's edge is
exactly opposite to another facet sharing the same edge, this necessary condition is
also known as Mobius rule as shown in Fig. 19.
A facet can reference the three edges which bound it.
17
Each edge can reference
the two vertices which define it. Vertex points can contain the connectivity infor-
mation to all edges or faces which share it. The STL format only contains facets
with minimum information necessary to define the image or solid object.
Fig. 18. Right hand screw rule.
Fig. 19. Mobius rule = Edge shared by two facets.

Generation of 3D Shapes in CAD/CAM Systems 15
For each vertex that is present in the STL file, it is absolutely necessary to

calculate the normal in order to determine which way the facet is facing, whether
inwards or outwards. To calculate the normal, the essential information required is
the vertices which bound the facet. The normal is calculated by the cross product
of the vertices.
In order to understand the format of a STL file, it is important to know the basic
internal structure of a STL file. There are two different formats of STL files. One
is the ASCII format which is human readable, and the other is the binary which
is totally unreadable. During the developmental stages of this project, the ASCII
format was used for debugging purposes.
The binary format is used only in the final release version. The reason for using
the binary file format is because of its compactness. To illustrate with the example
of the bear, the size of the STL file in ASCII is 12 MB whereas the size STL file in
binary is only 900 kilobytes. The size of the file differentiates these two formats.
4.2.
STL conversion
To convert the relief file into STL output, a number of problems must be overcome.
They are mainly related to the size of the image file being converted. The major
concerns that will affect the image size are the resolution of the relief image (input
file), the size of the output file with respect to testing, and the reduction of triangles
which are directly dependent on the resolution of the image. Each problem will be
explained in detail as follows:
4.2.1.
Limitation of the STL format
In order for the file size not to be too large, the ASCII version of the STL file was
used only for verification purposes and the binary version was used for testing and
in the final release version. The size of the converted STL file (binary) should not
exceed a size greater than 50 MB. This is a limitation of the STL format amongst
several other disadvantages of the STL format. This is one of the major problems
affecting the testing of the file because if the file could not be tested, it would not
be possible to detect the errors. This puts a major constraint on the image size of

the relief file. The example used for testing purposes was that of the face of a bear.
The output of the STL ASCII file size was 12 MB whereas the size of the binary file
was 900 kilobytes.
4.2.2.
Resolution of the relief image
The resolution of the relief image also affected the output. If the resolution of the
relief image was higher, then the STL output would grow in direct proportion to the
resolution of the relief image. The primary reason being that, for a high-resolution
image the number of pixels used to describe the image would be far greater than
required. Hence in order to keep the size of the file under control, it is necessary to

×