Stop Using SDF + Marching Cubes! FaithC Changes Everything

B
Bright Coding
Auteur
Stop Using SDF + Marching Cubes! FaithC Changes Everything
Advertisement

Stop Using SDF + Marching Cubes! FaithC Changes Everything

What if everything you knew about 3D voxel representation was fundamentally broken?

For decades, we've accepted a dirty secret in computer graphics and 3D machine learning: Signed Distance Functions (SDFs) combined with Marching Cubes are the "standard" way to turn voxels into meshes. But here's the painful truth nobody talks about at conferences — this pipeline butchers your geometry. Watertight preprocessing requirements. Global sign computation nightmares. Surface thickening that turns sharp edges into mush. Jagged iso-surfaces that make your beautiful models look like they're from 1998. And don't even get me started on lost internal structures — those intricate details your artists spent hours crafting? Gone. Vaporized by the very pipeline meant to preserve them.

If you've ever stared at a reconstructed mesh wondering why your original design looks like it went through a blender, you're not alone. The entire field has been trapped in this paradigm, accepting artifacts as "acceptable losses."

Until now.

Enter FaithC — Faithful Contouring, the CVPR 2026 Oral paper that's sending shockwaves through the 3D deep learning community. This isn't an incremental improvement. This is a complete paradigm shift that eliminates iso-surfaces entirely. No more Marching Cubes. No more distance field approximations. Just pure, faithful geometry reconstruction that preserves every edge, every internal structure, even for open and non-manifold meshes.

Ready to unlearn everything? Let's dive in.


What is FaithC?

FaithC (short for Faithful Contouring) is the official PyTorch/CUDA implementation of a groundbreaking 3D representation method developed by researchers from Imperial College London, Tsinghua University, Meshy, Nanyang Technological University, University of Melbourne, and The Chinese University of Hong Kong. Led by Yihao Luo and Xianglong He, this work achieved the prestigious Oral presentation at CVPR 2026 — a distinction given to only the most impactful papers.

But why is the community freaking out? Let's look at the timeline:

  • November 2025: arXiv preprint drops. People start paying attention.
  • December 2025: Code fully open-sourced with v1.5 — pure Python↗ Bright Coding Blog + Atom3d, zero C++ compilation required. The barrier to entry collapses.
  • January 2026: Microsoft's concurrent work TRELLIS 2 releases with O-Voxel representation. The signal is clear — the industry is moving beyond iso-surfaces.
  • March 2026: CVPR 2026 Oral acceptance. The academic seal of approval.

The core insight is deceptively simple yet revolutionary: instead of approximating surfaces through distance fields and extracting them with Marching Cubes, FaithC directly operates on the raw mesh. It identifies every surface-intersecting voxel and solves for compact Faithful Contour Tokens (FCTs) — 18-dimensional descriptors that enable near-lossless reconstruction.

Think about what this means. No more watertight requirements. No more global sign consistency headaches. No more trading fidelity for convenience. FaithC brings geometry back — faithfully.


Key Features That Make FaithC Insane

Near-Lossless Fidelity

This isn't marketing fluff. FaithC preserves sharp edges that SDF+Marching Cubes rounds off. It maintains internal structures that get obliterated by iso-surface extraction. It handles open meshes and non-manifold geometry that would break conventional pipelines entirely. The QEF (Quadric Error Function) solve for optimal anchor points and normals ensures mathematical precision at every voxel.

Scalable GPU Performance

Thanks to custom CUDA kernels and hierarchical octree traversal with BVH-accelerated AABB intersection, FaithC scales to 2048+ resolutions on modern NVIDIA hardware. We're talking 18.4 million active voxels processed in under 5 seconds on an H100. The encoder-decoder architecture separates the heavy lifting (spatial queries) from the reconstruction, enabling efficient batched processing.

Ultra-Compact Representation

Each active voxel is just 18 dimensions: 3 for the surface anchor point, 3 for the normal direction, and 12 int8 edge flux signs. This compactness isn't just about storage — it makes FCT tokens ideal for machine learning pipelines. The token format natively supports filtering, texturing, manipulation, and assembly operations that would be nightmarish with raw mesh data.

