voxel-based solid models: representation, display and
TRANSCRIPT
Voxel-based Solid Models:
Representation, Display and Geometric
Analysis
M. Tech Dissertation
Submitted in partial fulfillment of the requirements for the award of the degree of
Master of Technology
(Manufacturing Engineering)
by
Sandeep Sudhir Patil
(Roll No. 03310002)
under the guidance of
Prof. B. Ravi
Department of Mechanical Engineering
Indian Institute of Technology, Bombay
Mumbai – 400076
June 2005
i
Abstract
‘Voxel’ stands for ‘volumetric element’ or ‘volumetric pixel’ and is a three-dimensional
element analogous to what pixels are in two-dimensions. ‘Volumetric modeling’ in the
form of exhaustive enumeration of voxels is becoming popular in CAD/CAM/CAE
world, owing to its superiority over traditional solid models especially for free form
modeling (volumetric modeling, display and analysis).
In this work, a new generic voxel based volumetric modeling and visualization system
has been developed. The binary voxel model is stored as a stack of voxel layers
represented as ‘bit-arrays’. The process of ‘voxelization’ converts polygonal solid model
to the voxel format. The voxelization gives satisfactory results in terms of memory
consumption and processing time for voxel resolutions up to 1000 – overall volume of 1
billion voxels. Voxel resolution can be set as per application requirement. A new
algorithm has been developed for visualization of the voxel model using direct point
based rendering. This uses look-up table to generate realistic rendering. The images
generated are better than simple cube face display which gives blocky appearance. Low
level functions that operate on the voxel data are written to perform geometric
computation and reasoning. With this, functions to perform sectional-display, X-ray scan
and skin-removal simulation have been developed. The algorithms have been tested for
complex free-form models like a ‘Ganehsa’ and a Pelvic bone model along with other
engineering models. The outcome is a new basic voxel based modeling framework which
can be extended and coupled to standard solid modeling systems as a supplement
providing additional capabilities to traditional surface based systems.
Keywords- Voxel, Solid modeling, Volume modeling, Free-form, Geometric reasoning.
ii
Contents Chapter No. Title Page No.
Abstract i
List of tables v
List of figures vii
1 Introduction 1-5
1.1 Solid modeling 2
1.2 Voxel based modeling 3
1.3 Report organization 5
2 Literature review 6-31
2.1 Volume representation methods 6
2.2 Volume graphics 8
2.3 Voxel model representations 9
2.3.1 Discrete Cell Enumeration 9
2.3.2 Octree representation 10
2.3.3 Array representation 11
2.4 Voxelization 12
2.4.1 Essential characteristics of Voxelization
algorithm 13
2.4.2 Scan conversion algorithm 13
2.4.3 Implicit functions 14
2.4.4 Distance shells and fields 14
2.4.5 Parity count method 15
2.4.6 Ray stabbing 15
2.5 Volumetric display (rendering) 16
2.5.1 Classifying volume rendering methods 16
2.5.2 Indirect methods 17
2.5.3 Direct methods for the display of surfaces in binary data 19
2.5.4 Display algorithms for grey-scale data 22
2.5.5 Radiosity 23
2.6 Applications of Voxel (Volume) based modeling 24
2.6.1 Scientific data set visualization 24
2.6.2 Amorphous entity visualization 26
2.6.3 Representing solid interiors 26
2.6.4 Visualizing volume data 27
iii
2.6.5 Haptic modeling and rendering 29
2.7 Summery of Literature survey 29
3 Problem definition 32-38
3.1 Motivation 32
3.2 Study of present voxel based modeling systems 33
3.2.1 FreeForm Modeling Plus 33
3.2.2 3D Doctor 34
3.2.3 MIMICS 35
3.3 Objective and scope 37
3.4 Approach 37
4 Voxel data structure and voxelization 39-48
4.1 Voxel data set 39
4.2 Voxel data structure 40
4.2.1 Bit array 41
4.2.2 Voxel data on disc 43
4.3 Voxelization 43
4.3.1 Voxelization algorithm 43
4.3.2 Modified Voxelization algorithm 46
4.3.3 Errors in voxelization 46
5 Voxel display and analysis 49-56
5.1 Intensity look-up table 49
5.2 Geometric analysis of voxel model 54
5.2.1 Progressive sectional display 55
5.2.2 Skin removal simulation 55
5.2.3 X-ray scan 56
6 Implementation and results 57-73
6.1 Voxelization 57
6.2 Voxel display 63
6.3 Voxel section display 69
6.4 Skin removal 70
6.5 X-ray scan display 71
7 Conclusions 74-75
7.1 Summary of work done 74
7.2 Future scope 75
iv
Appendix 76-78
A. ‘STL’ file format 76
B. 3D discrete topology 77
References 79-80
Acknowledgement 81
v
List of figures
Fig. No. Figure title Page No.
2.1 Volume representation methods 7
2.3.2 Quadtree and Octree architecture 11
2.5.1 Classification of volume rendering methods 17
2.5.3 Direct volumetric rendering 22
2.6.1 Volumetric analysis and visualization 24
2.6.2 Amorphous entity visualization 26
2.6.3 Mapping human body anatomy 26
2.6.4 Solid model from CT scan data slices 27
2.6.5 Haptic modeling and rendering 29
3.2.1 Modeling in FreeForm modeling Plus 7.1 33
3.2.2 Volume Rendering in 3D Doctor 35
3.2.3 MIMICS software interface 36
4.2.1 Stack of ‘planes’ holding bit-array 41
4.3.1 Steps to initialize voxelization 44
4.3.2 Voxelization algorithm 45
4.3.3 Errors in voxelization caused by thin sections 47
4.3.4 Image showing errors in voxelization 48
5.1 Face connected neighbouring voxels 50
5.2 Voxel intensities for a sphere 52
5.2.1 Progressive sectional display 55
5.2.2 Successive skin removal simulation 56
5.2.3 X-ray scan: Intensity variations proportional to thickness 56
6.1.1 Time for Voxelization of standard shapes
with different resolution 59
6.1.2 Time for Voxelization of various solid models
with different resolution 61
6.1.3 Memory required for Voxelization of standard shapes and
various solid models with different resolution respectively 62
vi
List of figures (Cont.)
Fig. No. Figure title Page No.
6.2.1 Voxel images with point-smooth Off and On (R=20) 63
6.2.2 Voxel images with Zoom and corresponding change of
point size(S) (Resolution=200) 63
6.2.3 Voxel images with different resolutions (R) 64
6.2.4 Voxel images with different angles of rotation
about Y-axis (Resolution= 200) 64
6.2.5 Voxel model from the project and from FreeForm
(Resolution= 200) 65
6.2.6 Voxel display images of various solid models with
resolution of 400 66
6.2.7 Display Images fro Ganesha model with different
resolutions (R) 67
6.2.8 Display Images of pelvis model with different resolutions(R) 67
6.2.9 Display Images of cylinder block with different resolutions(R) 68
6.3 Sectional Display Images of cylinder block and
Ganesha model with different resolutions(R) 69
6.4 Successive Skin removal Images of cylinder block
with resolution 200 70
6.5.1 X-ray scan images of Ganesha model with minimum,
maximum and total thickness options respectively (R=200) 72
6.5.2 X-ray scan images of Cylinder block model along two
directions and with different thickness options (R=200) 73
vii
List of tables Table No. Table title Page No.
1.1 Comparison of exact and approximate 3D model representations 3
4.2.1 Voxel indices in bit-array for one Z-plane with resolution 100 42
5.1 Sample bit strings from neighbouring voxel configuration 51
5.2 Intensity look-up table 53
6.1.1 Voxelization results for standard shapes 58
6.1.2 Voxelization results for various solid models 60
1
Chapter 1
Introduction
Today, the use of computers in various fields has gone well beyond mere data storage.
Especially in engineering, computers are extensively used for virtual product modeling,
simulations, manufacturing planning and control, knowledge management, automation
and other allied business processes. The practices like CAD, CAM, CAE have developed
enormously over last couple of decades, not only in terms of penetration into industry but
the underlying technologies as well. Similar trends of increasing computer applications
are seen in other areas as well, like medical modeling and simulations, geological
modeling, environmental modeling and simulations. On the other side, non-engineering
fields like animation and computer gaming, virtual reality, art, fashion and archeological
modeling are also using computers for making new generation designs. The drivers for
this growth of computer applications are innovations in the basic computer technology
and hardware, and also the ever expanding business scope and complexities. The latest
practices like collaborative engineering, product life cycle management and tele-
operations demand more advances in the computer technology to enable faster and
efficient communication across distances.
In engineering applications, a virtual model of product and assemblies is a must for all
other computer integrated processes. Solid modeling is extensively used in engineering as
well as non-engineering areas such as medical modeling. The components and assemblies
involved are getting more complex day by day. Hence, an efficient solid modeling
technology is very fundamental for successful implementation of upstream applications.
Traditionally surface representations were used for solid modeling as they are very
compact and just sufficient for many applications. But surface models lack volumetric
information and do not cater easily for volumetric analysis and display. The need for
volumetric modeling and display was first recognized when medical scanning
technologies like CT and MRI became popular. Other areas where volume modeling is
used are scientific analysis of volumetric phenomenon like environmental and geological
research.
2
1.1 Solid modeling
Solid models come under the realm of 3D modeling. 3D modeling is a computerized
representation of physical objects in some suitable mathematic or abstract from. The 3D
models from the basis for all CAE and CAM operations.
The 3D model world constitutes two fundamental aspects: Modeling and Representation.
Modeling is how the actual computer model is generated using some modeling software
package (For instance Pro-E, CATIA) or in a raw form by some 3D scanning (CAT, MRI,
Confocal Microscopy, Radar imaging). Various methods used in 3D modeling include
CSG (Constructive Solid Geometry)
Breps (Boundary representation) and
Feature based modeling
Representation is the form of representation of the 3D model and way in which it is
stored in the computer memory. Different schemes in practice for representing 3D models
are
Surface models
Wireframe models- Meshes and polygon (faceted models)
Decomposition based (Octrees, BSP)
Voxel based: ―Voxel‖ stands for ―volume element‖ or ―volume pixel‖. Voxel
based models represent solids as a three dimensional arrangement of discrete
volume elements.
The 3D representation schemes for sold models can be broadly classified as: Exact and
Approximate representations.
Exact representation is precise model of object topology and mathematically represents
all geometry. These include Wireframe, Parametric surfaces, and Solid models
represented by CSG, BRep and implicit solid models. Here the object features are
represented exclusively.
Approximate representation involves discretization of the 3D objects and use of simple
primitives to model topology and geometry. These include Facet/ Mesh representing just
surfaces, Voxel models representing volumes.
3
The comparative positives and negatives of exact and approximate representations are
given in the following table 1.1.
Table 1.1 Comparison of exact and approximate 3D model representations
Exact representation Approximate representation
Advantages
Precision: good for simulation, modeling
Lots of modeling environments
Compact
Many applications
Easy to implement
Easy to acquire (3D scanner, CT)
Easy to render
Many algorithms possible
Limitations
Complex data structures
Expensive algorithms
Wide variety of formats
Hard to acquire data
Translation required for rendering
Loss of details
Data structure sizes can get huge, for
good fidelity
Easy to break, cracks can appear
Not suitable for certain applications
1.2 Voxel based modeling
―Voxel‖ is a 3-dimensional element analogous to ―pixel‖ in 2D. In volumetric modeling
an object is represented as a collection of voxels in 3D arrangement which may be regular
or irregular. Cubic voxels in uniform grid aligned with the coordinate axes is the simplest
and commonly used representation. The same is used in this project.
―Volume visualization‖ is a very fast growing field in computer graphics driven by need
for analysing large volumetric data sets generated in scientific and medical projects.
Volume visualization systems are used to create high-quality displays from scalar and
vector datasets defined on multidimensional grids, usually for the purpose of gaining
insight into a scientific problem. Volume visualization also uses concept of voxels. But
voxels used in CAD application are little different in the sense that generally they are
binary models where voxel only represent status of object occupancy in the given volume.
4
Voxel based modeling is not new but it was not used to extent because of huge memory
and processing capability required by computers to handle voxel models of sufficient
resolution. But now with advances in computer hardware and architectures, we have
sufficiently higher processing speed and cheaper memory that voxel models can be
implemented on desktop systems as well. It is expected that voxel based modeling will be
used extensively in future in areas like CAD/CAM/CAE, medical imaging, scientific
simulations and visualizations, animations and non-engineering modeling, virtual reality
systems and tele-operations and controls etc. Some manufacturing related problems can
be better analysed using voxel based modeling [Lu, 1996] than conventional surface
based systems.
The focus of this work is on use of ‗volumetric modeling‘ in CAD/CAE application for
engineering/non-engineering components. A ‗voxel‘ based model representation scheme
has been developed. The main goal of the project was to develop a voxel representation
scheme efficient in terms of memory and processing and which serves voxel resolution up
to 1000. That is an overall volume of 1 billion voxels. Though, in general, voxel models
of resolution up to 400 are commonly used. A new visualization algorithm using point
based direct rendering is developed for displaying voxel model. The work is different
from conventional ‗Volume visualization‘ basically in terms of type of volume data
involved and the purpose of visualization.
A CAD model is usually defined in B-Rep format which is essentially a surface
representation. Such model is first converted into a ‗volumetric model‘ representation by
process of ―Voxelization‖. The voxel data generated is basically binary data in uniform
Cartesian grid. As this is a simple and low level representation of only geometry of
object, there are no data values (either scalar or vector) in volumetric form. Hence the
display algorithm sought was to just suffice efficient visualization of object geometry
with sufficient accuracy and realism. The availability of volumetric representation and
visualization in a CAD/CAE system allows great many possibilities in geometrical
processing and analysis which are not easy to implement if not impossible, with
conventional surface representations. Along with basic display functions, few low level
geometric reasoning functions are also written to operate on voxel model. Using such
functions, section display, X-ray scan and skin-removal simulation module is also
developed.
5
1.3 Report organization
The detailed literature review regarding volumetric modeling and volume graphics is
presented in chapter two. The chapter begins with fundamentals of volumetric modeling
and its advantages and limitations. Various algorithms and methods proposed and
developed by researchers for voxel model representation and display are described.
Description of various voxelization algorithms is also included. The chapter ends with
applications of voxel based modeling and summary of literature review.
Chapter three includes the problem definition, objectives and scope of the work. A short
description of study of few existing voxel based modeling systems is included. The
chapter ends with the description of approach followed in the work.
Chapters four and five include detailed description of the major work done in the project.
The new voxel model representation scheme and voxelization algorithm are explained in
chapter four. While, chapter five describes the new voxel display algorithm developed.
The geometric reasoning and analysis functions implemented are included in chapter five.
Detail results regarding time and memory required for voxelization are presented in
chapter six. The results include testing on various engineering and non-engineering
models. The chapter also includes numerous images of display of various voxel models
using the developed visualization algorithm with different settings. The outcome of the
geometric analysis functions is presented at the end of the chapter.
Conclusion and scope for future work is presented at end of the report.
6
Chapter 2
Literature review
Volume graphics and volumetric modeling are separate streams of research, but have
considerable interlink. Over the last couple of decades, these fields have evolved
enormously in terms of variety of technologies and depth as well. The chapter begins with
evaluation of volumetric modeling and voxel based methods. This is followed by various
voxel based model representation techniques presently used. Then a detailed review of
various voxelization and volumetric display algorithms is presented.
2.1 Volume representation methods
Volume representation for engineering models is essentially space occupancy information
for a given object. The information is ‗Binary‘. It means that the space is either occupied
by the object or is void. Following are the various methods used for volume
representation which are described in Figure 2.1.
(a) Sweep volume
Sweeping a 2D area along a trajectory creates a new 3D object. The sweep may be
Translational, Tapered, Rotational or General 3D curve. Thus each volumetric segment is
defined by one ‗section curve‘ which is a closed planar curve swept along ‗sweep curve‘.
(b) Binary Space Partitions (BSP)
BSP involves partitioning 3D space by a sequence of planes successively dividing the
space into two halves each time. The tree representation of BSP is a binary tree with two
child nodes added as leaf nodes. A leaf node represents a homogeneous portion of space-
either ―in‖ or ―out‖. Regions decrease in size along any tree path. It is easy to determine if
a point lies inside our outside the region by traversing the BSP tree.
7
Translational
Tapered
Slanted
Rotational
Solids by Sweep CSG
Voxel enumeration BSP
(c) Constructive Solid Geometry (CSG)
Combines simple primitives using Boolean operations and represents as a binary tree. The
Boolean operations include Union, Intersection and Difference. To generate the object the
tree is processed in a depth-first pass. The CSG representation may not be unique.
(d) Boundary Representation (B-Rep)
A closed 2D surface defines a 3D object. At ach point on the boundary there is an ―in‖
and ―out‖ side. Boundary representations can be defined in two ways, ‗Primitive based': a
collection of primitives forming the boundary (polygons, for example) and ‗Freeform
based‘ (splines, parametric surfaces, implicit forms).
(e) Spatial Occupancy Enumeration
This is a voxel based method. It is an extension of the concept of pixels into 3D. Space is
considered as a regular array of cells (usually cubes). Each cell is called ―voxel‖. A 3D
object is represented as a list of object filled Voxels
Fig. 2.1 Volume representation methods
8
2.2 Volume graphics
Volume graphics is an emerging subfield of computer graphics. It is concerned with the
synthesis, modeling, manipulation, and rendering of volumetric geometric objects, stored
in a volume buffer of voxels. A volume representation that has general applicability is the
exhaustive enumeration of the occupancy of elementary cells (voxels) that lie on a
uniform 3D grid. For each cell, either a binary value indicating whether that cell is inside
or outside the object (binary voxel model) or a numerical value representing some
physical quantity such as density (gray-value voxel model) is maintained. Usually a
spatial ordering is imposed on the occupancy values by storing them in a 3D array. A 3D
array (called also volume buffer, cubic frame buffer, 3D raster) is typically used to store
these values [Kaufman, 1993].
Desired features of a modeling system
Selection of a representation scheme for solid models for any application involves
evaluating the following things [Jense, 1989]
Storage cost
Display complexities
Desired manipulations
Data availability
Representation conversions
Typical manipulations that may be performed on geometric data are
Geometric transformations (translation, rotation and scaling)
Modeling operations (Boolean set operations, re-slicing, spatial editing)
Numerical analysis (extraction and quantification of parameters such as surface
area, volume)
From the above listed parameters, requirements of a good solid model representation
could be identified as
Accurate Efficient Boolean operations
Concise Efficient display
Affine invariant Incorporate volume information
Easy acquisition Easy to implement algorithms
Guaranteed validity Good resolution variability
9
Voxel based modeling
Using voxel based methods for solid model representation provides following advantages
and limitations. [Kaufman, 1993]
Advantages
Simple, intuitive, unambiguous and unique representation
Same complexity for all objects
Natural acquisition for some applications (CT, MRI)
Trivial Boolean operations (CSG)
Heterogeneity and anisotropy of models can be easily incorporated into analysis
(which may be the case in objects made by powder metallurgy of recently by
Nanotechnology)
Display is viewpoint independent, insensitive to scene and object complexity
Limitations
Approximate representation: inherent to discretization
Large memory requirements
Larger processing times (compared to surface models in terms of display)
Aliasing
Lack of geometric representation
2.3 Voxel model representations
There are many methods proposed for voxelization of polygon models [Nooruddin, 2003;
Fang, 2000] and CSG models [Fang, 2000]. As there are many method of voxelization, so
there are many representation schemes for voxel models. Mostly the voxel file formats
are application specific. Few voxel model representations in use are as follows.
2.3.1 Discrete Cell Enumeration
There are many formats used by commercial software developers which have a specific
data field format specified for every voxel and the file essentially is enumeration of these
values in some sequence of voxels. For instance the following voxel representation
formats.
10
(a) Vox1999a file format
The proposed voxel file format consists of three logical sections. The file begins with a
file header that contains descriptions and copyright notices pertaining to the data in the
file. The header is followed by a volume description section that describes the first
volume and the voxel data in it. The volume data section follows immediately after the
end of the description section. Each datum in the data section represents a voxel
containing one or more fields (for example, an RGBA voxel). The volume description
and volume data sections may repeat to provide for multiple volumes in one file
[TeraRecon Inc., 2002].
(b) Gaussian Cube File format
The cube file describes volumetric data as well as atom positions. The file consists of a
header which includes the atom information and the size as well as orientation of the
volumetric data. This is followed by the volumetric data, one scalar per voxel element.
All aspects of the file are in text format.
Header- The header has the number of atoms included in the file followed by the position
of the origin of the volumetric data. Then it includes the number of voxels along each axis
(x, y, z) followed by the axis vector. This means the volume need not be aligned with the
coordinate axis, also means it may be sheared. The last section in the header is one line
for each atom consisting of 5 numbers, the first is the atom number, the last three are the
x, y, z coordinates of the atom center.
Volumetric data- The volumetric data is straightforward, one floating point number for
each volumetric element.
2.3.2 Octree representation
Octree is a data structure enabling efficient storage of 3D data. Octree is a 3D
generalization of a Quadtree (for 2D). Each node in an Octree has eight children. Octree
describes a recursive partitioning of a volume into cells that are completely full or empty
[Prakash, 1990]. Octree methods achieve data compression by storing voxel information
in a hierarchical tree structure, which is built in a top-down fashion by recursively
subdividing inhomogeneous regions of the volume into eight sub-regions until each
terminal node of the tree corresponds to a region of the volume in which all voxels share
the same value.
11
Actual implementation of octree uses pointers for representing connections between
parent and sibling nodes at every stage of partitioning (Fig. 2.3.2).
Fig. 2.3.2 Quadtree and Octree architecture
2.3.3 Array representation
In spite of the many advantages associated with an octree representation of solids, the
main disadvantage would be that of storage. This is because for every node in the octree,
we must store pointers to its parent and eight siblings. Instead, if the octree was
implemented as an array, we would have to allocate space for a full tree amounting to
[(8n+1
- 1) / 7] nodes, for a tree of depth n. However, we would not need to store pointers
to siblings and parent since their location is implicit in the array index of any given node.
Further, for a realistic reproduction of irregular solids, it is presumable that the octree
would grow close to its full size. Consequently, we find no storage efficiency in storing
the tree in a pointer based structure as opposed to an array based structure. In fact we
would find that in realistic modeling of sculptured surfaces and solids, a pointer based
structure would actually consume more memory space due to the pointer storage
overhead corresponding to each of the eight sons and parent.
Thus it can be seen that as the object shape becomes more complex, the depth of octree
increases and it becomes more inefficient in terms of memory. Instead a simple
exhaustive enumeration format of voxel data implemented as array will have size
independent of object shape complexity. Also it will avoid the overhead of storing
pointers. Also, the advantage can be taken of the regularity in the arrangement of voxels
in the given volume to enforce correspondence between the actual voxel in space and its
Octree
12
index in the array. There are many possible variations in array representation of voxel
models. Many commercial software packages have their own custom formats. The
simplest array implementation would be for a binary voxel model wherein a single bit can
be used to represent state of each voxel. For grayscale voxel model, depending upon the
range of variable at each voxel, an array of appropriate data type can be used.
Here is one such model employing arrays to store voxel information. A node in the voxel
model is a number called V-value as shown below.
V-value = vn vn-1..... v1 where 0 ≤ vi ≤ 8.
Each digit vi denotes the path to be taken at level i, (0=terminal, 1,2,3,4,5,6,7,8 are the
directions of the sibling nodes along the eight octants) to reach the node from root which
is assigned a level 0. The root carries a V-value 00...0. V-value gives the unique path
from root to any node in the tree and can also be obtained for a given path. Each element
of this array contains 2 bits (call Co, Cl) of information. These represent the color-type of
the node as follows.
type color-type = (white, gray, not-used, black);
C0 Cl Color
0 0 White
0 I Gray
1 0 Not-used
1 1 Black
A white or black node is a terminal node and has no children. However, with regard to the
array representation of voxel tree, the nodes allocated for their children are labeled not-
used. A gray node is a non-terminal node and has children which are black, white or gray.
2.4 Voxelization
‗Voxelization‘ is the process of converting geometric objects from their continuous
geometric representation into a set of voxels that ―best‖ approximates the continuous
object [Kaufman, 1993]. As this process mimics the scan conversion process that
pixelizes (rasterizes) 2D geometric objects, it is also referred to as ‗3D scan –conversion‘.
However, the voxelization process does not render the voxels but merely generates a
database of the discrete digitization of the continuous object.
13
2.4.1 Essential characteristics of Voxelization algorithm
A 3D scan-converter is required to obey some fidelity, connectivity, and efficiency
requirements [Kaufman, 1987]. The requirements assume viewing from a major axis, and
would have to be changed slightly for omni directional viewing.
(a) Fidelity
The discrete points, for which the region contained by them is entirely inside the
continuous object, are in the converted discrete object.
The discrete points, for which the region contained by them is entirely outside the
continuous object, are not in the converted discrete object.
Obviously, some discrete points will not belong to either of the above cases, and more
guidelines are necessary.
If the object is 3D (volume), its ―inside‖ will be converted according to requirements
1 and 2. Other points will be treated by majority decision - the discrete point is in the
object if more than half its region is in the continuous object.
(b) Connectivity
For a 1D object, 6-connectivity or 26-connectivity is required, depending on
implementation needs.
For a 2D object ―lack of tunnels‖ of certain connectivity is required. Again, 6-
connected or 26-connected tunnels can be disallowed depending on implementation
requirements.
(c) Efficiency
Use integer or fixed point arithmetic whenever possible, and floating point only when
impossible otherwise.
Use simple operations (addition) rather than complex ones (multiplication), and avoid
altogether more complex operations (square root) within inner algorithm loops.
Operate in parallel so that the temporal complexity is less than the computational
complexity, without too much hardware complexity.
Various methods used for voxelization are as follows.
2.4.2 Scan conversion algorithm
This is also called as ―volume sampling‖. The basic method for converting objects is
spatial occupancy. A regular grid of voxels is placed over the domain of the source
object, and for each voxel a binary decision is made as to whether each voxel is inside or
14
on, or outside the object [Kaufman, 1987; Huang, 1998]. The recognized problem with
this method is that the representation produces a discrete surface which is recognizably
blocky. Simple solutions have been to increase the resolution of the data set, but this in
turn increases the memory requirements and rendering times [Jones, 2001]. These
algorithms do scan-conversion with computational complexity which is linear in the
number of voxels written to the CFB (Cubic Frame Buffer) [Kaufman, 1987]. All
algorithms are incremental and use only additions, subtractions, tests and simpler
operations inside the inner algorithm loops. Since the algorithms are basically sequential,
the temporal complexity is also linear. There are algorithms proposed for voxelizing lines
and polygons [Wang, 1993].
2.4.3 Implicit functions
Sampling is a valid method for producing voxelised objects, but it suffers from resolution
problems (blocky images), and restricted orientation of normals. One type of object for
which this volume sampling is not a problem is that of implicit functions [Jones, 2001].
Here the voxel grid is calculated by evaluating the function of the implicit surface – for
example, for a sphere of radius r, f (x, y, z) = x2 +y
2 +z
2 - r
2.
Normals from such data produce naturally shaded objects. The implicit functions encoded
as above can be considered as ‗space filled‘ voxelization – there is a value at every point
in the domain of the object. The sampled voxelizations only produce values in the vicinity
of the object and can be considered to be ‗shell‘ voxelizations.
2.4.4 Distance shells and fields
If the interest is just in encoding the surface and do not need a space filled distance field,
we can voxelize the object just in the vicinity of the surface. Such a voxelization is called
‗a distance shell‘. Here the computational expense is significantly less, and the surface
representation is far superior when compared to the over sampling method which takes an
equivalent time. The distance shell adequately represents the object, and is a valid method
for voxelizing objects where only the surface needs to be encoded. As a shell voxelization
it benefits from the advantage of requiring less memory to store. Space filled distance
fields [Jones, 2001] can be calculated from distance shells and gives more realistic
modeling with many application areas.
15
2.4.5 Parity count method
For polygon mesh models, classify a voxel V by counting the number of times that a ray
with its origin at the center of V intersects polygons of the model [Nooruddin, 2003]. An
odd number of intersections mean that V is interior to the model and an even number
means it is outside. This is simply the 3D extension to the parity count method of
determining whether a point is interior to a polygon in 2D. For manifold models, the
direction of the ray is unimportant and advantage can be taken of this to speed up the
voxel classification. Many parallel rays can be cast through the polygonal model and each
one of these rays classifies all of the voxels along the ray. For an N x N x N volume, we
need to cast only N x N rays, with each ray passing through N voxel centers. Although
the parity count method works well for manifold models, many polygonal models have
various degeneracies that require modifying the voxelization process. One common
problem is for a model to have small cracks or holes in the surface. To voxelize such
models, the parity count method is extended by using k different directions of
orthographic projection and by scan-converting the model once for each direction. Each
of the k projections gives the classification of a voxel (interior or exterior), and the
majority vote is the voxel‘s final classification. For watertight models, all of the votes will
agree.
2.4.6 Ray stabbing
The ray-stabbing method also makes use of orthographic projections of a polygonal
model. It differs from the parity count method, however, in the way it interprets the depth
samples of a ray. The ray stabbing method only retains the first and last depth sample
along each ray [Nooruddin, 2003]. In effect, each ray only keeps those points of
intersection where the ray first stabs the surface of the model. Keeping both the first and
last depth samples is equivalent to stabbing the surface from two directions at once, at no
extra cost. A voxel is classified by a ray to be interior if the voxel lies between these two
extreme depth samples; otherwise, it is classified as an exterior voxel. For a single
direction of projection, this can cause some voxels to be misclassified as being interior to
the surface. To avoid this, several projections in different directions are taken. If any of
the projections classify a voxel as exterior, it is given an exterior classification. Only
those voxels that are classified as interior for all projections are given the final
classification of interior.
16
2.5 Volumetric display (rendering)
Traditional surface graphics is not ideal for rendering volumetric objects which have
volume data associated; for example sampled data sets from CT, MRI and amorphous
data like gases, fire smoke, cloud. Also, when operations such as peeling, cutting,
sculpting are to be performed on solid models which expose the interiors of object,
surface graphics finds difficulty [Acker, 1993].
Advantages of Volume graphics
Suitable for sampled data and amorphous phenomena
Insensitive to scene complexity
Insensitive to surface type
Allows block (volumetric) operations
Hierarchical representation
Limitations of Volume graphics
Large memory and processing power required
Object-space aliasing
Discrete transformations
Lack of geometric representation
2.5.1 Classifying Volume rendering methods
Several methods exist for the rendering of volumes. One class of these methods converts
the voxel representation into surface and line primitives [Elvins, 1992]. However,
methods of this class suffer from various disadvantages that mainly arise from the
ambiguity of determining the exact position of the surface. As an alternative, direct
methods have been developed to render volumes. These methods can be classified as
object order or image order as shown in figure 2.5.1. Object-order methods require the
enumeration of all voxels of a volume and the determination of the affected pixels on a
screen. Image order techniques, on the other hand, determine all the voxels of a volume
which affect a given pixel on the screen. Hybrid methods exist in which the volume is
traversed in both object and image order.
17
Various rendering methods can be differentiated using the following three characteristics,
(1) whether the explicit creation of an intermediate surface representation is required (if
so, then refer to the method as "indirect")
(2) whether the method is designed to operate on binary or on grey-scale data, and
(3) for methods that operate on grey-scale data, whether a binary decision must be made
about the existence of a surface at any given location in the volume.
Voxel data
Binary Grey-scale
Direct rendering Indirect rendering
Object order Image order
Fig. 2.5.1 Classification of volume rendering methods
The following sections contain short description of various direct and indirect rendering
methods for binary voxel data as per the classification described above.
2.5.2 Indirect methods
(a) Tiling method
This one of the earliest approaches used to create images from volume data sets involved
the construction of three-dimensional polygonally-tiled surfaces from planar contour
curves defined on successive two-dimensional slices through a volume. In the simplest
cases, a single closed contour (either hand-drawn or computed using an automatic
boundary-detection algorithm) is used to outline the object of interest separately on each
slice and contour points from adjacent slices are then joined to form triangular tiles.
(b) Indirect, voxel-based methods
In addition to the tiling methods, a number of voxel-based methods have been introduced
which compute and display surfaces from volume data. Most of these methods assume,
18
for algorithmic simplicity, that all data points in the volume are equidistant. If the data
has been sampled at unequal rates in the different dimensions (for example, if the distance
between data points within a slice is less than the distance between data points in adjacent
slices), then some kind of interpolation is generally used to obtain the necessary
intermediate values. In most grey-scale data sets, the value at a voxel represents a point
sample of a continuous three-dimensional distribution, which is referred to as "intensity".
In the cuberille method, the volume occupied by each voxel is modelled as a cube of
constant intensity consisting of six polygonal faces, and object surfaces are constructed
from appropriately selected connected subsets of these cube faces. Despite the large
number of primitives, images can be displayed fairly quickly once the set of cube faces
comprising the surface has been found because the shading and hidden surface
computations can be optimized to take advantage of the regularity of the polygonal
representation. The quality of an image produced by this method will be highly dependent
on the accuracy of both the surface localization and the estimation of surface normals.
Because the cuberille method relies on an intermediate representation in which polygons
may only appear in one of three possible orientations, the images produced by this
method will exhibit sharp discontinuities in surface brightness if shading is based solely
on the polygonal approximation. Attempts to mitigate the effects of these blocky artifacts
by low-pass filtering the final image, antialiasing using sub-pixel sampling, or averaging
surface normals from adjacent polygons have met with little success.
(c) Indirect, sub-voxel based methods
One of the most popular voxel-based methods is the "marching cubes" algorithm
[Lorensen, 1987] which uses subvoxel-sized triangular elements to represent isovalue
surfaces in a volume. Unlike other methods, in which each data point, or voxel, is
represented as a small cube, the basic unit of operation in this algorithm is the cubic
volume defined between eight neighboring data samples. Each such cube in the data set is
examined and if the desired isovalue surface is found to be contained within that volume,
a trianglular tesselation of the enclosed portion of the surface is derived. As a first step,
the voxel intensity (or some precomputed object inclusion likelihood value) at each of the
eight cube vertices is compared with a threshold value to determine whether that voxel
lies inside or outside of the desired surface. The cube is then assigned one of 256 possible
19
index values based on the configuration of its vertices. These 256 cube configurations can
be mapped by rotation into 15 topologically distinct arrangements, and a triangular
tesselation is defined for each of these canonical cases. Vertex coordinates are computed
for each triangle in the tesselation by linearly interpolating between the endpoints of the
enclosing cube edge, according to the difference between the threshold value and the
values at each of the endpoints. To achieve the best possible results in shading, normals at
the triangle vertices are computed not from the surface's polygonal approximation but
rather from the intensity gradients of the underlying voxel data; gradient values found at
each of the eight cube vertices, using central differences, are linearly interpolated along
cube edges to the triangle vertex locations.
The marching cubes algorithm has a number of features that recommend it. Because
subvoxel elements of arbitrary orientation are used in the polygonal representation,
surfaces produced by this method generally fit the underlying data more closely than
surfaces obtained through either a cuberille or tiling approach, and virtual memory
requirements are kept to a minimum since the algorithm operates on only two slices of
data at a time. A marching-cubes surface will usually take longer to render than a
cuberille or tiled surface, however, due to the larger number of polygons and also to the
loss of the regularity in polygonal orientation that allowed simplified shading and hidden
surface computations to be used in the rendering of cuberille data.
2.5.3 Direct methods for the display of surfaces in binary data
In the mid-1980's a number of new methods for visualizing volume data sets were
proposed, which did not require the extraction of surfaces as a first step.
(a) Octree methods
One of the earliest direct methods uses octree encoding to model objects defined by a
binary-valued volume obtained from the grey-scale data through thresholding or some
other segmentation procedure. Images can be generated from an octree data set by
establishing a correspondence between pixels in the image and face-connected strings of
voxels in the volume, then recursively traversing the octree in a back-to-front order and
whenever a non-empty voxel is encountered overwriting the corresponding pixel value
with the color of the current voxel. Pseudo-shading can be implemented by defining top,
bottom, left and right illumination factors which are added to a voxel's color when its
20
neighbor in the corresponding direction is empty. Front-to-back octree display algorithms
have also been developed for octree data sets.
The primary disadvantages of octree encoding binary data are the time it takes to build
the tree and the complexity of the tree-traversal operations. In addition, the octree
representation of a data set is highly dependent on the initial position and orientation of
the data; two data sets that differ only by a small translation or rotation may have
substantially different octree representations.
(b) Object-space methods for the display of surfaces in binary data
Algorithms which create images by projecting volume information onto the image plane
are commonly referred to as "object-space" methods. An important feature of these
algorithms is that they do not require that the complete data set be resident in memory at
all times. One of the earliest object space approaches renders images from binary-valued
voxel data sets by traversing slices of the arbitrarily-oriented volume from back to front,
beginning within each slice at the most distant corner and progressing along either rows
or columns, projecting a value derived from the depth of each voxel perpendicularly onto
an individual pixel of the final image.
‗Splatting‘ also referred as ―forward projection‖ is an object-order approach. Only
existing objects in the volume are processed, which makes this approach time-efficient.
This method, although straightforward, is not optimal for a variety of reasons. The
resulting images also suffer from the same shading problems that were encountered in the
cuberille approach, and because a given pixel may be colored and re-colored many times
before a final value is assigned, efficiency is sacrificed. In addition, this method is limited
to performing parallel planar projections; a perspective view can be achieved only by pre-
warping the volume data before rendering is begun. Moreover, due to the poor quality of
the reconstruction algorithm, small hole artifacts can appear in the rendered image when
the volume is viewed at certain angles or magnifications. If voxel data is projected onto
the image plane in order of increasing distance from the viewer, only the first value
received by each pixel needs to be retained and all subsequent attempts to write to the
same pixel must be disallowed. A front-to-back version of the above method which
produces equivalent images in less time avoids pixel re-writes through the use of a
dynamic data structure that keeps track of unwritten scan-line segments. The algorithm
21
first ensures that face connected voxels in a single row of the volume will project onto
adjacent pixels in a single scan-line of the two-dimensional image by requiring that all
rotations be done in a specific sequence. As each row of voxels is projected onto the
image plane, the endpoints of the newly generated spans can then be compared with the
endpoints of the unwritten portions of the scan-line, which eliminates the need to test for
overwrites at each individual pixel.
(c) Image-space methods for the display of surfaces in binary data
In addition to the object-space methods described above, image-space methods - which
render the data on a pixel-by-pixel basis - have also been developed to display solid
objects defined by binary-valued voxel data sets. The simplest of these methods steps
through the volume along rays cast perpendicularly from the center of each pixel until the
first non-empty voxel is encountered, shading pixels of the final image with a value based
primarily on their distance from this surface voxel. Ray casting method is sometimes
referred as ―backward projection‖ or ―resampling‖. It integrates the intensity along a ray
through the voxels (Fig. 2.5.3) [Acker, 1993]. It is an image-order approach. A ray is shot
through the volume for every pixel in the resulting image. The volume itself is processed
object oriented, where a transfer function defines the edges of an object in the volume.
The intersection point of a ray - perpendicular to the viewing plane - with an object
border is rendered by a shading function which represents lighting effects like shades and
highlights. Shading improves volume perception.
One advantage of the ‗ray-casting‘ approach is that it does not require a complete
traversal of the volume; processing can be stopped as soon as a surface voxel is
encountered along the ray from each pixel. A disadvantage of this approach is that in
order to generate images at arbitrary orientations the entire data set must generally be
accessible in memory at all times. Techniques have been developed which reduce the
time required to render a series of images by exploiting the coherence between
consecutive frames of a rotation sequence.
22
Fig. 2.5.3 Direct volumetric rendering
2.5.4 Display algorithms for grey-scale data
This section describes few of the visualization algorithms developed for rendering grey-
scale voxel data.
(a) Direct, binary methods for the display of surfaces in grey-scale data
While early methods were designed to operate on binary-valued voxel data sets, in which
surfaces have been pre-defined using some type of segmentation procedure, more recent
methods have moved towards integrating segmentation into the rendering process. This
gives twofold. First of all, retaining the grey-scale information at each voxel allows the
use of shading models which more accurately reflect the orientation of underlying object
surfaces. Because the values found at each voxel typically represent point samples of a
smoothly-varying function in three dimensions, shading methods that base their estimate
of surface orientation on a 0th-order reconstruction in which the volume is represented by
a set of cubes of uniform intensity are clearly not optimal. A much better approximation
to the surface orientation at a boundary voxel is given by the gradient of grey-scale values
across the voxels in a 3x3 neighborhood. In addition, surface position can be estimated
Slicing Isosurface rendering
Ray tracing
23
with greater precision when the possibilities are not limited to specific locations on a
regular grid.
(b) Direct, binary methods for the display of intensity distributions in grey-scale
data
A direct binary method has been developed which uses color to represent different
intensity ranges within a volume. Before three-dimensional surface or volume rendering
methods came into widespread use, volume data was typically viewed on a slice-by-slice
basis. A display method that builds upon this slice-based approach forms images using
stacks of two-dimensional slices. Data is extracted from the volume along a user-defined
axis to produce the set of slices, and on each slice data points are assigned one of several
possible colors based on the density range into which they fall. The slices are then
projected onto the screen, one at a time from back to front, with each slice slightly offset
from its predecessor to produce an oblique view. Only those points falling within the
desired density ranges are displayed on each slice, to prevent the unwanted obscuration of
data from preceding slices.
(c) Direct, non-binary methods for the display of grey-scale data
There exist a large number of other non-binary methods to display grey-scale volume data
such as Multi-planar reconstruction. But, as the volume model considered in the project is
binary, such methods are not directly relevant and hence are not discussed here.
2.5.5 Radiosity
In the radiosity approach, instead of modeling light as particles bouncing around in a
scene (as is done in ray tracing), light is modeled as energy whose distribution tends
toward a stable equilibrium. The amount of radiation leaving a body is called the radiosity
[Cohen, 1985]. It is the sum of the incident radiation which is reflected and that which is
emitted by the body.
24
2.6 Applications of Voxel (Volume) based modeling
This section discusses various applications of voxel based modeling and volume graphics.
2.6.1 Scientific data set visualization
Because of inherent discrete nature of voxel models, they lend themselves for easy
scientific analysis and visualization involving volumes. As the voxel sizes become
smaller and smaller, made possible by larger and cheaper memory, the accuracy of
analysis continuously improves. More importantly, voxel models can very effectively
incorporate the non-homogeneity of solids into analysis, as the local property variations
can be associated with voxel models (Fig. 2.6.1).
Fig. 2.6.1 Volumetric analysis and visualization
In CAD/CAM/CAE applications like for volumetric (mass) property evaluation,
interference, collision detection (tool path planning), simulations, manufacturability
analysis [Yagel, 1995; Chandru, 1995] voxel models are more easy (though not precise)
to use. Voxel models can give real life rendering involving reflection, refraction and
diffractions in volumes.
25
In view of CAD/CAE applications, aspects of geometric modeling that can benefit from
adopting Voxel based approach are [Chandru, 1995]:
(a) Estimating mass properties
The voxel model lets designers evaluate the mass properties of the modeled object.
For instance, the total material volume can be obtained as a simple sum of all the
nonzero voxels of the volume buffer.
(b) Interference detection
Detecting interference among the components of an assembly is a major problem in
computer-aided design of mechanical parts. Analytical methods for computing such
interference have been proposed but they are complicated and do not easily generalize
to arbitrary geometries. This measure can be applied irrespective of the assembly‘s
complexity and is another advantage of a voxel model.
(c) Tolerancing
Tolerancing is an important aspect of mechanical. In a voxel-based modeler, the
intersection of two objects due to variations in tolerance can be visualized as a 3D
interference volume itself.
(d) CSG modeling
Computation of the Boolean operations reduces to voxel-by-voxel logical operations.
(e) Voxel-level analysis
The powerful aspect of voxel-based modeling is that the designer can selectively
modify individual voxels so that the resulting object meets the design specifications.
(f) Designing composites
A voxel-based modeler can ultimately provide the capability to design a composite
object with materials selectively placed at individual voxels.
(g) Reverse engineering
The combination of Layered Manufacturing (LM) technologies and volume scanning
devices (like CT and MRI) is a powerful reverse-engineering platform. A voxel-based
modeling package can import the scanned volume data, perform voxel-level
modifications, and then directly fabricate the object, or its tooling, using LM
equipment. Custom prostheses, replicas of archaeological artifacts, and retooling for
components where a sample is available but the design information is lost are some
areas that greatly benefit from this combination.
26
2.6.2 Amorphous entity visualization
The entities like smoke, clouds, steam, fire, etc., which are amorphous (discrete, random
volumes) in nature, involved in simulations or artistic models, computer games etc. are
impossible to represent using surface models. Voxel based models perfectly fit in for their
representation and visualization (Fig. 2.6.2).
Fig-2.6.2 Amorphous entity visualization
2.6.3 Representing solid interiors
Voxel models are very effective in representing interior details of solid models. It is
difficult to model as well as represent solid free from objects like Human body and
internal organs, free-form solid artwork like jewelry, artifacts in traditional modeling
schemes like CSG or B-rep. Voxel models prove to be best suited for such applications as
they provide means for
Slicing: display the volume data mapped to colours, along a slice plane
Iso-surfacing: generate opaque and semi-opaque surfaces
Transparency effects: volume material governs reflected and emitted light
Fig. 2.6.3 Mapping human body anatomy
Slice
Semi-transparent
material Iso-surface
27
These advantages of voxel models are effectively used in applications like
Surgery simulation and planning
An interactive surgical planning system allows a surgeon to simulate manipulations of
organs prior to an actual operation. Using patient data, acquired by means of CT scanning
for example, and an interactive 3D display system, multiple operating strategies can be
tried out in advance. Possible difficulties thus may be anticipated, while by recording the
sequence of actions taken during the simulation, an operation protocol can be produced.
Prosthetic design
Voxel models can be used to combine and manipulate both physical data (CT scan) and
artificially created objects (CAD models). The easy way in which spatial selection can be
made in a voxel model is used for the removal of parts of organs. The Boolean set
operations union and difference allow the combination of reconstructed organs with user-
created secondary objects, such as prosthetics.
2.6.4 Visualizing volume data
Some geometric data acquisition techniques like CT (Computed Tomography), MRI
(Magnetic Resonance Imaging) and PET (Positron Emission Tomography) generate
volume information. This lends the voxel based models as the most suitable visualization
tool for such data (Fig. 2.6.4).
Fig. 2.6.4 Solid model from CT scan data slices
This proves very much useful in medical applications like for modeling prosthesis or
implants. The following section briefly describes aspects of medical modeling.
28
Medical modeling
Some acquisition methods like CT scan, MRI, 3D-scan generate solids. There are few
unique aspects of 3D medical imaging that distinguish it from other graphics processing
applications. [Stytz, 1991]
Two well-known, closely related factors are data volume and computational cost. The
typical medical image contains a large amount of data. As an average CT procedure
generates more than 2 million voxels per patient examination. MRI, PET, and ultrasound
procedures produce similar amounts of data. The second factor is that the algorithms used
for 3D medical imaging have great computational cost even at moderate 3D resolution.
Additional factors, first, there are no underlying mathematical models that can be applied
to medical image data to simplify it. Second, the display is not static. Typically,
physicians, technicians, and other users want to interact with the display to perform
digital dissection and slicing. Third, for a 3D representation to provide an increase in
clinical usefulness over a 2D representation it must be capable of portraying the scene
from all points of view.
The importance of the voxel model comes from its use in the CT, MRI, SPECT, and PET
medical imaging modalities as well as for 3D medical image rendering. The voxel model
is the assumed input data format for the three major approaches to medical image object
space modeling described in this section: the contour approach, the surface approach, and
the volume approach. These three object space modeling techniques provide the input
data to the two major classes of 3D medical image rendering techniques—surface and
volume rendering. Three major approaches to portraying an object in a 3D medical image
volume have been developed as the contour, surface, and volume object space depiction
methods. The contour, lD-primitive, approach uses sets of lD contours to form a
description of the boundary of an object of interest within the individual slices that form a
3D volume. The boundary is represented in each slice as a sequence of points connected
by directed line segments. Before forming the boundary representation, the desired object
contour must be isolated using a segmentation operator. Thresholding can be used if the
boundary occurs between high contrast materials. Otherwise, boundary detection using
automatic or manual tracking is used for segmentation.
29
2.6.5 Haptic modeling and rendering
Haptic devices are now commercially available which give real time force feed-back.
These devices are very effectively combined with voxel modeling for
Interactive surgical simulation and
planning
Free-form modeling: virtual clay sculpting
(Fig.2.6.5)
Haptic based product design
Fig. 2.6.5 Haptic modeling and rendering
2.7 Summery of Literature survey
The important concepts and methods of voxel based modeling (volume graphics) have
been presented. Although volumetric representations and visualization techniques seem
more natural for sampled or computed data sets, they are very advantageous in traditional
geometric-based applications as well. This trend implies an expanding role for volume
visualization, and it has thus the potential to revolutionize the field of computer graphics,
by providing an alternative to surface graphics, called ―volume graphics‖. Volume
graphics has advantages over surface graphics by being viewpoint independent,
insensitive to scene and object complexity, and lending itself to the realization of block
operations, CSG modeling, and hierarchical representation. It is suitable for the
30
representation of sampled or simulated datasets and their intermixing with geometric
objects, and it supports the visualization of internal structures. The problems associated
with the volume data representation are, large memory requirement, larger processing
time, aliasing, and lack of geometric representation.
These computational and some algorithmic bottlenecks need to be overcome to realize the
potential offered by voxel based design. The possible areas for research aimed at
eliminating these bottlenecks are as follows.
(A) Memory
The memory requirements of voxel models are enormous. For storing a reasonable
resolution voxel model say 400x400x400 in raw form , (i.e. just as a 3D array of voxels)
requires 64 M bytes of space [Chandru, 1995]. One can trade-off computation time for
storage space by one of the following means.
Store the voxel array in compressed form and use algorithms that will operate directly
on the compressed data.
Convert the voxel array into some other more compact representation and reconvert
into voxels when required.
Retain the original geometric representation and use voxelization algorithms when
necessary. This is especially valuable since in engineering design there is a large
library of components that can be imported into the voxel based modeler.
(B) Rendering complexity
In order to be an effective design tool, a voxel based system should be able to update the
display at interactive rates. Current graphics rendering systems cannot provide a level of
rendering performance on voxel models that is comparable to their polygon rendering
performance. However this situation is likely to change in the near future since parallel
algorithms and hardware support for volume rendering are the focus of several current
research efforts.
(C) Interactive volume sculpting
One of the premises on which a voxel based modeling and design system is based is the
availability of a powerful interaction paradigm that provides the designer with the
31
freedom to realize arbitrary shapes. Without this capability called ―interactive sculpting‖
most of the advantages of a voxel based design for rapid prototyping will be nullified.
Interactive sculpting is currently a highly active research area.
Efficient algorithms for computational analysis of voxel based models and virtual reality
interfaces for sculpting are some of the other challenging research problems.
The simplicity of designing analysis algorithms based on mass properties in voxel based
models can be used for developing many manufacturing simulations and design solutions.
For example, metal flow simulation in casting, casting solidification analysis, prediction
of defects and alike.
The progress so far in volume graphics, in computer hardware, and memory architectures,
coupled with the desire to reveal the inner structures of volumetric objects, suggests that
volume visualization and volume graphics using voxel based technologies may develop
into major trends in computer graphics and CAD/CAM.
32
Chapter 3
Problem definition
This chapter gives the basic outline of the project in terms of motivation for selecting the
problem and the scope of the work done. Also, this includes the review of few voxel
based system available commercially.
3.1 Motivation
The literature survey clearly brings out the impact of Voxel modeling on a wide range of
applications, ranging from CAD/CAM/CAE to medical field like prosthesis design,
surgery simulations and planning. Especially for the design of complex free-form shaped
objects, voxel based methods prove very effective.
As concluded from the literature survey, there is scope for working on developing
compact, application specific voxel model representations and visualization algorithms.
Even with existing voxel based methodologies available, a large world of applications
remains unexplored, specifically in manufacturing field.
With the advantages associated with voxel (volume) modeling and the developments in
computing hardware, it is predicted that the fundamental problems like memory
limitation, resolution (accuracy with voxel size) and computation times, will be soon
resolved.
Thus, it is expected that with the need for volumetric analysis increasing with very
complex and heterogeneous systems developed by latest technologies like
Nanotechnology, advanced computer graphics in Virtual Reality (VR) simulations, will
bring more and more focus on Voxel based modeling and Volume graphics.
33
3.2 Study of present voxel based modeling systems
The following software packages are installed at Prof. B. Ravi‘s lab in Mechanical
Engineering department at IIT Bombay. We have complete license for FreeForm while
educational trial licenses for MIMICS and 3D Doctor. The installations were followed by
demonstration and training sessions by the experts from respective companies.
3.2.1 FreeForm Modeling Plus
This software is developed by SensAble Technologies Inc., USA (www.sensable.com). It
comes with a haptic interface called ―Phantom‖. The FreeForm Modeling Plus system is
the ideal tool for the design of complex, free-form shapes and delivers manufacturable
models, files for rapid prototyping, and photo-realistic renderings.
Fig. 3.2.1 Modeling in FreeForm modeling Plus 7.1
This is a free-form interactive modeling technique based on the metaphor of sculpting and
painting a voxel based solid material, such as a block of clay or wax. There are two
motivations for this approach. First, modeling topologically complex and highly-detailed
34
objects are still difficult in most CAD systems. Second, sculpting has shown to be useful
in volumetric applications. Real-time human interaction is achieved in this approach,
since the actions of sculpting (as carving, sawing) and painting are localized in the
volume buffer, a localized rendering can be employed to re-project only those pixels that
are affected. Carving is the process of taking a pre-existing volume sampled tool to chip
or chisel the object bit by bit. Since both the object and tool are represented as
independent volume buffers, the process of sculpting involves positioning the tool with
respect to the object and performing a Boolean subtraction between the two volumes.
Sawing is the process of removing a whole chunk of material at once, much like a
carpenter sawing off a portion of a wood piece. We have modeled few complex non-
engineering objects like the Ganesha and some jewelry items using this system.
The main features of the system are
Interactive sculpting of digital clay with haptic feed back
Operations like adding clay, sculpt, smudge, pull, cut, combine, remove, etc along
with standard CAD operations like extrude, cut, revolve, mirror, sweep, etc
Selective clay hardness
Voxel size- Resolution adjustment (Scaling)
File format conversions with selective accuracy
3.2.2 3D Doctor
This is a volumetric visualization and modeling package developed by Able Software
Corporation (www.ablesw.com). 3D-DOCTOR creates 3D displays from CT/MRI
images. 3D-DOCTOR's vector-based editing tools allow easy image data handling,
volume measurement, and quantitative analysis. From extracted boundary data, 3D
surface models are created using the Surface Rendering command. Multiple objects can
be easily combined to create sophisticated 3D views of complex structures for
applications such as surgical planning and diagnostic imaging. Parameters such as
material properties, colors, viewing angle, and display settings, can be adjusted
interactively. Volume rendering supports several rendering modes, including
Transparency, where voxels are treated as transparent, Direct, where only surface voxels
are displayed, and Maximum Density, where only the brightest voxel is displayed along
each ray.
35
Image thresholding Surface rendering
Direct volume rendering Transparent volume rendering
Fig. 3.2.2 Volume Rendering in 3D Doctor
3.2.3 MIMICS
Materialise's Interactive Medical Image Control System (MIMICS) is an interactive tool
for the visualization and segmentation of CT images as well as MRI images and 3D
rendering of objects. In the medical field MIMICS can be used for diagnostic, operation
planning or rehearsal purposes. A very flexible interface to rapid prototyping systems is
included for building distinctive segmentation objects.
The software enables the surgeon or the radiologist to control and correct the
segmentation of CT-scans and MRI-scans. MIMICS is a general purpose segmentation
program for gray value images. It can process any number of 2D image slices
(rectangular images are allowed). The only restriction is the physical memory of
computer.
36
Fig. 3.2.3 MIMICS software interface
MIMICS and 3D Doctor are very much similar in the sense that both take CT, MRI slice
data as input in form of Di-com images or BMP images with additional data. Then the
images are spatially referenced with each other and ―thresholding‖ is done. Thresholding
is essentially a process of selecting a set of pixels with gray values within specified limits.
Then the voxelization is as if adding thickness to the plane slices. The pixels selected are
converted to voxels by adding thickness and are grouped together to form the solid. The
distance between the slices determines the voxel thickness whereas the voxel height and
the width can be appropriately set. The model can be visualized using surface or volume
rendering with required accuracy. Some standard file conversions through import/export
are available.
Going through all these software packages, following remarks can be made.
FreeForm provides for the virtual sculpting of digital clay using Boolean operations
on voxel model representation. The model display is continuously updated surface
representation.
MIMICS and 3D Doctor use voxel model as modeling base for inherent volume
data obtaind through 3D scans like CT or MRI.
37
Voxel models are very appropriate for volumetric Boolean operations and free form
shape models like human body anatomy models.
3.3 Objective and scope
The overall objective of the project was to develop an efficient voxel based modeling and
visualization system which can be easily adopted for applications like manufacturability
analysis. The idea has been to take advantage of volumetric nature of voxel models which
make them ideal for problems involving volumes like solid models in CAD/CAM/CAE.
The focus of the work is been on binary voxel models which have only space occupancy
information. Also, cubic voxels with regular arrangement aligned with the coordinate
axes are considered. The major work involved devising fast and efficient voxelization
algorithm which can convert existing solid model in faceted format into the custom
developed voxel form. Solid model in form of ASCII STL file is taken as input into the
system. The voxel model representation scheme involves model storage in memory as
well as in hard drive in file format. Minimum memory required and faster processing
were the main goals. To serve for general application requirements, the system was to be
made capable of handling 1 billion voxel models. This gives resolution of 1000 voxels
along each coordinate axes. Still provision was sought for selectively setting the voxel
resolution as per the application requirement. A fast and effective visualization algorithm
would display the voxel model. The voxel model format would enable standard Boolean
operations and also geometric reasoning to be performed on the voxelized solid.
3.4 Approach
The work is split into modules which are implemented one by one as follows.
(a) First a voxel model representation scheme was developed which would need
minimum memory and at the same time allow faster access to individual voxel. The main
features sought in such a scheme were dynamic memory allocation, provision for
selective resolution, speed of access and ease of implementation. Various alternatives
were evaluated to select the most efficient one. Having selected the voxel model
38
representation format, a file format was determined to store the voxel model on hard drive
in as compact form as possible.
(b) After finalizing the voxel representation scheme, a voxelization algorithm was
developed to convert a solid model in STL format into the voxel format. A class base to
implement the selected representation scheme for voxel into C++ environment was
developed. The algorithm and the storage format were implemented using VC++ and
validated using various solid models. The algorithm for voxelization was optimized for
quicker voxelization and tested for few complex free-form models with various
complexities and triangle counts.
(c) After considering various methods available for voxel display, a new algorithm was
developed and implemented to render voxel models. OpenGL is used as graphics
environment. The algorithm was tested for various complex models and the system was
modified for an errors found and for better performance.
(d) Then over the developed voxel model base, many low level functions were written.
These functions include functions to access and modify individual voxels, handle voxel
bodies, voxel display functions and few geometric reasoning functions.
(e) Using the developed framework of voxel based modeling, functions were written for
sectional display, X-ray scan and skin-removal simulation. The functions were tested for
various models and the results were compiled.
39
Chapter 4
Voxel data structure and voxelization
This chapter contains the in depth description of the basic work done in the project to
come up with new voxel model representation scheme. Details of the considerations made
for designing the voxel model representation scheme along with the comparative
evaluation of different options is presented. The chapter also includes the voxelization
algorithm and the modifications made to optimize it. Discussion is presented on the errors
in the voxel model, the causes and measures to reduce the errors.
4.1 Voxel data set
As voxel model is exhaustive enumeration of volume data, usually the amount of data is
very large as compared to parametric representation of solids. The size of data depends
upon the number of voxels and also the amount of information to be stored per voxel. The
number of voxels depends upon the grid used for discretization of solids. There has to be
a trade-off between the voxel resolution and the size of data. As the size of voxels
reduces, the accuracy of representation improves and we get higher resolution in analysis.
But this will correspondingly increase the number of voxels to be stored for given solid
model which may be difficult to handle in terms of available computer memory and
computational load.
Sometimes the resolution required may be dictated by the application requirement. The
actual physical size of the object also determines the number of voxels required for
expected resolution. For example, consider a cylinder block model of an automobile with
maximum dimension of around 500 mm. Then a grid of 1billion voxels (1000 x 1000 x
1000) will give voxel dimension of 0.5 mm, which may be just sufficient for application
like casting solidification simulation. The same model with a grid of 500 x 500 x 500 will
give resolution of 1 mm which may be sufficient for approximate weight calculation or
determination of C.G. Thus, it would be very useful if a voxel model representation and
storage scheme is flexible enough so that it can be easily configured for required
40
resolution depending upon particular application. So, we have incorporated such
flexibility in the design of voxel file format and representation. But, still we will limit the
maximum grid to 1000 x 1000 x 1000 (1 billion voxels) as per the current computer
memory limitations.
The information to be stored for every voxel also depends upon the application
requirements. For a simple object, it may be sufficient to store only occupancy data,
meaning only whether a voxel is an object voxel or not. Such voxel models are called
―binary voxel models‖, as they store only one binary variable per voxel. The project
currently uses only binary voxel models. But many times, some property which varies
spatially within the region of interest (object) need to be stored for corresponding voxels.
Then we have to store a variable (discrete or continuous) with every voxel as for example
local density value, intensity, type of voxel, etc. Sometimes, there might be requirement
of storing more than one property value with every voxel, for example local velocity
vector, temperature, etc. The voxel model needs to be flexible in this aspect as well to be
able to be adopted for changing requirements.
For the voxel model to be developed, Cartesian coordinate system is chosen. Presently,
voxels are assumed to be cubic, meaning the scaling factor along all three axes is the
same. The voxels are assumed to be aligned with the coordinate axes.
4.2 Voxel data structure
The voxel data needs to be stored efficiently in memory so as to allow very quick access
to any voxel information and also be very compact as voxel data volume could be very
large. As the voxel data size depends on the resolution set, the data size is variable. For a
cubic voxel volume of resolution 1000, the maximum number of voxels may go up to
1x109. But at the same time, for any further manipulation of voxel data for geometric
reasoning or analysis, each voxel needs to be easy to access and modify. Taking this into
consideration, the voxel data is stored in memory as a ―Bit-array‖ while the file on the
disc can be made compact by writing in form of run-lengths.
41
4.2.1 Bit array
A new bit array class is defined. Functions are written to set, reset, access and edit the
voxel information in the bit array. Every voxel is represented by single bit. So, it is a
binary structure, classifying voxels as either filled by the object or empty. The bit array is
created one layer at a time. So, to start with, pointers to ‗plane‘ structure are declared.
‗Plane‘ is a structure which holds a bit array to store (resolution+2)2 voxels. Assuming
maximum possible resolution of 1000, an array of pointers to structure ‗plane‘ is created
at the beginning. Then depending upon the requirement as per the object shape, new plane
is created for every Z increment and then the voxels in that plane are stored. All bits are
initially set to ‗0‘. Then as per the voxelization algorithm, the filled voxels are set to ‗1‘.
The actual index of the voxel to be accessed from the array is calculated properly from its
X, Y and Z coordinate values. Chapter 3 includes the results of memory required for
storing voxel models of various objects with different resolution.
The actual bit array is one bit extra on all sides. This is to enable a simple filtering
algorithm for finding neighbour configuration to be applied to all voxels, including ones
at the bounding box extremes. One layer of voxel is added on all sides of minimum
voxel-box required for a model as shown in the figure 4.2.1.
Fig.4.2.1 Stack of ‘planes’ holding bit-array
To start with, one ‗plane‘ is created to represent Z=0 layer. This bit array is set to ‗0‘
allover as it is the lowermost layer just outside the voxel box. Then, as the voxelization
starts, for every increment of Z, a new ‗plane‘ is created which can hold the required bits.
Plane (Z+1)
Plane (Z)
Plane (Z-1)
One layer of voxels added
on all sides
42
After the voxelization is over with Z reaching maximum of object, one more extra ‗plane‘
is added on top, which again is set to ‗0‘ allover.
Whenever a new ‗plane‘, that is a new bit-array is created, it is set to ‗0‘ allover, and
whenever a filled voxel is found, the corresponding bit is set to ‗1‘.Then the voxel index
in the bit array is properly determined for voxel writing as well as while finding
neighbour configuration. For example, for a resolution of 100, every ‗plane‘ created will
be an array of (100 + 2)2 = (102)
2 = 10404 bits. The array in memory would look like
0 1 2 3 4 5 6 … … … … … … 10401 10402 10403
But when considered voxels on a Z-layer, actual voxel indices would be as shown in table
4.2.1.
Table 4.2.1 Voxel indices in bit-array for one Z-plane with resolution 100
x x x x x X x x x 10402 10403
510 511 X+102
408 409 X 508 509
306 307 X-102 406 407
204 205 304 305
102 103 104 104 106 x X x x 201 202 203
0 1 2 3 4 x X x x 99 100 101
Thus the total memory required (MTOTAL) for a voxel cube of resolution ‗R‘ is equal to
MTOTAL = (MPOINTER + MPLANE ARRAY) x Total no. of planes
= (4 bytes + [(R+2)2/8] bytes) x (R+2)
The goal of using minimum memory for voxel storage is achieved by two approaches.
One is the use of smallest memory unit for representing single voxel. As in the project, a
‗bit‘ is used to represent voxel in the binary voxel model. The other approach is to use as
minimum of such units as just required for the given object. This requires dynamic
memory allocation and which in turn needs a balance between pointer overhead and
memory saving.
43
4.2.2 Voxel data on disc
As voxel data is stored as bit-array in memory for quick, direct access, in contrast, voxel
data is stored on disc as a set of run-lengths to make it compact. The file is simply a
sequence of voxel type and corresponding run-length. So, ‗0‘ indicates empty voxel.
Similarly, different types of voxels can be identified by different characters or numbers. If
the voxel model is binary, containing voxels of only one type, then, file can be further
compacted by storing only run-lengths. Then, the starting run-length is always interpreted
as of empty voxels, which could be ‗0‘ also, and then follows the run-lengths for filled
and empty voxels alternately.
4.3 Voxelization
The solid model imported is in STL ASCII format. STL stands for ‗Stereolithography
Tessellated Language‘. STL format is a kind of boundary representation scheme in which
the surface of solid is represented by triangles or ‗facets‘. The file includes the listing of
facets in random order. For every facet, three coordinate values of three vertices and an
outward normal vector is stored.
4.3.1 Voxelization algorithm
After importing STL, a structure to represent the model is created which stores the
vertices, edges, facets and connectivity between them. Also, the bounding box of the
model is determined. The voxel size is determined by dividing the maximum dimension
of this bounding box by the resolution defined. The coefficients of line and plane
equation of edges and facet are also determined.
To start with, the STL model is placed in the positive octant as shown in figure 4.3.1.
This is achieved not by actually translating the solid model but taking proper Y and Z
values for the rays passed through. Then, the first ray passed is with Y=Ystart and
Z=Zstart. After finding intersections for this ray and writing the voxel configuration, the
Y value is incremented by cell size. Thus effectively the next ray is shifted along positive
Y axis. After sufficient number of shifts along Y-axis, when the Y-span of object is
covered, Z-value is incremented by cell size. This process is repeated till Z value covers
maximum Z-coordinate of the model.
44
The voxelization process essentially passes rays along X-axis in preset order and finds it‘s
intersections with the facets. The number of intersections for any ray would always be
even provided, the STL file is free of errors and the rays completely extend beyond the
model on both sides. Then, it is just finding the voxels lying between an odd and the next
even intersection, which are occupied by the solid model body. The algorithm is shown in
figure 4.3.2.
Fig.4.3.1 Steps to initialize voxelization
Y
Z
X
Z
Y X
Voxel
siz
e
Y
Z
X
Y s
tart
Z start
Y
Z
X
Filled voxels
Z r
ange
Y range
45
Fig.4.3.2 Voxelization algorithm
Create structure of faces, edges
and vertices. Also, generates
plane equations for facets.
Essentially, find the Y and Z
coordinates for the ray
STL Ascii file
Import STL
Create a ray parallel to X-axis
Extract faces which intersect X-axis Remove faces with normal
coefficients as ‗0, y, z‘
Find the intersections of this ray
with all the facets extracted
Substitute, Y and Z values for
the ray in the plane equation of
a facet and find X coordinate of
the intersection.
Check for inclusion of the
intersection point within the facet.
If yes, carry the point forward.
Find areas of triangles made by
intersection point with all
vertices. Check for difference in
areas of parent facet and sum of
three triangles made.
Sort the intersections in ascending
order
As, Y and Z for a given ray
remain constant, only X-
coordinate values are required.
Traverse the intersection
sequence, find the run-lengths
and populate the voxel bit-array
Ensure even number of
intersections. Voxels between
an odd and the next even
intersection are marked filled.
Voxel bit array
Res
et Y
or
Z v
alues
to g
o t
o n
ext
ray o
r pla
ne
resp
ecti
vel
y
46
4.3.2 Modified Voxelization algorithm
To reduce the time required for voxelization, the voxelization algorithm shown in figure
4.3.2 is modified further. The redundancies removed from the algorithm include
following.
(1) There may be many faces which intersect X-axis but the actual facet lies completely
outside the current ray. These are the facets whose all vertices have Y or Z or both
coordinates greater or smaller than the corresponding values for the current ray.
Intersections with such facets need not be calculated.
(2) Shift the model close to origin such that its minimum X, Y, Z coordinate values
coincide with the origin. Then, the rays can be passed only up to maximum limits of the
bounding box of the model, which are the maximum values of the X, Y, Z coordinates.
Thus, for every layer, Y coordinates of rays start from minimum Y and go up to
maximum Y for the bounding box. Thus, whenever, maximum Y is reached, Z-is
incremented and voxelization continues for next layer. When maximum Z is reached,
voxelization is complete.
When the STL is imported at first, the bounding box of the model is determined. This can
be used to reduce the voxelization time further. As the voxelization is layer by layer, with
memory space created for every new layer to be added, the memory as well as time
required for voxelization will be still lesser when minimum layers are generated. Thus,
the ideal order of range for given set up would be as X-range > Y-range > Z-range. In
other way, for any ratio of ranges, one can select the direction of rays and layers so that
the above order is achieved, which will take minimum time and memory for voxelization
with current scheme.
4.3.3 Errors in voxelization
Possible errors in the voxelization are as follows.
(1) Missing thin sections.
(2) Odd number of intersection caused by errors in STL of section thinner than voxel.
(3) Approximation of shape, which is inherent to voxel models. This can be improved by
having voxel models of higher resolution.
47
The errors in voxelization are made visible in voxel model display or also in section
display and X-ray scan display. This can be identified as stray voxel lines or planes,
missing voxels and similar inconsistencies.
The maximum error possible is half the voxel size.
As shown in the figure 2.1, the first ray originates from
Y start = Yminimum of the model + (Voxel size / 2)
Z start = Zminimum of the model + (Voxel size / 2)
Then, the rays are passed with shift of voxel size along Y and/ or Z axes for further
iterations. For determining voxel along the ray, the intersections are sorted in ascending
order. Then finding the run-lengths as
Run-length = (Intersection i – Intersection (i-1)) / Voxel size
Then the run-lengths are used to write the bit array for that plane as filled or empty voxels
as the case may be.
For correction along X axis, after populating integer number of voxels between two
intersections along a ray, the remainder can be analyzed for setting the partially occupied
last voxel as filled or empty. The other possible error is when voxel size is larger than the
thinnest section in the model. Here also, by comparing the distance between the
intersection with the voxel size, error ca be minimized. When such a section lies exactly
between two rays without having any intersection as shown in the figure 4.4 below, it
may be completely missed.
Fig. 4.3.3 Errors in voxelization caused by thin sections
When the Y or Z maximum value for the model lies between two adjacent rays, the first
ray will give valid intersections, but the next will not intersect inside the facets. As shown
in the figure 4.4, the maximum error would be of half the voxel size. To include one more
ray will not give extra intersection as the intersection point will fail the facet inclusion
Z Z
X Y
48
test. If tolerance is provided on facet inclusion test, then we may get extra intersections
with adjacent triangles also. This may lead to wrong interpretation of geometry.
Following figure 4.3.4 shows the errors in voxelization as voxels in thick black colour.
The figure on the right hand side shows the corrected voxel model. The erroneous voxel
in form of one dimensional voxel structures such as a single isolated voxel, a voxel line or
a plane can be identified. These are the voxels which have specific surface connectivity
configuration like only opposite faces connected, or opposite faces free and similar. If the
voxel model is scanned for such voxels, those can be reset and this will eliminate possible
erroneous voxels to some extent. This is applicable when it is assured that the smallest
feature of the original model is bigger than two voxel dimensions. Otherwise this process
may remove some of feature details.
Fig.4.3.4 Image showing errors in voxelization
49
Chapter 5
Voxel display and analysis
There are many techniques for voxel display such as depth sorting or ray tracing, direct
rendering, ‗marching cube‘ and slicing. Many methods try to generate approximate
surfaces from the voxel data and render those surfaces with appropriate normals. These
techniques are useful for small volume data and when there is no surface information
available previously, like from medical scans with resolution of 2563.
In this project, as voxel model is generated from a STL file, which is the surface
definition of object, again trying to extract surfaces from voxel data is unnecessary. Also,
as the target resolution is of (1000)3 voxels, extracting surfaces from such huge voxel data
would be a very tedious task. Therefore a novel but direct method of displaying voxels as
points is implemented.
When number of voxels is sufficiently large, displaying them as points will create a
contiguous surface like display. The problem is, points do not have normals and shadows
like 3D objects. Therefore for a point based display, variation in intensity can not be
automatically computed using standard graphics utilities. So, voxels at various locations
over the model need to be given proper intensity values individually to create realistic
display. This is achieved using a predefined lookup table of intensity values
corresponding to neighbour configuration of every voxels.
5.1 Intensity look-up table
As the voxels are assumed to be cubic in shape, every voxel will have maximum of 26
neighbours as, voxels connected by face = 6, voxels connected by edge = 12, voxels
connected by vertex = 8. As for sufficiently higher resolution and normal solids without
very thin sections, most voxels are face connected. Also, while displaying voxel faces,
only face connectivity will determine the visibility of a particular voxel and not the edge
or vertex connectivity. Therefore, for determining display intensity of voxels, only face
50
connected neighbours are considered. Figure 5.1 shows the 6 face connected
neighbouring voxels. The voxels numbers represent the order in which corresponding bits
are read from the array and added to form an integer representing the neighbouring
configuration as a whole.
Once the voxel data is obtained in form of bit array, the configuration of neighbouring
voxels can be obtained. This is done only for filled voxels.
Fig.5.1 Face connected neighbouring voxels
If the current voxel has index ‗X‘ in the bit array of plane Z, then its neighbours have
indices as follows.
Index of ‗1‘ = X – (resolution + 2)
Index of ‗2‘ = X – 1
Index of ‗3‘ = X + 1
Index of ‗4‘ = X + (resolution + 2)
Index of ‗5‘ = X (in the plane Z-1)
Index of ‗6‘ = X (in the plane Z+1)
The status of these neighbour voxels is represented by either ‗1‘ or ‗0‘ in the array as
when one is occupied or empty respectively. These neighbours are returned in the same
sequence as 1-2-3-4-5-6. Each time the returned bit is added and then the bit string is
shifted to left, except for the last bit. Thus the final bit string looks like 1-2-3-4-5-6.
When this bit string is interpreted as integer, it gives a unique number for a particular
neighbouring configuration. As there are total 26 = 64 combinations possible, the result
can be stored in a variable of type ‗char‘. Now every voxel can be identified as surface or
interior. Also, amongst the surface voxels, a voxel can be categorized based on the
4
6
X
5
3 2
1 X
Y
Z
51
number of free faces where neighboring voxel is absent. This is shown in the following
table 5.1.
Table 5.1 Sample bit strings from neighbouring voxel configuration
Number
of free
faces
Sample configuration
Bit string Integer
returned
No. of similar
configurations 1 2 3 4 5 6
1
1 1 1 1 1 0 62 6
2
1 1 0 1 1 0 54 15
3
1 1 0 0 1 0 50 20
4
0 1 0 0 1 0 18 15
5
0 0 0 0 1 0 2 6
For an error free STL and sufficiently large resolution, when the voxel size is smaller than
the thinnest section in the model, the voxels of type 4 and 5 from the above table should
not be present. These are the voxels with only one or two face connected neighbours and
4
X
X 5
3 2
1
5
4
X
X 2
1
X
X
5
2
1
5
X
X 2
X
X
5
52
represent a one or two dimensional structures at voxel level. If such voxels are found,
they can be treated as errors and can be reset to ‗0‘.
If a sphere is voxelized, then voxels at various locations have configurations as shown
below in figure 5.2. The numbers outside the bracket are the integers returned from bit
string.
Fig.5.2 Voxel intensities for a sphere
Deciding voxel for a particular neighbouring configuration requires visualization and
judgment. The voxel intensity values are rated on a scale of 20, as 0 is very dark to 20
which is bright color. Table 5.2 is the intensity look-up table which holds the intensity
values for various integers returned from bit string.
For every filled voxel, the bit string value is determined. Then the returned integer is
searched for in the intensity look-up table. When a match is found, corresponding
intensity is returned and process moves to next voxel. In OpenGL , the point color is
defined as (0, currIntensity, 0) where currIntensity = (Intensity value / 20). It is taken into
consideration that while display, screen is Z = 0 plane. Therefore, considering the light
from top right hand corner, the intensities are appropriately determined.
58(18)
51(18)
54(19)
30(10)
14(10)
15(12)
46(13)
42(15)
43(16)
62(16)
X
Y 22(13)
50(20)
53
Table 5.2 Intensity look-up table
Index Integer Intensity Index Integer Intensity
1 2 20 32 26 16
2 1 12 33 19 14
3 16 20 34 49 15
4 8 14 35 41 15
5 32 20 36 13 13
6 4 10 37 21 15
7 36 18 38 50 20
8 24 16 39 42 15
9 3 14 40 14 10
10 48 20 41 22 13
11 20 14 42 27 12
12 12 20 43 39 16
13 40 16 44 60 20
14 17 14 45 15 12
15 5 16 46 43 16
16 9 12 47 51 18
17 33 14 48 23 14
18 18 20 49 46 13
19 6 18 50 58 18
20 10 16 51 54 19
21 34 20 52 30 10
22 52 14 53 45 13
23 2 20 54 57 18
24 44 20 55 53 19
25 56 16 56 29 10
26 35 14 57 61 16
27 7 16 58 62 17
28 37 16 59 47 13
29 38 18 60 55 16
30 25 12 61 31 12
31 11 12 62 59 18
Voxel with bit string corresponding to 63 is completely inside the solid body and hence
not visible.
54
5.2 Geometric analysis of voxel model
The regular arrangement of the voxels along the coordinate axes makes the addressing
individual voxels very easy as the index of a voxel is directly related to it‘s actual location
in the 3D coordinate space. Though, this imposes some limitations on the manipulations
that could be done on the voxel model such as rotation of model or handling multiple
bodies. This limitation however, can be overcome by appropriately modifying the original
STL model itself before voxelization. As the fundamental base with voxelization
algorithm and voxel model storage scheme is ready, to implement any end application
over this base, few low level functions are required which can efficiently handle the voxel
model. Such small functions include the functions to read, write individual voxel,
handling voxel bodies, display functions and others as listed below. The following set of
functions is developed which provide modularity to the system and makes it easy to
extend it‘s scope by addition of new applications over the same voxel framework.
Read voxel with location (x,y,z)
Set/reset given voxel
Get voxel array index given it‘s (x,y,z) location
Get voxel intensity code given (x,y,z)
Get voxel intensity value given intensity code
Copy entire voxel body
Delete entire voxel body
Display entire voxel body
Display a single voxel
Display a section in the voxel volume at specified location
Find neighbour to given voxel along given direction at specified distance
Find distance between two given voxels in terms of cell-distance
Remove skin- reset surface voxels
Using these low level functions, some geometric applications are developed which are as
follows.
55
5.2.1 Progressive sectional display
Planar sections can be taken normal to any of the coordinate axes through the voxel
model (fig. 5.2.1). These sections can be displayed to reveal interior of the voxel model at
specified location. The layered structure used for storing voxel model, makes the section
display very trivial along those planes. For the other two directions, little more recursions
are required for accessing respective voxels from successive layers. The section is
essentially a layer one voxel dimension thick. The advantage with voxel model is that it
can show the solid interiors in contrast to surface models.
Fig.5.2.1Progressive sectional display
5.2.2 Skin removal simulation
In the voxel model, surface voxels can be exclusively identified. Surface voxels will be
non-zero with at least one neighbour missing. This condition will give certain number of
voxel intensity codes. So, by traversing through the entire voxel model, surface voxels
can be identified and reset to simulate one skin layer removal. The problem being that
each voxel identified as surface voxel can not be reset immediately and then move to next
voxel for examination. this is because the rest voxel will change the original neighbour
configuration for the next voxel to be examined. This problem is solved by traversing the
voxel model layer by layer. The structural layers are selected for ease of implementation.
Then, first layer is examined and the indices of surface voxels are stored in temporary
array without resetting any voxel. Then the next successive layer is examined for surface
voxels and similarly the indices of surface voxels identified are stored in a temporary
array. Now before moving to the third layer, the surface voxels from the first layer can be
reset without affecting the original voxel configuration as the configuration of second
layer is already stored separately. Thus, every time a voxel layer which is one before the
previous is reset. The skin removal can be simulated one layer at a time
Successive section planes
56
Fig.5.2.2 Successive skin removal simulation
5.2.3 X-ray scan
The voxel model can be scanned along any of the coordinate axes to generate X-scan
image of the model. This X-ray scan is useful for thickness analysis of the model. This
reveals the interior thickness distribution in the model which is normally difficult to
visualize. The X-ray scan generates image wherein the intensity varies proportional to the
thickness along the scan direction. Three options are provided for determining the
intensity as the Minimum, Maximum and Total thickness along the scan direction at
every point. To generate X-ray scan image of a voxel model of resolution ‗R‘, model is
scanned along the scan direction for R2 rays. The voxel configuration along each of the
rays is determined and the intensity at the point of projection of the ray on the image
plane is determined according to the selected option.
Fig.5.2.3 X-ray scan: Intensity variations proportional to thickness
Intensity proportional
to no. of voxels
2
8
14
X-ray Voxel configuration along scan-line
MINIMUM
MAXIMUM
TOTAL
Surface voxels reset
57
Chapter 6
Implementation and results
This chapter presents the results of implementation of the developed voxelization
algorithm and the voxel model representation scheme. The memory and time required for
voxelization of various models of varying complexities is included. Chapter also includes
the display images generated by the system for various models with different resolution
settings. The images of display output from the functions like section display, skin
removal and X-ray scan are also presented.
6.1 Voxelization
The voxelization and display algorithm developed is tested for various solid models.
Following parameters are included in the results.
1) Voxelization time for different resolutions
2) Memory required for voxelization
3) Display images of different resolution, point sizes and orientations
The implementation is done on a system with following configuration.
Intel(R) Pentium, 2.40 GHz processor, 2GB RAM.
There are two sets of solid models considered for testing. One is a set of simple regular
shapes. The other includes some engineering and non-engineering objects. Tables 6.1.1
and 6.1.2 give the details of voxelization results for these solids respectively. Figures
6.1.1, 6.1.2 and 6.1.3 show the graph plots for these results.
58
Table.6.1.1 Voxelization results for standard shapes
M = Memory required for voxelization (MB), T = Time required for voxelization (sec)
Sr.
No. STL file name
Size
KB
No. of
Facets
Resolution
100 200 400 500 800 1000
M T M T M T M T M T M T
1 Pyramid 2 6 0.27 0.078 1.16 0.407 8.18 2.453 15.70 4.468 63.60 16.36 123.6 30.64
2 Prism 3 8 0.27 0.141 1.24 0.704 8.25 3.985 15.60 7.171 63.60 25.43 123.8 46.98
3 Double pyramid 3 8 0.15 0.031 1.16 0.156 8.18 0.875 15.60 1.532 63.60 5.25 123.6 9.58
4 Cube 4 12 0.24 0.172 1.23 0.984 8.27 6.297 15.60 11.73 63.60 44.08 123.6 83.42
5 Block 4 12 0.36 0.093 1.33 0.500 8.35 3.188 15.70 5.937 63.70 22.17 123.7 42.47
6 Block
(rotated) 4 12 0.30 0.141 1.30 0.719 8.50 4.015 16.10 7.125 64.10 25.56 123.6 44.17
7 Block with hole 33 112 0.60 0.125 1.70 0.656 7.40 3.844 13.06 6.984 47.4 25.31 89.5 47.22
8 Cylinder 39 136 0.70 0.171 2.10 0.906 10.00 5.500 17.96 9.922 67.00 36.50 127.9 68.11
9 Sphere 652 2352 1.80 0.219 4.00 1.016 13.50 4.922 22.30 8.610 73.80 29.39 136.2 53.31
10 Cup 788 2814 1.90 0.172 3.54 0.640 9.70 2.531 14.75 4.047 42.56 11.02 75.2 17.84
59
0
10
20
30
40
50
60
70
80
90
Pyram
id
Prism
Dou
ble
pyra
mid
Cub
e
Block
Block
(rot
ated
)
Block
with
hol
e
Cylin
der
Spher
eCup
Solid model
Vo
xelizati
on
tim
e (
sec)
100
200
400
500
800
1000
Fig.6.1.1 Time for Voxelization of standard shapes with different resolution
60
Table 6.1.2 Voxelization results for various solid models
M = Memory required for voxelization (MB), T = Time required for voxelization (sec)
Sr.
No. STL file name
Size
KB
No. of
Facets
Resolution
100 200 400 500 800 1000
M T M T M T M T M T M T
1 Valve 354 2352 0.60 0.140 1.60 0.594 6.60 2.782 11.50 4.656 41.50 14.26 78.3 24.50
2 End shield 951 3714 2.30 0.281 4.80 1.00 15.30 3.766 24.50 5.89 77.30 15.45 140.6 24.67
3 Crank 1651 6184 1.80 0.125 3.50 0.375 12.20 1.215 20.68 1.734 76.00 4.40 133 7.15
4 Body cap 1948 7430 2.43 0.187 4.57 0.532 13.50 2.250 21.50 3.531 67.80 9.219 123.6 14.81
5 Cover 2599 15776 7.10 0.656 13.10 2.578 29.60 9.281 41.40 14.47 99.10 37.00 163 58.50
6 Ganesha 4140 19298 5.30 0.328 8.50 1.062 17.35 3.610 23.80 5.531 55.50 14.11 90.55 22.58
7 Pelvis 8978 41100 10.30 0.859 15.60 2.203 30.70 6.313 41.80 9.047 97.20 20.92 158.9 32.15
8 Valve top 12355 73912 17.40 1.61 25.40 4.89 43.28 17.06 53.90 25.80 96.70 64.33 137.1 99.95
9 Test piece 12648 45892 8.90 0.453 11.90 1.078 19.85 4.047 24.95 6.078 48.40 15.84 72.75 25.91
10 Naval crest 20787 75260 11.5 0.484 13.56 1.156 19.26 3.844 22.90 5.937 35.50 14.30 47.45 22.39
61
0
20
40
60
80
100
120
Valve End shield Crank Body cap Cover Ganesha Pelvis Valve top Test piece Naval
crest
Solid model
Vo
xeli
zati
on
tim
e (
sec)
.
100
200
400
500
800
1000
Fig.6.1.2 Time for Voxelization of various solid models with different resolution
62
0
20
40
60
80
100
120
140
160
Pyr
amid
Pris
m
Tetra
hedr
on
Cub
e
Block
Cub
e(ro
tate
d)
Block
with
hole
Cylin
der
Sph
ere
Cup
Solid model
Mem
ory
req
uir
ed
(M
B)
.
100
200
400
500
800
1000
0
20
40
60
80
100
120
140
160
180
Valve
End
shield
Cra
nk
Bod
y ca
p
Cov
er
Gan
esha
Pelvis
Valve
top
Test p
iece
Nav
al cre
st
Solid modelM
em
ory
req
uir
ed
(M
B)
.
100
200
400
500
800
1000
(a) (b)
Fig.6.1.3 Memory required for Voxelization of standard shapes and various solid models with different resolution respectively
63
6.2 Voxel display
Displaying voxel model as collection of points requires point size to be controlled
properly in relation to ‗resolution‘ as well as the object display size on the screen. As a
vertex is drawn as a pixel or a group of pixels, the size in terms of pixels is properly set.
To reduce the aliasing effect and also have smooth variation in color shades, standard
antialiasing and smoothening is used from graphics utility. Figure 4.2.1 shows the images
of sphere and pyramid at resolution of 20 with Point smooth Off and On.
(a) without smooth and blend (b) with smooth and blend
Fig.6.2.1 Voxel images with point-smooth Off and On (R=20)
Figure 6.2.2 shows the images of sphere drawn for resolution of 200 with different
display sizes. Display size is determined by the ‗zoom‘ level set by the Z-value of origin
in relation to object. Here, S= size of the point in terms of pixels, which represents
individual voxel. It is observe that as the object display size increases, the image
smoothness reduces. This is because the point size also increases, and then the effect of
intensity smoothening is reduced in the interior of a point, which is a considerable area
for larger point sizes.
(a) S=2 (b) S=3.2 (c) S=4 (d) S=4.5
Fig.6.2.2 Voxel images with Zoom and corresponding change of point size(S)
(Resolution=200)
64
Figure 6.2.3 shows the images of sphere with same size of display but with different
resolutions and corresponding point size. It is quite clear that, as the resolution increases,
the intensity variation becomes very gradual and image looks smooth. This is because of
the fact that as resolution increases, the point size reduces, and moreover, the effect of
smoothening is more evident. But, this comes at a cost of more time and memory for
display.
(a) R=100 (b) R=200 (c) R=400
(d) R=800 (e) R=1000
Fig.6.2.3 Voxel images with different resolutions (R)
Figure 6.2.4 shows the sphere displayed as voxel model with resolution of 200 from
various angles of views. The variation in this case is effect of the intensity set in the
intensity look-up table for various voxel configurations.
(a) 30 (b) 60 (c) 90
(d) 120 (e) 150
Fig. 6.2.4 Voxel images with different angles of rotation about Y-axis (Resolution= 200)
65
As can be seen in figure 6.2.5, when the Ganesha model is imported in FreeForm, the
voxel model in the form of *.cly format, which is native format for FreeForm had errors.
As can be seen the trunk got connected to the body though it is not so originally. This
happened at resolutions of 200 and 400 also. But, the voxelization algorithm in this
project, that error is not generated. Also when attempted to get voxel resolution of 800 or
1000 in FreeForm, the memory requirement goes up to 500-800 MB, and the size of
simple cube model in *.cly format becomes of the order of 40-50 MB. Also, the
functioning and display becomes very slow for resolutions above 500. So, the results from
the voxelization algorithm proposed in the project are very much comparable to FreeForm
if not better. But, it is remembered that the application intended from developed voxel
model may be different and not haptic modeling as FreeForm. Still, the display of the
voxel model in the current project needs to be improved for quality and moreover time.
Currently, the time taken for display is of the order of 2minutes for cube with resolution
of 1000.
Voxel display FreeForm display
Fig.6.2.5 Voxel model from the project and from FreeForm (Resolution= 200)
Figures 6.2.6 shows the voxel display images of various solid models considered. All
images are at resolution 400, with point display size of 3 pixels and view rotated. Figures
6.2.7, 6.2.8, 6.2.9 show voxel display images of Ganesha model, pelvis model and
cylinder block model at various resolutions respectively.
66
Valve End shield Crank Body cap
Cover
Ganesha Pelvis Valve top Test piece Naval crest
Fig.6.2.6 Voxel display images of various solid models with resolution of 400
67
(a) R=100 (b) R=200 (c) R=400 (d) R=800 (e) R=1000
Fig.6.2.7 Display Images fro Ganesha model with different resolutions (R)
(a) R=100 (b) R=200 (c) R=400 (d) R=800 (e) R=1000
Fig.6.2.8 Display Images of pelvis model with different resolutions(R)
68
(a) R=100 (b) R=200
(c) R=400 (d) R=800
Fig.6.2.9 Display Images of cylinder block with different resolutions(R)
The results of the display algorithm developed are quite satisfactory as far as the
rendering quality is considered. The display is smoother and more realistic than the
simple display rendering individual voxel faces. But still the algorithm takes longer time
to render models of high resolutions. Currently it takes less than 2 seconds to generate an
image of resolution up to 200. The time required to render higher resolution images
depends upon the object shape and varies in the range 2-150 seconds. The rendering time
can be further reduced by implementing the concept of ‗display-list‘. This is simplified
listing of visible voxels which can be directly rendered. But, this is valid for voxel models
which do not change. If any change is made in the voxel configuration of the model, a
new display-list has to be generated after every such change.
69
6.3 Voxel section display
Sections of voxel model can be displayed along the coordinate axes. Sections normal to
Z-axis is very trivial as the voxel model is stored as a stack of X-Y planes. For display of
sections normal to X or Y plane, it requires more computations to find the appropriate
voxels in different Z-planes. The sections can be displayed at a specified point or also as
successive incremental sections.
Fig.6.3 Sectional Display Images of cylinder block and Ganesha model with different
resolutions(R)
70
6.4 Skin removal
This is a very novel function which allows voxel model to be pealed off layer by layer.
This operation ultimately points to the thickest portion of the model on continuous skin
removal till last filled voxel. In principal, at every skin removal, surface voxels are
identified and reset to zero. Surface voxels are those which are filled but are not
completely inside the object. Surface voxels have at least one face free.
Fig.6.4 Successive Skin removal Images of cylinder block with resolution 200
71
6.5 X-ray scan display
X-ray scan can be performed along any of the coordinate axes. In X-ray scan, there are
three options as follows.
a) Minimum thickness- the intensity at any point is proportional to the minimum section
thickness found along the corresponding scan ray.
b) Maximum thickness- the intensity at any point is proportional to the maximum section
thickness found along the corresponding scan ray.
c) Total thickness- the intensity at any point is proportional to the total of all section
thicknesses found along the corresponding scan ray.
X-ray scan is particularly useful in analyzing internal thickness variations in a model
which is difficult to visualize otherwise. The three options provided are very much useful
and eliminate the limitation of normal X-ray scan which does not identify individual
sections as minimum or maximum. Figures 6.5.1 and 6.5.2 show the X-ray scan images
generated for Ganesha model and cylinder block model. the white spots or stray lines
indicate the errors in voxelization as missing voxel segment or extra voxel segment
respectively.
72
Fig. 6.5.1 X-ray scan images of Ganesha model with minimum, maximum and total thickness options respectively (R=200)
73
Fig. 6.5.2 X-ray scan images of Cylinder block model along two directions and with different thickness options (R=200)
74
Chapter 7
Conclusions
Solid modeling is essential for all CAE implementations and other computer integrated
processes in engineering businesses. Voxel based solid modeling techniques provide
capabilities additional to conventional surface modeling which enable processing of very
complex, free-form parts and assemblies. The advances in computer technology have
made possible to implement voxel based systems on desktop PCs with sufficient accuracy
and efficiency. Though voxel based techniques may not replace surface modeling, they
offer much better solutions for certain problems, especially involving volumetric
information and analysis. The focus of the work has been on resolving the problems of
memory and time for high resolution voxel models and to develop completely new
flexible voxel based modeling environment adaptable to various applications. The aim is
to use capabilities of volumetric modeling into engineering fields as a supplement to
conventional surface modeling.
7.1 Summary of work done
The main goal of the project was to develop a voxel based model representation and
display module which can efficiently handle up to 1 billion voxel models. This gives
voxel resolution of 1000 along all coordinate axes which is sufficient for most of the
cases. A completely new and custom designed voxel based modeling environment is
developed. The basic framework to generate, store and handle voxel models of
resolutions up to 1billion voxels is implemented. The results of voxelization are
satisfactory. The developed voxel representation considers cubic voxels aligned with
coordinate axes. Spatial enumeration is used to store these binary voxel models. A stack
of bit-arrays is used to store voxel model. A new point based voxel display method is
implemented which gives refresh rate of less than 2seconds for resolutions up to 200. The
intensity variation in voxel image is achieved through intensity look-up table which gives
intensity values corresponding to various voxel configurations. The display is much more
realistic than simple cube surface display. Using this basic voxel representation and
75
display scheme, few low level geometric routines are written. These can be used to
develop high end geometric analysis functions and application. Sectional display, X-ray
scan and skin removal are the modules implemented over the developed voxel base. The
voxel modeling system is tested for numerous engineering as well as non-engineering
models.
7.2 Future scope
The main goal of the project has been successfully achieved. The system works very well
for resolutions up to 400. Though, further improvements are necessary for efficient
handling of voxel models with resolution of 1000. This may require custom designed
hardware modifications. Special memory architectures may solve the problem. This will
also allow for interactive viewing of high resolution voxel models which is currently not
possible. The voxel file format is proposed which uses concept of ‗run-lengths‘. Standard
conversion routines can be written to read and write such voxel files. On the similar basis,
a gray scale voxel based system can also be devised. Also, system could be modified to
handle multiple voxel models simultaneously. This will allow standard Boolean
operations over different voxel models.
More specifically, over the present system, immediately possible improvements may
include the following. The display could be further enhanced by tuning the intensity
values. The voxelization errors can be minimized by considering voxelization from
multiple directions and then combining the resulting voxel models. The display could be
improved to include colors and transparency. Currently, the rotation of view is
incorporated as view direction change with light positioned stationary. But, with simple
global rotation variables, a changing intensity can be implemented so as to depict object
rotation. Also, the display could be made faster by using ‗display lists‘ which will store
voxel information in more ready to display form for a fixed voxel model.
Using the basic framework developed, a voxel based application module can be
developed for engineering applications such as casting analysis. The system can be
coupled with a good user interface and controls. The voxel based module can also be
added to existing applications as a supplement.
76
Appendix A
‘STL’ file format
There are various file formats for storing solid model data like STL, IGES, STEP, etc.
The ‗.stl‘ or stereolithography format is an ASCII or binary file used in manufacturing.
STL stands for Stereolithographic Tessellated Language. It is a list of the triangular facets
that describe a computer generated solid model. This is the standard input for most rapid
prototyping machines. The ASCII .stl file starts with the lower case keyword solid and
end with endsolid. Within these keywords are listings of individual triangles that define
the faces of the solid model. Each individual triangle description defines a single normal
vector directed away from the solid's surface followed by the xyz components for all three
of the vertices.
The STL files have typical advantages of use as they constitute a simple data structure
involving facets, which is repeated throughout the file. Also, the file is easy to read and
the connectivity relations between the facets, edges and vertices are easy to store.
Following is a sample ASCII description of a single triangle within an STL file.
solid
...
facet normal 0.00 0.00 1.00
outer loop
vertex 2.00 2.00 0.00
vertex -1.00 1.00 0.00
vertex 0.00 -1.00 0.00
endloop
endfacet
...
endsolid
77
Appendix B
3D discrete topology The 3D discrete space is a set of integral grid points in 3D Euclidean space defined by
their Cartesian coordinates (x, y, z). A voxel is the unit cubic volume centered at the
integral grid point. The voxel value is mapped onto {0,1}: the voxels assigned ‗‗1‘‘ are
called the ‗‗black‘‘ voxels representing opaque objects and those assigned ‗‗0‘‘ are the
‗‗white‘‘ voxels representing the transparent background [Kaufman, 1993]. Sometimes
the voxel value is mapped onto the interval [0,1] representing either partial coverage,
variable densities, or graded opacities. Due to its larger dynamic range of values, this
approach supports 3D antialiasing and thus supports higher quality rendering.
Every voxel has 26 neighboring voxels. Two voxels are 26-adjacent if they share either a
vertex, an edge, or a face (Fig. A2). Accordingly, face-sharing voxels are defined as 6-
adjacent, and edge-sharing and face-sharing voxels are defined as 18-adjacent. A
sequence of voxels having the same value (e.g. ‗‗black‘‘) is called an N-path if all
consecutive pairs are N-adjacent. A set of voxels W is N-connected if there is an N-path
between every pair of voxels in W. An N-connected component is a maximal N-connected
set.
Given a 2D discrete 8-connected black curve, there are sequences of 8-connected white
pixels (8-component) that pass from one side of the black component to its other side
without intersecting it. This phenomenon is a discrete disagreement with the continuous
case where there is no way of penetrating a closed curve without intersecting it. To avoid
such a scenario, it has been the convention to define ‗‗opposite‘‘ types of connectivity for
the white and black sets. ‗‗Opposite‘‘ types in 2D space are 4 and 8, while in 3D space 6
is ‗‗opposite‘‘ to 26 or to 18.
78
Fig. A2 Voxel connectivity
79
References
[1] Acker, D.E., Sobierajski, L., Cohen, D., Kaufman, A., Yagel, R., ―A fast display
method for Volumetric data‖, The Visual Computer: International Journal of
Computer Graphics, Vol. 10, No. 2, pp.116-124, 1993.
[2] Chandru, V., Manohar, S., and Prakash, C.E., ―Voxel based Modeling for Layered
Manufacturing‖, IEEE Computer Graphics and Applications, Vol. 15, No. 6, pp. 42-
47, Nov 1995.
[3] Cohen, M.F., Greenberg, D.P., ―A Radiosity solution for complex environments‖,
Computer Graphics, Vol. 9, No 3., pp. 31-40, July 1985.
[4] Elvins, T.T., "A Survey of Algorithms for Volume Visualization", Computer
Graphics, Vol. 26, No.3, pp. 194-201, 1992.
[5] Fang, S., Hongsheng Chen, ―Hardware accelerated voxelization‖, Computers &
Graphics, Vol. 24, No. 3, pp. 433-442, June 2000.
[6] Fang, S., Liao, D., ―Fast CSG Voxelization by Frame Buffer Pixel Mapping‖,
IEEE/ACM Proceedings of Volume Visualization and Graphics Symposium, Salt
Lake City, UT, U.S.A., pp. 43-48, 2000.
[7] ―Gaussian file format‖, http://astronomy.swin.edu.au/~pbourke/geomformats/cube/,
Dec 2000.
[8] Huang, J., Yagel, R., Filippov, V., Kurzion, Y., ―An accurate method for voxelizing
polygon meshes‖, Proceedings of the 1998 IEEE symposium on Volume
visualization, pp. 119-126, 1998.
[9] Jense, G.J., ―Voxel-based methods for CAD‖, Computer-aided design, Vol. 21, No. 8,
pp. 528-533, Oct 1989.
[10] Jones, M.W., ―The Production of Volume Data from Triangular Meshes Using
Voxelisation‖, EuroGraphics, Computer Graphics Forum, Vol.15, No. 5, pp. 311-318,
1996.
[11] Jones, M.W., Satherley, R.A., ―Shape representation using space filled sub-voxel
distance fields‖, International Conference on Shape Modeling and Applications, pp.
316-325, May 2001.
[12] Kaufman, A., Shimony, E., ―3D scan-conversion algorithms for voxel based
graphics‖, Proceedings of the 1986 workshop on Interactive 3D graphics, pp. 45-75,
1987.
80
[13] Kaufman, A., Cohen, D. and Yagel, R., ‗‗Volume Graphics‘‘, IEEE Computer, Vol.
26, No. 7, pp. 51-64, July 1993.
[14] Lorensen, W.E., Cline, H.E., ―Marching Cubes: A high resolution 3D surface
reconstruction algorithm‖, Computer Graphics, Vol. 21, No. 4, pp. 163-169, July
1987.
[15] Lu, S.C., Rebello, A.B., Cui, D.H., Yagel, R., Miller, R.A., Kinzel, G.L., ―A
Visualization Tool For Mechanical Design‖, Proceedings of the 7th conference on
Visualization, pp. 401-404, 1996.
[16] Nooruddin, F. S., Turk, G., ―Simplification and Repair of Polygonal Models Using
Volumetric Techniques‖, IEEE Transactions on Visualization and Computer
Graphics, Vol. 9, No. 2, pp. 191-205, April-June 2003.
[17] Prakash, C.E., Nandy, S.K., ―Voxel based modeling and rendering irregular solids‖,
Microprocessing and Microprogramming, Vol. 30, No. 1-5, pp. 341-346 , Aug 1990.
[18] Stytz, M.R., Frieder, G., Frieder, O., ―Three-Dimensional Medical Imaging:
Algorithms and Computer Systems‖, ACM Computing Surveys, Vol. 23, No. 4,
December 1991.
[19] TeraRecon Inc., ―Voxel file format‖, http://www.terarecon.com /downloads /support/
vp1000_voxelfileformat.pdf, 2002.
[20] Wang, S.W., Kaufman, A.E., ―Volume sampled voxelization of geometric
primitives‖, Proceedings of the 4th conference on Visualization, pp. 78-84, 1993.
[21] Yagel, R., Lu, S.C., Rebello, A.B., Miller, R.A., ―Volume based reasoning and
visualization of Diecastability‖, Proceedings of the 6th conference on Visualization,
pp. 359-362, 1995.