Each iteration replaces every solid square with 8 smaller squares at 1/3 scale (removing the center), building a Sierpinski carpet — the 2D face of the Menger sponge. Counting how the number of pieces N grows as the ruler size s shrinks gives the fractal (box-counting) dimension.
N(k) = 8^k (pieces after k iterations)
s(k) = (1/3)^k (size of each piece)
D = log(N) / log(1/s) = log(8) / log(3) ≈ 1.893
- Iteration depth — how many times the subdivision rule is applied; higher depth = finer, more detailed carpet (and slower to render).
- Explode factor — pushes sub-squares apart radially so the recursive, self-similar structure is easier to see.
- Pulse speed — gentle breathing animation for inspecting scale.
Real application: box-counting dimension quantifies roughness of coastlines, porous rock, retina vasculature, and fracture surfaces — anywhere a shape is "between" 1D and 2D.