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 would like to draw this figure here using tikz. However I do not know how to draw curved cylinders in Tikz. enter image description here

Can someone give a hint with it? Thanks

share|improve this question
You mean the left hand side for curved cylinders is that right? The right hand side is not relevant? – percusse Jul 29 '14 at 9:43
Both sides are relevant! – Jonel_R Jul 29 '14 at 10:52
I don't see any bent cylinders on the right side though. – percusse Jul 29 '14 at 10:55
up vote 9 down vote accepted

It can be nicer if you remove the middle points of the two curves and adjust the angles slightly as follows:

\shadedraw[shading=axis] (0,0) to[out=20,in=160] (10,0)--(10,0.5) to[out=160,in=20] (0,0.5)--cycle;
\draw(5,1.25) circle[x radius=1.5mm, y radius=2.5mm];

enter image description here

Also, for the part of the curved cylinders you can integrate the following part of code (I ignored the shading though):

\def\sp{4mm}% adjust to scale
\begin{tikzpicture}[>=latex,line width=0.7pt,line cap=round]
\foreach \yshft in {0,7,-7}{
    \node(e)[draw,xscale=1.8,yscale=3,circle,minimum size=2*\sp,outer sep=0pt,inner sep=0pt]at(3*\sp,0){};
    \coordinate (A) at ([xshift=-7*\sp]e.north);
    \coordinate (B) at ([xshift=-7*\sp]e.south);
    \draw (e.north)--(e.south);
    \draw (A)--(e.north);
    \draw (B)--(e.south);
    \draw (-4*\sp, 3*\sp).. controls (-4.5*\sp,3*\sp) and(-5*\sp, 2*\sp)..(-4*\sp,0*\sp);
    \draw (-4*\sp,-3*\sp).. controls (-4.5*\sp,-3*\sp)and(-5*\sp,-2*\sp)..(-4*\sp,0*\sp);
    \draw (-4*\sp, 3*\sp).. controls (-3.5*\sp,3*\sp) and(-3*\sp, 2*\sp)..(-4*\sp,0*\sp);
    \ifthenelse{\yshft=0} {}{
    \foreach \y in {-9,-8,...,-1,1,2,...,9}{
        \draw [->](3*\sp, \y/3)-- ++(\y/21*\yshft, 0);}};

With the following output:

enter image description here

share|improve this answer
Could you put some comment si order to understand all the steps?? Thanks for you help! – Jonel_R Jul 30 '14 at 10:12

You can start with something like this.

\shadedraw[shading=axis] (0,0) to[out=15,in=180] (5,1) to[out=0,in=165] (10,0)--(10,0.5) to[out=165,in=0] (5,1.5) to [out=180,in=15] (0,0.5)--cycle;
\draw(5,1.25) circle[x radius=1mm, y radius=2.5mm];

enter image description here

share|improve this answer

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.