Rotating polyhedra · Live vertex/edge/face counts · Genus-g surfaces
Euler's formula states that for any convex polyhedron, the number of vertices minus the number of edges plus the number of faces always equals 2: V − E + F = 2. This holds for the tetrahedron (4 − 6 + 4 = 2), the cube (8 − 12 + 6 = 2), and every other simply-connected polyhedron, no matter how many faces it has or what shape they are — it is a topological invariant, unaffected by stretching, bending or the exact geometry, only by the underlying connectivity.
The quantity χ = V − E + F is called the Euler characteristic, and it generalises far beyond polyhedra: it classifies closed surfaces by their genus g (the number of "handles" or holes), via χ = 2 − 2g. A sphere (g = 0) has χ = 2; a torus/doughnut (g = 1) has χ = 0; a two-holed surface (g = 2) has χ = −2. This turns a purely combinatorial count into a powerful tool for distinguishing fundamentally different shapes.
Euler's formula, published by Leonhard Euler in 1758, was one of the first results in what became topology — the study of properties preserved under continuous deformation. It explains why there are exactly five Platonic solids (the constraint V − E + F = 2 combined with regularity leaves only five valid combinations), and its generalisation, the Euler characteristic, underlies the classification of all closed surfaces, modern mesh-processing algorithms in computer graphics, and even Gauss–Bonnet-type theorems linking curvature to topology.
This simulator renders eight convex polyhedra as rotating wireframes using a hand-rolled 3D-to-2D projection, counting each shape's vertices, edges (derived by de-duplicating every face's boundary segments) and faces to compute the live Euler characteristic χ = V − E + F. A ninth mode shows a schematic genus-g surface where χ = 2 − 2g.
Each solid's vertex coordinates and face-vertex lists are defined exactly (the dodecahedron is generated as the true geometric dual of the icosahedron, and the truncated cube from the standard vertex-truncation construction). Edges are derived automatically from the faces, so V, E and F are genuine counts, not hard-coded numbers.
Pick a shape from the dropdown. Drag the canvas to rotate it manually, or toggle Auto-rotate and adjust Speed. In Genus-g Surface mode, move the Handles slider from 0 to 5 to watch the schematic diagram gain handles and χ = 2 − 2g shift from 2 down to −8.
The constraint V − E + F = 2, combined with the requirement that every face and vertex look identical, restricts regular convex polyhedra to exactly five possibilities — the Platonic solids known since antiquity.
Because every convex polyhedron is topologically equivalent to a sphere: you can inflate its surface into a ball without tearing it. Euler proved that any way of dividing a sphere's surface into polygons (vertices, edges, faces) always satisfies V − E + F = 2, regardless of the specific shapes used.
Rather than hard-coding golden-ratio coordinates, the simulator builds the icosahedron first, then computes its geometric dual: each dodecahedron vertex is the centroid of an icosahedron face, and each dodecahedron face corresponds to an icosahedron vertex, with its edges ordered by angle around that vertex.
A torus (doughnut shape) is not topologically a sphere — it has one handle, or genus 1 — so its Euler characteristic is χ = 2 − 2(1) = 0. Any polygon mesh drawn on a torus's surface will satisfy V − E + F = 0, not 2, no matter how it is subdivided.
Each of the cube's 8 corners is sliced off by a small plane, turning every corner into a triangle and every square face into an octagon. The simulator places truncated vertices at (±ξ, ±1, ±1) and permutations, with ξ = √2 − 1, then reconstructs the 8 triangular and 6 octagonal faces from that vertex data.
Because χ is a topological invariant, it lets mathematicians tell surfaces apart without measuring angles or lengths — a sphere, torus and double torus have different χ values (2, 0, −2) no matter how they are stretched or bent, which makes χ a foundational tool in topology, computer graphics mesh analysis and theoretical physics.