Spiralyst Lab logo Spiralyst Lab ← All fractals 3D · orbit

3D fractal

Menger sponge

Live turntable captured from Spiralyst Lab.

The Menger sponge is a cube recursively drilled with square holes on every face until it reaches the paradox of infinite surface area enclosing zero volume. It is the purest geometric lattice in the gallery, its faces forming Sierpinski carpets and its edges forming Cantor sets.

Infinite Surface, Zero Volume

The Menger sponge, described by Karl Menger in 1926, is the three-dimensional big sibling of the Cantor set and the Sierpiński carpet. Take a cube, divide it into a 3×3×3 grid of 27 smaller cubes, and remove the center cube of every face plus the one in the very middle — seven cubes gone, twenty remaining. Now do the same to each of those twenty, and to each of theirs, forever.

The limit is a paradox you can hold in your mind: it has infinite surface area but encloses zero volume. It is drilled so thoroughly that its fractal dimension is about 2.727 — more than a surface but less than a solid. Its faces are exactly Sierpiński carpets and its edges are Cantor sets, so the sponge contains both of those lower-dimensional fractals inside itself.

Visually it is the purest geometric lattice in the gallery — all straight edges and square holes, recursion you can read at a single glance, with none of the organic ambiguity of the escape-time fractals.

keep 20 of 27 sub-cubes, then recurse

Each level subdivides every surviving cube into 27 and discards the seven 'face-center and center' cubes, leaving 20.

dimension = log 20 / log 3 ≈ 2.727

The Hausdorff dimension — twenty pieces, each one-third the size, gives a value between a surface (2) and a solid (3).

In Spiralyst Lab

Rather than build millions of literal cubes, Spiralyst Lab ray-marches an exact distance field that folds space and intersects the cube with the complement of three crossing bars at each level — the classic Inigo Quilez construction — so deep sponges stay fast. Iteration depth (3–6) is the only shape control; there is no power or bailout, just clean recursion. Orbit it with crisp lighting for that unmistakable lattice look.

Every parameter below is a live control — set it by hand, map it to a frequency band, or let it ride a smooth animation. These ranges are the actual in-app slider limits.

ParameterRange (in-app)
Iterations3 – 6
Surface ε0.0001 – 0.01
Ray steps32 – 256

Audio-reactive by default: iterations 3→6 (discrete), fov 0.8→1.6. Any control can be mapped to audio or animation.

Plus the universal 3D controls every ray-marched type shares: camera (yaw, pitch, distance, FOV) and lighting (light direction, ambient, fog density, glow falloff).

Menger sponge still 1 Menger sponge still 2 Menger sponge still 3

Watch it in action

Full-length showcase video — coming soon
assets/video/fractals/17-menger.mp4

Did you know: The Menger sponge contains copies of two other famous fractals: every face is a Sierpiński carpet, and every edge is a Cantor set.

Get Spiralyst Lab — $24.99/yr ← Back to the gallery