\pgfkeys{
        /pump/dimension/radius/.code = {#1},
        /pump/dimension/radius/.initial = {0.5 cm},
        /pump/.is choice,
        /pump/basic/.code = {#1},
        /pump/basic/.default = {},
        /pump/centrifugal/.code = {
            \pgfkeys{/pump/basic/.append code = {
                \pgfpathmoveto{\east}
                \east
                \pgfpathlineto{\pgfpoint{-\pgf@x}{\pgf@y}}
            }
        }},
        /pump/reciprocating/.code = {
            \pgfkeys{/pump/basic/.append code = {

                \pgfpointscale{0.4}{\east}
                \pgf@xa = \pgf@x
    
                \pgfpathmoveto{\pgfpoint{-\pgf@xa}{0}}
                \pgfpathlineto{\pgfpoint{\pgf@xa}{0}}
    
                \pgfpointscale{0.4}{\north}
                \pgf@ya = \pgf@y

                \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
                \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@ya}}
            }
        }},
        /pump/gear/.code = {
            \pgfkeys{/pump/basic/.append code = {
                \pgfpointscale{0.15}{\east}
                \pgf@xa = \pgf@x

                \pgfpointscale{0.4}{\pgfpoint{\pgfkeysvalueof{/pump/dimension/radius}}{0}} % Diameter of smaller circle
                \pgf@xb = \pgf@x

                \pgfpointscale{0.701}{\pgfpoint{0}{\pgf@xb}} % Height of center of circle if between circles 30 degrees is starting angle
                \pgf@ya = \pgf@y
                \pgf@yb = \pgf@y

                \pgfpointdiff{\pgfpoint{\pgf@xa}{0}}{\pgfpoint{\pgf@ya}{0}}
                \pgf@xc = \pgf@x
                
                \pgfpathmoveto{\pgfpointscale{3}{\pgfpoint{\pgf@xc}{0}}}
                \pgfpatharc{135}{405}{\pgf@xb}
                \pgfpathcircle{\pgfpoint{-\pgf@xa}{\pgf@yb}}{\pgf@xb}
                }
        }},
        /pump/screw/.code = {
            \pgfkeys{/pump/basic/.append code = {
                \pgfpointscale{0.3}{\east}
                \pgf@xa = \pgf@x
                \pgfpointscale{0.15}{\north}
                \pgf@ya = \pgf@y 
                
                \pgfpathmoveto{\pgfpoint{-2.25 \pgf@xa}{0.5 \pgf@ya}}
                \pgfpathlineto{\pgfpoint{-2 \pgf@xa}{\pgf@ya}}

                \pgfpathmoveto{\pgfpoint{-2.25 \pgf@xa}{-0.5\pgf@ya}}
                \pgfpathlineto{\pgfpoint{-2 \pgf@xa}{ 0\pgf@ya}}

                \foreach \j in {-2, -1, 0} {
                    \pgfpointscale{\j}{\pgfpoint{\pgf@xa}{0}}
                    \pgfpathmoveto{\pgfpoint{\pgf@x}{\pgf@ya}}

                    \pgfpointscale{\j + 0.5}{\pgfpoint{\pgf@xa}{0}}
                    \pgfpathlineto{\pgfpoint{\pgf@x}{0 \pgf@ya}}

                    \pgfpointscale{\j + 1}{\pgfpoint{\pgf@xa}{0}}
                    \pgfpathlineto{\pgfpoint{\pgf@x}{\pgf@ya}}
                }
                
                \foreach \j in {-2, -1, 0} {
                    \pgfpointscale{\j}{\pgfpoint{\pgf@xa}{0}}
                    \pgfpathmoveto{\pgfpoint{\pgf@x}{0 \pgf@ya}}

                    \pgfpointscale{\j + 0.5}{\pgfpoint{\pgf@xa}{0}}
                    \pgfpathlineto{\pgfpoint{\pgf@x}{-\pgf@ya}}

                    \pgfpointscale{\j + 1}{\pgfpoint{\pgf@xa}{0}}
                    \pgfpathlineto{\pgfpoint{\pgf@x}{0 \pgf@ya}}
                }

                \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@ya}}
                \pgfpathlineto{\pgfpoint{1.25 \pgf@xa}{0.5 \pgf@ya}}

                
                \pgfpathmoveto{\pgfpoint{\pgf@xa}{0 \pgf@ya}}
                \pgfpathlineto{\pgfpoint{1.25 \pgf@xa}{-0.5 \pgf@ya}}
                
            }
        }},
        /pump/cavity/.code = {
            \pgfkeys{/pump/basic/.append code = {
                \pgfpointscale{0.2}{\east}
                \pgf@xa = \pgf@x
                
                \pgfpathmoveto{\pgfpointscale{-.75}{\east}}
                \pgfpatharc{180}{0}{\pgf@xa}
                \pgfpatharc{180}{360}{\pgf@xa}
                \pgfpatharc{180}{0}{\pgf@xa}
            }
        }},
        /pump/diaphragm/.code = {
            \pgfkeys{/pump/basic/.append code = {
                \pgfpointscale{0.4}{\east}
                \pgf@xa = \pgf@x

                \north
                \pgf@ya = \pgf@y
                
                \pgfpathmoveto{\north}
                \north
                \pgfpatharc{90}{270}{\pgf@xa and \pgf@ya}
            }
        }},
        /pump/jet/.code = {
            \pgfkeys{/pump/basic/.append code = {
                \pgfpointscale{0.5}{\east}
                \pgf@xa = \pgf@x

                \pgfpointscale{0.683}{\east} % Manually calculated to close figure
                \pgf@xb = \pgf@x

                \pgfpointscale{0.2}{\north}
                \pgf@yb = \pgf@y
                
                \pgfpathmoveto{\pgfpoint{\pgf@xa}{\pgf@xa}}
                \pgfpatharc{360}{180}{\pgf@xb and \pgf@yb}
                \pgfpathmoveto{\pgfpoint{\pgf@xa}{-\pgf@xa}}
                \pgfpatharc{0}{180}{\pgf@xb and \pgf@yb}
            }
        }},
        /pump/.default = {\pgfkeys{/pump/basic}}
}


