# How to draw the intersection of two surfaces using Asymptote?

I'm trying to draw the intersection of a plane with a hyperboloid with asymptote. The result should either be 2 crossing lines or a conic (ellipse, circle or parabola).

Heres the code:

``````settings.outformat="png";
settings.render=8;
size(200);
import solids;

currentprojection=perspective(0,-5,3);
revolution hyperboloid=revolution(graph(new triple(real z) {
return (sqrt(1+z*z),0,z);},-2,2,20,operator ..),axis=Z);

draw(surface(hyperboloid), surfacepen=material(diffusepen=white+opacity(0.6),emissivepen=gray(0.6)));

draw(hyperboloid,12,black+0.3pt,longitudinalpen=0.1pt+black);

path3 p=plane((0,6,0),(0,0,6),O=(1,-3,-3));
draw(p);
``````

I have tried intersectionpoints but the code doesnt work.

• Actually, finding the intersection of two surfaces is easier if one of them is implicitly defined, since you can use the `contour` module. See my code for `surfacepaths.asy` in tex.stackexchange.com/a/159365/484 – Charles Staats Nov 24 '14 at 15:07