Pure Python Simplicity

With v1.5, FaithC eliminated the C++ compilation barrier. The Pixi-based installation handles all dependencies automatically. One command to install, one to run. First run sets everything up; subsequent runs take ~5 seconds. For manual setups, it's standard PyTorch + torch-scatter + Atom3d — no exotic dependencies.

Flexible Token Architecture

The FCT format isn't just for reconstruction. These tokens are manipulable representations — you can filter them, apply textures, perform geometric operations, and assemble complex scenes. This opens doors for generative modeling that were previously locked behind mesh-processing complexity.


Real-World Use Cases Where FaithC Dominates

1. High-Fidelity Asset Pipeline for Game Engines

Game studios spend enormous resources on mesh cleanup and retopology. FaithC's ability to preserve sharp edges and internal structures means artist-authored detail survives the voxelization process. The 18-dimensional tokens can be streamed efficiently, and reconstruction at runtime is sub-second even at 512³ resolution. No more "good enough" approximations — your collision meshes can match your render meshes.

2. Medical Imaging and 3D Printing

Medical visualization demands accuracy. SDF thickening around thin structures (vessel walls, bone trabeculae) introduces dangerous artifacts. FaithC's direct surface representation preserves topological correctness without the artificial inflation that iso-surface methods cause. For 3D printing, this translates to dimensionally accurate prints without post-processing compensation.

3. Generative 3D AI and Neural Representations

The compact, regular token format is perfect for VAE and diffusion architectures. The research team explicitly lists "FCT-based VAE release" and "diffusion model release" on their roadmap. Early adopters are already experimenting with token-space manipulation for shape editing and generation — operations that would require complex mesh neural networks with traditional representations.

4. CAD and Engineering Workflows

Engineering models are inherently non-manifold — assemblies with contacting parts, sheet metal with zero-thickness features, models with intentional gaps. Conventional voxel pipelines fail here. FaithC handles these cases natively, enabling simulation preprocessing and digital twin applications that were previously impossible with volumetric representations.

5. Cultural Heritage Digitization

Scanning artifacts with complex topology (broken pottery, corroded metal, organic materials) produces meshes that are nightmares for SDF computation. FaithC's direct approach reconstructs faithfully without topological repair, preserving the authentic condition of historical objects for digital preservation.


Step-by-Step Installation & Setup Guide

Prerequisites

Before starting, ensure you have:

  • NVIDIA GPU with CUDA support (required for GPU kernels)
  • Python 3.10+
  • PyTorch 2.5+

Method 1: Pixi Installation (Recommended — 60 Seconds)

Pixi is a modern package manager that handles all dependencies automatically. This is the fastest path to a working FaithC environment.

Step 1: Install Pixi (if not already installed)

# Cross-platform Pixi installer
curl -fsSL https://pixi.sh/install.sh | sh

Step 2: Clone and Run

# Clone the repository
git clone https://github.com/Luo-Yihao/FaithC.git
cd FaithC

# Magic happens here: installs Python, PyTorch, torch-scatter, Atom3d, etc.
# Then runs the demo automatically
pixi run demo

That's genuinely it. The first run downloads and configures everything. Subsequent runs complete in approximately 5 seconds.

Method 2: Manual Setup (Full Control)

For developers who need specific PyTorch/CUDA versions or want to integrate FaithC into existing environments:

Step 1: Install PyTorch (match your CUDA version)

# Example for CUDA 12.4 — adjust for your system
pip install torch --index-url https://download.pytorch.org/whl/cu124

Step 2: Install PyTorch Geometric dependencies

# torch_scatter and related packages from PyG wheel index
pip install pyg_lib torch_scatter torch_sparse torch_cluster torch_spline_conv \
    -f https://data.pyg.org/whl/torch-2.5.1+cu124.html

Step 3: Install Atom3d (geometry backend)

