Math
Vertices, edges, faces
A solid body of a few dozen faces, and V − E + F read off it after every edit: triangulate a face, put a vertex in it, split or erase an edge, cut a face out, refine them all - a ledger shows what each does to V, E and F and that χ moves only when a hole is cut. The genus comes from χ with its conditions stated: how many pieces, how many boundary loops, orientable or not - on a Möbius band the formula gives cross-caps instead.

What happens
Count the corners, edges and faces of a solid: V − E + F. On a block it is 2; drill a tunnel through it and the answer is 0; two tunnels, −2. The number does not care how the surface is cut into faces - triangulate a face, put a vertex in it, split an edge, erase one, refine everything, and V, E and F all move while their alternating sum stands still. Only cutting a face OUT changes it, by one. But χ alone is not the shape: the genus follows from it only once the pieces and the boundary loops are counted and the surface is orientable - a torus and a cylinder share χ = 0, and a Möbius band is neither.
Equations used in the module
Equations χ = V − E + F orientable, c pieces, b boundary loops: χ = 2c − 2g − b not orientable: χ = 2c − k − b (k cross-caps) triangulate an n-gon: ΔE = ΔF = n − 3; vertex in a face: ΔV = 1, ΔE = n, ΔF = n − 1 split an edge: ΔV = ΔE = 1; erase an edge: ΔE = ΔF = −1; cut a face out: ΔF = −1, Δχ = −1


