RUST · 3D MESH REPAIR & CAD

watertight-meshes-rs — 3D AI Mesh Repair & Manifold Watertight Solid Generator in Rust

watertight-meshes-rs repairs noisy, non-manifold 3D meshes from generative AI models and photogrammetry into 100% watertight solids ready for 3D printing and physics simulation. It uses sparse octree Unsigned Distance Fields (UDF), flood-fill interior/exterior classification, and Dual Contouring to seal holes and self-intersections.

$ cargo install watertight-meshes-rs
GitHub ↗

Architected for Speed & Reliability

Engineered from the ground up in memory-safe Rust with zero unnecessary dependencies.

🛡️

Guaranteed 2-Manifold Surfaces

Resolves non-manifold edges, singular vertices, and T-junctions generated by generative 3D models like TRELLIS, Pixal3D, and Hunyuan3D.

🕳️

Automated Hole Closing

Detects open boundary loops and computes minimal-area triangulation patches with geometric normal smoothing.

🐚

Internal Shell Pruning

Discards concentric internal floating cavities and trapped geometry that waste 3D printer resin, filament, or rendering polygons.

📦

Cross-Platform Pure Rust

Replaces fragile 87KB Windows-only batch scripts and Python 3.12 / CUDA wheel dependencies with a single native binary on macOS, Linux, and Windows.

🧊

Sparse Voxel Octree Meshing

High-speed voxelization and Dual Contouring / Marching Cubes surface reconstruction for repairing severely degenerate input meshes.

🖨️

3D Slicer Ready

Outputs clean, validated STL, OBJ, and GLB files that load instantly into Bambu Studio, PrusaSlicer, and Cura with zero toolpath errors.

Get Started in Seconds

Install via Cargo and run immediately on macOS, Linux, or Windows.

Terminal
# Install Watertight-Meshes-RS
cargo install --git https://github.com/bhubbard/watertight-meshes-rs

# Validate an AI-generated mesh for manifold errors
watertight check raw_trellis_output.obj

# Automatically repair holes, remove internal shells, and output solid GLB
watertight repair raw_trellis_output.obj -o solid_model.glb --strict-manifold

# Run voxelization reconstruction
watertight voxelize input.obj --resolution 256 -o reconstructed.stl

Engine Architecture

Streamlined execution pipeline with deterministic memory isolation and zero runtime overhead.

Pipeline Flow
┌───────────────────────────────────────────────────────────┐
│         Raw Generative AI Output (TRELLIS, Hunyuan3D)     │
└─────────────────────────────┬─────────────────────────────┘
                              │ Non-manifold edges, holes, shells
┌─────────────────────────────▼─────────────────────────────┐
│               watertight-meshes-rs Engine                 │
│  ┌──────────────────┐  ┌──────────────────┐  ┌──────────┐ │
│  │ Boundary Detector│  │ Shell Pruner     │  │ Voxel SVO│ │
│  │ & Hole Triangulat│  │ (Ray Intersect)  │  │ Resampler│ │
│  └──────────────────┘  └──────────────────┘  └──────────┘ │
└─────────────────────────────┬─────────────────────────────┘
                              │ 100% Sealed 2-Manifold Mesh
┌─────────────────────────────▼─────────────────────────────┐
│          3D Printing Slicer (Bambu Studio, Prusa, Cura)   │
└───────────────────────────────────────────────────────────┘