Generating a smooth voxel-based model from an irregular

advertisement
1 Introduction
Original articles
Generating a smooth
voxel-based model from
an irregular polygon
mesh
Daniel Cohen, Arie Kaufman, and
Yingxing Wang
Department of Computer Science,
State University of New York at Stony Brook,
Stony Brook,
NY 11794-4400, USA
A method for generating a smooth voxelbased model from an arbitrary polygon
mesh is presented. It is based on a polygonal subdivision process which takes an
irregular polygon mesh as input and creates a finer and smoother mesh. The mesh
is recursively refined down to or close to
the voxel level, and then voxelized
(digitized) into a voxel-based representation. A local subdivision approach has
been developed in order to ease the computationally expensive subdivision process.
The voxelization of the mesh maintains
topological and fidelity requirements
which are pre-defined and application dependent.
Key words: Voxelization - Polyhedral
subdivision - Smoothing Interpolation
Volume graphics - Volume visualization - 3D scan conversion - Volume synthesis - Voxelization
Correspondence to: A. Kaufman
The Visual Computer (1994) 10:295-305
9 Springer-Verlag 1994
Modeling 3D objects by meshes of connected
polygonal facets is a way of successfully representing objects consisting of large flat parts, such as
a building wall or a table top, but only an approximation for curved objects. The quality of the
model of a curved object is increased by using
a large number of small polygons. A polygonal
subdivision process can smooth the geometry by
fairing the rough edges and sharp corners between
adjacent polygons. This process introduces a new,
larger mesh of smaller polygons which better approximates the real smooth object. However, using a very fine mesh in conventional polygonbased graphics is expensive with respect to the
display time. Instead, applying interpolation of
the colors (Gouraud shading) or the normals
(Phong shading) creates the appearance of
a smooth surface. However, this approach greatly
increases the rendering cost and fails to convey
the illusion of smoothness at the edges and the
silhouettes.
A different modeling method uses a voxel-based
approach, where the 3D objects are represented
by a 3D raster of voxels. Each such voxel has
a numeric value associated with it which represents some measurable properties of a small cube
of the real object. The voxels are either derived
from discrete samples of the physical object, generated by a simulation model, or synthesized from
a geometric model in a process called voxelization
or 31) scan conversion [-3, 6-8, 11]. The conversion
of an object from its analytical geometric representation into a discrete form (i.e., the voxelization)
is decoupled from the rendering and can be performed in a preprocessing stage. This suggests
that view-independent attributes (e.g., texture) can
be precomputed during voxelization, stored within the voxel, and be readily accessible for speeding
up the rendering [15]. Unlike the polygon-based
approaches, in the voxel-based approach the
space size is constant and the rendering is insensitive to the model complexity [9]. These and other
advantages of the voxel-based representation
have been attracting traditional surface-based applications, including CAD models and terrain
models for flight simulators [9].
Our goal has been to develop a voxelization
method for models given as irregular polygon
meshes for voxel-based applications, such as the
Hughes Aircraft voxel-based flight simulator
RealScene [14]. By first smoothing the polygon
295
mesh, and then voxelizing it during a preprocessing stage, we take full advantage of the insensitivity of voxel-based rendering to the object's shape
complexity. In this paper we present a preprocessing technique that smoothes an irregular polygon
mesh by a subdivision process and then converts
the refined mesh into voxels, without any user
intervention. The polygons need not be planar,
and their vertices do not have to form a topological rectangular mesh. The refinement process can
be applied all the way down to the voxel level or
close to that level, hence creating a fine mesh with
voxel granularity. The refined and smoothed
mesh is then converted into its voxel-based form
and stored as a 3D raster for later use by a voxelbased rendering mechanism.
A subdivision process can generate a surface
that interpolates the original mesh vertices or
approximates them by fitting a smooth surface.
The early work by Catmull and Clark [2J, which
recursively generates B-spline surfaces on arbitrary topological meshes, has the limitation of being unable to interpolate the data points. Under
the constraint of mesh rectangularity (i.e., every
interior vertex has four adjacent polygon faces
and every polygon face is four-sided), Barsky and
Greenberg [1] reduce the problem to determining
an appropriate set of B-spline control vertices
by solving simultaneous linear equations. If
a voxel-based surface is desired or required, one
can then employ an incremental voxelization algorithm of Bezier or B-spline patches [7], which
guarantees proper control over voxel connectivity. However, the constraint of rectangularity of the data points and the limitation on the
interpolation are undesirable. Here we have
adapted and extended a polygonal subdivision
method [5, 12, 13], which can be applied to an
irregular (non-rectangular) mesh.
The next section introduces the subdivision mechanism, describes how to deal with the mesh
boundary problems, and suggests how to achieve
interior interpolation and interpolation of the
whole set of data points.
A subdivision method exhibits an inherent problem of exponential time and space complexities.
The problem becomes even more severe in our
case since many iterations have to be carried out
before the mesh reaches the voxel resolution. We
have thus developed a local subdivision mechanism that eases the working space problem by
296
operating locally on submeshes (see Sect. 4). Our
technique also accelerates the process when the
polygon mesh includes a large variance of polygon sizes.
The voxelization of a surface is a digitization
process in which the discrete voxel-based surface
has to preserve the topological properties of the
original continuous mesh [3]. In Sect. 5 the conditions to guarantee a correct generation of a discrete surface are developed. In Sects. 6-8 we discuss the voxelization of polygons, and we end
with implementation details in Sect. 9.
2 The subdivision method
2. 1 Mesh smoothing
In Doo-Sabin's polygonal subdivision method, the
polygon mesh is recursively subdivided by constructing on each face a new vertex (termed imagevertex) for every existing old vertex. The i-th image-vertex U~ of polygon k is a weighted sum of
the vertices I'1/~k (j = 1, ... , n) of the polygon k:
u, =
(1)
j=l
where
% =
n+5
4n
if i = j
3 + 2cos(2rc(i-j)/n)
4n
if i r
The new polygon mesh is then obtained by constructing three types of new faces: F-faces, E-faces,
and V-faces, corresponding to the old polygon
faces, edges, and vertices, respectively (see Fig. 1).
The F-face is created by linking the image-vertices
U~ (i = 1, ... , n) of polygon k. The E-face is created by linking the image-vertices of the vertices
of the edge on the two incident faces. The V-face is
created by linking all image-vertices of a certain
vertex.
By recursively repeating the subdivision process,
the mesh is refined and becomes smoother. Unlike
Catmull-Clark's method, Doo-Sabin's subdivision method guarantees that the centroid of each
original face lies inside its F-face and thus on the
final surface (i.e., the centroid interpolation property), where the centroid of a face is defined as the
average of the vertices of that face. Consequently,
this process generates a smoothed surface that is
tangent to the original mesh at the centroids of its
polygons. This process, which we call smoothing,
creates a physically smaller object than the original one (except for concavities).
2.2 Mesh interpolation
The centroid interpolation property can also be
used to construct another analogous set of points,
which generates a new surface which when
smoothed by subdivision, interpolates (passes
through) any prescribed interior vertices of the
original polygon mesh. In a process called lifting,
the mesh vertices are shifted to a new location in
such a way that the centroids of the V-faces of the
lifted mesh coincide with the coordinates of the
prescribed (old) interior vertices.
The lifted mesh is an analogous polygon mesh of
the original mesh. Referring to Fig. 2, let the
vertices of the old mesh be V/(i = 1, ... ,s) and
the vertices of the new lifted mesh be
W~(i = 1, ... , s). The U[ are the image-vertices of
the W~ vertices. The centroid of the V-face of W~,
after the first subdivision, is forced to be at the
same location as vertex Vii.
Since the relationship between the centroid of
a polygon face and its vertices is linear, and since
this is also true for the image-vertex and the
vertices of the polygon, the relationship between
V/(i = 1, ... ,s) and W/(i = 1, ... ,s) is linear:
V~= ~ 5 u Wj.
(2)
j=l
Two sets of vertices have to be considered: one is
the set of vertices that are not to be interpolated,
and the other is the prescribed set of vertices to be
interpolated. It is clear that for the first set, where
Vii = Wi, 5u = 1 and air = 0 for i # j. For the second set, as V~is the centroid:
Fig. 1. A refinement step in the subdivision process. The
oroginal vertices are black squares and the image-vertices
are white circles. The arrows refer to the vertices order within the polygon (see Sect. 8)
Fig. 2. A lifted neighborhood of polygons. The original
mesh vertices are marked as white circles and lifted vertices
are marked as black squares. The U~ are the image-vertices
of W~, and Vi is their centroid
mk=l
where m is the number of faces meeting W~. Substitute Eq. (1) into Eq. (3) and compare it with Eq.
(2.) The coefficient air of each vertex W~is the sum
of all the subdivision coefficients associated with
Wj divided by m.
297
2.3 Boundary control
mesh contains boundaries
Polygon meshes can be classified into two groups:
closed meshes and open meshes. A closed mesh
represents a closed object (a polyhedron) where
the surface has no boundary curves. An open
mesh has boundary curves, that is, edges with
only one adjacent polygon. The boundary curves
need special treatment which is called boundary
control. Due to the fact that each face of the
polygon mesh converges toward its centroid, the
subdivision procedure has no control over the
boundaries. Nasri [12] suggests a method of extending any n-sided boundary face such that when
the modified mesh is subsequently divided, the
boundary polygons converge toward the corresponding B-spline curves of the boundary vertices.
Thus, to achieve boundary interpolation, we compute the new boundary control vertices that force
the boundary curves of the surface (i.e., the Bspline curves of the new control vertices) to interpolate the required points.
To achieve boundary and interior interpolation at
the same time, we first find the control vertices of
the B-spline interpolation of the original boundary vertices, then replace the boundary vertices by
these control vertices, and finally construct the
linear equations to achieve interior interpolation
(Eq. (2)). Because the equations for lifting that
correspond to the boundary vertices are V~= W~,
the new set of vertices does not change the boundary vertices. As the subdivided surface boundary
is the B-spline curve of the control vertices, the
final boundary curve interpolates the original
boundary vertices.
3 The algorithm
Figure 3 is a flow diagram of the algorithm. The
algorithm generates a smooth voxel-based surface
from an arbitrary polygon mesh in three stages:
preparation, subdivision, and voxelization.
During the preparation stage the original polygon
mesh may be modified. By lifting or extending
the original polygon mesh, different kinds of interpolation surfaces can be achieved. If the original
mesh is not modified and only the subdivision and
voxelization stages are applied, one can construct
a higher-order smooth surface over any polyhed-
298
Iboundaryextension [
Potygen r
~-
interpolation is required
Modified Mesh
ease computation load
9
~r2
spliting [
[(localization)
[ subdivision]
l further
refinement
Re f.med Mesh
reaching voxel level
I
I triangulation[
I alignment
I
[
]polygonvoxelization ]
Ivertexconversion I
t
Smooth Voxel-based Surface
Fig. 3. The algorithm
ral mesh that passes through the centroids of all
polygon faces [13], a process called smoothing.
The entire vertex mesh or parts thereof can be
lifted during the preparation stage to yield a lifted
mesh that, when subdivided generates a surface
which interpolates the original vertex mesh or
prescribed parts thereof. This process is referred
to as interpolation or puffing, as it usually causes
the mesh to expand.
If the mesh is closed (i.e., a polyhedron), no additional preparation steps are necessary. However, in
the case of an open mesh the boundary can be
extended, as described before, in a separate and
independent preparation step. Boundary control
can be employed with or without interior interpolation/smoothing, to have the effect of interpolation of boundary vertices only, interior vertices
only, or both.
In the second stage of the algorithm the modified
mesh is recursively subdivided to yield a refined
mesh. In order to make the subdivision procedure
practical, the original mesh is split into local submeshes. This step is described in Sect. 4.
The refined mesh is finally digitized into a
voxel-based form during the voxelization stage. If
the mesh is refined down to the voxel level,
a simple vertex voxelization step is applied (see
Sect. 5). Alternatively, if the mesh is refined d o w n
until the polygon sizes are within an aesthetic
tolerance, a polygon voxelization step is applied
(see Sect. 6). The actual digitization of the polygon
proceeds by two steps: a triangulation process
that guarantees polygon planarity (Sect. 7), and
a polygon alignment process for aligning the normals for the shading (Sect. 8).
4 Local subdivision
Exponential time complexity and high m e m o r y
requirements are the primary drawbacks of the
Doo-Sabin subdivision method. In this section we
introduce a local subdivision mechanism which
has been developed in order to cope with the time
and space complexities and to m a k e the subdivision d o w n to the voxel level practical.
First, we analyze the growth of the n u m b e r of
polygons in the mesh as a function of the n u m b e r
of iterations. Let vi, ez and f~ be the n u m b e r of
vertices, edges, and faces, respectively, at the i-th
iteration. An i m p o r t a n t property of the subdivision is that the degree of the new vertices is always
four. After the first iteration, the only polygons
which are not four-sided (4-gons) are the F-faces
of a non-four-sided predecessor polygon and the
V-faces of original vertices of degree other than
four. Thus, excluding the first iteration, all polygons are four-sided except those which are directly derived from n o n 4-gons. Clearly, after a few
iterations the majority of the polygons are foursided. F o r the sake of simplicity we assume t h a t
the original mesh is closed and consists of 4-gons
only. Thus, at any time all polygons are 4-gons
with vertices of degree four (see Fig. 4).
The recursive equations for the n u m b e r of vertices
and edges are:
F r o m Eq. (6):
ei-1-
Vi-l=f-l-
2.
(8)
Substituting Eq. (8) into Eq. (7) we get:
f~ = 4f_1 - 6.
(9)
Solving the recursive equation for f~:
vi = 4 v i - 1
(4)
f = 4'(do -- 2) + 2
ei = 4 e l - 1.
(5)
which is the n u m b e r of polygons at the i-th iteration.
For an arbitrary polygon face F in the original
(global) mesh, the l o c a l m e s h of F is the mesh
consisting of F and its adjacent polygon faces
(Fig. 4(a)). The local subdivision employs a
procedure called l o c a l i z a t i o n , which splits the
mesh into a list of local meshes. An unacceptable
procedure would create a local mesh for each
Employing Euler invariant for the n u m b e r of faces, edges, and vertices in a closed polyhedron:
fi =- ei -
vi
Jr- 2
(6)
and substituting Eqs. (4) and (5) into Eq. (6) yields:
f
Fig. 4a, b. A polygon mesh of four-sided polygons
and vertices of degree four: a a local mesh is
shown in gray; b after one iteration the new edges
are shown as bold lines
= 4(ei-t
-
vi-1)
+ 2.
(7)
(10)
299
original polygon face, causing each polygon to be
overlapped by the local meshes of all its adjacent
polygons. Although overlapping is unavoidable, it
can be reduced by the following heuristics:
1. If any interior polygon face exists that is not
covered by any local mesh, create its proper local
mesh, and add it to the local mesh list.
2. Repeat step 1 until each interior polygon face is
covered by some local mesh.
3. Repeat 1 and 2 for the boundary polygon faces.
Creating local meshes first for the interior polygons reduces the number of local meshes because
interior meshes have more adjacent polygons
than the boundary ones. The local subdivision
mechanism interleaves localization with subdivision where at any stage of the subdivision localization can be applied.
The smallest local mesh, provided that all its
vertices are adjacent to four faces and the faces are
four-sided, has 32 polygons. In the i-th step the
number of polygons Pi in the local mesh is s 2,
where si = 2si-1 + 1 (see Fig. 4b). Solving the
recursive equation for s~, we get:
s,-- 2~(So + 1 ) - 1.
(11)
But since So = 3 we get:
Pi = (2~4 - 1)2 < 4i 16.
(12)
Following the assumption of four-sided polygons
and vertices of degree four, each interior local
mesh covers nine polygons. Thus, a polygon mesh
is approximately split into m = Po/9 disjoint local
meshes. Let ko < "" _< k,,_l be the number of
iterations of subdivision needed for the m local
meshes, respectively. When employing local subdivision, from Eq. (12), the total number of polygons generated in a voxelization process is less
than:
16(4ko + ... + 4kin 1).
(13)
According to Eq. (10), without localization it
would have been much higher:
4k~-l(P o - 2) + 2.
(14)
For each local mesh the number of subdivision
steps needed varies adaptively according to the
size of the polygons in the local mesh. If the
polygon mesh has a large variance of polygon
sizes, and no localization is used, all polygons are
subdivided kin-1 times; for most of them, many
redundant iterations are performed, because most
300
of the polygons satisfy the conditions for termination in an earlier iteration. Localization, on the
other hand, promises a more effective number of
iterations to be used for each local mesh. However, from Eq. (13) we learn that localization has
a price of a factor of 16. When Po is larger than 18,
it is very likely that localization will speed up the
process. Furthermore, in case of a small Po, the
localization is better applied only after several
subdivision iterations.
Note that adjacent submeshes subdivided at different numbers of iterations will result in cracks in
the continuous space, but not in voxel space. The
refinement of the two submeshes stops at the
granularity of the voxel, and thus the small subvoxel gap between adjacent polygons is meaningless.
Although time complexity remains exponential in
the number of levels and linear in the surface area
measured in voxel units, the local subdivision
accelerates the process when the polygon mesh
includes a variety of polygon sizes. The technique
also eases the space problem by operating locally
on submeshes. Moreover, the local subdivision
lends itself to parallelism and the local meshes can
be processed simultaneously and independently
on a multiprocessor machine.
5 Vertex voxelization
In order to describe the voxelization stage the
following discrete topology terms are defined. Let
Z 3 be the subset of the 3D Euclidean space R 3,
which consists of all the points whose coordinates
are integer. This subset is called the grid for short.
A voxel is a closed unit cube whose center is at
a grid point. With each grid point we associate
a voxel, and a subjective function that maps Z 3,
and hence the voxels, to {0, 1}: the non-empty
voxels are assigned the value "1" and are called
"black" voxels; the others are assigned the value
"0" and are called "white" voxels. A white voxel at
(x, y, z) has six face-adjacent voxels, while a black
voxel has 26 adjacent voxels; 8 share a corner
(vertex) with the center voxel, 12 share an edge,
and 6 share a face. The black and white sets have
different adjacency relations to avoid paradoxes.
Other types of adjacency relations for the black
and white sets are also possible El01 but are not
used in this paper. A path is a sequence of voxels
i omp r
of the same color (black/white) such that consecutive pairs are adjacent. A set of voxels A is
connected if there is a path between every pair of
points in A.
A voxelized discrete surface approximating a connected continuous surface has to be connected.
However, connectivity alone does not fully characterize the surface because the voxelized surface
may contain discrete holes, termed tunnels, which
are not present in the continuous surface. A tunnel
is a passage of a white path through a voxel-based
black surface. The path (e.g., viewing ray) penetrates from one side of the surface to the other
where it should not. According to our definition of
the white set, a tunnel through a surface introduces a real hole (e.g., an empty pixel) in one of the
orthographic projections of the voxelized surface.
In particular, there exists a polygon whose continuous face area covers that pixel coordinate, but
the voxelization process does not set to black the
voxel at the coordinate whose projection covers
the hole.
Let p and q be points in Ra; if the distances along
the three coordinates between p and q are all less
than or equal to 0.5, then p is said to be close to q.
Let t be a point at some integer coordinates. If p is
close to t, then round (p) = t. A vertex conversion
process converts each vertex in the continuous
space to the voxel whose integral coordinates are
the closest to that vertex (by a rounding operation
of its coordinates) and sets the voxel to black. Let
P be a triangle in R 3 whose projection on the
x - y plane covers the pixel at (i,j). If the length of
every one of the edges of P is less than one, then at
least one of the vertices is close to the voxel at
(i,j, k) for some k. This implies that the conversion
of the vertex to a voxel at (i,j, k) guarantees that
the orthographic projection of the voxel covers
(i,j).
To generalize these conditions to an n-gon, we
define the diameter of the polygon to be the maximal length between any two of the polygon
vertices. Let P be an n-gon which covers (i,j). If
P has a diameter less than one, then the vertex
conversion guarantees the coverage of (i,j), because at least one of its vertices must be close to
(i,j, k). A one unit diameter is optimal since an
n-gon can cover (i, j) while none of its vertices are
close to (i,j). The conditions on the triangle are a
special case since a triangle has a diameter less than
one if and only if every edge is shorter than one.
As described before, each F-face is a reduced size
polygon of its predecessor, and the number of
edges of any F-face polygon is preserved. The Efaces and the V-faces are always 4-gons (to be
more precise, only the V-faces about the original
vertex remain non 4-gons if the original vertex has
a degree different from four). Thus, as we showed
earlier, if the original mesh consists of polygons
with no more than four edges, so does the refined
mesh. The diameter of an n-gon is easily found by
checking the length of the polygon edges and all
its diagonals. Specifically for 4-gons, only the
length of its two diagonals have to be calculated.
The diameters of the polygons in the refined mesh
specify whether the refinement process is exhausted and the mesh is ready for a vertex conversion
into black voxels. The diameter condition has to
be tested on the polygon with the largest area
only. This takes advantage of the property that
the subdivision process preserves the maximum
polygon area. Consequently, at the beginning of
the subdivision process, the polygon with the largest area has to be determined and only its diameter has to be calculated after every subdivision
cycle.
6 Voxelization of polygons
The number of iterations needed to subdivide the
mesh all the way down to voxel granularity, in
order to meet the diameter condition for the vertex conversion, might be too costly. Instead, the
process can stop at an earlier stage, depending on
the aesthetic or required tolerance of the final
image. In this case, each polygon face of the refined mesh is scan-converted into its voxel representation using a 3D scan-conversion (voxelization) algorithm for polygons [3, 8]. Obviously, it
is hard to define aesthetic tolerance because it
depends on many parameters, such as the shading
technique, color, object size, and h u m a n factors.
In addition, the voxelization of a polygon, even
a very small one, is much more complicated than
the above vertex conversion process. However,
the complexity of the polygon voxelization is contrasted with the exponential complexity of the
subdivision process.
As mentioned before, the number of vertices,
edges, and polygons are exponential functions of
the number of subdivision iterations. Applying
301
many iterations on an initially large mesh requires
a very large memory. The problem is even more
severe in our case since most of the memory is
occupied by the voxel-based dataset. Using polygon voxelization before the polygons have reached the voxel granularity can solve the memory
burden and also achieve a substantial speedup.
An early stop becomes more effective when the
polygon mesh is not uniformly "squarish." For
example, if there is a very long rectangular polygon, then the F-face polygon corresponding to
this polygon degenerates to a line at a certain
stage of the subdivision. Obviously, in this case,
further subdivision of this polygon down to
the voxel level results in many redundant subdivision iterations, which are very space and time
consuming.
Unfortunately, one cannot avoid polygon meshes
with a variety of polygon sizes, such as in many
computer-aided geometric design applications. If
the original polygon mesh is an approximation of
a free-form surface, a unification of the initial
polygons by splitting "long" polygons is not acceptable because it distorts the shape of the original approximated surface. The distortion is obvious. For example, suppose L is split into L1,
L2, ... ,Lk. Originally, only the centroid of L is
on the surface. After splitting, all the centroids of
L1, L2, ... , Lk are on the surface. This usually has
the effect of slightly lifting the original surface.
7 Triangulation
The original polygons comprising the mesh need
not be planar. Furthermore, the subdivision algorithm does not guarantee planarity of the polygons generated. For example, if there exists a vertex which is incident to several polygons, and the
polygons are not coplanar, then the V-face corresponding to this vertex does not lie on a plane. To
employ the polygon voxelization algorithm,
planarity or near planarity of the polygons is
required. To solve this problem, every polygon is
triangulated before the voxelization, that is, decomposed into triangles.
The following practical algorithm for triangulating a 3D concave non-planar polygon has
been developed. Assume a polygon P with
n vertices Vo, V1, ... , V~_I is a simple polygon
302
(i.e., does not intersect itself), is either convex or
concave (i.e., one of its main projection is concave)
and is not too distorted (i.e., has a meaningful
normal average). The triangulation algorithm
chops off one triangle at a time from P and leaves
the remainder polygon with one less edge. The
algorithm keeps applying this function repeatedly
on the remainder polygon until it is reduced into
a single triangle. The conditions for chopping
a triangle V/_ 1 V/V/+1 are:
- The corner at V~is not concave;
- No vertices of P other than V~_1, V~ and V~+1
are contained in the triangular prism c. The triangular prism c passes through the three vertices
V/_ 1, V~and V/+ 1 and is parallel to the normal of
the triangle V/_ 1 V/V/+ 1.
The first condition is checked by comparing the
normal direction (i.e., the vertex traversal order) of
the triangle with the direction of the average normal of the entire polygon. This condition is intuitively equivalent to whether the new edge is inside
the polygon or outside. The second condition is
checked by determining if any vertex, excluding
the triangle vertices, is within the triangular prism.
8 Polygons alignment
The polygon voxelization algorithm supports
normal interpolation for Phong shading. Thus,
the normal of every polygon has to point towards
the "outside" of the object. The correct normal
directions can be maintained during the subdivision procedure provided that the original polygon
normals are correct in the initial polygon mesh.
However, this introduces a lot of bookkeeping in
every iteration of the subdivision. Consequently,
another approach has been devised, which aligns
the normals after the subdivision procedure.
Two neighboring polygons have normals pointing toward the same side of the object if and only
if the two lists of vertices are both in the same
clockwise or counterclockwise order. Thus, if the
c o m m o n edge of two polygons is traversed in
reverse directions, the two polygons are coordinated in their normal direction (see Fig. 1).
Otherwise, one of the polygon normals has to be
reversed, that is, the order of the vertices of one of
the polygons has to be reversed. The normal
alignment process first aligns the normal of the
first polygon to the proper direction and then
corrects the rest of the polygons accordingly by
traversing the edges of the already aligned polygon and aligning neighbor after neighbor.
9
Implementation
The algorithm for generating a smooth voxelbased surface from an irregular polygon mesh has
been implemented in C on a Sun workstation, in
the framework of the HighRes (high resolution)
Cube software. This work is part of a long-term
research project at Stony Brook whose goals include the generation of smooth synthetic objects
for out-of-the-window views in a flight simulator
such as the Hughes Aircraft ReatScene voxeIbased flight simulator (see figures in [9, 14]).
At present, the input specification is given
through a display file that consists of the polygon
5
6
7
8
9
lo
Fig. 5. The original polygon mesh of a toy jack
Fig. 6. Voxelized toy jack after one iteration
Fig. 7. Voxelized toy jack after three iterations
Fig. 8. Smoothed voxelized toy jack
Fig. 9. Puffing (top left) vs smoothing (top right)
Fig. 10. Voxelized polyhedron with solid texture mapping
11
Fig. 11. Voxelized smoothed polyhedron with solid texture mapping
303
mesh specification, parameters, and commands
for smoothing the polygon mesh. The program
supports the interpolation of either the interior
vertices only, the boundary vertices only, or both.
The user can choose to subdivide the polygon
mesh down to the voxel level or to stop at a certain fidelity of the polygon mesh, by specifying
either the number of iterations, the size of the
maximum polygon diameter, or the surface curvature tolerance measured by the difference of normals at vertices or adjacent polygons. Local subdivision is optional, and the user can specify
whether to split the polygon mesh before or during the subdivision.
For voxelized surfaces which do not contain any
normal values, such as those generated by vertex
voxelization, congradient shading [-4] has been
employed. It estimates the normal vector from the
voxel neighborhood structure using a modified
central differences depth gradient. In addition,
a normal interpolation process for Phong shading
has been embedded within the polygon voxelization algorithm. However, the images shown here
have been shaded with diffuse reflection only. Figures 5-8 show a voxelization of a toy jack. Figure
5 is the original polygon mesh of the jack, and
Figs. 6 and 7 are the jack after one and three
subdivisions, respectively. In Fig. 8 normal interpolation is applied to the normals. The jack at the
upper right corner of Fig. 9 has been puffed (i.e.,
the interpolation passes through the original
vertices). It is compared with the smooth jack (at
the upper left corner of Fig. 9) where the interpolation passes through the original face centroids.
The original jack (at the bottom) is given for
size reference. Figure 10 shows a solid textured
polyhedron before smoothing. Figure 11 shows
the voxelized polyhedron with the solid texture
after smoothing. All the images look smooth
with no staircase effect due to the fact that
the voxel-based resolution is equal to the image
resolution.
Acknowledgements. This work was partially supported by the
National Science Foundation under grants IRI-9008109 and
CCR-9205047 and grants from Hughes Aircraft Company and
Hewlett Packard. We are grateful to Rick Avila for implementing the preprocessing part of the algorithm, for his idea of
trianguiating concave polygons, and for his devoted work on the
HighRes system of the Cube project. We would also like to thank
Chichuang Dzeng for writing the routine that coordinates the
normals of polygon meshes.
304
References
1. Barsky BA, Greenberg DG (1990) Determining a set of
B-spline control vertices to generate an interpolating surface. Comput Graphics Image Process 227-248
2. Catmull E, Clark J (1978) Recursively generated B-spline
surfaces on arbitrary topological meshes. Comput Aided
Design 10:350-355
3. Cohen D, Kaufman A (1990) Scan conversion algorithms for
linear and quadratic objects. In: Volume Visualization,
Kaufman A (ed.) IEEE Computer Society, Los Alamitos,
CA, pp 280-301
4. Cohen D, Kaufman A, Bakatash R, Bergman S (1990) Realtime discrete shading. Vis Comput 6:16-27
5. Doo DWH, Sabin MA (1978) Behaviour of recursive subdivision surfaces near extraordinary points. Comput Aided
Design 10:356-360
6. Kaufman A, Shimony E (1986) 3D scan-conversion algorithms for voxel-based graphics, Proc. ACM Workshop on
Interactive 3D Graphics, Chapel Hill, NC, pp 45-76
7. Kaufman A (1987) Efficient algorithms for 3D scanconversion of parametric curves, surfaces, and volumes.
Comput Graphics 21:171-179
8. Kaufman A (1988) Efficient algorithms for 3D scan-converting polygons. Computers & Graphics 12:213~19
9. Kaufman A, Cohen D, Yagel R (1993) Volume graphics.
Computer 26: 7, pp 51-64
10. Kong TY, Rosenfeld A (1989) Digital topology: introduction
and survey. Comput Vis Graphics Image Process 48:357-393
11. Mokrzycki W (1988) Algorithms of discretization of algebraic spatial curves on homogeneous cubical grids. Computers & Graphics 12:477487
12. Nasri AH, (1987) Polyhedron subdivision methods for freeform surfaces ACM Trans Graphics 6:29-73
13. Tan ST, Chan KC (1986) Generation of high order surface
over arbitrary polyhedral meshes. Comput Aided Design 18:
411-423
14. Wright J, Hsieh (1992) A voxel-based forward projection
algorithm for rendering surface and volumetric data.
Proceedings Visualization '92, Boston, MA, pp 340-348
15. Yagel R, Cohen D, Kaufman (1992) Discrete ray tracing
IEEE Comput Graphics Applic, pp 19-28
DANIEL COHEN is lecturer
at the Department of Computer
Science at Ben-Gurion University, Beer-Sheva, and at the
school of Mathematics at TelAviv University, Israel. Currently, he also developing a real-time
ray tracer of terrain systems at
Milikon, Ltd. In 1987 he was
a software engineer at ANon,
Ltd. working on bitmap
graphics. His research interests
include rendering techniques,
volume visualization, architectures and algorithms for voxelbased graphics. He received
a BSc Cure Laude in both Mathematics and Computer Science (i985), an MSc Cum Laude in
Computer Science both from Ben-Gurion University (1986), and
a Phd from the Department of Computer Science at State University of New York Stony Brook (1991).
ARIE KAUFMAN is a Professor of Computer Science at the
State University of New York at
Stony Brook, where he is also
the director of the Cube project
for volume visualization supported by the National Science
Foundation, Department of Energy, Hughes Aircraft Company,
Hewlett-Packard
Company,
Silicon Graphics Company, and
the State of New York. He has
conducted research in computer
graphics for 20 years specializing
in volume visualization, computer graphics architectures and
algorithms, user interfaces, and
aultimedia. Kaufman has held positions as a Senior Lecturer
nd the Director of the Center of Computer Graphics of the
len-Gurion University in Beer-Sheva, Israel, and as an Associ~e and Assistant Professor of Computer Science at FlU in
/Iiami, Florida. He is currently the chairman of the IEEE
;omputer Society Technical Committee on Computer Grphics,
Las been the Paper or Program co-Chair for Visualization'
,0-93 Conferences, and co-Chair for several EUROGRAPHICS
3raphics Hardware Workshops. He received a BS in Mathematzs and Physics from the Hebrew University of Jerusalem in
969, an MS in Computer Science from the Weizmann Institute
~f Science (Rehovot) in 1973, and a PhD in Computer Science
tom the Ben-Gurion University in 1977.
YINGXING WANG is currently working for Protein Database, Inc. and was working before for Lundy Computer
Graphics, a subdivision of
Trans-Technology. She received
an M.Sc. in Computer Science
from State University of New
York at Stony Brook in 1989, an
M.Sc. in Applied Mathematics
from Academia Sinica in China,
and a B.Sc in Mathematics from
the University of Science and
Technology of China.
305
Download