Dror Bar - Natan: Classes: 2007-08: Geometry and Topology:

Shadows of the Cantor Aerogel

GraphicsGrid[Partition[Table[
ArrayPlot[Table[
If[MemberQ[IntegerDigits[x, 3]~Union~IntegerDigits[y,3],1], 0, 1],
{x, 0, 3^n-1}, {y, 0, 3^n-1}
]],
{n, 1, 6}
], 3]]

CC[0]=Line[{{0,0}, {1,1}}];
Graphics[CC[0]]

Evolve[Line[{a_, b_}]] := Module[{v,n},
v=b-a; n={-v[[2]], v[[1]]};
{
Line[{a, a+v/3}], Line[{a+2v/3, b}],
Line[{a+v/3+n/3, a+2v/3+n/3}],
Line[{a+v/3-n/3, a+2v/3-n/3
}]
}];
CC[n_] := CC[n] = CC[n-1] /. l_Line :> Evolve[l];
CC[1]

Graphics[CC[3]]

v={0.6, 0.8};
basepoints = Sort[Flatten[CC[3] /. Line[{a_, _}] :> a.v]]

Measure[b_, l_] := l+Sum[
Min[l, b[[i]]-b[[i-1]]],
{i, 2, Length[b]}
];
Measure[basepoints, v.{1,1}/3^3]

CCShadow[n_, t_] := Module[{v, basepoints},
v={Cos[t], Sin[t]};
basepoints = Sort[Flatten[CC[n] /. Line[{a_, _}] :> a.v]];
Measure[basepoints, v.{1,1}/3^n]
];
{CCShadow[3, 0], CCShadow[3,Pi/4]}

Plot[{CCShadow[1, t], CCShadow[2, t], CCShadow[3, t], CCShadow[4, t], CCShadow[5, t]}, {t, 0, Pi/2}, PlotRange -> {0, Sqrt[2]}]