marching cubes consolidate and tutorial entry

This commit is contained in:
Alec Jacobson
2015-09-23 18:59:38 -04:00
parent e07e56dad8
commit 4bbd030681
6 changed files with 179 additions and 0 deletions
+40
View File
@@ -143,6 +143,7 @@ lecture notes links to a cross-platform example application.</p>
<li><a href="#generalizedwindingnumber">702 Generalized Winding Number</a></li>
<li><a href="#meshdecimation">703 Mesh Decimation</a></li>
<li><a href="#signeddistances">704 Signed Distances</a></li>
<li><a href="#marchingcubes">705 Marching Cubes</a></li>
</ul></li>
<li><a href="#future">Chapter 8: Outlook for continuing development</a></li>
</ul>
@@ -3256,6 +3257,45 @@ slices through the bunny." />
slices through the bunny.</figcaption>
</figure>
<h2 id="marchingcubes">Marching Cubes</h2>
<p>Often 3D data is captured as scalar field defined over space <span class="math">\(f(\mathbf{x}) :
\mathcal{R}^3 \rightarrow \mathcal{R}\)</span>. Lurking within this field,
<em>iso-surfaces</em> of the scalar field are often salient geometric objects. The
iso-surface at value <span class="math">\(v\)</span> is composed of all points <span class="math">\(\mathbf{x}\)</span> in
<span class="math">\(\mathcal{R}^3\)</span> such that <span class="math">\(f(\mathbf{x}) = v\)</span>. A core problem in geometry
processing is to extract an iso-surface as a triangle mesh for further
mesh-based processing or visualization. This is referred to as iso-contouring.</p>
<p>&#8220;Marching Cubes&#8221; [lorensen_1987] is a <a href="https://en.wikipedia.org/wiki/Marching_cubes">famous
method</a> for iso-contouring
tri-linear functions <span class="math">\(f\)</span> on a regular lattice (aka grid). The core idea of this
method is to contour the iso-surface passing through each cell (if it does at
all) with a predefined topology (aka connectivity) chosen from a look up table
depending on the function values at each vertex of the cell. The method
iterates (&#8220;marches&#8221;) over all cells (&#8220;cubes&#8221;) in the grid and stitches together
the final, watertight mesh.</p>
<p>In libigl, <code>igl::marching_cubes</code> constructs a triangle mesh <code>(V,F)</code> from an
input scalar field <code>S</code> sampled at vertex locations <code>GV</code> of a <code>nx</code> by <code>ny</code> by
<code>nz</code> regular grid:</p>
<pre><code class="cpp">igl::marching_cubes(S,GV,nx,ny,nz,V,F);
</code></pre>
<figure>
<img src="images/armadillo-marching-cubes.jpg" alt="(Example 705) samples signed distance to the
input mesh (left) and then reconstructs the surface using
marching cubes to counter the 0-level set (center). For comparison, clamping
this signed distance field to an indicator function and contouring reveals
serious aliasing artifacts." />
<figcaption>(<a href="705_MarchingCubes/main.cpp">Example 705</a>) samples signed distance to the
input mesh (left) and then reconstructs the surface using
marching cubes to counter the 0-level set (center). For comparison, clamping
this signed distance field to an indicator function and contouring reveals
serious aliasing artifacts.</figcaption>
</figure>
<h1 id="future">Outlook for continuing development</h1>
<p>Libigl is in active development, and we plan to focus on the following features