Sub topic 11
Core cleanup tools: Merge by Distance, Delete Loose, Recalculate Normals
This chapter assumes you can switch between Object Mode and Edit Mode, select vertices, edges and faces, and apply modifiers. It also assumes you know what a manifold mesh is and what a face normal is, from earlier chapters. Here you will learn the three tools you run first on almost any mesh that a boolean has touched, and the order to run them in.
Why these three tools come first
A boolean builds new geometry where two surfaces cross. Along the cut, it can leave behind three kinds of debris:
- Vertices that sit on top of each other but are not connected.
- Vertices or edges that belong to no face.
- Faces whose normals point the wrong way.
Each of these breaks a later step. Duplicate vertices make edges look closed when they are not. Stray vertices inflate selections and confuse measurements. Flipped normals make shading look inverted and make the next boolean give wrong results.
The three tools below fix these problems in a fixed order.
The order matters. Merging first connects geometry that was only touching. Deleting loose parts then removes only what is truly disconnected. Recalculating normals comes last because it works on the connected surface, and that surface only exists after the merge.
Merge by Distance
Merge by Distance fuses vertices that lie within a set distance of each other. Blender's older name for it was Remove Doubles, which you will still see in older tutorials and in the Python operator remove_doubles.
To run it in Edit Mode:
- Press
Ato select everything. If you select only part of the mesh, only that part is cleaned. - Open Mesh > Clean Up > Merge by Distance, or press
Mand choose By Distance. - Open the Adjust Last Operation panel at the lower left to change the settings.
The panel has these options:
| Option | Meaning |
|---|---|
| Merge Distance | Vertices closer than this value are merged. The default is 0.0001 m. |
| Unselected | Merges selected vertices into nearby unselected ones, so the unselected geometry does not move. |
| Sharp Edges | Keeps sharp edges as they are while merging, so the merge does not alter your hard-edge markings. |
After the operation, the status bar or the Info editor reports how many vertices were removed. Zero is a useful answer too, because it tells you duplicates were not your problem.
Choosing the distance
The Merge Distance is measured in the object's local units, before object scale is applied. If the object has an unapplied scale of 100, a distance of 0.0001 acts like 0.01 in the world. This is one reason the earlier chapter asks you to apply scale before any boolean.
Start with the default. Raise it only when you can see gaps that are real but tiny, for example 0.001 for geometry that was imported from CAD. A distance that is too large collapses fine detail, such as the corners of small bevels. You can check this by watching the removed-vertex count. If it is far larger than the number of seams you expected, undo and use a smaller value.
Delete Loose
Delete Loose removes geometry that is not connected to any face. Typical examples are an isolated vertex left over after a boolean, or a lone edge that belonged to a deleted face.
Open Mesh > Clean Up > Delete Loose. The Adjust Last Operation panel offers three checkboxes:
- Vertices: delete vertices with no edges. On by default.
- Edges: delete edges with no faces. On by default.
- Faces: delete faces with no edges that are shared with other faces. Off by default.
Leave Faces off unless you know you want it. A face with no neighbours can be a real part of your model, such as a single plane used as a decal.
If you want to look before deleting, use Select > Select All by Trait > Loose Geometry first. This selects the same elements without removing them, so you can inspect and decide. It is the safe way to learn what your boolean is leaving behind.
Delete Loose does not remove whole disconnected objects that are themselves closed shells, such as a small floating cube inside your model. Those are connected to their own faces, so they count as valid geometry. To find them, hover over the mesh and press L to select linked geometry, or use Separate by Loose Parts (P) and look at the resulting objects.
Recalculate Normals
Recalculate Normals makes the face normals of each connected piece point consistently outward. It works from the geometry itself, not from the current normals, so it can repair faces that point inward.
In Edit Mode, select the faces you want to fix, normally everything with A, and then press Shift+N. The menu path is Mesh > Normals > Recalculate Outside. The shortcut Ctrl+Shift+N runs Recalculate Inside, which makes the normals point inward. You rarely want that, except for something like the inside of a room.
Seeing what is wrong first
Do not guess which faces are flipped. Turn on one of two overlays:
- Overlays > Face Orientation: front faces turn blue, back faces turn red. A clean closed solid is all blue from outside. In Blender 4.2 and later, this overlay is found in the Overlays popover.
- Overlays > Mesh Edit Mode > Normals: draws a short line from each face. Lines pointing into the object mark flipped faces.
If only a few faces are red, you can select them and use Mesh > Normals > Flip instead of recalculating everything.
When Recalculate Normals fails
Recalculate decides "outside" by looking at the mesh's own shape. It can get this wrong in these cases:
- Open or non-manifold meshes. If the surface has holes, "outside" is ambiguous, and results can be inconsistent. Fix the holes first.
- Intersecting shells. Where one shell passes through another, the algorithm may treat the inner shell as outside. Separate the shells with
Pand recalculate each one. - A whole object flipped. The command can sometimes make a closed object point inward when its geometry is unusual. Check with Face Orientation afterwards. If the whole thing is red, run Flip on all faces.
A complete first pass, step by step
Here is the whole routine on an object with a freshly applied boolean:
- Select the object, enter Edit Mode with
Tab, and pressA. - Turn on Overlays > Statistics so you can see the vertex count.
- Run Merge by Distance and note how many vertices were removed.
- Run Delete Loose with Vertices and Edges checked.
- Switch on Face Orientation, then press
Shift+N. - Run Select > Select All by Trait > Non Manifold (Vertices, Edges, Faces options default to a sensible set for solids). If anything stays selected, the mesh still has a problem, and the next chapter handles it.
You can do the same thing from Python. This script uses the operators you just learned, so it behaves exactly like the menu commands.
import bpy
obj = bpy.context.active_object
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.remove_doubles(threshold=0.0001)
bpy.ops.mesh.delete_loose(use_verts=True, use_edges=True, use_faces=False)
bpy.ops.mesh.select_all(action='SELECT')
bpy.ops.mesh.normals_make_consistent(inside=False)
bpy.ops.object.mode_set(mode='OBJECT')
print(f"{obj.name}: {len(obj.data.vertices)} vertices after cleanup")The script needs an active mesh object, and a 3D viewport is not required because these operators run in Edit Mode on the active object.
Common errors
- Cleaning in Object Mode only. These tools are Edit Mode operators. Applying a modifier does not run them for you.
- Nothing happens. The elements may not be selected. Merge by Distance only affects the selection.
- Details disappear after merging. Your Merge Distance is larger than the smallest feature. Undo and lower it.
- Normals still look wrong. You may be seeing smoothing problems, not orientation problems. Check Face Orientation before changing normals.
- Boolean still fails after cleanup. The mesh may be non-manifold in a way these three tools do not touch, such as holes or edges shared by three faces.
Exercise
After a Difference boolean, your object has a handful of vertices floating near the cut, and one patch of faces looks red under the Face Orientation overlay. Which tools do you use, in which order, and why does the order matter?
Show answer
Run Merge by Distance first, so touching vertices become connected. Then run Delete Loose to remove the vertices that are still unattached, so you only delete what is truly disconnected. Finally, run Recalculate Normals (Shift+N) so the red patch is reoriented, because normals can only be calculated consistently once the surface is connected. Recheck with Face Orientation and Select Non Manifold afterwards.
Exercise
You run Merge by Distance with a Merge Distance of 0.01 on a model with small bevels, and the bevels collapse. What went wrong, and what should you do?
Show answer
The Merge Distance was larger than the spacing between the bevel's vertices, so Blender treated those vertices as duplicates and merged them. Undo the operation, then rerun it with a smaller distance, starting from the default 0.0001. Also check that the object's scale is applied, because the distance is measured in local units.