I am using Asymptote to generate 3D images which I embed in .pdf's. Is there a way to clip these 3D images, much like you can clip 2D images to a path? I'd be happy to clip to the interior of a rectangular solid.
The reason I ask is that using Spline to graph some functions creates some wavy, undesired end behavior. I've given an example below of a hyperboloid of one sheet. With spline, there is a warble at the top. I've tried to cut it off with a bool condition, but that gives very undesirable results.
Here is an example; note where you can comment out lines to see different results.
import graph3;
size(200,200,IgnoreAspect); currentprojection=orthographic(4,4,0);
defaultrender.merge=true;
defaultpen(0.5mm);
//Draw the surface z^2 - x^2 - y^2=1
triple f(pair t) {return (cos(t.y)*tan(t.x), sin(t.y)*tan(t.x),1/cos(t.x));
}
bool cond(pair t) {return 1/cos(t.x) <1.5;}
//The following plots with just Spline. Note the warble.
surface s=surface(f,(-1,0),(1,2*pi),32,16,Spline);
// Comment above and uncomment below to use the boolean cond.
//surface s=surface(f,(-1,0),(1,2*pi),32,16,Spline,cond);
pen p=rgb(0,0,.7);
draw(s,rgb(.6,.6,1)+opacity(.7),meshpen=p);
I could remove the Spline option but I like how it smooths things otherwise.
Here's the warble:

And here's what happens if you try to cut it off with the bool option:


sI think it is possible with the latestbooloption. See http://asymptote.sourceforge.net/gallery/3D%20graphs/partialsurface.asy in the documentation. For apath3I have no idea, except to implement such a function. – O.G. Feb 13 '15 at 20:31booloptions, but don't get the desired result I was looking for. – GregH Feb 16 '15 at 13:08