Menger Sponge

Author

Eric W. Weisstein
January 20, 2017

This notebook downloaded from http://mathworld.wolfram.com/notebooks/Fractals/MengerSponge.nb.

For more information, see Eric's MathWorld entry http://mathworld.wolfram.com/MengerSponge.html.

©2017 Wolfram Research, Inc. except for portions noted otherwise

Graphics

V5

Show[Graphics3D[MengerFacade[2]],Boxed->False,ViewPoint->{-2,-2,0}]

Show[Graphics3D[MengerSponge[2]],Boxed->False]

V6

Show[Graphics3D[MengerSponge[2]],Boxed->False]

LiveGraphics3D

Do[
	WriteLiveForm["menger"<>ToString[i]<>".m",
		Show[MengerSponge[i,opts]]],
	{i,3}]

V11

rules={1->1-CrossMatrix[{1,1,1}],0->ConstantArray[0,{3,3,3}]};

RulePlot[SubstitutionSystem[rules]]

its=SubstitutionSystem[rules,{{{1}}},3];

Graphics3D[Raster3D[1-#]]&/@its

Image3D/@its

Image3D[1-#,ColorFunction->(GrayLevel[#,.5]&)]&/@its

Graphics3D[Cuboid/@Position[#,1],Boxed->False]&/@its

Graphics3D[{EdgeForm[None],Cuboid/@Position[#,1]},Boxed->False]&/@its

V11.1

GraphicsRow[Table[MengerMesh[n,3],{n,0,3}]]