3D Mesh Repair
Automatic mesh hole detection and filling for 3D scanning, game development, and additive manufacturing workflows

MeshRepair is an open-source tool for detecting and filling holes in triangulated 3D meshes. It provides both a command-line interface for batch processing and a Blender addon for interactive use.
This tool was developed to address a common issue in photogrammetry workflows:
Software such as Epic’s RealityScan (formerly RealityCapture) and similar photogrammetry applications generate watertight meshes by creating large polygons to close open boundaries. These oversized polygons typically appear in:
| Area | Cause |
|---|---|
| Mesh boundaries | Large triangles spanning the capture edge |
| Low overlap regions | Oversized faces where few source images overlap |
| Weak depth reconstruction | Large polygons masking areas with poor 3D data |

These oversized polygons create problems for subsequent operations:
The recommended approach is to remove problematic oversized polygons (creating holes) and then fill those holes with properly-sized geometry:
MeshRepair generates fill geometry with:
Photogrammetry outputs frequently contain millions of polygons. MeshRepair is designed to handle large meshes efficiently:
Photogrammetry (RealityScan, Metashape, 3DF Zephir, ...)
-> Remove oversized boundary polygons (RealityScan, Metashape, Blender, ...)
-> MeshRepair CLI or Addon (fill holes with uniform geometry)
-> Continue with sculpting, retopology, or mesh wrapping
| Feature | Description |
|---|---|
| Hole Detection | Identifies all boundary loops in the mesh |
| Hole Filling | Triangulates holes using constrained Delaunay methods |
| Mesh Preprocessing | Removes duplicate vertices, non-manifold geometry, and isolated components |
| Surface Continuity | Supports C⁰, C¹, and C² continuity for filled regions |
| Blender Integration | Native addon with Edit Mode selection support |
| Command Line Interface | Batch processing and scripting support |
| Multi-threaded Processing | Parallel hole filling with partition count capped by hole count |
| Partition Tuning | Minimum edge budget per partition (--min-edges) to avoid oversharding tiny holes |
| Global Hole Size Guards | Diameter limits use the full mesh bounding box even when partitioned |
For batch processing, automation, and integration with other tools.
meshrepair input.obj output.obj
For interactive use within Blender’s modeling environment.
Provides direct access to repair operations from Blender’s sidebar panel.
MeshRepair processes meshes through four stages:
Cleans mesh topology by removing duplicate vertices, non-manifold elements, isolated vertices, and small disconnected components.
Identifies all boundary loops (holes) by traversing border halfedges in the mesh structure.
Fills each hole using the Liepa algorithm with constrained Delaunay triangulation and optional Laplacian fairing for surface smoothness.
Exports the repaired mesh in the specified format.
The hole filling algorithm supports three continuity levels:
| Level | Description | Computation Cost | Application |
|---|---|---|---|
| C⁰ | Positional continuity | Low | Fast processing, preview |
| C¹ | Tangent continuity | Medium | General use |
| C² | Curvature continuity | High | High-quality output |

| Document | Description |
|---|---|
| CLI Guide | Command line interface usage |
| Blender Addon Guide | Blender addon installation and usage |
MeshRepair is released under the LGPL-2.1 license license. MeshRepair Blender addon is released under the GPL-2.0 license license.
Dependencies:
Hole filling algorithm based on:
Peter Liepa. “Filling Holes in Meshes.” Eurographics Symposium on Geometry Processing, 2003.
Fairing algorithm based on:
Mario Botsch et al. “On Linear Variational Surface Deformation Methods.” IEEE Transactions on Visualization and Computer Graphics, 2008.