Pyramid made of polygonal slabs
Sándor Kabai
Polygonal slabs are placed on one another to create a pyramid. The polygon, the thickness of slabs and the frequency can be varied.
In[]:=
Manipulate[Module[{},​​f1=Polygon[Table[{Sin[i2Pi/n],Cos[i2Pi/n],thick},{i,n+1}]];​​f2=Polygon[Table[{Sin[i2Pi/n],Cos[i2Pi/n],0},{i,n+1}]];​​v1=Table[{Sin[i2Pi/n],Cos[i2Pi/n],thick},{i,2}];​​v2=Table[{Sin[-i2Pi/n+6Pi/n],Cos[-i2Pi/n+6Pi/n],0},{i,2}];​​od=Table[Rotate[Polygon[Join[v2,v1]],i2Pi/n,{0,0,1}],{i,n}];​​pir=Table[{Hue[0.24^2.1j],Translate[Scale[{od,f1,f2},reduce^j{1,1,1},{0,0,0}],​​{0,0,Sum[(thick*reduce^(k-1)),{k,1,j}]}]},{j,fr}];​​Graphics3D[pir,​​BoxedFalse,SphericalRegionTrue,ImageSize400,ViewAngle0.27,PlotRange{{-1,1},{-1,1},{0,1.5}}]],​​{{reduce,0.85,"reduce size of slab"},0.5,1},​​{{fr,16,"frequency of slab"},1,18,1},​​{{n,5,"poly"},3,10,1,RadioButton},​​{{thick,0.2,"initial thickness"},0,0.25},​​TrackedSymbols{reduce,fr,n,thick}]
Out[]=
​
reduce size of slab
frequency of slab
poly
3
4
5
6
7
8
9
10
initial thickness