# Direct from GitHub, no build isolation to ensure compatibility
pip install git+https://github.com/Luo-Yihao/Atom3d.git --no-build-isolation

Step 4: Install FaithContour

Advertisement
# Clone and install in editable mode
git clone https://github.com/Luo-Yihao/FaithC.git
cd FaithC
pip install -e . --no-build-isolation

Step 5: Additional dependencies

pip install trimesh scipy einops

Verification

Test your installation with the default demo:

# Reconstructs default icosphere at 128³ resolution
python demo.py

For a more impressive test with custom geometry:

# Custom mesh at 512³ resolution with explicit output path
python demo.py -p assets/examples/pirateship.glb -r 512 -o output/pirateship.glb

REAL Code Examples from FaithC

Let's examine actual code from the FaithC repository, with detailed explanations of what's happening under the hood.

Example 1: Complete Encode-Decode Pipeline

This is the core API usage pattern from the README, showing the full workflow from mesh loading to reconstructed export:

import torch
import trimesh
from faithcontour import FCTEncoder, FCTDecoder
from atom3d import MeshBVH
from atom3d.grid import OctreeIndexer

# Load mesh — force='mesh' ensures we get a single mesh object,
# not a scene with multiple geometries
mesh = trimesh.load("model.obj", force='mesh')

# Transfer to GPU tensors: vertices as float32, faces as long (indices)
V = torch.tensor(mesh.vertices, dtype=torch.float32, device='cuda')
F = torch.tensor(mesh.faces, dtype=torch.long, device='cuda')

# Build spatial acceleration structures
# MeshBVH: Bounding Volume Hierarchy for fast ray-mesh intersection
bvh = MeshBVH(V, F)

# Define the voxel grid bounds — [-1,1]³ is the default normalized space
bounds = torch.tensor([[-1., -1., -1.], [1., 1., 1.]], device='cuda')

# OctreeIndexer: hierarchical spatial index for efficient voxel traversal
# max_level=9 means 2^9 = 512 resolution per axis (512³ total grid)
octree = OctreeIndexer(max_level=9, bounds=bounds, device='cuda')

# ENCODE: mesh → Faithful Contour Tokens
encoder = FCTEncoder(bvh, octree, device='cuda')
fct = encoder.encode(
    min_level=4,           # Start octree traversal at level 4 (coarse)
    compute_flux=True,     # Calculate edge crossing signs — critical for reconstruction
    clamp_anchors=True     # Keep anchor points within voxel bounds for numerical stability
)

# The FCT object contains:
# fct.anchor: [K, 3] — surface representative points (QEF-optimized centroids)
# fct.normal: [K, 3] — surface normals at each anchor
# fct.edge_flux_sign: [K, 12] — which of 12 voxel edges are crossed by surface {-1,0,+1}
# fct.active_voxel_indices: [K] — linear indices of surface-intersecting voxels

# DECODE: tokens → mesh
decoder = FCTDecoder(resolution=512, bounds=bounds, device='cuda')
result = decoder.decode_from_result(fct)

# Export reconstructed geometry
# result.vertices: [N, 3] reconstructed vertex positions
# result.faces: [M, 3] triangle indices
trimesh.Trimesh(
    result.vertices.cpu().numpy(),
    result.faces.cpu().numpy()
).export("output.glb")

What's happening here? The encoder performs hierarchical octree traversal, using the BVH to quickly identify which voxels intersect the mesh surface. For each intersecting voxel, it computes SAT (Separating Axis Theorem) polygon clipping to get precise centroids and areas, then solves the QEF for optimal anchor points and normals. The edge flux signs encode topological connectivity. The decoder reverses this: identifying active edges from flux signs, forming quads from incident voxels, and adaptively triangulating based on normal consistency.

Example 2: Command-Line Demo with Full Arguments

The demo.py script exposes rich configuration options for experimentation:

# Default icosphere at resolution 128 (fastest, for testing)
python demo.py

