How to repair a broken STL
An STL is a list of triangles and nothing else. Nothing in the format makes the triangles join up into a closed surface, so a file can look perfect in a viewer and still be broken in ways that make the slicer leave out walls, fill holes that should be open or skip whole layers. Most of these faults are easy to fix once you know which one you have.
What a valid mesh is
For a slicer, a good mesh is one closed surface, or several, that separates inside from outside without ambiguity. In practice that means three conditions:
- Closed. Every edge is shared by exactly two triangles. No holes, no loose borders.
- Manifold. No edge is shared by three or more triangles, and no two parts touch at a single vertex or along a single edge.
- Consistently oriented. Every triangle's normal, the direction the triangle faces, points outward, and neighbours agree on which side is outside.
A mesh that meets all three is called watertight: fill it with water and none would leak out. A simple count shows why the conditions are strict. In a closed triangle mesh each triangle has three edges and each edge belongs to two triangles, so the number of edges must be exactly 1.5 times the number of triangles. A cube has 12 triangles and 18 edges. One missing triangle, one doubled face or one gap where two corners almost meet breaks that balance, and somewhere the slicer no longer knows which side is inside.
The format makes this easy to break. An STL stores each triangle with its own copy of its three corner points; nothing records that two triangles share an edge. Programs that read STL rebuild the connections by matching coordinates, and corners that differ by a tiny rounding error do not match, which leaves a hairline crack.
The errors, one by one
| Error | What it is | Typical cause | What you see after slicing |
|---|---|---|---|
| Open edges, holes | Edges with only one triangle | Deleted faces, 3D scans, lost precision in conversion | Missing wall sections, gaps in top surfaces, or nothing at all on some layers |
| Flipped normals | Single faces pointing inward | Edits in mesh tools, mirrored parts | Often nothing; sometimes small missing areas |
| Inside-out shell | All faces of a part point inward | Mirroring without flipping the faces | The part may be treated as empty, or as a hole in another part |
| Non-manifold edges | Edges with three or more triangles | Parts placed against each other but not joined | Thin internal walls, or gaps where the parts meet |
| Self-intersections | Surfaces passing through each other | Overlapping shells, such as a head pushed into a body | Usually fine; sometimes a void or doubled wall where they overlap |
| Stray shells | Tiny separate pieces | Scan noise, leftovers from editing | Specks printed in mid-air or extra travel |
| Internal shells | A closed shell inside another | Duplicated objects, hidden helper geometry | A cavity where the part should be solid, or an extra wall inside it |
| Zero-thickness surfaces | Single sheets with no volume | Game and animation models, flags, leaves, hair cards | The sheet is ignored and disappears |
| Degenerate triangles | Triangles with zero area, or duplicated triangles | Exporters, conversions | Usually harmless, but they break edge counts and some tools |
Multiple shells are not an error in themselves. A kit of parts in one file, or a model with a separate base, is meant to have several. They become a problem when they overlap badly or sit inside each other. To print the parts of a kit separately, take them apart with Split STL.
How to find out what is wrong
- Open it in a viewer. The STL viewer shows the size and triangle count. Check the size first: a model at 1/25 of its intended size has a unit problem, not a mesh problem; see scaling an STL. Faces that render dark, or that let you see into the model, may be flipped.
- Let a repair tool mark the edges. Repair STL draws open edges in red and other problem edges in orange, so you see whether the problem is one hole under the base or thousands of cracks all over the surface.
- Read the slicer's warnings. Slicers that repair on import usually mark the object and list what they changed. Treat a long list as a sign that the file needs a real repair.
- Check the layer preview. Step through the layers where the model is complex. Missing walls, a top surface with holes, or a layer that is suddenly empty all point to a mesh fault at that height. The slicer preview guide explains what to look for.
What slicers fix on their own, and what they do not
Slicers are tolerant because they have to be: many downloaded files are imperfect. PrusaSlicer, OrcaSlicer and Bambu Studio repair common errors when a model is imported and show that they did. Cura leaves the mesh as it is and handles faults while slicing, with options in its Mesh Fixes section such as Union Overlapping Volumes, Remove All Holes and Extensive Stitching.
What slicers generally handle well:
- small holes and hairline gaps,
- single flipped faces and duplicate triangles,
- overlapping shells, which are treated as one solid when the overlapping parts are closed themselves.
What they cannot fix, or fix differently from one program to the next:
- Large holes. Each layer's outline is closed with a straight line across the gap, which may or may not resemble the missing surface.
- Zero-thickness walls. There is no way to know how thick a sheet was meant to be, so it is dropped.
- Inside-out parts and internal shells. Depending on how a slicer decides what is inside, a shell inside another can turn into a cavity or vanish.
- Problems you need fixed in the file. A slicer repair applies only inside that slicer. Cutting, scaling, converting to STEP or sending the file to someone else all need a repaired file. The STL splitter and Cut STL, for example, can only fill cut faces on a closed mesh.
The repair order
The faults depend on each other, so the order matters. Automatic tools follow roughly this sequence, and it is the right one for manual work as well:
- Join corners that almost meet. Welding points within a very small distance, 0.01 mm or less, closes hairline cracks and turns thousands of open edges into a closed surface. Keep the distance small, or separate details start merging.
- Remove duplicate and degenerate triangles. They distort the edge counts that the next steps rely on.
- Make orientation consistent within each part, then turn whole parts that point inward the right way round.
- Fill the remaining holes. Only now are the true holes clear, and each one is closed along its border.
- Delete stray fragments if they are noise, not parts.
- Check again. A repaired part should report as watertight with a positive volume. If it does not, the remaining problem is one of the hard cases below.
Repair before anything else you do to the file. Resizing, cutting, compressing and converting all work better on a closed mesh, and some refuse to work without one.
When automatic repair is not enough
- Self-intersections that the slicer gets wrong. Merge the overlapping parts with a boolean union in a modelling program, so one closed surface remains.
- Zero-thickness surfaces. Give them thickness with a solidify or offset operation. Choose at least two line widths, 0.8 mm for a 0.4 mm nozzle, or the result will be too thin to print anyway.
- Large holes in curved surfaces. A flat patch over a missing part of a sphere looks wrong. Fill it in a modelling program and shape the patch to follow the surface.
- Scans and sculpts with many faults. A voxel remesh rebuilds the entire surface as a new watertight mesh. It removes every kind of error at once, at the cost of detail finer than the voxel size, and usually produces more triangles than needed, so reduce them afterwards.
Some files are not meant to be solids: a surface used only as a visual reference, or a cut-away display model. And a hollow part with an inner surface, such as a hollowed resin model, is a valid closed mesh with an internal shell, not a fault. Check what the author intended before filling or deleting anything.
Exporting files that do not need repair
- Join, do not just touch. Parts placed against each other produce non-manifold edges and coincident faces. Union them before export, or keep them clearly apart as separate bodies.
- Apply modifiers and transforms. In mesh programs, apply mirror, scale and other modifiers before export, and recalculate normals after mirroring.
- Export solids from CAD. CAD programs export closed meshes from solid bodies; surfaces and open sketches turn into the zero-thickness sheets that slicers drop.
- Use binary STL or 3MF. Text STL and repeated conversion between formats both add rounding, which is a common source of hairline cracks. For export resolution, see STL resolution.
- Check before you share. Run the export through a viewer or repair check once. A downloaded file deserves the same check; the free STL files guide lists what to look for before printing.
Frequently asked questions
What does non-manifold mean?
In a manifold mesh every edge is shared by exactly two triangles, so the surface is closed and has a clear inside. An edge used by only one triangle is an open edge, the border of a hole. An edge shared by three or more triangles is non-manifold, typically where two parts touch along an edge or a face. Both confuse the slicer about what is inside the part.
Can I print an STL that is not watertight?
Often, yes. Slicers close small holes and work around flipped faces on their own, and the print may be fine. Look at the slicer preview layer by layer: if every wall and top surface is there, the repair worked. If walls are missing or layers are empty, repair the file before slicing.
Why does my model look fine in the viewer but slice badly?
A viewer only draws the triangles. A slicer has to decide what is inside the surface, and that needs a closed mesh with consistent face directions. A tiny gap or a face pointing the wrong way is invisible on screen but can change the inside and outside on some layers.
Does repairing an STL change its shape?
A good repair keeps every existing triangle and only adds new ones to close holes, so small holes get small flat patches. Large missing areas are closed with a flat or slightly domed cap that may not match the original curve, and these may need finishing in a modelling program.
What is the best fix for a badly broken 3D scan?
Remeshing. A voxel remesh rebuilds the whole surface as a new closed mesh, which removes holes, intersections and stray pieces in one step. Choose a voxel size smaller than the finest detail you want to keep, for example 0.1–0.2 mm for a small figure, and compare the result with the original.