Cube pyramid
Sándor Kabai
Cubes and rhombic dodecahedra are arranged in a pyramid.
In[]:=
Manipulate[​​Needs["PolyhedronOperations`"];​​cub=GraphicsComplex[PolyhedronData["Cube","VertexCoordinates"],Polygon[PolyhedronData["Cube","FaceIndices"]]];​​cubn=Truncate[Scale[Rotate[Rotate[cub,Pi/4,{0,0,1}],ArcTan[Sqrt[2]],{1,0,0}],Sqrt[2]],trunc];​​p=Table[{2j-i,Sqrt[3]i,0},{i,0,n},{j,i,n}];​​If[exchange,rdn=cubn];​​rd=GraphicsComplex[PolyhedronData["RhombicDodecahedron","VertexCoordinates"],Polygon[PolyhedronData["RhombicDodecahedron","FaceIndices"]]];​​rdn=Truncate[Scale[Rotate[rd,ArcTan[Sqrt[2]],{1,0,0}],Sqrt[3/2]],trunc];​​If[exchange,rdn=cubn];​​tri1=Map[Translate[rdn,#]&,p];​​sp=Sphere[{0,0,0},1.1];​​tri2=Rotate[tri1,-Pi/6,{0,0,1}];​​piramid=Table[Rotate[Rotate[tri2,-ArcTan[Sqrt[2]]-Pi,{0,1,0}],i2Pi/4,{0,0,1}],{i,4}];​​Graphics3D[{piramid},BoxedFalse,SphericalRegionTrue,ViewAngle0.12,ViewPoint{1,-10,3}],​​{{n,4,"Frequency"},1,10},​​{{trunc,0,"Truncate cube"},0,0.5},​​{{exchange,True,""},{False->"RD",True->"False"},ControlPlacementLeft,ImageSize->Tiny},​​TrackedSymbols{n,exchange,trunc}]
Out[]=
​
Frequency
Truncate cube
RD
False