I would like the surface of the cylinder to reach the blue arcs towards left (y-axis
) but not passing through them.
How can I achieve that?
\documentclass[border=3mm]{standalone}
\usepackage{pgfplots}
\pgfplotsset{compat=1.15}
\begin{document}
\begin{tikzpicture}
\begin{axis}[%
axis lines=middle, ticks=none,
zmin=-2, zmax=2,
xmin=-3, xmax=3,
ymin=-1, ymax=3,
view/h=125, view/v=25
]
\addplot3[%
opacity = 0.02,
fill opacity=0.5,
mesh/interior colormap name=hot,
surf,
colormap/hot,
faceted color=black,
z buffer = sort,
samples = 50,
variable = \u,
variable y = \v,
domain = 0:360,
y domain = -3:3,
]
({cos(u)}, {max(v,cos(v))}, {sin(u)});
% ARCS
\addplot3[%
variable= \t,
mesh,
blue!80!,
semithick,
samples=30,
opacity = 0.025,
z buffer = sort,
domain= 0:180,
]
({sin(t)}, {sin(t)}, {cos(t)});
\addplot3[%
variable= \t,
mesh,
blue!80!,
semithick,
samples=30,
opacity = 0.025,
z buffer = sort,
domain= 0:-180,
]
({sin(t)}, {-sin(t)}, {cos(t)});
\end{axis}
\end{tikzpicture}
\end{document}