Sine house
Sándor Kabai
A house model with sine contour is shown.
In[]:=
Manipulate[Module[{},​​f1=Polygon[Table[{Sin[i2Pi/n],Cos[i2Pi/n],0},{i,n+1}]];​​f2=Polygon[Table[{Sin[i2Pi/n],Cos[i2Pi/n],-thick},{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}];​​c1=Table[Translate[Scale[{{Green,od},f1,f2},{Cos[jPi/floor],Cos[jPi/floor],1}],{0,0,jcomp/floor}],{j,floor/2}];​​tab1=Table[{0,Cos[ex],comp*ex/Pi},{ex,0,Pi/2,Pi/floor}];​​tab2=RotationTransform[2Pi/n,{0,0,1}][tab1];​​f[{a_,b_,c_,d_}]:={a,b,d,c};​​poly[t1_,t2_]:=Polygon/@f/@Partition[Flatten[Transpose[{t1,t2}],1],4,2];​​zone=poly[tab1,tab2];​​top={Table[Rotate[{zone},i2×2Pi/n,{0,0,1}],{i,n/2}]};​​column=Cylinder[{{0,0,0},{0,0,comp/2}},0.03];​​cel=Rotate[{c1,top},Pi,{0,1,0}];​​​​Graphics3D[{If[scel,cel,{}],{Red,f1},{RGBColor[0,1,1],top},column,c1},SphericalRegionTrue,BoxedFalse,ImageSize{300,360},ViewAngle0.1,ViewPoint{4,7,1},PlotRange{{-1,1},{-1,1},{-2,2}}]],​​{{n,8,"polygon"},4,20,4,RadioButton},​​{{floor,9,"number of floors"},3,21,6,RadioButton},​​{{comp,4,"compress"},2,4,ControlPlacementLeft,ImageSizeTiny},​​{{scel,False,"cellar"},{False,True},ControlPlacementLeft,ImageSizeTiny},​​{{thick,0.04,"slab"},0.01,0.06,ControlPlacementLeft,ImageSizeTiny},​​TrackedSymbols{n,floor,comp,scel,thick}]
Out[]=
​
polygon
4
8
12
16
20
number of floors
3
9
15
21
compress
cellar
slab
Contents cannot be rendered at this time; please try again later or download this notebook for full functionality »