Flexible Isosurface Extraction for Gradient-Based Mesh Optimization

Tianchang Shen, Jacob Munkberg, Jon Hasselgren, Kangxue Yin, Zian Wang, Wenzheng Chen, Zan Gojcic, Sanja Fidler, Nicholas Sharp, Jun Gao

TL;DR

FlexiCubes is a novel differentiable isosurface representation designed to bridge the gap between high-quality mesh generation and gradient-based optimization. By introducing carefully chosen local degrees of freedom into a Dual Marching Cubes framework, it allows researchers to optimize 3D surfaces that are both geometrically precise (preserving sharp features) and topologically sound (manifold and intersection-free), outperforming traditional methods like Marching Cubes and DMTet.

What Problem Does This Paper Address?

In modern 3D AI, we often want to "optimize" a mesh—for example, to make a 3D model match a set of 2D photos or to generate a new shape from a text prompt. A common strategy is to optimize a hidden "scalar field" (like a Signed Distance Function) and then use an algorithm like Marching Cubes (MC) to extract the visible triangle mesh.

However, existing extraction methods have a "quality vs. stability" problem:

  1. Marching Cubes is stable for optimization but "stiff." It can’t represent sharp corners well and often produces "sliver" triangles (long, skinny triangles that break physics simulations and rendering).
  2. Dual Contouring (DC) is flexible and captures sharp features, but it is numerically unstable. During optimization, its vertices can "explode" to infinity, and it often creates non-manifold geometry (mathematically "broken" surfaces).

The authors introduce FlexiCubes to provide the best of both worlds: the flexibility to fit complex geometry and the numerical stability required for deep learning and gradient descent.

Methods

FlexiCubes builds upon Dual Marching Cubes (DMC), a lesser-known cousin of Marching Cubes that naturally produces manifold (watertight) meshes. The core innovation is the introduction of three sets of learnable parameters that are updated via automatic differentiation:

  • Flexible Vertex Positioning ($\alpha, \beta$): Instead of placing vertices at fixed centroids, FlexiCubes allows each vertex to move within its local grid cell to better align with the target surface.
  • Flexible Quad Splitting ($\gamma$): Most dual methods produce quadrilaterals, which must be split into triangles. FlexiCubes learns the best diagonal to split along, preventing artifacts in curved regions.
  • Grid Deformation ($\delta$): The underlying grid itself can warp slightly to align with thin or sharp features.

Additionally, the authors extend the method to support tetrahedral mesh extraction (useful for volume-based physics simulations) and hierarchical octrees, allowing the mesh to have high resolution only where it's needed.

Datasets

The authors evaluated FlexiCubes across several diverse benchmarks:

  • Mesh Reconstruction: 79 complex 3D shapes from the AIM@Shape database and other CAD repositories.
  • Photogrammetry: The NeRF synthetic dataset (8 scenes) and real-world datasets like Tanks&Temples (Family) and GoldCape.
  • Generative Modeling: The ShapeNet dataset (specifically the Car, Chair, and Motorbike categories) used within the GET3D framework.
  • Physics Simulation: Custom-designed "Pretzel" and "Donut" scenarios for Finite Element Method (FEM) optimization.

Key Insights and Ideas

  • The "Grad-Flexible" Sweet Spot: The paper identifies that "Grad" (effective gradient descent) and "Flexible" (fitting sharp features) are usually in conflict. FlexiCubes resolves this by using convex combinations for vertex placement, ensuring vertices stay within their cells and gradients remain well-behaved.
  • Manifold by Construction: By choosing DMC as the base, the method guarantees that the output is a manifold surface, which is a massive headache-saver for downstream tasks like 3D printing or simulation.
  • End-to-End Learning of Mesh Structure: Unlike traditional algorithms where the mesh connectivity is a fixed post-processing step, FlexiCubes makes the way the mesh is built part of the optimization. The mesh "learns" how to best tessellate itself to represent the target shape.

Key Results

  • Geometric Fidelity: In 3D reconstruction tasks, FlexiCubes achieved significantly lower Chamfer Distance (CD) and higher F1 scores than Marching Cubes and DMTet. For example, at a $64^3$ resolution, FlexiCubes improved the Edge F1 score (EF1) to 0.43, compared to 0.25 for Marching Cubes.
  • Mesh Quality: FlexiCubes produces far fewer "sliver" triangles. Its distribution of triangle angles is much closer to the ideal equilateral shape, which is critical for stable physics.
  • Generative Improvements: When swapped into the GET3D generative model, FlexiCubes improved the FID score (a measure of image/shape quality) across all categories. For Motorbikes, the FID dropped from 48.90 to 44.87.
  • Physics-Ready: The authors demonstrated that they could optimize the physical properties (like mass density) of a deforming object by feeding the extracted tetrahedral mesh directly into a differentiable physics engine.

Limitations and Future Work

  • Self-Intersections: While FlexiCubes reduces self-intersections significantly compared to Dual Contouring (0.10% vs 1.48%), it does not mathematically guarantee zero intersections.
  • Global Continuity: The extraction is not globally continuous; as the surface moves across grid boundaries, the mesh topology can "jump." While the Adam optimizer handles this well, it remains a theoretical limitation.
  • Future Directions: The authors suggest integrating FlexiCubes with volumetric rendering (like NeRFs) for even better gradient approximations and exploring 4D spatiotemporal meshing for animated sequences.

Summary updated

BibTeX
@article{shen2023flexible,
  author = {Tianchang Shen and Jacob Munkberg and Jon Hasselgren and Kangxue Yin and Zian Wang and Wenzheng Chen and Zan Gojcic and Sanja Fidler and Nicholas Sharp and Jun Gao},
  title = {{Flexible Isosurface Extraction for Gradient-Based Mesh Optimization}},
  journal = {ACM Trans. Graphics},
  year = {2023},
  doi = {10.1145/3592430},
}

Loading related content...

Figure