Topology Preserving Isosurface Extraction for Geometry Processing
Total Page:16
File Type:pdf, Size:1020Kb
Topology Preserving Isosurface Extraction for Geometry Processing Gokul Varadhan1, Shankar Krishnan2, TVN Sriram1, and Dinesh Manocha1 1Department of Computer Science, University of North Carolina, Chapel Hill, U.S.A 2AT&T Labs - Research, Florham Park, New Jersey, U.S.A http://gamma.cs.unc.edu/recons ABSTRACT Marching Cubes (MC) [2] or any of its variants [3–5]. We We address the problem of computing a topology preserving refer to these isosurface extraction algorithms collectively as isosurface from a volumetric grid using Marching Cubes for MC-like algorithms. The output of an MC-like algorithm is geometry processing applications. We present a novel adap- an approximation – usually a polygonal approximation – of tive subdivision algorithm to generate a volumetric grid. the implicit surface. We refer to this step as reconstruction Our algorithm ensures that every grid cell satisfies certain of the implicit surface. sampling criteria. We show that these sampling criteria Compared to other surface representations (e.g. para- are sufficient to ensure that the isosurface extracted from metric surfaces), implicit surface representations are easy to the grid using Marching Cubes is topologically equivalent use to perform geometric operations like union, intersection, to the exact isosurface: both the exact isosurface and the difference, blending, and warping. Specifically, they map extracted isosurface have the same genus and connectivity. Boolean operations into simple minimum/maximum opera- We use our algorithm for accurate boundary evaluation of tions on the scalar fields of the primitives. Suppose we have Boolean combinations of polyhedra and low degree algebraic two primitives P1 and P2 with scalar fields f1 and f2. Then primitives, Minkowski sum computation, model simplifica- we have tion, and remeshing. The running time of our algorithm p ∈ ∂(P1 ∪ P2) ⇐⇒ min(f1(p), f2(p)) = 0 varies between a few seconds for simple models composed p ∈ ∂(P ∩ P ) ⇐⇒ max(f (p), f (p)) = 0 of a few thousand triangles and tens of seconds for complex 1 2 1 2 polyhedral models represented using hundreds of thousands p ∈ ∂(P1 \P2) ⇐⇒ max(f1(p), −f2(p)) = 0 of triangles. where ∂P denotes the boundary of P. Because of the above property, implicit representations are frequently used to per- 1. INTRODUCTION form Boolean operations. They have been used for numerous applications including geometric modeling, volume render- Implicit surface representations have become increasingly ing, morphing, path planning, swept volume computation, common in computer graphics and geometric modeling. This and sculpting digital characters [3, 4, 6–11]. representation uses a function f : d → to represent a R R Our goal is to exploit the desirable properties of implicit closed surface S. The function f : d → is known as the R R surface representations for geometric computations such as implicit function or the scalar field. S is the set of points Boolean operations (i.e. union, intersection and difference), p where f(p) = 0; S is referred to as an implicit surface or Minkowski sum computation, simplification, and remeshing. an isosurface. A commonly used scalar field is the signed In each case, we wish to obtain an accurate polygonal ap- distance field. The signed distance field D : d → is a R R proximation of the boundary of the final solid. Let E denote continuous function that at a point p measures the distance this boundary. We represent E implicitly – as an isosurface between p and S. This value is positive or negative de- of a scalar field. This scalar field is obtained by performing pending on whether the point lies outside or inside S. The minimum/maximum operations over the scalar fields defined distance can be defined under any reasonable norm (e.g., for the primitives. At a broad level, our approach performs Euclidean, max-norm). three main steps. A common way of representing a scalar field is to dis- cretize the continuous scalar field into discrete samples – to 1. Sampling: Generate a volumetric grid and compute compute the value of the scalar field at the vertices of a a scalar field (e.g, a signed distance field) at its corner volumetric grid. We refer to this step as a sampling of the grid points. scalar field. The grid is an approximate representation of the scalar field; the accuracy of the approximate representation 2. Operation: For each geometric operation (union or depends on the rate of sampling – the resolution of the grid. intersection), perform an analogous operation (e.g., An explicit boundary representation of the implicit surface min/max) on the scalar fields of the primitives. At can be obtained by extracting the zero-level isosurface using the end of this step, the scalar values at the grid points define a sampled scalar field for E. 3A preliminary version of this work appeared in the second European Symposium on Geometry Processing 2004 [1]. 3. Reconstruction: Perform isosurface extraction using (a) Union (b) Sampling and Operation (c) Reconstruction Figure 1: Sampling and reconstruction: This figure shows how to perform a union operation using the sampling and and reconstruction approach. The sampling step generates a volumetric grid (shown as a uniform grid). At each grid point, it computes a signed distance to the boundaries of each of the two primitives, P and Q. Next, a minimum operation is performed on the two signed distances. This generates another distance field on which the reconstruction is performed using an MC-like algorithm. The rightmost figure shows the reconstruction, which is an approximation to the union. an MC-like algorithm to obtain a polygonal approxi- plicity and efficiency. Each step is easy to implement. A mation A of E. uniform grid or an adaptive grid (e.g. octree) may be cho- sen. Geometric operations such as union or intersection are This approach is illustrated in Fig. 1. We will refer to E as cheap – we only need to perform simple min/max opera- the exact isosurface and A as the extracted isosurface or the tions on the corresponding scalar fields. Isosurface extrac- reconstructed isosurface. tion is also reasonably straightforward: MC-like algorithms are both simple and fast. Many public domain implementa- tions of MC-like algorithms [12] are available. Challenges/Issues: The above approach produces an ap- proximation A to the final surface E. The accuracy of the approximation mainly depends on the resolution of the un- derlying grid. Insufficient grid resolution can result in a poor approximation. This occurs especially if E has small com- ponents, thin sheets, or needle-shaped features. A may suffer from various kinds of errors: small components or handles present in E may not be captured in A. The process of re- construction may also introduce “extraneous topology”, i.e., A may have unwanted additional components or undesirable handles that were not present in E. Fig. 2 shows an example Figure 2: Accuracy problems with MC-like meth- of such a situation. ods: This figure highlights the errors that can be The above problems occur on account of inadequate res- present in the output when MC-like methods are used olution of the grid. Therefore, to alleviate these problems, to reconstruct surfaces with thin features. The left many applications generate samples on a fine grid. However, image shows the “gun model” of the Bradley Fight- the use of fine grid can result in three problems. First, there ing Vehicle, which is generated using 8 Boolean opera- may still be no guarantees on the accuracy of A. Second, tions. The right image shows the output of a MC-like a fine grid increases the storage overhead and the recon- algorithm (dual contouring) on a distance field sam- structed surface can have a high number of polygonal prim- pled on a uniform 64 × 64 × 64 grid. The output has itives. Finally, it is computationally expensive to use a fine many artifacts such as unwanted holes and extrane- grid. Recent work on adaptive grid generation and subdivi- ous handles. sion algorithms overcomes some of these problems [10, 13]. However, none of these algorithms give rigorous guarantees Two important advantages of the above approach are sim- on the accuracy of A. As compared to prior work, the main benefits of our algo- rithm are its speed, simplicity, and accuracy. It not only Goals: Our goal is to ensure an accurate approximation by offers the simplicity and efficiency of MC-like reconstruc- providing geometric and topological guarantees on A. In tion, but also the ability to guarantee the topology of the particular, we wish to ensure that A has a bounded two- extracted isosurface. sided Hausdorff error, and is topologically equivalent to E. Organization: The rest of our paper is organized as fol- The Hausdorff error measures the surface deviation between lows. Section 2 gives a brief overview of previous work on A and E; bounding this error is important to ensure a geo- isosurface extraction. Section 3 introduces the notation and metrically close approximation. definitions used in the rest of the paper. Section 4 presents Preserving topology is also important in many applica- an overview of the MC-like methods and analyzes the er- tions. In CAD, topological features such as tunnels often rors in their output that can be caused due to inadequate correspond to distinguishing characteristics of the model. resolution of the grid. In Section 5, we present a sampling The geometric models used to represent the organs in med- condition on the volumetric grid to ensure topology preser- ical datasets often consist of handles. Retaining these topo- vation. In Section 6, we present an adaptive subdivision logical features can be necessary in order to preserve the algorithm to generate a volumetric grid satisfying the sam- anatomical structure of the organ, which can be crucial for pling condition.