(*This Mathematica code was written by John Zweck (zweck@utdallas.edu) and generates a mathematical curve/surface that can be printed using a 3D printer. This model can (probably) be printed by Shapeways.*)

(*If you evaluate this Mathematica notebook,the curve/surface will be rendered using computer graphics.*)

(*If you uncomment the export line at the end of the code and set the directory path appropriately for your system you will obtain an STL file that can be sent to a 3D printer.*)

(*The STL file can also be viewed using the open source software Meshlab.*)

(*You may modify this code in any way you like.*)

(*This project was supported by the National Science Foundation through a Supplement to the UTeach Dallas Robert Noyce Scholarship Program (DUE 1544159).*)

Surface[u_,v_]:={u*Cos[v],u*Sin[v],u^2};

(*Shapeways price: Red polished $12.01  for r=1mm, and $9.64 for r=0.75 mm *)

scale = 25;            (*Height is 4*scale mm and largest diameter is 4*scale mm, with scale =25 get 8 cm *)
radius = 0.75;          (*Diameter of tubes is 2r in mm *)
numPoints=24;  (*Number of sides of cross section of polygonal tube*)
gridstepsParabolas=8;
umin=0;
umax=2;
vmin=0;
vmax=2*Pi;

levelSteps={1,2^(1/2),3^(1/2),4^(1/2)};

curvesParabolas=Table[scale*Surface[u,j],{j, vmin, vmax,(vmax-vmin)/gridstepsParabolas}];

curvesCircles=Table[scale*Surface[i,v],{i,levelSteps}];

tubesParabolas=ParametricPlot3D[curvesParabolas,{u,umin,umax},
 PlotStyle->Tube[radius,PlotPoints->numPoints],PlotRange->All];

tubesCircles=ParametricPlot3D[curvesCircles,{v,vmin,vmax},
PlotStyle->Tube[radius,PlotPoints->numPoints],PlotRange->All];

vertices=Graphics3D[Table[Sphere[scale*Surface[i,j],radius],{i, levelSteps},{j, vmin, vmax,(vmax-vmin)/gridstepsParabolas}],PlotPoints->numPoints];

origin = Graphics3D[Table[Sphere[scale*Surface[i,j],radius],{i, 0,0},{j,0,0}],PlotPoints->numPoints];

output=Show[tubesParabolas,tubesCircles, vertices, origin]

(*Export["CircularParaboloidLevelCurves.stl",output]*)