I'm trying to create a signed distance function S(x), where I want to intersect S(x) = 0 with a plane. The problem is not to get the two functions into a plot, but to get the two functions to visual intersect with each other, i.e the nearest surface is in the foreground. Currently, I have something like:
\documentclass{standalone}
\usepackage{pgfplots}
\begin{document}
\begin{tikzpicture}
\begin{axis}[grid=major]
\addplot3[surf,domain=-10:10,samples=40]
{-sqrt((x-0)^2/1 + (y-0)^2/1) + 5};
\addplot3[surf,domain=-10:10,samples=2,opacity=0.5]
{0*x+0*y};
\end{axis}
\end{tikzpicture}
\end{document}
Which gives:
As you can see, the plane is only overlapping the function and not intersecting. How can it be done? Bonus question: Is it possible to create a contour on the 3d surf plot at the intersection?
pgfplots
. From the manual: "pgfplots
supports z buffering techniques up to a certain extent. (...) However, it can't combine different\addplot
commands, those will be drawn in the order of appearance."