(* Drinkable proof of the Archimedes idea to relate the volume of the sphere with the complement of the volume of a cone in a cylinder   *)
(* Oliver Knill and Elizabeth Slavkovsky. This Mathematica file was written on December 11, 2011 and put online on February 3, 2013      *)
(* See http://arxiv.org/abs/1301.5027 for the paper and http://www.math.harvard.edu/~knill/3dprinter for the project page                *)

M=6; a=0.1; b=0.06; b1=Sin[b]; b2=Cos[b]; b1a=ArcSin[b1/(1+a)]; b2a=(1+a)Cos[b1a]; opacity=1;  o=opacity;
bowl1   =ParametricPlot3D[{Cos[t] Sin[s],Sin[t] Sin[s],Cos[s]}+{0,0,2},{t,0,2Pi},{s,Pi/2,Pi-b},Mesh->False,PlotStyle->{Yellow,Opacity[o]}]; 
bowl2   =ParametricPlot3D[(1+a){Cos[t] Sin[s],Sin[t] Sin[s],Cos[s]}+{0,0,2},{t,0,2Pi},{s,Pi/2,Pi-b1a},Mesh->False,PlotStyle->{Yellow,Opacity[o]}]; 
drain   =ParametricPlot3D[{b1 Cos[t],b1 Sin[t],z},{z,2-b2,2-b2a},{t,0,2Pi},Mesh->False,PlotStyle->{Red,Opacity[o]}]; 
cone1   =ParametricPlot3D[{(1-z)Cos[t],(1-z)Sin[t],z-1},{t,0,2Pi},{z,0,1},Mesh->False,PlotStyle->{Green,Opacity[o]}]; 
cone2   =ParametricPlot3D[{(1+a)(1-z) Cos[t],(1+a)(1-z) Sin[t],z-1},{t,0,2Pi},{z,0,1}, Mesh->False,PlotStyle->{Green,Opacity[o]}]; 
wall1   =ParametricPlot3D[{Cos[t],Sin[t],z},{t,0,2Pi},{z,-1,0},PlotStyle->{Blue,Opacity[o]},Mesh->False]; 
wall2   =ParametricPlot3D[{(1+a)Cos[t],(1+a)Sin[t],z},{t,0,2Pi},{z,-1,0},PlotStyle->{Blue,Opacity[o]},Mesh->False]; 
top1    =ParametricPlot3D[{r Cos[t],r Sin[t],0},{r,1,1+a},{t,0,2Pi},Mesh->False,PlotStyle->{Red,Opacity[o]}]; 
top2    =ParametricPlot3D[{r Cos[t],r Sin[t],2},{r,1,1+a},{t,0,2Pi},Mesh->False,PlotStyle->{Red,Opacity[o]}]; 
connect =Graphics3D[{Opacity[o],Table[m=2Pi*k/M;a2=a/2;{Blue,Cylinder[{{(1+a2)Cos[m],(1+a2)Sin[m],-1},{(1+a2)Cos[m],(1+a2)Sin[m],2}},a2]},{k,M}]}]; 
bottom  =ParametricPlot3D[{r Cos[t],r Sin[t],-1},{r,0, 1+a},{t,0,2Pi},Mesh->False,PlotStyle->{Blue,Opacity[o]}]; 

S=Show[{connect,drain,bowl1,bowl2,cone1,cone2,wall1,wall2,bottom,top1,top2},PlotRange->All,Boxed->False,Axes->False]

Export["archimedes.3ds",S,"3DS"]    (* to import into other graphics programs like sketchup to place into google earth and fly through  *)
Export["archimedes.wrl",S]          (* to print in color. Color printing services often can not print this in color yet                 *)
Export["archimedes.stl",S]          (* the standard STL export which can be printed on 3D printers                                      *)

