I was looking for a normally closed switch
in circuitikz, but with a closing or opening arrow. Since I couldn't find them, I coded them myself. It's mostly a copy-paste of the normally closed switch
and the opening spst
/closing spst
. Note that the symbols are slightly wider than the normally closed switch
which is implemented at the moment.
\documentclass{standalone}
\usepackage{tikz}
\usepackage{circuitikz}
\ctikzset{bipoles/oncs/height/.initial=.35}
\ctikzset{bipoles/oncs/width/.initial=.45}
\ctikzset{bipoles/oncs/depth/.initial=.2}
\makeatletter
%% Opening NCS
\pgfcircdeclarebipolescaled{switches}
{}
{\ctikzvalof{bipoles/oncs/depth}}
{oncs}
{\ctikzvalof{bipoles/oncs/height}}
{\ctikzvalof{bipoles/oncs/width}}
{
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
\pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
\pgfsetlinewidth{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
\pgfpathlineto{\pgfpoint{.45\pgf@circ@res@right}{0pt}}
\pgfpathlineto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
\pgfscope
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
\pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}}
\pgfpatharc{-10}{90}{1.2\pgf@circ@res@right}
\pgfcirc@set@arrows{switch}{}{latexslim}
\pgfsetbeveljoin
\pgfusepath{draw}
\endpgfscope
}
%% Closing NCS
\pgfcircdeclarebipolescaled{switches}
{}
{\ctikzvalof{bipoles/oncs/depth}}
{cncs}
{\ctikzvalof{bipoles/oncs/height}}
{\ctikzvalof{bipoles/oncs/width}}
{
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
\pgfpathlineto{\pgfpoint{.9\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
\pgfsetlinewidth{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
\pgfpathlineto{\pgfpoint{.45\pgf@circ@res@right}{0pt}}
\pgfpathlineto{\pgfpoint{.45\pgf@circ@res@right}{\pgf@circ@res@up}}
\pgfusepath{draw}
\pgfscope
\pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
\pgfpathmoveto{\pgfpointpolar{90}{1.2\pgf@circ@res@right}}
\pgfpatharc{90}{-20}{1.2\pgf@circ@res@right}
\pgfcirc@set@arrows{switch}{}{latexslim}
\pgfsetbeveljoin
\pgfusepath{draw}
\endpgfscope
}
\pgfcirc@activate@bipole@simple{l}{oncs}
\pgfcirc@style@to@style{oncs}{opening normal closed switch}
\pgfcirc@activate@bipole@simple{l}{cncs}
\pgfcirc@style@to@style{cncs}{closing normal closed switch}
\makeatother
\begin{document}
\begin{tikzpicture}
\draw (0,2) to[ncs] (1,2) node[anchor = west] {normally closed switch};
\draw (0,1) to[cncs] (1,1) node[anchor = west] {closing normally closed switch};
\draw (0,0) to[oncs] (1,0) node[anchor = west] {opening normally closed switch};
\end{tikzpicture}
\end{document}