# Production-quality reconstruction with explicit control
python demo.py \
    -p assets/examples/pirateship.glb \  # Input mesh path
    -r 512 \                              # Grid resolution: 512³ voxels
    -o output/pirateship.glb \           # Output path
    --margin 0.05 \                      # Boundary padding around mesh
    --tri_mode auto \                    # Adaptive triangulation strategy
    --clamp_anchors True \               # Numerical stability guard
    --compute_flux True                  # Essential for correct topology

The tri_mode parameter deserves special attention. It controls how quads are split into triangles:

  • auto: Chooses based on local geometry (recommended)
  • length: Shortest diagonal split
  • angle: Best angle preservation
  • normal_abs: Normal consistency priority
  • simple_02, simple_13: Fixed pattern splits (fastest, for specific use cases)

Example 3: Pixi One-Liner (The "It Just Works" Approach)

# From zero to running demo — no manual dependency resolution
git clone https://github.com/Luo-Yihao/FaithC.git
cd FaithC
pixi run demo

This simplicity is deliberate. The FaithC team recognized that adoption barriers kill good research. By leveraging Pixi's lockfile-based reproducibility, they've eliminated "works on my machine" problems. The pixi.toml in the repository pins exact versions of PyTorch, CUDA toolkit, torch-scatter, and Atom3d — tested combinations that are guaranteed to work together.


Advanced Usage & Best Practices

Resolution Selection Strategy

Don't blindly max out resolution. FaithC's performance scales sub-linearly thanks to the octree, but memory is still a constraint:

  • 128³: Rapid prototyping, ~71K active voxels, <0.3s total
  • 512³: Production quality, ~1.1M voxels, <0.7s — sweet spot for most applications
  • 1024³+: Only when you need microscopic detail, 4.6M+ voxels

Batch Processing Multiple Meshes

The encoder/decoder objects are reusable. Initialize once, encode multiple meshes:

# Reuse spatial structures for same-bounds meshes
encoder = FCTEncoder(bvh, octree, device='cuda')
decoder = FCTDecoder(resolution=512, bounds=bounds, device='cuda')

for mesh_path in mesh_batch:
    mesh = trimesh.load(mesh_path, force='mesh')
    # ... update V, F, rebuild BVH if geometry changes ...
    fct = encoder.encode(min_level=4, compute_flux=True)
    result = decoder.decode_from_result(fct)
    # Export ...

Memory Optimization for Large Scenes

For scenes exceeding GPU memory, consider:

  • Chunked encoding: Process spatial sub-volumes independently
  • Mixed precision: The FCT format uses float32 anchors/normals but int8 flux signs — maintain this precision split
  • Streaming decode: Write vertices/faces incrementally rather than holding full result tensors

Integration with PyTorch DataLoaders

The FCT tensor format is natively batchable. For ML training:

# Pad/truncate to fixed K active voxels per sample
# Stack in batch dimension: [B, K, 18] where 18 = 3+3+12 dimensions
# Use edge_flux_sign as auxiliary topology supervision

Comparison with Alternatives

Feature SDF + Marching Cubes Neural Implicit (NeRF, etc.) FaithC
Sharp edge preservation ❌ Rounded by interpolation ⚠️ Network-dependent Exact via QEF
Internal structures ❌ Lost in iso-surface ⚠️ Requires careful design Preserved natively
Open/non-manifold meshes ❌ Requires watertight input ⚠️ Ambiguous Handled directly
Reconstruction speed ⚠️ Moderate ❌ Slow (network evaluation) <5s at 2048³
Representation compactness ⚠️ Full grid or sparse ✅ Very compact (MLP weights) 18 dims per active voxel
ML pipeline friendly ❌ Irregular mesh output ✅ Implicit is differentiable Regular token tensors
Preprocessing required ❌ Watertight, signed, closed ⚠️ Camera poses, etc. Raw mesh in, tokens out
Topological guarantees ⚠️ Ambiguous at thin features ❌ No guarantees Flux signs encode topology

