$ show Luo-Yihao/FaithC
FaithC is a Python library (with CUDA acceleration) for near-lossless 3D mesh encoding and decoding using Faithful Contour Tokens (FCT), as accepted at CVPR 2026 (Oral). It implements an encoder that transforms a mesh into compact per-voxel tokens (anchors, normals, edge flux signs) via octree traversal, SAT-based triangle clipping, QEF optimization, and edge flux computation. The decoder reconstructs the mesh from tokens using edge-based quad extraction and triangulation. The library is not a standalone application but a research-oriented tool intended for downstream tasks like VAE and diffusion models. It provides both a modern class-based API (FCTEncoder/FCTDecoder) and an older functional API. The codebase is well-structured with modular components, custom CUDA kernels for performance, and a PyTorch-centric design. However, it has some maintenance risks including dual code paths, hardcoded CUDA dependencies, and a custom 'atom3d' package without version pinning.
The LLM identified 3 files worth highlighting for reuse:
Provides a drop-in replacement for torch_scatter using native PyTorch scatter operations. This is highly reusable in any PyTorch project that depends on torch_scatter but needs to avoid that dependency. It is self-contained and well-implemented.
Implements standard and differentiable Quadratic Error Function (QEF) solvers for optimizing anchor points in contour extraction. The solver uses PyTorch's SVD for robust least-squares minimization. This is a core building block for mesh reconstruction that can be extracted for other geometry processing tasks.
Contains GridExtent and OctreeIndexer classes for spatial indexing with Morton encoding, cube-edge mapping, and octree traversal. These utilities are self-contained and reusable for any voxel-based 3D processing or point cloud tasks requiring fast spatial lookups.