Sub topic 9
Reviewing Topology and Cleaning Up
This chapter covers the review pass after your Boolean cuts and Bevel modifier are in place. The prop looks right, but the mesh underneath may still contain stray vertices, flipped faces, or faces that cause shading errors. You will inspect the mesh, fix what matters, and decide what to leave alone.
It assumes you can already do the following:
- Move between Object Mode and Edit Mode.
- Select vertices, edges and faces.
- Work with the Mirror, Boolean and Bevel modifiers from the earlier chapters.
- Run short Python scripts from Blender's Scripting workspace.
What "clean" means for a hard-surface prop
Hard-surface topology is judged differently from character topology. A character mesh must deform, so you care about edge flow around joints. A prop that never bends only needs to meet these requirements:
- It shades correctly.
- It is watertight where it should be.
- It unwraps cleanly.
- It does not hide defects that will show up in a render or in another application.
Triangles and n-gons (faces with five or more sides) are therefore not automatically wrong. An n-gon on a flat panel face is harmless. A triangle on a curved, smooth-shaded surface often produces a visible pinch. Judge each one by where it sits.
| Problem | Typical source | Why it matters |
|---|---|---|
| Duplicate vertices | Boolean results, joined objects, mirror seams | Cracks in shading, broken selection, bad UV islands |
| Loose vertices and edges | Deleted faces, failed cuts | Stray points in export, extra bounds |
| Non-manifold edges | Open holes, internal faces, edges with 3+ faces | Problems in 3D printing, physics, some game engines |
| Flipped normals | Mirrored geometry, manual face edits | Dark or inverted faces, wrong backface culling |
| Triangles and n-gons on curved surfaces | Boolean cuts, bevel corners | Shading pinches, uneven subdivision or bevel results |
| Poles (vertices with 5 or more edges, or 3) | Bevel junctions, loop cut ends | Local shading distortion on smooth surfaces |
Choose when to review
Run this review at two points:
- After the Boolean cuts and before you finalise bevels. Booleans create the messiest geometry, and bevel results depend on clean input.
- After the bevel and shading are set, as a final check before UV unwrapping.
Reviewing earlier is cheap because the modifier stack is still editable. Once you apply modifiers, you can no longer change a cut's position or a bevel's width.
Inspect with the viewport tools
Start with the built-in tools before you write any script.
Statistics overlay
Open the Overlays popover in the 3D Viewport header and enable Statistics. It shows vertex, edge, face and triangle counts. In Edit Mode it also shows how many of each element are selected, which makes it a counter for the selection tools below.
The statistics reflect the evaluated mesh in Object Mode, so they include modifiers. In Edit Mode they describe the base mesh. A prop with a Mirror and a Bevel will show very different numbers in the two modes, which is expected.
Face Orientation
Enable Face Orientation in the Overlays popover. Faces that point outward are blue and faces that point inward are red. Colours can differ between versions or themes, so check against a face you know is correct. A hard-surface prop should be almost entirely one colour from the outside. A red patch means flipped normals. Fix it in Edit Mode by selecting everything and using Mesh > Normals > Recalculate Outside (Shift+N).
Select by trait
In Edit Mode, use Select > Select All by Trait:
- Non Manifold finds holes, internal faces and edges shared by three or more faces. Switch to edge select mode first. Mirror seams and intentional openings (an open-bottomed shell, for example) will also be selected, so you decide which ones are real defects.
- Faces by Sides selects triangles, quads or n-gons. Use "Greater Than" 4 to find all n-gons.
- Loose Geometry selects vertices and edges that do not belong to any face.
- Interior Faces finds faces fully enclosed by other geometry. Boolean operations on overlapping objects often leave these.
Press Alt+H to reveal anything hidden before you run these. Hidden geometry is not selected, and defects hidden behind the selection tools are a common reason a "clean" mesh fails later.
Fix the cheap problems first
The first fixes need no judgement, so do them first. Work on a mesh you can restore, either through Undo or a saved copy.
- Select everything (A), then Mesh > Clean Up > Merge by Distance. Keep the threshold small. The default of 0.0001 m is 0.1 mm in the millimetre scene from the units chapter, which is safe for most props. A larger value can collapse small bevel geometry.
- Mesh > Delete > Loose (or Mesh > Clean Up > Delete Loose) removes stray vertices and edges.
- Recalculate Outside for normals.
- Re-select non-manifold edges and inspect what is left.
Do these in order. Merging doubles first matters because many apparent "non-manifold" edges are two vertices sitting on top of each other.
Automate the audit with Python
Counting by hand gets tedious across several objects. The following script reports the main metrics for the active object. It reads the evaluated mesh, so it measures the result with modifiers applied. It does not change the scene.
import bpy
import bmesh
obj = bpy.context.active_object
if obj is None or obj.type != 'MESH':
raise RuntimeError("Select a mesh object first")
depsgraph = bpy.context.evaluated_depsgraph_get()
eval_obj = obj.evaluated_get(depsgraph)
mesh = eval_obj.to_mesh()
bm = bmesh.new()
bm.from_mesh(mesh)
bm.verts.ensure_lookup_table()
tris = sum(1 for f in bm.faces if len(f.verts) == 3)
quads = sum(1 for f in bm.faces if len(f.verts) == 4)
ngons = sum(1 for f in bm.faces if len(f.verts) > 4)
loose_verts = sum(1 for v in bm.verts if not v.link_edges)
loose_edges = sum(1 for e in bm.edges if not e.link_faces)
non_manifold = sum(1 for e in bm.edges if not e.is_manifold)
poles = sum(1 for v in bm.verts if len(v.link_edges) >= 5)
doubles = bmesh.ops.find_doubles(bm, verts=bm.verts, dist=0.0001)
duplicate_count = len(doubles["targetmap"])
volume = bm.calc_volume(signed=True)
print(f"Object: {obj.name}")
print(f"Faces: {len(bm.faces)} (tris {tris}, quads {quads}, ngons {ngons})")
print(f"Loose verts: {loose_verts}, loose edges: {loose_edges}")
print(f"Non-manifold edges: {non_manifold}")
print(f"Poles (5+ edges): {poles}")
print(f"Duplicate vertices: {duplicate_count}")
print(f"Signed volume: {volume:.6f} (negative suggests inverted normals)")
bm.free()
eval_obj.to_mesh_clear()Read the output in the system console or the Info editor, depending on how Blender was launched. Two cautions apply:
- The signed volume is only meaningful for a closed mesh. An intentionally open prop gives a number that tells you little.
- A non-zero non-manifold count is not automatically a failure. A shell with an open back has non-manifold edges by design.
Apply the fixes with a script
For repeatable cleanup on the base mesh, run the same operations from Python. The script leaves the object in Object Mode.
import math
import bpy
obj = bpy.context.active_object
if obj is None or obj.type != 'MESH':
raise RuntimeError("Select a mesh object first")
bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.mesh.reveal()
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.normals_make_consistent(inside=False)
bpy.ops.mesh.dissolve_limited(angle_limit=math.radians(1.0))
bpy.ops.object.mode_set(mode='OBJECT')dissolve_limited removes edges between faces whose angle is under the limit. At 1 degree it only removes edges that lie on a flat surface, such as leftover cut lines. Do not raise the limit on a model with curved surfaces. A larger angle starts flattening real shape.
Deal with triangles, n-gons and poles
Once the mechanical problems are gone, look at the face shapes that remain. Use the following rules.
- Flat surfaces: leave n-gons and triangles alone unless they cause a UV or shading problem. A flat n-gon shades correctly because every vertex shares the same normal direction.
- Curved surfaces with smooth shading: n-gons and triangles are the usual cause of pinching. Re-route the edges so the area is made of quads, or use Mesh > Faces > Triangulate and then Join into cleaner quads only where it helps.
- Bevel corners: where three bevelled edges meet, the Bevel modifier produces poles and small triangles. That is normal. It becomes a problem only when the surrounding shading looks wrong.
- Boolean boundaries: a Boolean often leaves a ring of n-gons around the cut. If the cut sits on a flat face, keep it. If it crosses a curved face, rebuild the surrounding loops by hand.
A practical test is to look at the shading in a Matcap or a strongly lit viewport, rotating the object. A defect that you cannot see from any angle is not worth fixing.
Decide what to apply
The modifier stack is the reason your model is easy to change. Applying modifiers freezes it. Use these guidelines:
| Modifier | Apply before UV unwrap? | Reason |
|---|---|---|
| Mirror | Usually yes | UV islands need real geometry, though you can also leave mirrored UVs overlapping on purpose |
| Boolean | Yes, if you need to edit the cut edges by hand | Otherwise the cut stays editable by moving the cutter |
| Bevel | Usually keep until the final export | Width and segment changes remain possible |
Applying a modifier from Python looks like this:
import bpy
obj = bpy.context.active_object
bpy.ops.object.modifier_apply(modifier="Mirror")Apply modifiers in stack order, from the top. Applying one that sits below another changes the result, and Blender warns that the modifier is not first. The operator also fails on objects that share mesh data with another object. Make the data single-user first, using Object > Relations > Make Single User > Object & Data.
Common errors
- Dark patches after Mirror: the mirrored half has flipped normals, often because the object has negative scale. Apply the scale with Ctrl+A and recalculate normals.
- Cracks along the mirror seam: the vertices on the centre line are not exactly at X = 0, so clipping and merging do not close them. Select them and set their X value to 0.
- Merge by Distance changes small details: the threshold is too large for the scale. Reduce it, or merge only the selected area.
- The audit script reports no duplicates but the seam is still open: the vertices are farther apart than the 0.0001 m search distance. Increase
distin small steps. - Non-manifold count stays above zero: check whether the openings are intentional before trying to remove them.
Exercise
You run the audit script on a closed prop and see "Signed volume: -0.004210". Name what this likely means, the viewport tool that confirms it, and the Edit Mode command that fixes it.
Show answer
The negative signed volume suggests the faces point inward, so the normals are inverted. The Face Orientation overlay confirms it by showing the outside faces in red instead of blue. In Edit Mode, select all and use Mesh > Normals > Recalculate Outside (Shift+N) to fix it.
Exercise
A Boolean cut across a curved, smooth-shaded panel leaves an n-gon ring that makes the shading pinch. Why is leaving the same n-gon ring on a flat panel acceptable, and what should you do on the curved panel?
Show answer
On a flat panel every vertex of the n-gon shares one normal direction, so shading stays correct. On a curved smooth-shaded surface the n-gon spans changing normals, which causes the pinch. Rebuild the surrounding edge loops into quads, either by re-routing edges by hand or by dissolving the ring and adding loop cuts, then re-check the shading.
Exercise
Why should you run Merge by Distance before selecting non-manifold edges, and why can a large merge threshold damage a model?
Show answer
Many apparent non-manifold edges are caused by two vertices sitting at the same position, and merging them removes those false reports so only real holes remain. A large threshold welds together vertices that belong to small real features, such as fine bevels or screw heads, and destroys them.