Roger Bagula
2007-09-07 18:17:41 UTC
I figured out how to use the Menger sponge program to give
Lauwerier's 3d von Koch.
Pictures:
http://profile.imeem.com/GUmj0c/photo/rhidP5F98h/
http://profile.imeem.com/GUmj0c/photo/oJx8SaGGpa/
Clear[pieces, menger]
(*from Hans Lauwerier, "Fractals, Endlessly Repeating Geometrical Figures",
Princeton Science Library, Page 129*)
pieces =
Join[{{0, 2, 2}, {4, 2, 2}, {2, 0, 2}, {2, 4, 2}, {2, 2, 0}, {2, 2, 4}},
Flatten[Table[{i, j, k}, {i, 1, 3}, {j, 1, 3}, {k, 1, 3}], 2]];
N[Log[Length[pieces]]/Log[5]]
2.1725022968909635`
menger[cornerPt_, sideLen_, n_] :=
menger[cornerPt + #1*(sideLen/5), sideLen/5, n - 1] & /@ pieces;
menger[cornerPt_, sideLen_, 0] :=
{EdgeForm[], Cuboid[cornerPt, cornerPt + sideLen*{1, 1, 1}]};
Show[Graphics3D[Flatten[menger[{0, 0, 0}, 1, 1]]], Boxed -> False]
Show[Graphics3D[Flatten[menger[{0, 0, 0}, 1, 2]]], Boxed -> False]
gr = Show[Graphics3D[Flatten[menger[{0, 0, 0}, 1, 3]]], Boxed -> False]
Show[gr, ViewPoint -> {2.367, 2.305, 0.730}]
Lauwerier's 3d von Koch.
Pictures:
http://profile.imeem.com/GUmj0c/photo/rhidP5F98h/
http://profile.imeem.com/GUmj0c/photo/oJx8SaGGpa/
Clear[pieces, menger]
(*from Hans Lauwerier, "Fractals, Endlessly Repeating Geometrical Figures",
Princeton Science Library, Page 129*)
pieces =
Join[{{0, 2, 2}, {4, 2, 2}, {2, 0, 2}, {2, 4, 2}, {2, 2, 0}, {2, 2, 4}},
Flatten[Table[{i, j, k}, {i, 1, 3}, {j, 1, 3}, {k, 1, 3}], 2]];
N[Log[Length[pieces]]/Log[5]]
2.1725022968909635`
menger[cornerPt_, sideLen_, n_] :=
menger[cornerPt + #1*(sideLen/5), sideLen/5, n - 1] & /@ pieces;
menger[cornerPt_, sideLen_, 0] :=
{EdgeForm[], Cuboid[cornerPt, cornerPt + sideLen*{1, 1, 1}]};
Show[Graphics3D[Flatten[menger[{0, 0, 0}, 1, 1]]], Boxed -> False]
Show[Graphics3D[Flatten[menger[{0, 0, 0}, 1, 2]]], Boxed -> False]
gr = Show[Graphics3D[Flatten[menger[{0, 0, 0}, 1, 3]]], Boxed -> False]
Show[gr, ViewPoint -> {2.367, 2.305, 0.730}]