STL Mesh Repair
Operator: Abdulla Al Fahad. How tools are built and checked
A slicer can only print a surface that encloses a volume: every edge shared by exactly two triangles, all of them facing outward. Scans and exports break that in four or five distinct ways, and the slicer's error message rarely says which. This page reports each defect with a count, highlights the offending edges on the model, repairs what can safely be repaired, and shows the same report again afterwards.
It reads STL (binary and ASCII), OBJ, PLY and 3MF, and writes STL, 3MF or OBJ. A final check hands the result to manifold-3d, a geometry library that refuses anything that is not a closed solid, so a green result there is a real test, not a promise.
What it will not do is invent geometry. Holes are closed with flat patches, crossing triangles are reported but left alone, and nothing is scaled or moved beyond the weld distance you set.
Key features
- A before and after table: open edges, non-manifold edges and vertices, edges wound the wrong way, degenerate and duplicate triangles, shells, inside-out shells, crossing triangle pairs, volume and bounding box
- Defect highlighting in the 3D view: red for open edges, orange for non-manifold edges, purple for crossing triangles
- Welding within a distance, consistent winding per shell, outward orientation by the sign of each closed shell's volume
- Hole filling by ear clipping with an optional size limit, and removal of tiny stray shells
The defects it counts and how each is fixed
STL stores loose triangles, so a vertex shared by six triangles is stored six times. The page first merges only vertices with identical coordinates to count honest open edges; the repair then welds within the distance you choose, which is why an STL with microscopic gaps shows hundreds of open edges before and none after.
Units are whatever the file uses. Volume and weld distance are reported in those units; STL and OBJ files carry none, so the numbers are millimetres only if your model was built in millimetres. 3MF files state their unit and are converted to millimetres on reading.
How it works
Edges are counted per triangle pair. One user means an open edge, three or more a non-manifold edge, and two users traversing the edge in the same direction mean the faces disagree about which way is out. Shells are found by walking shared edges, and each closed shell's signed volume says whether it points inward.
Winding is fixed by a breadth-first walk from one triangle per shell, flipping each neighbour that traverses a shared edge in the same direction. Boundary loops are then chained and closed by ear clipping on a plane through the loop, taking at each step the ear with the best minimum angle.
Crossing triangles are found with a bounding-volume tree and edge-against-triangle tests; triangles that share a vertex are skipped, and the search stops at a work limit, marking the count as a lower bound.
The result goes to manifold-3d 3.5.4, served unchanged from this site. If it builds a solid, the volume it reports is shown beside yours.
Common use cases
- A print fails with 'non-manifold geometry' at layer 0: the report shows 12 orange edges where two parts were exported touching along an edge, and which of them to separate in the source model.
- A photogrammetry scan arrives with 3,100 open edges around the base and a few floating fragments: weld at 0.05 units, fill holes up to 800 edges, and drop shells under 0.1% of the largest.
- A model downloaded as OBJ prints inside out in the slicer: the report lists one inside-out closed shell, and the repair turns it outward by its negative volume.
- A cube exported with its top face missing shows 4 open edges; the repair adds back two triangles and the volume returns to exactly 1,000 for a 10-unit cube.
How to use this tool
- Drop an STL, OBJ, PLY or 3MF file (up to 1,000,000 triangles).
- Read the Before column and look at the red and orange edges in the left view.
- Choose the repair steps and a weld distance, then press Repair.
- Compare the After column and download STL, 3MF or OBJ.
Example
A 24-sided cylinder, radius 5, height 10, with both ends open (generated for the check, so illustrative)
Default steps: weld 0.001, remove degenerate and duplicate triangles, fix winding, fill holes up to 500 edgesReport after repair
Before: 48 triangles, 48 open edges, volume 517.64. After: 92 triangles, 0 open edges, volume 776.4571 (the 24-gon prism's exact volume is 776.4571), accepted by manifold-3d.Common pitfalls
A hole is closed with a flat patch of triangles and no new vertices, so a hole in a curved surface becomes a flat spot. Fill large holes in a sculpting tool instead.
A closed shell with negative volume that sits inside a larger shell is treated as a cavity and left alone, using bounding boxes as the test. Odd nesting can fool it.
Shells with open edges count as zero volume for the small-shell filter, so they are never removed by it.
- Set the weld distance well below your thinnest wall; a distance as large as the wall would merge its two faces.
- Check the crossing-pairs line first: hole filling cannot help a model whose problem is overlapping parts.
Common errors and how to fix them
- The report still shows non-manifold edges after repair
- Three or more faces share an edge, usually where two bodies touch. This page marks them but does not split them; separate the bodies in your modelling tool.
- manifold-3d does not accept the result
- Look for red or orange edges in the After view; they mark what is left. Open loops longer than your hole limit or pinched vertices are the usual cause.
Best practices
- Keep the original file and save the repaired copy under a new name.
- Run a repaired part through your slicer's preview before a long print, since the slicer has the final say on what it can print.
- Prefer 3MF for the repaired output when your slicer reads it, because it keeps units.
Frequently asked questions
Does it change my model's size or position?
No scaling or recentring happens. Welding can move a vertex by at most the weld distance, and the report prints the bounding box before and after so you can check.
What does a watertight result require here?
Three things must agree: zero open, non-manifold and wrongly wound edges in the After column, no inside-out closed shell, and manifold-3d building a solid from it. If one disagrees the page says so.
Why are crossing triangles reported but not fixed?
Fixing intersections means deciding which surface wins, which needs a boolean operation on a solid that is already valid. A model with many crossings usually needs remeshing in a sculpting or CAD tool.
What are the limits on size?
Files up to 1,000,000 triangles and 80 MB. The checks run in a worker, so the page stays responsive, and Cancel stops a run.