Sub topic 1
Mesh anatomy: vertices, edges and faces
Every boolean problem you meet later in this tutorial comes back to the structure of the mesh. Flipped normals, holes, doubled vertices and n-gon clutter are all statements about how three kinds of element connect. This chapter gives you the vocabulary and a way to inspect those elements, both in the viewport and from Python.
Prerequisites
This chapter assumes you can:
- Navigate the 3D viewport and switch between Object Mode and Edit Mode.
- Select, move, rotate and scale vertices, edges and faces.
- Add a modifier from the Properties editor and apply it.
You don't need any scripting experience for the main text. The final code example is optional, but it uses only a few lines of Python.
The three elements
A Blender mesh stores its shape as three kinds of element:
- A vertex is a single point in 3D space, stored as an X, Y, Z coordinate.
- An edge is a straight line connecting exactly two vertices.
- A face is a closed loop of three or more edges that is filled in to form a surface.
Each element depends on the one below it. A face needs edges, and an edge needs vertices. The reverse is not true. A vertex can exist with no edges, and an edge can exist with no face. These leftover pieces are the source of many boolean failures.
The default cube shows the relationship. It has 8 vertices, 12 edges and 6 faces. Each vertex touches 3 edges, and each edge is shared by exactly 2 faces. That second fact is what makes the cube a solid, closed shape, and the chapter on manifold meshes builds on it.
Selection modes and the statistics overlay
In Edit Mode you choose which element type you work with:
| Mode | Key | You select | Typical use in boolean work |
|---|---|---|---|
| Vertex | 1 | Single points | Finding stray or doubled vertices |
| Edge | 2 | Lines between vertices | Checking boundary edges and loops |
| Face | 3 | Filled surfaces | Selecting n-gons or faces to delete |
Selection mode changes what is selected, but the mesh data stays the same. Selecting two faces in Face mode also selects their vertices and edges.
To see exact counts, open the Overlays popover in the viewport header and enable Statistics. The viewport then shows how many vertices, edges, faces and triangles the object has. In Edit Mode it also shows how many of each are selected. Watch these numbers when you clean up a mesh. For example, if Merge by Distance reports that it removed vertices, the vertex count should drop by that amount.
Face types: triangles, quads and n-gons
Faces are named by their number of sides:
- A triangle has 3 sides. It is always flat, because three points define a plane.
- A quad has 4 sides. It is the usual building block for modelling, because quads deform and subdivide predictably.
- An n-gon has 5 or more sides.
Blender stores n-gons without trouble, and they are fine on flat surfaces. Problems appear when an n-gon is non-planar, meaning its vertices don't all lie on one plane. A non-planar n-gon has to be split into triangles to display and to compute booleans, and the way it is split can change the surface slightly. The Exact boolean solver triangulates internally. Large non-planar faces are therefore a common source of surprising results.
Loops, the hidden fourth element
Internally, Blender also stores loops, sometimes called face corners. A loop represents one corner of one face. A quad has four loops. Vertices and edges are shared between faces, but loops are not. Data that can differ from face to face at the same vertex lives on loops. This includes UV coordinates, vertex colours and custom split normals.
This matters for cleanup. When you merge two vertices, their loops stay with their faces. Smooth or sharp shading depends on loop data, which is why shading can look wrong after a boolean even when the geometry is correct. The chapter on shading cleanup covers the fix.
Common defects at each level
Most mesh problems can be described as a defect at one level:
| Level | Defect | What it looks like |
|---|---|---|
| Vertex | Duplicate vertices | Two vertices at the same position that are not connected, so the surface has an invisible seam |
| Vertex | Loose vertex | A point with no edges, visible only when selected |
| Edge | Zero-length edge | Two joined vertices at the same location |
| Edge | Loose (wire) edge | An edge that belongs to no face |
| Edge | Edge with 3 or more faces | Several surfaces meeting along one line, with no clear inside |
| Face | Zero-area face | A face collapsed to a line or point |
| Face | Duplicate face | Two faces occupying the same vertices |
| Face | Non-planar n-gon | A bent face that triangulates unpredictably |
Duplicate vertices are the hardest to spot, because the mesh looks fine. Two cubes that appear joined may still be separate surfaces. Boolean solvers and edge-based tools treat the two vertices as unrelated. The Merge by Distance tool, covered in a later chapter, finds and fixes them.
Local coordinates and object transforms
Vertex positions are stored in the object's local space. The object's location, rotation and scale then place it in the scene. A vertex at (1, 0, 0) on an object scaled by 2 appears at world X = 2.
This is why scale needs attention before a boolean. Operations that use distances, such as a merge threshold of 0.0001 units, work on local coordinates. If an object has a scale of 100, a distance that is tiny in local space is large in world space. The chapter on preparing objects shows how to apply scale.
Inspecting a mesh from Python
The Statistics overlay shows totals. A script can go further and classify the elements. The example below reads the active object's mesh into a bmesh, which is an editable copy of the mesh data. It then counts faces by type and finds loose vertices, loose edges and over-shared edges.
import bpy
import bmesh
from collections import Counter
obj = bpy.context.active_object
if obj is None or obj.type != 'MESH':
raise RuntimeError("Select a mesh object first")
bm = bmesh.new()
bm.from_mesh(obj.data)
print(f"Vertices: {len(bm.verts)}")
print(f"Edges: {len(bm.edges)}")
print(f"Faces: {len(bm.faces)}")
sides = Counter(len(f.verts) for f in bm.faces)
tris = sides[3]
quads = sides[4]
ngons = sum(count for n, count in sides.items() if n > 4)
print(f"Triangles: {tris}, quads: {quads}, n-gons: {ngons}")
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)
print(f"Loose vertices: {loose_verts}")
print(f"Loose edges (no faces): {loose_edges}")
faces_per_edge = Counter(len(e.link_faces) for e in bm.edges)
for count in sorted(faces_per_edge):
print(f"Edges shared by {count} face(s): {faces_per_edge[count]}")
bm.free()Run it in the Scripting workspace with a mesh object active and in Object Mode. For the default cube it prints 8 vertices, 12 edges, 6 faces, 6 quads, no loose elements, and 12 edges shared by 2 faces.
The last part of the output is the useful one. In a closed solid, every edge is shared by exactly 2 faces. Any edge shared by 0, 1 or 3 or more faces marks a spot where the surface is open or ambiguous. Later chapters use this check to define what makes a mesh manifold.
Practical habits
- Turn on the Statistics overlay whenever you clean a mesh, and compare counts before and after each step.
- Use the Euler check as a sanity test on simple closed shapes with no holes. Vertices minus edges plus faces equals 2. The cube gives 8 − 12 + 6 = 2. A mismatch means the shape has holes, handles or extra loose geometry.
- After joining or importing meshes, assume duplicate vertices exist until you have merged them.
- Switch between the three selection modes. Some defects are only visible in one of them.
Exercise
A student adds a cube and a UV sphere, joins them with Ctrl+J, and moves the sphere so it touches the cube. Statistics shows no loose vertices, yet the two shapes can still be pulled apart with no edge connecting them. Which element-level defect or condition explains this, and what do the faces-per-edge counts look like for edges where the shapes touch?
Show answer
Joining objects only combines their data into one mesh. It does not connect any vertices. Where the shapes touch, the vertices on each side are separate points that happen to be near each other, so they are unrelated to each other. No loose vertices appear because every vertex still belongs to an edge in its own shape. Each edge near the contact is still shared by exactly 2 faces of its own shape. The contact is only visual, and the shapes remain two separate surfaces in one mesh.
Exercise
A closed mesh has 14 vertices and 24 edges. Using V − E + F = 2, how many faces should it have, and what does a different count suggest?
Show answer
F = 2 − V + E = 2 − 14 + 24 = 12 faces. A different count suggests the mesh has holes, loose geometry, handles (like a torus), or multiple separate shells, since the formula only holds for a single closed shape with no holes.