Robust Repair of Polygonal Models: Tao Ju Rice University
Robust Repair of Polygonal Models: Tao Ju Rice University
Tao Ju∗
Rice University
Figure 1: A synthetically distorted Horse model (left) containing numerous self-intersecting polygons, gaps and holes, and the repaired model
(right) with a closed surface.
Abstract 2 compares two groups of curve models in 2D, one group being
closed (bottom) and the other not (top).
We present a robust method for repairing arbitrary polygon mod- We seek a robust method for repairing an arbitrary polygonal
els. The method is guaranteed to produce a closed surface that model, so that the repaired model is always closed. Due to the
partitions the space into disjoint internal and external volumes. diversity and complexity of polygonal models, mesh repair faces
Given any model represented as a polygon soup, we construct an daunting challenges. Specifically, an ideal repair method should
inside/outside volume using an octree grid, and reconstruct the sur- possess the following properties:
face by contouring. Our novel algorithm can efficiently process
large models containing millions of polygons and is capable of re- 1. Robustness: The method should always produce a closed sur-
producing sharp features in the original geometry. face for any input model.
CR Categories: I.3.5 [Computer Graphics]: Computational Ge-
ometry and Object Modeling—Boundary representations; Curve, 2. Efficiency: The method should be able to process huge mod-
surface, solid, and object representations; Geometric algorithms, els within reasonable time and space.
languages, and systems
3. Accuracy: The method should preserve the geometry of the
Keywords: model repair, robustness, scan conversion, octree input model whenever possible.
1.1 Contributions
Although other volumetric techniques have been proposed for re-
pairing polygon models [Nooruddin and Turk 2003] or filling holes
on the model surface [Curless and Levoy 1996; Davis et al. 2002],
our method differs substantially in the following aspects:
2.2 Volumetric model repair
A volumetric approach to model repair involves representing the in-
put model on a volumetric grid and reconstructing an output surface
from the grid. Several approaches have been proposed for perform-
ing each task, which we shall review separately. (Note that a related
problem considers surface reconstruction from scattered points via
an intermediate volume, such as [Ohtake et al. 2003].)
5 Sign generation
Given a scan-converted grid, our next task is to determine signs
at the grid points such that each intersection edge exhibits a sign Figure 6: Sign generation via the dual surface: the input model
change (i.e., a consistent sign configuration). However, consistent with an open top (a), edges intersected with the model and the cor-
signs do not exist when a cell face contains an odd number of edges responding dual surface (b) (boundary edges are highlighted), the
that intersect the model, as shown in figure 5. Such cases may arise patched dual surface with corresponding intersection edges (c), and
either due to an insufficient grid resolution (figure 5 left) or a non- the repaired model based on the consistent signs generated (d).
closed input model (figure 5 middle and right). Denote the set of
original intersection edges on the scan-converted grid as E, our goal
is to obtain a modified set Ê of intersection edges that possess a 1. Detect boundary cycles. ∂ (S) is a collection of closed cycles
consistent sign configuration. bi . In fact, since a vertex on S is shared by two edges on each
quad that contains the vertex, every vertex on S is shared by an
even number of boundary edges. Hence ∂ (S) is an Eulerian
graph and can be partitioned into disjoint cycles bi [Bollobas
1979]. The dual surface in figure 6 (b) contains one boundary
cycle at the top.
6 Surface reconstruction
After signs are determined at each grid point, a closed surface sep-
arating grid points with opposite signs can be constructed using
contouring algorithms. If the locations of the intersection points
are stored on the edges during scan-conversion, a primal contour-
ing algorithm can be used, such as the Marching Cubes algorithm
[Lorensen and Cline 1987]. If normals are attached to the intersec-
tion points in addition to their locations (i.e., a Hermite represen-
tation), we can use Dual Contouring [Ju et al. 2002] to reproduce
sharp features in the original model. In either case, the polygons on
the contoured surface do not self-intersect, and can be consistently
Figure 7: Patch construction by divide-and-conquer. Left: quads Q oriented to face the external volume.
connect edges e1 and e2 orthogonal to the splitting plane and divide
the original cycle into b1 (solid lines) and b2 (broken lines). Right: 6.1 Examples
on the splitting plane, quads Q are dual to cell edges (thickened)
crossing the line h (dashed) connecting the projections of e1 and Figures 8 and 9 demonstrate repairing CAD models with sharp fea-
e2. tures using the presented method. Figure 8 (a) shows a mechanical
part built using a state-of-the-art 3D design software. Note that it is
To construct a patch with low surface area, we let the band of not unusual for CAD software to produce hanging polygons (shown
quads Q follow the plane on which e1 and e2 lie. Specifically, as in this example) during CSG operations. The gears model in figure
shown on the right of figure 7, we connect the projections of e1 9 (a) is also not closed, since the polygons between the top and the
and e2 on the splitting plane with a line segment h (in practice the bottom gear does not lie between an internal volume and an exter-
projections are computed by averaging the locations and normals of nal volume. In both examples, boundary cycles are detected on the
existing edge intersections on the cell faces dual to e1 and e2 ). We corresponding dual surfaces, in which each boundary edge is shared
then construct Q as the quads dual to the cell edges on the primal by one quad (figure 8 (b)) or three quads (figure 9 (b)). The final
grid that cross h (new edge intersections are created when necessary repaired surfaces are reconstructed using the Marching Cubes algo-
by intersecting h with the cell edges and interpolating the normals rithm (figure 8 (c) and figure 9 (c)) and Dual Contouring (figure 8
associated with the end points of h). Since h lies inside the convex (d) and figure 9 (d)). Observe that the dual-contoured surfaces elim-
reconstructed surface may not look optimal with respect to the sur-
rounding mesh, particularly in places of complex holes with mul-
tiple boundaries or highly curved shapes. Moreover, curved inter-
nal membranes may not be satisfactorily removed as a result of the
simple divide-and-conquer approach. Without compromising the
robustness of our method, we can improve the appearance of the
repaired surface by exploring other means by which the boundary
cycles on the dual surface can be patched. For example, boundary
cycles that are within a distance threshold can be combined, and
existing geometry can be taken into consideration when patching
the cycles. We are also investigating incorporation of diffusion-
based methods [Davis et al. 2002] for creating more natural looking
patches on the dual surface with the surrounding geometry.
Due to the use of an intermediate volume, the reconstructed sur-
Figure 8: A mechanical part model containing hanging triangles (a), face using our method may contain topological redundancy in the
the dual surface with highlighted boundary cycles (b), reconstructed form of handles, cavities, and disconnected components (the genus
surfaces using Marching Cubes (c) and Dual Contouring (d). of each repaired model in this paper are reported in Table 1). Since
a large number of topology repair methods operate directly in the
volume domain, we can adapt these methods to work on the octree
volume produced by the second step (i.e., sign generation) so that
inate the errors in the original models while accurately preserving a topologically acceptable surface is produced by contouring. In
the rest of the geometry, such as sharp edges and corners. particular, we can apply the robust seed algorithm [Andujar et al.
Polygonal models obtained from 3D range images typically have 2002] to remove internal cavities, and the topology simplification
gaps, holes or intersecting polygons. In figure 10, the Bunny model algorithm [Wood et al. 2002] to reduce the genus of the surface.
is repaired using octree grids at different depths and reconstructed Morphological operators introduced in [Nooruddin and Turk 2003]
using Marching Cubes. Observe that the holes at the bottom of the can also be applied to remove small features on the repaired volume
Bunny are repaired at every grid resolution with reasonable appear- if desired.
ance. The geometry of the original model away from the holes are Finally, to reduce triangle count due to the use of contouring al-
faithfully reproduced to the extent that the grid resolution allows. gorithms, we can output the reconstructed mesh to a polygon sim-
To test the robustness of our algorithm, we synthetically distort plifier, such as QSlim [Garland and Heckbert 1997], to obtain a
the Horse model on the left of figure 1 by randomly perturbing the decimated model. Alternatively, if Hermite data are present, QEF
vertex locations in each triangle in the front part, and removing simplification method [Ju et al. 2002] can be applied directly on the
one third of the triangles at random locations in the second part. octree grid, so that the dual-contoured mesh is already simplified to
Despite the numerous self-intersections, gaps and holes on the dis- the desired extent.
torted model, the repaired model on the right consists of a single
closed surface with no self-intersecting triangles. Observe that the 8 Conclusion
repaired surface reproduces both noisy and smooth geometry on the
original model. In this paper we present a robust method for repairing polygonal
models. Given an arbitrary polygonal model represented as poly-
Our model repair method can process huge models efficiently.
gon soups, our method always produces a closed and consistently
Figure 11 (a) shows the statue of Michelangelo’s David recon-
oriented surface. As a volumetric approach, our method employs an
structed at 1mm resolution from 3D range scans. The model con-
octree grid and memory-efficient operations that are capable of pro-
tains over 56 million triangles, and takes up over 1 Gigabyte of
cessing huge models. The output surface is guaranteed to be defect-
memory to store. Figure 11 (b) shows the repaired model using
free due to a simple and robust algorithm for generating signs on the
an octree of depth 13, in which each leaf cell on the octree mea-
octree grid. Sharp features in the input model can also be faithfully
sures approximately 1mm on the model. The repair process finishes
reproduced by storing Hermite data.
within an hour using less than half a gigabyte of memory. Sign gen-
eration on the entire grid, in particular, takes only 45 seconds . Fig-
ure 11 (c) takes close-up looks at the model before and after repair. 9 Acknowledgement
Observe again that the repaired surface accurately reproduces the I would like to thank my advisor, Joe Warren, for his continuous
geometry details, and generates reasonable patches where the data support and insightful comments.
is missing from the original model.
Table 1 reports the time and space consumed for repairing the References
various models in the paper. We also include the results of repair-
ing other models from the Stanford 3D Scanning Repository, such A NDUJAR , C., B RUNET, P., AND AYALA , D. 2002. Topology-
as the Dragon and the Happy Buddha, as well as the David model reducing surface simplification using a discrete solid representa-
reconstructed at 2mm resolution. The experiments are performed tion. ACM Transaction on Graphics 21, 2, 88–105.
on a consumer-level PC with 1.5GHz CPU and 2GB memory, and
I/O operations are included when measuring the scan-conversion BAREQUET, G., AND K UMAR , S. 1997. Repairing CAD models.
and contouring time. Observe that while scan-conversion is sensi- In IEEE Visualization ’97, R. Yagel and H. Hagen, Eds., 363–
tive to the size of the input model, the performance of sign genera- 370.
tion and surface reconstruction only depends on the complexity of B OLLOBAS , B. 1979. Graph Theory: An Introductory Course.
the octree. New York: Springer-Verlag.
7 Discussion and future work B ORODIN , P., N OVOTNI , M., AND K LEIN , R. 2002. Progressive
The goal of our work is to design a simple algorithm for generat- gap closing for mesh repairing. In Advances in Modelling, Ani-
ing a closed surface robustly for any arbitrary input mesh. Due to mation and Rendering, J. Vince and R. Earnshaw, Eds. Springer
the simplicity of our approach, however, the repaired region on the Verlag, July, 201–213.
Figure 9: A gear model (a) that contains a membrane in the middle, the dual surface with a highlighted boundary cycle (b), reconstructed
surfaces using Marching Cubes (c) and Dual Contouring (d). The cross-section views of the original and the repaired model are shown at
their top-right corners.
Figure 10: The original bunny model (a) repaired at octree depth 5 (b), 6 (c) and 7 (d).
Figure 11: Repairing David: the original model at 1mm resolution (a), the repaired model at the same resolution (b), and close-ups on the
model before repair (top row in (c)) and after repair (bottom row in (c)).
Model Input Octree Octree Scan-conversion Sign generation Contouring Memory Output Surface
Triangles Depth Leaf Cells Time (sec) Time (sec) Time (sec) Usage (MB) Triangles Genus
Mechanic Part 25,487 6 5,449 0.89 0.01 0.094 < 10 5,480 3
Gears 11,610 6 9,316 0.86 0.03 0.14 < 10 8,926 0
Bunny 69,451 7 46,028 2.75 0.06 0.79 < 10 91,716 0
Horse 80,805 8 93,164 3.62 0.31 2.14 < 10 163,692 1
Dragon 871,414 9 543,449 37.16 0.69 7.92 16 1,085,404 2
Buddha 1,087,716 10 1,716,718 56.47 2.02 18.22 28 3,425,781 11
David (2mm) 8,254,150 12 6,539,335 362.98 8.20 133.75 92 13,059,000 15
David (1mm) 56,230,343 13 31,561,029 2482.14 45.82 661.64 417 62,825,040 179
Table 1: Performance results on repairing various models on a consumer level PC with 1.5GHz CPU and 2GB memory.
C URLESS , B., AND L EVOY, M. 1996. A volumetric method for M URALI , T. M., AND F UNKHOUSER , T. A. 1997. Consistent solid
building complex models from range images. In Proceedings of and boundary representations from arbitrary polygonal data. In
ACM SIGGRAPH 1996, ACM Press / ACM SIGGRAPH, New Proceedings of the 1997 symposium on Interactive 3D graphics,
York. E. Fiume, Ed., Computer Graphics Proceedings, Annual ACM Press, 155–ff.
Conference Series, ACM, vol. 30, 303–312.
N OORUDDIN , F. S., AND T URK , G. 2003. Simplification and
DACHILLE , F., AND K AUFMAN , A. 2000. Incremental triangle repair of polygonal models using volumetric techniques. IEEE
voxelization. In Graphics Interface, 205–212. Transactions on Visualization and Computer Graphics 9, 2, 191–
205.
DAVIS , J., M ARSCHNER , S. R., G ARR , M., AND L EVOY, M.
2002. Filling holes in complex surfaces using volumetric diffu- O HTAKE , Y., B ELYAEV, A., A LEXA , M., T URK , G., AND S EI -
sion. In First ’International Symposium on 3D Data Processing, DEL , H.-P. 2003. Multi-level partition of unity implicits. ACM
Visualization, and Transmission. Transactions on Graphics 22, 3, 463–470.
D OUGLAS , J. 1931. Solution of the problem of plateau. Transac- O OMES , S., S NOEREN , P., AND D IJKSTRA , T. 1997. 3d
tions of the American Mathematical Society 33, 263–321. shape representation: Transforming polygons into voxels. In
ScaleSpace97.
F OLEY, J. D., VAN DAM , A., F EINER , S. K., AND H UGHES , J. F.
1990. Computer Graphics (2nd Edition). Addison-Wesley Pubi- S CHROEDER , W. J., Z ARGE , J. A., AND L ORENSEN , W. E. 1992.
cation Company. Decimation of triangle meshes. In Computer Graphics (Proceed-
ings of ACM SIGGRAPH 92), ACM Press, 65–70.
F RISKEN , S. F., P ERRY, R. N., ROCKWOOD , A. P., AND J ONES ,
T. R. 2000. Adaptively sampled distance fields: A general rep- T URK , G., AND L EVOY, M. 1994. Zippered polygon meshes from
resentation of shape for computer graphics. In SProceedings of range images. In Proceedings of ACM SIGGRAPH 1994, ACM
ACM SIGGRAPH 2000, ACM Press / ACM SIGGRAPH, New Press / ACM SIGGRAPH, New York. E. Fiume, Ed., Computer
York. E. Fiume, Ed., Computer Graphics Proceedings, Annual Graphics Proceedings, Annual Conference Series, ACM, 311–
Conference Series, ACM, K. Akeley, Ed., 249–254. 318.
G ARLAND , M., AND H ECKBERT, P. S. 1997. Surface simplifica- W OOD , Z., H OPPE , H., D ESBRUN , M., AND S CHRODER , P.
tion using quadric error metrics. In Proceedings of ACM SIG- 2002. Isosurface topology simplification. Technical Report
GRAPH 1997, ACM Press / ACM SIGGRAPH, New York. E. MSR-TR-2002-28, Microsoft Research (January).
Fiume, Ed., Computer Graphics Proceedings, Annual Confer-
ence Series, ACM, 209–216.
A Existence of consistent signs
H UANG , J., YAGEL , R., F ILIPPOV, V., AND K URZION , Y. 1998.
An accurate method for voxelizing polygon meshes. In IEEE Proposition: An octree grid with intersection edges E can be
Symposium on Volume Visualization, 119–126. consistently signed if and only if its dual surface S contains no
boundary edges, that is, ∂ (S) = 0.
/
J U , T., L OSASSO , F., S CHAEFER , S., AND WARREN , J. 2002.
Dual contouring of hermite data. ACM Transactions on Graphics Proof: Observe that a consistent sign configuration exists if and
21, 3, 339–346. only if every closed circuit of edges on the grid contains an even
number of intersection edges. In particular, since a cell face is a
KOBBELT, L. P., B OTSCH , M., S CHWANECKE , U., AND S EIDEL , closed circuit of four edges, every cell face should contain an even
H.-P. 2001. Feature sensitive surface extraction from volume number of intersection edges if a consistent sign configuration ex-
data. In Proceedings of ACM SIGGRAPH 2001, ACM Press / ists, hence the dual surface contains no boundary edges. To prove
ACM SIGGRAPH, New York. E. Fiume, Ed., Computer Graph- sufficiency, we assume that a consistent sign configuration does not
ics Proceedings, Annual Conference Series, ACM, 57–66. exist. Among all closed circuits on the grid containing an odd num-
ber of intersection edges (referred to as odd circuits), we find the
L IEPA , P. 2003. Filling holes in meshes. In Proceedings of the
one with the shortest length and denote it as b. Following a similar
Eurographics/ACM SIGGRAPH symposium on Geometry pro-
argument as in Section 5.3, b can be split into two sub-circuits, b 1
cessing, Eurographics Association, 200–205.
and b2 , by a band of cell faces Q in the middle (see figure 7 left).
L ORENSEN , W., AND C LINE , H. 1987. Marching cubes: A Since b1 and b2 are strictly shorter than b, they can not be odd cir-
high resolution 3d surface construction algorithm. In Computer cuits. Hence at least one cell face in Q contains an odd number of
Graphics (Proceedings of ACM SIGGRAPH 87), ACM Press, intersection edges. In other words, a boundary edge must exist on
vol. 21, 163–169. the dual surface. This completes the proof.