Geometry vs topology, precisely
Geometry studies quantities that require a notion of distance or angle — lengths, curvature, area — preserved only by rigid motions (translation, rotation, reflection). Stretch a sphere into an ellipsoid and its curvature distribution changes completely, even though nothing was cut or glued. Topology studies quantities preserved by continuous deformation — stretching, bending, twisting — as long as the surface is never torn or distinct points glued together. Under this looser equivalence, a coffee mug and a donut genuinely are "the same": both are a solid with a single hole running through them, and one deforms continuously into the other.
Three kinds of maps form a strict hierarchy, each a special case of the next: isometry (preserves all distances — rigid motions plus reflections) ⊂ diffeomorphism (smooth bijection, preserves differentiable structure but can stretch distances) ⊂ homeomorphism (continuous bijection with continuous inverse — no tearing, no gluing, nothing else required). Geometric invariants are preserved only by isometries; topological invariants — Euler characteristic, genus, number of holes — survive the much larger class of homeomorphisms, which is exactly why they classify shapes "up to deformation."
The Euler characteristic
For any polyhedron, or any polygonal mesh dividing a surface into vertices, edges and faces, Euler's formula computes a single number from purely combinatorial data:
χ = V − E + F Cube: V=8, E=12, F=6 → χ = 2 Tetrahedron: V=4, E=6, F=4 → χ = 2 Every convex polyhedron is topologically a sphere → χ = 2, regardless of mesh resolution
This is the key insight: χ doesn't depend on how finely or coarsely a surface is triangulated, only on the underlying topological shape.
Genus and non-orientable surfaces
For a closed, orientable surface, χ relates directly to the genus g — the number of "handles" a loop of string can pass through without pulling back out. For a closed non-orientable surface built from k "cross-caps" (the local twist that creates a Möbius-strip-like patch), the formula shifts:
Orientable: χ = 2 − 2g sphere (g=0), torus (g=1), double torus (g=2)… Non-orientable: χ = 2 − k projective plane (k=1), Klein bottle (k=2)…
The Klein bottle (k = 2) has χ = 2 − 2 = 0 — the same Euler characteristic as the torus. That is not a contradiction: χ alone does not distinguish orientable from non-orientable surfaces, so orientability is needed as a separate invariant alongside χ to fully classify closed surfaces.
| Surface | χ | Genus | Orientable? |
|---|---|---|---|
| Sphere | 2 | genus 0 | Yes |
| Torus | 0 | genus 1 | Yes |
| Projective plane | 1 | 1 crosscap | No |
| Klein bottle | 0 | 2 crosscaps | No |
Gauss-Bonnet: curvature meets topology
The Gauss-Bonnet theorem is the single most striking bridge between geometry and topology: the total curvature spread across an entire closed surface is forced to equal a topological invariant, no matter how the surface is bent or stretched — ∫∫M K dA = 2πχ(M). Deform a sphere into a lumpy potato and the Gaussian curvature K varies wildly point to point, but the total integral stays locked at 4π. This is exactly why a sphere cannot be deformed into a torus without tearing — their curvature integrals differ and cannot change continuously — and why an orange peel can't be flattened without tearing (positive curvature has nowhere to go on a flat plane).
Why this matters for simulations
Beyond classroom curiosity, these invariants have concrete engineering uses in a WebGL/Three.js pipeline: mesh validation catches procedurally generated meshes with holes or non-manifold edges before they reach a physics solver; simplification/LOD algorithms must preserve χ to guarantee a decimated mesh is still topologically equivalent to the original; and marching-cubes isosurface extraction must reproduce the same topology (number of blobs, holes) regardless of grid resolution. A generated torus-like mesh that doesn't reliably report χ = 0 has a bug independent of any single vertex position.
Frequently asked questions
Why are a coffee mug and a donut topologically the same shape?
Topology only cares about properties preserved by continuous deformation — stretching and bending without tearing or gluing. A coffee mug and a donut are both a solid with exactly one hole running through it, and one can be continuously reshaped into the other, so they share the same genus (1) and Euler characteristic (0), making them homeomorphic even though their curvature and geometry are completely different.
Why do the torus and the Klein bottle have the same Euler characteristic?
χ alone does not fully classify closed surfaces. The torus is an orientable surface of genus 1, giving χ = 2 − 2(1) = 0. The Klein bottle is non-orientable, built from 2 cross-caps, giving χ = 2 − 2 = 0 by the separate cross-cap formula. Both land on χ = 0 by coincidence of two different formulas — you need orientability as a second invariant alongside χ to tell them apart.
Why does mesh-generation software check the Euler characteristic?
χ = V − E + F is computable from vertex/edge/face counts alone and is invariant under remeshing, so it works as a cheap sanity check that a procedurally generated mesh is a closed, watertight surface before it's handed to a physics or isosurface pipeline. A genus computed from g = (2 − χ)/2 that comes out non-integer or negative is a reliable sign of a non-manifold edge, an unwelded seam, or a hole that would otherwise make a rigid-body solver behave unpredictably.
Try it live
Everything above runs in your browser — open Topology Surfaces and explore genus, Euler characteristic and orientability interactively across the sphere, torus, Klein bottle and Möbius strip. Nothing is installed, nothing is uploaded.
▶ Open Topology Surfaces simulation