Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

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
1  
You mean the left hand side for curved cylinders is that right? The right hand side is not relevant? –  percusse Jul 29 at 9:43
1  
Both sides are relevant! –  Jonel_R Jul 29 at 10:52
2  
I don't see any bent cylinders on the right side though. –  percusse Jul 29 at 10:55

2 Answers 2

up vote 10 down vote accepted

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

\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}[xscale=0.9]
\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];
\end{tikzpicture}
\end{document}

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):

\documentclass[12pt,border=0.125cm]{standalone}
\usepackage{tikz,pgfplots}
\usepackage{xifthen}
\begin{document}
\def\sp{4mm}% adjust to scale
\begin{tikzpicture}[>=latex,line width=0.7pt,line cap=round]
\foreach \yshft in {0,7,-7}{
    \begin{scope}[yshift=\yshft*\sp]
    \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);}};
    \end{scope}
}
\end{tikzpicture}
\end{document}

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 at 10:12

You can start with something like this.

\documentclass[tikz,border=2mm]{standalone}
\begin{document}
\begin{tikzpicture}
\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];
\end{tikzpicture}
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

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.