When to choose FaithC over alternatives:

  • You need geometric fidelity over compression ratio
  • Your meshes have complex topology (open, non-manifold, thin features)
  • You're building ML pipelines that benefit from regular token structures
  • You want deterministic, fast reconstruction without network inference costs

When alternatives might win:

  • Extreme compression for transmission (neural implicits)
  • View-dependent rendering without explicit geometry (NeRF variants)
  • Scenes where mesh extraction is never needed (pure volume rendering)

FAQ

What makes FaithC "faithful" compared to SDF methods?

SDF methods approximate surfaces through distance values, then extract iso-surfaces with Marching Cubes — a lossy process that rounds corners, thickens thin features, and loses internal geometry. FaithC directly represents the surface in each voxel through QEF-optimized anchor points and exact edge crossing information, enabling near-lossless reconstruction.

Do I need C++ compilation skills to use FaithC?

No! Version 1.5 and later are pure Python + Atom3d. The Pixi installation handles everything automatically. Manual setup only requires standard pip install commands. The CUDA kernels are pre-compiled in the wheel packages.

Can FaithC handle my messy, non-manifold meshes?

Yes — this is a core strength. Unlike SDF pipelines that require watertight, manifold input, FaithC operates directly on raw mesh geometry. Open boundaries, non-manifold edges, and self-intersections are handled natively through the direct surface representation.

What hardware do I need?

Any NVIDIA GPU with CUDA support. The benchmarks shown use H100, but the code scales to consumer GPUs. Resolution is the main memory driver — 512³ fits comfortably on 8GB VRAM, while 2048³ requires high-end cards.

How do I cite FaithC in my research?

Use the provided BibTeX from the repository:

@inproceedings{luo2026faithfulcontouring,
    title     = {Faithful Contouring: Near-Lossless 3D Voxel Representation Free from Iso-surface},
    author    = {Luo, Yihao and He, Xianglong and Pan, Chuanyu and Chen, Yiwen and Wu, Jiaqi and Li, Yangguang and Ouyang, Wanli and Hu, Yuanming and Yang, Guang and Yap, ChoonHwai},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    year      = {2026}
}

Is there a pretrained generative model available?

Not yet, but the roadmap explicitly lists FCT-based VAE and diffusion model releases. The 18-dimensional token format was designed with generative modeling in mind. Early adopters are already building custom architectures.

How does FaithC relate to Microsoft's O-Voxel?

They're concurrent, convergent research. Both appeared in late 2025/early 2026, recognizing that iso-surface methods are limiting 3D representation. O-Voxel (in TRELLIS 2) takes a similar philosophical direction. FaithC distinguishes itself through the specific FCT token format and QEF-based optimization.


Conclusion: The Future of 3D Representation is Faithful

We've been stuck in a paradigm that trades fidelity for convenience. SDFs and Marching Cubes were brilliant for their era, but they carry fundamental limitations that no amount of engineering can overcome. FaithC proves we don't have to accept those tradeoffs anymore.

The evidence is compelling: CVPR 2026 Oral recognition. Concurrent industry adoption (Microsoft's O-Voxel). A clean, usable codebase that installs in seconds. Performance that scales to production resolutions. And most importantly, reconstruction quality that preserves the geometry you actually created, not an approximation of it.

For researchers, FaithC opens new directions in generative 3D AI with its ML-friendly token format. For engineers, it enables accurate simulation and manufacturing pipelines. For artists, it means their creative intent survives technical processing. For the field, it represents a genuine paradigm shift — the kind that happens once a decade.

The repository is actively maintained, the team is responsive, and the roadmap is ambitious. The only question is: will you be early to this transition, or will you be catching up in two years?

⭐ Star FaithC on GitHub — clone it, run the demo, break it, improve it. The future of 3D representation is being written right now, and you can be part of it.

Enough with SDF + Marching Cubes. Time to bring geometry back — faithfully.

Advertisement
Advertisement

Commentaires 0

Aucun commentaire pour l'instant. Soyez le premier à réagir !

Laisser un commentaire

Advertisement