# Solid region enclosed by surfaces

I'm trying to obtain the solid regions showed below for didactical purposes:

I know that with psplot in 2d one can do things like that (area enclosed by two curves) and the output is very nice (I did this one):

While reading information about 3d plotting packages I didn't found something similar (easy code, clear output) so I'm asking for your help. Is there a easy way to plot this type of solids? Solids that are obtained in a triple integral, bounded by some surfaces.

• Perhaps pst-solides3d might help? – Bernard Jul 6 '18 at 21:19

It is straightforward with tikz-3dplot. The only thing I don't know is the parametrization of your surface, so I made something up. It would be great if you could tell me such that I can improve the figure. I now just took the parametrizations from your figure.

\documentclass[tikz,border=3.14mm]{standalone}
\usepackage{tikz-3dplot}
\begin{document}
\tdplotsetmaincoords{70}{110}
\begin{tikzpicture}
\begin{scope}[tdplot_main_coords,scale=3.14]
\draw[thick,-latex] (1,0,0) -- (1.5,0,0) node[anchor=north east] (x) {$x$};
\draw[thick,-latex] (0,1,0) -- (0,1.5,0) node[anchor=north west] (y) {$y$};
\draw[thick,-latex] (0,0,1) -- (0,0,1.5) node[anchor=south] (z) {$z$};
\draw[fill=cyan!30] plot[variable=\x,domain=0:1,samples=50] ({\x},{0},{sqrt(1-\x*\x)})
-- (1,0,0) --
plot[variable=\x,domain=1:0,samples=50] ({\x},{1-\x},{1-\x*\x}) -- cycle;
\draw[fill=cyan!80] (0,1,1) -- plot[variable=\x,domain=0:1,samples=50]
({\x},{1-\x},{1-\x*\x})
-- (1,0,0) -- (0,1,0)  -- cycle;
\draw[dashed] (0,0,0) -- (1,0,0) (0,0,0) -- (0,1,0) (0,0,0) -- (0,0,1);
\node (lz) at (1.4,0,1.4) {$z=1-x^2$};
\draw[-latex]  (lz) -- (0.6,0.1,1-0.6*0.6);
\node (ly) at (1.4,1,0.2) {$y=1-x$};
\draw[-latex]  (ly) -- (0.6,1-0.6,0.2);
\end{scope}
%
\begin{scope}[xshift=8cm,tdplot_main_coords,scale=3.14]
\draw[thick,-latex] (0,0,0) -- (1.5,0,0) node[anchor=north east] (x) {$x$};
\draw[thick,-latex] (0,1,0) -- (0,1.5,0) node[anchor=north west] (y) {$y$};
\draw[thick,-latex] (0,0,0) -- (0,0,1.5) node[anchor=south] (z) {$z$};
\draw[fill=cyan!30] plot[variable=\x,domain=0:1,samples=50]
({\x},{sqrt(\x)},{1-sqrt(\x)})
-- (1,1,0) --
plot[variable=\x,domain=1:0,samples=50]
({\x},{sqrt(\x)},{0}) %pow(1-(1-\x)*(1-\x),2/3)
-- (0,0,0) -- cycle;
\draw[fill=cyan!80] plot[variable=\x,domain=0:1,samples=50]
({\x},{sqrt(\x)},{1-sqrt(\x)}) -- (1,1,0) -- (0,1,0) -- (0,0,1) -- cycle;
\draw[dashed] (0,0,0) -- (0,1,0);
\node (lz) at (0,1,1) {$z=1-y$};
\draw[-latex]  (lz) -- (0.1,{sqrt(0.2)},{1-sqrt(0.2)});
\node (ly) at (1.4,0.6,0.2) {$y=\sqrt{x}$};
\draw[-latex]  (ly) -- (0.4,{sqrt(0.4)},0.2);
\end{scope}
\end{tikzpicture}
\end{document}