surf_extrude allows for linearly extruding a surface given in the form: f(x,y)=z and defined over a matrix of x,y points.
It conveniently builds up the mesh and the polyhedron, without any effort from the user.
The extrusion length and direction is controlled by a vector, the default [0,0,1] results in a 1 mm extrusion in the z direction.
I am sure that there are other several implementations out there, but I couldn't find anything being simple and quick to my taste, so I went for it.
surf = [for (x=linspace(0,40,100)) [for (y=linspace(0,20,100))
[ x, y, sqrt(x)+sqrt(y)+2*cos(x*40+200*cos(y*20)) ]