Sub topic 9
Manifold versus non-manifold meshes
We assume you know basic 3D coordinates, vectors, cross products, and Python lists. You should also know that a mesh stores vertices and faces, while an edge is the connection between two vertices.
A manifold mesh has a surface that behaves locally like a normal sheet. At every point, the nearby surface looks like a disk. On a surface with a boundary, it may look like a half-disk at the boundary. This rule makes the mesh predictable for modeling, shading, simulation, and manufacturing.
The edge test
For a polygon mesh, the simplest manifold test counts how many faces use each undirected edge.
| Faces using an edge | Meaning |
|---|---|
| 1 | Boundary edge |
| 2 | Normal interior edge |
| 3 or more | Non-manifold edge |
A closed manifold mesh has exactly two faces on every edge. A mesh can still be manifold with boundary edges, such as a flat sheet or an open cylinder. Therefore, “closed” and “manifold” are different properties.
- A closed mesh has no boundary edges.
- A manifold mesh has no edge shared by more than two faces and has a valid neighborhood around every vertex.
- A closed manifold mesh satisfies both conditions.
The following program reports the first two edge problems:
from collections import Counter
def edge_report(faces):
counts = Counter()
for face in faces:
for i, a in enumerate(face):
b = face[(i + 1) % len(face)]
edge = tuple(sorted((a, b)))
counts[edge] += 1
boundary = [edge for edge, count in counts.items() if count == 1]
non_manifold = [edge for edge, count in counts.items() if count > 2]
return boundary, non_manifold
faces = [
(0, 1, 2),
(0, 2, 3),
]
boundary, non_manifold = edge_report(faces)
print("Boundary edges:", boundary)
print("Non-manifold edges:", non_manifold)The two triangles form a square. Four edges appear once, so the surface has a boundary. The shared diagonal appears twice, so it is a valid interior edge.
What makes a vertex non-manifold?
The edge count does not detect every problem. Consider two closed cubes that touch at only one vertex. No edge is shared by too many faces, but the surface is still non-manifold. A small neighborhood around the touching vertex contains two separate surface pieces instead of one disk-like piece.
Other common causes include:
- Three sheets meeting along one edge.
- A face attached to the middle of another face's edge.
- A “bow-tie” vertex where face groups touch at one vertex but do not form one continuous ring.
- Internal faces left inside a solid.
- Duplicate vertices that should have been welded, or vertices welded when they should remain separate.
This diagram shows the difference between a valid shared edge and three faces meeting along one edge.
Why non-manifold geometry causes trouble
Different tools make different assumptions about surfaces. A renderer may still display a non-manifold mesh, but other operations can fail or produce ambiguous results.
- Normals and shading: several surface directions may meet without one clear local surface.
- Subdivision: the algorithm may create spikes, holes, or unexpected patches.
- Solid operations: volume, inside/outside tests, and Boolean operations become unclear.
- 3D printing: a slicer may not know which regions are solid.
- Simulation: collision and finite-element systems often require a clean manifold boundary.
A non-manifold mesh is not always useless. It can represent an intentional junction in a technical model. The important point is to know whether the next operation supports it.
Cleaning a mesh
When a checker finds a non-manifold edge, inspect the faces that use it. Common repairs are:
- Delete an accidental internal face.
- Separate intersecting shells instead of making them share an edge.
- Split a vertex where two surfaces should only touch visually.
- Remove duplicate or zero-area faces.
- Rebuild a T-junction so all affected faces share the same vertices.
Run the check again after each repair. Also check face winding, because two faces can share an edge with inconsistent directions even when the edge count is two.
Exercise
A mesh has no boundary edges, but one edge is used by three faces. Is it a closed manifold mesh?
Show answer
No. It is closed with respect to boundary edges, but the edge shared by three faces is non-manifold.