Sub topic 4
Geometry versus topology: positions and connections
Prerequisites: you should know basic 3D coordinates (x, y, z), introductory dot and cross products, and how to read simple Python code.
A polygon mesh has two related but different descriptions:
- Geometry describes where the mesh elements are in space.
- Topology describes how those elements connect.
A vertex is a point with a position, such as (1, 0, 0). Positions are geometric data. A face is a polygon whose corners refer to vertices. The list of connections between those vertices is topological data.
The same topology can have different geometry
Imagine a cube. Its topology says that six faces connect eight vertices in a particular pattern. If you move one vertex upward, the cube becomes deformed, but its topology remains unchanged. The same faces still use the same vertices.
You can also change the geometry without changing the number of elements. A cube can become a rectangular box, a stretched box, or a rounded-looking low-resolution shape. As long as the connections stay the same, these shapes share the same topology.
The reverse is also possible. Two meshes can occupy similar locations but have different topology. For example, one surface might contain four large faces while another contains many smaller faces. Their geometry may look similar, but their connections differ.
| Description | Question it answers | Example |
|---|---|---|
| Geometry | Where are the points? | Vertex 3 is at `(0, 1, 0)` |
| Topology | Which points connect? | Face 2 uses vertices `(0, 1, 5, 4)` |
| Geometry and topology | What surface results? | A closed cube made from six faces |
An indexed representation
A common storage format is an indexed face set. It stores vertex positions once in a vertex list. Each face then stores indices into that list.
vertices = [
(0, 0, 0), # 0
(1, 0, 0), # 1
(1, 1, 0), # 2
(0, 1, 0), # 3
]
faces = [
(0, 1, 2, 3),
]
print(vertices[faces[0][2]]) # (1, 1, 0)The vertices list supplies geometry. The faces list supplies topology. The number 2 does not mean a position by itself. It means “use the position stored at index 2.”
This separation saves memory. If several faces meet at one corner, they can all refer to the same vertex entry. It also makes deformation efficient: changing one position updates every face that uses that vertex.
You can derive an edge from each consecutive pair of indices in a face. For (0, 1, 2, 3), the edges are (0, 1), (1, 2), (2, 3), and (3, 0). The final pair closes the polygon.
Why the distinction matters
Topology controls structural questions:
- Is the surface connected?
- Does an edge have one, two, or more neighboring faces?
- Is there a hole?
- Can a face be reached from another through shared edges?
Geometry controls spatial questions:
- How large is the object?
- Where is its center?
- Are faces flat or distorted?
- Do faces intersect after deformation?
A topologically valid mesh can still have bad geometry. Vertices might overlap, faces might cross, or a face might have zero area. A geometrically plausible shape can also have bad topology, such as a missing connection or an edge shared by too many faces.
Vertex identity is not only position
Two vertices can occupy the same coordinates but remain different topological vertices. Conversely, one topological vertex can have additional attributes, such as a normal or UV coordinate, that vary by face corner.
This matters at sharp edges and UV seams. A renderer may need to split one geometric corner into multiple render vertices so that each copy can have a different normal or texture coordinate. The visible positions remain equal, but the attribute data differs.
Exercise
A mesh keeps its face index lists unchanged while every vertex position is scaled by 2. Did its topology change? Why?
Show answer
No. Scaling changes the geometry because it changes positions, but the connections between vertices and faces remain unchanged.