(*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).*)

LevelCircle[u_,v_] := {(1+v^2)^0.5*Cos[u],(1+v^2)^0.5*Sin[u],v}

scale = 8;
radius = 1;
numPoints=100;
gridsteps=8;

MaxRadius=4;

MaxHeight= (MaxRadius^2 - 1)^0.5;

NumLevelCurves = 7;

umin=0;
umax=2*Pi;  
NumHyperbolae = 8;

curvesLevelCircles = Table[scale*LevelCircle[u,j],{j,-MaxHeight,MaxHeight, 2*MaxHeight/(NumLevelCurves-1)}];

curvesHyperbolae = Table[scale*LevelCircle[i,v],{i, umin, umax,(umax-umin)/NumHyperbolae }];

tubesLevelCircles =ParametricPlot3D[curvesLevelCircles,{u,umin,umax+1},PlotStyle->Tube[radius],PlotPoints->numPoints,PlotRange->All];

tubesHyperbolae  =ParametricPlot3D[curvesHyperbolae ,{v,-MaxHeight,MaxHeight},PlotStyle->Tube[radius],PlotPoints->numPoints,PlotRange->All];

output=Show[tubesLevelCircles,tubesHyperbolae]

Export["HyperboloidOneSheetLevelCurves.stl",output];