# Valve and pump symbol using TikZ

I'm wondering if there is a library for the pump and the valve symbol. I want to draw the following schematics using TikZ.

using something like this:

\documentclass{standalone}

\usepackage{VALVEPUMPPACAKGE}

\begin{document}

\begin{tikzpicture}

\draw (0,0)  to[pump] (2,0) -- (4,0) to[valve] (4,-2);

\end{tikzpicture}

\end{document}

• No, but one could easily construct one. I have tutorials (for Circuitikz) at elfsoft2000.com/projects/index.htm – John Kormylo Mar 29 '14 at 16:09
• to[pump] would be difficult. Normally components connect in straight lines through the center. – John Kormylo Mar 29 '14 at 16:45
• Thanks for the reply @JohnKormylo. I'll have a look at the tutorial. I figgure I'll just draw the pump, and (try to) make symbols for the valves. – David Kristiansen Mar 29 '14 at 19:44

My solution was to draw it line by line.

\documentclass[border=2pt,tikz]{standalone}

\newcommand{\valve}[3]{%
\draw (#1-.5,#2) -- (#1+.5,#2) -- (#1-.5,#2-2) -- (#1+.5,#2-2) -- cycle;
\draw (#1,#2-1) -- (#1-.5,#2-1);
\draw (#1-.5,#2-1.45) rectangle (#1-1.25,#2-.65);
\node at (#1-2.5,#2-1) {\bf #3};
}

\newcommand{\process}[3]{%
\draw [rounded corners=1.5mm] (#1-.5,#2) rectangle (#1+.5,#2-2);
\node at (#1-2,#2-1) {\bf #3};
}

\begin{document}
\begin{tikzpicture}

\begin{scope}[ultra thick]

%% pump
\draw (0,-.2) --  (2,-.2) -- (1,.8) -- (0,-.2);
\filldraw [color=white,draw=black](1,1) circle (1cm);
\draw [->] (-2,1) -- (1,1);
\draw [->] (1,2) -- (2,2);
\node at (1,-.75) {\bf Pump};

\draw (2,2) -- (6,2);
\draw (6,2) -- (6,-2);

% <- valve 1

\draw (6,-4) -- (6,-6);

% <- process 1

\draw (6,-8) -- (6,-10) -- (-2,-10);
\draw (6,2) -- (12,2) -- (12,-2);

% <- valve 2

\draw (12,-4) -- (12,-6);

% <- process 2

\draw (12,-8) -- (12,-10) -- (6,-10);

\end{scope}

\begin{scope}[thick]

\valve{6}{-2}{Valve 1}
\process{6}{-6}{Process 1}
\valve{12}{-2}{Valve2}
\process{12}{-6}{Process 2}

\end{scope}

\end{tikzpicture}
\end{document}


• It is normally preferred to post a complete document including \documentclass and the appropriate packages, so that one can simply cut and paste and try out the solution. – Peter Grill Mar 30 '14 at 1:19
• Fixed! Sorry about that. – David Kristiansen Mar 30 '14 at 1:27
• Looks great. Might want to add border=2pt option to the \documentclass. For future improvement I would recommend you define macros for things which are repetitive. For example, you could define macros for \Valve and specify the coordinate for the location of the \Valve as parameters. And if you want to go farther, define you own custom shapes with appropriate anchors. – Peter Grill Mar 30 '14 at 1:38
• @PeterGrill thanks for the replies. I took your advice and improved the source. It seems that defining shapes is a bit heavy at the moment. – David Kristiansen Mar 30 '14 at 12:06
• @DavidKristiansen Did you ever make any macros? If so, you might be interested in latex-community.org/forum/viewtopic.php?p=90728#p90728 – Johannes_B Jul 27 '15 at 21:22