Count the corners, edges and faces of ANY map drawn on a shape and combine them as V − E + F — you always get the same number, no matter how you draw it. On a sphere it’s 2. On a doughnut it’s 0. That single number counts the holes: the torus has one, so its Euler characteristic is 0. Slide the mesh finer — V, E and F all change, but V − E + F does not.
Euler’s formula: for any polygonal mesh on a surface, V − E + F is a topological invariant — the Euler characteristic χ, independent of the mesh. For a sphere χ=2; for a genus-g surface χ = 2 − 2g, so the torus (one hole, g=1) has χ=0. On an m×n grid wrapped around the torus every vertex has degree 4, giving V=mn, E=2mn, F=mn, hence V−E+F = mn − 2mn + mn = 0 for ALL m,n. A fail-loud self-check throws unless V−E+F=0 across several resolutions. Refine the mesh and the three counts explode while their alternating sum stays pinned at 0. ◆ real topology, node-verified.
Computed on a clean quad-grid torus; the invariant is exact and mesh-independent (that is the whole point). Genus = holes via χ = 2 − 2g is the classical classification of closed orientable surfaces.