The 3D version of this simulation runs the chaos game inside a regular tetrahedron: starting from the centroid, each step jumps a fraction r of the remaining distance toward a randomly chosen one of the four corners. After enough steps, the accumulated point cloud converges onto the 3D Sierpinski fractal — the attractor of four contraction maps.
This 2D companion doesn't re-derive that shape by flattening it — that's already covered by the 2D vertex chaos game elsewhere on the site. Instead it does something only possible because the original is 3D: it cuts a plane through the tetrahedral point cloud and projects only the points that fall within a thin slab around that plane onto a flat 2D canvas.
- Slice height — moves the cutting plane from the tetrahedron's apex to its base along the tilt axis.
- Slice tilt — rotates the plane's normal from perfectly horizontal (0°) toward vertical (90°), changing which family of cross-sections you see.
- Slice thickness (ε) — how far from the exact plane a point can be and still count as "in" the slice; thinner reveals finer structure but needs a denser cloud.
- Jump ratio r — the contraction fraction per chaos-game step; r=0.5 gives the exact self-similar Sierpinski tetrahedron, other values distort or thicken it.
- Forbid repeat vertex — excludes the corner used on the previous jump from the next random pick, changing the correlations in the point cloud and therefore the cross-sections cut through it.
At r=0.5, tilt=0° and roughly mid-height, the horizontal cross-section of a Sierpinski tetrahedron is a well-known curiosity: a hexagram (Star-of-David) outline made of small triangular clusters, not the plain triangle you might expect. Sweep the height slider slowly through the middle to watch it appear and dissolve.
pₙ₊₁ = pₙ + r · (vertex − pₙ) (3D chaos game)
d = p · n̂ − h (signed distance to slice plane)
keep p if |d| < ε, project onto (û, v̂) ⟂ n̂