\pgfdeclareshape{pump}{
    \savedanchor{\centerpoint}{
        \pgfpointorigin
    }
    \savedanchor{\north}{
        \pgfpoint{0}{\pgfkeysvalueof{/pump/dimension/radius}}
    }
    \savedanchor{\east}{
        \pgfpoint{\pgfkeysvalueof{/pump/dimension/radius}}{0}
    }

    
    \anchor{center}{
        \centerpoint
    }
    \anchor{north}{
        \north
    }
    \anchor{east}{
        \east
    }
    \anchor{south}{
        \north
        \pgfpoint{\pgf@x}{-\pgf@y}
    }
    \anchor{west}{
        \east
        \pgfpoint{-\pgf@x}{\pgf@y}
    }
    \anchor{northeast}{
        \north
        \pgf@ya = \pgf@y
        \pgfpoint{0.707\pgf@ya}{0.707\pgf@ya}
    }
    \anchor{southeast}{
        \north
        \pgf@ya = \pgf@y
        \pgfpoint{0.707\pgf@ya}{-0.707\pgf@ya}
    }
    \anchor{northwest}{
        \north
        \pgf@ya = \pgf@y
        \pgfpoint{-0.707\pgf@ya}{0.707\pgf@ya}
    }
    \anchor{southwest}{
        \north
        \pgf@ya = \pgf@y
        \pgfpoint{-0.707\pgf@ya}{-0.707\pgf@ya}
    }

    
    \backgroundpath{
        \pgfpathmoveto{\pgfpointorigin}
        \pgfpathcircle{\pgfpointorigin}{\pgfkeysvalueof{/pump/dimension/radius}}
    
        \pgfpathmoveto{\north}
        \pgfpathlineto{\east}
        \north
        \pgfpathlineto{\pgfpoint{\pgf@x}{-\pgf@y}}

        \pgfkeys{/pump/basic}
    
        \pgfusepath{stroke}
    }
}