Fill Holes in STL Mesh Online
Close gaps and open boundaries in your 3D mesh to make it watertight and ready for printing or simulation.
What Are Mesh Holes?
A mesh hole is an opening in the surface of a 3D model β a region where the triangle shell is missing, leaving boundary edges (edges that belong to only one triangle instead of two). These boundaries form closed loops around the missing area, like the rim of a hole in a piece of fabric.
For a mesh to be considered watertight β meaning it fully encloses a volume with no openings β every edge must be shared by exactly two faces. Even a single boundary edge means the mesh has a hole, and the model cannot be reliably sliced for 3D printing or used in simulations that require a closed volume.
Why Mesh Holes Happen
Holes in meshes can come from many sources. Understanding the cause can help you decide whether automatic repair is appropriate or whether you need to go back to the source.
Partial Exports
When exporting from CAD or modeling software, selection errors or export settings can result in only part of the model being written to the file. The bottom of an object might be missing, or internal features may be incomplete. This is especially common when exporting assemblies piece by piece.
Boolean Operation Failures
Boolean operations (union, difference, intersection) are notoriously fragile in mesh-based tools. When two surfaces are nearly coincident or just barely touching, the boolean algorithm may fail to close the result properly, leaving gaps at the intersection seams.
3D Scan Artifacts
3D scanners capture point clouds that are reconstructed into meshes. Regions the scanner could not see β occluded areas, dark surfaces, reflective materials β result in missing data. The reconstruction algorithm leaves holes where it has no information to fill.
Mesh Editing Mistakes
Deleting faces during cleanup, separating parts of a model, or performing edge cuts without reconnecting can all introduce holes. In complex editing sessions, small holes are easy to miss.
File Corruption
Truncated or corrupted STL files may be missing face data at the end of the file, resulting in partial meshes with large open boundaries.
How Hole Filling Works
JustFixSTL uses a multi-step process to detect and fill holes in your mesh:
Boundary loop detection
The algorithm identifies all boundary edges (edges with only one adjacent face) and traces them into closed loops. Each loop represents the rim of one hole. If boundary edges do not form closed loops, it indicates a more severe topological issue that must be resolved first.
Loop analysis
Each boundary loop is analyzed for its vertex count, area, and shape. Small holes (few vertices) are straightforward to fill. Larger, more complex holes require more careful triangulation to avoid creating overlapping or degenerate faces.
Fan triangulation
For each boundary loop, the algorithm generates new triangles to close the opening. Simple holes are filled using fan triangulation from a central point or ear-clipping methods. The new faces are oriented to match the surrounding surface normals.
Normal consistency check
After filling, the new faces are checked to ensure their normals are consistent with the rest of the mesh. Misoriented fill faces would recreate the same rendering and slicing problems that holes cause.
When Holes Can Be Filled Automatically
Automatic hole filling works best in these situations:
- Small holes β a few missing faces where the surrounding geometry provides clear context for filling.
- Planar or near-planar holes β flat openings such as missing bottom faces on objects that were designed to sit on a flat surface.
- Well-defined boundaries β the boundary loop forms a clean closed path with reasonable angles between vertices.
- Scan artifacts β small gaps in 3D scan data where the missing region is relatively flat or gently curved.
When Automatic Filling May Not Be Ideal
There are cases where automatic hole filling produces technically correct but geometrically unsatisfying results:
- Very large holes β if a significant portion of the model is missing, the fill will be flat across the gap rather than following the expected curvature. The mesh will be watertight, but the filled region may not look right.
- Complex curved surfaces β a flat fan triangulation across a hole in a curved area will create a visible faceted patch. This is fine for printing (the surface is closed) but may be visually noticeable.
- Intentional openings β some models have deliberate openings (vases, tubes, housings). Filling these defeats the design intent. If you do not want a hole filled, you may need to go back to the source model.
- Non-manifold boundaries β if the boundary edges are part of non-manifold geometry, hole filling alone will not work. The non-manifold issues must be resolved first. JustFixSTL handles this by performing non-manifold repair before hole filling.
Holes vs. Other Mesh Defects
It is worth distinguishing holes from other mesh problems that may look similar:
- Non-manifold edges are not holes β they are edges shared by three or more faces. They cause different symptoms and require different repair strategies. See Fix Non-Manifold STL Files.
- Flipped normals can make a mesh appear to have holes in a 3D viewer (backface culling hides the misoriented faces), but the faces are actually there. See Fix Flipped Normals.
- Self-intersections do not create holes but can cause similar slicing failures. The mesh is closed but the surface passes through itself.
Related Pages
Close the gaps in your mesh
Upload your STL or OBJ file above for instant hole detection and filling, or visit the home page.
Go to Home Page