← Back to Labs

Sierpinski Carpet — 3D Fractal

n = 3
depth = 20

Sierpinski Carpet: Fractal Dimension and Self-Similarity

The Sierpinski carpet is constructed by dividing a square into a 3×3 grid and removing the center, then recursively applying this to each remaining subsquare. After n iterations, 8ⁿ squares remain of side length (1/3)ⁿ each.

Hausdorff dimension: d_H = log(8) / log(3) ≈ 1.8928

This is between 1D (a line) and 2D (a filled square) — a fractional dimension. The limiting set has Lebesgue measure zero (area → 0 as n → ∞), yet is topologically connected and locally connected. Every compact metric space of topological dimension 1 embeds homeomorphically into the Sierpinski carpet (it is the "universal" 1-dimensional planar compact set).

The 3D extrusion (Menger sponge variant) has dimension log(20)/log(3) ≈ 2.727 for the sponge itself. Drag to rotate the view.