Soma Cube

Author

Eric W. Weisstein
December 22, 2010

This notebook downloaded from http://mathworld.wolfram.com/notebooks/RecreationalMath/SomaCube.nb.

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

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

Initialization

cube[x_,y_,z_]:=cube[{x,y,z}]
cube[ctr_List,a_:1.]:=Module[{off=Table[ctr,{4}],h=.5 a},
  {
  Polygon[off+{{-h,-h,-h},{-h,h,-h},{h,h,-h},{h,-h,-h}}], (* bottom *)
  Polygon[off+{{-h,-h,h},{-h,h,h},{h,h,h},{h,-h,h}}],     (* top *)
  Polygon[off+{{-h,-h,-h},{-h,h,-h},{-h,h,h},{-h,-h,h}}], (* sides *)
  Polygon[off+{{h,-h,-h},{h,h,-h},{h,h,h},{h,-h,h}}],
  Polygon[off+{{-h,-h,-h},{h,-h,-h},{h,-h,h},{-h,-h,h}}],
  Polygon[off+{{-h,h,-h},{h,h,-h},{h,h,h},{-h,h,h}}]
  }
]

Soma[1]:={cube[0,0,0],cube[1,0,0],cube[1,0,1]}
Soma[2]:={cube[0,0,0],cube[1,0,0],cube[2,0,0],cube[2,0,1]}
Soma[3]:={cube[0,0,0],cube[1,0,0],cube[2,0,0],cube[1,0,1]}
Soma[4]:={cube[0,0,0],cube[1,0,0],cube[1,0,1],cube[2,0,1]}
Soma[5]:={cube[0,0,0],cube[1,0,0],cube[1,1,0],cube[1,0,1]}
Soma[6]:={cube[0,0,0],cube[0,0,1],cube[1,0,0],cube[1,1,0]}
Soma[7]:={cube[0,0,0],cube[1,0,0],cube[1,1,0],cube[1,1,1]}

Graphic

LiveGraphics3D

Do[
	WriteLiveForm["soma"<>ToString[i]<>".m",
		Graphics3D[Soma[i],Boxed->False,AspectRatio->1]],
	{i,7}]

Graphic

V5

partition[l_List,n_]:=Module[{m=Mod[Length[l],n],p},p=Partition[l,n];
If[m==0,p,Append[p,Take[l,-m]]]]
Show[GraphicsArray[partition[Table[Show[Graphics3D[Soma[i]],Boxed->False,AspectRatio->1,DisplayFunction->Identity],{i,7}],4]],DisplayFunction->$DisplayFunction]

Table[Show[Graphics3D[Soma[i],Boxed->False,AspectRatio->1]],
	{i,7}]

V6

GraphicsGrid[Partition[Graphics3D[Soma[#],Boxed->False]&/@Range[7],4,4,{1,1},{}]]