# Creating outlines of 3D surfaces in Tikz

I want to draw a 3D surface outline using the 3D functionality of tikz or pgfplots. For example the code below creates a cylinder "can" surface but it is only valid for incline viewing angles \h between 0 and 90. If it goes above or below these values you can see that the rim of the caps are visible when they shouldnt be.

I am wondering if there is an easier way to define a general 3D surface in tikz but only show the outlines of the surface and fill the interior with white. Hence only the edges of the surface should be visible and any edges behind the surface should be obscured by the white.

\documentclass{standalone}

\usepackage{tikz}
\usepackage{tikz-3dplot}

\begin{document}
% set the viewing angle
\def\a{45}
\def\h{55}
\tdplotsetmaincoords{\h}{\a}
\begin{tikzpicture}
[scale=7,
tdplot_main_coords,
axis/.style={->,black,very thin},
curve/.style={black,thin}]
\def\axissize{.3}
\def\th{0.25}

\tdplotsinandcos{\sintheta}{\costheta}{0}