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

(* I use this model when I teach global optimization in Calculus III *)

xyscale=20;
zscale=0.5*xyscale;

MinZ=0;

RegionRectangle = Rectangle[{-1,-2},{2,1}];

RegionTriangle=ImplicitRegion[y ≥ x-1,{x,y}];

RegionBase = RegionIntersection[RegionRectangle,RegionTriangle];

EasterEggInTobleroneBox=ParametricPlot3D[{xyscale*u,xyscale*v,zscale*(u^2+2*u*v+3*v^2)},{u,v} ∈ RegionBase,
Mesh->False, MaxRecursion->15,  PlotStyle->{Thickness[2]}];

Base =ParametricPlot3D[{xyscale*u,xyscale*v,MinZ},
{u,v} ∈ RegionBase,
Mesh->False, MaxRecursion->4,  PlotStyle->{Thickness[2]}];

output= Show[EasterEggInTobleroneBox,Base]

(*Export["EasterEggInTobleroneBox.stl",output];*)