TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to draw a simple cylinder with PSTricks, similar to what is attached. Is there a smart way to do this, or do I just have to manually draw each line? If there is no other way, then it is way to cumbersome and time-consuming for me.

enter image description here

share|improve this question
up vote 8 down vote accepted

You can use \psCylinder from pst-3dplot; some examples from the documentation:






enter image description here

share|improve this answer
Thanks. Looking at the first picture, how do I rotate it such that the z-axis is horizontal? – BillyJean Feb 7 '14 at 9:25

Here's how you can do this with asymptote:



import solids;

revolution r=cylinder(O,1,4,(1,0.5,0));

share|improve this answer
Info on compilation sequence: pdflatex --> asy --> pdflatex – texenthusiast Feb 6 '14 at 18:06

You have the psCylinder command from the pst-3dplotpackage. You give the coordinates of the centre and the radius of the base circle, the height of the cylinder and the angle of vieW. This will give a parallel projection. See § 14-15 of the doc.

For a central projection, you have the pst-solides3d package and a psSolidcommand; you specify the type of object you want to plot (object=cylindr, its parameters (for a cylinder r=… and h =…).

share|improve this answer
Sorry for this partial duplicate: the other answer was published while I was writing mine. I leave it, as another possibility is mentioned. – Bernard Feb 6 '14 at 17:11

pst-solides3d allows you to draw the hidden lines using the action=draw key-value:

enter image description here

\usepackage{pst-solides3d}% http://ctan.org/pkg/pst-solides3d

\psset{lightsrc=viewpoint,viewpoint=50 60 25 rtp2xyz,Decran=50}

share|improve this answer
One bad thing in pst-solides3d are the object names which are not in English. – kiss my armpit Feb 6 '14 at 17:15

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.