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.



    % set the viewing angle
    axis/.style={->,black,very thin},
    % radius and axes

    \draw[thick] (\radius*\costheta,\radius*\sintheta,0) {} -- (\radius*\costheta,\radius*\sintheta,\th);

    \draw[thick] (\radius*\costheta,\radius*\sintheta,0) -- (\radius*\costheta,\radius*\sintheta,\th);


  • You would have to draw the edges back-to-front in order, Which is a lot more difficult than handling the 3 or 4 special cases separately. – John Kormylo Nov 21 '17 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.