I'm trying to draw a simple hydraulic brake system. I've already managed to make a simple hydraulic system.


        \tkzInit[ymin=0,ymax=6.5, xmin=0,xmax=10]
        \tkzDefPoints{1/6/A, 1/1/B, 9/1/C, 9/6/D, 6/6/E, 6/2/F, 2/2/G, 2/6/H};
        \tkzDefPoints{1/5/K, 6/3/L}; 
        \filldraw[black] (K) --+ (1,0) --+ (1,0.5) --+ (0,0.5);
        \filldraw[black] (L) --+ (3,0) --+ (3,0.5) --+ (0,0.5);
        \filldraw[black!40] (K) --+ (1,0) -- (G) -- (F) --(L) --+ (3,0) -- (C) -- (B);
        \draw [thick] (A) -- (B) -- (C) -- (D);
        \draw [thick] (E) -- (F) -- (G) -- (H);
        \draw[->, very thick,red] (K) ++ (0.5,0.5) --+ (0,1); 
        \draw[->, very thick, red] (L) ++ (1.5,0.5) --+ (0,2);
        \node[white, above right] at (K) {$A_1$};
        \node[white, above right] at (L) {$A_2$};

enter image description here

But I want it to make de tubes curved to make it something like this: enter image description here

So instead of the rectangular oil tubes, I want them curved and filled. Is Tikz the way to go, or should I look for something else?


Yes, I'd say you can go with TikZ; a double with appropriate out=, in= values can do the job; I also used some layers to place some of the elements:

enter image description here

The code:





    line width=1.5pt,
\begin{scope}[rotate=-30,transform shape]
\node[fill=myorange,text width=3cm,minimum height=40pt] 
\node[fill=myred,text width=1cm,minimum height=40pt,anchor=east,outer sep=0pt] 
  at (tube1l.west)
  ([shift={(0pt,5pt)}]tube2l.center|-tube1l.north west) 
  ([shift={(5pt,-5pt)}]tube1l.south east); 

\node[fill=myorange,text width=1cm,minimum height=60pt] 
  at (20,4) 
\node[fill=myred,text width=1.5cm,minimum height=60pt,anchor=west,outer sep=0pt] 
  at (tube1r.east)
  ([shift={(0pt,5pt)}]tube2r.center|-tube1r.north east) 
  ([shift={(-5pt,-5pt)}]tube1r.south west); 

\draw[double,double distance=10pt,black,double=myorange]
  (tube1l.east) to[out=-30,in=180] (tube1r.west);  

  (tube1l.west) -- (-30:2.3cm);
  (tube1r.east) -- ++(2.5cm,0);

  (current bounding box.north west)
  (current bounding box.south east);

  • 1
    even the colors are reproduced perfect ;-) – Arne Timperman Sep 21 '15 at 17:41

You can use double and friends. For drawing a bent line, you may use plot (as I did) or ..controls or the hobby package.



    \draw[thick,double=red!40!brown,double distance=3pt,draw=black]  plot[smooth, tension=.7] coordinates {(-3.5,-1) (-1,-2) (1.5,0) (3,0.9) (4.5,1)};


enter image description here

Your Answer

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

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