Graphing functions

Evelyn Sander, George Mason University

Define your function h(x,y).

h[x_,y_] := Sin[  4x y]
Plot3D[h[x,y],{x,-1,1},{y,-1,1}]

Graph contours of h(x,y).

ContourPlot3D[{z-h[x,y]==0, z == 0.1},{x,-1,1},{y,-1,1},{z,-1,1}]

Plot a solid region defined using h(x,y).

RegionPlot3D[h[x,y]-z>0 ,{x,-1,1},{y,-1,1},{z,-1,1}]

Change the precision for plotting h(x,y).
Play around with PlotPoints to see what happens. This is critical to get good resolution on your print.

RegionPlot3D[h[x,y]-z>0 && x^2 + y^2 <1 ,{x,-1,1},{y,-1,1},{z,-1,1},PlotPoints->100,MaxRecursion->15]

This creates a printable version of function h.   
The point of the scale is to make it a reasonable size when measured in millimeters. This has jagged edges -add in PlotPoints to make it a good resolution.

scale = 40;min  = -1; max=1;

output=RegionPlot3D[h[x/scale,y/scale]-z/scale>-1 ,{x,-scale,scale},{y,-scale,scale},{z,-scale, 2scale}]

Export["Graph.stl",output]