I am trying to create a wedge from a cylinder like
I have been able to get the basics:
\documentclass[11pt,tikz,border=3.14pt]{standalone}
\usepackage{tikz-3dplot}
\usepackage{pgfplots}
\begin{document}
\tdplotsetmaincoords{70}{130}
\begin{tikzpicture}[tdplot_main_coords,scale=3]
\def\pos{0.81} %value 0 < \pos < 1
\coordinate (O) at (0,0,0);
\coordinate (A) at (0,0,0);
\coordinate (B) at (1,0,0);
\coordinate (C) at (1,2,0);
\coordinate (D) at (0,2,0);
\coordinate (AT) at (0,0,1);
\coordinate (BT) at (1,0,1);
\coordinate (CT) at (1,2,1);
\coordinate (DT) at (0,2,1);
\draw[thick,black] (A) -- (B) -- (C) -- (D) -- cycle;
\draw[thick,black] (AT) -- (BT) -- (CT) -- (DT) -- cycle;
\draw[thick,black] (A) -- (AT);
\draw[thick,black] (B) -- (BT);
\draw[thick,black] (C) -- (CT);
\draw[thick,black] (D) -- (DT);
\draw[thin,black] (1,1,0) -- (0,1,0) -- (0,1,1) -- cycle;
% The circle/ellipse:
\begin{scope}[canvas is xy plane at z=0]
\draw[thick] (1,0) arc (270:90:1);
\end{scope}
\begin{scope}[
plane origin={(1,0,0)},
plane x={(1,1,0)},
plane y={(0,0,1)},
canvas is plane
]
\draw[thick] (0,0) arc (180:0:1);
\end{scope}
% The manually computed right-edge:
\draw[thin] ({1-sqrt(1-\pos^2)},1+\pos,0) -- ({1-sqrt(1-\pos^2)},1+\pos,{sqrt(1-\pos^2)}) ;
% The axis:
\draw[->] (O) --++ (1.5,0,0) node[below] {$x$};
\draw[->] (O) --++ (0,2.5,0) node[below] {$y$};
\draw[->] (O) --++ (0,0,1.25) node[right] {$z$};
\end{tikzpicture}
\end{document}
that renders as:
But I have a couple of roadblocks:
I would like to compute the right-edge of the cylinder automatically, much like this answer here, so I can experiment with the best angle view of the image, but I guess, I did not manage to understand how that solution fully works.
I also would like to shade the whole solid surface, but I am having problems with the edge computed by hand.