texlive[52990] Master/texmfdist: circuitikz (1dec19)
commits+karl at tug.org
commits+karl at tug.org
Sun Dec 1 22:35:44 CET 2019
Revision: 52990
http://tug.org/svn/texlive?view=revision&revision=52990
Author: karl
Date: 20191201 22:35:44 +0100 (Sun, 01 Dec 2019)
Log Message:

circuitikz (1dec19)
Modified Paths:

trunk/Master/texmfdist/doc/context/third/circuitikz/circuitikzcontext.pdf
trunk/Master/texmfdist/doc/generic/circuitikz/CHANGELOG.md
trunk/Master/texmfdist/doc/generic/circuitikz/README.md
trunk/Master/texmfdist/doc/latex/circuitikz/changelog.tex
trunk/Master/texmfdist/doc/latex/circuitikz/circuitikzmanual.pdf
trunk/Master/texmfdist/doc/latex/circuitikz/circuitikzmanual.tex
trunk/Master/texmfdist/tex/context/third/circuitikz/tcircuitikz.tex
trunk/Master/texmfdist/tex/generic/circuitikz/pgfcirc.defines.tex
trunk/Master/texmfdist/tex/generic/circuitikz/pgfcircpath.tex
trunk/Master/texmfdist/tex/generic/circuitikz/pgfcirctripoles.tex
trunk/Master/texmfdist/tex/generic/circuitikz/pgfcircutils.tex
trunk/Master/texmfdist/tex/latex/circuitikz/circuitikz.sty
Added Paths:

trunk/Master/texmfdist/tex/context/third/circuitikz/tcircuitikz0.9.6.tex
trunk/Master/texmfdist/tex/latex/circuitikz/circuitikz0.9.6.sty
Modified: trunk/Master/texmfdist/doc/context/third/circuitikz/circuitikzcontext.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmfdist/doc/generic/circuitikz/CHANGELOG.md
===================================================================
 trunk/Master/texmfdist/doc/generic/circuitikz/CHANGELOG.md 20191201 00:57:58 UTC (rev 52989)
+++ trunk/Master/texmfdist/doc/generic/circuitikz/CHANGELOG.md 20191201 21:35:44 UTC (rev 52990)
@@ 1,6 +1,13 @@
<! CircuiTikz  Changelog >
The major changes among the different circuitikz versions are listed here. See <https://github.com/circuitikz/circuitikz/commits> for a full list of changes.
+* Version 0.9.7 (20191201)
+
+ The important thing in this release is the new position of transistor's labels; see the manual for details.
+
+  Fix the position of transistor's text. There is an option to revert to the old behavior.
+  Added anchors for adding circuits (like snubbers) to the flyback diodes in transistors (after a suggestion from @EdAlvesSilva on GitHub).
+
* Version 0.9.6 (20191109)
The highlights of this release are the new multiple terminals BJTs and several stylistic addition and fixes; if you like to pixelpeep, you will like the fixed transistors arrows. Additionally, the transforms are much more configurable now, the "pmos" and "nmos" elements have grown an optional bulk connection, and you can use the "flow" arrows outside of a path.
Modified: trunk/Master/texmfdist/doc/generic/circuitikz/README.md
===================================================================
(Binary files differ)
Modified: trunk/Master/texmfdist/doc/latex/circuitikz/changelog.tex
===================================================================
 trunk/Master/texmfdist/doc/latex/circuitikz/changelog.tex 20191201 00:57:58 UTC (rev 52989)
+++ trunk/Master/texmfdist/doc/latex/circuitikz/changelog.tex 20191201 21:35:44 UTC (rev 52990)
@@ 5,6 +5,22 @@
\begin{itemize}
\item
+ Version 0.9.7 (20191201)
+
+ The important thing in this release is the new position of
+ transistor's labels; see the manual for details.
+
+ \begin{itemize}
+ \tightlist
+ \item
+ Fix the position of transistor's text. There is an option to revert
+ to the old behavior.
+ \item
+ Added anchors for adding circuits (like snubbers) to the flyback
+ diodes in transistors (after a suggestion from @EdAlvesSilva on
+ GitHub).
+ \end{itemize}
+\item
Version 0.9.6 (20191109)
The highlights of this release are the new multiple terminals BJTs and
Modified: trunk/Master/texmfdist/doc/latex/circuitikz/circuitikzmanual.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmfdist/doc/latex/circuitikz/circuitikzmanual.tex
===================================================================
 trunk/Master/texmfdist/doc/latex/circuitikz/circuitikzmanual.tex 20191201 00:57:58 UTC (rev 52989)
+++ trunk/Master/texmfdist/doc/latex/circuitikz/circuitikzmanual.tex 20191201 21:35:44 UTC (rev 52990)
@@ 223,6 +223,7 @@
Here, we will provide a list of incompabilitys between different version of circuitikz. We will try to hold this list short, but sometimes it is easier to break with old syntax than including a lot of switches and compatibility layers.
You can check the used version at your local installation using the macro \verb!\pgfcircversion{}!.
\begin{itemize}
+ \item After v0.9.7: the position of the text of transistor nodes has changed; see section~\ref{sec:transistorslabels}.
\item After v0.9.4: added the concept of styling of circuits. It should be backward compatible, but it's a big change, so be ready to use the \texttt{0.9.3} snapshot (see below for details).
\item After v0.9.0: the parameters \texttt{tripoles/american or port/aaa}, \texttt{...bbb}, \texttt{...ccc} and \texttt{...ddd} are no longer used and are silently ignored; the same stands for \texttt{nor}, \texttt{xor}, and \texttt{xnor} ports.
\item After v0.9.0: voltage and current directions/sign (plus and minus signs in case of \texttt{american voltages} and arrows in case of \texttt{european voltages} have been rationalized with a couple of new options (see details in section~\ref{currandvolt}. The default case is still the same as v0.8.3.
@@ 235,12 +236,12 @@
If you have older projects that show compatibility problems, you have two options:
\begin{itemize}
\item you can use an older version locally using the gitversion and picking the correct commit from the repository (branch ghpages) or the main GitHub site directly;
 \item if you are using \LaTeX, the distribution has embedded several important old versions: \texttt{0.4}, \texttt{0.6}, \texttt{0.7}, \texttt{0.8.3} and \texttt{0.9.3}. To switch to use them, you simply change your \verb\usepackage invocation like
+ \item if you are using \LaTeX, the distribution has embedded several important old versions: \texttt{0.4}, \texttt{0.6}, \texttt{0.7}, \texttt{0.8.3}, \texttt{0.9.3} and \texttt{0.9.6}. To switch to use them, you simply change your \verb\usepackage invocation like
\begin{lstlisting}
\usepackage[]{circuitik0.8.3} % or circuitikz0.4, 0.6...
\end{lstlisting}
You have to take care of the options that may have changed between versions;
 \item if you are using \ConTeXt, only versions \texttt{0.8.3} and \texttt{0.9.3} are packaged for now; if can use it with
+ \item if you are using \ConTeXt, only versions \texttt{0.8.3}, \texttt{0.9.3} and \texttt{0.9.6} are packaged for now; if can use it with
\begin{lstlisting}
\usemodule[circuitik0.8.3]
\end{lstlisting}
@@ 272,6 +273,8 @@
\end{tabular}
\end{center}
+\textbf{However}, most of the global package options are not available in \ConTeXt; in that case you can always use the appropriate \verb\tikzset{} or \verb\ctikzset{} command after loading the package.
+
\begin{LTXexample}[varwidth=true,linerange={11,36}]
\begin{circuitikz}
[circuitikz/voltage=american, circuitikz/resistor=american] % line not printed
@@ 315,6 +318,8 @@
\item \texttt{nofetsolderdot}: do not draw solderdot at bulksource junction of some transistors;
\item \texttt{emptypmoscircle}: the circle at the gate of a pmos transistor gets not filled;
\item \texttt{lazymos}: draws lazy nmos and pmos transistors. Chip designers with huge circuits prefer this notation;
+ \item \texttt{legacytransistorstext}: the text of transistor nodes is typeset near the collector;
+ \item \texttt{nolegacytransistorstext} or \texttt{centertransistorstext}: the text of transistor nodes is typeset near the center of the component;
\item \texttt{straightlabels}: labels on bipoles are always printed straight up, i.e.~with horizontal baseline;
\item \texttt{rotatelabels}: labels on bipoles are always printed aligned along the bipole;
\item \texttt{smartlabels}: labels on bipoles are rotated along the bipoles, unless the rotation is very close to multiples of 90°;
@@ 338,7 +343,7 @@
Loading the package with no options is equivalent to the following options:
\texttt{[nofetsolderdot, europeancurrents, europeanvoltages, americanports,
americanresistors, cuteinductors, europeangfsurgearrester, nosiunitx, noarrowmos,
 smartlabels, nocompatibility]}.
+ smartlabels, nocompatibility, centertransistorstext]}.
\medskip
@@ 381,7 +386,7 @@
\end{circuitikz}
\end{LTXexample}
You can use a single path or multiple path when drawing your circuit, it's just a question of style (but be aware that closing path could be nontrivial, see section~\ref{sec:linejoins}), and you can use standard \TikZ\ lines (\verb, \verb++ or similar) for the wires. Nonetheless, sometime using the \Circuitikz\ specific \texttt{short} component for the wires can be useful, because then we can add labels and nodes at it, like for example in the following circuit.
+You can use a single path or multiple path when drawing your circuit, it's just a question of style (but be aware that closing path could be nontrivial, see section~\ref{sec:linejoins}), and you can use standard \TikZ\ lines (\verb, \verb++ or similar) for the wires. Nonetheless, sometime using the \Circuitikz\ specific \texttt{short} component for the wires can be useful, because then we can add labels and nodes at it, like for example in the following circuit, where we add a current (with the key \texttt{i=...}, see section~\ref{sec:currents}) and a connection dot (with the special shortcut \texttt{*} which adds a \texttt{circ} node at the end of the connection, see sections~\ref{sec:terminals} and~\ref{sec:bipolenodes}).
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[american]
@@ 394,7 +399,7 @@
\end{circuitikz}
\end{LTXexample}
One of the problems with this circuit is that we would like to have the current in a different position, such as for example on the upper side of the resistors, so that Kirchoff's Current Law at the node is better shown to students. No problem; as you can see in section~\ref{currandvolt} you can use the position specifier \verb<>^_} after the key \texttt{i}:
+One of the problems with this circuit is that we would like to have the current in a different position, such as for example on the upper side of the resistors, so that Kirchoff's Current Law at the node is better shown to students. No problem; as you can see in section~\ref{currandvolt} you can use the position specifier \verb<>^_ after the key \texttt{i}:
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[american]
@@ 452,19 +457,29 @@
\begingroup % do not propagate to the rest of the manual
The idea is to draw a twostage amplifier for a lesson, or exercise, on the different qualities of BJT and MOSFET transistors.
Notice that this is a more ``personal'' tutorial, showing a way to draw circuits that is, in the author's opinion, highly reusable and easy to do.
+
+Please Notice that this section uses the ``new'' position for transistors labels, enabled since version \texttt{0.9.7}. You should refer to older manuals to see how to do the same with older versios; basically the transistor's names where put with a different \verbnode{} command.
+
+Also notice that this is a more ``personal'' tutorial, showing a way to draw circuits that is, in the author's opinion, highly reusable and easy to do.
The idea is using relative coordinates and named nodes as much as possible, so that changes in the circuit are easily done by changing keys numbers of position, and crucially, each block is reusable in other diagrams.
First of all, let's define a handy function to show the position of nodes:
\def\coord(#1){node[circle, red, draw, inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.1cm, pin edge={red, overlay,}]45:#1}](#1){}}
+\def\normalcoord(#1){coordinate(#1)}
+\def\showcoord(#1){node[circle, red, draw, inner sep=1pt,
+ pin={[red, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.1cm,
+ pin edge={red, overlay}]45:#1}](#1){}}
+\let\coord=\normalcoord
+\let\coord=\showcoord
\begin{lstlisting}
\def\coord(#1){coordinate(#1)}
\def\coord(#1){node[circle, red, draw, inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.1cm, pin edge={red, overlay,}]45:#1}](#1){}}
+\def\normalcoord(#1){coordinate(#1)}
+\def\showcoord(#1){node[circle, red, draw, inner sep=1pt,
+ pin={[red, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.1cm,
+ pin edge={red, overlay}]45:#1}](#1){}}
+\let\coord=\normalcoord
+\let\coord=\showcoord
\end{lstlisting}


The idea is that you can use \verb\coord() instead of \verbcoordinate() in paths, and that will draw sort of \emph{markers} showing them. For example:
\begin{LTXexample}[varwidth=true]
@@ 476,7 +491,7 @@
\end{circuitikz}
\end{LTXexample}
After the circuit is drawn, simply commenting out the second definition of \verb\coord will hide all the markers.
+After the circuit is drawn, simply commenting out the second \verb\let command will hide all the markers.
So let's start with the first stage transistor; given that my preferred way of drawing a MOSFET is with arrows, I'll start with the command \verb\ctikzset{tripoles/mos style/arrows}:
@@ 486,11 +501,13 @@
\begin{circuitikz}[american,]
\ctikzset{tripoles/mos style/arrows}
\def\killdepth#1{{\raisebox{0pt}[\height][0pt]{#1}}}
 \draw (0,0) node[nmos](Q1){};
 \draw (Q1.center) node[right]{\killdepth{Q1}};
+\path (0,0)  (2,0); % bounding box
+\draw (0,0) node[nmos](Q1){\killdepth{Q1}};
\end{circuitikz}
\end{LTXexample}
+I had to do draw an invisible line to take into account the text for Q1  the text is not taken into account in calculating the bounding box. This is because the ``geographical'' anchors (\texttt{north}, \texttt{north west}, \dots) are defined for the symbol only. In a complex circuit, this is rarely a problem.
+
Another thing I like to modify with respect to the standard is the position of the arrows in transistors, which are normally in the middle the symbol. Using the following setting (see section~\ref{sec:stylingtransistors}) will move the arrows to the start or end of the corresponding pin.
\ctikzset{transistors/arrow pos=end}
@@ 498,18 +515,15 @@
\ctikzset{transistors/arrow pos=end}
\end{lstlisting}
The tricky thing about \verb\killdepth{} macro is finnicky details; I do not like the standard position of labels on transistors (which is near the collector/drain) so I plot the label at the right of the \texttt{center} anchor. Without the \verb\killdepth macro, the labels of different transistor will be adjusted so that the center of the box is at the \texttt{center} anchor, and as an effect, labels with descenders (like Q) will have a different baseline than labels without. You can see this here (it's really subtle):
+The tricky thing about \verb\killdepth{} macro is finicky details. Without the \verb\killdepth macro, the labels of different transistor will be adjusted so that the vertical center of the box is at the \texttt{center} anchor, and as an effect, labels with descenders (like Q) will have a different baseline than labels without. You can see this here (it's really subtle):

\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[american,]
\draw (0,0) node[nmos](Q1){} ++(2,0) node[nmos](M1){};
\draw (Q1.center) node[right]{q1};
\draw (M1.center) node[right]{m1};
+\draw (0,0) node[nmos](Q1){q1} ++(2,0)
+ node[nmos](M1){m1};
\draw [red] (Q1.center) ++(0,0.7ex)  ++(3,0);
\draw (0,2)node[nmos](Q1){} ++(2,0) node[nmos](M1){};
\draw (Q1.center) node[right]{\killdepth{q1}};
\draw (M1.center) node[right]{\killdepth{m1}};
+\draw (0,2)node[nmos](Q1){\killdepth{q1}} ++(2,0)
+ node[nmos](M1){\killdepth{m1}};
\draw [red] (Q1.center) ++(0,0.7ex)  ++(3,0);
\end{circuitikz}
\end{LTXexample}
@@ 518,34 +532,36 @@
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[american,]
 \draw (0,0) node[nmos,](Q1){};
 \draw (Q1.center) node[right]{\killdepth{Q1}};
 \draw (Q1.S) to[R, l2^=$R_S$ and \SI{5}{k\ohm}] ++(0,3)
 node[vee](VEE){$V_{EE}=\SI{10}{V}$};
 \draw (Q1.D) to[R, l2_=$R_D$ and \SI{10}{k\ohm}] ++(0,3)
 node[vcc](VCC){$V_{CC}=\SI{10}{V}$};
 \draw (Q1.S) to[short] ++(2,0) to[C=$C_1$] ++(0,1.5) node[ground](GND){};
 \path (GND) \coord(GND) (VCC) \coord(VCC)
+ \draw (0,0) node[nmos,](Q1){\killdepth{Q1}};
+ \draw (Q1.S) to[R, l2^=$R_S$ and \SI{5}{k\ohm}]
+ ++(0,3) node[vee](VEE){$V_{EE}=\SI{10}{V}$};
+ \draw (Q1.D) to[R, l2_=$R_D$ and \SI{10}{k\ohm}]
+ ++(0,3) node[vcc](VCC){$V_{CC}=\SI{10}{V}$};
+ \draw (Q1.S) to[short] ++(2,0) to[C=$C_1$]
+ ++(0,1.5) node[ground](GND){};
+ % show the named coordinates!
+ \path (GND) \coord(GND)
+ (VCC) \coord(VCC)
(VEE) \coord(VEE);
\end{circuitikz}
\end{LTXexample}
After that, let's add the input part. I will use a named node here, to refer to it to add the input source. Notice how the ground node is positioned: the coordinate \texttt{(in  GND)} is the point with the horizontal coordinate of \texttt{(in)} and the horizontal one of \texttt{(GND)}, lining it up with the ground of the capacitor $C_1$.
+After that, let's add the input part. I will use a named node here, to refer to it to add the input source. Notice how the ground node is positioned: the coordinate \texttt{(in  GND)} is the point with the horizontal coordinate of \texttt{(in)} and the vertical one of \texttt{(GND)}, lining it up with the ground of the capacitor $C_1$ (you can think it as ``the point on the vertical of \texttt{in} and the horizontal of \texttt{GND}'').
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}[american, scale=0.7]
 \draw (0,0) node[nmos,](Q1){};
 \draw (Q1.center) node[right]
 {\killdepth{Q1}};
 \draw (Q1.S) to[R, l2^=$R_S$ and \SI{5}{k\ohm}] ++(0,3)
 node[vee](VEE){$V_{EE}=\SI{10}{V}$};
 \draw (Q1.D) to[R, l2_=$R_D$ and \SI{10}{k\ohm}] ++(0,3)
 node[vcc](VCC){$V_{CC}=\SI{10}{V}$};
 \draw (Q1.S) to[short] ++(2,0) to[C=$C_1$] ++(0,1.5) node[ground](GND){};
 \draw (Q1.G) to[short] ++(1,0)
 \coord (in) to[R, l2^=$R_G$ and \SI{1}{M\ohm}]
 (in  GND) node[ground]{};
 \draw (in) to[C, l_=$C_2$,*o] ++(1.5,0) node[left](vi1){$v_i=v_{i1}$};
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}[american, scale=0.7, transform shape]
+\draw (0,0) node[nmos,](Q1){\killdepth{Q1}};
+\draw (Q1.S) to[R, l2^=$R_S$ and \SI{5}{k\ohm}]
+ ++(0,3) node[vee](VEE){$V_{EE}=\SI{10}{V}$};
+\draw (Q1.D) to[R, l2_=$R_D$ and \SI{10}{k\ohm}]
+ ++(0,3) node[vcc](VCC){$V_{CC}=\SI{10}{V}$};
+\draw (Q1.S) to[short] ++(2,0) to[C=$C_1$]
+ ++(0,1.5) node[ground](GND){};
+\draw (Q1.G) to[short] ++(1,0)
+ \coord (in) to[R, l2^=$R_G$ and \SI{1}{M\ohm}]
+ (in  GND) node[ground]{};
+\draw (in) to[C, l_=$C_2$,*o]
+ ++(1.5,0) node[left](vi1){$v_i=v_{i1}$};
\end{circuitikz}
\end{LTXexample}
@@ 552,17 +568,17 @@
Notice that the only absolute coordinate here is the first one, \texttt{(0,0)}; so the elements are connected with relative movements and can be moved by just changing one number (for example, changing the \verb to[C=$C_1$] ++(0,1.5)  will move \emph{all} the grounds down).
This is the final circuit, with the nodes still marked:
\begin{lstlisting}
+\begin{lstlisting}[basicstyle=\small\ttfamily, escapechar=@]
+% this is for the blue brackets under the circuit
\tikzset{blockdef/.style={%
{Straight Barb[harpoon, reversed, right, length=0.2cm]}{Straight Barb[harpoon, reversed, left, length=0.2cm]},
 blue, %densely dotted,
+ blue,
}}
\def\killdepth#1{{\raisebox{0pt}[\height][0pt]{#1}}}
\def\coord(#1){coordinate(#1)}
\def\coord(#1){node[circle, red, draw, inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.1cm, pin edge={red, overlay,}]45:#1}](#1){}}
\begin{circuitikz}[american, ]
 \draw (0,0) node[nmos,](Q1){};
 \draw (Q1.center) node[right]{\killdepth{Q1}};
+ \draw (0,0) node[nmos,](Q1){\killdepth{Q1}};
\draw (Q1.S) to[R, l2^=$R_S$ and \SI{5}{k\ohm}] ++(0,3) node[vee](VEE){$V_{EE}=\SI{10}{V}$}; %define VEE level
\draw (Q1.S) to[short] ++(2,0) to[C=$C_1$] ++(0,1.5) node[ground](GND){};
\draw (Q1.G) to[short] ++(1,0) \coord (in) to[R, l2^=$R_G$ and \SI{1}{M\ohm}] (in  GND) node[ground]{};
@@ 570,10 +586,9 @@
\draw (Q1.D) to[R, l2_=$R_D$ and \SI{10}{k\ohm}] ++(0,3) node[vcc](VCC){$V_{CC}=\SI{10}{V}$};
\draw (Q1.D) to[short, o] ++(1,0) node[right](vo1){$v_{o1}$};
%
 \path (vo1)  ++(3,0) \coord(bjt);
+ \path (vo1)  ++(2,0) \coord(bjt); @\label{codeline:positionbjt}@
%
 \draw (bjt) node[npn, ](Q2){};
 \draw (Q2.center) node[right]{\killdepth{Q2}};
+ \draw (bjt) node[npn, anchor=B](Q2){\killdepth{Q2}};
\draw (Q2.B) to[short, o] ++(0.5,0) node[left](vi2){$v_{12}$};
\draw (Q2.E) to[R,l2^=$R_E$ and \SI{9.3}{k\ohm}] (Q2.E  VEE) node[vee]{};
\draw (Q2.E) to[short, o] ++(1,0) node[right](vo2){$v_{o2}$};
@@ 601,8 +616,7 @@
\def\coord(#1){coordinate(#1)}
\def\coord(#1){node[circle, red, draw, inner sep=1pt,pin={[red, overlay, inner sep=0.5pt, font=\tiny, pin distance=0.1cm, pin edge={red, overlay,}]45:#1}](#1){}}
\begin{circuitikz}[american, ]
 \draw (0,0) node[nmos,](Q1){};
 \draw (Q1.center) node[right]{\killdepth{Q1}};
+ \draw (0,0) node[nmos,](Q1){\killdepth{Q1}};
\draw (Q1.S) to[R, l2^=$R_S$ and \SI{5}{k\ohm}] ++(0,3) node[vee](VEE){$V_{EE}=\SI{10}{V}$}; %define VEE level
\draw (Q1.S) to[short] ++(2,0) to[C=$C_1$] ++(0,1.5) node[ground](GND){};
\draw (Q1.G) to[short] ++(1,0) \coord (in) to[R, l2^=$R_G$ and \SI{1}{M\ohm}] (in  GND) node[ground]{};
@@ 610,10 +624,9 @@
\draw (Q1.D) to[R, l2_=$R_D$ and \SI{10}{k\ohm}] ++(0,3) node[vcc](VCC){$V_{CC}=\SI{10}{V}$};
\draw (Q1.D) to[short, o] ++(1,0) node[right](vo1){$v_{o1}$};
%
 \path (vo1)  ++(3,0) \coord(bjt);
+ \path (vo1)  ++(2,0) \coord(bjt);
%
 \draw (bjt) node[npn, ](Q2){};
 \draw (Q2.center) node[right]{\killdepth{Q2}};
+ \draw (bjt) node[npn, anchor=B](Q2){\killdepth{Q2}};
\draw (Q2.B) to[short, o] ++(0.5,0) node[left](vi2){$v_{12}$};
\draw (Q2.E) to[R,l2^=$R_E$ and \SI{9.3}{k\ohm}] (Q2.E  VEE) node[vee]{};
\draw (Q2.E) to[short, o] ++(1,0) node[right](vo2){$v_{o2}$};
@@ 629,9 +642,10 @@
 node[midway, fill=white]{bloque 1} (vo1 tmp);
\draw [blockdef] (vi2VEE) ++(0,2) \coord(tmp)
 node[midway, fill=white]{bloque 2} (vo2 tmp);

\end{circuitikz}
+You can see that after having found the place where we want to put the BJT transistor (line~\ref{codeline:positionbjt}), we use the option \texttt{anchor=B} so that the base anchor will be put at the coordinate \texttt{bjt}.
+
Finally, if you like a more compact drawing, you can add the options (for example):
\begin{lstlisting}
\begin{circuitikz}[american, scale=0.8] % this will scale only the coordinates
@@ 644,9 +658,8 @@
\ctikzset{resistors/scale=0.7, capacitors/scale=0.6}
\def\coord(#1){coordinate(#1)}
\begin{circuitikz}[american, scale=0.8]
 \draw (0,0) node[nmos,](Q1){};
 \draw (Q1.center) node[right]{\killdepth{Q1}};
+\begin{circuitikz}[american, ]
+ \draw (0,0) node[nmos,](Q1){\killdepth{Q1}};
\draw (Q1.S) to[R, l2^=$R_S$ and \SI{5}{k\ohm}] ++(0,3) node[vee](VEE){$V_{EE}=\SI{10}{V}$}; %define VEE level
\draw (Q1.S) to[short] ++(2,0) to[C=$C_1$] ++(0,1.5) node[ground](GND){};
\draw (Q1.G) to[short] ++(1,0) \coord (in) to[R, l2^=$R_G$ and \SI{1}{M\ohm}] (in  GND) node[ground]{};
@@ 654,10 +667,9 @@
\draw (Q1.D) to[R, l2_=$R_D$ and \SI{10}{k\ohm}] ++(0,3) node[vcc](VCC){$V_{CC}=\SI{10}{V}$};
\draw (Q1.D) to[short, o] ++(1,0) node[right](vo1){$v_{o1}$};
%
 \path (vo1)  ++(3,0) \coord(bjt);
+ \path (vo1)  ++(2,0) \coord(bjt);
%
 \draw (bjt) node[npn, ](Q2){};
 \draw (Q2.center) node[right]{\killdepth{Q2}};
+ \draw (bjt) node[npn, anchor=B](Q2){\killdepth{Q2}};
\draw (Q2.B) to[short, o] ++(0.5,0) node[left](vi2){$v_{12}$};
\draw (Q2.E) to[R,l2^=$R_E$ and \SI{9.3}{k\ohm}] (Q2.E  VEE) node[vee]{};
\draw (Q2.E) to[short, o] ++(1,0) node[right](vo2){$v_{o2}$};
@@ 673,10 +685,8 @@
 node[midway, fill=white]{bloque 1} (vo1 tmp);
\draw [blockdef] (vi2VEE) ++(0,2) \coord(tmp)
 node[midway, fill=white]{bloque 2} (vo2 tmp);

\end{circuitikz}

\endgroup
@@ 873,12 +883,12 @@
\noindent Which is ok: just use the environment \verb!tikzpicture!: everything will work there just fine.
\end{framed}
\subsubsection{Mirroring and flipping}
+\subsubsection{Mirroring and flipping}\label{sec:mirroringandflipping}
Mirroring and flipping of node components is obtained by using the \TikZ\ keys \texttt{xscale} and \texttt{yscale}. Notice that this parameters affect also text labels, so they need to be unscaled by hand.
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}[scale=0.7, transform shape]
\draw (0,3) node[op amp]{OA1};
\draw (3,3) node[op amp, xscale=1]{OA2};
\draw (0,0) node[op amp]{OA3};
@@ 887,6 +897,21 @@
\end{circuitikz}
\end{LTXexample}
+To simplify this task, \Circuitikz{} has three helper macros  \verb\ctikzflipx{}, \verb\ctikzflipy{},
+and \verb\ctikzflipxy{}, that can be used to ``unrotate'' the text of nodes drawn with, respectively,
+\texttt{xscale=1}, \texttt{yscale=1}, and \texttt{scale=1} (which is equivalent to
+\texttt{xscale=1, yscale=1}).
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}[scale=0.7, transform shape]
+ \draw (0,3) node[op amp]{OA1};
+ \draw (3,3) node[op amp, xscale=1]{\ctikzflipx{OA2}};
+ \draw (0,0) node[op amp, yscale=1]{\ctikzflipy{OA3}};
+ \draw (3,0) node[op amp, scale=1]{\ctikzflipxy{OA4}};
+\end{circuitikz}
+\end{LTXexample}
+
+
\subsubsection{Anchors}
Node components anchors are variable across the various kind of components, so they will described better after each category is presented in the manual.
@@ 1178,7 +1203,7 @@
\end{circuitikz}
\end{LTXexample}
However, arrows in \TikZ{} are in the same class with the line thickness, so they do not scale with neither the class \texttt{power supplies} scale nor the global scale parameter (you should use \texttt{transform canvas={scale\dots}} for this).
+However, arrows in \TikZ{} are in the same class with the line thickness, so they do not scale with neither the class \texttt{power supplies} scale nor the global scale parameter (you should use \texttt{transform canvas=\{scale\dots\}} for this).
If you want that the arrows behave like the legacy symbols (which are shapes), \emph{only in the arrow definitions}, you can use the special length parameter \verb\scaledwidth\footnote{Thanks to @Schrödinger's cat on \href{https://tex.stackexchange.com/a/506249/38080}{\TeX{} stackexchange site}} in the arrow definition, which correspond to the width of the legacy \texttt{vcc} or \texttt{vee}. Compare the effects on the following circuit.
@@ 2198,14 +2223,16 @@
\subsubsection{Standard bipolar transistors}
\begin{groupdesc}
 \circuitdesc{npn}{npn}{}( B/180/0.2,C/0/0.2,E/0/0.2 )
+ \circuitdesc{npn}{npn}{Q}( B/180/0.2,C/0/0.2,E/0/0.2 )
\circuitdesc{pnp}{pnp}{}
+ \circuitdesc{npn, bodydiode}{npn}{}(body C in/60/0.2, body E in/60/0.2,body C out/0/0.3, body E out/0/0.3)
\circuitdesc{npn,photo}{npn}{}( nobase/0/0.4 )
\circuitdesc{pnp,photo}{pnp}{}
 \circuitdesc{nigbt}{nigbt}{}
+ \circuitdesc{nigbt}{nigbt}{Q}
\circuitdesc{pigbt}{pigbt}{}
 \circuitdesc{Lnigbt}{Lnigbt}{}
+ \circuitdesc{Lnigbt}{Lnigbt}{Q}
\circuitdesc{Lpigbt}{Lpigbt}{}
+ \circuitdesc{Lpigbt, bodydiode}{Lpigbt}{Q}(body C in/60/0.2, body E in/60/0.2,body C out/0/0.3, body E out/0/0.3)
\end{groupdesc}
\subsubsection{Multiterminal bipolar transistors}
@@ 2222,7 +2249,7 @@
\subsubsection{Fieldeffect transistors}
\begin{groupdesc}
 \circuitdesc{nmos}{nmos}{}( G/180/0.2,D/0/0.2,S/0/0.2 )
+ \circuitdesc{nmos}{nmos}{Q}( G/180/0.2,D/0/0.2,S/0/0.2 )
\circuitdesc{pmos}{pmos}{}
\circuitdesc{hemt}{hemt}{}
\end{groupdesc}
@@ 2230,12 +2257,12 @@
\textsc{nfet}s and \textsc{pfet}s have been incorporated based on code provided by Clemens Helfmeier and Theodor Borsche. Use the package options \texttt{fetsolderdot}/\texttt{nofetsolderdot} to enable/disable solderdot at some fettransistors. Additionally, the solderdot option can be enabled/disabled for single transistors with the option "solderdot" and "nosolderdot", respectm ively.
\begin{groupdesc}
 \circuitdesc{nfet}{nfet}{}
 \circuitdesc{nigfete}{nigfete}{}
+ \circuitdesc{nfet}{nfet}{Q}
+ \circuitdesc{nigfete}{nigfete}{Q}
\circuitdesc{nigfete,solderdot}{nigfete}{}
\circuitdesc{nigfetebulk}{nigfetebulk}{}
\circuitdesc{nigfetd}{nigfetd}{}
 \circuitdesc{pfet}{pfet}{}
+ \circuitdesc{pfet}{pfet}{Q}
\circuitdesc{pigfete}{pigfete}{}
\circuitdesc{pigfetebulk}{pigfetebulk}{}
\circuitdesc{pigfetd}{pigfetd}{}
@@ 2243,19 +2270,42 @@
\textsc{njfet} and \textsc{pjfet} have been incorporated based on code provided by Danilo Piazzalunga:
\begin{groupdesc}
 \circuitdesc{njfet}{njfet}{}
+ \circuitdesc{njfet}{njfet}{Q}
\circuitdesc{pjfet}{pjfet}{}
\end{groupdesc}
\textsc{isfet}
\begin{groupdesc}
 \circuitdesc{isfet}{isfet}{}
+ \circuitdesc{isfet}{isfet}{Q}
\end{groupdesc}
+\subsubsection{Transistor texts (labels)}\label{sec:transistorslabels}
+
+In versions before \texttt{0.9.7}, transistors text (the node text) was positioned near the collector terminal; since version \texttt{0.9.7} the default has been changed to a more natural position near the center of the device, similar to the multiteminal transistors. You can revert to the old behavior locally with the key \texttt{legacy transistors text}, or globally by setting the package option \texttt{legacytransistorstext}.
+
+Notice the use of the utility functions \verb\ctikzflip{\texttt{\textsl{x,y,xy}}\verb} as explained in section~\ref{sec:mirroringandflipping}.
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\begin{circuitikz}[scale=0.8, transform shape]
+ \draw (0,0) node [npn]{T1}
+ ++(1.2,0) node [npn, xscale=1]{\ctikzflipx{T1}}
+ ++(2,0) node [npn, yscale=1]{\ctikzflipy{T1}}
+ ++(1.2,0) node [npn, scale=1]{\ctikzflipxy{T1}};
+ \ctikzset{legacy transistors text}
+ \draw (0,2) node [npn]{T1}
+ ++(1.2,0) node [npn, xscale=1]{\ctikzflipx{T1}}
+ ++(2,0) node [npn, yscale=1]{\ctikzflipy{T1}}
+ ++(1.2,0) node [npn, scale=1]{\ctikzflipxy{T1}};
+\end{circuitikz}
+\end{LTXexample}
+
\subsubsection{Transistors customization}\label{sec:stylingtransistors}
The default position of the arrows in transistors is somewhat in the middle of the terminal; if you prefer you can move them to the end with the style key \texttt{transistors/arrow pos=end} (the default value is \texttt{legacy}).
+\paragraph{Size.} You can change the scale of all the transistors by setting the key \texttt{transistors/scale} (default \texttt{1.0}).
+The size of the arrows (if any) is controlled by the same parameters as \texttt{currarrow} (see section~\ref{sec:currarrowsize}) and the dots on Ptype transistors (if any) are the same as the nodes/poles (see section~\ref{sec:bipolenodes}).
+\paragraph{Arrows.} The default position of the arrows in transistors is somewhat in the middle of the terminal; if you prefer you can move them to the end with the style key \texttt{transistors/arrow pos=end} (the default value is \texttt{legacy}).
+
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
\ctikzset{tripoles/mos style=arrows}
@@ 2267,20 +2317,52 @@
\end{circuitikz}
\end{LTXexample}
You can change the scale of all the transistors by setting the key \texttt{transistors/scale} (default \texttt{1.0}).
The size of the arrows (if any) is controlled by the same parameters as \texttt{currarrow} (see section~\ref{sec:currarrowsize}) and the dots on Ptype transistors (if any) are the same as the nodes/poles (see section~\ref{sec:bipolenodes}).
+If the option \texttt{arrowmos} is used (or after the command \verb!\ctikzset{tripoles/mos style/arrows}! is given), this is the output:
+\begin{groupdesc}
+ \ctikzset{tripoles/mos style/arrows}
+ \circuitdesc{nmos}{nmos}{}
+ \circuitdesc{pmos}{pmos}{}
+\end{groupdesc}
For all transistors (minus \texttt{bjtnpn} and \texttt{bjtpnp}) a body diode (or freewheeling diode) can automatically be drawn. Just use the global option bodydiode, or for single transistors, the tikzoption bodydiode:
+You can go back to the noarrows mos with \texttt{noarrowmos} locally or with
+\texttt{\textbackslash ctikzset\{tripoles/mos style/no arrows\}}.
+\paragraph{Body diodes and similar things.}\label{sec:bodydiodesanchor} For all transistors (minus \texttt{bjtnpn} and \texttt{bjtpnp}) a body diode (or freewheeling or flyback diode) can automatically be drawn. Just use the global option \texttt{bodydiode}, or for single transistors, the tikzoption \texttt{bodydiode}.
+As you can see in the next example, the text for the diode is moved if a bodydiode is present (but beware, if you change a lot the relative dimension of components, it may become misplaced):
+
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
 \draw (0,0) node[npn,bodydiode](npn){}++(2,0)node[pnp,bodydiode](npn){};
 \draw (0,2) node[nigbt,bodydiode](npn){}++(2,0)node[pigbt,bodydiode](npn){};
 \draw (0,4) node[nfet,bodydiode](npn){}++(2,0)node[pfet,bodydiode](npn){};
+ \draw (0,0) node[npn,bodydiode](npn){1}
+ ++(2,0)node[pnp,bodydiode](npn){};
+ \draw (0,2) node[nigbt,bodydiode](npn){2}
+ ++(2,0)node[pigbt,bodydiode](npn){};
+ \draw (0,4) node[nfet,bodydiode](npn){3}
+ ++(2,0)node[pfet,bodydiode](npn){};
\end{circuitikz}
\end{LTXexample}
The Base/Gate connection of all transistors can be disabled by the options \textit{nogate} or \textit{nobase}, respectively. The Base/Gate anchors are floating, but there is an additional anchor "nogate"/"nobase", which can be used to point to the unconnected base:
+You can use the \texttt{body ...} anchors to add more or different things to the transistors in addition (or instead) of the flyback diode.
+
+\begin{LTXexample}[varwidth=true, basicstyle=\small\ttfamily]
+\def\snubb#1#2{% add a snubber to a transistor
+ \draw (#1.body C #2) to[short, *, nodes width=0.02]
+ ++(0.3,0) coordinate(tmp) to [R, resistors/scale=0.3]
+ % 2/3 space for R, 1/3 for C
+ ($(tmp)!0.66!(tmp#1.body E #2)$)
+ to [C, capacitors/scale=0.3] (tmp#1.body E #2)
+ to [short, *, nodes width=0.02] (#1.body E #2);
+}
+\begin{circuitikz}
+ \node[npn](Q1) at(0,0) {};
+ \node[pnp](Q2) at(2,0) {};
+ \node[pnp, bodydiode](Q3) at(0,3) {};
+ \node[npn, bodydiode](Q4) at(2,3) {};
+ \snubb{Q1}{in} \snubb{Q2}{in}
+ \snubb{Q3}{out} \snubb{Q4}{out}
+\end{circuitikz}
+\end{LTXexample}
+
+\paragraph{Base/Gate terminal.} The Base/Gate connection of all transistors can be disabled by the options \textit{nogate} or \textit{nobase}, respectively. The Base/Gate anchors are floating, but there is an additional anchor "nogate"/"nobase", which can be used to point to the unconnected base:
\begin{LTXexample}[varwidth=true]
\begin{circuitikz}
\draw (2,0) node[npn,nobase](npn){};
@@ 2291,16 +2373,6 @@
\end{circuitikz}
\end{LTXexample}
If the option \texttt{arrowmos} is used (or after the command \verb!\ctikzset{tripoles/mos style/arrows}! is given), this is the output:
\begin{groupdesc}
 \ctikzset{tripoles/mos style/arrows}
 \circuitdesc{nmos}{nmos}{}
 \circuitdesc{pmos}{pmos}{}
\end{groupdesc}

You can go back to the noarrows mos with \texttt{noarrowmos} locally or with
\texttt{\textbackslash ctikzset\{tripoles/mos style/no arrows\}}.

To draw the PMOS circle nonsolid, use the option \texttt{emptycircle} or the command
\\\verb!\ctikzset{tripoles/pmos style/emptycircle}!. To remove the dot completely (only useful if you have \texttt{arrowmos} enabled, otherwise there will be no difference between PMOS and NMOS), you can use the option \texttt{nocircle} or \verb\ctikzset{tripoles/pmos style/nocircle}.
@@ 2309,7 +2381,7 @@
\circuitdesc{pmos,nocircle,arrowmos}{pmos}{}
\end{groupdesc}
You can add a bulk terminal\footnote{Thanks to Burak Kelleci <kellecib at hotmail.com>.} to \texttt{nmos} and \texttt{pmos} using the key \texttt{bulk} in the node (and \texttt{nobulk} if you set the bulk terminal by default); additional anchors \texttt{bulk} and \texttt{nobulk} are added (in the next example, \texttt{tripoles/mos style/arrows} is enacted, too):
+\paragraph{Bulk terminals.} You can add a bulk terminal\footnote{Thanks to Burak Kelleci <kellecib at hotmail.com>.} to \texttt{nmos} and \texttt{pmos} using the key \texttt{bulk} in the node (and \texttt{nobulk} if you set the bulk terminal by default); additional anchors \texttt{bulk} and \texttt{nobulk} are added (in the next example, \texttt{tripoles/mos style/arrows} is enacted, too):
\begin{groupdesc}
\ctikzset{tripoles/mos style/arrows}
@@ 2335,7 +2407,7 @@
\subsubsection{Multiple terminal transistors customization}
You can create completely ``bare'' transistors (without the connection leads to the \texttt{B}, \texttt{C} y \texttt{E} terminals), by changing the parameter \texttt{tripoles/bjt/pins width} (default \texttt{0.3}; it is expressed as a fraction of the basic (scaled) length) or using the style \texttt{bjt pins width}; and you can change the distance between multiple collectors/emitters setting with \verb\ctikzset{} the parameter \texttt{tripoles/bjt/multi height/} (default \texttt{0.5}) or the style \texttt{bjt multi height}.
+You can create completely ``bare'' transistors (without the connection leads to the \texttt{B}, \texttt{C} y \texttt{E} terminals), by changing the parameter \texttt{tripoles/bjt/pins width} (default \texttt{0.3}; it is expressed as a fraction of the basic (scaled) length) or using the style \texttt{bjt pins width}; and you can change the distance between multiple collectors/emitters setting with \verb\ctikzset{} the parameter \texttt{tripoles/bjt/multi height} (default \texttt{0.5}) or the style \texttt{bjt multi height}.
\begin{groupdesc}
\circuitdesc{bjtnpn, collectors=2, emitters=2, bjt pins width=0, bjt multi height=0.8}{bjt npn with parameters}{Q}(B/180/0.2, C/45/0.2, E/45/0.2, C1/0/0.4, C2/0/0.4, E1/0/0.4, E2/0/0.4, nobase/135/0.4, cbase/135/0.4)
@@ 2412,9 +2484,16 @@
\end{circuitikz}
\end{LTXexample}
+Additionally, you can access the position for the flyback diodes and possibly snubbers as shown in~\ref{sec:bodydiodesanchor}.
+\begin{quote}
+\showanchors{npn}{}(body C in/45/0.4, body E in/45/0.4, body C out/0/0.4, body E out/0/0.4)
+\showanchors{npn, bodydiode}{}(body C in/45/0.4, body E in/45/0.4, body C out/0/0.4, body E out/0/0.4)
+\showanchors{pnp}{}(body C in/45/0.4, body E in/45/0.4, body C out/0/0.4, body E out/0/0.4)
+\end{quote}
+
The multiterminal transistors have all the geographical anchors; note though that the \texttt{center} anchor is not the geometrical center of the component, but the logical one (at the same height than the base).
The additional anchors \texttt{vcenter} (vertical geometric center of the collectoremitter zone) and \texttt{gcenter} (graphical center) are provided, as shown in the following picture.
+The additional anchors \texttt{vcenter} (vertical geometric center of the collectoremitter zone) and \texttt{gcenter} (graphical center) are provided, as shown in the following picture. They have no bodydiode anchors nor \texttt{inner \emph{up/down}} ones.
\begin{quote}
\geocoord{bjtnpn, collectors=1, emitters=2}
@@ 2448,12 +2527,14 @@
Here is one composite example (please notice that the \texttt{xscale=1} style would also reflect the label of the transistors, so here a new node is added and its text is used, instead of that of \texttt{pnp1}):
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw
 (0,0) node[pnp] (pnp2) {2}
+ % \begin{circuitikz} [legacy transistors label]\draw
+ \begin{circuitikz} []\draw
+ (0,0) node[pnp] (pnp2) {Q2}
(pnp2.B) node[pnp, xscale=1, anchor=B] (pnp1) {}
 (pnp1) node {1}
 (pnp1.C) node[npn, anchor=C] (npn1) {}
 (pnp2.C) node[npn, xscale=1, anchor=C] (npn2) {}
+ (pnp1) node[left, inner sep=0pt] {Q1}
+ (pnp1.C) node[npn, anchor=C] (npn1) {Q3}
+ (pnp2.C) node[npn, xscale=1, anchor=C] (npn2)
+ {\scalebox{1}[1]{Q4}}
(pnp1.E)  (pnp2.E) (npn1.E)  (npn2.E)
(pnp1.B) node[circ] {}  (pnp2.C) node[circ] {}
;\end{circuitikz}
@@ 2474,7 +2555,8 @@
\subsubsection{Transistor paths}\label{sec:transasbip}
For syntactical convenience transistors can be placed using the normal path notation used for bipoles. The transitor type can be specified by simply adding a ``T'' (for transistor) in front of the node name of the transistor. It will be placed with the base/gate orthogonal to the direction of the path:
+For syntactical convenience standard transistors (not multiterminal ones) can be placed using the normal path notation used for bipoles. The transitor type can be specified by simply adding a ``T'' (for transistor) in front of the node name of the transistor. It will be placed with the base/gate orthogonal to the direction of the path:
+
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw
(0,0) node[njfet] {1}
@@ 2486,10 +2568,10 @@
Access to the gate and/or base nodes can be gained by naming the transistors with the \texttt{n} or \texttt{name} path style:
\begin{LTXexample}[varwidth=true]
\begin{circuitikz} \draw[yscale=1.1, xscale=.8]
 (2,4.5)  (0,4.5) to[Tpmos, n=p1] (0,3)
 to[Tnmos, n=n1] (0,1.5)
 to[Tnmos, n=n2] (0,0) node[ground] {}
 (2,4.5) to[Tpmos,n=p2] (2,3) to[short, *] (0,3)
+ (2,4.5)  (0,4.5) to[Tpmos=p1, n=p1] (0,3)
+ to[Tnmos=n1, n=n1] (0,1.5)
+ to[Tnmos=n2, n=n2] (0,0) node[ground] {}
+ (2,4.5) to[Tpmos=p2,n=p2] (2,3) to[short, *] (0,3)
(p1.G)  (n1.G) to[short, *o] ($(n1.G)+(3,0)$)
(n2.G) ++(2,0) node[circ] {}  (p2.G)
(n2.G) to[short, o] ($(n2.G)+(3,0)$)
@@ 2498,10 +2580,10 @@
\end{LTXexample}
Transistor paths have the possibility to use the poles syntax (see section~\ref{sec:bipolenodes}) but they have \textbf{no} voltage, current, flow, annotation options.
+Also, the positioning of the labels is very simple and is not foolproof for all rotations; if you need to control them more please name the node and position them by hand, or use the more natural node style for transistors.
The \texttt{name} property is available also for bipoles; this is useful mostly for triac, potentiometer and thyristor (see~\ref{sec:othertrip}).

\subsection{Electronic Tubes}
Electronic tubes, also known as vacuum tubes, control current flow between electrodes. They come in many different flavours.
@@ 4107,7 +4189,7 @@
This manual has been typeset with the option \texttt{\chosenvoltoption}.
\subsection{Currents}
+\subsection{Currents}\label{sec:currents}
Inline (along the wire) currents are selected with \verbi_>, \verbi^<, \verbi>_, \verbi>^, and various simplification; the default position and direction is obtained with the key \verbi=....
@@ 5153,7 +5235,7 @@
\usepackage[T1]{fontenc}
\parindent=0pt
\parskip=4pt plus 6pt minus 2pt
\usepackage[siunitx, RPvoltages]{circuitikz}
+\usepackage[siunitx, RPvoltages]{circuitikzgit}
\usepackage{ctikzmanutils}
\makeatletter
%% Test things here
Added: trunk/Master/texmfdist/tex/context/third/circuitikz/tcircuitikz0.9.6.tex
===================================================================
 trunk/Master/texmfdist/tex/context/third/circuitikz/tcircuitikz0.9.6.tex (rev 0)
+++ trunk/Master/texmfdist/tex/context/third/circuitikz/tcircuitikz0.9.6.tex 20191201 21:35:44 UTC (rev 52990)
@@ 0,0 +1,18067 @@
+\def\pgfcircversion{0.9.6}
+\def\pgfcircversiondate{2019/11/09}
+\writestatus{loading}{\pgfcircversiondate{} The CircuiTikz circuit drawing package version \pgfcircversion}
+
+\usemodule[tikz]
+
+\startmodule[circuitikz0.9.6]
+\usetikzlibrary[calc]
+\usetikzlibrary[arrows.meta, bending]
+
+\unprotect
+
+\edef\tikzatcode{\the\catcode`\@}
+\edef\tikzbarcode{\the\catcode`\}
+\edef\tikzexclaimcode{\the\catcode`\!}
+\catcode`\@=11
+\catcode`\=12
+\catcode`\!=12
+
+%%%%%%%%%%% Springe nach tex/pgfcirc.defines
+%%% open: tex/pgfcirc.defines.tex
+%% Key managements
+
+\long\def\pgf at circ@comment#1{}
+
+\def\circuitikzbasekey{/tikz/circuitikz}
+
+\pgfkeys{\circuitikzbasekey/.is family}
+
+\def\circuitikzset#1{\pgfkeys{\circuitikzbasekey,#1}}
+\let\ctikzset\circuitikzset
+\def\ctikzvalof#1{\pgfkeysvalueof{\circuitikzbasekey/#1}}
+\def\ctikzsetvalof#1#2{\pgfkeyssetvalue{\circuitikzbasekey/#1}{#2}}
+
+%% Temporary Counters
+
+\newcount\pgf at circ@count at a
+\newcount\pgf at circ@count at b
+\newcount\pgf at circ@count at c
+%%%%%%%%%%%%
+%% Dimensions
+
+% coordinates
+\newdimen\pgf at circ@res at up
+\newdimen\pgf at circ@res at down
+\newdimen\pgf at circ@res at zero
+\newdimen\pgf at circ@res at left
+\newdimen\pgf at circ@res at right
+\newdimen\pgf at circ@res at other
+\newdimen\pgf at circ@res at step
+\newdimen\pgf at circ@res at temp
+% inital thickness
+\newdimen \pgfstartlinewidth
+
+% arrow tips, ported over old arrows library (deprecated)
+% see https://tex.stackexchange.com/questions/234084/latexarrowtipwitharrowsmetalibrary
+% this was the original definition of latex' tips, renamed to avoid clashes
+%
+\pgfarrowsdeclare{latexslim}{latexslim}
+{
+ \pgfutil at tempdima=0.28pt%
+ \advance\pgfutil at tempdima by.3\pgflinewidth%
+ \pgfarrowsleftextend{+4\pgfutil at tempdima}
+ \pgfarrowsrightextend{+6\pgfutil at tempdima}
+}
+{
+ \pgfutil at tempdima=0.28pt%
+ \advance\pgfutil at tempdima by.3\pgflinewidth%
+ \pgfpathmoveto{\pgfqpoint{6\pgfutil at tempdima}{0\pgfutil at tempdima}}
+ \pgfpathcurveto
+ {\pgfqpoint{3.5\pgfutil at tempdima}{.5\pgfutil at tempdima}}
+ {\pgfqpoint{1\pgfutil at tempdima}{1.5\pgfutil at tempdima}}
+ {\pgfqpoint{4\pgfutil at tempdima}{3.75\pgfutil at tempdima}}
+ \pgfpathcurveto
+ {\pgfqpoint{1.5\pgfutil at tempdima}{1\pgfutil at tempdima}}
+ {\pgfqpoint{1.5\pgfutil at tempdima}{1\pgfutil at tempdima}}
+ {\pgfqpoint{4\pgfutil at tempdima}{3.75\pgfutil at tempdima}}
+ \pgfpathcurveto
+ {\pgfqpoint{1\pgfutil at tempdima}{1.5\pgfutil at tempdima}}
+ {\pgfqpoint{3.5\pgfutil at tempdima}{.5\pgfutil at tempdima}}
+ {\pgfqpoint{6\pgfutil at tempdima}{0\pgfutil at tempdima}}
+ \pgfpathclose
+ \pgfusepathqfill
+}
+
+\pgfarrowsdeclarereversed{latexslim reversed}{latexslim reversed}{latexslim}{latexslim}
+
+\def\pgf at circ@setifdefinedfill#1#2{%
+ % if \ctikzclass is defined and \ctikzclass/fill is defined and is not none:
+ % set the fill color and execute \pgfusepath{#1}, else execute \pgfusepath{#2}
+ \ifdefined\ctikzclass
+ \pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/fill}%
+ {% yes, it's defined
+ \edef\@@tmp{\ctikzvalof{\ctikzclass/fill}}\edef\@@none{none}%
+ \ifx\@@tmp\@@none % but it's none
+ \pgfusepath{#2}%
+ \else
+ \pgfsetfillcolor{\@@tmp}%
+ \pgfusepath{#1}%
+ \fi
+ }{% the class is defined but the fill key not; use #2
+ \pgfusepath{#2}%
+ }
+ \else
+ \pgfusepath{#2}%
+ \fi
+}
+
+%% Macro to fill or draw
+
+\def\pgf at circ@draworfill{%
+ \ifx\tikz at fillcolor\pgfutil at empty
+ \pgf at circ@setifdefinedfill{draw,fill}{draw}
+ \else
+ \pgfsetfillcolor{\tikz at fillcolor}
+ \pgfusepath{draw, fill}
+ \fi
+}
+
+\def\pgf at circ@draworfillandclip{%
+ \ifx\tikz at fillcolor\pgfutil at empty
+ \pgf at circ@setifdefinedfill{draw, clip, fill}{draw, clip}
+ \pgfusepath{draw, clip}
+ \else
+ \pgfsetfillcolor{\tikz at fillcolor}
+ \pgfusepath{draw, clip, fill}
+ \fi
+}
+
+\def\pgf at circ@maybefill{%
+ \ifx\tikz at fillcolor\pgfutil at empty
+ \pgf at circ@setifdefinedfill{fill}{discard}
+ \else
+ \pgfsetfillcolor{\tikz at fillcolor}
+ \pgfusepath{fill}
+ \fi
+}
+
+%% Macros for setting linewidth
+% #1 is the legacy class (bipoles, tripoles) etc
+% #2 is the reference linewidth
+\def\pgf at circ@setlinewidth#1#2{%
+ \ifdefined\ctikzclass
+ \pgfkeysifdefined{\circuitikzbasekey/\ctikzclass/thickness}%
+ {% yes, it's defined
+ \edef\@@tmp{\ctikzvalof{\ctikzclass/thickness}}\edef\@@none{none}%
+ \ifx\@@tmp\@@none % but it's none
+ \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}% passthrough legacy class
+ \else
+ \pgfsetlinewidth{\@@tmp #2}%
+ \fi
+ }{ % key not defined, do the legacy thing
+ \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}%
+ }% Ok, do nothing
+ \else % no class
+ \pgfsetlinewidth{\ctikzvalof{#1/thickness}#2}%
+ \fi
+}
+% use \pgf at circ@setlinewidth{none}{\pgflinewidth} if there is no legacy case
+\ctikzset{none/thickness/.initial=1.0} % do not touch
+
+%% font changes compatible with plain/LaTeX/ConTeXt
+%% thanks to Henri Menke https://github.com/circuitikz/circuitikz/issues/285#issuecomment537224605
+
+\ifpgfutil at format@is at latex
+ \long\def\pgf at circ@font at tiny{\tiny}
+ \long\def\pgf at circ@font at small{\small}
+ \long\def\pgf at circ@font at bold{\textbf}
+ \long\def\pgf at circ@font at boldmath{\boldmath}
+ \long\def\pgf at circ@font at sixbm{\fontsize{6}{7}\selectfont\boldmath}
+ \long\def\pgf at circ@font at tenbm{\fontsize{10}{12}\selectfont\boldmath}
+ \long\def\pgf at circ@font at twelve{\fontsize{12}{14}\selectfont}
+\else\ifpgfutil at format@is at plain
+ \long\def\pgf at circ@font at tiny{\fiverm}
+ \long\def\pgf at circ@font at small{\sevenrm}
+ \long\def\pgf at circ@font at bold#1{{\bf#1}}
+ \long\def\pgf at circ@font at boldmath{\bf} % to be tested
+ \long\def\pgf at circ@font at sixbm{\sevenrm\bf} %
+ \long\def\pgf at circ@font at tenbm{\tenrm\bf} %
+ \long\def\pgf at circ@font at twelve{\twelverm} %
+\else\ifpgfutil at format@is at context
+ \long\def\pgf at circ@font at tiny{\tfxx}
+ \long\def\pgf at circ@font at small{\tfx}
+ \long\def\pgf at circ@font at bold{\bold}
+ \long\def\pgf at circ@font at boldmath{\bold} % to be tested
+ \long\def\pgf at circ@font at sixbm{\tfx\bold} %
+ \long\def\pgf at circ@font at tenbm{\normal\bold}%
+ \long\def\pgf at circ@font at twelve{\tfa} %
+\fi\fi\fi
+
+
+% voltage options
+
+\newif\ifpgf at circ@siunitx
+\newif\ifpgf at circuit@compat
+\newif\ifpgf at circ@oldvoltagedirection % default false
+\newif\ifpgf at circ@explicitvdir
+\newif\ifpgf at circ@fixbatteries
+
+\ctikzset{voltage dir/.is choice}
+\ctikzset{voltage dir/old/.code={\pgf at circ@oldvoltagedirectiontrue\pgf at circ@fixbatteriesfalse}}
+\ctikzset{voltage dir/noold/.code={\pgf at circ@oldvoltagedirectionfalse\pgf at circ@fixbatteriesfalse}}
+\ctikzset{voltage dir/RP/.code={\pgf at circ@oldvoltagedirectiontrue\pgf at circ@fixbatteriestrue}}
+\ctikzset{voltage dir/EF/.code={\pgf at circ@oldvoltagedirectionfalse\pgf at circ@fixbatteriestrue}}
+\tikzset{voltage dir/.style={circuitikz/voltage dir=#1}}
+
+% Option ">" for twoports
+\newif\ifpgf at circuit@inputarrow
+\ctikzset{>/.add code={}{\pgf at circuit@inputarrowtrue}}
+\ctikzset{inputarrow/.is choice}
+\ctikzset{inputarrow/true/.code={\pgf at circuit@inputarrowtrue}}
+\ctikzset{inputarrow/false/.code={\pgf at circuit@inputarrowfalse}}
+
+% Option "boxed" for nodes and twoports
+\newif\ifpgf at circuit@boxed
+\pgfkeys{/tikz/boxed/.add code={}{\pgf at circuit@boxedtrue}}
+\ctikzset{boxed/.add code={}{\pgf at circuit@boxedtrue}}
+\pgfkeys{/tikz/box/.add code={}{\pgf at circuit@boxedtrue}}
+\ctikzset{box/.add code={}{\pgf at circuit@boxedtrue}}
+
+% Option "dashed" for nodes and twoports
+\newif\ifpgf at circuit@dashed
+\pgfkeys{/tikz/dashed/.add code={}{\pgf at circuit@dashedtrue}}
+\ctikzset{dashed/.add code={}{\pgf at circuit@dashedtrue}}
+
+% Option "t=*" for nodes
+\pgfkeys{/tikz/t/.add code={}{\ctikzset{text=#1}}}
+
+\ctikzset{current arrow scale/.initial=16}
+
+\ctikzset{bipoles/.is family}
+\ctikzset{bipoles/border margin/.initial=1.1}
+\ctikzset{bipoles/thickness/.initial=2}
+\ctikzset{tripoles/thickness/.initial=2}
+\ctikzset{quadpoles/thickness/.initial=2}
+\ctikzset{nodes width/.initial=.04}
+
+% Base len for all circuitikz
+\newdimen\pgf at circ@Rlen
+% scaled length for internal use in scalable shapes
+\newdimen\pgf at circ@scaled at Rlen
+\ctikzset{bipoles/length/.code={\pgf at circ@Rlen = #1\pgf at circ@scaled at Rlen=\pgf at circ@Rlen}}
+\pgf at circ@Rlen = 1.4cm
+% by default scale is 1.0
+\pgf at circ@scaled at Rlen=\pgf at circ@Rlen
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% main style definitions
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+
+
+% load a style file: search ctikzstyleNAME.tex in path
+\def\ctikzloadstyle#1{%
+ \edef\pgf at temp{#1}%
+ % guard against reloading
+ \expandafter\ifx\csname pgf at circ@style@\pgf at temp @loaded\endcsname\relax%
+ \expandafter\global\expandafter\let\csname pgf at circ@style@\pgf at temp @loaded\endcsname=\pgfutil at empty
+ \pgfutil at InputIfFileExists{ctikzstyle#1}{}{%
+ \tikzerror{I did not find the circuitikz style #1}}%
+ \fi
+}
+
+% load and enact a style
+\def\ctikzsetstyle#1{%
+ \ctikzloadstyle{#1}%
+ \tikzset{#1 circuit style}%
+}
+
+% global style parameters
+\ctikzset{default/scale/.initial=1.0} % do not touch
+\ctikzset{default/fill/.initial=none} % do not touch
+\ctikzset{default/thickness/.initial=none} % do not touch
+% default is use as the generic default style for bipoles
+
+% mostly bipoles:
+
+\ctikzset{resistors/scale/.initial=1.0}
+\ctikzset{resistors/fill/.initial=none}
+\ctikzset{resistors/thickness/.initial=none}
+
+\ctikzset{capacitors/scale/.initial=1.0}
+\ctikzset{capacitors/fill/.initial=none}
+\ctikzset{capacitors/thickness/.initial=none}
+
+\ctikzset{inductors/scale/.initial=1.0}
+\ctikzset{inductors/fill/.initial=none}
+\ctikzset{inductors/thickness/.initial=none}
+
+\ctikzset{diodes/scale/.initial=1.0}
+\ctikzset{diodes/fill/.initial=none}
+\ctikzset{diodes/thickness/.initial=none}
+
+\ctikzset{batteries/scale/.initial=1.0}
+\ctikzset{batteries/fill/.initial=none}
+\ctikzset{batteries/thickness/.initial=none}
+
+\ctikzset{sources/scale/.initial=1.0}
+\ctikzset{sources/fill/.initial=none}
+\ctikzset{sources/thickness/.initial=none}
+
+\ctikzset{csources/scale/.initial=1.0}
+\ctikzset{csources/fill/.initial=none}
+\ctikzset{csources/thickness/.initial=none}
+
+\ctikzset{instruments/scale/.initial=1.0}
+\ctikzset{instruments/fill/.initial=none}
+\ctikzset{instruments/thickness/.initial=none}
+
+\ctikzset{mechanicals/scale/.initial=1.0}
+\ctikzset{mechanicals/fill/.initial=none}
+\ctikzset{mechanicals/thickness/.initial=none}
+
+\ctikzset{misc/scale/.initial=1.0}
+\ctikzset{misc/fill/.initial=none}
+\ctikzset{misc/thickness/.initial=none}
+
+\ctikzset{blocks/scale/.initial=1.0}
+\ctikzset{blocks/fill/.initial=none}
+\ctikzset{blocks/thickness/.initial=none}
+
+% mostly nodes
+
+\ctikzset{grounds/scale/.initial=1.0}
+\ctikzset{grounds/fill/.initial=none}
+\ctikzset{grounds/thickness/.initial=none}
+
+\ctikzset{power supplies/scale/.initial=1.0}
+\ctikzset{power supplies/fill/.initial=none}
+\ctikzset{power supplies/thickness/.initial=none}
+
+\ctikzset{transistors/scale/.initial=1.0}
+\ctikzset{transistors/fill/.initial=none}
+\ctikzset{transistors/thickness/.initial=none}
+
+\ctikzset{tubes/scale/.initial=1.0}
+\ctikzset{tubes/fill/.initial=none}
+\ctikzset{tubes/thickness/.initial=none}
+
+\ctikzset{RF/scale/.initial=1.0}
+\ctikzset{RF/fill/.initial=none}
+\ctikzset{RF/thickness/.initial=none}
+
+\ctikzset{electromechanicals/scale/.initial=1.0}
+\ctikzset{electromechanicals/fill/.initial=none}
+\ctikzset{electromechanicals/thickness/.initial=none}
+
+% transformers go with inductors
+\ctikzset{amplifiers/scale/.initial=1.0}
+\ctikzset{amplifiers/fill/.initial=none}
+\ctikzset{amplifiers/thickness/.initial=none}
+
+\ctikzset{switches/scale/.initial=1.0}
+\ctikzset{switches/fill/.initial=none}
+\ctikzset{switches/thickness/.initial=none}
+
+\ctikzset{logic ports/scale/.initial=1.0}
+\ctikzset{logic ports/fill/.initial=none}
+\ctikzset{logic ports/thickness/.initial=none}
+
+\ctikzset{chips/scale/.initial=1.0}
+\ctikzset{chips/fill/.initial=none}
+\ctikzset{chips/thickness/.initial=none}
+
+\ctikzset{displays/scale/.initial=1.0}
+\ctikzset{displays/fill/.initial=none}
+\ctikzset{displays/thickness/.initial=none}
+
+% grounds and power supplies
+
+\ctikzset{monopoles/.is family}
+\ctikzset{monopoles/ground/width/.initial=.25}
+\ctikzset{monopoles/ground/connectionthickness/.initial=1}
+\ctikzset{monopoles/ground/thickness/.initial=2}
+\ctikzset{monopoles/rground/thickness/.initial=2}
+\ctikzset{monopoles/tground/thickness/.initial=3}
+\ctikzset{monopoles/vcc/width/.initial=.2}
+\ctikzset{monopoles/vcc/arrow/.initial=legacy}
+\ctikzset{monopoles/vee/arrow/.initial=legacy}
+\ctikzset{monopoles/match/width/.initial=.4}
+\ctikzset{monopoles/chassis/width/.initial=.25}
+\ctikzset{monopoles/alternative chassis/width/.initial=.25}
+\ctikzset{monopoles/equipotentiality/width/.initial=.25}
+\ctikzset{monopoles/antenna/width/.initial=.25}
+\ctikzset{monopoles/antenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/antenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/txantenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/txantenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/txantenna/width/.initial=.25}
+\ctikzset{monopoles/rxantenna/label/xanchor/.initial=.4}
+\ctikzset{monopoles/rxantenna/label/yanchor/.initial=.75}
+\ctikzset{monopoles/rxantenna/width/.initial=.25}
+\ctikzset{monopoles/bareantenna/width/.initial=.25}
+\ctikzset{monopoles/bareantenna/label/xanchor/.initial=1}
+\ctikzset{monopoles/bareantenna/label/yanchor/.initial=0.5}
+\ctikzset{monopoles/waves/width/.initial=0.5}
+
+% microstrips
+\ctikzset{bipoles/mstline/height/.initial=0.3}
+\ctikzset{bipoles/mstline/width/.initial=1.2}
+\pgfkeys{/tikz/mstlinelen/.add code={}{\ctikzset{bipoles/mstline/width=#1}}}
+\ctikzset{monopoles/msport/width/.initial=.5}
+\ctikzset{monopoles/msrstub/height/.initial=1.0}
+\ctikzset{monopoles/msrstub/width/.initial=0.6}
+
+% microphone and loudspeaker
+\ctikzset{bipoles/loudspeaker/height/.initial=.8}
+\ctikzset{bipoles/loudspeaker/depth/.initial=.3}
+\ctikzset{bipoles/loudspeaker/width/.initial=.8}
+\ctikzset{bipoles/mic/height/.initial=1.2}
+\ctikzset{bipoles/mic/depth/.initial=.0}
+\ctikzset{bipoles/mic/width/.initial=.8}
+
+% Zig Zag resistors
+\ctikzset{resistors/zigs/.initial=3}
+\ctikzset{resistors/width/.code={%
+ \ctikzset{bipoles/resistor/width=#1}%
+ \ctikzset{bipoles/vresistor/width=#1}%
+ \ctikzset{bipoles/potentiometer/width=#1}%
+ \ctikzset{bipoles/resistivesens/width=#1}%
+ \ctikzset{bipoles/photoresistor/width=#1}%
+ \ctikzset{bipoles/thermistor/width=#1}%
+ \ctikzset{bipoles/thermistorntc/width=#1}%
+ \ctikzset{bipoles/thermistorptc/width=#1}%
+ \ctikzset{bipoles/varistor/width=#1}%
+ \ctikzset{bipoles/generic/width=#1}%
+ \ctikzset{bipoles/generic potentiometer/width=#1}%
+ \ctikzset{bipoles/ageneric/width=#1}%
+ \ctikzset{bipoles/tgeneric/width=#1}%
+}}
+\ctikzset{wiper pos/.code={%
+ \ctikzset{bipoles/potentiometer/wiper pos=#1}%
+ \ctikzset{bipoles/generic potentiometer/wiper pos=#1}%
+}}
+% zigzag resistor
+\ctikzset{bipoles/resistor/height/.initial=.3}
+\ctikzset{bipoles/resistor/width/.initial=.8}
+\ctikzset{bipoles/potentiometer/height/.initial=.8}
+\ctikzset{bipoles/potentiometer/height 2/.initial=.3}
+\ctikzset{bipoles/potentiometer/width/.initial=.8}
+\ctikzset{bipoles/potentiometer/wiper pos/.initial=.5}
+\ctikzset{bipoles/vresistor/height/.initial=.6}
+\ctikzset{bipoles/vresistor/width/.initial=.8}
+\ctikzset{bipoles/resistivesens/height/.initial=.6}
+\ctikzset{bipoles/resistivesens/width/.initial=.8}
+% square resistors
+\ctikzset{bipoles/photoresistor/height/.initial=.6}
+\ctikzset{bipoles/photoresistor/height 2/.initial=.3}
+\ctikzset{bipoles/photoresistor/width/.initial=.8}
+\ctikzset{bipoles/thermistor/main/.initial=.7}
+\ctikzset{bipoles/thermistor/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorntc/width/.initial=.8}
+\ctikzset{bipoles/thermistorntc/main/.initial=.7}
+\ctikzset{bipoles/thermistorntc/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorntc/height 2/.initial=.75}%.3/.7
+\ctikzset{bipoles/thermistorptc/width/.initial=.8}
+\ctikzset{bipoles/thermistorptc/main/.initial=.7}
+\ctikzset{bipoles/thermistorptc/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/thermistorptc/height 2/.initial=.75}%.3/.7
+\ctikzset{bipoles/thermistor/width/.initial=.8}
+\ctikzset{bipoles/varistor/main/.initial=.7}
+\ctikzset{bipoles/varistor/height/.initial=.428}%.3/.7
+\ctikzset{bipoles/varistor/width/.initial=.8}
+\ctikzset{bipoles/generic/height/.initial=.30}
+\ctikzset{bipoles/generic/width/.initial=.80}
+\ctikzset{bipoles/generic potentiometer/height/.initial=.80}
+\ctikzset{bipoles/generic potentiometer/height 2/.initial=.30}
+\ctikzset{bipoles/generic potentiometer/width/.initial=.80}
+\ctikzset{bipoles/generic potentiometer/wiper pos/.initial=.5}
+\ctikzset{bipoles/ageneric/height/.initial=.30}
+\ctikzset{bipoles/tgeneric/height/.initial=.70}
+\ctikzset{bipoles/tgeneric/width/.initial=.80}
+\ctikzset{bipoles/ageneric/width/.initial=.80}
+
+%% Capacitors
+\ctikzset{bipoles/capacitor/height/.initial=.6}
+\ctikzset{bipoles/capacitor/width/.initial=.2}
+\ctikzset{bipoles/ecapacitor/height/.initial=.5}
+\ctikzset{bipoles/ecapacitor/width/.initial=.2}
+\ctikzset{bipoles/ecapacitor/font/.initial=\pgf at circ@font at sixbm}
+%%% pcapacitor is deprecated
+\ctikzset{bipoles/pcapacitor/height/.initial=.6}
+\ctikzset{bipoles/pcapacitor/width/.initial=.2}
+\ctikzset{bipoles/pcapacitor/bend width/.initial=1.1}
+\ctikzset{bipoles/ccapacitor/height/.initial=.6}
+\ctikzset{bipoles/ccapacitor/width/.initial=.12}
+\ctikzset{bipoles/ccapacitor/bend width/.initial=1.1}
+\ctikzset{bipoles/vcapacitor/height/.initial=.6}
+\ctikzset{bipoles/vcapacitor/width/.initial=.5}
+\ctikzset{bipoles/vcapacitor/capacitor width/.initial=.4}
+\ctikzset{bipoles/piezoelectric/height/.initial=.7}
+\ctikzset{bipoles/piezoelectric/width/.initial=.5}
+
+% Inductors
+\ctikzset{inductors/coils/.code={%
+ \ctikzset{bipoles/cuteinductor/coils=#1}%
+ \ctikzset{bipoles/cutechoke/coils=#1}%
+ \ctikzset{bipoles/americaninductor/coils=#1}%
+ \ctikzset{bipoles/vcuteinductor/coils=#1}%
+ \ctikzset{bipoles/vamericaninductor/coils=#1}%
+}}
+\ctikzset{inductors/width/.code={%
+ \ctikzset{bipoles/cuteinductor/width=#1}%
+ \ctikzset{bipoles/cutechoke/width=#1}%
+ \ctikzset{bipoles/americaninductor/width=#1}%
+ \ctikzset{bipoles/vcuteinductor/width=#1}%
+ \ctikzset{bipoles/vamericaninductor/width=#1}%
+ \ctikzset{bipoles/fullgeneric/width=#1}%
+ \ctikzset{bipoles/tfullgeneric/width=#1}%
+}}
+\ctikzset{bipoles/cuteinductor/height/.initial=.3}
+\ctikzset{bipoles/cuteinductor/lower coil height/.initial=.15}
+\ctikzset{bipoles/cuteinductor/width/.initial=.6}
+\ctikzset{bipoles/cuteinductor/coils/.initial=5}
+\ctikzset{bipoles/cuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
+%% Cute choke settings
+\ctikzset{bipoles/cutechoke/height/.initial=.3}
+\ctikzset{bipoles/cutechoke/lower coil height/.initial=.15}
+\ctikzset{bipoles/cutechoke/width/.initial=.6}
+\ctikzset{bipoles/cutechoke/coils/.initial=5}
+\ctikzset{bipoles/cutechoke/coil aspect/.initial=.5}%percentage of choke width, which is covered by lower coil
+\ctikzset{bipoles/cutechoke/cstep/.initial=.3}
+\ctikzset{bipoles/cutechoke/cdist/.initial=1.3}
+\ctikzset{bipoles/cutechoke/cthick/.initial=1}
+\newif\ifpgf at circuit@bipole at twolineschoke
+\pgf at circuit@bipole at twolineschokefalse
+\pgfkeys{/tikz/onelinechoke/.add code={}{\pgf at circuit@bipole at twolineschokefalse}}
+\ctikzset{onelinechoke/.add code={}{\pgf at circuit@bipole at twolineschokefalse}}
+\pgfkeys{/tikz/twolineschoke/.add code={}{\pgf at circuit@bipole at twolineschoketrue}}
+\ctikzset{twolineschoke/.add code={}{\pgf at circuit@bipole at twolineschoketrue}}
+%
+\ctikzset{bipoles/americaninductor/height/.initial=.3}
+\ctikzset{bipoles/americaninductor/height 2/.initial=.1}
+\ctikzset{bipoles/americaninductor/width/.initial=.8}
+\ctikzset{bipoles/americaninductor/coils/.initial=4}
+\ctikzset{bipoles/americaninductor/coil height/.initial=.15}
+\ctikzset{bipoles/vcuteinductor/height/.initial=.6}
+\ctikzset{bipoles/vcuteinductor/lower coil height/.initial=.3}
+\ctikzset{bipoles/vcuteinductor/width/.initial=.6}
+\ctikzset{bipoles/vcuteinductor/coils/.initial=5}
+\ctikzset{bipoles/vcuteinductor/coil aspect/.initial=.5}%percentage of inductor width, which is covered by lower coil
+\ctikzset{bipoles/vamericaninductor/height/.initial=.6}
+\ctikzset{bipoles/vamericaninductor/height 2/.initial=.2}
+\ctikzset{bipoles/vamericaninductor/width/.initial=.8}
+\ctikzset{bipoles/vamericaninductor/coils/.initial=4}
+\ctikzset{bipoles/vamericaninductor/coil height/.initial=.15}
+\ctikzset{bipoles/tfullgeneric/height/.initial=.70}
+\ctikzset{bipoles/tfullgeneric/width/.initial=.80}
+\ctikzset{bipoles/fullgeneric/height/.initial=.30}
+\ctikzset{bipoles/fullgeneric/width/.initial=.80}
+
+% Sources
+
+\ctikzset{bipoles/esource/height/.initial=.60}
+\ctikzset{bipoles/esource/width/.initial=.60}
+\ctikzset{bipoles/pvsource/height/.initial=.60}
+\ctikzset{bipoles/pvsource/width/.initial=.60}
+\ctikzset{bipoles/isource/height/.initial=.60}
+\ctikzset{bipoles/isource/width/.initial=.60}
+\ctikzset{bipoles/oosource/height/.initial=.60}
+\ctikzset{bipoles/oosource/width/.initial=.60}
+\ctikzset{bipoles/oosource/circlesize/.initial=.65}%circlesize+circleoffset should be =1
+\ctikzset{bipoles/oosource/circleoffset/.initial=.35}%circlesize+circleoffset should be =1
+\ctikzset{bipoles/dcisource/angle/.initial=80}
+\ctikzset{bipoles/dcisource/height/.initial=.60}
+\ctikzset{bipoles/dcisource/width/.initial=.60}
+\ctikzset{bipoles/dcvsource/height/.initial=.60}
+\ctikzset{bipoles/dcvsource/width/.initial=.60}
+\ctikzset{bipoles/vsourcetri/height/.initial=.60}
+\ctikzset{bipoles/vsourcetri/width/.initial=.60}
+\ctikzset{bipoles/isourceam/height/.initial=.60}
+\ctikzset{bipoles/isourceam/width/.initial=.60}
+\ctikzset{bipoles/vsource/height/.initial=.60}
+\ctikzset{bipoles/vsource/width/.initial=.60}
+\ctikzset{bipoles/vsourceam/height/.initial=.60}
+\ctikzset{bipoles/vsourceam/width/.initial=.60}
+\ctikzset{bipoles/vsourceam/margin/.initial=.7}
+\ctikzset{bipoles/isourcesin/height/.initial=.60}
+\ctikzset{bipoles/isourcesin/width/.initial=.60}
+\ctikzset{bipoles/vsourcesin/height/.initial=.60}
+\ctikzset{bipoles/vsourcesin/width/.initial=.60}
+\ctikzset{bipoles/vsourcesquare/height/.initial=.60}
+\ctikzset{bipoles/vsourcesquare/width/.initial=.60}
+\ctikzset{bipoles/cisource/height/.initial=.7}
+\ctikzset{bipoles/cisource/width/.initial=.7}
+\ctikzset{bipoles/cisourceam/height/.initial=.7}
+\ctikzset{bipoles/cisourceam/width/.initial=.7}
+\ctikzset{bipoles/ecsource/height/.initial=.7}
+\ctikzset{bipoles/ecsource/width/.initial=.7}
+\ctikzset{bipoles/cvsource/height/.initial=.7}
+\ctikzset{bipoles/cvsource/width/.initial=.7}
+\ctikzset{bipoles/cvsourceam/height/.initial=.7}
+\ctikzset{bipoles/cvsourceam/width/.initial=.7}
+\ctikzset{bipoles/cvsourceam/margin/.initial=.7}
+\ctikzset{bipoles/cvsourceam/text scale/.initial=1}
+\ctikzset{bipoles/cisourcesin/width/.initial=.7}
+\ctikzset{bipoles/cvsourcesin/height/.initial=.7}
+\ctikzset{bipoles/cvsourcesin/width/.initial=.7}
+\ctikzset{bipoles/battery/height/.initial=.6}
+\ctikzset{bipoles/battery/width/.initial=.3}
+\ctikzset{bipoles/battery1/height/.initial=.6}
+\ctikzset{bipoles/battery1/width/.initial=.3}
+\ctikzset{bipoles/battery2/height/.initial=.6}
+\ctikzset{bipoles/battery2/width/.initial=.3}
+
+% diodes
+
+\ctikzset{bipoles/diode/height/.initial=.50}
+\ctikzset{bipoles/diode/width/.initial=.40}
+\ctikzset{bipoles/bidirectionaldiode/height/.initial=1.1}
+\ctikzset{bipoles/bidirectionaldiode/width/.initial=1}
+\ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
+\ctikzset{bipoles/bidirectionaldiode/diode width right/.initial=.3}
+\ctikzset{bipoles/varcap/height/.initial=.50}
+\ctikzset{bipoles/varcap/width/.initial=.45}
+
+% switches
+
+\ctikzset{bipoles/spst/height/.initial=.35}
+\ctikzset{bipoles/spst/width/.initial=.35}
+\ctikzset{bipoles/spst/depth/.initial=.2}
+\ctikzset{bipoles/nos/height/.initial=.3}
+\ctikzset{bipoles/nos/width/.initial=.35}
+\ctikzset{bipoles/nos/depth/.initial=.2}
+\ctikzset{bipoles/ncs/height/.initial=.35}
+\ctikzset{bipoles/ncs/width/.initial=.35}
+\ctikzset{bipoles/ncs/depth/.initial=.2}
+
+% misc
+
+\ctikzset{bipoles/european gas filled surge arrester/height/.initial=.30}
+\ctikzset{bipoles/european gas filled surge arrester/width/.initial=.80}
+\ctikzset{bipoles/european gas filled surge arrester/inside/.initial=.30}
+\ctikzset{bipoles/american gas filled surge arrester/height/.initial=.60}
+\ctikzset{bipoles/american gas filled surge arrester/width/.initial=.60}
+\ctikzset{bipoles/american gas filled surge arrester/inside/.initial=.15}
+\ctikzset{bipoles/american gas filled surge arrester/dot x/.initial=.25}
+\ctikzset{bipoles/american gas filled surge arrester/dot y/.initial=.45}
+\ctikzset{bipoles/american gas filled surge arrester/size/.initial=.1}
+\ctikzset{bipoles/fuse/height/.initial=.20}
+\ctikzset{bipoles/fuse/width/.initial=.50}
+\ctikzset{bipoles/afuse/height/.initial=.20}
+\ctikzset{bipoles/afuse/width/.initial=.50}
+\ctikzset{bipoles/memristor/height/.initial=.30}
+\ctikzset{bipoles/memristor/wave height/.initial=.5}
+\ctikzset{bipoles/memristor/width/.initial=.80}
+\ctikzset{bipoles/open/height/.initial=.3} %necessary for curly voltages
+\ctikzset{bipoles/open/width/.initial=.3} %necessary for curly voltages
+\ctikzset{bipoles/open/voltage/straight label distance/.initial=0}
+\ctikzset{bipoles/open/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/short/height/.initial=0} %dummy height for voltage positioning
+\ctikzset{bipoles/short/width/.initial=0} %dummy width for voltage positioning
+%\ctikzset{bipoles/short/voltage/straight label distance/.initial=.2}
+%\ctikzset{bipoles/short/voltage/distance from node/.initial=.5}
+\ctikzset{bipoles/ammeter/height/.initial=.60}
+\ctikzset{bipoles/ammeter/width/.initial=.60}
+\ctikzset{bipoles/ohmmeter/height/.initial=.60}
+\ctikzset{bipoles/ohmmeter/width/.initial=.60}
+\ctikzset{bipoles/voltmeter/height/.initial=.60}
+\ctikzset{bipoles/voltmeter/width/.initial=.60}
+\ctikzset{bipoles/smeter/height/.initial=.60}
+\ctikzset{bipoles/smeter/width/.initial=.60}
+\ctikzset{bipoles/qmeter/depth/.initial=.40}
+\ctikzset{bipoles/qmeter/height/.initial=.80}
+\ctikzset{bipoles/qmeter/width/.initial=.60}
+\ctikzset{bipoles/iloop/width/.initial=.40}
+\ctikzset{bipoles/iloop/height/.initial=.60}
+\ctikzset{bipoles/oscope/height/.initial=.60}
+\ctikzset{bipoles/oscope/width/.initial=.60}
+\ctikzset{bipoles/buffer/height/.initial=1}
+\ctikzset{bipoles/buffer/width/.initial=1}
+\ctikzset{bipoles/not port/width/.initial=1}
+\ctikzset{bipoles/not port/height/.initial=.8}
+\ctikzset{bipoles/not port/circle width/.initial=.15}
+\ctikzset{bipoles/lamp/height/.initial=.60}
+\ctikzset{bipoles/lamp/width/.initial=.60}
+\ctikzset{bipoles/bulb/height/.initial=.8}
+\ctikzset{bipoles/bulb/width/.initial=.8}
+\ctikzset{bipoles/tline/height/.initial=.3}
+\ctikzset{bipoles/tline/width/.initial=.8}
+\ctikzset{bipoles/squid/height/.initial=.60}
+\ctikzset{bipoles/squid/width/.initial=.60}
+\ctikzset{bipoles/barrier/height/.initial=.60}
+\ctikzset{bipoles/barrier/width/.initial=.60}
+\ctikzset{bipoles/thermocouple/height/.initial=.250}
+\ctikzset{bipoles/thermocouple/height 2/.initial=.60}
+\ctikzset{bipoles/thermocouple/width/.initial=.140}
+\ctikzset{bipoles/pushbutton/height/.initial=.5}
+\ctikzset{bipoles/pushbutton/height 2/.initial=.2}
+\ctikzset{bipoles/pushbutton/width/.initial=.50}
+
+\ctikzset{bipoles/twoport/width/.initial=.7}
+\ctikzset{bipoles/twoport/height/.initial=.7}
+\ctikzset{bipoles/twoport/text/.initial=}
+\ctikzset{bipoles/vco/width/.initial=.7}
+\ctikzset{bipoles/bandpass/width/.initial=.7}
+\ctikzset{bipoles/bandstop/width/.initial=.7}
+\ctikzset{bipoles/highpass/width/.initial=.7}
+\ctikzset{bipoles/lowpass/width/.initial=.7}
+\ctikzset{bipoles/adc/width/.initial=.7}
+\ctikzset{bipoles/dac/width/.initial=.7}
+\ctikzset{bipoles/dsp/width/.initial=.7}
+\ctikzset{bipoles/fft/width/.initial=.7}
+\ctikzset{bipoles/amp/width/.initial=.7}
+\ctikzset{bipoles/vamp/width/.initial=.7}
+\ctikzset{bipoles/piattenuator/width/.initial=.7}
+\ctikzset{bipoles/vpiattenuator/width/.initial=.7}
+\ctikzset{bipoles/tattenuator/width/.initial=.7}
+\ctikzset{bipoles/vtattenuator/width/.initial=.7}
+\ctikzset{bipoles/phaseshifter/width/.initial=.7}
+\ctikzset{bipoles/vphaseshifter/width/.initial=.7}
+\ctikzset{bipoles/detector/width/.initial=.7}
+
+% crossing wires
+\ctikzset{bipoles/crossing/size/.initial=.2}
+
+% Transistors starts here
+
+\newif\ifpgf at circuit@trans at depletiontype
+\pgf at circuit@trans at depletiontypefalse
+
+\newif\ifpgf at circuit@mos at arrows
+\ctikzset{tripoles/mos style/.is choice}
+\ctikzset{tripoles/mos style/no arrows/.code={\pgf at circuit@mos at arrowsfalse}}
+\ctikzset{tripoles/mos style/arrows/.code={\pgf at circuit@mos at arrowstrue}}
+\pgfkeys{/tikz/arrowmos/.add code={}{\pgf at circuit@mos at arrowstrue}}
+\pgfkeys{/tikz/noarrowmos/.add code={}{\pgf at circuit@mos at arrowsfalse}}
+
+% Option solderdot for fet
+\newif\ifpgf at circuit@fet at solderdot
+\pgfkeys{/tikz/solderdot/.add code={}{\pgf at circuit@fet at solderdottrue}}
+\ctikzset{solderdot/.add code={}{\pgf at circuit@fet at solderdottrue}}
+\pgfkeys{/tikz/nosolderdot/.add code={}{\pgf at circuit@fet at solderdotfalse}}
+\ctikzset{nosolderdot/.add code={}{\pgf at circuit@fet at solderdotfalse}}
+
+% Option bodydiode for fet
+\newif\ifpgf at circuit@fet at bodydiode
+\pgfkeys{/tikz/bodydiode/.add code={}{\pgf at circuit@fet at bodydiodetrue}}
+\ctikzset{bodydiode/.add code={}{\pgf at circuit@fet at bodydiodetrue}}
+\pgfkeys{/tikz/nobodydiode/.add code={}{\pgf at circuit@fet at bodydiodefalse}}
+\ctikzset{nobodydiode/.add code={}{\pgf at circuit@fet at bodydiodefalse}}
+
+% Option draw fet without gate connection
+\newif\ifpgf at circuit@bpt at drawgate
+\pgf at circuit@bpt at drawgatetrue
+\pgfkeys{/tikz/nogate/.add code={}{\pgf at circuit@bpt at drawgatefalse}}
+\ctikzset{nogate/.add code={}{\pgf at circuit@bpt at drawgatefalse}}
+\pgfkeys{/tikz/nobase/.add code={}{\pgf at circuit@bpt at drawgatefalse}}
+\ctikzset{nobase/.add code={}{\pgf at circuit@bpt at drawgatefalse}}
+
+% Option draw bpt without base connection
+\newif\ifpgf at circuit@bpt at drawbase
+\pgf at circuit@bpt at drawbasetrue
+\pgfkeys{/tikz/nobase/.add code={}{\pgf at circuit@bpt at drawbasefalse}}
+\ctikzset{nobase/.add code={}{\pgf at circuit@bpt at drawbasefalse}}
+\pgfkeys{/tikz/nogate/.add code={}{\pgf at circuit@bpt at drawbasefalse}}
+\ctikzset{nogate/.add code={}{\pgf at circuit@bpt at drawbasefalse}}
+
+% Option draw bpt with optical input
+\newif\ifpgf at circuit@bpt at drawphoto
+\pgf at circuit@bpt at drawphotofalse
+\pgfkeys{/tikz/photo/.add code={}{\pgf at circuit@bpt at drawphototrue}}
+\ctikzset{photo/.add code={}{\pgf at circuit@bpt at drawphototrue}}
+\pgfkeys{/tikz/photo/.add code={}{\pgf at circuit@bpt at drawphototrue}}
+\ctikzset{photo/.add code={}{\pgf at circuit@bpt at drawphototrue}}
+
+% Option draw fet without bulk connection  Added by Burak Kelleci
+\newif\ifpgf at circuit@bpt at drawbulk
+\pgfkeys{/tikz/bulk/.add code={}{\pgf at circuit@bpt at drawbulktrue}}
+\ctikzset{bulk/.add code={}{\pgf at circuit@bpt at drawbulktrue}}
+\pgfkeys{/tikz/nobulk/.add code={}{\pgf at circuit@bpt at drawbulkfalse}}
+\ctikzset{nobulk/.add code={}{\pgf at circuit@bpt at drawbulkfalse}}
+
+% Option draw pmos with empty circle
+\newif\ifpgf at circuit@pmos at emptycircle
+\pgf at circuit@pmos at emptycirclefalse
+\ctikzset{tripoles/pmos style/.is choice}
+\pgfkeys{/tikz/emptycircle/.add code={}{\pgf at circuit@pmos at emptycircletrue}}
+\ctikzset{tripoles/pmos style/emptycircle/.add code={}{\pgf at circuit@pmos at emptycircletrue}}
+% Option draw pmos with no circle
+\newif\ifpgf at circuit@pmos at nocircle
+\pgf at circuit@pmos at nocirclefalse
+\pgfkeys{/tikz/nocircle/.add code={}{\pgf at circuit@pmos at nocircletrue}}
+\ctikzset{tripoles/pmos style/nocircle/.add code={}{\pgf at circuit@pmos at nocircletrue}}
+% back to normal
+\pgfkeys{/tikz/fullcircle/.add code={}{\pgf at circuit@pmos at emptycirclefalse\pgf at circuit@pmos at nocirclefalse}}
+\ctikzset{tripoles/pmos style/fullcircle/.add code={}{\pgf at circuit@pmos at emptycirclefalse\pgf at circuit@pmos at nocirclefalse}}
+% arrows at the end, the correct way
+\newif\ifpgf at circuit@trans at arrowatend
+\pgf at circuit@trans at arrowatendfalse
+\ctikzset{transistors/arrow pos/.is choice}
+\ctikzset{transistors/arrow pos/legacy/.code={\pgf at circuit@trans at arrowatendfalse}}
+\ctikzset{transistors/arrow pos/end/.code={\pgf at circuit@trans at arrowatendtrue}}
+
+\newif\ifpgf at circuit@trans at ntype
+\pgf at circuit@trans at ntypetrue %default true
+%\newif\ifpgf at circuit@trans at ptype
+%\ctikzset{tripoles/nmos/.add code={\pgf at circuit@trans at ntypetrue}}
+\ctikzset{tripoles/nmos/width/.initial=.7}
+\ctikzset{tripoles/nmos/gate height/.initial=.35}
+\ctikzset{tripoles/nmos/base height/.initial=.5}
+\ctikzset{tripoles/nmos/conn height/.initial=0}
+\ctikzset{tripoles/nmos/height/.initial=1.1}
+\ctikzset{tripoles/nmos/base width/.initial=.5}
+\ctikzset{tripoles/nmos/gate width/.initial=.62}
+\ctikzset{tripoles/nmos/arrow pos/.initial=.6}
+\ctikzset{tripoles/nmos/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nmos/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nmos/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nmos/curr direction/.initial=1}
+
+\ctikzset{tripoles/pmos/width/.initial=.7}
+\ctikzset{tripoles/pmos/gate height/.initial=.35}
+\ctikzset{tripoles/pmos/base height/.initial=.5}
+\ctikzset{tripoles/pmos/conn height/.initial=0}
+\ctikzset{tripoles/pmos/height/.initial=1.1}
+\ctikzset{tripoles/pmos/base width/.initial=.5}
+\ctikzset{tripoles/pmos/gate width/.initial=.62}
+\ctikzset{tripoles/pmos/arrow pos/.initial=.4}
+\ctikzset{tripoles/pmos/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pmos/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pmos/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pmos/curr direction/.initial=1}
+
+\ctikzset{tripoles/hemt/width/.initial=.7}
+\ctikzset{tripoles/hemt/gate height/.initial=.35}
+\ctikzset{tripoles/hemt/base height/.initial=.5}
+\ctikzset{tripoles/hemt/conn height/.initial=0}
+\ctikzset{tripoles/hemt/height/.initial=1.1}
+\ctikzset{tripoles/hemt/base width/.initial=.5}
+\ctikzset{tripoles/hemt/gate width/.initial=.62}
+\ctikzset{tripoles/hemt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/hemt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/hemt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/hemt/curr direction/.initial=1}
+
+\ctikzset{tripoles/nfet/width/.initial=.7}
+\ctikzset{tripoles/nfet/gate height/.initial=.35}
+\ctikzset{tripoles/nfet/base height/.initial=.5}
+\ctikzset{tripoles/nfet/conn height/.initial=0}
+\ctikzset{tripoles/nfet/height/.initial=1.1}
+\ctikzset{tripoles/nfet/base width/.initial=.5}
+\ctikzset{tripoles/nfet/gate width/.initial=.62}
+\ctikzset{tripoles/nfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nfet/curr direction/.initial=1}
+
+\ctikzset{tripoles/pfet/width/.initial=.7}
+\ctikzset{tripoles/pfet/gate height/.initial=.35}
+\ctikzset{tripoles/pfet/base height/.initial=.5}
+\ctikzset{tripoles/pfet/conn height/.initial=0}
+\ctikzset{tripoles/pfet/height/.initial=1.1}
+\ctikzset{tripoles/pfet/base width/.initial=.5}
+\ctikzset{tripoles/pfet/gate width/.initial=.62}
+\ctikzset{tripoles/pfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pfet/curr direction/.initial=1}
+
+\ctikzset{tripoles/nigfete/width/.initial=.7}
+\ctikzset{tripoles/nigfete/gate height/.initial=.35}
+\ctikzset{tripoles/nigfete/base height/.initial=.5}
+\ctikzset{tripoles/nigfete/conn height/.initial=.35}
+\ctikzset{tripoles/nigfete/height/.initial=1.1}
+\ctikzset{tripoles/nigfete/base width/.initial=.5}
+\ctikzset{tripoles/nigfete/gate width/.initial=.62}
+\ctikzset{tripoles/nigfete/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfete/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfete/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfete/curr direction/.initial=1}
+
+\ctikzset{tripoles/nigfetd/width/.initial=.7}
+\ctikzset{tripoles/nigfetd/gate height/.initial=.35}
+\ctikzset{tripoles/nigfetd/base height/.initial=.5}
+\ctikzset{tripoles/nigfetd/conn height/.initial=.35}
+\ctikzset{tripoles/nigfetd/height/.initial=1.1}
+\ctikzset{tripoles/nigfetd/base width/.initial=.5}
+\ctikzset{tripoles/nigfetd/gate width/.initial=.62}
+\ctikzset{tripoles/nigfetd/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfetd/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfetd/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfetd/curr direction/.initial=1}
+
+\ctikzset{tripoles/nigfetebulk/width/.initial=.7}
+\ctikzset{tripoles/nigfetebulk/gate height/.initial=.35}
+\ctikzset{tripoles/nigfetebulk/base height/.initial=.5}
+\ctikzset{tripoles/nigfetebulk/conn height/.initial=.35}
+\ctikzset{tripoles/nigfetebulk/height/.initial=1.1}
+\ctikzset{tripoles/nigfetebulk/base width/.initial=.5}
+\ctikzset{tripoles/nigfetebulk/gate width/.initial=.62}
+\ctikzset{tripoles/nigfetebulk/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigfetebulk/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigfetebulk/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigfetebulk/curr direction/.initial=1}
+
+\ctikzset{tripoles/pigfete/width/.initial=.7}
+\ctikzset{tripoles/pigfete/gate height/.initial=.35}
+\ctikzset{tripoles/pigfete/base height/.initial=.5}
+\ctikzset{tripoles/pigfete/conn height/.initial=.35}
+\ctikzset{tripoles/pigfete/height/.initial=1.1}
+\ctikzset{tripoles/pigfete/base width/.initial=.5}
+\ctikzset{tripoles/pigfete/gate width/.initial=.62}
+\ctikzset{tripoles/pigfete/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfete/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfete/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfete/curr direction/.initial=1}
+
+\ctikzset{tripoles/pigfetd/width/.initial=.7}
+\ctikzset{tripoles/pigfetd/gate height/.initial=.35}
+\ctikzset{tripoles/pigfetd/base height/.initial=.5}
+\ctikzset{tripoles/pigfetd/conn height/.initial=.35}
+\ctikzset{tripoles/pigfetd/height/.initial=1.1}
+\ctikzset{tripoles/pigfetd/base width/.initial=.5}
+\ctikzset{tripoles/pigfetd/gate width/.initial=.62}
+\ctikzset{tripoles/pigfetd/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfetd/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfetd/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfetd/curr direction/.initial=1}
+
+\ctikzset{tripoles/pigfetebulk/width/.initial=.7}
+\ctikzset{tripoles/pigfetebulk/gate height/.initial=.35}
+\ctikzset{tripoles/pigfetebulk/conn height/.initial=.35}
+\ctikzset{tripoles/pigfetebulk/base height/.initial=.5}
+\ctikzset{tripoles/pigfetebulk/height/.initial=1.1}
+\ctikzset{tripoles/pigfetebulk/base width/.initial=.5}
+\ctikzset{tripoles/pigfetebulk/gate width/.initial=.62}
+\ctikzset{tripoles/pigfetebulk/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigfetebulk/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigfetebulk/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigfetebulk/curr direction/.initial=1}
+
+\ctikzset{tripoles/npn/width/.initial=.6}
+\ctikzset{tripoles/npn/base height/.initial=.45}
+\ctikzset{tripoles/npn/base height 2/.initial=.15}
+\ctikzset{tripoles/npn/base height/.initial=.4}
+\ctikzset{tripoles/npn/conn height/.initial=0}
+\ctikzset{tripoles/npn/height/.initial=1.1}
+\ctikzset{tripoles/npn/base width/.initial=.5}
+\ctikzset{tripoles/npn/arrow pos/.initial=.5}
+\ctikzset{tripoles/npn/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/npn/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/npn/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/npn/curr direction/.initial=1}
+
+\ctikzset{tripoles/pnp/width/.initial=.6}
+\ctikzset{tripoles/pnp/base height/.initial=.45}
+\ctikzset{tripoles/pnp/base height 2/.initial=.15}
+\ctikzset{tripoles/pnp/base height/.initial=.4}
+\ctikzset{tripoles/pnp/conn height/.initial=0}
+\ctikzset{tripoles/pnp/height/.initial=1.1}
+\ctikzset{tripoles/pnp/base width/.initial=.5}
+\ctikzset{tripoles/pnp/arrow pos/.initial=.5}
+\ctikzset{tripoles/pnp/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pnp/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pnp/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pnp/curr direction/.initial=1}
+
+\ctikzset{tripoles/pigbt/width/.initial=.6}
+\ctikzset{tripoles/pigbt/gate height/.initial=.45}
+\ctikzset{tripoles/pigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/pigbt/base height/.initial=.4}
+\ctikzset{tripoles/pigbt/conn height/.initial=0}
+\ctikzset{tripoles/pigbt/height/.initial=1.1}
+\ctikzset{tripoles/pigbt/gate width/.initial=.62}
+\ctikzset{tripoles/pigbt/base width/.initial=.5}
+\ctikzset{tripoles/pigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pigbt/curr direction/.initial=1}
+
+\ctikzset{tripoles/nigbt/width/.initial=.6}
+\ctikzset{tripoles/nigbt/gate height/.initial=.45}
+\ctikzset{tripoles/nigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/nigbt/base height/.initial=.4}
+\ctikzset{tripoles/nigbt/conn height/.initial=0}
+\ctikzset{tripoles/nigbt/height/.initial=1.1}
+\ctikzset{tripoles/nigbt/gate width/.initial=.62}
+\ctikzset{tripoles/nigbt/base width/.initial=.5}
+\ctikzset{tripoles/nigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/nigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/nigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/nigbt/curr direction/.initial=1}
+
+\ctikzset{tripoles/Lpigbt/width/.initial=.6}
+\ctikzset{tripoles/Lpigbt/gate height/.initial=.45}
+\ctikzset{tripoles/Lpigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/Lpigbt/base height/.initial=.4}
+\ctikzset{tripoles/Lpigbt/conn height/.initial=.4}
+\ctikzset{tripoles/Lpigbt/height/.initial=1.1}
+\ctikzset{tripoles/Lpigbt/gate width/.initial=.62}
+\ctikzset{tripoles/Lpigbt/base width/.initial=.5}
+\ctikzset{tripoles/Lpigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/Lpigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/Lpigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/Lpigbt/curr direction/.initial=1}
+
+\ctikzset{tripoles/Lnigbt/width/.initial=.6}
+\ctikzset{tripoles/Lnigbt/gate height/.initial=.45}
+\ctikzset{tripoles/Lnigbt/gate height 2/.initial=.15}
+\ctikzset{tripoles/Lnigbt/base height/.initial=.4}
+\ctikzset{tripoles/Lnigbt/conn height/.initial=.4}
+\ctikzset{tripoles/Lnigbt/height/.initial=1.1}
+\ctikzset{tripoles/Lnigbt/gate width/.initial=.62}
+\ctikzset{tripoles/Lnigbt/base width/.initial=.5}
+\ctikzset{tripoles/Lnigbt/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/Lnigbt/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/Lnigbt/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/Lnigbt/curr direction/.initial=1}
+
+\ctikzset{tripoles/njfet/width/.initial=.7}
+\ctikzset{tripoles/njfet/gate height/.initial=.5}
+\ctikzset{tripoles/njfet/gate height 2/.initial=.35}
+\ctikzset{tripoles/njfet/gate width/.initial=.5}
+\ctikzset{tripoles/njfet/conn height/.initial=.35}
+\ctikzset{tripoles/njfet/height/.initial=1.1}
+\ctikzset{tripoles/njfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/njfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/njfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/njfet/curr direction/.initial=1}
+
+\ctikzset{tripoles/pjfet/width/.initial=.7}
+\ctikzset{tripoles/pjfet/gate height/.initial=.5}
+\ctikzset{tripoles/pjfet/gate height 2/.initial=.35}
+\ctikzset{tripoles/pjfet/gate width/.initial=.5}
+\ctikzset{tripoles/pjfet/conn height/.initial=.35}
+\ctikzset{tripoles/pjfet/height/.initial=1.1}
+\ctikzset{tripoles/pjfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/pjfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/pjfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/pjfet/curr direction/.initial=1}
+
+\ctikzset{tripoles/isfet/width/.initial=1}
+\ctikzset{tripoles/isfet/gate height/.initial=.35}
+\ctikzset{tripoles/isfet/base height/.initial=.5}
+\ctikzset{tripoles/isfet/height/.initial=1.1}
+\ctikzset{tripoles/isfet/base width/.initial=.3}
+\ctikzset{tripoles/isfet/gate width/.initial=.5}
+\ctikzset{tripoles/isfet/conn height/.initial=0}
+\ctikzset{tripoles/isfet/wave width/.initial=.16}
+\ctikzset{tripoles/isfet/wave amp/.initial=.06}
+\ctikzset{tripoles/isfet/waves y sep/.initial=.22}
+\ctikzset{tripoles/isfet/waves x sep/.initial=.8}
+\ctikzset{tripoles/isfet/bodydiode scale/.initial=.3}
+\ctikzset{tripoles/isfet/bodydiode distance/.initial=.3}
+\ctikzset{tripoles/isfet/bodydiode conn/.initial=.6}
+\ctikzset{tripoles/isfet/curr direction/.initial=1}
+%
+% multiemitter and multicollector BJTs by Romano Giannetti
+%
+\ctikzset{tripoles/bjt/emitters/.initial=1}
+\ctikzset{tripoles/bjt/collectors/.initial=1}
+\pgfkeys{/tikz/emitters/.add code={}{\ctikzset{tripoles/bjt/emitters=#1}}}
+\pgfkeys{/tikz/collectors/.add code={}{\ctikzset{tripoles/bjt/collectors=#1}}}
+\ctikzset{tripoles/bjt/pins width/.initial=0.3}
+\pgfkeys{/tikz/bjt pins width/.add code={}{\ctikzset{tripoles/bjt/pins width=#1}}}
+\ctikzset{tripoles/bjt/multi height/.initial=.5}
+\pgfkeys{/tikz/bjt multi height/.add code={}{\ctikzset{tripoles/bjt/multi height/.initial=#1}}}
+%
+\ctikzset{tripoles/bjt/width/.initial=.3}
+\ctikzset{tripoles/bjt/base height 2/.initial=.4}
+\ctikzset{tripoles/bjt/base height/.initial=1.1}
+\ctikzset{tripoles/bjt/height/.initial=.4}
+\ctikzset{tripoles/bjt/base width/.initial=1}
+\ctikzset{tripoles/bjt/arrow pos/.initial=.5}
+% do NOT touch these two!
+\ctikzset{tripoles/bjt/npn/curr direction/.initial=1}
+\ctikzset{tripoles/bjt/pnp/curr direction/.initial=1}
+
+%% transistors stop here
+
+%% Logic ports
+
+\newif\ifpgf at circuit@europeanlogicport
+\ctikzset{logic ports/.is choice}
+\ctikzset{logic ports/european/.code= {\pgf at circuit@europeanlogicporttrue
+ \tikzset{and port/.style={shape=european and port}}%
+ \tikzset{or port/.style={shape=european or port}}%
+ \tikzset{xor port/.style={shape=european xor port}}%
+ \tikzset{buffer port/.style={shape=european buffer port}}%
+ \tikzset{not port/.style={shape=european not port}}%
+ \tikzset{nand port/.style={shape=european nand port}}%
+ \tikzset{nor port/.style={shape=european nor port}}%
+ \tikzset{xnor port/.style={shape=european xnor port}}%
+}}
+\ctikzset{logic ports/american/.code= {\pgf at circuit@europeanlogicportfalse
+ \tikzset{and port/.style={shape=american and port}}%
+ \tikzset{or port/.style={shape=american or port}}%
+ \tikzset{xor port/.style={shape=american xor port}}%
+ \tikzset{buffer port/.style={shape=american buffer port}}%
+ \tikzset{not port/.style={shape=american not port}}%
+ \tikzset{nand port/.style={shape=american nand port}}%
+ \tikzset{nor port/.style={shape=american nor port}}%
+ \tikzset{xnor port/.style={shape=american xnor port}}%
+}}
+
+\ctikzset{logic ports origin/.is choice}
+\ctikzset{logic ports origin/legacy/.code={
+ \ctikzset{tripoles/american and port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american nand port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american nor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american or port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american xor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/american xnor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european and port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european nand port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european or port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european nor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european xor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european xnor port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european buffer port/origin/.initial=0.8}%
+ \ctikzset{tripoles/european not port/origin/.initial=0.8}%
+ }%
+}
+\ctikzset{logic ports origin/center/.code={%
+ \ctikzset{tripoles/american and port/origin/.initial=0}%
+ \ctikzset{tripoles/american nand port/origin/.initial=0}%
+ \ctikzset{tripoles/american nor port/origin/.initial=0}%
+ \ctikzset{tripoles/american or port/origin/.initial=0}%
+ \ctikzset{tripoles/american xor port/origin/.initial=0}%
+ \ctikzset{tripoles/american xnor port/origin/.initial=0}%
+ \ctikzset{tripoles/european and port/origin/.initial=0}%
+ \ctikzset{tripoles/european nand port/origin/.initial=0}%
+ \ctikzset{tripoles/european or port/origin/.initial=0}%
+ \ctikzset{tripoles/european nor port/origin/.initial=0}%
+ \ctikzset{tripoles/european xor port/origin/.initial=0}%
+ \ctikzset{tripoles/european xnor port/origin/.initial=0}%
+ \ctikzset{tripoles/european buffer port/origin/.initial=0}%
+ \ctikzset{tripoles/european not port/origin/.initial=0}%
+ }%
+}
+
+
+\ctikzset{tripoles/american and port/width/.initial=1.1}
+\ctikzset{tripoles/american and port/height/.initial=.8}
+\ctikzset{tripoles/american and port/port width/.initial=.7}
+\ctikzset{tripoles/american and port/input height/.initial=.5}
+\ctikzset{tripoles/american nand port/width/.initial=1.1}
+\ctikzset{tripoles/american nand port/height/.initial=.8}
+\ctikzset{tripoles/american nand port/port width/.initial=.7}
+\ctikzset{tripoles/american nand port/circle width/.initial=.15}
+\ctikzset{tripoles/american nand port/input height/.initial=.5}
+\ctikzset{tripoles/american or port/width/.initial=1.1}
+\ctikzset{tripoles/american or port/height/.initial=.8}
+\ctikzset{tripoles/american or port/port width/.initial=.7}
+\ctikzset{tripoles/american or port/input height/.initial=.5}
+\ctikzset{tripoles/american or port/input skip/.initial=.25}
+\ctikzset{tripoles/american or port/aaa/.initial=.6}
+\ctikzset{tripoles/american or port/bbb/.initial=.4}
+\ctikzset{tripoles/american or port/ccc/.initial=.5}
+\ctikzset{tripoles/american or port/ddd/.initial=.0}
+\ctikzset{tripoles/american nor port/width/.initial=1.1}
+\ctikzset{tripoles/american nor port/height/.initial=.8}
+\ctikzset{tripoles/american nor port/port width/.initial=.7}
+\ctikzset{tripoles/american nor port/input height/.initial=.5}
+\ctikzset{tripoles/american nor port/input skip/.initial=.25}
+\ctikzset{tripoles/american nor port/circle width/.initial=.15}
+\ctikzset{tripoles/american nor port/aaa/.initial=.6}
+\ctikzset{tripoles/american nor port/bbb/.initial=.4}
+\ctikzset{tripoles/american nor port/ccc/.initial=.5}
+\ctikzset{tripoles/american nor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xor port/width/.initial=1.1}
+\ctikzset{tripoles/american xor port/height/.initial=.8}
+\ctikzset{tripoles/american xor port/port width/.initial=.7}
+\ctikzset{tripoles/american xor port/input height/.initial=.5}
+\ctikzset{tripoles/american xor port/input skip/.initial=.15}
+\ctikzset{tripoles/american xor port/distance/.initial=.1}
+\ctikzset{tripoles/american xnor port/width/.initial=1.1}
+\ctikzset{tripoles/american xnor port/height/.initial=.8}
+\ctikzset{tripoles/american xnor port/port width/.initial=.7}
+\ctikzset{tripoles/american xnor port/input height/.initial=.5}
+\ctikzset{tripoles/american xnor port/input skip/.initial=.15}
+\ctikzset{tripoles/american xnor port/distance/.initial=.1}
+\ctikzset{tripoles/american xnor port/circle width/.initial=.15}
+\ctikzset{tripoles/american and port/origin/.initial=0.8}
+\ctikzset{tripoles/american and port/inputs/.initial=2}
+% variable number of inputs
+\ctikzset{tripoles/american nand port/origin/.initial=0.8}
+\ctikzset{tripoles/american nand port/inputs/.initial=2}
+\ctikzset{tripoles/american nor port/origin/.initial=0.8}
+\ctikzset{tripoles/american nor port/inputs/.initial=2}
+\ctikzset{tripoles/american nor port/angle/.initial=70}
+\ctikzset{tripoles/american nor port/inner/.initial=0.3}
+\ctikzset{tripoles/american or port/origin/.initial=0.8}
+\ctikzset{tripoles/american or port/inputs/.initial=2}
+\ctikzset{tripoles/american or port/angle/.initial=70}
+\ctikzset{tripoles/american or port/inner/.initial=0.3}
+\ctikzset{tripoles/american xor port/origin/.initial=0.8}
+\ctikzset{tripoles/american xor port/inputs/.initial=2}
+\ctikzset{tripoles/american xor port/angle/.initial=70}
+\ctikzset{tripoles/american xor port/inner/.initial=0.3}
+\ctikzset{tripoles/american xnor port/origin/.initial=0.8}
+\ctikzset{tripoles/american xnor port/inputs/.initial=2}
+\ctikzset{tripoles/american xnor port/angle/.initial=70}
+\ctikzset{tripoles/american xnor port/inner/.initial=0.3}
+
+\ctikzset{tripoles/european and port/width/.initial=1.4}
+\ctikzset{tripoles/european and port/height/.initial=.65}
+\ctikzset{tripoles/european and port/reserved/.initial=.6}
+\ctikzset{tripoles/european and port/input height/.initial=.6}
+\ctikzset{tripoles/european or port/width/.initial=1.4}
+\ctikzset{tripoles/european or port/height/.initial=.65}
+\ctikzset{tripoles/european or port/reserved/.initial=.6}
+\ctikzset{tripoles/european or port/input height/.initial=.6}
+\ctikzset{tripoles/european xor port/width/.initial=1.4}
+\ctikzset{tripoles/european xor port/height/.initial=.65}
+\ctikzset{tripoles/european xor port/reserved/.initial=.6}
+\ctikzset{tripoles/european xor port/input height/.initial=.6}
+\ctikzset{tripoles/european nand port/width/.initial=1.4}
+\ctikzset{tripoles/european nand port/not height/.initial=.3}
+\ctikzset{tripoles/european nand port/not width/.initial=.8}
+\ctikzset{tripoles/european nand port/height/.initial=.65}
+\ctikzset{tripoles/european nand port/reserved/.initial=.6}
+\ctikzset{tripoles/european nand port/input height/.initial=.6}
+\ctikzset{tripoles/european buffer port/width/.initial=1.4}
+\ctikzset{tripoles/european buffer port/not height/.initial=.3}
+\ctikzset{tripoles/european buffer port/not width/.initial=.8}
+\ctikzset{tripoles/european buffer port/height/.initial=.65}
+\ctikzset{tripoles/european buffer port/reserved/.initial=.6}
+\ctikzset{tripoles/european buffer port/input height/.initial=0}
+\ctikzset{tripoles/european not port/width/.initial=1.4}
+\ctikzset{tripoles/european not port/not height/.initial=.3}
+\ctikzset{tripoles/european not port/not width/.initial=.8}
+\ctikzset{tripoles/european not port/height/.initial=.65}
+\ctikzset{tripoles/european not port/reserved/.initial=.6}
+\ctikzset{tripoles/european not port/input height/.initial=0}
+\ctikzset{tripoles/european xnor port/width/.initial=1.4}
+\ctikzset{tripoles/european xnor port/not height/.initial=.3}
+\ctikzset{tripoles/european xnor port/not width/.initial=.8}
+\ctikzset{tripoles/european xnor port/height/.initial=.65}
+\ctikzset{tripoles/european xnor port/reserved/.initial=.6}
+\ctikzset{tripoles/european xnor port/input height/.initial=.6}
+\ctikzset{tripoles/european nor port/width/.initial=1.4}
+\ctikzset{tripoles/european nor port/not height/.initial=.3}
+\ctikzset{tripoles/european nor port/not width/.initial=.8}
+\ctikzset{tripoles/european nor port/height/.initial=.65}
+\ctikzset{tripoles/european nor port/reserved/.initial=.6}
+\ctikzset{tripoles/european nor port/input height/.initial=.6}
+% variable number of inputs
+\ctikzset{tripoles/european and port/origin/.initial=0.8}
+\ctikzset{tripoles/european and port/inputs/.initial=2}
+\ctikzset{tripoles/european nand port/origin/.initial=0.8}
+\ctikzset{tripoles/european nand port/inputs/.initial=2}
+\ctikzset{tripoles/european or port/origin/.initial=0.8}
+\ctikzset{tripoles/european or port/inputs/.initial=2}
+\ctikzset{tripoles/european nor port/origin/.initial=0.8}
+\ctikzset{tripoles/european nor port/inputs/.initial=2}
+\ctikzset{tripoles/european xor port/origin/.initial=0.8}
+\ctikzset{tripoles/european xor port/inputs/.initial=2}
+\ctikzset{tripoles/european xnor port/origin/.initial=0.8}
+\ctikzset{tripoles/european xnor port/inputs/.initial=2}
+\ctikzset{tripoles/european buffer port/origin/.initial=0.8}
+\ctikzset{tripoles/european buffer port/inputs/.initial=1}%
+\ctikzset{tripoles/european not port/origin/.initial=0.8}
+\ctikzset{tripoles/european not port/inputs/.initial=1}%
+%%% parameters that are not used anymore after multiinput
+%%% gates  left for compatibility of source code.
+\ctikzset{tripoles/american xor port/aaa/.initial=.6}
+\ctikzset{tripoles/american xor port/bbb/.initial=.4}
+\ctikzset{tripoles/american xor port/ccc/.initial=.5}
+\ctikzset{tripoles/american xor port/ddd/.initial=.0}
+\ctikzset{tripoles/american xnor port/aaa/.initial=.6}
+\ctikzset{tripoles/american xnor port/bbb/.initial=.4}
+\ctikzset{tripoles/american xnor port/ccc/.initial=.5}
+\ctikzset{tripoles/american xnor port/ddd/.initial=.0}
+% switches for logic gates
+%
+\pgfkeys{/tikz/number inputs/.initial=0}
+\pgfkeys{/tikz/number inputs/.default=0}
+%
+% switches for op amps
+% changing input polarity
+%
+\newif\ifpgf at circuit@oa at iplusup\pgf at circuit@oa at iplusupfalse
+\pgfkeys{/tikz/noinv input up/.add code={}{\pgf at circuit@oa at iplusuptrue}}
+\ctikzset{noinv input up/.add code={}{\pgf at circuit@oa at iplusuptrue}}
+\pgfkeys{/tikz/noinv input down/.add code={}{\pgf at circuit@oa at iplusupfalse}}
+\ctikzset{noinv input down/.add code={}{\pgf at circuit@oa at iplusupfalse}}
+%
+% changing output polarity (for fully diff objects)
+%
+\newif\ifpgf at circuit@oa at oplusup\pgf at circuit@oa at oplusuptrue
+\pgfkeys{/tikz/noinv output up/.add code={}{\pgf at circuit@oa at oplusuptrue}}
+\ctikzset{noinv output up/.add code={}{\pgf at circuit@oa at oplusuptrue}}
+\pgfkeys{/tikz/noinv output down/.add code={}{\pgf at circuit@oa at oplusupfalse}}
+\ctikzset{noinv output down/.add code={}{\pgf at circuit@oa at oplusupfalse}}
+
+% Operational amplifier
+\ctikzset{tripoles/op amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/op amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/op amp/height/.initial=1.4} % Total height
+\ctikzset{tripoles/op amp/input height/.initial=.5} % Input port vertical separation
+\ctikzset{tripoles/op amp/up pos/.initial=.45} % Top and bottom anchor position
+\ctikzset{tripoles/op amp/font/.initial=\pgf at circ@font at tenbm} % Absolute font size needed!
+
+% Fully differential operational amplifier
+\ctikzset{tripoles/fd op amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/fd op amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/fd op amp/height/.initial=1.4} % Total height
+\ctikzset{tripoles/fd op amp/input height/.initial=.5} % Input port vertical separation
+\ctikzset{tripoles/fd op amp/output height/.initial=.5} % Output port vertical separation
+\ctikzset{tripoles/fd op amp/up pos/.initial=.45} % Top and bottom anchor position
+\ctikzset{tripoles/fd op amp/font/.initial=\pgf at circ@font at tenbm} % Absolute font size needed!
+
+\ctikzset{tripoles/en amp/width/.initial=1.7}
+\ctikzset{tripoles/en amp/port width/.initial=.7}
+\ctikzset{tripoles/en amp/height/.initial=1.6}
+\ctikzset{tripoles/en amp/input height/.initial=.3}
+\ctikzset{tripoles/en amp/up pos/.initial=.45}
+\ctikzset{tripoles/en amp/font/.initial=\pgf at circ@font at tenbm} % Absolute font size needed!
+\ctikzset{tripoles/en amp/font2/.initial=\pgf at circ@font at twelve} % Absolute font size needed!
+\ctikzset{tripoles/en amp/text/.initial={$\mathstrut{\triangleright}\,{\infty}$}}
+\tikzset{
+ en amp text/.code = {%
+ \ctikzsetvalof{tripoles/en amp/text}{#1}%
+ },
+ en amp text A/.code = {%
+ \ctikzsetvalof{tripoles/en amp/text}{$\mathstrut{\triangleright}\,\mathrm{A}$}%
+ },
+}
+
+% Transconductance amplifier
+\ctikzset{tripoles/gm amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/gm amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/gm amp/height/.initial=1.4} % Left side of the trapezoid
+\ctikzset{tripoles/gm amp/height 2/.initial=0.5} % Right side of the trapezoid
+\ctikzset{tripoles/gm amp/input height/.initial=.5} % Input port vertical separation
+\ctikzset{tripoles/gm amp/up pos/.initial=.45} % Top and bottom anchor position
+\ctikzset{tripoles/gm amp/font/.initial=\pgf at circ@font at tenbm} % Absolute font size needed!
+
+% Instrumentation amplifier
+\ctikzset{tripoles/inst amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/inst amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/inst amp/height/.initial=1.4} % Left side of the trapezoid
+\ctikzset{tripoles/inst amp/height 2/.initial=0.6} % Right side of the trapezoid
+\ctikzset{tripoles/inst amp/input height/.initial=.5} % Input ports vertical separation
+\ctikzset{tripoles/inst amp/up pos/.initial=.4} % Top and bottom anchor position
+\ctikzset{tripoles/inst amp/refv pos/.initial=.7} % Top and bottom voltage reference position
+\ctikzset{tripoles/inst amp/font/.initial=\pgf at circ@font at tenbm} % Absolute font size needed!
+
+% Instrumentation amplifier with differential output
+\ctikzset{tripoles/fd inst amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/fd inst amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/fd inst amp/height/.initial=1.4} % Left side of the trapezoid
+\ctikzset{tripoles/fd inst amp/height 2/.initial=0.6} % Right side of the trapezoid
+\ctikzset{tripoles/fd inst amp/input height/.initial=.5} % Input ports vertical separation
+\ctikzset{tripoles/fd inst amp/output height/.initial=.5} % Output ports vertical separation
+\ctikzset{tripoles/fd inst amp/up pos/.initial=.4} % Top and bottom anchor position
+\ctikzset{tripoles/fd inst amp/refv pos/.initial=.7} % Top and bottom voltage reference position
+\ctikzset{tripoles/fd inst amp/font/.initial=\pgf at circ@font at tenbm} % Absolute font size needed!
+
+% Instrumentation amplifier with gain resistor terminals
+\ctikzset{tripoles/inst amp ra/width/.initial=2.4} % Total width
+\ctikzset{tripoles/inst amp ra/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/inst amp ra/height/.initial=2.9} % Left side of the trapezoid
+\ctikzset{tripoles/inst amp ra/height 2/.initial=0.4} % Right side of the trapezoid
+\ctikzset{tripoles/inst amp ra/input height/.initial=.7} % Input ports vertical separation
+\ctikzset{tripoles/inst amp ra/up pos/.initial=.4} % Top and bottom anchor position
+\ctikzset{tripoles/inst amp ra/refv pos/.initial=.7} % Top and bottom voltage reference position
+\ctikzset{tripoles/inst amp ra/ra pos/.initial=.6} % Gain resistor terminals vertical separation
+\ctikzset{tripoles/inst amp ra/font/.initial=\pgf at circ@font at tenbm} % Absolute font size needed!
+
+% Plain amplifier
+\ctikzset{tripoles/plain amp/width/.initial=1.7} % Total width
+\ctikzset{tripoles/plain amp/port width/.initial=.7} % Terminals length
+\ctikzset{tripoles/plain amp/height/.initial=1.4} % Total height
+\ctikzset{tripoles/plain amp/input height/.initial=.5} % Input ports vertical separation
+\ctikzset{tripoles/plain amp/up pos/.initial=.45} % Top and bottom anchor position
+
+\ctikzset{tripoles/thyristor/height/.initial=1.10}
+\ctikzset{tripoles/thyristor/height 2/.initial=.5}
+\ctikzset{tripoles/thyristor/width/.initial=1.0}
+\ctikzset{tripoles/thyristor/diode height/.initial=.5}
+\ctikzset{tripoles/thyristor/diode width left/.initial=.4}
+\ctikzset{tripoles/thyristor/diode width right/.initial=.3}
+
+\ctikzset{tripoles/triac/height/.initial=1.1}
+\ctikzset{tripoles/triac/width/.initial=1}
+\ctikzset{tripoles/triac/diode width left/.initial=.3}
+\ctikzset{tripoles/triac/diode width right/.initial=.3}
+
+%% Cute switches
+\ctikzset{bipoles/cuteswitch/shape/.initial={ocirc}}
+\ctikzset{bipoles/cuteswitch/height/.initial=.6}
+\ctikzset{bipoles/cuteswitch/height 2/.initial=.2}
+\ctikzset{bipoles/cuteswitch/width/.initial=.50}
+\ctikzset{bipoles/cuteswitch/thickness/.initial=1}
+
+\ctikzset{tripoles/spdt/width/.initial=.85}
+\ctikzset{tripoles/spdt/height/.initial=.45}
+\ctikzset{tripoles/spdt/margin/.initial=.45}
+
+\ctikzset{tripoles/toggleswitch/height/.initial=.8}
+\ctikzset{tripoles/toggleswitch/height 2/.initial=.0}
+\ctikzset{tripoles/toggleswitch/width/.initial=.80}
+
+\ctikzset{tripoles/mixer/width/.initial=0.7}
+\ctikzset{tripoles/adder/width/.initial=0.7}
+\ctikzset{tripoles/circulator/width/.initial=.7}
+\ctikzset{tripoles/oscillator/width/.initial=.7}
+
+
+\ctikzset{tripoles/wilkinson/height/.initial=1.3}
+\ctikzset{tripoles/wilkinson/width/.initial=1.3}
+
+\ctikzset{quadpoles/transformer/inner/.initial=0.4}
+\ctikzset{quadpoles/transformer/width/.initial=1.5}
+\ctikzset{quadpoles/transformer/width1/.initial=.4}
+\ctikzset{quadpoles/transformer/height/.initial=1.5}
+\ctikzset{quadpoles/transformer/height1/.initial=.8}
+\ctikzset{quadpoles/transformer core/inner/.initial=0.4}
+\ctikzset{quadpoles/transformer core/width/.initial=1.5}
+\ctikzset{quadpoles/transformer core/height/.initial=1.5}
+\ctikzset{quadpoles/transformer core/core height/.initial=.5}
+\ctikzset{quadpoles/transformer core/core width/.initial=.05}
+\ctikzset{quadpoles/gyrator/inner/.initial=0.4}
+\ctikzset{quadpoles/gyrator/width/.initial=1.5}
+\ctikzset{quadpoles/gyrator/height/.initial=1.5}
+\ctikzset{quadpoles/fourport/width/.initial=1.3}
+\ctikzset{quadpoles/fourport/height/.initial=1.3}
+\ctikzset{quadpoles/coupler/width/.initial=1.3}
+\ctikzset{quadpoles/coupler/height/.initial=1.3}
+\ctikzset{quadpoles/coupler2/width/.initial=1.3}
+\ctikzset{quadpoles/coupler2/height/.initial=1.3}
+
+\ctikzset{/tikz/circuitikz/tripoles/magnetron/width/.initial=1}
+
+\ctikzset{quadpoles style/.is choice}
+\ctikzset{quadpoles style/inward/.code={% default value
+ \ctikzset{quadpoles/transformer/inner=0.4}%
+ \ctikzset{quadpoles/transformer/width=1.5}%
+ \ctikzset{quadpoles/transformer core/inner=0.4}%
+ \ctikzset{quadpoles/transformer core/width=1.5}%
+ \ctikzset{quadpoles/gyrator/inner=0.4}%
+ \ctikzset{quadpoles/gyrator/width=1.5}%
+ }%
+}
+\ctikzset{quadpoles style/inline/.code={% now horizontal baffle
+ \ctikzset{quadpoles/transformer/inner=1}%
+ \ctikzset{quadpoles/transformer/width=0.6}%
+ \ctikzset{quadpoles/transformer core/inner=1}%
+ \ctikzset{quadpoles/transformer core/width=0.6}%
+ \ctikzset{quadpoles/gyrator/inner=1} % FIXME
+ \ctikzset{quadpoles/gyrator/width=0.6}%
+ }%
+}
+
+%
+% multipoles
+%
+\ctikzset{multipoles/thickness/.initial=2}
+\ctikzset{multipoles/font/.initial=\pgf at circ@font at tiny}
+% DIP (dual in line package) chips
+\ctikzset{multipoles/dipchip/width/.initial=1.2}
+\ctikzset{multipoles/dipchip/num pins/.initial=8}
+\ctikzset{multipoles/dipchip/pin spacing/.initial=0.4}
+\pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/dipchip/num pins=#1}}}
+% QFP (quad flat package) chips
+\ctikzset{multipoles/qfpchip/num pins/.initial=8}
+\ctikzset{multipoles/qfpchip/pin spacing/.initial=0.4}
+\pgfkeys{/tikz/num pins/.add code={}{\ctikzset{multipoles/qfpchip/num pins=#1}}}
+% chip numbers
+\newif\ifpgf at circuit@chip at shownumbers\pgf at circuit@chip at shownumberstrue
+\pgfkeys{/tikz/show numbers/.add code={}{\pgf at circuit@chip at shownumberstrue}}
+\ctikzset{show numbers/.add code={}{\pgf at circuit@chip at shownumberstrue}}
+\pgfkeys{/tikz/hide numbers/.add code={}{\pgf at circuit@chip at shownumbersfalse}}
+\ctikzset{hide numbers/.add code={}{\pgf at circuit@chip at shownumbersfalse}}
+\newif\ifpgf at circuit@chip at straightnumbers\pgf at circuit@chip at straightnumberstrue
+\pgfkeys{/tikz/straight numbers/.add code={}{\pgf at circuit@chip at straightnumberstrue}}
+\ctikzset{straight numbers/.add code={}{\pgf at circuit@chip at straightnumberstrue}}
+\pgfkeys{/tikz/rotated numbers/.add code={}{\pgf at circuit@chip at straightnumbersfalse}}
+\ctikzset{rotated numbers/.add code={}{\pgf at circuit@chip at straightnumbersfalse}}
+% external chip pins
+\ctikzset{multipoles/external pins thickness/.initial=1}
+\ctikzset{multipoles/external pins width/.initial=0.2}
+\ctikzset{multipoles/external pad fraction/.initial=0}
+\pgfkeys{/tikz/external pins width/.add code={}{\ctikzset{multipoles/external pins width=#1}}}
+\pgfkeys{/tikz/external pad fraction/.add code={}{\ctikzset{multipoles/external pad fraction=#1}}}
+% topmarks
+\newif\ifpgf at circuit@chip at topmark\pgf at circuit@chip at topmarktrue
+\pgfkeys{/tikz/topmark/.add code={}{\pgf at circuit@chip at topmarktrue}}
+\ctikzset{topmark/.add code={}{\pgf at circuit@chip at topmarktrue}}
+\pgfkeys{/tikz/no topmark/.add code={}{\pgf at circuit@chip at topmarkfalse}}
+\ctikzset{no topmark/.add code={}{\pgf at circuit@chip at topmarkfalse}}
+
+% rotary switch by Romano
+\ctikzset{multipoles/rotary/thickness/.initial=1}
+\ctikzset{multipoles/rotary/shape/.initial=ocirc}
+\ctikzset{multipoles/rotary/channels/.initial=5}
+\ctikzset{multipoles/rotary/angle/.initial=60}
+\ctikzset{multipoles/rotary/wiper/.initial=20}
+\ctikzset{multipoles/rotary/arrow/.is choice}
+\newif\ifpgf at circ@rotaryarrow\pgf at circ@rotaryarrowfalse
+\newif\ifpgf at circ@rotaryarrow at cw\pgf at circ@rotaryarrow at cwfalse
+\newif\ifpgf at circ@rotaryarrow at ccw\pgf at circ@rotaryarrow at ccwfalse
+\ctikzset{multipoles/rotary/arrow/none/.code={\pgf at circ@rotaryarrowfalse\pgf at circ@rotaryarrow at cwfalse\pgf at circ@rotaryarrow at ccwfalse}}
+\ctikzset{multipoles/rotary/arrow/both/.code={\pgf at circ@rotaryarrowtrue\pgf at circ@rotaryarrow at cwtrue\pgf at circ@rotaryarrow at ccwtrue}}
+\ctikzset{multipoles/rotary/arrow/cw/.code={\pgf at circ@rotaryarrowtrue\pgf at circ@rotaryarrow at cwtrue\pgf at circ@rotaryarrow at ccwfalse}}
+\ctikzset{multipoles/rotary/arrow/ccw/.code={\pgf at circ@rotaryarrowtrue\pgf at circ@rotaryarrow at cwfalse\pgf at circ@rotaryarrow at ccwtrue}}
+
+\tikzset{%
+ rotary switch/.style args={#1in#2wiper#3}{%
+ shape=rotaryswitch,
+ /tikz/circuitikz/multipoles/rotary/channels=#1,
+ /tikz/circuitikz/multipoles/rotary/angle=#2,
+ /tikz/circuitikz/multipoles/rotary/wiper=#3,
+ },
+ rotary switch /.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=none,
+ },
+ rotary switch </.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=ccw,
+ },
+ rotary switch >/.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=cw,
+ },
+ rotary switch <>/.style args={#1in#2wiper#3}{
+ rotary switch=#1 in #2 wiper #3,
+ /tikz/circuitikz/multipoles/rotary/arrow=both,
+ },
+ % Notice that these should be the same as the initial values of the keys
+ rotary switch/.default={5 in 60 wiper 20},
+ rotary switch /.default={5 in 60 wiper 20},
+ rotary switch </.default={5 in 60 wiper 20},
+ rotary switch >/.default={5 in 60 wiper 20},
+ rotary switch <>/.default={5 in 60 wiper 20},
+}
+
+% %Mechanical section
+\ctikzset{/tikz/circuitikz/tripoles/elmech/height/.initial=.8}
+\ctikzset{/tikz/circuitikz/tripoles/elmech/width/.initial=.6}
+\ctikzset{bipoles/spring/height/.initial=.5}
+\ctikzset{bipoles/spring/width/.initial=.5}
+\ctikzset{bipoles/mass/height/.initial=.55}
+\ctikzset{bipoles/mass/box height/.initial=.4}
+\ctikzset{bipoles/mass/width/.initial=.5}
+
+\ctikzset{bipoles/damper/height/.initial=.35}
+\ctikzset{bipoles/damper/length/.initial=.3}
+\ctikzset{bipoles/damper/width/.initial=.4}
+
+
+\ctikzset{bipole/.is family}
+\ctikzset{bipole/kind/.initial=}
+\ctikzset{bipole/name/.initial=}
+\newif\ifpgf at circuit@bipole at isvoltage
+\ctikzset{bipole/is voltage/.is if=pgf at circuit@bipole at isvoltage}
+\newif\ifpgf at circuit@bipole at voltageoutsideofsymbol
+\ctikzset{bipole/is voltageoutsideofsymbol/.is if=pgf at circuit@bipole at voltageoutsideofsymbol}
+\newif\ifpgf at circuit@bipole at strokedsymbol
+\ctikzset{bipole/is strokedsymbol/.is if=pgf at circuit@bipole at strokedsymbol}
+\newif\ifpgf at circuit@bipole at iscurrent
+\ctikzset{bipole/is current/.is if=pgf at circuit@bipole at iscurrent}
+
+\ctikzset{bipole/voltage/.is family}
+\newif\ifpgf at circuit@bipole at voltage@backward
+\ctikzset{bipole/voltage/direction/.is choice}
+\ctikzset{bipole/voltage/direction/forward/.code={\pgf at circuit@bipole at voltage@backwardfalse}}
+\ctikzset{bipole/voltage/direction/backward/.code={\pgf at circuit@bipole at voltage@backwardtrue}}
+\newif\ifpgf at circuit@bipole at voltage@below
+\ctikzset{bipole/voltage/position/.is choice}
+\ctikzset{bipole/voltage/position/above/.code={\pgf at circuit@bipole at voltage@belowfalse}}
+\ctikzset{bipole/voltage/position/below/.code={\pgf at circuit@bipole at voltage@belowtrue}}
+
+\ctikzset{bipole/voltage/label/unit/.initial=}
+\ctikzset{bipole/voltage/label/name/.initial=}
+
+\ctikzset{bipole/current/.is family}
+\newif\ifpgf at circuit@bipole at current@backward
+\ctikzset{bipole/current/direction/.is choice}
+\ctikzset{bipole/current/direction/forward/.code={\pgf at circuit@bipole at current@backwardfalse}}
+\ctikzset{bipole/current/direction/backward/.code={\pgf at circuit@bipole at current@backwardtrue}}
+\newif\ifpgf at circuit@bipole at current@before
+\ctikzset{bipole/current/x position/.is choice}
+\ctikzset{bipole/current/x position/after/.code={\pgf at circuit@bipole at current@beforefalse}}
+\ctikzset{bipole/current/x position/before/.code={\pgf at circuit@bipole at current@beforetrue}}
+\newif\ifpgf at circuit@bipole at current@below
+\ctikzset{bipole/current/y position/.is choice}
+\ctikzset{bipole/current/y position/above/.code={\pgf at circuit@bipole at current@belowfalse}}
+\ctikzset{bipole/current/y position/below/.code={\pgf at circuit@bipole at current@belowtrue}}
+\ctikzset{bipole/current/label/unit/.initial=}
+\ctikzset{bipole/current/label/name/.initial=}
+
+\ctikzset{bipole/flow/.is family}
+\newif\ifpgf at circuit@bipole at flow@backward
+\ctikzset{bipole/flow/direction/.is choice}
+\ctikzset{bipole/flow/direction/forward/.code={\pgf at circuit@bipole at flow@backwardfalse}}
+\ctikzset{bipole/flow/direction/backward/.code={\pgf at circuit@bipole at flow@backwardtrue}}
+\newif\ifpgf at circuit@bipole at flow@before
+\ctikzset{bipole/flow/x position/.is choice}
+\ctikzset{bipole/flow/x position/after/.code={\pgf at circuit@bipole at flow@beforefalse}}
+\ctikzset{bipole/flow/x position/before/.code={\pgf at circuit@bipole at flow@beforetrue}}
+\newif\ifpgf at circuit@bipole at flow@below
+\ctikzset{bipole/flow/y position/.is choice}
+\ctikzset{bipole/flow/y position/above/.code={\pgf at circuit@bipole at flow@belowfalse}}
+\ctikzset{bipole/flow/y position/below/.code={\pgf at circuit@bipole at flow@belowtrue}}
+\ctikzset{bipole/flow/label/unit/.initial=}
+\ctikzset{bipole/flow/label/name/.initial=}
+\ctikzset{flow/distance/.initial = .5}
+\ctikzset{flow/offset/.initial = .2}%distance between flowarrow and conductor
+
+\ctikzset{bipole/label/.is family}
+\ctikzset{bipole/label/position/.initial=90}
+\ctikzset{bipole/label/unit/.initial=}
+\ctikzset{bipole/label/name/.initial=}
+\ctikzset{bipole/annotation/.is family}
+\ctikzset{bipole/annotation/position/.initial=90}
+\ctikzset{bipole/annotation/unit/.initial=}
+\ctikzset{bipole/annotation/name/.initial=}
+
+\newif\ifpgf at circuit@europeanresistor
+\ctikzset{resistor/.is choice}
+\ctikzset{resistor/american/.code = \pgf at circuit@europeanresistorfalse }
+\ctikzset{resistor/european/.code = \pgf at circuit@europeanresistortrue }
+
+\ctikzset{inductor/.is choice}
+\ctikzset{inductor/cute/.code={\ctikzsetvalof{inductor}{cute}}}
+\ctikzset{inductor/european/.code={\ctikzsetvalof{inductor}{european}}}
+\ctikzset{inductor/american/.code={\ctikzsetvalof{inductor}{american}}}
+
+\newif\ifpgf at circuit@strokediode
+\newif\ifpgf at circuit@fulldiode
+\pgf at circuit@strokediodefalse
+\pgf at circuit@fulldiodefalse
+
+\ctikzset{diode/.is choice}
+\ctikzset{diode/empty/.code = \pgf at circuit@fulldiodefalse\pgf at circuit@strokediodefalse}%default
+\ctikzset{diode/full/.code = \pgf at circuit@fulldiodetrue }
+\ctikzset{diode/stroke/.code = \pgf at circuit@strokediodetrue}
+
+\tikzset{full diodes/.style = { \circuitikzbasekey/diode = full}}
+\tikzset{empty diodes/.style = { \circuitikzbasekey/diode = empty}}
+\tikzset{stroke diodes/.style = { \circuitikzbasekey/diode = stroke}}
+
+\ctikzset{thickness/.initial=2}
+\ctikzset{color/.initial=black}
+\pgfkeys{/tikz/color/.add code={}{\ctikzset{color={#1}}}}
+
+\newif\ifpgf at circ@siunitx
+\newif\ifpgf at circ@siunitx at res
+
+\ctikzset{straight/.is choice}
+\ctikzset{straightvoltage value/.initial=true}
+\ctikzset{straight/true/.code = {\pgf at circuit@bipole at voltage@straighttrue}}
+\ctikzset{straight/false/.code = {\pgf at circuit@bipole at voltage@straightfalse}}
+\ctikzset{straightvoltage/.style = {/tikz/circuitikz/straight=true}}
+\newif\ifpgf at circuit@bipole at voltage@straight
+\ctikzset{bipole/straight/.is if=pgf at circuit@bipole at voltage@straight}
+
+
+\ctikzset{voltage/.is family}
+\ctikzset{voltage/distance from node/.initial=.5} %\pgf at circ@Rlen units
+\ctikzset{voltage/distance from line/.initial=.08} % pos, tra 0 e 1
+\ctikzset{voltage/bump a/.initial=1.2}
+\ctikzset{voltage/bump b/.initial=1.5}
+\ctikzset{voltage/shift/.initial=0.0} % shift form the cable of voltage symbols
+\ctikzset{voltage shift/.style={voltage/shift=#1}}
+\tikzset{voltage shift/.style={\circuitikzbasekey/voltage/shift=#1}}
+\ctikzset{voltage/european label distance/.initial=1.4}
+\ctikzset{voltage/american label distance/.initial=1.1}
+% shaping the +/ sign, see pgfcircvoltage.tex
+\ctikzset{voltage/american font/.initial={}}
+\ctikzset{voltage/american plus/.initial={$+$}}
+\ctikzset{voltage/american minus/.initial={$$}}
+
+% special cases
+\ctikzset{bipoles/generic/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/generic/voltage/bump b/.initial=2}
+\ctikzset{bipoles/generic/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/thermocouple/voltage/distance from node/.initial=.3}
+\ctikzset{bipoles/thermocouple/voltage/bump b/.initial=2.2}
+\ctikzset{bipoles/thermocouple/voltage/european label distance/.initial=1.5}
+\ctikzset{bipoles/ageneric/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/ageneric/voltage/bump b/.initial=2}
+\ctikzset{bipoles/ageneric/voltage/european label distance/.initial=1.8}
+\ctikzset{bipoles/fullgeneric/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/fullgeneric/voltage/bump b/.initial=2}
+\ctikzset{bipoles/fullgeneric/voltage/european label distance/.initial=1.8}
+\ctikzset{bipoles/memristor/voltage/distance from node/.initial=.4}
+\ctikzset{bipoles/memristor/voltage/bump b/.initial=2}
+\ctikzset{bipoles/memristor/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/tline/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/tline/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/tline/voltage/european label distance/.initial=2.1}
+%\ctikzset{bipoles/varistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/varistor/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/varistor/voltage/european label distance/.initial=2}
+%\ctikzset{bipoles/photoresistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/photoresistor/voltage/bump b/.initial=2}
+\ctikzset{bipoles/photoresistor/voltage/european label distance/.initial=1.8}
+%\ctikzset{bipoles/thermistor/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistor/voltage/bump b/.initial=2.4}
+\ctikzset{bipoles/thermistor/voltage/european label distance/.initial=2}
+%\ctikzset{bipoles/thermistorntc/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistorntc/voltage/bump b/.initial=1.6}
+%\ctikzset{bipoles/thermistorptc/voltage/distance from node/.initial=.2}
+\ctikzset{bipoles/thermistorptc/voltage/bump b/.initial=1.6}
+
+\ctikzset{current/.is family}
+\ctikzset{current/distance/.initial = .5}
+
+
+\tikzset{american currents/.style = {\circuitikzbasekey/current = american}}
+\tikzset{european currents/.style = {\circuitikzbasekey/current = european}}
+\tikzset{american voltages/.style = {\circuitikzbasekey/voltage = american}}
+\tikzset{european voltages/.style = {\circuitikzbasekey/voltage = european}}
+\tikzset{american resistors/.style = {\circuitikzbasekey/resistor = american}}
+\tikzset{european resistors/.style = {\circuitikzbasekey/resistor = european}}
+
+\newif\ifpgf at circuit@europeangfsurgearrester
+\ctikzset{gas filled surge arrester choice/.is choice}
+\ctikzset{gas filled surge arrester choice/european/.code= {\pgf at circuit@europeangfsurgearrestertrue}}
+\ctikzset{gas filled surge arrester choice/american/.code= {\pgf at circuit@europeangfsurgearresterfalse}}
+
+\tikzset{american gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=american}}
+\tikzset{european gas filled surge arrester set/.style = {\circuitikzbasekey/gas filled surge arrester choice=european}}
+\tikzset{american inductors/.style = {\circuitikzbasekey/inductor = american}}
+\tikzset{european inductors/.style = {\circuitikzbasekey/inductor = european}}
+\tikzset{cute inductors/.style = {\circuitikzbasekey/inductor = cute}}
+\tikzset{american ports/.style = {\circuitikzbasekey/logic ports = american}}
+\tikzset{european ports/.style = {\circuitikzbasekey/logic ports = european}}
+\tikzset{european/.style = {european currents, european voltages, european resistors, european inductors, european ports, european gas filled surge arrester set}}
+\tikzset{american/.style = {american currents, american voltages, american resistors, american inductors, american ports, american gas filled surge arrester set}}
+\tikzset{cute/.style = {european currents, european voltages, american resistors, cute inductors, american ports}}
+
+% I should try to make the tree clearer (this voltage conflicts with the options above)
+
+\newif\ifpgf at circuit@europeanvoltage
+\ctikzset{voltage/.is choice}
+\ctikzset{voltage/american/.code = {\pgf at circuit@europeanvoltagefalse}}
+\ctikzset{voltage/european/.code = {\pgf at circuit@europeanvoltagetrue}}
+
+\newif\ifpgf at circuit@europeancurrent
+\ctikzset{current/.is choice}
+\ctikzset{current/american/.code = \pgf at circuit@europeancurrentfalse}
+\ctikzset{current/european/.code = \pgf at circuit@europeancurrenttrue}
+
+% noise sources
+\ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50}
+
+\ctikzset{label/align/.is choice}
+\ctikzset{label/align/straight/.code={\ctikzsetvalof{label/align}{straight}}}
+\ctikzset{label/align/rotate/.code={\ctikzsetvalof{label/align}{rotate}}}
+\ctikzset{label/align/smart/.code={\ctikzsetvalof{label/align}{smart}}}
+
+% seven segment displays by RGtti
+
+\newif\ifpgf at circ@sevenseg at dot
+\newif\ifpgf at circ@sevenseg at box
+\def\pgf at circ@sevenseg at dotstate{empty}
+\ctikzset{seven seg/.is family}
+\ctikzset{seven seg/dot/.is choice}
+% none means no dot, not space for it. Empty means no dot, but space
+\ctikzset{seven seg/dot/none/.code={\pgf at circ@sevenseg at dotfalse}}
+\ctikzset{seven seg/dot/empty/.code={\pgf at circ@sevenseg at dottrue\def\pgf at circ@sevenseg at dotstate{empty}}}
+\ctikzset{seven seg/dot/off/.code={\pgf at circ@sevenseg at dottrue\def\pgf at circ@sevenseg at dotstate{off}}}
+\ctikzset{seven seg/dot/on/.code={\pgf at circ@sevenseg at dottrue\def\pgf at circ@sevenseg at dotstate{on}}}
+%
+\ctikzset{seven seg/width/.initial=0.4}% relative to \pgf at circ@Rlen
+\ctikzset{seven seg/thickness/.initial=4pt}% segment thickness
+\ctikzset{seven seg/segment sep/.initial=0.2pt}% gap between segments
+\ctikzset{seven seg/box sep/.initial=1pt}% external box gap
+\ctikzset{seven seg/color on/.initial=red}% color for segment "on"
+\ctikzset{seven seg/color off/.initial=gray!20!white} % ...and "off"
+\ctikzset{seven seg/box/.is choice}
+\ctikzset{seven seg/box/off/.code={\pgf at circ@sevenseg at boxfalse}}
+\ctikzset{seven seg/box/on/.code={\pgf at circ@sevenseg at boxtrue}}
+
+\ctikzset{seven seg/bits/.initial=0000000}
+
+\ctikzset{seven seg/value/.code={%
+ \edef\@@tmp{#1}%
+ \edef\@@n{0} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111110}\fi
+ \edef\@@n{1} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110000}\fi
+ \edef\@@n{2} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1101101}\fi
+ \edef\@@n{3} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111001}\fi
+ \edef\@@n{4} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0110011}\fi
+ \edef\@@n{5} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011011}\fi
+ \edef\@@n{6} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1011111}\fi
+ \edef\@@n{7} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110000}\fi
+ \edef\@@n{8} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111111}\fi
+ \edef\@@n{9} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1111011}\fi
+ \edef\@@n{10}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
+ \edef\@@n{11}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
+ \edef\@@n{12}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
+ \edef\@@n{13}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
+ \edef\@@n{14}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
+ \edef\@@n{15}\ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
+ \edef\@@n{A} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
+ \edef\@@n{B} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
+ \edef\@@n{C} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
+ \edef\@@n{D} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
+ \edef\@@n{E} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
+ \edef\@@n{F} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
+ \edef\@@n{a} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1110111}\fi
+ \edef\@@n{b} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0011111}\fi
+ \edef\@@n{c} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001110}\fi
+ \edef\@@n{d} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0111101}\fi
+ \edef\@@n{e} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1001111}\fi
+ \edef\@@n{f} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=1000111}\fi
+ \edef\@@n{} \ifx\@@tmp\@@n\relax\ctikzset{seven seg/bits=0000001}\fi
+}}
+
+\tikzset{%
+ seven segment val/.style args={#1dot#2box#3}{%
+ shape=bare7seg,
+ /tikz/circuitikz/seven seg/value=#1,
+ /tikz/circuitikz/seven seg/dot=#2,
+ /tikz/circuitikz/seven seg/box=#3,
+ },
+ seven segment bits/.style args={#1dot#2box#3}{%
+ shape=bare7seg,
+ /tikz/circuitikz/seven seg/bits=#1,
+ /tikz/circuitikz/seven seg/dot=#2,
+ /tikz/circuitikz/seven seg/box=#3,
+ },
+}
+
+
+%%%%%%%%%% new
+\pgfkeys{\circuitikzbasekey/.search also={/tikz}}
+
+% Electronic tubes: diodetube, triode, tetrode and pentode
+\ctikzset{tubes/width/.initial=1} % relative width
+\ctikzset{tubes/height/.initial=1.4} % relative height
+\ctikzset{tubes/tube radius/.initial=0.40} % radius of tube circle
+\ctikzset{tubes/anode distance/.initial=0.40} % distance from center
+\ctikzset{tubes/anode width/.initial=0.40} % width of an anode/plate
+\ctikzset{tubes/grid protrusion/.initial=0.25} % distance from center
+\ctikzset{tubes/grid dashes/.initial=5} % number of grid dashes
+\ctikzset{tubes/grid separation/.initial=0.2} % separation between grids
+\ctikzset{tubes/grid shift/.initial=0.0} % y shift grids from center
+\ctikzset{tubes/cathode distance/.initial=0.40} % distance from grid
+\ctikzset{tubes/cathode width/.initial=0.40} % width of an cathode
+\ctikzset{tubes/cathode corners/.initial=0.06} % corners of the cathode wire
+\ctikzset{tubes/cathode right extend/.initial=0.075} % extension at the right side
+\ctikzset{tubes/filament distance/.initial=0.1} % distance from cathode
+\ctikzset{tubes/filament angle/.initial=15} % Angle from centerpoint
+
+\newif\ifpgf at circuit@tubes at filament\pgf at circuit@tubes at filamentfalse
+\pgfkeys{/tikz/filament/.add code={}{\pgf at circuit@tubes at filamenttrue}}
+\ctikzset{tubes/filament/.add code={}{\pgf at circuit@tubes at filamenttrue}}
+\newif\ifpgf at circuit@tubes at nocathode\pgf at circuit@tubes at nocathodefalse
+\pgfkeys{/tikz/nocathode/.add code={}{\pgf at circuit@tubes at nocathodetrue}}
+\ctikzset{tubes/nocathode/.add code={}{\pgf at circuit@tubes at nocathodetrue}}
+\newif\ifpgf at circuit@tubes at fullcathode\pgf at circuit@tubes at fullcathodefalse
+\pgfkeys{/tikz/fullcathode/.add code={}{\pgf at circuit@tubes at fullcathodetrue}}
+\ctikzset{tubes/fullcathode/.add code={}{\pgf at circuit@tubes at fullcathodetrue}}
+
+%%% close: tex/pgfcirc.defines
+%%%%%%%%%%% Springe nach tex/pgfcircutils
+%%% open: tex/pgfcircutils.tex
+% Copyright 20072009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the files gpl3.0_license.txt and lppl13c_license.txt for more details.
+
+%\def\pgf at circ@handleSI#1{%
+ % \pgf at circ@siunitx at resfalse
+%
+ % \edef\len{\stringlength[e]{#1}}
+ %\testmatchingchar[e]{#1}{\len}{>}%
+ %\ifmatchingchar%
+ % \ifnum\findchars{#1}{<}=0
+ % \def\pgf at circ@handleSI at val{\substring{#1}{1}{\findchars{#1}{<}1}}
+ %\def\pgf at circ@handleSI at unit{\substring{#1}{\findchars{#1}{<}1}+1}{\stringlength{#1}}
+ %\pgf at circ@siunitx at restrue
+% \else
+% \fi
+ %\else
+ %\fi
+%}
+
+\def\pgf at circ@handleSI#1{
+ \noexpandarg
+ \def\pgf at temp{}
+ \StrBetween{#1}{<}{>}[\pgf at circ@handleSI at unit]
+ \StrLen{\pgf at circ@handleSI at unit}[\pgf at circ@handleSI at unit@len]
+
+ \ifnum\pgf at circ@handleSI at unit@len=0
+ \pgf at circ@siunitx at resfalse
+ \else
+ \IfEndWith{#1}{>}{
+ \pgf at circ@siunitx at restrue
+ \noexpandarg
+ \StrBefore{#1}{<}[\pgf at circ@handleSI at val]
+ %\typeout{si #1}
+ }{
+ \pgf at circ@siunitx at resfalse
+ %\typeout{no si #1}
+ }
+\fi
+}
+
+\def\pgf at circ@ifkeyempty#1{
+ \pgfextra{
+ \ctikzset{#1/.get=\pgf at circ@temp}
+ \edef\pgf at temp{}
+ }
+ \ifx\pgf at circ@temp\pgf at temp
+ }
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Math routines
+
+\def\pgf at circ@stripdecimals#1.#2\pgf at nil{#1}
+
+%%% close: tex/pgfcircutils
+
+%%%%%%%%%%% Springe nach tex/pgfcircshapes
+%%% open: tex/pgfcircshapes.tex
+% Copyright 20072009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the files gpl3.0_license.txt and lppl13c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Other shapes
+
+%% Nothing
+
+\pgfdeclareshape{emptyshape}{
+ \savedanchor{\northeast}{%
+ \pgf at x=.5\wd\pgfnodeparttextbox%
+ \pgf at y=.5\ht\pgfnodeparttextbox%
+ }
+ \anchor{north}{\northeast\pgf at x=0cm\relax}
+ \anchor{east}{\northeast\pgf at y=0cm\relax}
+ \anchor{south}{\northeast\pgf at y=\pgf at y \pgf at x=0cm\relax}
+ \anchor{west}{\northeast\pgf at y=0cm\pgf at x=\pgf at x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf at x=\pgf at x}
+ \anchor{south east}{\northeast\pgf at y=\pgf at y}
+ \anchor{south west}{\northeast\pgf at y=\pgf at y\pgf at x=\pgf at x}
+ \anchor{text}{\pgfpoint{.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox.5\ht\pgfnodeparttextbox}}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+}
+
+%% Full terminal
+
+\pgfdeclareshape{circ}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgf at y=\ctikzvalof{nodes width}\pgf at circ@Rlen
+ \pgf at x=\pgf at y
+ }
+ \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+ \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{e}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{west}{ \northwest \pgf at y=0pt }
+ \anchor{w}{ \northwest \pgf at y=0pt }
+ \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{s}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{north}{ \northwest \pgf at x=0pt }
+ \anchor{n}{ \northwest \pgf at x=0pt }
+ \anchor{south west}{ \northwest \pgf at y=\pgf at y }
+ \anchor{north east}{ \northwest \pgf at x=\pgf at x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf at x=\pgf at x \pgf at y=\pgf at y }
+ \anchorborder{
+ \pgf at circ@res at left=\pgf at x
+ \pgf at circ@res at up=\pgf at y
+ \pgfpointborderellipse{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}
+ }{\pgfpoint{\ctikzvalof{nodes width}*\pgf at circ@Rlen}{\ctikzvalof{nodes width}*\pgf at circ@Rlen}}
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf at circ@Rlen}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfsetfillopacity{1.0}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ }
+}
+
+%% Empty terminal
+
+\pgfdeclareshape{ocirc}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgf at y=\ctikzvalof{nodes width}\pgf at circ@Rlen
+ \pgf at x=\pgf at y
+ }
+ \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+ \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{e}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{west}{ \northwest \pgf at y=0pt }
+ \anchor{w}{ \northwest \pgf at y=0pt }
+ \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{s}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{north}{ \northwest \pgf at x=0pt }
+ \anchor{n}{ \northwest \pgf at x=0pt }
+ \anchor{south west}{ \northwest \pgf at y=\pgf at y }
+ \anchor{north east}{ \northwest \pgf at x=\pgf at x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf at x=\pgf at x \pgf at y=\pgf at y }
+ \anchorborder{
+ \pgf at circ@res at left=\pgf at x
+ \pgf at circ@res at up=\pgf at y
+ \pgfpointborderellipse{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}
+ }{\pgfpoint{\ctikzvalof{nodes width}*\pgf at circ@Rlen}{\ctikzvalof{nodes width}*\pgf at circ@Rlen}}
+ }
+
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgfpathcircle{\pgfpointorigin}{\ctikzvalof{nodes width}*\pgf at circ@Rlen}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifx\tikz at fillcolor\pgfutil at empty
+ % set the default fill color to white
+ \pgfsetfillcolor{white}
+ % ...but override it if the class is defined!
+ % note that this element has no class, but will inherit it when used
+ % into another component
+ \pgf at circ@setifdefinedfill{draw, fill}{draw, fill}
+ \else
+ \pgfsetfillcolor{\tikz at fillcolor}
+ \fi
+ \pgfsetfillopacity{1.0}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+
+ }
+}
+
+%% Diamond terminal
+
+\pgfdeclareshape{diamondpole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf at y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf at circ@Rlen}
+ \pgf at x=\pgf at y
+ }
+ \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+ \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{e}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{west}{ \northwest \pgf at y=0pt }
+ \anchor{w}{ \northwest \pgf at y=0pt }
+ \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{s}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{north}{ \northwest \pgf at x=0pt }
+ \anchor{n}{ \northwest \pgf at x=0pt }
+ \anchor{south west}{ \northwest \pgf at y=\pgf at y }
+ \anchor{north east}{ \northwest \pgf at x=\pgf at x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf at x=\pgf at x \pgf at y=\pgf at y }
+ \anchorborder{
+ % \typeout{IN\space X:\the\pgf at x\space Y:\the\pgf at y}
+ \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf at x>0,1,1)}
+ \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf at y>0,1,1)}
+ \pgfmathsetlength{\pgf at xa}{abs(\pgf at x)}
+ \pgfmathsetlength{\pgf at ya}{abs(\pgf at y)}
+ \pgfextracty{\pgf at circ@res at up}{\northwest}
+ % \typeout{MID\space X:\the\pgf at xa\space Y:\the\pgf at ya\space L:\the\pgf at circ@res at up}
+ % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
+ \pgfpointintersectionoflines
+ {\pgfpointorigin}{\pgfqpoint{\pgf at xa}{\pgf at ya}}
+ {\pgfqpoint{0pt}{\pgf at circ@res at up}}{\pgfqpoint{\pgf at circ@res at up}{0pt}}
+ % \typeout{CROSS \space X:\the\pgf at x\space Y:\the\pgf at y}
+ \pgf at x=\@@switchx\pgf at x
+ \pgf at y=\@@switchy\pgf at y
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf at circ@res at temp}{\ctikzvalof{nodes width}*\pgf at circ@Rlen}
+ \pgftransformrotate{45}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgf at circ@res at temp}{\pgf at circ@res at temp}}
+ {\pgfpoint{\pgf at circ@res at temp}{\pgf at circ@res at temp}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfsetfillopacity{1.0}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%% Diamond terminal, unfilled
+
+\pgfdeclareshape{odiamondpole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf at y}{sqrt(2)*\ctikzvalof{nodes width}*\pgf at circ@Rlen}
+ \pgf at x=\pgf at y
+ }
+ \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+ \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{e}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{west}{ \northwest \pgf at y=0pt }
+ \anchor{w}{ \northwest \pgf at y=0pt }
+ \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{s}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{north}{ \northwest \pgf at x=0pt }
+ \anchor{n}{ \northwest \pgf at x=0pt }
+ \anchor{south west}{ \northwest \pgf at y=\pgf at y }
+ \anchor{north east}{ \northwest \pgf at x=\pgf at x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf at x=\pgf at x \pgf at y=\pgf at y }
+ \anchorborder{
+ % \typeout{IN\space X:\the\pgf at x\space Y:\the\pgf at y}
+ \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf at x>0,1,1)}
+ \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf at y>0,1,1)}
+ \pgfmathsetlength{\pgf at xa}{abs(\pgf at x)}
+ \pgfmathsetlength{\pgf at ya}{abs(\pgf at y)}
+ \pgfextracty{\pgf at circ@res at up}{\northwest}
+ % \typeout{MID\space X:\the\pgf at xa\space Y:\the\pgf at ya\space L:\the\pgf at circ@res at up}
+ % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
+ \pgfpointintersectionoflines
+ {\pgfpointorigin}{\pgfqpoint{\pgf at xa}{\pgf at ya}}
+ {\pgfqpoint{0pt}{\pgf at circ@res at up}}{\pgfqpoint{\pgf at circ@res at up}{0pt}}
+ % \typeout{CROSS \space X:\the\pgf at x\space Y:\the\pgf at y}
+ \pgf at x=\@@switchx\pgf at x
+ \pgf at y=\@@switchy\pgf at y
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf at circ@res at temp}{\ctikzvalof{nodes width}*\pgf at circ@Rlen}
+ \pgftransformrotate{45}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgf at circ@res at temp}{\pgf at circ@res at temp}}
+ {\pgfpoint{\pgf at circ@res at temp}{\pgf at circ@res at temp}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifx\tikz at fillcolor\pgfutil at empty
+ % set the default fill color to white
+ \pgfsetfillcolor{white}
+ % ...but override it if the class is defined!
+ % note that this element has no class, but will inherit it when used
+ % into another component
+ \pgf at circ@setifdefinedfill{draw, fill}{draw, fill}
+ \else
+ \pgfsetfillcolor{\tikz at fillcolor}
+ \fi
+ \pgfsetfillopacity{1.0}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%% square terminal, filled
+
+\pgfdeclareshape{squarepole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf at y}{\ctikzvalof{nodes width}*\pgf at circ@Rlen}
+ \pgf at x=\pgf at y
+ }
+ \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+ \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{e}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{west}{ \northwest \pgf at y=0pt }
+ \anchor{w}{ \northwest \pgf at y=0pt }
+ \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{s}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{north}{ \northwest \pgf at x=0pt }
+ \anchor{n}{ \northwest \pgf at x=0pt }
+ \anchor{south west}{ \northwest \pgf at y=\pgf at y }
+ \anchor{north east}{ \northwest \pgf at x=\pgf at x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf at x=\pgf at x \pgf at y=\pgf at y }
+ \anchorborder{
+ \pgf at xa=\pgf at x
+ \pgf at ya=\pgf at y
+ \pgfextracty{\pgf at circ@res at up}{\northwest}
+ \pgfpointborderrectangle
+ {\pgfqpoint{\pgf at xa}{\pgf at ya}}
+ {\pgfqpoint{\pgf at circ@res at up}{\pgfqpoint{\pgf at circ@res at up}}}
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf at circ@res at temp}{\ctikzvalof{nodes width}*\pgf at circ@Rlen}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgf at circ@res at temp}{\pgf at circ@res at temp}}
+ {\pgfpoint{\pgf at circ@res at temp}{\pgf at circ@res at temp}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfsetfillopacity{1.0}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+%% square terminal, unfilled
+
+\pgfdeclareshape{osquarepole}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf at y}{\ctikzvalof{nodes width}*\pgf at circ@Rlen}
+ \pgf at x=\pgf at y
+ }
+ \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+ \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{e}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{west}{ \northwest \pgf at y=0pt }
+ \anchor{w}{ \northwest \pgf at y=0pt }
+ \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{s}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{north}{ \northwest \pgf at x=0pt }
+ \anchor{n}{ \northwest \pgf at x=0pt }
+ \anchor{south west}{ \northwest \pgf at y=\pgf at y }
+ \anchor{north east}{ \northwest \pgf at x=\pgf at x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf at x=\pgf at x \pgf at y=\pgf at y }
+ \anchorborder{
+ \pgf at xa=\pgf at x
+ \pgf at ya=\pgf at y
+ \pgfextracty{\pgf at circ@res at up}{\northwest}
+ \pgfpointborderrectangle
+ {\pgfqpoint{\pgf at xa}{\pgf at ya}}
+ {\pgfqpoint{\pgf at circ@res at up}{\pgfqpoint{\pgf at circ@res at up}}}
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfmathsetlength{\pgf at circ@res at temp}{\ctikzvalof{nodes width}*\pgf at circ@Rlen}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgf at circ@res at temp}{\pgf at circ@res at temp}}
+ {\pgfpoint{\pgf at circ@res at temp}{\pgf at circ@res at temp}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifx\tikz at fillcolor\pgfutil at empty
+ % set the default fill color to white
+ \pgfsetfillcolor{white}
+ % ...but override it if the class is defined!
+ % note that this element has no class, but will inherit it when used
+ % into another component
+ \pgf at circ@setifdefinedfill{draw, fill}{draw, fill}
+ \else
+ \pgfsetfillcolor{\tikz at fillcolor}
+ \fi
+ \pgfsetfillopacity{1.0}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+% BNC connector
+
+\pgfdeclareshape{bnc}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ % BNC size is 2.5 times the size of the internal "ocirc"
+ \savedanchor\northwest{%
+ \pgf at y=\ctikzvalof{nodes width}\pgf at circ@Rlen
+ \pgf at y=2.5\pgf at y
+ \pgf at x=\pgf at y
+ }
+ % center is on the opening
+ \anchor{center}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{zero}{ \pgfpointorigin }
+ \anchor{hot}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{shield}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ % geoanchors
+ \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{right}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{west}{ \northwest \pgf at y=0pt }
+ \anchor{left}{ \northwest \pgf at y=0pt }
+ \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{north}{ \northwest \pgf at x=0pt }
+ \anchor{south west}{ \northwest \pgf at y=\pgf at y }
+ \anchor{north east}{ \northwest \pgf at x=\pgf at x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf at x=\pgf at x \pgf at y=\pgf at y }
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf at circ@res at up}{\northwest}
+ \pgfpoint{.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+ }
+ }
+ \anchorborder{
+ \pgf at circ@res at left=\pgf at x
+ \pgf at circ@res at up=\pgf at y
+ \pgfpointborderellipse{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}
+ }{\pgfpoint{2.5*\ctikzvalof{nodes width}*\pgf at circ@Rlen}{2.5*\ctikzvalof{nodes width}*\pgf at circ@Rlen}}
+ }
+ \behindforegroundpath{
+ \pgfextracty{\pgf at circ@res at other}{\northwest}
+ \pgf at circ@res at step=\ctikzvalof{nodes width}\pgf at circ@Rlen
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf at circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgfsetcolor{\ctikzvalof{color}}
+ % external circle
+ \pgfscope
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf at circ@res at other}{2\pgf at circ@res at other}}
+ {\pgfpoint{2\pgf at circ@res at other}{2\pgf at circ@res at other}}
+ % next the opening to the right
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at step}}
+ {\pgfpoint{2\pgf at circ@res at other}{\pgf at circ@res at step}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathcircle{\pgfpointorigin}{\pgf at circ@res at other}
+ \pgfusepath{draw}
+ \endpgfscope
+ % internal circle
+ \pgfpathcircle{\pgfpointorigin}{\pgf at circ@res at step}
+ \pgf at circ@draworfill
+ % and the contact line to the right
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+%% Fill for correct rectangular joins
+
+\pgfdeclareshape{rectjoinfill}{
+ \savedanchor{\northeast}{%
+ \pgf at x=.5\pgflinewidth%
+ \pgf at y=.5\pgflinewidth%
+ }
+ \anchor{north}{\northeast\pgf at x=0cm\relax}
+ \anchor{east}{\northeast\pgf at y=0cm\relax}
+ \anchor{south}{\northeast\pgf at y=\pgf at y \pgf at x=0cm\relax}
+ \anchor{west}{\northeast\pgf at y=0cm\pgf at x=\pgf at x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf at x=\pgf at x}
+ \anchor{south east}{\northeast\pgf at y=\pgf at y}
+ \anchor{south west}{\northeast\pgf at y=\pgf at y\pgf at x=\pgf at x}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchorborder{
+ \pgf at circ@res at left=\pgf at x
+ \pgf at circ@res at up=\pgf at y
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgfpathrectanglecorners
+ {\pgfpoint{0}{.5\pgflinewidth}}
+ {\pgfpoint{0}{.5\pgflinewidth}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ }
+}
+
+%% transistor arrow
+
+\def\pgf at circ@find at linescale{
+ % find the scale inverse of the scale factor: line width do not scale
+ % with scale=..., transform shape so we have to counteract it.
+ \iftikz at fullytransformed % this is true if `transform shape` is active
+ % from @Circumscribe https://tex.stackexchange.com/a/474035/38080
+ % Note that this trick is not working inside a `spy` environment...
+ \pgfgettransformentries{\scaleA}{\scaleB}{\scaleC}{\scaleD}{\whatevs}{\whatevs}%
+ \pgfmathsetmacro{\@@factor}{1.0/sqrt(abs(\scaleA*\scaleD\scaleB*\scaleC))}%
+ \else
+ \pgfmathsetmacro{\@@factor}{1.0}
+ \fi
+}
+
+\pgfdeclareshape{trarrow}{%
+ % this arrow is only filled but grows with the linewidth, more or less
+ % like currarrow do
+ \savedanchor{\northeast}{%
+ \pgf at circ@res at step = \pgf at circ@Rlen
+ \pgf at circ@find at linescale
+ \divide \pgf at circ@res at step by \ctikzvalof{current arrow scale}
+ \pgfpoint{0.7*\pgf at circ@res at step +0.5*\@@factor*\pgflinewidth}
+ {0.8*\pgf at circ@res at step+0.7593*\@@factor*\pgflinewidth}
+ }
+ % The arrow size should be more or less the same of a currarrow, which is
+ % both filled and stroke, for backward output compatibility (more or less)
+ %
+ % angle \beta W is \pgf at circ@Rlen/\ctikzvalof{current arrow scale}
+ % \__ currarrow as the tip at (W,0)
+ %   and the upper tail at (0.7*W, 0.8*W)
+ %  \__ it then "overshoot" do to the linew width L
+ %  \__ xangle \alpha
+ % 0>
+ %
+ % \beta = atan(0.7/0.8) \alpha=atan(0.8/1.7)
+ % tip overshoot is (L/2)/sin(\alpha) = 1.743*L only in x direction
+ % tail overshoot is (L/2) in x, and (L/2)/sin(\beta) = 0.7539*L in y
+ %
+ \savedanchor{\northwest}{%
+ \pgf at circ@res at step = \pgf at circ@Rlen
+ \divide \pgf at circ@res at step by \ctikzvalof{current arrow scale}
+ \pgf at circ@find at linescale
+ \pgfpoint{0.7*\pgf at circ@res at step 0.5*\@@factor*\pgflinewidth}
+ {0.8*\pgf at circ@res at step+0.7593*\@@factor*\pgflinewidth}
+ }
+ \savedanchor{\tip}{%
+ \pgf at circ@res at step = \pgf at circ@Rlen
+ \divide \pgf at circ@res at step by \ctikzvalof{current arrow scale}
+ \pgf at circ@find at linescale
+ \pgfpoint{\pgf at circ@res at step + 1.743*\@@factor*\pgflinewidth}{0pt}
+ }
+ \anchor{north}{\northeast\pgf at x=0cm\relax}
+ \anchor{east}{\northeast\pgf at y=0cm\relax}
+ \anchor{south}{\northeast\pgf at y=\pgf at y \pgf at x=0cm\relax}
+ \anchor{west}{\northeast\pgf at y=0cm\pgf at x=\pgf at x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf at x=\pgf at x}
+ \anchor{south east}{\northeast\pgf at y=\pgf at y}
+ \anchor{south west}{\northeast\pgf at y=\pgf at y\pgf at x=\pgf at x}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{tip}{
+ \tip
+ }
+ \anchor{btip}{% this anchor is behind the tip of half a linewidth
+ \tip
+ \pgf at circ@find at linescale
+ \pgf at circ@res at temp=\@@factor\pgflinewidth
+ \advance\pgf at x by .5\pgf at circ@res at temp
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \northwest
+ \pgf at circ@res at up=\pgf at y
+ \pgf at circ@res at left=\pgf at x
+ \tip
+ \pgf at circ@res at step = \pgf at x
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{1\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathclose
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{fill} % just fill
+ \endpgfscope
+ }
+}
+
+%% Current arrow
+
+\pgfdeclareshape{currarrow}{
+ \savedanchor{\northeast}{%
+ \pgf at circ@res at step = \pgf at circ@Rlen
+ \divide \pgf at circ@res at step by \ctikzvalof{current arrow scale}
+ \pgf at x=.5\pgf at circ@res at step
+ \pgf at y=\pgf at x%
+ }
+ \anchor{north}{\northeast\pgf at x=0cm\relax}
+ \anchor{east}{\northeast\pgf at y=0cm\relax}
+ \anchor{south}{\northeast\pgf at y=\pgf at y \pgf at x=0cm\relax}
+ \anchor{west}{\northeast\pgf at y=0cm\pgf at x=\pgf at x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf at x=\pgf at x}
+ \anchor{south east}{\northeast\pgf at y=\pgf at y}
+ \anchor{south west}{\northeast\pgf at y=\pgf at y\pgf at x=\pgf at x}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{tip}{
+ \pgfpointorigin
+ \pgf at circ@res at step = \pgf at circ@Rlen
+ \divide \pgf at circ@res at step by \ctikzvalof{current arrow scale}
+ \pgf at x =\pgf at circ@res at step
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgf at circ@res at step = \pgf at circ@Rlen
+ \divide \pgf at circ@res at step by \ctikzvalof{current arrow scale}
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at step}{.8\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{1\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at step}{.8\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at step}{0pt}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{draw,fill}
+
+ \endpgfscope
+ }
+}
+
+%% Flow arrow
+
+\pgfdeclareshape{flowarrow}{
+ \savedanchor{\northeast}{%
+ \pgf at circ@res at step = \pgf at circ@Rlen
+ \divide \pgf at circ@res at step by \ctikzvalof{current arrow scale}
+ \pgf at y=.5\pgf at circ@res at step
+ \pgf at circ@res at step = \pgf at circ@Rlen
+ \divide \pgf at circ@res at step by 4
+ \pgf at x=\pgf at circ@res at step%
+ }
+ \anchor{north}{\northeast\pgf at x=0cm\relax}
+ \anchor{east}{\northeast\pgf at y=0cm\relax}
+ \anchor{south}{\northeast\pgf at y=\pgf at y \pgf at x=0cm\relax}
+ \anchor{west}{\northeast\pgf at y=0cm\pgf at x=\pgf at x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf at x=\pgf at x}
+ \anchor{south east}{\northeast\pgf at y=\pgf at y}
+ \anchor{south west}{\northeast\pgf at y=\pgf at y\pgf at x=\pgf at x}
+ \anchor{text}{% text centered above
+ \pgfpointorigin
+ \pgfpoint{.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox}
+ }
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{tip}{
+ \pgfpointorigin
+ \pgf at circ@res at step = \pgf at circ@Rlen
+ \divide \pgf at circ@res at step by \ctikzvalof{current arrow scale}
+ \pgf at x =\pgf at circ@res at step
+ }
+ \behindforegroundpath{
+ \pgfscope
+ \pgf at circ@res at step = \pgf at circ@Rlen
+ \divide \pgf at circ@res at step by 4
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{draw}
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfnode{currarrow}{tip}{}{}{\pgfusepath{fill}}
+ \endpgfscope
+ }
+}
+
+%% Input arrow
+
+\pgfdeclareshape{inputarrow}{
+ \savedanchor{\northeast}{% this is really not northeast, really northwest
+ \pgf at circ@res at step = \pgf at circ@Rlen
+ \divide \pgf at circ@res at step by \ctikzvalof{current arrow scale}
+ \pgf at y=.5\pgf at circ@res at step
+ \pgf at x=1.7\pgf at circ@res at step
+ }
+ \anchor{north}{\northeast\pgf at x=0cm\relax}
+ \anchor{east}{\northeast\pgf at y=0cm\relax\pgf at x=0cm\relax}
+ \anchor{south}{\northeast\pgf at y=\pgf at y \pgf at x=0cm\relax}
+ \anchor{west}{\northeast\pgf at y=0cm\pgf at x=\pgf at x}
+ \anchor{north east}{\northeast\pgf at x=0cm\relax}
+ \anchor{north west}{\northeast\pgf at x=\pgf at x}
+ \anchor{south east}{\northeast\pgf at y=\pgf at y\pgf at x=0cm\relax}
+ \anchor{south west}{\northeast\pgf at y=\pgf at y\pgf at x=\pgf at x}
+ \savedanchor{\tip}{
+ \pgfpointorigin
+ }
+ \anchor{center}{
+ \tip
+ }
+ \anchor{tip}{
+ \tip
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf at circ@res at step = \pgf at circ@Rlen
+ \divide \pgf at circ@res at step by 16
+
+ \pgfpathmoveto{\pgfpoint{1.7\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{1.7\pgf at circ@res at step}{.8\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfpathlineto{\pgfpoint{1.7\pgf at circ@res at step}{.8\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{1.7\pgf at circ@res at step}{0pt}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfusepath{fill}
+
+ \endpgfscope
+ }
+}
+
+
+%% box
+
+\pgfdeclareshape{box}{
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+
+ \pgfscope
+ \pgf at circ@res at step = \ctikzvalof{bipoles/twoport/width}\pgf at circ@Rlen
+ \pgf at circ@res at step = 0.5\pgf at circ@res at step
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at step}}{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at step}}
+ \pgf at circ@draworfill
+ \endpgfscope
+ }
+}
+
+%% box scaled with blocks
+
+\pgfdeclareshape{blockbox}{
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{blocks/scale}\pgf at circ@Rlen}}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \behindforegroundpath{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{blocks/scale}\pgf at circ@Rlen}
+ \pgfscope
+ \pgf at circ@res at step = \ctikzvalof{bipoles/twoport/width}\pgf at circ@scaled at Rlen
+ \pgf at circ@res at step = 0.5\pgf at circ@res at step
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at step}}{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at step}}
+ \pgf at circ@draworfill
+ \endpgfscope
+ }
+}
+
+% full nodes for wire crossing
+
+\pgfdeclareshape{jump crossing}
+{
+ \savedanchor\northwest{%
+ \pgf at y=\ctikzvalof{bipoles/crossing/size}\pgf at circ@Rlen
+ \pgf at y=.5\pgf at y
+ \pgf at x=\pgf at y
+ }
+ \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+ \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{e}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{west}{ \northwest \pgf at y=0pt }
+ \anchor{w}{ \northwest \pgf at y=0pt }
+ \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{s}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{north}{ \northwest \pgf at x=0pt }
+ \anchor{n}{ \northwest \pgf at x=0pt }
+ \anchor{south west}{ \northwest \pgf at y=\pgf at y }
+ \anchor{north east}{ \northwest \pgf at x=\pgf at x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf at x=\pgf at x \pgf at y=\pgf at y }
+ \behindbackgroundpath{
+ \northwest
+ \pgf at circ@res at up = \pgf at y
+ \pgf at circ@res at down = \pgf at y
+ \pgf at circ@res at right = \pgf at x
+ \pgf at circ@res at left = \pgf at x
+ % horizontal jumper
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at left}{0pt}}
+ \pgfpatharc{0}{180}{0.4*\pgf at circ@res at left}
+ \pgfsetbeveljoin
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+ % vertical, broken path
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.5\pgf at circ@res at up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.3\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+
+ }
+}
+\pgfdeclareshape{plain crossing}
+{
+ \savedanchor\northwest{%
+ \pgf at y=\ctikzvalof{bipoles/crossing/size}\pgf at circ@Rlen
+ \pgf at y=.5\pgf at y
+ \pgf at x=\pgf at y
+ }
+ \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+ \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{e}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{west}{ \northwest \pgf at y=0pt }
+ \anchor{w}{ \northwest \pgf at y=0pt }
+ \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{s}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{north}{ \northwest \pgf at x=0pt }
+ \anchor{n}{ \northwest \pgf at x=0pt }
+ \anchor{south west}{ \northwest \pgf at y=\pgf at y }
+ \anchor{north east}{ \northwest \pgf at x=\pgf at x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf at x=\pgf at x \pgf at y=\pgf at y }
+ \behindbackgroundpath{
+ \northwest
+ \pgf at circ@res at up = \pgf at y
+ \pgf at circ@res at down = \pgf at y
+ \pgf at circ@res at right = \pgf at x
+ \pgf at circ@res at left = \pgf at x
+ % horizontal jumper
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+ % vertical, broken path
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.1\pgf at circ@res at up}}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.1\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+
+ }
+}
+
+%%% close: tex/pgfcircshapes
+%%%%%%%%%%% Springe nach tex/pgfcircmonopoles
+%%% open: tex/pgfcircmonopoles.tex
+% Copyright 20072009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the files gpl3.0_license.txt and lppl13c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Monopoles
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%
+%% Grounds
+%%%%%%%%%%%%%
+
+
+%% Ground symbol
+% #1 > name
+% #2 > width
+% #3 > depth
+% #4 > code
+\long\def\pgf at circ@declareground#1#2#3#4{
+ \pgfdeclareshape{#1}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{grounds}} % class of these components
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \savedanchor{\southeast}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at x=\ctikzvalof{monopoles/ground/width}\pgf at circ@scaled at Rlen
+ \pgf at x=#2\pgf at x
+ \pgf at y=\ctikzvalof{monopoles/ground/width}\pgf at circ@scaled at Rlen
+ \pgf at y=#3\pgf at y
+ }
+ \anchor{north}{\pgfpointorigin}
+ \anchor{north east}{\southeast\pgf at y=0pt\relax}
+ \anchor{east}{\southeast\pgf at y=.5\pgf at y}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf at x=0pt\relax}
+ \anchor{south west}{\southeast\pgf at x=\pgf at x}
+ \anchor{west}{\southeast\pgf at y=.5\pgf at y\pgf at x=\pgf at x}
+ \anchor{north west}{\southeast\pgf at y=0pt\pgf at x=\pgf at x}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ \anchor{center}{\pgfpointorigin}
+ \behindforegroundpath{
+ \pgf at circ@scaled at Rlen=\scaledRlen
+ \pgf at circ@res at step=\ctikzvalof{monopoles/ground/width}\pgf at circ@scaled at Rlen
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ #4
+ \endpgfscope
+ }
+ }
+}
+
+
+\pgf at circ@declareground{ground}{0.6}{1.6}{
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{1.2\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \pgf at circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at step}{1.2\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{1.2\pgf at circ@res at step}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at step}{1.4\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at step}{1.4\pgf at circ@res at step}}
+ \pgfpathmoveto{\pgfpoint{.25\pgf at circ@res at step}{1.6\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at step}{1.6\pgf at circ@res at step}}
+ \pgfusepath{draw}
+}
+
+\pgf at circ@declareground{tlground}{0.6}{0.4}{
+ \pgf at circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at step}{0.2\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at step}{0.2\pgf at circ@res at step}}
+ \pgfpathmoveto{\pgfpoint{.25\pgf at circ@res at step}{0.4\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at step}{0.4\pgf at circ@res at step}}
+ \pgfusepath{draw}
+}
+
+
+\pgf at circ@declareground{rground}{0.6}{1}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf at circ@setlinewidth{monopoles/rground}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at step}{\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{\pgf at circ@res at step}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+\pgf at circ@declareground{tground}{0.6}{0}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf at circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{0pt}}
+ \pgfusepath{draw}
+}
+
+\pgf at circ@declareground{sground}{0.6}{1.8}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at step}{\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0}{1.8\pgf at circ@res at step}}
+ \pgfpathclose
+ \pgf at circ@draworfill
+}
+
+% noiseless ground
+\pgf at circ@declareground{nground}{0.9}{1.6}{
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{1.2\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \pgf at circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at step}{1.2\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{1.2\pgf at circ@res at step}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at step}{1.4\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at step}{1.4\pgf at circ@res at step}}
+ \pgfpathmoveto{\pgfpoint{.25\pgf at circ@res at step}{1.6\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at step}{1.6\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.9\pgf at circ@res at step}{1.6\pgf at circ@res at step}}
+ \pgfpatharc{0}{180}{0.9\pgf at circ@res at step}
+ \pgfusepath{draw}
+}
+
+% protective ground
+\pgf at circ@declareground{pground}{0.9}{1.8}{
+ \pgf at circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0pt}{0.9\pgf at circ@res at step}}{0.9\pgf at circ@res at step}
+ \pgf at circ@draworfill
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{1\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \pgf at circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at step}{1\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{1\pgf at circ@res at step}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at step}{1.2\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at step}{1.2\pgf at circ@res at step}}
+ \pgfpathmoveto{\pgfpoint{.25\pgf at circ@res at step}{1.4\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at step}{1.4\pgf at circ@res at step}}
+ \pgfusepath{draw}
+}
+
+% chassis ground
+\pgf at circ@declareground{cground}{1}{2}{
+ \pgfsetlinewidth{\ctikzvalof{monopoles/ground/connectionthickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \pgf at circ@setlinewidth{monopoles/ground}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{1.00\pgf at circ@res at step}{2.10\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0.75\pgf at circ@res at step}{1.50\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{ 0.75\pgf at circ@res at step}{1.50\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{ 0.50\pgf at circ@res at step}{2.10\pgf at circ@res at step}}
+ \pgfpathmoveto{\pgfpoint{ 0.00\pgf at circ@res at step}{1.50\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0.25\pgf at circ@res at step}{2.10\pgf at circ@res at step}}
+ \pgfusepath{draw}
+}
+
+% Contributed by @fotesan https://github.com/fotesan
+% european ground
+\pgf at circ@declareground{eground}{1.1}{1.7}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf at circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{1\pgf at circ@res at step}{\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{1\pgf at circ@res at step}{\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{1.1\pgf at circ@res at step}{1.7\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at step}{1\pgf at circ@res at step}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at step}{1.7\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.1\pgf at circ@res at step}{1\pgf at circ@res at step}}
+ \pgfpathmoveto{\pgfpoint{.1\pgf at circ@res at step}{1.7\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at step}{1\pgf at circ@res at step}}
+ \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at step}{1.7\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.9\pgf at circ@res at step}{1\pgf at circ@res at step}}
+ \pgfusepath{draw}
+}
+
+\pgf at circ@declareground{eground2}{1.1}{1.7}{
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf at circ@setlinewidth{monopoles/tground}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{1\pgf at circ@res at step}{\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{1\pgf at circ@res at step}{\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{1.1\pgf at circ@res at step}{1.7\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at step}{1\pgf at circ@res at step}}
+ \pgfpathmoveto{\pgfpoint{.45\pgf at circ@res at step}{1.7\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at step}{1\pgf at circ@res at step}}
+ \pgfpathmoveto{\pgfpoint{.2\pgf at circ@res at step}{1.7\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{.9\pgf at circ@res at step}{1\pgf at circ@res at step}}
+ \pgfusepath{draw}
+}
+
+%%%%%%%%%%%%%%%%%%
+%% Power supplies
+%%%%%%%%%%%%%%%%%%
+
+% Vcc
+\pgfdeclareshape{vcc}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
+ \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
+ \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd\tmpb*\tmpc))}% abs should not be needed
+ \pgfmathsetlength{\pgf at x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf at circ@Rlen}%
+ }
+ \savedanchor{\northeast}{%
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@scaled at Rlen
+ \pgf at x=.5\pgf at circ@res at step
+ \pgf at y=3\pgf at x%
+ }
+ \anchor{north}{\northeast\pgf at x=0cm\relax}
+ \anchor{east}{\northeast\pgf at y=0.5\pgf at y\relax}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{west}{\northeast\pgf at y=0.5\pgf at y\pgf at x=\pgf at x}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf at x=\pgf at x}
+ \anchor{south east}{\northeast\pgf at y=0pt\relax}
+ \anchor{south west}{\northeast\pgf at y=0pt\pgf at x=\pgf at x}
+ \anchor{center}{\pgfpointorigin}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ \anchor{text}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@scaled at Rlen
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf at circ@res at step+2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf at circ@res at step+2\ht\pgfnodeparttextbox}}
+ \pgf at x=0pt
+ \pgf at y=2\pgf at circ@res at step
+ \advance \pgf at y by 0.5\ht\pgfnodeparttextbox
+ \pgf at x=.5\wd\pgfnodeparttextbox
+ }
+ \behindforegroundpath{
+ \pgf at circ@scaled at Rlen=\scaledRlen
+ \pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@scaled at Rlen
+ \pgfscope
+ \edef\pgf at circ@temp{\ctikzvalof{monopoles/vcc/arrow}}\edef\pgf at temp{legacy}
+ \ifx\pgf at temp\pgf at circ@temp
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{.8\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0}{1.5\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{.8\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \else
+ \pgfsetarrowsend{\pgf at circ@temp}
+ \fi
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+% Vee
+\pgfdeclareshape{vee}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{power supplies}} % class of these components
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \saveddimen{\scaledwidth}{% thanks to @Schrödinger's cat on https://tex.stackexchange.com/a/506249/38080
+ \pgfgettransformentries{\tmpa}{\tmpb}{\tmpc}{\tmpd}{\tmp}{\tmp}%
+ \pgfmathsetmacro{\gscale}{sqrt(abs(\tmpa*\tmpd\tmpb*\tmpc))}% abs should not be needed
+ \pgfmathsetlength{\pgf at x}{(\ctikzvalof{\ctikzclass/scale}*\gscale*\ctikzvalof{monopoles/vcc/width})*\pgf at circ@Rlen}%
+ }
+ \savedanchor{\northeast}{%
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@scaled at Rlen
+ \pgf at x=.5\pgf at circ@res at step
+ \pgf at y=3\pgf at x%
+ }
+ \anchor{south}{\northeast\pgf at x=0cm\relax}
+ \anchor{east}{\northeast\pgf at y=0.5\pgf at y\relax}
+ \anchor{north}{\pgfpointorigin}
+ \anchor{west}{\northeast\pgf at y=0.5\pgf at y\pgf at x=\pgf at x}
+ \anchor{south east}{\northeast}
+ \anchor{south west}{\northeast\pgf at x=\pgf at x}
+ \anchor{north east}{\northeast\pgf at y=0pt\relax}
+ \anchor{north west}{\northeast\pgf at y=0pt\pgf at x=\pgf at x}
+ \anchor{center}{\pgfpointorigin}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ \anchor{text}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@scaled at Rlen
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf at circ@res at step2\ht\pgfnodeparttextbox}}
+ \pgfpathmoveto{\pgfpoint{.5\wd\pgfnodeparttextbox}{2\pgf at circ@res at step2\ht\pgfnodeparttextbox}}
+ \pgf at x=0pt
+ \pgf at y=2\pgf at circ@res at step
+ \advance \pgf at y by 1.5\ht\pgfnodeparttextbox
+ \pgf at x=.5\wd\pgfnodeparttextbox
+ }
+
+ \behindforegroundpath{
+ \pgf at circ@scaled at Rlen=\scaledRlen
+ \pgf at circ@res at step=\ctikzvalof{monopoles/vcc/width}\pgf at circ@scaled at Rlen
+ \pgfscope
+ \edef\pgf at circ@temp{\ctikzvalof{monopoles/vee/arrow}}\edef\pgf at temp{legacy}
+ \ifx\pgf at temp\pgf at circ@temp
+
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{.8\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0}{1.5\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{.8\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \else
+ \pgfsetarrowsend{\pgf at circ@temp}
+ \fi
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{1.5\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+%%%%%%%%%%%%%%%%
+%% RF elements
+%%%%%%%%%%%%%%%%
+
+% Legacy tlinestub
+% Contributed by Leonardo Azzinnari
+\pgfdeclareshape{tlinestub}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \savedanchor{\northeast}{%
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step = \ctikzvalof{bipoles/tline/width} \pgf at circ@scaled at Rlen
+ \pgf at x=1.2\pgf at circ@res at step
+ \pgf at circ@res at step = \ctikzvalof{bipoles/tline/width} \pgf at circ@scaled at Rlen
+ \pgf at y=.2\pgf at circ@res at step%
+ }
+ % the center is on the left side of the shape for facility of usage
+ \anchor{north}{\northeast\pgf at x=0.5\pgf at x\relax}
+ \anchor{east}{\northeast\pgf at y=0cm\relax}
+ \anchor{south}{\northeast\pgf at y=\pgf at y \pgf at x=0.5\pgf at x\relax}
+ \anchor{west}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf at x=0cm\relax}
+ \anchor{south east}{\northeast\pgf at y=\pgf at y}
+ \anchor{south west}{\northeast\pgf at x=0cm\pgf at y=\pgf at y}
+ \anchor{center}{\pgfpointorigin}
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+
+ \pgf at circ@scaled at Rlen=\scaledRlen
+ \pgf at circ@res at step=\ctikzvalof{bipoles/tline/width} \pgf at circ@scaled at Rlen
+ \pgf at circ@res at step=0.6\pgf at circ@scaled at Rlen
+
+ \pgfscope\begin{pgftransparencygroup}
+ \pgfpathellipse{\pgfpoint{0.5\pgf at circ@res at step}{0\pgf at circ@res at step}}{\pgfpoint{0.125\pgf at circ@res at step}{0\pgf at circ@res at step}}{\pgfpoint{0\pgf at circ@res at step}{0.25\pgf at circ@res at step}}
+ \pgf at circ@maybefill
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0.25\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{1.5\pgf at circ@res at step}{0.25\pgf at circ@res at step}}
+ \pgfpatharc{90}{90}{0.125\pgf at circ@res at step and 0.25\pgf at circ@res at step}
+ \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{0.25\pgf at circ@res at step}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf at circ@draworfill
+ \pgfpathellipse{\pgfpoint{0.5\pgf at circ@res at step}{0\pgf at circ@res at step}}{\pgfpoint{0.125\pgf at circ@res at step}{0\pgf at circ@res at step}}{\pgfpoint{0\pgf at circ@res at step}{0.25\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \end{pgftransparencygroup} \endpgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{0pt}}
+ \pgfusepath{draw}
+ }
+}
+
+%% New antennas without tails
+
+% main body of antennas
+\def\pgf at circ@antennabody{%
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf at circ@scaled at Rlen=\scaledRlen
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf at circ@res at step=\ctikzvalof{monopoles/bareantenna/width}\pgf at circ@scaled at Rlen
+ \pgfscope
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{2\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{2\pgf at circ@res at step}}
+ \pgfsetbeveljoin
+ \pgfpathclose
+ \pgf at circ@draworfill
+ \endpgfscope
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{2\pgf at circ@res at step}}
+ \pgfusepath{draw}
+}
+
+% Waves for the antennas.
+\def\pgf at circ@antennawaves{%
+ \pgfscope
+ % define a triangle for clipping the waves
+ \pgfpathmoveto{\pgfpoint{0pt}{\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{4.2\pgf at circ@res at step}{3\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{4.2\pgf at circ@res at step}{1\pgf at circ@res at step}}
+ \pgfpathclose
+ \pgfusepath{clip}
+ % ...and build the waves as clipped circles
+ \pgf at circ@count at a=8\pgf at circ@res at other=0.5\pgf at circ@res at step
+ \pgfmathloop%
+ \ifnum\pgf at circ@count at a>2
+ \pgfpathcircle{\pgfpoint{0pt}{\pgf at circ@res at step}}{\the\pgf at circ@count at a*\pgf at circ@res at other}
+ \advance\pgf at circ@count at a1\relax%
+ \repeatpgfmathloop
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% additional shape with the waves
+\pgfdeclareshape{waves}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step=\ctikzvalof{monopoles/waves/width}\pgf at circ@scaled at Rlen
+ \pgf at x=\pgf at circ@res at step
+ \pgf at y=\pgf at circ@res at step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf at y=\dimexpr\pgf at y+.5\dp\pgfnodeparttextbox.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{top}{\northeast\pgf at x=0pt}
+ \anchor{right}{\northeast\pgf at y=0pt}
+ \anchor{left}{\northeast\pgf at x=\pgf at x\pgf at y=0pt}
+ \anchor{bottom}{\northeast\pgf at y=\pgf at y\pgf at x=0pt}
+ \anchor{north}{\northeast\pgf at x=0pt}
+ \anchor{north east}{\northeast}
+ \anchor{east}{\northeast\pgf at y=0pt}
+ \anchor{south east}{\northeast\pgf at y=\pgf at y}
+ \anchor{south}{\northeast\pgf at y=\pgf at y\pgf at x=0pt}
+ \anchor{south west}{\northeast\pgf at y=\pgf at y\pgf at x=\pgf at x}
+ \anchor{west}{\northeast\pgf at x=\pgf at x\pgf at y=0pt}
+ \anchor{north west}{\northeast\pgf at x=\pgf at x}
+ \behindforegroundpath{
+ \pgf at circ@scaled at Rlen=\scaledRlen
+ \pgf at circ@res at step=\ctikzvalof{monopoles/waves/width}\pgf at circ@scaled at Rlen
+ \pgf at circ@res at step=0.5\pgf at circ@res at step
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfscope
+ % define a triangle for clipping the waves
+ \pgfpathmoveto{\pgfpoint{2\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{2.1\pgf at circ@res at step}{2\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{2.1\pgf at circ@res at step}{2\pgf at circ@res at step}}
+ \pgfpathclose
+ \pgfusepath{clip}
+ % ...and build the waves as clipped circles
+ \c at pgf@counta=8\pgf at circ@res at other=0.5\pgf at circ@res at step
+ \pgfmathloop%
+ \ifnum\c at pgf@counta>1
+ \pgfpathcircle{\pgfpoint{2\pgf at circ@res at step}{0pt}}{\the\c at pgf@counta*\pgf at circ@res at other}
+ \advance\c at pgf@counta1\relax%
+ \repeatpgfmathloop
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+% the three types of antennas: simple, TX, RX. Notice that you can flip them...
+
+\pgfdeclareshape{bareantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step=\ctikzvalof{monopoles/bareantenna/width}\pgf at circ@scaled at Rlen
+ \pgf at x=\pgf at circ@res at step
+ \pgf at y=2\pgf at circ@res at step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf at x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf at x
+ \pgf at y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf at y
+ \pgf at y=\dimexpr\pgf at y+.5\dp\pgfnodeparttextbox.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{top}{\northeast\pgf at x=0pt}
+ \anchor{right}{\northeast\pgf at y=0.5\pgf at y}
+ \anchor{left}{\northeast\pgf at x=\pgf at x\pgf at y=0.5\pgf at y}
+ \anchor{bottom}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf at x=0pt}
+ \anchor{east}{\northeast\pgf at y=0.5\pgf at y}
+ \anchor{west}{\northeast\pgf at x=\pgf at x\pgf at y=0.5\pgf at y}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf at x=\pgf at x}
+ \anchor{south east}{\northeast\pgf at y=0pt\relax}
+ \anchor{south west}{\northeast\pgf at y=0pt\pgf at x=\pgf at x}
+ \behindforegroundpath{
+ \pgf at circ@antennabody
+ }
+}
+
+\pgfdeclareshape{bareTXantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step=\ctikzvalof{monopoles/bareantenna/width}\pgf at circ@scaled at Rlen
+ \pgf at x=\pgf at circ@res at step
+ \pgf at y=2\pgf at circ@res at step
+ }
+ \savedanchor{\savedwaves}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step=\ctikzvalof{monopoles/bareantenna/width}\pgf at circ@scaled at Rlen
+ \pgf at x=4.2\pgf at circ@res at step
+ \pgf at y=\pgf at circ@res at step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf at x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf at x
+ \pgf at y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf at y
+ \pgf at x=\dimexpr\pgf at x\wd\pgfnodeparttextbox\relax
+ \pgf at y=\dimexpr\pgf at y+.5\dp\pgfnodeparttextbox.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{waves}{\savedwaves}
+ \anchor{top}{\northeast\pgf at x=0pt}
+ \anchor{right}{\northeast\pgf at y=0.5\pgf at y}
+ \anchor{left}{\northeast\pgf at x=\pgf at x\pgf at y=0.5\pgf at y}
+ \anchor{bottom}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf at x=0pt}
+ \anchor{east}{\northeast\pgf at y=0.5\pgf at y}
+ \anchor{west}{\northeast\pgf at x=\pgf at x\pgf at y=0.5\pgf at y}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf at x=\pgf at x}
+ \anchor{south east}{\northeast\pgf at y=0pt\relax}
+ \anchor{south west}{\northeast\pgf at y=0pt\pgf at x=\pgf at x}
+ \behindforegroundpath{
+ \pgf at circ@antennabody
+ \pgf at circ@antennawaves
+ }
+}
+
+\pgfdeclareshape{bareRXantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step=\ctikzvalof{monopoles/bareantenna/width}\pgf at circ@scaled at Rlen
+ \pgf at x=\pgf at circ@res at step
+ \pgf at y=2\pgf at circ@res at step
+ }
+ \savedanchor{\savedwaves}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step=\ctikzvalof{monopoles/bareantenna/width}\pgf at circ@scaled at Rlen
+ \pgf at x=4.2\pgf at circ@res at step
+ \pgf at y=\pgf at circ@res at step
+ }
+ \anchor{text}{
+ \northeast
+ \pgf at x=\ctikzvalof{monopoles/bareantenna/label/xanchor}\pgf at x
+ \pgf at y=\ctikzvalof{monopoles/bareantenna/label/yanchor}\pgf at y
+ \pgf at y=\dimexpr\pgf at y+.5\dp\pgfnodeparttextbox.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{waves}{\savedwaves}
+ \anchor{top}{\northeast\pgf at x=0pt}
+ \anchor{right}{\northeast\pgf at y=0.5\pgf at y}
+ \anchor{left}{\northeast\pgf at x=\pgf at x\pgf at y=0.5\pgf at y}
+ \anchor{bottom}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf at x=0pt}
+ \anchor{east}{\northeast\pgf at y=0.5\pgf at y}
+ \anchor{west}{\northeast\pgf at x=\pgf at x\pgf at y=0.5\pgf at y}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf at x=\pgf at x}
+ \anchor{south east}{\northeast\pgf at y=0pt\relax}
+ \anchor{south west}{\northeast\pgf at y=0pt\pgf at x=\pgf at x}
+ \behindforegroundpath{
+ \pgf at circ@antennabody
+ \pgftransformxshift{5.2\pgf at circ@res at step}
+ \pgf at circ@antennawaves
+ }
+}
+
+% Microstrip monopoles
+
+\pgfdeclareshape{mslstub}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \savedanchor{\southeast}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at x=\ctikzvalof{bipoles/mstline/width}\pgf at circ@scaled at Rlen
+ \pgf at x=.5\pgf at x
+ \pgf at y=\ctikzvalof{bipoles/mstline/height}\pgf at circ@scaled at Rlen
+ \pgf at y=.5\pgf at y
+ }
+ \savedanchor{\northwest}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at x=\ctikzvalof{bipoles/mstline/width}\pgf at circ@scaled at Rlen
+ \pgf at x=.5\pgf at x
+ \pgf at y=\ctikzvalof{bipoles/mstline/height}\pgf at circ@scaled at Rlen
+ \pgf at y=.5\pgf at y
+ }
+ \anchor{north}{\northwest\pgf at x=0pt\relax}
+ \anchor{north east}{\northwest\pgf at x=\pgf at x}
+ \anchor{east}{\southeast\pgf at y=0pt\relax}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf at x=0pt\relax}
+ \anchor{south west}{\southeast\pgf at x=\pgf at x}
+ \anchor{west}{\northwest\pgf at y=0pt\relax}
+ \anchor{north west}{\northwest}
+ %
+ \anchor{center}{\northwest\pgf at y=0pt\relax}
+ \anchor{left}{\northwest\pgf at y=0pt\relax}
+ \anchor{right}{\southeast\pgf at y=0pt\relax}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf at circ@res at up}{\northwest}
+ \pgfpoint{.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+ }
+ }
+ \behindbackgroundpath{
+ \pgfextracty{\pgf at circ@res at up}{\northwest}
+ \pgfextractx{\pgf at circ@res at right}{\southeast}
+ \pgfextractx{\pgf at circ@res at left}{\northwest}
+ \pgfextracty{\pgf at circ@res at down}{\southeast}
+ \pgfmathsetlength{\pgf at circ@res at step}{0.25*\pgf at circ@res at up}
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfscope
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgf at circ@draworfill
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{msrstub}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \savedanchor{\southeast}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at x=\ctikzvalof{monopoles/msrstub/width}\pgf at circ@scaled at Rlen
+ \pgf at x=.5\pgf at x
+ \pgf at y=0pt\relax
+ }
+ \savedanchor{\northwest}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at x=\ctikzvalof{monopoles/msrstub/width}\pgf at circ@scaled at Rlen
+ \pgf at x=.5\pgf at x
+ \pgf at y=\ctikzvalof{monopoles/msrstub/height}\pgf at circ@scaled at Rlen
+ \pgf at y=.5\pgf at y
+ }
+ \anchor{north}{\northwest\pgf at x=0pt\relax}
+ \anchor{north east}{\northwest\pgf at x=\pgf at x}
+ \anchor{east}{\southeast\pgf at y=0pt\relax}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf at x=0pt\relax}
+ \anchor{south west}{\southeast\pgf at x=\pgf at x}
+ \anchor{west}{\northwest\pgf at y=0pt\relax}
+ \anchor{north west}{\northwest}
+ %
+ \anchor{center}{\pgfpointorigin}
+ \anchor{left}{\pgfpointorigin}
+ \anchor{right}{\pgfpointorigin}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf at circ@res at up}{\northwest}
+ \pgfpoint{.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+ }
+ }
+ \behindbackgroundpath{
+ \pgfextracty{\pgf at circ@res at up}{\northwest}
+ \pgfextractx{\pgf at circ@res at right}{\southeast}
+ \pgfextractx{\pgf at circ@res at left}{\northwest}
+ \pgfextracty{\pgf at circ@res at down}{\southeast}
+ \pgfmathsetlength{\pgf at circ@res at step}{0.25*\pgf at circ@res at up}
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointpolar{135}{\pgf at circ@res at step}}
+ \pgfpatharc{135}{45}{\pgf at circ@res at step}
+ \pgfpathlineto{\pgfpointpolar{45}{\pgf at circ@res at up}}
+ \pgfpatharc{45}{135}{\pgf at circ@res at up}
+ \pgfclosepath
+ \pgf at circ@draworfill
+ \endpgfscope
+ }
+}
+
+\pgfdeclareshape{msport}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \savedanchor{\southeast}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at x=\ctikzvalof{monopoles/msport/width}\pgf at circ@scaled at Rlen
+ \pgf at x=.5\pgf at x
+ \pgf at y=\ctikzvalof{bipoles/mstline/height}\pgf at circ@scaled at Rlen
+ \pgf at y=.5\pgf at y
+ }
+ \savedanchor{\northwest}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at x=\ctikzvalof{monopoles/msport/width}\pgf at circ@scaled at Rlen
+ \pgf at x=.5\pgf at x
+ \pgf at y=\ctikzvalof{bipoles/mstline/height}\pgf at circ@scaled at Rlen
+ \pgf at y=.5\pgf at y
+ }
+ \anchor{north}{\northwest\pgf at x=0pt\relax}
+ \anchor{north east}{\northwest\pgf at x=\pgf at x}
+ \anchor{east}{\southeast\pgf at y=0pt\relax}
+ \anchor{south east}{\southeast}
+ \anchor{south}{\southeast\pgf at x=0pt\relax}
+ \anchor{south west}{\southeast\pgf at x=\pgf at x}
+ \anchor{west}{\northwest\pgf at y=0pt\relax}
+ \anchor{north west}{\northwest}
+ %
+ \anchor{center}{\northwest\pgf at y=0pt\relax}
+ \anchor{left}{\northwest\pgf at y=0pt\relax}
+ \anchor{right}{\southeast\pgf at y=0pt\relax}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf at circ@res at up}{\northwest}
+ \pgfpoint{.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox.5\ht\pgfnodeparttextbox\relax
+ }
+ }
+ \behindbackgroundpath{
+ \pgfextracty{\pgf at circ@res at up}{\northwest}
+ \pgfextractx{\pgf at circ@res at right}{\southeast}
+ \pgfextractx{\pgf at circ@res at left}{\northwest}
+ \pgfextracty{\pgf at circ@res at down}{\southeast}
+ \pgfmathsetlength{\pgf at circ@res at step}{0.5*\pgf at circ@res at up}
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfscope
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left+\pgf at circ@res at step}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left+\pgf at circ@res at step}{\pgf at circ@res at down}}
+ \pgfpathclose
+ \pgf at circ@draworfill
+ \endpgfscope
+ }
+}
+
+% Legacy antennas (with tails)
+\def\pgf at circ@shift at antenna@xy#1#2{%
+ \pgf at y=\dimexpr\pgf at y+#2\pgf at circ@res at step
+ \pgf at x=\dimexpr\pgf at x+#1\pgf at circ@res at step
+\relax}
+
+% Legacy antenna
+\pgfdeclareshape{antenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step=\ctikzvalof{monopoles/antenna/width}\pgf at circ@scaled at Rlen
+ \pgf at x=\pgf at circ@res at step%0.5\pgflinewidth
+ \pgf at y=4\pgf at circ@res at step
+ }
+ \anchor{north}{\northeast\pgf at circ@res at step=\pgf at x\pgf at x=0cm\pgf at circ@shift at antenna@xy{0}{2}}
+ \anchor{east}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=0cm\pgf at circ@shift at antenna@xy{0}{3}\relax}
+ \anchor{south}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=\pgf at y \pgf at x=0cm\pgf at circ@shift at antenna@xy{0}{4}\relax}
+ \anchor{west}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=0cm\pgf at x=\pgf at x\pgf at circ@shift at antenna@xy{0}{3}}
+ \anchor{north east}{\northeast\pgf at circ@res at step=\pgf at x\pgf at circ@shift at antenna@xy{0}{2}}
+ \anchor{north west}{\northeast\pgf at circ@res at step=\pgf at x\pgf at x=\pgf at x\pgf at circ@shift at antenna@xy{0}{2}}
+ \anchor{south east}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=\pgf at y\pgf at circ@shift at antenna@xy{0}{4}}
+ \anchor{south west}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=\pgf at y\pgf at x=\pgf at x\pgf at circ@shift at antenna@xy{0}{4}}
+ \anchor{text}{
+ \northeast
+ \pgf at x=\ctikzvalof{monopoles/antenna/label/xanchor}\pgf at x
+ \pgf at y=\ctikzvalof{monopoles/antenna/label/yanchor}\pgf at y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf at circ@scaled at Rlen=\scaledRlen
+ \pgf at circ@res at step=\ctikzvalof{monopoles/antenna/width}\pgf at circ@scaled at Rlen
+
+ \pgftransformxshift{ 4\pgf at circ@res at step }
+
+ \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{5\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{4\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{3\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+}
+
+% Legacy TX antenna
+\pgfdeclareshape{txantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step=\ctikzvalof{monopoles/antenna/width}\pgf at circ@scaled at Rlen
+ \pgf at x=\pgf at circ@res at step%0.5\pgflinewidth
+ \pgf at y=4\pgf at circ@res at step
+ }
+ \anchor{north}{\northeast\pgf at circ@res at step=\pgf at x\pgf at x=0cm\pgf at circ@shift at antenna@xy{2}{2}}
+ \anchor{east}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=0cm\pgf at circ@shift at antenna@xy{4}{3}\relax}
+ \anchor{south}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=\pgf at y \pgf at x=0cm\pgf at circ@shift at antenna@xy{2}{4}\relax}
+ \anchor{west}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=0cm\pgf at x=\pgf at x\pgf at circ@shift at antenna@xy{1}{3}}
+ \anchor{north east}{\northeast\pgf at circ@res at step=\pgf at x\pgf at circ@shift at antenna@xy{4}{2}}
+ \anchor{north west}{\northeast\pgf at circ@res at step=\pgf at x\pgf at x=\pgf at x\pgf at circ@shift at antenna@xy{1}{2}}
+ \anchor{south east}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=\pgf at y\pgf at circ@shift at antenna@xy{4}{4}}
+ \anchor{south west}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=\pgf at y\pgf at x=\pgf at x\pgf at circ@shift at antenna@xy{1}{4}}
+ \anchor{text}{
+ \northeast
+ \pgf at x=\ctikzvalof{monopoles/txantenna/label/xanchor}\pgf at x
+ \pgf at y=\ctikzvalof{monopoles/txantenna/label/yanchor}\pgf at y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf at circ@scaled at Rlen=\scaledRlen
+ \pgf at circ@res at step=\ctikzvalof{monopoles/txantenna/width}\pgf at circ@scaled at Rlen
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{5\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{4\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{3\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{5.5\pgf at circ@res at step}{6\pgf at circ@res at step}}
+ % \pgfpatharc{60}{60}{\pgf at circ@res at step and \pgf at circ@res at step}
+ \pgfpatharc{30}{30}{2\pgf at circ@res at step} \pgfpathmoveto{\pgfpoint{6\pgf at circ@res at step}{6.25\pgf at circ@res at step}}
+ \pgfpatharc{30}{30}{2.5\pgf at circ@res at step}
+ \pgfpathmoveto{\pgfpoint{6.5\pgf at circ@res at step}{6.5\pgf at circ@res at step}}
+ \pgfpatharc{30}{30}{3\pgf at circ@res at step}
+ \pgfpathmoveto{\pgfpoint{7\pgf at circ@res at step}{6.75\pgf at circ@res at step}}
+ \pgfpatharc{30}{30}{3.5\pgf at circ@res at step}
+ \pgfpathmoveto{\pgfpoint{7.5\pgf at circ@res at step}{7\pgf at circ@res at step}}
+ \pgfpatharc{30}{30}{4\pgf at circ@res at step}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ }
+}
+
+% Legacy RX antenna
+\pgfdeclareshape{rxantenna}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step=\ctikzvalof{monopoles/antenna/width}\pgf at circ@scaled at Rlen
+ \pgf at x=\pgf at circ@res at step%0.5\pgflinewidth
+ \pgf at y=4\pgf at circ@res at step
+ }
+ \anchor{north}{\northeast\pgf at circ@res at step=\pgf at x\pgf at x=0cm\pgf at circ@shift at antenna@xy{2}{2}}
+ \anchor{east}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=0cm\pgf at circ@shift at antenna@xy{4}{3}\relax}
+ \anchor{south}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=\pgf at y \pgf at x=0cm\pgf at circ@shift at antenna@xy{2}{4}\relax}
+ \anchor{west}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=0cm\pgf at x=\pgf at x\pgf at circ@shift at antenna@xy{1}{3}}
+ \anchor{north east}{\northeast\pgf at circ@res at step=\pgf at x\pgf at circ@shift at antenna@xy{4}{2}}
+ \anchor{north west}{\northeast\pgf at circ@res at step=\pgf at x\pgf at x=\pgf at x\pgf at circ@shift at antenna@xy{1}{2}}
+ \anchor{south east}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=\pgf at y\pgf at circ@shift at antenna@xy{4}{4}}
+ \anchor{south west}{\northeast\pgf at circ@res at step=\pgf at x\pgf at y=\pgf at y\pgf at x=\pgf at x\pgf at circ@shift at antenna@xy{1}{4}}
+ \anchor{text}{
+ \northeast
+ \pgf at x=\ctikzvalof{monopoles/rxantenna/label/xanchor}\pgf at x
+ \pgf at y=\ctikzvalof{monopoles/rxantenna/label/yanchor}\pgf at y
+ }
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf at circ@scaled at Rlen=\scaledRlen
+ \pgf at circ@res at step=\ctikzvalof{monopoles/rxantenna/width}\pgf at circ@scaled at Rlen
+
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{0pt}}
+ \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{5\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{4\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{3\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{4\pgf at circ@res at step0.5\pgflinewidth}{6\pgf at circ@res at step}}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{6\pgf at circ@res at step}{7\pgf at circ@res at step}}
+ % \pgfpatharc{60}{60}{\pgf at circ@res at step and \pgf at circ@res at step}
+ \pgfpatharc{150}{210}{4\pgf at circ@res at step} \pgfpathmoveto{\pgfpoint{6.5\pgf at circ@res at step}{6.75\pgf at circ@res at step}}
+ \pgfpatharc{150}{210}{3.5\pgf at circ@res at step}
+ \pgfpathmoveto{\pgfpoint{7\pgf at circ@res at step}{6.5\pgf at circ@res at step}}
+ \pgfpatharc{150}{210}{3\pgf at circ@res at step}
+ \pgfpathmoveto{\pgfpoint{7.5\pgf at circ@res at step}{6.25\pgf at circ@res at step}}
+ \pgfpatharc{150}{210}{2.5\pgf at circ@res at step}
+ \pgfpathmoveto{\pgfpoint{8\pgf at circ@res at step}{6\pgf at circ@res at step}}
+ \pgfpatharc{150}{210}{2\pgf at circ@res at step}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ }
+}
+
+% Legacy match
+\pgfdeclareshape{match}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{RF}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \savedanchor{\northeast}{%
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step = \ctikzvalof{monopoles/match/width} \pgf at circ@scaled at Rlen
+ \pgf at x=2\pgf at circ@res at step
+ \pgf at circ@res at step = \ctikzvalof{monopoles/match/width} \pgf at circ@scaled at Rlen
+ \pgf at y=.5\pgf at circ@res at step%
+ }
+ % the center is on the left side of the shape for facility of usage
+ \anchor{north}{\northeast\pgf at x=0.5\pgf at x\relax}
+ \anchor{east}{\northeast\pgf at y=0cm\relax}
+ \anchor{south}{\northeast\pgf at y=0pt\pgf at x=0.5\pgf at x\relax}
+ \anchor{west}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf at x=0cm\relax}
+ \anchor{south east}{\northeast\pgf at y=0pt\relax}
+ \anchor{south west}{\pgfpointorigin}
+ \anchor{center}{
+ \pgfpointorigin
+ }
+ \anchor{text}{
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at x=\ctikzvalof{monopoles/match/width}\pgf at circ@scaled at Rlen
+ \pgf at x=1.5\pgf at x
+ \advance \pgf at x by .5\wd\pgfnodeparttextbox
+ \pgf at y=1.5\ht\pgfnodeparttextbox
+ }
+ \behindforegroundpath{
+ \pgf at circ@scaled at Rlen=\scaledRlen
+ \pgf at circ@res at step=\ctikzvalof{monopoles/match/width}\pgf at circ@scaled at Rlen
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{2\pgf at circ@res at step}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{2\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{2\pgf at circ@res at step}{0}}
+ \pgfusepath{fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \endpgfscope
+ }
+}
+
+%%% close: tex/pgfcircmonopoles
+%%%%%%%%%%% Springe nach tex/pgfcircbipoles
+%%% open: tex/pgfcircbipoles.tex
+% Copyright 20072009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the files gpl3.0_license.txt and lppl13c_license.txt for more details.
+
+%% Generic macro for defining a bipole shape
+% #1  additional anchors
+% #2  lower ysize of the bipole (from the center).
+% #3  #shape is the name of the shape
+% #4  upper ysize of the bipole (from the center)
+% #5  width of the bipole
+% #6  macros drawing the bipole
+%
+\long\def\pgfcircdeclarebipole{%
+ \pgfcircdeclarebipolescaled{default}}
+
+%% Generic macro for defining a bipole shape
+% #1  scale factor
+% #2  additional anchors
+% #3  lower ysize of the bipole (from the center).
+% #4  #shape is the name of the shape
+% #5  upper ysize of the bipole (from the center)
+% #6  width of the bipole
+% #7  macros drawing the bipole
+%
+\long\def\pgfcircdeclarebipolescaled#1#2#3#4#5#6#7{
+ \pgfdeclareshape{#4shape}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{#1}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \savedanchor{\northeast}{
+ \pgf at circ@scaled at Rlen=\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen
+ \pgf at y=#5\pgf at circ@scaled at Rlen
+ \pgf at y=.5\pgf at y
+ \pgf at x=#6\pgf at circ@scaled at Rlen
+ \pgf at x=.5\pgf at x
+ }
+ \savedanchor{\northeastborder}{
+ \pgf at circ@scaled at Rlen=\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen
+ \pgf at y=#5\pgf at circ@scaled at Rlen
+ \pgf at y=.5\pgf at y
+ \pgf at y=\ctikzvalof{bipoles/border margin}\pgf at y
+ \pgf at x=#6\pgf at circ@scaled at Rlen
+ \pgf at x=.5\pgf at x
+ \pgf at x=\ctikzvalof{bipoles/border margin}\pgf at x
+ }
+ \savedanchor{\southwestborder}{
+ \pgf at circ@scaled at Rlen=\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen
+ \pgf at y=#3\pgf at circ@scaled at Rlen
+ \pgf at y=.5\pgf at y
+ \pgf at y=\ctikzvalof{bipoles/border margin}\pgf at y
+ \pgf at x=#6\pgf at circ@scaled at Rlen
+ \pgf at x=.5\pgf at x
+ \pgf at x=\ctikzvalof{bipoles/border margin}\pgf at x
+ }
+ \savedanchor{\southwest}{
+ \pgf at circ@scaled at Rlen=\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen
+ \pgf at y=#3\pgf at circ@scaled at Rlen
+ \pgf at y=.5\pgf at y
+ \pgf at x=#6\pgf at circ@scaled at Rlen
+ \pgf at x=.5\pgf at x
+ }
+ \savedanchor{\centerpoint}{
+ \pgf at circ@scaled at Rlen=\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen
+ \pgf at circ@res at down=#3\pgf at circ@scaled at Rlen
+ \pgf at circ@res at up=#5\pgf at circ@scaled at Rlen
+ \pgfpointorigin
+ \pgf at y=\pgf at circ@res at up
+ \advance\pgf at y by\pgf at circ@res at down
+ \pgf at y=.5\pgf at y
+ }
+ \anchor{center}{\pgfpointorigin}
+ \anchor{n}{
+ \northeast
+ \pgf at x=0cm
+ }
+ \anchor{north east}{
+ \northeast
+ }
+ \anchor{north west}{
+ \northeast
+ \pgf at x=\pgf at x
+ }
+ \anchor{ne}{
+ \northeast
+ }
+ \anchor{nw}{
+ \northeast
+ \pgf at x=\pgf at x
+ }
+ \anchor{e}{
+ \northeast
+ \pgf at y=0cm
+ }
+ \anchor{s}{
+ \southwest
+ \pgf at x=0cm
+ }
+ \anchor{south east}{
+ \southwest
+ \pgf at x=\pgf at x
+ }
+ \anchor{south west}{
+ \southwest
+ }
+ \anchor{se}{
+ \southwest
+ \pgf at x=\pgf at x
+ }
+ \anchor{sw}{
+ \southwest
+ }
+ \anchor{w}{
+ \southwest
+ \pgf at y=0cm
+ }
+ \anchor{north}{
+ \northeast
+ \pgf at x=0cm
+ }
+ \anchor{east}{
+ \northeast
+ \pgf at y=0cm
+ }
+ \anchor{south}{
+ \southwest
+ \pgf at x=0cm
+ }
+ \anchor{west}{
+ \southwest
+ \pgf at y=0cm
+ }
+ \anchor{right}{
+ \northeast
+ \pgf at y=0cm
+ }
+ \anchor{above}{
+ \northeast
+ \pgf at x=0cm
+ }
+ \anchor{left}{
+ \southwest
+ \pgf at y=0cm
+ }
+ \anchor{below}{
+ \southwest
+ \pgf at x=0cm
+ }
+ \anchor{a}{
+ \northeast
+ \pgf at y=0cm
+ }
+ \anchor{b}{
+ \southwest
+ \pgf at y=0cm
+ }
+ \savedanchor{\textanchor}{%
+ \pgf at y=\ht\pgfnodeparttextbox
+ \pgf at x=.5\wd\pgfnodeparttextbox
+ }
+ \anchor{text}{
+ \textanchor
+ }
+ \anchorborder{%
+ \ifpgf at circuit@bipole at inverted
+ \pgf at circ@res at left=\pgf at x
+ \pgf at circ@res at right=\pgf at y
+ \else
+ \pgf at circ@res at left=\pgf at x
+ \pgf at circ@res at right=\pgf at y
+ \fi
+ \ifdim\pgf at circ@res at right>0cm
+ \pgfpointborderrectangle{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at right}}{\northeastborder}
+ \else
+ \southwestborder
+ \pgfpointborderrectangle{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at right}}{\pgfpoint{\pgf at x}{\pgf at y}}
+ \fi
+ }
+
+ #2
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northeast
+ \pgf at circ@res at up = \pgf at y
+ \pgf at circ@res at zero = 0cm
+ \pgf at circ@res at left = \pgf at x
+ \pgf at circ@res at right = \pgf at x
+ \southwest
+ \pgf at circ@res at down = \pgf at y
+ \pgf at circ@scaled at Rlen=\scaledRlen
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetcornersarced{\pgfpointorigin}% do not use rounded corners!
+ #7
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ }
+ }
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Standard bipole shapes declarations
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%%%%%%%%%%%%%%%%%%%%%%%%
+% Resistive components
+%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% Short circuit
+
+%%% NOTICE that the short is really NOT drawn; we trust the fact that its
+%%% natural length is zero.
+\pgfcircdeclarebipole
+{}
+{0}
+{short}
+{0}
+{0}
+{ }
+
+%% Open circuit
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/open/height}}
+{open}
+{\ctikzvalof{bipoles/open/height}}
+{\ctikzvalof{bipoles/open/width}}
+{ }
+
+%% Generic bipole  used as resistor by some (bleah)
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/generic/height}}
+{generic}
+{\ctikzvalof{bipoles/generic/height}}
+{\ctikzvalof{bipoles/generic/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf at circ@draworfill
+}
+
+%% Generic empty tunable
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/tgeneric/height}}
+{tgeneric}
+{\ctikzvalof{bipoles/tgeneric/height}}
+{\ctikzvalof{bipoles/tgeneric/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{.4\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{.4\pgf at circ@res at down}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf at circ@draworfill
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.5\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Generic asymmetric bipole
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/ageneric/height}}
+{ageneric}
+{\ctikzvalof{bipoles/ageneric/height}}
+{\ctikzvalof{bipoles/ageneric/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf at circ@draworfill
+ \endpgfscope
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfusepath{stroke,fill}
+}
+
+%% Memristor
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/memristor/height}}
+{memristor}
+{\ctikzvalof{bipoles/memristor/height}}
+{\ctikzvalof{bipoles/memristor/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/resistor/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 14
+
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf at circ@draworfill
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.72*\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.72*\pgf at circ@res at left}{\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.35*\pgf at circ@res at left}{\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.35*\pgf at circ@res at left}{\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.05*\pgf at circ@res at left}{\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.05*\pgf at circ@res at left}{\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.42*\pgf at circ@res at right}{\ctikzvalof{bipoles/memristor/wave height}\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.42*\pgf at circ@res at right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.8*\pgf at circ@res at right}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfusepath{stroke,fill}
+}
+
+%% Photoresistor
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/photoresistor/height 2}}
+{photoresistor}
+{\ctikzvalof{bipoles/photoresistor/height}}
+{\ctikzvalof{bipoles/photoresistor/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf at circ@draworfill
+ \endpgfscope
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.3\pgf at circ@res at right}{1.2\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.05\pgf at circ@res at right}{1.2\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Thermistor
+\pgfcircdeclarebipolescaled{resistors}
+{{% anchor for labelling the type of dependency
+ \anchor{label}{%
+ \southwest
+ \pgf at x=0.4\pgf at x
+ \pgf at y=1.2\pgf at y
+ }%
+}}
+{\ctikzvalof{bipoles/thermistor/height}}
+{thermistor}
+{\ctikzvalof{bipoles/thermistor/height}}
+{\ctikzvalof{bipoles/thermistor/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\ctikzvalof{bipoles/thermistor/main}\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\ctikzvalof{bipoles/thermistor/main}\pgf at circ@res at up}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf at circ@draworfill
+ \endpgfscope
+
+ %\pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{1.2\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{1.2\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ %\endpgfscope
+}
+
+%% Thermistor PTC
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/thermistorptc/height 2}}
+{thermistorptc}
+{\ctikzvalof{bipoles/thermistorptc/height}}
+{\ctikzvalof{bipoles/thermistorptc/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\ctikzvalof{bipoles/thermistorptc/main}\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\ctikzvalof{bipoles/thermistorptc/main}\pgf at circ@res at up}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf at circ@draworfill
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftext[top,x=.85\pgf at circ@res at left,y=.75\pgf at circ@res at down]{\pgf at circ@font at tiny$\vartheta$}
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.62\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{.62\pgf at circ@res at left}{.7\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{.45\pgf at circ@res at left}{.7\pgf at circ@res at down}}
+ \pgfusepath{draw}
+}
+
+%% Thermistor NTC
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/thermistorntc/height 2}}
+{thermistorntc}
+{\ctikzvalof{bipoles/thermistorntc/height}}
+{\ctikzvalof{bipoles/thermistorntc/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\ctikzvalof{bipoles/thermistorntc/main}\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\ctikzvalof{bipoles/thermistorntc/main}\pgf at circ@res at up}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf at circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftext[top,x=.85\pgf at circ@res at left,y=.75\pgf at circ@res at down]{\pgf at circ@font at tiny$\vartheta$}
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.62\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{.62\pgf at circ@res at left}{.7\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{.45\pgf at circ@res at left}{.7\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{.45\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+}
+
+%% Generic tunable
+\pgfcircdeclarebipolescaled{resistors}
+{
+ \savedanchor{\wiper}{
+ \pgf at circ@scaled at Rlen=\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen
+ \pgf at ya=\ctikzvalof{bipoles/generic potentiometer/height}\pgf at circ@scaled at Rlen
+ \pgf at y=.5\pgf at ya
+ \pgf at xa=\ctikzvalof{bipoles/generic potentiometer/width}\pgf at circ@scaled at Rlen
+ \pgfmathsetlength{\pgf at x}{(\ctikzvalof{bipoles/generic potentiometer/wiper pos}0.5)*\pgf at xa}
+ }
+ \anchor{wiper}{\wiper}
+ \anchor{W}{\wiper}
+}
+{\ctikzvalof{bipoles/generic potentiometer/height 2}}
+{genericpotentiometer}
+{\ctikzvalof{bipoles/generic potentiometer/height}}
+{\ctikzvalof{bipoles/generic potentiometer/width}}
+{
+
+ \pgf at circ@res at step = \ctikzvalof{bipoles/resistor/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 14
+
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf at circ@draworfill
+ \endpgfscope
+ \pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latexslim}
+ \pgfextractx{\pgf at circ@res at other}{\wiper}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Zig zag resistores
+\def\pgf at circ@zigzag#1{%
+ \divide \pgf at circ@res at step by \numexpr4*\zigs\relax
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \pgf at circ@count at a=\zigs\relax
+ % first half zig
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{#1\pgf at circ@res at down}}
+ \pgfmathloop%
+ \advance\pgf at circ@count at a by 1\relax% Loop zigs 1 times
+ \ifnum\pgf at circ@count at a>0
+ \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{#1\pgf at circ@res at down}}
+ \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{#1\pgf at circ@res at down}}
+ \repeatpgfmathloop%
+ % last zig and a half
+ \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{#1\pgf at circ@res at down}}
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at zero}}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+}
+
+%% Resistor
+\pgfcircdeclarebipolescaled{resistors}
+{
+\savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+}
+{\ctikzvalof{bipoles/resistor/height}}
+{resistor}
+{\ctikzvalof{bipoles/resistor/height}}
+{\ctikzvalof{bipoles/resistor/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf at circ@res at step}{\ctikzvalof{bipoles/resistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgf at circ@zigzag{1}
+}
+
+
+%% Variable resistor
+\pgfcircdeclarebipolescaled{resistors}
+{
+\savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+}
+{\ctikzvalof{bipoles/vresistor/height}}
+{vresistor}
+{\ctikzvalof{bipoles/vresistor/height}}
+{\ctikzvalof{bipoles/vresistor/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf at circ@res at step}{\ctikzvalof{bipoles/vresistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgf at circ@zigzag{.5}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at other}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at other}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Potentiometer
+\pgfcircdeclarebipolescaled{resistors}
+{
+ \savedanchor{\wiper}{
+ \pgf at circ@scaled at Rlen=\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen
+ \pgf at ya=\ctikzvalof{bipoles/potentiometer/height}\pgf at circ@scaled at Rlen
+ \pgf at y=.5\pgf at ya
+ \pgf at xa=\ctikzvalof{bipoles/potentiometer/width}\pgf at circ@scaled at Rlen
+ \pgfmathsetlength{\pgf at x}{(\ctikzvalof{bipoles/potentiometer/wiper pos}0.5)*\pgf at xa}
+ }
+ \anchor{wiper}{\wiper}
+ \anchor{W}{\wiper}
+ \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+}
+{\ctikzvalof{bipoles/potentiometer/height 2}}
+{potentiometer}
+{\ctikzvalof{bipoles/potentiometer/height}}
+{\ctikzvalof{bipoles/potentiometer/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf at circ@res at step}{\ctikzvalof{bipoles/potentiometer/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgf at circ@zigzag{1}
+
+ \pgfscope
+ %\pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latexslim}
+ \pgfextractx{\pgf at circ@res at other}{\wiper}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Resistive sensor
+\pgfcircdeclarebipolescaled{resistors}
+{% anchor for labelling the type of dependency
+ \anchor{label}{\southwest\pgf at x=0.4\pgf at x}%
+ \savedmacro{\zigs}{\edef\zigs{\ctikzvalof{resistors/zigs}}}
+}
+{\ctikzvalof{bipoles/resistivesens/height}}
+{resistivesens}
+{\ctikzvalof{bipoles/resistivesens/height}}
+{\ctikzvalof{bipoles/resistivesens/width}}
+{%
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfmathsetlength{\pgf at circ@res at step}{\ctikzvalof{bipoles/resistivesens/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgf at circ@zigzag{.5}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at other}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at other}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{.9\pgf at circ@res at other}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%%%%%%%%%%%%%%
+%% Capacitors
+%%%%%%%%%%%%%
+
+%% Plain Capacitor
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/capacitor/height}}
+{capacitor}
+{\ctikzvalof{bipoles/capacitor/height}}
+{\ctikzvalof{bipoles/capacitor/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+
+}
+
+%% Capacitive sensor
+\pgfcircdeclarebipolescaled{capacitors}
+{
+ \anchor{label}{\southwest\pgf at x=2.6\pgf at x\pgf at y=1.2\pgf at y}%
+}
+{\ctikzvalof{bipoles/capacitor/height}}
+{capacitivesens}
+{\ctikzvalof{bipoles/capacitor/height}}
+{\ctikzvalof{bipoles/capacitor/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{2.6\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{2.6\pgf at circ@res at right}{1.2\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{4.4\pgf at circ@res at right}{1.2\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Polar Capacitor (DEPRECATED)
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/pcapacitor/height}}
+{polarcapacitor}
+{\ctikzvalof{bipoles/pcapacitor/height}}
+{\ctikzvalof{bipoles/pcapacitor/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left+ \ctikzvalof{bipoles/pcapacitor/bend width}\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgftransformrotate{90}
+ \pgfpathsine{\pgfpoint{\pgf at circ@res at up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf at circ@res at left}}
+ \pgfpathcosine{\pgfpoint{\pgf at circ@res at up}{\ctikzvalof{bipoles/pcapacitor/bend width}\pgf at circ@res at left}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+}
+
+
+%% Curved capacitor
+% see https://tex.stackexchange.com/questions/509594/polarcapacitororientationincircuitikzseemswrong
+% for a rationale
+%
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/ccapacitor/height}}
+{ccapacitor}
+{\ctikzvalof{bipoles/ccapacitor/height}}
+{\ctikzvalof{bipoles/ccapacitor/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right+ \ctikzvalof{bipoles/ccapacitor/bend width}\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgftransformrotate{90}
+ \pgfpathsine{\pgfpoint{\pgf at circ@res at up}{\ctikzvalof{bipoles/ccapacitor/bend width}\pgf at circ@res at right}}
+ \pgfpathcosine{\pgfpoint{\pgf at circ@res at up}{\ctikzvalof{bipoles/ccapacitor/bend width}\pgf at circ@res at right}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+}
+
+
+
+
+%% Electrolytic Capacitor
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/ecapacitor/height}}
+{ecapacitor}
+{\ctikzvalof{bipoles/ecapacitor/height}}
+{\ctikzvalof{bipoles/ecapacitor/width}}
+{
+ \pgfsetrectcap
+ % % % Draw plus pole
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgf at circ@draworfill
+ % % Draw minus pole
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfsetfillcolor{\ctikzvalof{color}}
+ \pgfusepath{draw,fill}
+ \pgfsetfillcolor{\ctikzvalof{color}}
+ % % plus pole annotation
+ \pgftext[right,at=\pgfpoint{1.2\pgf at circ@res at left}{.6\pgf at circ@res at up}]
+ {\ctikzvalof{bipoles/ecapacitor/font} $+$}
+}
+
+%% Variable Capacitor
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/vcapacitor/height}}
+{vcapacitor}
+{\ctikzvalof{bipoles/vcapacitor/height}}
+{\ctikzvalof{bipoles/vcapacitor/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/vcapacitor/capacitor width} \pgf at circ@res at right
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfusepath{draw}
+}
+
+
+%% Piezoelectric Element
+
+\pgfcircdeclarebipolescaled{capacitors}
+{}
+{\ctikzvalof{bipoles/piezoelectric/height}}
+{piezoelectric}
+{\ctikzvalof{bipoles/piezoelectric/height}}
+{\ctikzvalof{bipoles/piezoelectric/width}}
+{
+ % \pgf at circ@res at step = \ctikzvalof{bipoles/piezoelectric/width}\pgf at circ@Rlen
+ % \divide \pgf at circ@res at step by 5
+
+ %% Outer markings
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+
+ %% Inner Box
+ \pgf at circ@res at step = \pgf at circ@res at right \divide \pgf at circ@res at step by 10
+ \pgfscope
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners
+ {\pgfpoint{\pgf at circ@res at left+4*\pgf at circ@res at step}{\pgf at circ@res at up\pgf at circ@res at step}}
+ {\pgfpoint{\pgf at circ@res at right4*\pgf at circ@res at step}{\pgf at circ@res at down+\pgf at circ@res at step}}
+ \pgf at circ@draworfill
+ \endpgfscope
+}
+
+%%%%%%%%%%%%%%%
+%% Inductors
+%%%%%%%%%%%%%%%
+
+%% cute inductor
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf at x=0pt\relax
+ \pgfmathsetlength{\pgf at y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ \ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf at circ@scaled at Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/cuteinductor/lower coil height}}
+{cuteinductor}
+{\ctikzvalof{bipoles/cuteinductor/height}}
+{\ctikzvalof{bipoles/cuteinductor/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf at circ@res at other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/cuteinductor/coils}1)}
+
+
+ \pgfmathsetlength{\pgf at circ@res at step}
+ {(\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}1)*2*\pgf at circ@res at other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at up}
+ \pgfpatharc{0}{180}{\pgf at circ@res at other and \pgf at circ@res at down}
+ }
+ \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% cute inductive sensor
+\pgfcircdeclarebipolescaled{inductors}
+{% anchor for labelling the type of dependency
+ \anchor{label}{\southwest\pgf at x=0.8\pgf at x\pgf at y=2.6\pgf at y}%
+ \savedanchor{\midtap}{%
+ \pgf at x=0pt\relax
+ \pgfmathsetlength{\pgf at y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ \ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf at circ@scaled at Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/cuteinductor/lower coil height}}
+{scuteinductor}
+{\ctikzvalof{bipoles/cuteinductor/height}}
+{\ctikzvalof{bipoles/cuteinductor/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf at circ@res at other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/cuteinductor/coil aspect}*\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/cuteinductor/coils}1)}
+
+
+ \pgfmathsetlength{\pgf at circ@res at step}
+ {(\ctikzvalof{bipoles/cuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cuteinductor/coils}1)*2*\pgf at circ@res at other)/\ctikzvalof{bipoles/cuteinductor/coils}/2}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/cuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at up}
+ \pgfpatharc{0}{180}{\pgf at circ@res at other and \pgf at circ@res at down}
+ }
+ \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.8\pgf at circ@res at right}{2\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.8\pgf at circ@res at right}{2.6\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{1.6\pgf at circ@res at right}{2.6\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% cute choke
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf at x=0pt\relax
+ \pgfmathsetlength{\pgf at y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ \ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf at circ@scaled at Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/cutechoke/lower coil height}}
+{cutechoke}
+{\ctikzvalof{bipoles/cutechoke/height}}
+{\ctikzvalof{bipoles/cutechoke/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf at circ@res at other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/cutechoke/coil aspect}*\ctikzvalof{bipoles/cutechoke/width}*\scaledRlen/(\ctikzvalof{bipoles/cutechoke/coils}1)}
+
+
+ \pgfmathsetlength{\pgf at circ@res at step}
+ {(\ctikzvalof{bipoles/cutechoke/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/cutechoke/coils}1)*2*\pgf at circ@res at other)/\ctikzvalof{bipoles/cutechoke/coils}/2}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/cutechoke/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at up}
+ \pgfpatharc{0}{180}{\pgf at circ@res at other and \pgf at circ@res at down}
+ }
+ \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf at circ@res at up}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
+ \pgfusepath{stroke}
+
+ \ifpgf at circuit@bipole at twolineschoke
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf at circ@res at up+\ctikzvalof{bipoles/cutechoke/cstep}\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth+\ctikzvalof{bipoles/cutechoke/cdist}\pgf at circ@res at up+\ctikzvalof{bipoles/cutechoke/cstep}\pgf at circ@res at up}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfsetlinewidth{\ctikzvalof{bipoles/cutechoke/cthick}\pgflinewidth}
+ \pgfusepath{stroke}
+ \fi
+}
+
+%% variable cute inductor
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf at x=0pt\relax
+ \pgfmathsetlength{\pgf at y}{%
+ (mod(\ctikzvalof{bipoles/cuteinductor/coils},2) ?%
+ \ctikzvalof{bipoles/cuteinductor/height} :% even
+ \ctikzvalof{bipoles/cuteinductor/lower coil height}) %odd
+ *\pgf at circ@scaled at Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/vcuteinductor/lower coil height}}
+{vcuteinductor}
+{\ctikzvalof{bipoles/vcuteinductor/height}}
+{\ctikzvalof{bipoles/vcuteinductor/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf at circ@res at other}%width of small coil
+ {0.5*\ctikzvalof{bipoles/vcuteinductor/coil aspect}*\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen/(\ctikzvalof{bipoles/vcuteinductor/coils}1)}
+
+
+ \pgfmathsetlength{\pgf at circ@res at step}
+ {(\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}1)*2*\pgf at circ@res at other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {2,...,\ctikzvalof{bipoles/vcuteinductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf at circ@res at step and .5\pgf at circ@res at up}
+ \pgfpatharc{0}{180}{\pgf at circ@res at other and .5\pgf at circ@res at down}
+ }
+ \pgfpatharc{180}{0}{\pgf at circ@res at step and .5\pgf at circ@res at up}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% american inductor
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf at x=0pt\relax
+ \pgfmathsetlength{\pgf at y}{%
+ (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?%
+ 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even
+ 0) %odd
+ *\pgf at circ@scaled at Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/americaninductor/height 2}}
+{americaninductor}
+{\ctikzvalof{bipoles/americaninductor/height}}
+{\ctikzvalof{bipoles/americaninductor/width}}
+{
+ \pgf at circ@res at step=\ctikzvalof{bipoles/americaninductor/width}\pgf at circ@scaled at Rlen
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf at circ@res at step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf at circ@res at step by \ctikzvalof{bipoles/americaninductor/coils}
+ \divide \pgf at circ@res at step by 2
+ \pgf at circ@res at other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf at circ@scaled at Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at other}
+ }
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+
+%% american inductive sensor
+\pgfcircdeclarebipolescaled{inductors}
+{% anchor for labelling the type of dependency
+ \anchor{label}{\southwest\pgf at x=0.8\pgf at x\pgf at y=2.6\pgf at y}%
+ \savedanchor{\midtap}{%
+ \pgf at x=0pt\relax
+ \pgfmathsetlength{\pgf at y}{%
+ (mod(\ctikzvalof{bipoles/americaninductor/coils},2) ?%
+ 2*\ctikzvalof{bipoles/americaninductor/coil height} :% even
+ 0) %odd
+ *\pgf at circ@scaled at Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/americaninductor/height 2}}
+{samericaninductor}
+{\ctikzvalof{bipoles/americaninductor/height}}
+{\ctikzvalof{bipoles/americaninductor/width}}
+{
+ \pgf at circ@res at step=\ctikzvalof{bipoles/americaninductor/width}\pgf at circ@scaled at Rlen
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf at circ@res at step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf at circ@res at step by \ctikzvalof{bipoles/americaninductor/coils}
+ \divide \pgf at circ@res at step by 2
+ \pgf at circ@res at other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf at circ@scaled at Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at other}
+ }
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{.8\pgf at circ@res at right}{2\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.8\pgf at circ@res at right}{2.6\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{1.6\pgf at circ@res at right}{2.6\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% variable american inductor
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \savedanchor{\midtap}{%
+ \pgf at x=0pt\relax
+ \pgfmathsetlength{\pgf at y}{%
+ (mod(\ctikzvalof{bipoles/vamericaninductor/coils},2) ?%
+ 2*\ctikzvalof{bipoles/vamericaninductor/coil height} :% even
+ 0) %odd
+ *\pgf at circ@scaled at Rlen/2
+ }
+ }
+ \anchor{midtap}{\midtap}
+}
+{\ctikzvalof{bipoles/vamericaninductor/height 2}}
+{vamericaninductor}
+{\ctikzvalof{bipoles/vamericaninductor/height}}
+{\ctikzvalof{bipoles/vamericaninductor/width}}
+{
+ \pgf at circ@res at step=\ctikzvalof{bipoles/vamericaninductor/width}\pgf at circ@scaled at Rlen
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \advance \pgf at circ@res at step by \pgfhorizontaltransformationadjustment\pgflinewidth
+ \divide \pgf at circ@res at step by \ctikzvalof{bipoles/vamericaninductor/coils}
+ \divide \pgf at circ@res at step by 2
+ \pgf at circ@res at other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf at circ@scaled at Rlen
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {1,...,\ctikzvalof{bipoles/vamericaninductor/coils}}
+ {
+ \pgfpatharc{180}{0}{\pgf at circ@res at step and \pgf at circ@res at other}
+ }
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Generic bipole, filled  used as inductor by some
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \anchor{midtap}{\northeast\pgf at x=0pt\relax}
+}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{fullgeneric}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{\ctikzvalof{bipoles/fullgeneric/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfusepath{draw,fill}
+}
+
+%% Generic sensor, filled  used as inductive sensor by some
+\pgfcircdeclarebipolescaled{inductors}
+{% anchor for labelling the type of dependency
+ \anchor{label}{\southwest\pgf at x=0.4\pgf at x\pgf at y=2\pgf at y}%
+ \anchor{midtap}{\northeast\pgf at x=0pt\relax}
+}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{sfullgeneric}
+{\ctikzvalof{bipoles/fullgeneric/height}}
+{\ctikzvalof{bipoles/fullgeneric/width}}
+{
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw,fill}
+ %\pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{2\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{2\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{2\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ %\endpgfscope
+}
+
+%% Generic full tunable
+\pgfcircdeclarebipolescaled{inductors}
+{
+ \anchor{midtap}{\northeast\pgf at x=0pt\relax}
+}
+{\ctikzvalof{bipoles/tfullgeneric/height}}
+{tfullgeneric}
+{\ctikzvalof{bipoles/tfullgeneric/height}}
+{\ctikzvalof{bipoles/tfullgeneric/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/resistor/width}\pgf at circ@Rlen
+ \divide \pgf at circ@res at step by 14
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{.4\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{.4\pgf at circ@res at down}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw,fill}
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{.5\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%%%%%%%%%%%
+%% Battery
+%%%%%%%%%%%
+
+%% Battery
+\pgfcircdeclarebipolescaled{batteries}
+{}
+{\ctikzvalof{bipoles/battery/height}}
+{battery}
+{\ctikzvalof{bipoles/battery/height}}
+{\ctikzvalof{bipoles/battery/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/battery/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 6
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \ifpgf at circ@fixbatteries
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{.5\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{.5\pgf at circ@res at down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{.5\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{.5\pgf at circ@res at down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \else
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{.5\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{.5\pgf at circ@res at down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at down}}
+ \fi
+ \pgfusepath{draw}
+}
+
+
+%% Battery 1 % poles with equl thickness
+
+\pgfcircdeclarebipolescaled{batteries}
+{}
+{\ctikzvalof{bipoles/battery1/height}}
+{battery1}
+{\ctikzvalof{bipoles/battery1/height}}
+{\ctikzvalof{bipoles/battery1/width}}
+{
+ \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
+ \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgfusepath{draw}
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \ifpgf at circ@fixbatteries
+ \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at right}{\pgf at circ@res at down}}
+
+ \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{.5\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at left}{.5\pgf at circ@res at down}}
+ \else
+ \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{.5\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at right}{.5\pgf at circ@res at down}}
+
+ \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \fi
+ \pgfusepath{draw}
+}
+
+%% Battery 2 % negative pole thicker
+
+\pgfcircdeclarebipolescaled{batteries}
+{}
+{\ctikzvalof{bipoles/battery2/height}}
+{battery2}
+{\ctikzvalof{bipoles/battery2/height}}
+{\ctikzvalof{bipoles/battery2/width}}
+{
+ \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
+ \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgfusepath{draw}
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \ifpgf at circ@fixbatteries
+ \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{3\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{.5\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at left}{.5\pgf at circ@res at down}}
+ \else
+ \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{3\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf at circ@res at right}{.5\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf at circ@res at right}{.5\pgf at circ@res at down}}
+ \fi
+ \pgfusepath{draw}
+}
+
+%%%%%%%%%%%
+%% Round and diamond sources
+%%%%%%%%%%%
+
+%% Independent voltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsource}
+{\ctikzvalof{bipoles/vsource/height}}
+{\ctikzvalof{bipoles/vsource/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfusepath{draw}
+}
+
+%% Independent voltage source  American style
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsourceam/height}}
+{vsourceAM}
+{\ctikzvalof{bipoles/vsourceam/height}}
+{\ctikzvalof{bipoles/vsourceam/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifpgf at circ@oldvoltagedirection
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf at circ@res at down]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf at circ@res at up]{$$}
+ \else
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf at circ@res at down]{$$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf at circ@res at up]{$+$}
+ \fi
+}
+
+%% Independent sinusoidal voltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsourcesin/height}}
+{vsourcesin}
+{\ctikzvalof{bipoles/vsourcesin/height}}
+{\ctikzvalof{bipoles/vsourcesin/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+
+ \pgf at circ@res at up = .5\pgf at circ@res at up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% Square Voltage source  contributed by Alistair Kwan
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsourcesquare/height}}
+{vsourcesquare}
+{\ctikzvalof{bipoles/vsourcesquare/height}}
+{\ctikzvalof{bipoles/vsourcesquare/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+ \pgf at circ@res at up = .5\pgf at circ@res at up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{1\pgf at circ@res at up}{0cm}}
+ \pgfpathlineto{\pgfpoint{1\pgf at circ@res at up}{1\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0\pgf at circ@res at up}{1\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0\pgf at circ@res at up}{1\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{1\pgf at circ@res at up}{1\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{1\pgf at circ@res at up}{0\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% Triangle Voltage source  contributed by Ralf Farkas
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsourcetri/height}}
+{vsourcetri}
+{\ctikzvalof{bipoles/vsourcetri/height}}
+{\ctikzvalof{bipoles/vsourcetri/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+
+ \pgf at circ@res at up = .5\pgf at circ@res at up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{1\pgf at circ@res at up}{0cm}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at up}{0.75\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at up}{0.75\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{1\pgf at circ@res at up}{0\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% PV Source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/pvsource/height}}
+{pvsource}
+{\ctikzvalof{bipoles/pvsource/height}}
+{\ctikzvalof{bipoles/pvsource/width}}
+{
+ \pgfpointorigin
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
+ \pgf at circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{.15\pgf at circ@res at right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
+ \pgfpathmoveto{\pgfpoint{.15\pgf at circ@res at left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgfusepath{draw}
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.15\pgf at circ@res at left}{.4\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.15\pgf at circ@res at left}{.4\pgf at circ@res at down}}
+
+ \pgfpathmoveto{\pgfpoint{.15\pgf at circ@res at right}{.6\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.15\pgf at circ@res at right}{.6\pgf at circ@res at down}}
+ \pgfusepath{draw}
+
+ %Arrow Part
+ \pgfscope
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{.3\pgf at circ@res at left}{0}}{\pgfpointpolar{45}{2.2\pgf at circ@res at up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{.3\pgf at circ@res at left}{0}}{\pgfpointpolar{45}{1.3\pgf at circ@res at up}}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpointadd{\pgfpoint{0}{0.3\pgf at circ@res at up}}{\pgfpointpolar{45}{2.2\pgf at circ@res at up}}}
+ \pgfpathlineto{\pgfpointadd{\pgfpoint{0}{0.3\pgf at circ@res at up}}{\pgfpointpolar{45}{1.3\pgf at circ@res at up}}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Empty Source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/esource/height}}
+{esource}
+{\ctikzvalof{bipoles/esource/height}}
+{\ctikzvalof{bipoles/esource/width}}
+{
+ \pgfpointorigin
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+}
+
+%% DC Current Source with open shape
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/dcisource/height}}
+{dcisource}
+{\ctikzvalof{bipoles/dcisource/height}}
+{\ctikzvalof{bipoles/dcisource/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@maybefill
+ \edef\@@angle{\ctikzvalof{bipoles/dcisource/angle}}
+ \pgfpathmoveto{\pgfpointpolar{\@@angle}{\pgf at circ@res at up}}
+ \pgfpatharc{\@@angle}{\@@angle}{\pgf at circ@res at up}
+ \pgfpathmoveto{\pgfpointpolar{180\@@angle}{\pgf at circ@res at up}}
+ \pgfpatharc{180\@@angle}{180+\@@angle}{\pgf at circ@res at up}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+%% DCVoltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/dcvsource/height}}
+{dcvsource}
+{\ctikzvalof{bipoles/dcvsource/height}}
+{\ctikzvalof{bipoles/dcvsource/width}}
+{
+ \pgfpointorigin
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+ \pgfpathmoveto{\pgfpoint{.2\pgf at circ@res at up}{.5\pgf at circ@res at left}}
+ \pgfpathlineto{\pgfpoint{.2\pgf at circ@res at up}{.5\pgf at circ@res at right}}
+ \pgfpathmoveto{\pgfpoint{.2\pgf at circ@res at down}{.5\pgf at circ@res at left}}
+ \pgfpathlineto{\pgfpoint{.2\pgf at circ@res at down}{.5\pgf at circ@res at right}}
+ \pgfusepath{draw}
+}
+
+%% Independent current source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isource}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+ \pgfpointorigin
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+ \pgf at circ@draworfill
+}
+
+%% Independent double oo source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/oosource/height}}
+{oosource}
+{\ctikzvalof{bipoles/oosource/height}}
+{\ctikzvalof{bipoles/oosource/width}}
+{
+ \pgfpointorigin
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf at circ@res at left}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf at circ@res at left}
+ \pgf at circ@maybefill
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf at circ@res at right}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf at circ@res at right}
+ \pgf at circ@draworfill
+ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosource/circleoffset}\pgf at circ@res at left}{0}}
+ {\ctikzvalof{bipoles/oosource/circlesize}\pgf at circ@res at left}
+ \pgfusepath{draw}
+}
+
+%% Independent current source  American
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isourceam/height}}
+{isourceAM}
+{\ctikzvalof{bipoles/isourceam/height}}
+{\ctikzvalof{bipoles/isourceam/width}}
+{
+ \pgfpointorigin
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{.7\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+%% Independent sinusoidal current source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isourcesin}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+ \pgfpointorigin
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+
+ \pgf at circ@res at up = .5\pgf at circ@res at up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty controlled source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/ecsource/height}}
+{ecsource}
+{\ctikzvalof{bipoles/ecsource/height}}
+{\ctikzvalof{bipoles/ecsource/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+ \pgfpathclose
+ \pgf at circ@draworfill
+}
+
+%% Controlled voltage source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsource/height}}
+{cvsource}
+{\ctikzvalof{bipoles/cvsource/height}}
+{\ctikzvalof{bipoles/cvsource/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+ \pgfpathclose
+ \pgf at circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfusepath{draw}
+}
+
+%% Controlled voltage source  American
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsourceam/height}}
+{cvsourceAM}
+{\ctikzvalof{bipoles/cvsourceam/height}}
+{\ctikzvalof{bipoles/cvsourceam/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+ \pgfpathclose
+ \pgf at circ@draworfill
+
+ \pgfsetcolor{\ctikzvalof{color}}
+ \ifpgf at circ@oldvoltagedirection
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf at circ@res at left]{$+$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf at circ@res at right]{$$}
+ \else
+ \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf at circ@res at left]{$$}
+ \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf at circ@res at right]{$+$}
+ \fi
+}
+
+%% Controlled sinusoidal voltage source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{cvsourcesin}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{\ctikzvalof{bipoles/cvsourcesin/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+ \pgfpathclose
+ \pgf at circ@draworfill
+ \endpgfscope
+
+ \pgf at circ@res at up = .5\pgf at circ@res at up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Controlled sinusoidal current source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{cisourcesin}
+{\ctikzvalof{bipoles/cvsourcesin/height}}
+{\ctikzvalof{bipoles/cvsourcesin/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+ \pgfpathclose
+ \pgf at circ@draworfill
+ \endpgfscope
+
+ \pgf at circ@res at up = .5\pgf at circ@res at up
+ \pgfscope
+ \pgftransformrotate{90}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at up}{0cm}}
+ \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfpathsine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfpathcosine{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Controlled current source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cisource/height}}
+{cisource}
+{\ctikzvalof{bipoles/cisource/height}}
+{\ctikzvalof{bipoles/cisource/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+ \pgfpathclose
+ \pgf at circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+}
+
+%% Controlled current source  American
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cisourceam/height}}
+{cisourceAM}
+{\ctikzvalof{bipoles/cisourceam/height}}
+{\ctikzvalof{bipoles/cisourceam/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+ \pgfpathclose
+ \pgf at circ@draworfill
+ \pgfpathmoveto{\pgfpoint{.7\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfusepath{draw}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{.5\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+}
+
+%% Cute Independent voltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsourceC}
+{\ctikzvalof{bipoles/vsource/height}}
+{\ctikzvalof{bipoles/vsource/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%% Cute Independent current source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isourceC}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+ \pgfpointorigin
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{.6\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{.6\pgf at circ@res at down}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%% Cute Controlled voltage source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cvsource/height}}
+{cvsourceC}
+{\ctikzvalof{bipoles/cvsource/height}}
+{\ctikzvalof{bipoles/cvsource/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%% Cute Controlled current source
+\pgfcircdeclarebipolescaled{csources}
+{}
+{\ctikzvalof{bipoles/cisource/height}}
+{cisourceC}
+{\ctikzvalof{bipoles/cisource/height}}
+{\ctikzvalof{bipoles/cisource/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@draworfill
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at zero}{.6\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at zero}{.6\pgf at circ@res at down}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%% Noise voltage source
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/vsource/height}}
+{vsourceN}
+{\ctikzvalof{bipoles/vsource/height}}
+{\ctikzvalof{bipoles/vsource/width}}
+{
+ \pgfscope
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ %
+ \pgf at circ@scaled at Rlen=\scaledRlen
+ \pgf at circ@res at step=0.125\pgf at circ@scaled at Rlen\relax
+ \edef\pgf at noise@temp{dashed}
+ \edef\pgf at noise@fill{\ctikzvalof{bipoles/noise sources/fillcolor}}
+ \ifx\pgf at noise@temp\pgf at noise@fill
+ % fillable in this case
+ \pgf at circ@draworfillandclip
+ \pgfmathsetmacro{\@@thinner}{.5*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thinner\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ %
+ \advance\pgf at circ@res at up by 4\pgf at circ@res at step \advance\pgf at circ@res at down by 4\pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \else
+ \pgfsetfillcolor{\pgf at noise@fill}
+ \pgfusepath{draw,fill}
+ \fi
+ \endpgfscope
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+%% Noise current source
+
+\pgfcircdeclarebipolescaled{sources}
+{}
+{\ctikzvalof{bipoles/isource/height}}
+{isourceN}
+{\ctikzvalof{bipoles/isource/height}}
+{\ctikzvalof{bipoles/isource/width}}
+{
+ \pgfpointorigin
+ \pgfscope
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ %
+ \pgf at circ@scaled at Rlen=\scaledRlen
+ \pgf at circ@res at step=0.125\pgf at circ@scaled at Rlen\relax
+ \edef\pgf at noise@temp{dashed}
+ \edef\pgf at noise@fill{\ctikzvalof{bipoles/noise sources/fillcolor}}
+ \ifx\pgf at noise@temp\pgf at noise@fill
+ % fillable in this case
+ \pgf at circ@draworfillandclip
+ \pgfmathsetmacro{\@@thinner}{.5*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thinner\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ %
+ \advance\pgf at circ@res at up by 4\pgf at circ@res at step \advance\pgf at circ@res at down by 4\pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \advance\pgf at circ@res at up by \pgf at circ@res at step\advance\pgf at circ@res at down by \pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \else
+ \pgfsetfillcolor{\pgf at noise@fill}
+ \pgfusepath{draw,fill}
+ \fi
+ \endpgfscope
+ \pgfmathsetmacro{\@@thicker}{3*\ctikzvalof{bipoles/thickness}}
+ \pgfsetlinewidth{\@@thicker\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{.6\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{.6\pgf at circ@res at down}}
+ \pgfsetroundcap\pgfusepath{draw}
+}
+
+%%%%%%%%%%%%%%
+%% Diodes
+%%%%%%%%%%%%%%
+
+%% Black generic diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fulldiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf at circ@res at left}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+}
+
+%% Black Zener diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf at circ@res at left}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfusepath{draw,fill}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right.6\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black alternative zigzag Zener diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullzzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgftransformxshift{\pgf at circ@res at left}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfusepath{draw,fill}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right1.8\pgf at circ@res at left}{\pgf at circ@res at down0.5\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right0.2\pgf at circ@res at left}{\pgf at circ@res at up0.5\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black Schottky diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullsdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf at circ@res at left}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right.6\pgf at circ@res at left}{.6\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right.6\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right1.4\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right1.4\pgf at circ@res at left}{.6\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Black tunnel diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fulltdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf at circ@res at left}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right.6\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right.6\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Black light emitting diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fulllediode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf at circ@res at left}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{2\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
+ \pgfusepath{draw}
+
+}
+
+%% Black photodiode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{fullpdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxshift{\pgf at circ@res at left}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfusepath{draw,fill}
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latexslim}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{2\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
+ \pgfusepath{draw}
+}
+
+%% Black varcap
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/varcap/height}}
+{fullvarcap}
+{\ctikzvalof{bipoles/varcap/height}}
+{\ctikzvalof{bipoles/varcap/width}}
+{
+ \pgf at circ@res at temp=\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgfsetlinewidth{\pgf at circ@res at temp}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right2\pgf at circ@res at temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right2\pgf at circ@res at temp}{0pt}}
+ \pgfusepath{draw,fill}
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right2\pgf at circ@res at temp}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right2\pgf at circ@res at temp}{\pgf at circ@res at up}}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+}
+
+%% Code for the diode triangle
+\def\pgf at circ@basicdiodeshape{
+ % \pgfscope
+ \pgftransformxshift{\pgf at circ@res at left}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+ \pgfpathclose
+ \pgf at circ@draworfill
+ \pgfscope
+ % to allow filling, we need to draw explicitly the stroke here.
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \ifpgf at circuit@bipole at strokedsymbol
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfusepath{draw}
+ \fi
+ \endpgfscope
+ % \endpgfscope
+}
+
+%% Empty generic diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptydiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf at circ@basicdiodeshape
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+}
+
+%% Empty Zener diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptyzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgf at circ@basicdiodeshape
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right0.6\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty alternative zigzag Zener diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptyzzdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfscope
+ \pgf at circ@basicdiodeshape
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right1.8\pgf at circ@res at left}{\pgf at circ@res at down0.5\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right0.2\pgf at circ@res at left}{\pgf at circ@res at up0.5\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+%% Empty Schottky diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptysdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf at circ@basicdiodeshape
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right.6\pgf at circ@res at left}{.6\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right.6\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right1.4\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right1.4\pgf at circ@res at left}{.6\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+}
+
+%% Empty tunnel diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptytdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf at circ@basicdiodeshape
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right.6\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right.6\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Empty light emitting diode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptylediode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf at circ@basicdiodeshape
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{2\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
+ \pgfusepath{draw}
+}
+
+%% Empty photodiode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/diode/height}}
+{emptypdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/diode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgf at circ@basicdiodeshape
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsstart{latexslim}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{2\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.2\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{1.2\pgf at circ@res at right}{1.8\pgf at circ@res at up}}
+ \pgfusepath{draw}
+}
+
+%% Empty varcap
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/varcap/height}}
+{emptyvarcap}
+{\ctikzvalof{bipoles/varcap/height}}
+{\ctikzvalof{bipoles/varcap/width}}
+{
+ \pgf at circ@res at temp=\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgfsetlinewidth{\pgf at circ@res at temp}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right2\pgf at circ@res at temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+ % \pgfpathlineto{\pgfpoint{\pgf at circ@res at right2\pgf at circ@res at temp}{0pt}}
+ \pgfpathclose
+ \pgf at circ@draworfill
+ \pgfscope
+ % to allow filling, we need to draw explicitily the stroke here.
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \ifpgf at circuit@bipole at strokedsymbol
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right2\pgf at circ@res at temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfusepath{draw}
+ \fi
+ \endpgfscope
+ %
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right2\pgf at circ@res at temp}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right2\pgf at circ@res at temp}{\pgf at circ@res at up}}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+}
+
+%% Empty bidirectionaldiode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{emptybidirectionaldiode}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{\ctikzvalof{bipoles/bidirectionaldiode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf at circ@res at other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf at circ@res at left
+ \pgf at circ@res at step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf at circ@res at right
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at step}{0.707*(\pgf at circ@res at other\pgf at circ@res at step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at other}{0.707*(\pgf at circ@res at other\pgf at circ@res at step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+
+ \pgf at circ@draworfill
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%% Full bidirectionaldiode
+\pgfcircdeclarebipolescaled{diodes}
+{}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{fullbidirectionaldiode}
+{\ctikzvalof{bipoles/bidirectionaldiode/height}}
+{\ctikzvalof{bipoles/bidirectionaldiode/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf at circ@res at other = \ctikzvalof{bipoles/bidirectionaldiode/diode width left}\pgf at circ@res at left
+ \pgf at circ@res at step = \ctikzvalof{bipoles/bidirectionaldiode/diode width right}\pgf at circ@res at right
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at step}{0.707*(\pgf at circ@res at other\pgf at circ@res at step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at other}{0.707*(\pgf at circ@res at other\pgf at circ@res at step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+
+ \pgfusepath{draw, fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%% Black thyristor
+\pgfcircdeclarebipolescaled{diodes}
+{
+ \anchor{gate}{\northeast}
+ \anchor{anode}{\southwest\pgf at y=0cm}
+ \anchor{G}{\northeast}
+ \anchor{cathode}{\northeast\pgf at y=0cm }
+}
+{\ctikzvalof{tripoles/thyristor/height 2}}
+{fullthyristor}
+{\ctikzvalof{tripoles/thyristor/height}}
+{\ctikzvalof{tripoles/thyristor/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf at circ@res at other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf at circ@res at left
+ \pgf at circ@res at step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf at circ@res at right
+
+ \pgfscope
+ \pgftransformxshift{\pgf at circ@res at other}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step\pgf at circ@res at other}{0pt}}
+
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step\pgf at circ@res at other}{0pt}}
+ \pgfusepath{draw,fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step\pgf at circ@res at other}{0pt}}
+ \pgfpathlineto{\pgfpoint{2*\pgf at circ@res at step2*\pgf at circ@res at other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{2*\pgf at circ@res at step2*\pgf at circ@res at other}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+
+ \pgfusepath{draw}
+
+}
+
+%% Empty thyristor
+
+\pgfcircdeclarebipolescaled{diodes}
+{
+ \anchor{gate}{\northeast}
+ \anchor{anode}{\southwest\pgf at y=0cm}
+ \anchor{G}{\northeast}
+ \anchor{cathode}{\northeast\pgf at y=0cm }
+}
+{\ctikzvalof{tripoles/thyristor/height 2}}
+{emptythyristor}
+{\ctikzvalof{tripoles/thyristor/height}}
+{\ctikzvalof{tripoles/thyristor/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf at circ@res at other = \ctikzvalof{tripoles/thyristor/diode width left}\pgf at circ@res at left
+ \pgf at circ@res at step = \ctikzvalof{tripoles/thyristor/diode width right}\pgf at circ@res at right
+
+ \pgfscope
+ \pgftransformxshift{\pgf at circ@res at other}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step\pgf at circ@res at other}{0pt}}
+
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at down}}
+ \pgfpathclose
+ \pgf at circ@draworfill
+ \pgfscope
+ % to allow filling, we need to draw explicitily the stroke here.
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \ifpgf at circuit@bipole at strokedsymbol
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step\pgf at circ@res at other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{0pt}}
+ \pgfusepath{draw}
+ \fi
+ \endpgfscope
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step\pgf at circ@res at other}{0pt}}
+ \pgfpathlineto{\pgfpoint{2*\pgf at circ@res at step2*\pgf at circ@res at other}{\ctikzvalof{tripoles/thyristor/diode height}\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{2*\pgf at circ@res at step2*\pgf at circ@res at other}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at down}}
+
+ \pgfusepath{draw}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%% Empty triac
+\pgfcircdeclarebipolescaled{diodes}
+{
+ \anchor{gate}{\northeast}
+ \anchor{anode}{\southwest\pgf at y=0cm}
+ \anchor{G}{\northeast}
+ \anchor{cathode}{\northeast\pgf at y=0cm }
+}
+{\ctikzvalof{tripoles/triac/height}}
+{emptytriac}
+{\ctikzvalof{tripoles/triac/height}}
+{\ctikzvalof{tripoles/triac/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf at circ@res at other = \ctikzvalof{tripoles/triac/diode width left}\pgf at circ@res at left
+ \pgf at circ@res at step = \ctikzvalof{tripoles/triac/diode width right}\pgf at circ@res at right
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at step}{0.707*(\pgf at circ@res at other\pgf at circ@res at step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at other}{0.707*(\pgf at circ@res at other\pgf at circ@res at step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+
+ \pgf at circ@draworfill
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0.707*(\pgf at circ@res at other\pgf at circ@res at step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}} % sqrt(1/2)
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%% Full triac
+\pgfcircdeclarebipolescaled{diodes}
+{
+ \anchor{gate}{\northeast}
+ \anchor{anode}{\southwest\pgf at y=0cm}
+ \anchor{G}{\northeast}
+ \anchor{cathode}{\northeast\pgf at y=0cm }
+}
+{\ctikzvalof{tripoles/triac/height}}
+{fulltriac}
+{\ctikzvalof{tripoles/triac/height}}
+{\ctikzvalof{tripoles/triac/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf at circ@res at other = \ctikzvalof{tripoles/triac/diode width left}\pgf at circ@res at left
+ \pgf at circ@res at step = \ctikzvalof{tripoles/triac/diode width right}\pgf at circ@res at right
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at step}{0.707*(\pgf at circ@res at other\pgf at circ@res at step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf at circ@res at other}{0.707*(\pgf at circ@res at other\pgf at circ@res at step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at step}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}}
+
+ \pgfusepath{draw,fill}
+
+ \pgfsetlinewidth{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0.707*(\pgf at circ@res at other\pgf at circ@res at step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{1.414*(\pgf at circ@res at other\pgf at circ@res at step)}} % sqrt(1/2)
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}} % sqrt(1/2)
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+
+ \pgfusepath{draw}
+}
+
+%%%%%%%%%%%%%
+%% switches
+%%%%%%%%%%%%%
+
+%% (Closing) SPST
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/spst/depth}}
+{cspst}
+{\ctikzvalof{bipoles/spst/height}}
+{\ctikzvalof{bipoles/spst/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathmoveto{\pgfpointpolar{90}{1.2\pgf at circ@res at right}}
+ \pgfpatharc{90}{20}{1.2\pgf at circ@res at right}
+ \pgfsetarrowsend{latexslim}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Opening SPST
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/spst/depth}}
+{ospst}
+{\ctikzvalof{bipoles/spst/height}}
+{\ctikzvalof{bipoles/spst/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathmoveto{\pgfpointpolar{10}{1.2\pgf at circ@res at right}}
+ \pgfpatharc{10}{90}{1.2\pgf at circ@res at right}
+ \pgfsetarrowsend{latexslim}
+ \pgfsetbeveljoin
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% Normal open Switch
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/nos/depth}}
+{nos}
+{\ctikzvalof{bipoles/nos/height}}
+{\ctikzvalof{bipoles/nos/width}}
+{
+
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.9\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfsetbuttcap
+ \pgfusepath{draw}
+}
+
+%% Normal closed Switch
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/ncs/depth}}
+{ncs}
+{\ctikzvalof{bipoles/ncs/height}}
+{\ctikzvalof{bipoles/ncs/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.9\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.2\pgf at circ@res at right}{0pt}}
+ \pgfpathlineto{\pgfpoint{.2\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+}
+
+%% Push Button
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/pushbutton/height 2}}
+{pushbutton}
+{\ctikzvalof{bipoles/pushbutton/height}}
+{\ctikzvalof{bipoles/pushbutton/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{.5\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at up}}
+ \pgfpathmoveto{\pgfpoint{0}{.5\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf at circ@res at right}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+}
+
+%% Normally closed Push Button
+\pgfcircdeclarebipolescaled{switches}
+{}
+{\ctikzvalof{bipoles/pushbutton/height 2}}
+{ncpushbutton}
+{\ctikzvalof{bipoles/pushbutton/height}}
+{\ctikzvalof{bipoles/pushbutton/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ % Warning, if the nodes will have a class, we have to touch this.
+ \pgf at circ@res at temp=\ctikzvalof{nodes width}\pgf at circ@Rlen
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at temp}}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf at circ@res at temp}}
+ \pgfpathlineto{\pgfpoint{0}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ %
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf at circ@res at right}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+}
+% cute switch "to" shapes help function
+% #1 > name
+% #2 > barposition
+% #3 > arrowcode
+\long\def\pgfcircdeclarecutesw#1#2#3{
+ \pgfcircdeclarebipolescaled{switches}
+ {
+ \savedanchor\midlever{
+ % these values are calculated when we create the definition of the shape.
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at y=\ctikzvalof{bipoles/cuteswitch/height}\pgf at circ@scaled at Rlen
+ \pgf at circ@res at temp=\ctikzvalof{nodes width}\pgf at circ@scaled at Rlen
+ \pgf at circ@res at temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf at circ@res at temp
+ \pgf at circ@res at down = .5\pgf at y
+ \pgf at circ@res at up = .5\pgf at y
+ \pgfextracty{\pgf at circ@res at other}{#2}
+ \pgf at x=0pt
+ \pgf at y=.5\pgf at circ@res at other
+ }
+ % radius of the connector
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ % If cnnecting nodes are scaled, we have to modify this
+ \saveddimen{\radius}{\pgfmathsetlength\pgf at x{\pgf at circ@Rlen*\ctikzvalof{nodes width}}}
+ % shapename
+ \savedmacro{\thisshape}{\def\thisshape{\tikz at fig@name}}
+ % shape type
+ \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
+ % mid of the lever, to stack switches
+ \anchor{mid}{\midlever}
+ \anchor{cout}{\northeast \pgf at y=0cm}
+ \anchor{cin}{\southwest\pgf at y=0cm}
+ \anchor{out}{\northeast \pgf at y=0cm\advance\pgf at x by \radius}
+ \anchor{in}{\southwest\pgf at y=0cm\advance\pgf at x by \radius}
+ }
+ {\ctikzvalof{bipoles/cuteswitch/height 2}}
+ {#1}
+ {\ctikzvalof{bipoles/cuteswitch/height}}
+ {\ctikzvalof{bipoles/cuteswitch/width}}{
+ \pgfscope
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ % If cnnecting nodes are scaled, we have to modify this
+ \pgf at circ@res at temp=\ctikzvalof{nodes width}\pgf at circ@Rlen
+ \pgf at circ@res at temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf at circ@res at temp
+ \pgfsetlinewidth{2\pgf at circ@res at temp}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{#2}
+ \pgfsetroundcap\pgfusepath{draw}
+ \endpgfscope
+ \pgfscope % arrow
+ #3
+ \endpgfscope
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{\cshape}{center}{}{\thisshapein}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf at circ@res at right}{0pt}}
+ \pgfnode{\cshape}{center}{}{\thisshapeout}{\pgfusepath{draw}}
+ }
+}
+
+%% closed cute switch
+\pgfcircdeclarecutesw{cuteclosedswitch}
+ {\pgfpoint{\pgf at circ@res at right}{1.5\pgf at circ@res at temp}}
+ {}
+
+%% open cute switch
+\pgfcircdeclarecutesw{cuteopenswitch}
+ {\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ {}
+
+%% closing cute switch
+\pgfcircdeclarecutesw{cuteclosingswitch}
+ {\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ {
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{70}{1.2\pgf at circ@res at right}}
+ \pgfpatharc{70}{10}{1.2\pgf at circ@res at right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+ }
+
+%% opening cute switch
+\pgfcircdeclarecutesw{cuteopeningswitch}
+ {\pgfpoint{\pgf at circ@res at right}{1.5\pgf at circ@res at temp}}
+ {
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{10}{1.2\pgf at circ@res at right}}
+ \pgfpatharc{10}{60}{1.2\pgf at circ@res at right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+ }
+
+%%%%%%%%%%%%%%%%%
+%% Instruments
+%%%%%%%%%%%%%%%%%
+
+% % METERINGSHAPE
+\long\def\drawmeteringcircle{
+ \def\pgf at circ@temp{right}
+ \ifx\tikz at res@label at pos\pgf at circ@temp
+ \pgf at circ@res at step=1.2\pgf at circ@res at up
+ \else
+ \def\pgf at circ@temp{below}
+ \ifx\tikz at res@label at pos\pgf at circ@temp
+ \pgf at circ@res at step=1.2\pgf at circ@res at up
+ \else
+ \pgf at circ@res at step=1.2\pgf at circ@res at up
+ \fi
+ \fi
+ %draw connections to circle
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{.9\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathmoveto{\pgfpoint{.9\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfusepath{draw}
+ %draw circle
+ \pgfscope
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf at circ@res at up}
+ \pgf at circ@draworfill
+ \endpgfscope
+ %draw arrow
+ \pgfscope
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%AMPEREMETER
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/ammeter/height}}
+{ammeter}
+{\ctikzvalof{bipoles/ammeter/height}}
+{\ctikzvalof{bipoles/ammeter/width}}
+{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\pgf at circ@font at bold{A}}{}{}
+}
+%OHMMETER
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/ohmmeter/height}}
+{ohmmeter}
+{\ctikzvalof{bipoles/ohmmeter/height}}
+{\ctikzvalof{bipoles/ohmmeter/width}}
+{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\boldmath$\Omega$}{}{}
+}
+%VOLTMETER
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/voltmeter/height}}
+{voltmeter}
+{\ctikzvalof{bipoles/voltmeter/height}}
+{\ctikzvalof{bipoles/voltmeter/width}}
+{
+ \drawmeteringcircle
+ \pgfnode{circle}{center}{\pgf at circ@font at bold{V}}{}{}
+
+}
+
+% oscilloscope, suggested by @nobrl https://github.com/circuitikz/circuitikz/issues/176
+\pgfcircdeclarebipolescaled{instruments}
+{
+ \anchor{in 1}{\southwest\pgf at y=0.75\pgf at y\pgf at x=0.4\pgf at x}
+ \anchor{in 2}{\southwest\pgf at y=0.75\pgf at y\pgf at x=0.4\pgf at x}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf at circ@res at up}{\northeast}
+ \pgfpoint{.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/oscope/height}}
+{oscope}
+{\ctikzvalof{bipoles/oscope/height}}
+{\ctikzvalof{bipoles/oscope/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfextracty{\pgf at circ@res at up}{\northeast}
+ \pgfextractx{\pgf at circ@res at right}{\northeast}
+ \pgfextractx{\pgf at circ@res at left}{\southwest}
+ \pgfextracty{\pgf at circ@res at down}{\southwest}
+ \pgfmathsetlength{\pgf at circ@res at step}{0.25*\pgf at circ@res at up}
+ \pgfscope
+ \pgfsetcornersarced{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at step}}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ % this would create a round (analog?) scope...
+ % \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+ \endpgfscope
+ % get the rotation
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{atan2(\b,\a)}
+ % and unrotate the scope
+ \pgfscope
+ \pgftransformrotate{\rot}
+ % grid
+ \pgfscope
+ \pgfsetlinewidth{0.5\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf at circ@res at left}{0.25\pgf at circ@res at down}}
+ \pgfpathgrid[stepx=\pgf at circ@res at step, stepy=\pgf at circ@res at step]%
+ {\pgfpoint{0.75\pgf at circ@res at left}{0.5\pgf at circ@res at down}}
+ {\pgfpoint{0.75\pgf at circ@res at right}{0.5\pgf at circ@res at up}}
+ \pgfsetstrokeopacity{0.5}
+ \pgfusepath{draw}
+ \endpgfscope
+ % function displayed, thanks to
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf at circ@res at left}{0.25\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0.05\pgf at circ@res at left}{0.25\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.05\pgf at circ@res at left}{0.25\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0.65\pgf at circ@res at right}{0.25\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.65\pgf at circ@res at right}{0.25\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% generic round meter with always horizontal text, no arrow
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/esource/height}}
+{rmeter}
+{\ctikzvalof{bipoles/esource/height}}
+{\ctikzvalof{bipoles/esource/width}}
+{
+ \pgfpointorigin
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+ % draw the text label
+ % get the rotation
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{atan2(\b,\a)}
+ % and unrotate the scope
+ \pgfscope
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgftransformrotate{\rot}
+ \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
+ \endpgfscope
+}
+
+% generic round meter with always horizontal text, with arrow
+\pgfcircdeclarebipolescaled{instruments}
+{}
+{\ctikzvalof{bipoles/esource/height}}
+{rmeterwa}
+{\ctikzvalof{bipoles/esource/height}}
+{\ctikzvalof{bipoles/esource/width}}
+{
+ \pgfpointorigin
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+ % draw the text label
+ % get the rotation
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{atan2(\b,\a)}
+ % and unrotate the scope
+ \pgfscope
+ \pgftransformrotate{\rot}
+ \pgfsetcolor{\ctikzvalof{color}}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ % arrow: create a center hole to have better visual
+ \pgfscope
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf at circ@res at left}{2\pgf at circ@res at down}}
+ {\pgfpoint{2\pgf at circ@res at right}{2\pgf at circ@res at up}}
+ % next open a circle into it
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{.6\pgf at circ@res at up}}{\pgfpoint{.6\pgf at circ@res at left}{0}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfsetarrowsend{latexslim}
+ % the arrow is better if it has a bit of breath and it's not 45º
+ \pgfpathmoveto{\pgfpoint{.8\pgf at circ@res at left}{1.2\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{.8\pgf at circ@res at right}{1.2\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgftext[center]{\ctikzvalof{bipoles/twoport/text}}
+ \endpgfscope
+}
+
+% generic square meter with always horizontal text
+\pgfcircdeclarebipolescaled{instruments}
+{
+ \anchor{in 1}{\southwest\pgf at y=0.75\pgf at y\pgf at x=0.4\pgf at x}
+ \anchor{in 2}{\southwest\pgf at y=0.75\pgf at y\pgf at x=0.4\pgf at x}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf at circ@res at up}{\northeast}
+ \pgfpoint{.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/smeter/height}}
+{smeter}
+{\ctikzvalof{bipoles/smeter/height}}
+{\ctikzvalof{bipoles/smeter/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfextracty{\pgf at circ@res at up}{\northeast}
+ \pgfextractx{\pgf at circ@res at right}{\northeast}
+ \pgfextractx{\pgf at circ@res at left}{\southwest}
+ \pgfextracty{\pgf at circ@res at down}{\southwest}
+ \pgfmathsetlength{\pgf at circ@res at step}{0.25*\pgf at circ@res at up}
+ \pgfscope
+ \pgfsetcornersarced{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at step}}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgf at circ@draworfill
+ \endpgfscope
+ % get the rotation
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\rot}{atan2(\b,\a)}
+ % and unrotate the scope
+ \pgfscope
+ \pgftransformrotate{\rot}
+ % the metering window
+ \pgfscope
+ \def\@starta{105}\def\@stopa{75}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgftransformshift{\pgfpoint{0pt}{1.8\pgf at circ@res at up}}
+ \pgfpathmoveto{\pgfpointpolar{\@starta}{2\pgf at circ@res at up}}
+ \pgfpatharc{\@starta}{\@stopa}{2\pgf at circ@res at up}
+ \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf at circ@res at up}}
+ \pgfpatharc{\@stopa}{\@starta}{2.5\pgf at circ@res at up}
+ \pgfclosepath
+ \pgfpathmoveto{\pgfpointpolar{80}{2\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpointpolar{80}{2.4\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgftext[center, y=0.5\pgf at circ@res at down]{\ctikzvalof{bipoles/twoport/text}}
+ \endpgfscope
+}
+
+% probes qucs style:
+% #1 : name
+% #2 : extra code
+\long\def\pgfcirc at qucsprobe#1#2{
+ \pgfcircdeclarebipolescaled{instruments}
+ {
+ \anchor{v+}{\southwest\pgf at x=0.6\pgf at x}
+ \anchor{v}{\southwest\pgf at x=0.6\pgf at x}
+ % put the node text above and centered
+ \anchor{text}{\pgfextracty{\pgf at circ@res at up}{\northeast}
+ \pgfpoint{.5\wd\pgfnodeparttextbox}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+ }
+ }
+ }
+ {\ctikzvalof{bipoles/qmeter/depth}}
+ {#1}
+ {\ctikzvalof{bipoles/qmeter/height}}
+ {\ctikzvalof{bipoles/qmeter/width}}
+ {
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfextracty{\pgf at circ@res at up}{\northeast}
+ \pgfextractx{\pgf at circ@res at right}{\northeast}
+ \pgfextractx{\pgf at circ@res at left}{\southwest}
+ \pgfextracty{\pgf at circ@res at down}{\southwest}
+ \pgfmathsetlength{\pgf at circ@res at step}{0.25*\pgf at circ@res at up}
+ \pgfscope
+ \pgfscope
+ \pgfsetcornersarced{\pgfpoint{\pgf at circ@res at step}{\pgf at circ@res at step}}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgf at circ@draworfill
+ \endpgfscope
+ \def\@starta{103}\def\@stopa{77}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformshift{\pgfpoint{0pt}{1.7\pgf at circ@res at up}}
+ \pgfpathmoveto{\pgfpointpolar{\@starta}{2.1\pgf at circ@res at up}}
+ \pgfpatharc{\@starta}{\@stopa}{2.1\pgf at circ@res at up}
+ \pgfpathlineto{\pgfpointpolar{\@stopa}{2.5\pgf at circ@res at up}}
+ \pgfpatharc{\@stopa}{\@starta}{2.5\pgf at circ@res at up}
+ \pgfclosepath
+ \pgfpathmoveto{\pgfpointpolar{83}{2.1\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpointpolar{83}{2.4\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \pgf at circ@draworfill
+ \endpgfscope
+ #2
+ \endpgfscope
+ }
+}
+
+\pgfcirc at qucsprobe{qiprobe}{
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+ \pgfusepath{draw}
+ \pgfnode{currarrow}{center}{}{}{}
+}
+
+\pgfcirc at qucsprobe{qvprobe}{
+ \pgfmathsetlength{\pgf at circ@res at other}{\ctikzvalof{nodes width}*\pgf at circ@scaled at Rlen}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at left}{0pt}}
+ \pgfpathcircle{\pgfpoint{.6\pgf at circ@res at left+\pgf at circ@res at other}{0pt}}{\pgf at circ@res at other}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+ \pgfpathcircle{\pgfpoint{.6\pgf at circ@res at right\pgf at circ@res at other}{0pt}}{\pgf at circ@res at other}
+ \pgfusepath{draw}
+ \pgfscope
+ % "+" and "", drawn so that they scale correctly
+ \pgfsetlinewidth{2\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left+\pgf at circ@res at other}{1.5\pgf at circ@res at other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at left+\pgf at circ@res at other}{3.5\pgf at circ@res at other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left+0\pgf at circ@res at other}{2.5\pgf at circ@res at other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at left+2\pgf at circ@res at other}{2.5\pgf at circ@res at other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at right+0\pgf at circ@res at other}{2.5\pgf at circ@res at other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right2\pgf at circ@res at other}{2.5\pgf at circ@res at other}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+\pgfcirc at qucsprobe{qpprobe}{
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+ \pgfusepath{draw}
+ \pgfnode{currarrow}{center}{}{}{}
+ \pgfmathsetlength{\pgf at circ@res at other}{\ctikzvalof{nodes width}*\pgf at circ@scaled at Rlen}
+ \pgfpathcircle{\pgfpoint{.6\pgf at circ@res at left}{3\pgf at circ@res at other}}{\pgf at circ@res at other}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left}{4\pgf at circ@res at other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathcircle{\pgfpoint{.6\pgf at circ@res at right}{3\pgf at circ@res at other}}{\pgf at circ@res at other}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at right}{4\pgf at circ@res at other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \pgfscope
+ % "+" and "", drawn so that they scale correctly
+ \pgfsetlinewidth{2\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left+3\pgf at circ@res at other}{2\pgf at circ@res at other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at left+3\pgf at circ@res at other}{4\pgf at circ@res at other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left+2\pgf at circ@res at other}{3\pgf at circ@res at other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at left+4\pgf at circ@res at other}{3\pgf at circ@res at other}}
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at right4\pgf at circ@res at other}{3\pgf at circ@res at other}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right2\pgf at circ@res at other}{3\pgf at circ@res at other}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% current loop for oscope and similar: stylized
+\pgfcircdeclarebipolescaled{instruments}
+{
+ \anchor{i}{\northeast\pgf at x=0pt\relax}
+ \anchor{text}{
+ \pgfextracty{\pgf at circ@res at up}{\northeast}
+ \pgfextractx{\pgf at circ@res at left}{\northeast}
+ \pgfpoint{.5\wd\pgfnodeparttextbox+\pgf at circ@res at left}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/iloop/height}}
+{iloop}
+{\ctikzvalof{bipoles/iloop/height}}
+{\ctikzvalof{bipoles/iloop/width}}
+{
+ \pgfextracty{\pgf at circ@res at up}{\northeast}
+ \pgfextractx{\pgf at circ@res at right}{\northeast}
+ \pgf at circ@res at down=\pgf at circ@res at up
+ \pgf at circ@res at left=\pgf at circ@res at right
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetcolor{\ctikzvalof{color}}
+ % external ellipse
+ \pgfscope
+ \pgf at circ@setlinewidth{bipoles}{\pgflinewidth}
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf at circ@res at left}{2\pgf at circ@res at down}}
+ {\pgfpoint{2\pgf at circ@res at right}{2\pgf at circ@res at up}}
+ % next the opening to the left
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf at circ@res at left}{.1\pgf at circ@res at down}}
+ {\pgfpoint{0pt}{.1\pgf at circ@res at up}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathellipse{\pgfpointorigin}{
+ \pgfpoint{0pt}{0.8\pgf at circ@res at up}}{
+ \pgfpoint{0.4\pgf at circ@res at right}{0pt}}
+ \pgfusepath{draw}
+ \endpgfscope
+ % internal wire
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.3\pgf at circ@res at right}{0pt}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+ % and the contact line up
+ \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+% current loop for oscope and similar: real (double connection)
+\pgfcircdeclarebipolescaled{instruments}
+{
+ \anchor{i+}{
+ \pgfextracty{\pgf at circ@res at up}{\northeast}
+ \pgfextractx{\pgf at circ@res at right}{\northeast}
+ \pgf at circ@res at step=0.4\pgf at circ@res at right
+ \pgf at circ@res at other=0.8\pgf at circ@res at up
+ \pgfpointpolar{105}{\pgf at circ@res at step and \pgf at circ@res at other}
+ \pgf at y=\pgf at circ@res at up
+ }
+ \anchor{i}{
+ \pgfextracty{\pgf at circ@res at up}{\northeast}
+ \pgfextractx{\pgf at circ@res at right}{\northeast}
+ \pgf at circ@res at step=0.4\pgf at circ@res at right
+ \pgf at circ@res at other=0.8\pgf at circ@res at up
+ \pgfpointpolar{75}{\pgf at circ@res at step and \pgf at circ@res at other}
+ \pgf at y=\pgf at circ@res at up
+ }
+ \anchor{text}{
+ \pgfextracty{\pgf at circ@res at up}{\northeast}
+ \pgfextractx{\pgf at circ@res at left}{\northeast}
+ \pgfpoint{.5\wd\pgfnodeparttextbox+\pgf at circ@res at left}{
+ \dimexpr.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf at circ@res at up\relax
+ }
+ }
+}
+{\ctikzvalof{bipoles/iloop/height}}
+{iloop2}
+{\ctikzvalof{bipoles/iloop/height}}
+{\ctikzvalof{bipoles/iloop/width}}
+{
+ \pgfextracty{\pgf at circ@res at up}{\northeast}
+ \pgfextractx{\pgf at circ@res at right}{\northeast}
+ \pgf at circ@res at down=\pgf at circ@res at up
+ \pgf at circ@res at left=\pgf at circ@res at right
+ % must be the same than internal i+ and i anchors definition
+ \pgf at circ@res at step=0.4\pgf at circ@res at right
+ \pgf at circ@res at other=0.8\pgf at circ@res at up
+ \def\@plus{\pgfpointpolar{105}{\pgf at circ@res at step and \pgf at circ@res at other}}
+ \def\@minus{\pgfpointpolar{75}{\pgf at circ@res at step and \pgf at circ@res at other}}
+ \pgfscope
+ \pgfstartlinewidth=\pgflinewidth
+ \pgfsetcolor{\ctikzvalof{color}}
+ % external ellipse
+ \pgfscope
+ \pgf at circ@setlinewidth{bipoles}{\pgflinewidth}
+ % clipping path: first a rectangle bigger then the shape
+ % to avoid problems with the line thickness
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf at circ@res at left}{2\pgf at circ@res at down}}
+ {\pgfpoint{2\pgf at circ@res at right}{2\pgf at circ@res at up}}
+ % next the opening to the left
+ \pgfpathrectanglecorners{\pgfpoint{2\pgf at circ@res at left}{.1\pgf at circ@res at down}}
+ {\pgfpoint{0pt}{.1\pgf at circ@res at up}}
+ % do the difference and clip before drawing
+ \pgfseteorule
+ \pgfusepath{clip}
+ \pgfpathmoveto{\@plus}
+ \pgfpatharc{105}{435}{\pgf at circ@res at step and \pgf at circ@res at other}
+ \pgfusepath{draw}
+ \endpgfscope
+ % internal wire
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.3\pgf at circ@res at right}{0pt}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+ % and the contact line up
+ % I use ...left and right as temporal lengths here to avoid defining more
+ \pgfextractx{\pgf at circ@res at left}{\@plus}
+ \pgfextractx{\pgf at circ@res at right}{\@minus}
+ \pgfpathmoveto{\@plus}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathmoveto{\@minus}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+
+%% Varistor
+\pgfcircdeclarebipolescaled{resistors}
+{}
+{\ctikzvalof{bipoles/varistor/height}}
+{varistor}
+{\ctikzvalof{bipoles/varistor/height}}
+{\ctikzvalof{bipoles/varistor/width}}
+{
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\ctikzvalof{bipoles/varistor/main}\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\ctikzvalof{bipoles/varistor/main}\pgf at circ@res at up}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf at circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{.4\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+
+ \pgftext[top,x=.65\pgf at circ@res at left,y=1.2\pgf at circ@res at down]{{\pgf at circ@font at tiny\textsf{U}}}
+}
+
+%%%%%%%%%%%%%%
+%% RF bipoles
+%%%%%%%%%%%%%%
+
+% transmission line
+\pgfcircdeclarebipolescaled{RF}
+{}
+{\ctikzvalof{bipoles/tline/height}}
+{tline}
+{\ctikzvalof{bipoles/tline/height}}
+{\ctikzvalof{bipoles/tline/width}}
+{
+ \pgf at circ@res at step=.2\pgf at circ@res at right % half x axis
+ \begin{pgftransparencygroup}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at step}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left+\pgf at circ@res at step}{\pgf at circ@res at up}}
+ \pgfpatharc{90}{90}{\pgf at circ@res at step and \pgf at circ@res at up}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at step}{\pgf at circ@res at down}}
+ \pgf at circ@draworfill
+ \pgfpathellipse{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at step}{0pt}}
+ {\pgfpoint{\pgf at circ@res at step}{0pt}}{\pgfpoint{0pt}{\pgf at circ@res at up}}
+ \pgf at circ@draworfill
+ \end{pgftransparencygroup}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right\pgf at circ@res at step}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+ \pgfusepath{stroke}
+}
+
+% microstrip transmission line
+\pgfcircdeclarebipolescaled{RF}
+{}
+{\ctikzvalof{bipoles/mstline/height}}
+{mstline}
+{\ctikzvalof{bipoles/mstline/height}}
+{\ctikzvalof{bipoles/mstline/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf at circ@draworfill
+}
+
+%%%%%%%%%%%%%%%%%%%
+%% Block diagrams
+%%%%%%%%%%%%%%%%%%%
+
+%% Draw the twoport fillable box
+\def\pgf at circ@twoportbox{
+ \pgfscope
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgf at circ@draworfill
+ \endpgfscope
+}
+
+%% Generic two port box
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/twoport/height}}
+{twoport}
+{\ctikzvalof{bipoles/twoport/height}}
+{\ctikzvalof{bipoles/twoport/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/twoport/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+ % draw outer box
+ \pgf at circ@twoportbox
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}}
+
+}
+
+%% voltage controled oscillator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/vco/width}}
+{vco}
+{\ctikzvalof{bipoles/twoport/width}}
+{\ctikzvalof{bipoles/vco/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/vco/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+ % draw circle
+ \pgfscope
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0}{0}} {\pgf at circ@res at step}
+ \pgf at circ@draworfill
+ \endpgfscope
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner sine waves
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.5\pgf at circ@res at step}{0\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfusepath{draw}
+}
+
+%% bandpass filter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/bandpass/width}}
+{bandpass}
+{\ctikzvalof{bipoles/bandpass/width}}
+{\ctikzvalof{bipoles/bandpass/width}}
+{
+
+ \pgf at circ@res at step = \ctikzvalof{bipoles/bandpass/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.15\pgf at circ@res at step}{0.35\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.65\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.15\pgf at circ@res at step}{0.65\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.35\pgf at circ@res at step}}
+ \pgfusepath{draw}
+}
+
+%% bandstop filter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/bandstop/width}}
+{bandstop}
+{\ctikzvalof{bipoles/bandstop/width}}
+{\ctikzvalof{bipoles/bandstop/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/bandstop/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225% 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt}% always draw solid line for inner symbol
+ \pgfsetarrows{}%never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.15\pgf at circ@res at step}{0.15\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.15\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfusepath{draw}
+}
+
+%% highpass filter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/highpass/width}}
+{highpass}
+{\ctikzvalof{bipoles/highpass/width}}
+{\ctikzvalof{bipoles/highpass/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/highpass/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.15\pgf at circ@res at step}{0.15\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.15\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.15\pgf at circ@res at step}{0.65\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.35\pgf at circ@res at step}}
+ \pgfusepath{draw}
+}
+
+%% lowpass filter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/lowpass/width}}
+{lowpass}
+{\ctikzvalof{bipoles/lowpass/width}}
+{\ctikzvalof{bipoles/lowpass/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/lowpass/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 224 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.15\pgf at circ@res at step}{0.35\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.65\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.15\pgf at circ@res at step}{0.15\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0.15\pgf at circ@res at step}{0.15\pgf at circ@res at step}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathsine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfpathcosine{\pgfpoint{.25\pgf at circ@res at step}{.25\pgf at circ@res at step}}
+ \pgfusepath{draw}
+}
+
+%% ADC
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/adc/width}}
+{adc}
+{\ctikzvalof{bipoles/adc/width}}
+{\ctikzvalof{bipoles/adc/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/adc/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\texti{A}
+ \def\textii{D}
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \def\texti{D}
+ \def\textii{A}
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \def\texti{D}
+ \def\textii{A}
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \def\texti{A}
+ \def\textii{D}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+
+ \pgftext[center,x=0.45\pgf at circ@res at left,y=0.45\pgf at circ@res at up]{\textsf{\texti}}
+ \pgftext[center,x=0.45\pgf at circ@res at right,y=0.45\pgf at circ@res at down]{\textsf{\textii}}
+}
+
+%% DAC
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/dac/width}}
+{dac}
+{\ctikzvalof{bipoles/dac/width}}
+{\ctikzvalof{bipoles/dac/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/dac/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\texti{D}
+ \def\textii{A}
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \def\texti{A}
+ \def\textii{D}
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 134 \ifnum \pgfcircmathresult < 225 % 134 degree, because >= 135 is not possible
+ \def\texti{A}
+ \def\textii{D}
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \def\texti{D}
+ \def\textii{A}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+
+ \pgftext[center,x=0.45\pgf at circ@res at left,y=0.45\pgf at circ@res at up]{\textsf{\texti}}
+ \pgftext[center,x=0.45\pgf at circ@res at right,y=0.45\pgf at circ@res at down]{\textsf{\textii}}
+}
+
+%% DSP
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/dsp/width}}
+{dsp}
+{\ctikzvalof{bipoles/dsp/width}}
+{\ctikzvalof{bipoles/dsp/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/dsp/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\textsf{DSP}}
+}
+
+%% FFT
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/fft/width}}
+{fft}
+{\ctikzvalof{bipoles/fft/width}}
+{\ctikzvalof{bipoles/fft/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/fft/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgftext[center,x=0,y=0]{\textsf{FFT}}
+}
+
+%% Amplifier
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{
+ \ifpgf at circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{amp}
+{
+ \ifpgf at circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{
+ \ifpgf at circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/amp/width}\pgf at circ@scaled at Rlen
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \ifpgf at circuit@boxed
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfnode{blockbox}{center}{}{pgf at box}{\pgfusepath{draw}}
+ \pgf at circ@draworfill
+ \fi
+
+ % draw input arrow
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ \ifpgf at circuit@boxed
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
+ \pgf at circ@res at step=.7\pgf at circ@res at step % scale amp symbol when inside a box
+ \else
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+
+ \pgfsetarrows{} %never draw arrows
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0.55\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{0}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{0.55\pgf at circ@res at step}}
+
+ \pgfpathclose
+ \pgf at circ@draworfill
+
+ % draw inner text
+ \pgftext[center,x=0.12\pgf at circ@res at step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+}
+
+
+%% variable amplifier
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{
+ \ifpgf at circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{vamp}
+{
+ \ifpgf at circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{
+ \ifpgf at circuit@boxed
+ \ctikzvalof{bipoles/twoport/width}
+ \else
+ \ctikzvalof{bipoles/amp/width}
+ \fi
+}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/amp/width}\pgf at circ@scaled at Rlen
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \ifpgf at circuit@boxed
+ \pgfnode{blockbox}{center}{}{pgf at box}{\pgfusepath{draw}}
+ \fi
+
+ % draw input arrow
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ \ifpgf at circuit@boxed
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetdash{}{0pt} % draw solid line for inner symbol if no box is drawn
+ \pgf at circ@res at step=.7\pgf at circ@res at step % scale amp symbol when inside a box
+ \else
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \fi
+
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{} %never draw arrows
+
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at step}{0.55\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{0}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at step}{0.55\pgf at circ@res at step}}
+
+ \pgfpathclose
+ \pgf at circ@draworfill
+
+ % draw inner text
+ \pgftext[center,x=0.12\pgf at circ@res at step,y=0]{\ctikzvalof{bipoles/twoport/text}}
+
+ % draw arrow
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.8\pgf at circ@res at step}{0.5\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at step}{0.6\pgf at circ@res at step}}
+ \pgfusepath{draw}
+}
+
+%% pi attenuator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/piattenuator/width}}
+{piattenuator}
+{\ctikzvalof{bipoles/piattenuator/width}}
+{\ctikzvalof{bipoles/piattenuator/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/piattenuator/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at left}{0.4\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at right}{0.4\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
+ \pgfusepath{draw}
+}
+
+%% variable pi attenuator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/vpiattenuator/width}}
+{vpiattenuator}
+{\ctikzvalof{bipoles/vpiattenuator/width}}
+{\ctikzvalof{bipoles/vpiattenuator/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/vpiattenuator/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at left}{0.4\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.4\pgf at circ@res at right}{0.4\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
+ \pgfusepath{draw}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf at circ@res at left}{0.5\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
+ \pgfusepath{draw}
+}
+
+%% T attenuator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/tattenuator/width}}
+{tattenuator}
+{\ctikzvalof{bipoles/tattenuator/width}}
+{\ctikzvalof{bipoles/tattenuator/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/tattenuator/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
+ \pgfusepath{draw}
+}
+
+%% variable T attenuator
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/vtattenuator/width}}
+{vtattenuator}
+{\ctikzvalof{bipoles/vtattenuator/width}}
+{\ctikzvalof{bipoles/vtattenuator/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/vtattenuator/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % draw inner symbol
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{} %never draw arrows
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0pt}{0.4\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0pt}{0.4\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{0.6\pgf at circ@res at left}{0.4\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.6\pgf at circ@res at right}{0.4\pgf at circ@res at up}}
+ \pgfusepath{draw}
+
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.7\pgf at circ@res at left}{0.5\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf at circ@res at right}{0.8\pgf at circ@res at up}}
+ \pgfusepath{draw}
+}
+
+%% phase shifter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{phaseshifter}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/phaseshifter/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % inner symbol
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+}
+
+%% variable phase shifter
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/phaseshifter/width}}
+{vphaseshifter}
+{\ctikzvalof{bipoles/vphaseshifter/width}}
+{\ctikzvalof{bipoles/vphaseshifter/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/vphaseshifter/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % rotate inner symbol
+ \def\pgfcircmathresult{\expandafter\pgf at circ@stripdecimals\pgf at circ@direction\pgf at nil}
+ \ifnum \pgfcircmathresult > 45 \ifnum \pgfcircmathresult < 135
+ \pgftransformrotate{270}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 135 \ifnum \pgfcircmathresult < 225
+ \pgftransformrotate{180}
+ \fi\fi
+ \ifnum \pgfcircmathresult > 225 \ifnum \pgfcircmathresult < 315
+ \pgftransformrotate{90}
+ \fi\fi
+
+ % inner symbol
+ \pgftext[center,x=0,y=0]{\Large$\varphi$}
+
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfsetarrowsend{latex}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf at circ@res at left}{0.65\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0.7\pgf at circ@res at right}{0.65\pgf at circ@res at up}}
+ \pgfusepath{draw}
+}
+
+%% detector
+\pgfcircdeclarebipolescaled{blocks}
+{}
+{\ctikzvalof{bipoles/detector/width}}
+{detector}
+{\ctikzvalof{bipoles/detector/width}}
+{\ctikzvalof{bipoles/detector/width}}
+{
+ \pgf at circ@res at step = \ctikzvalof{bipoles/detector/width}\pgf at circ@scaled at Rlen
+ \divide \pgf at circ@res at step by 2
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \ifpgf at circuit@dashed
+ \pgfsetdash{{0.1cm}{0.1cm}}{0cm}
+ \fi
+
+ % draw outer box
+ \pgf at circ@twoportbox
+
+ \ifpgf at circuit@inputarrow
+ {
+ \advance \pgf at circ@res at left by .5\ctikzvalof{bipoles/thickness}\pgfstartlinewidth
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{inputarrow}{tip}{}{pgf at inputarrow}{\pgfusepath{fill}}
+ }
+ \fi
+
+ % draw inner stuff
+ \pgfsetdash{}{0pt} % always draw solid line for inner symbol
+ \pgfsetarrows{} %never draw arrows
+ \pgfsetlinewidth{0.8\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0.75\pgf at circ@res at left}{0}}
+ \pgfpathlineto{\pgfpoint{0.75\pgf at circ@res at right}{0}}
+ \pgfusepath{draw}
+
+ \ifpgf at circuit@fulldiode
+ \pgfmathparse{2\pgf at circ@res at up / \pgf at circ@scaled at Rlen / \ctikzvalof{bipoles/generic/width}}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{fulldiodeshape}{center}{}{pgf at fulldiode}{\pgfusepath{fill}}
+ \else
+ \pgfmathparse{2\pgf at circ@res at up / \pgf at circ@scaled at Rlen / \ctikzvalof{bipoles/resistor/width}}
+ \pgftransformscale{\pgfmathresult}
+ \pgfnode{emptydiodeshape}{center}{}{pgf at emptydiode}{\pgfusepath{fill}}
+ \fi
+
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%
+%% MECHANICAL SYMBOLS
+%%%%%%%%%%%%%%%%%%%%%%%
+
+%% mechanical capacitance  stiffness/spring
+
+\pgfcircdeclarebipolescaled{mechanicals}
+{}
+{\ctikzvalof{bipoles/spring/height}}
+{spring}
+{\ctikzvalof{bipoles/spring/height}}
+{\ctikzvalof{bipoles/spring/width}}{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+
+ \pgfmathsetlength{\pgf at circ@res at step}
+ {(\ctikzvalof{bipoles/spring/width}*\pgf at circ@scaled at Rlen+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth)/16}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf at circ@res at zero}}
+ \pgfsetcornersarced{\pgfpoint{.5\pgf at circ@res at up}{.5\pgf at circ@res at up}}
+ \pgf at circ@res at other = \pgf at circ@res at left
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+ \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+ \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+ \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+ \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+ \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+ \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+ \advance\pgf at circ@res at other by 2\pgf at circ@res at step
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at zero}}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
+ \pgfusepath{stroke}
+}
+
+%% mechanical inductance  mass
+\pgfcircdeclarebipolescaled{mechanicals}
+{}
+{\ctikzvalof{bipoles/mass/box height}}
+{mass}
+{\ctikzvalof{bipoles/mass/height}}
+{\ctikzvalof{bipoles/mass/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgftransformationadjustments
+ \pgfpathrectangle{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+ {\pgfpoint{2\pgf at circ@res at down}{2\pgf at circ@res at down}}
+ \pgf at circ@draworfill
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+}
+
+%% mechanical resistor  damper
+\pgfcircdeclarebipolescaled{mechanicals}
+{}
+{\ctikzvalof{bipoles/damper/height}}
+{damper}
+{\ctikzvalof{bipoles/damper/height}}
+{\ctikzvalof{bipoles/damper/width}}
+{
+ \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgf at circ@maybefill
+
+ % line into the damper
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
+ {\pgf at circ@res at zero}}
+ \pgfusepath{stroke}
+
+ % damper box
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+
+ % damper vertical element
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
+ {.8\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
+ {.8\pgf at circ@res at up}}
+ \pgfsetbuttcap
+ \pgfusepath{stroke}
+
+}
+%% mechanical viscoelastic element, suggested by @alex
+%% in https://tex.stackexchange.com/questions/484268/combinedspringdamperincircuitikz
+\pgfcircdeclarebipolescaled{mechanicals}
+{} % extra anchors
+{\ctikzvalof{bipoles/damper/height}} % depth (under the path line)
+{viscoe} % name
+{\ctikzvalof{bipoles/damper/height}} % height (above the path line)
+{\ctikzvalof{bipoles/damper/width}} % width
+{ % draw the bipole
+ \pgfpathrectanglecorners{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}{\pgf at circ@res at down}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgf at circ@maybefill
+
+ % spring into the damper
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfsetcornersarced{\pgfpoint{.25\pgf at circ@res at up}{.25\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.75\pgf at circ@res at left}{.75\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.5\pgf at circ@res at left}{.75\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.25\pgf at circ@res at left}{.75\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0pt}{.75\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}{.75\pgf at circ@res at up}}
+ \pgfusepath{stroke}
+ \endpgfscope
+ % damper box
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+
+ \pgfsetrectcap
+ \pgfsetmiterjoin
+ \pgfusepath{stroke}
+
+ % damper vertical element
+ \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
+ {.8\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf at circ@res at right}
+ {.8\pgf at circ@res at up}}
+ \pgfsetbuttcap
+ \pgfusepath{stroke}
+
+}
+
+%%%%%%%%%%%%%%%%
+%% Crossing
+%%%%%%%%%%%%%%%%
+
+%% crossing bipole (but see also nodes)
+\pgfcircdeclarebipole
+{}
+{\ctikzvalof{bipoles/crossing/size}}
+{crossing}
+{\ctikzvalof{bipoles/crossing/size}}
+{\ctikzvalof{bipoles/crossing/size}}{
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpatharc{0}{180}{0.4*\pgf at circ@res at left}
+ \pgfsetbeveljoin
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Miscellaneous bipoles
+%%%%%%%%%%%%%%%%%%%%%%%%%
+
+%% loudspeaker and microphone
+
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/loudspeaker/depth}}
+{loudspeaker}
+{\ctikzvalof{bipoles/loudspeaker/height}}
+{\ctikzvalof{bipoles/loudspeaker/width}}{
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{.4\pgf at circ@res at up}}
+ {\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathmoveto{\pgfpoint{0.5\pgf at circ@res at left}{.4\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.8\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.8\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.5\pgf at circ@res at right}{.4\pgf at circ@res at up}}
+ \pgfpathclose
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf at circ@draworfill
+}
+
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/mic/depth}}
+{mic}
+{\ctikzvalof{bipoles/mic/height}}
+{\ctikzvalof{bipoles/mic/width}}{
+
+ \pgfscope
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpoint{0pt}{.6\pgf at circ@res at up}}{.4\pgf at circ@res at up}
+ \pgf at circ@draworfill
+ \pgfpathmoveto{\pgfpoint{.6\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.6\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ \pgfscope
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{.2\pgf at circ@res at up}{0pt}}
+ % 0.25358 is 0.60.4*cos(30)
+ \pgfpathlineto{\pgfpoint{.2\pgf at circ@res at up}{.25358\pgf at circ@res at up}}
+ \pgfpathmoveto{\pgfpoint{.2\pgf at circ@res at up}{.25358\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.2\pgf at circ@res at up}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+ \pgfusepath{draw}
+
+ \pgfusepath{draw}
+ \endpgfscope
+}
+
+%% european gas filled surge arrester
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/european gas filled surge arrester/height}}
+{european gas filled surge arrester}
+{\ctikzvalof{bipoles/european gas filled surge arrester/height}}
+{\ctikzvalof{bipoles/european gas filled surge arrester/width}}
+{
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf at circ@draworfill
+
+ \pgfscope
+ \pgfsetarrowsend{latexslim}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/european gas filled surge arrester/inside}\pgf at circ@res at left}{0pt}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfusepath{draw}
+
+ \endpgfscope
+}
+
+%% american gas filled surge arrester
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/american gas filled surge arrester/height}}
+{american gas filled surge arrester}
+{\ctikzvalof{bipoles/american gas filled surge arrester/height}}
+{\ctikzvalof{bipoles/american gas filled surge arrester/width}}{
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpointorigin \pgf at circ@res at other = \pgf at x \advance \pgf at circ@res at other by \pgf at circ@res at up
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at zero}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathcircle{\pgfpointorigin}{.9\pgf at circ@res at up}
+ \pgf at circ@draworfill
+ \endpgfscope
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfsetarrowsend{latex}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/inside}\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfusepath{draw}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/inside}\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfusepath{draw}
+ \endpgfscope{}
+
+ \pgfcircle{\pgfpoint{\ctikzvalof{bipoles/american gas filled surge arrester/dot x}\pgf at circ@res at left}{\ctikzvalof{bipoles/american gas filled surge arrester/dot y}\pgf at circ@res at down}}{\ctikzvalof{bipoles/american gas filled surge arrester/size}\pgf at circ@res at down}
+ \pgfusepath{fill}
+}
+
+%% thermocouple
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/thermocouple/height 2}}
+{thermocouple}
+{\ctikzvalof{bipoles/thermocouple/height}}
+{\ctikzvalof{bipoles/thermocouple/width}}
+{
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at left}{.5\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{.5\pgf at circ@res at down}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathlineto{\pgfpoint{0}{\pgf at circ@res at down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{.5\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
+ \pgfusepath{draw}
+}
+
+%% fuse
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/fuse/height}}
+{fuse}
+{\ctikzvalof{bipoles/fuse/height}}
+{\ctikzvalof{bipoles/fuse/width}}
+{
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
+ \pgfusepath{draw}
+
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgf at circ@draworfill
+}
+
+%% asymmetric fuse
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/afuse/height}}
+{afuse}
+{\ctikzvalof{bipoles/afuse/height}}
+{\ctikzvalof{bipoles/afuse/width}}
+{
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{0}}
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgfpathrectanglecorners{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf at circ@draworfill
+ \endpgfscope
+
+ \pgfpathrectanglecorners{\pgfpoint{.7\pgf at circ@res at right}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfusepath{stroke,fill}
+}
+
+%% SQUID added by Cor Molenaar 5 March 2010
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/squid/height}}
+{squid}
+{\ctikzvalof{bipoles/squid/height}}
+{\ctikzvalof{bipoles/squid/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{1.35*\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{0.65*\pgf at circ@res at up}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{0.65*\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{1.35*\pgf at circ@res at up}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{1.35*\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{0.65*\pgf at circ@res at down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{0.65*\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{1.35*\pgf at circ@res at down}}
+
+ \pgfusepath{draw}
+}
+
+% Generic barrier added by Cor Molenaar 5 March 2010
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/barrier/height}}
+{barrier}
+{\ctikzvalof{bipoles/barrier/height}}
+{\ctikzvalof{bipoles/barrier/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at step}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at step}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{0.35*\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{0.35*\pgf at circ@res at down}}
+ \pgfpathmoveto{\pgfpoint{0.35*\pgf at circ@res at left}{0.35*\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{0.35*\pgf at circ@res at right}{0.35*\pgf at circ@res at up}}
+
+ \pgfusepath{draw}
+}
+
+%% Lamp
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/lamp/height}}
+{lamp}
+{\ctikzvalof{bipoles/lamp/height}}
+{\ctikzvalof{bipoles/lamp/width}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf at circ@res at up}}{\pgfpoint{\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+ \pgfpathmoveto{\pgfpoint{.7071*\pgf at circ@res at left}{.7071*\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{.7071*\pgf at circ@res at right}{.7071*\pgf at circ@res at down}}
+ \pgfpathmoveto{\pgfpoint{.7071*\pgf at circ@res at left}{.7071*\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{.7071*\pgf at circ@res at right}{.7071*\pgf at circ@res at up}}
+ \pgfusepath{draw}
+}
+
+%% bulb
+\pgfcircdeclarebipolescaled{misc}
+{}
+{\ctikzvalof{bipoles/bulb/height}}
+{bulb}
+{\ctikzvalof{bipoles/bulb/height}}
+{\ctikzvalof{bipoles/bulb/width}}
+{%
+ \pgf at circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{0.8\pgf at circ@res at up}}{\pgfpoint{0.8\pgf at circ@res at left}{0}}
+ \pgf at circ@draworfill
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf at circ@res at left}{\pgf at circ@res at zero}}
+ \pgfpatharc{0}{180}{0.4*\pgf at circ@res at left}
+ \pgfsetbeveljoin
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at zero}}
+ \pgfusepath{draw}
+}
+
+
+% end of pgfcircbipoles.tex
+%%% close: tex/pgfcircbipoles
+%%%%%%%%%%% Springe nach tex/pgfcirctripoles
+%%% open: tex/pgfcirctripoles.tex
+% Copyright 20072009 by Massimo Redaelli
+%
+% This file may be distributed and/or modified
+%
+% 1. under the LaTeX Project Public License and/or
+% 2. under the GNU Public License.
+%
+% See the files gpl3.0_license.txt and lppl13c_license.txt for more details.
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%% Tripoles
+
+%%%%%%%%%%%%%
+%% switches
+%%%%%%%%%%%%%
+
+% Legacy spdt
+\pgfdeclareshape{spdt}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at y=\ctikzvalof{tripoles/spdt/height}\pgf at circ@scaled at Rlen
+ \pgf at y=.5\pgf at y
+ \pgf at x=\ctikzvalof{tripoles/spdt/width}\pgf at circ@scaled at Rlen
+ \pgf at x=.5\pgf at x
+ }
+ \anchor{left}{%
+ \northwest
+ \pgf at y=0pt
+ }
+ \anchor{in}{
+ \northwest
+ \pgf at y=0pt
+ }
+ \anchor{out 1}{
+ \northwest
+ \pgf at x=\pgf at x
+ }
+ \anchor{out 2}{
+ \northwest
+ \pgf at x=\pgf at x
+ \pgf at y=\pgf at y
+ }
+ \anchor{center}{
+ \pgf at y=0pt
+ \pgf at x=0pt
+ }
+ \anchor{east}{
+ \northwest
+ \pgf at y=0pt
+ \pgf at x=\pgf at x
+ }
+ \anchor{west}{
+ \northwest
+ \pgf at y=0pt
+ }
+ \anchor{south}{
+ \northwest
+ \pgf at x=0pt
+ \pgf at y=\pgf at y
+ }
+ \anchor{north}{
+ \northwest
+ \pgf at x=0pt
+ }
+ \anchor{south west}{
+ \northwest
+ \pgf at y=\pgf at y
+ }
+ \anchor{north east}{
+ \northwest
+ \pgf at x=\pgf at x
+ }
+ \anchor{north west}{
+ \northwest
+ }
+ \anchor{south east}{
+ \northwest
+ \pgf at x=\pgf at x
+ \pgf at y=\pgf at y
+ }
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+
+ \northwest
+ \pgf at circ@res at up = \pgf at y
+ \pgf at circ@res at down = \pgf at y
+ \pgf at circ@res at right = \pgf at x
+ \pgf at circ@res at left = \pgf at x
+ \pgf at circ@res at other = \ctikzvalof{tripoles/spdt/margin}\pgf at circ@res at left
+
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+ \pgfnode{ocirc}{center}{}{spdt1}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at other}{0pt}}
+ \pgfnode{ocirc}{center}{}{spdt2}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ \pgfscope
+ \pgfpathmoveto{\pgfpointshapeborder{spdt2}{\pgfpointorigin}}
+ \pgfpathlineto{
+ \pgfpointadd{\pgfpointshapeborder{spdt1}{\pgfpoint{\pgf at circ@res at other}{100pt}}}
+ {\pgfpoint{.05\pgf at circ@res at up}{.05\pgf at circ@res at up}}
+ }
+ \pgf at circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfusepath{draw}
+ \endpgfscope
+ }
+}
+
+
+% cute switch "node" shapes, matching with cute "to" shapes
+% #1 > name
+% #2 > barposition
+% #3 > arrowcode
+\long\def\pgfcircdeclarecutespdt#1#2#3{
+ \pgfdeclareshape{#1}
+ {
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \savedanchor\northwest{%
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at y=\ctikzvalof{bipoles/cuteswitch/height}\pgf at circ@scaled at Rlen
+ \pgf at y=.5\pgf at y
+ \pgf at x=\ctikzvalof{tripoles/spdt/width}\pgf at circ@scaled at Rlen
+ \pgf at x=.25\pgf at x
+ }
+ \savedanchor\midlever{
+ % these values are calculated when we create the definition of the shape.
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at y=\ctikzvalof{bipoles/cuteswitch/height}\pgf at circ@scaled at Rlen
+ \pgf at circ@res at temp=\ctikzvalof{nodes width}\pgf at circ@scaled at Rlen
+ \pgf at circ@res at temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf at circ@res at temp
+ \pgf at circ@res at down = .5\pgf at y
+ \pgf at circ@res at up = .5\pgf at y
+ \pgfextracty{\pgf at circ@res at other}{#2}
+ \pgf at x=0pt
+ \pgf at y=.5\pgf at circ@res at other
+ }
+ % radius of the connector
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \saveddimen{\radius}{\pgfmathsetlength\pgf at x{\pgf at circ@Rlen*\ctikzvalof{nodes width}}}
+ % shapename
+ \savedmacro{\thisshape}{\def\thisshape{\tikz at fig@name}}
+ % shape type
+ \savedmacro{\cshape}{\def\cshape{\ctikzvalof{bipoles/cuteswitch/shape}}}
+ % mid of the lever, to stack switches
+ \anchor{mid}{\midlever}
+ % center anchors
+ \anchor{cin}{ \northwest \pgf at y=0pt}
+ \anchor{cout 1}{ \northwest \pgf at x=\pgf at x }
+ \anchor{cout 2}{ \northwest \pgf at x=\pgf at x \pgf at y=\pgf at y }
+ % horizontal angles
+ \anchor{in}{ \northwest \pgf at y=0pt\advance\pgf at x by \radius}
+ \anchor{out 1}{ \northwest \pgf at x=\pgf at x \advance\pgf at x by \radius}
+ \anchor{out 2}{ \northwest \pgf at x=\pgf at x \advance\pgf at x by \radius \pgf at y=\pgf at y }
+
+ \anchor{center}{ \pgf at y=0pt \pgf at x=0pt }
+ \anchor{east}{ \northwest \pgf at y=0pt \pgf at x=\pgf at x }
+ \anchor{west}{ \northwest \pgf at y=0pt }
+ \anchor{south}{ \northwest \pgf at x=0pt \pgf at y=\pgf at y }
+ \anchor{north}{ \northwest \pgf at x=0pt }
+ \anchor{south west}{ \northwest \pgf at y=\pgf at y }
+ \anchor{north east}{ \northwest \pgf at x=\pgf at x }
+ \anchor{north west}{ \northwest }
+ \anchor{south east}{ \northwest \pgf at x=\pgf at x \pgf at y=\pgf at y }
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ \northwest
+ \pgf at circ@res at up = \pgf at y
+ \pgf at circ@res at down = \pgf at y
+ \pgf at circ@res at right = \pgf at x
+ \pgf at circ@res at left = \pgf at x
+
+ \pgfscope
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ \pgf at circ@res at temp=\radius\relax
+ \pgf at circ@res at temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf at circ@res at temp
+ \pgfsetlinewidth{2\pgf at circ@res at temp}
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfpathlineto{#2}
+ \pgfsetroundcap\pgfusepath{draw}
+ \endpgfscope
+ \pgfscope % arrow
+ #3
+ \endpgfscope
+ % terminals
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \pgfnode{\cshape}{center}{}{\thisshapeout 1}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \pgfnode{\cshape}{center}{}{\thisshapeout 2}{\pgfusepath{stroke}}
+ \endpgfscope
+ \pgfscope
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}}
+ \pgfnode{\cshape}{center}{}{\thisshapein}{\pgfusepath{stroke}}
+ \endpgfscope
+
+ }
+ }
+}
+
+\pgfcircdeclarecutespdt{cute spdt up}
+{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up1.5\pgf at circ@res at temp}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt mid}
+{\pgfpoint{\pgf at circ@res at right}{0pt}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt down}
+{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down+1.5\pgf at circ@res at temp}}
+{}
+
+\pgfcircdeclarecutespdt{cute spdt up arrow}
+{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up1.5\pgf at circ@res at temp}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{70}{1.5\pgf at circ@res at right}}
+ \pgfpatharc{70}{50}{1.5\pgf at circ@res at right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+}
+
+\pgfcircdeclarecutespdt{cute spdt mid arrow}
+{\pgfpoint{\pgf at circ@res at right}{0pt}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}} % in node
+ \pgfsetarrowsstart{latexslim}
+ \pgfpathmoveto{\pgfpointpolar{60}{1.5\pgf at circ@res at right}}
+ \pgfpatharc{60}{60}{1.5\pgf at circ@res at right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+}
+
+\pgfcircdeclarecutespdt{cute spdt down arrow}
+{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down+1.5\pgf at circ@res at temp}}
+{
+ \pgf at circ@setlinewidth{bipoles}{\pgflinewidth}
+ \pgftransformshift{\pgfpoint{\pgf at circ@res at left}{0pt}} % in node
+ \pgfpathmoveto{\pgfpointpolar{50}{1.5\pgf at circ@res at right}}
+ \pgfpatharc{50}{70}{1.5\pgf at circ@res at right}
+ \pgfsetarrowsend{latexslim}
+ \pgfusepath{draw}
+}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%%
+%% Logic ports
+%%
+%% Code from John Kormylo at tex.stackexchange.com
+%% See https://tex.stackexchange.com/questions/372993/isitpossibletoimplementmultipleinputlogicportswithcircuitikz
+%% Integration and fixes from Romano Giannetti and TheTeXnician <38565529+TheTeXnician at users.noreply.github.com>
+%%
+
+\newcount\pgf at circ@res at count% reserve global register
+
+\def\pgf at circ@logicport at input#1% #1 = \pgfmathcounter
+{%
+ \pgfextracty{\pgf at circ@res at up}{\northeast}%
+ \step
+ \pgf at circ@res at step=\dimexpr 2\pgf at y 2\pgf at circ@res at up\relax
+ \advance\pgf at y by #1\pgf at circ@res at step\relax
+}%
+
+% #1 = \pgfmathcounter #2=type #3 specificic port
+% type is 1 for and,nand; 2 for or,nor; 3 for xor,xnor, 4 for european.
+\def\pgf at circ@logicport at baseinput#1#2#3%
+{%
+ % and and nand
+ \ifnum #2=1\relax
+ \pgfextracty{\pgf at circ@res at up}{\northeast}%
+ \pgfextractx{\pgf at circ@res at left}{\southwest}%
+ \step
+ \pgf at circ@res at step=\dimexpr 2\pgf at y 2\pgf at circ@res at up\relax
+ \advance\pgf at y by #1\pgf at circ@res at step\relax
+ \pgf at x=\ctikzvalof{tripoles/american #3 port/port width}\pgf at circ@res at left
+ \fi
+ % or and nor
+ \ifnum #2=2\relax
+ \pgfextracty{\pgf at circ@res at up}{\northeast}%
+ \pgfextractx{\pgf at circ@res at left}{\southwest}%
+ \pgfextractx{\pgf at circ@res at right}{\northeast}%
+ \step
+ \pgf at circ@res at step=\dimexpr 2\pgf at y 2\pgf at circ@res at up\relax
+ \advance\pgf at y by #1\pgf at circ@res at step\relax
+ \edef\pgf at circ@math at angle{\ctikzvalof{tripoles/american #3 port/angle}}%
+ \pgf at circ@res at other=\ctikzvalof{tripoles/american #3 port/inner}\pgf at circ@res at right
+ \pgfmathsetlengthmacro{\pgf at circ@math at xradius}{\pgf at circ@res at other /(1  cos(\pgf at circ@math at angle)}%
+ \pgfmathsetlengthmacro{\pgf at circ@math at yradius}{\pgf at circ@res at up /sin(\pgf at circ@math at angle)}%
+ \pgf at circ@res at other=\ctikzvalof{tripoles/american #3 port/port width}\pgf at circ@res at right
+ \pgfmathsetlengthmacro{\pgf at circ@math at xorigin}{\pgf at circ@res at other + \pgf at circ@math at xradius*cos(\pgf at circ@math at angle)}%
+ \pgf at circ@res at temp=\pgf at y
+ \pgfmathsetmacro{\pgf at circ@math at angle}{asin(\pgf at circ@res at temp/\pgf at circ@math at yradius)}%
+ \pgfmathsetlength{\pgf at circ@res at other}{\pgf at circ@math at xradius*cos(\pgf at circ@math at angle)\pgf at circ@math at xorigin}%
+ \pgf at x=\pgf at circ@res at other
+ \fi
+ % xor and xnor
+ \ifnum #2=3\relax
+ \pgfextracty{\pgf at circ@res at up}{\northeast}%
+ \pgfextractx{\pgf at circ@res at left}{\southwest}%
+ \pgfextractx{\pgf at circ@res at right}{\northeast}%
+ \pgfkeysgetvalue{/tikz/circuitikz/tripoles/american #3 port/angle}{\pgf at circ@math at angle}%
+ \pgf at circ@res at other=\ctikzvalof{tripoles/american #3 port/inner}\pgf at circ@res at right
+ \pgfmathsetlengthmacro{\pgf at circ@math at xradius}{\pgf at circ@res at other /(1  cos(\pgf at circ@math at angle)}%
+ \pgfmathsetlengthmacro{\pgf at circ@math at yradius}{\pgf at circ@res at up / sin(\pgf at circ@math at angle))}%
+ \pgf at circ@res at other=\ctikzvalof{tripoles/american #3 port/port width}\pgf at circ@res at right
+ \pgfmathsetlengthmacro{\pgf at circ@math at xorigin}{\pgf at circ@res at other + \pgf at circ@math at xradius*cos(\pgf at circ@math at angle)}%
+ \pgf at circ@res at temp=\ctikzvalof{tripoles/american #3 port/distance}\pgf at circ@res at right
+ \pgfmathsetlengthmacro{\pgf at circ@math at distance}{\pgf at circ@res at temp}
+ % this compensates for the effect of the line width on the gap between the arcs
+ \pgfmathsetlengthmacro{\pgf at circ@math at yradiusA}{\pgf at circ@math at yradius 2\pgflinewidth}%
+ \pgfmathsetlengthmacro{\pgf at circ@math at xradiusA}{\pgf at circ@math at xradius 2\pgflinewidth}%
+
+ \step
+ \pgf at circ@res at step=\dimexpr 2\pgf at y 2\pgf at circ@res at up\relax
+ \advance\pgf at y by #1\pgf at circ@res at step\relax
+ \pgf at circ@res at temp=\pgf at y
+ \pgfmathsetmacro{\pgf at circ@math at angle}{asin(\pgf at circ@res at temp / \pgf at circ@math at yradiusA)}%
+ \pgfmathsetlength{\pgf at circ@res at other}{\pgf at circ@math at xradiusA*cos(\pgf at circ@math at angle)\pgf at circ@math at xorigin}%
+ \advance\pgf at circ@res at other by \pgf at circ@math at distance
+ \pgf at x=\pgf at circ@res at other
+ \fi
+ % european
+ \ifnum #2=4\relax
+ \pgfextracty{\pgf at circ@res at up}{\northeast}%
+ \pgfextractx{\pgf at circ@res at other}{\left}%
+ \step
+ \pgf at circ@res at step=\dimexpr 2\pgf at y 2\pgf at circ@res at up\relax
+ \advance\pgf at y by #1\pgf at circ@res at step\relax
+ \pgf at x=\pgf at circ@res at other
+ \fi
+}%
+
+%%% american
+\long\def\pgfcircdeclarelogicport#1#2#3{%
+ \pgfdeclareshape{american #1 port}%
+ {%
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{logic ports}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf at x}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}}
+ \savedmacro\resize{% automatic
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at up = \ctikzvalof{tripoles/american #1 port/height}\pgf at circ@scaled at Rlen
+ \pgf at circ@res at up = .5\pgf at circ@res at up
+ \pgf at circ@res at down = \pgf at circ@res at up
+ \pgf at circ@res at right = \ctikzvalof{tripoles/american #1 port/width}\pgf at circ@scaled at Rlen
+ \pgf at circ@res at right = .5\pgf at circ@res at right
+ \pgf at circ@res at left = \pgf at circ@res at right
+ }%
+ \savedmacro\inputs{% get number of inputs
+ \pgf at circ@res at count=\pgfkeysvalueof{/tikz/number inputs}\relax%
+ \ifnum\pgf at circ@res at count=0
+ \pgf at circ@res at count=\ctikzvalof{tripoles/american #1 port/inputs}\relax%
+ \fi
+ \ifnum\pgf at circ@res at count<2 \pgf at circ@res at count=2\fi
+ \ifnum\pgf at circ@res at count>16 \pgf at circ@res at count=16\fi
+ \def\inputs{\the\pgf at circ@res at count}%
+ }%
+ \savedanchor\step{% 1/2 gap at edges
+ \pgfmathsetlength{\pgf at circ@scaled at Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf at circ@Rlen}
+ \pgf at circ@res at step = \ctikzvalof{tripoles/american #1 port/height}\pgf at circ@scaled at Rlen
+ \divide\pgf at circ@res at step by \pgf at circ@res at count
+ \pgfpoint{\pgf at circ@res at left}{\dimexpr\pgf at circ@res at up+0.5\pgf at circ@res at step}%
+ }%
+ \savedanchor\northeast{\pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at up}}
+ \savedanchor\southwest{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at down}}
+ \savedanchor\left{\pgfpoint{\ctikzvalof{tripoles/american #1 port/port width}\pgf at circ@res at left}{0pt}}
+ \savedanchor\right{\pgfpoint{\ctikzvalof{tripoles/american #1 port/port width}\pgf at circ@res at right}{0pt}}
+ \savedanchor\origin{\pgfpoint{\ctikzvalof{tripoles/american #1 port/origin}\pgf at circ@res at right}{0pt}}
+
+ \anchor{center}{\origin}% for backwards compatibility
+ \anchor{text}{\pgfpoint{.5\wd\pgfnodeparttextbox}{\dimexpr.5\dp\pgfnodeparttextbox.5\ht\pgfnodeparttextbox}}
+
+ % create input anchors
+ \expandafter\pgfutil at g@addto at macro\csname pgf at sh@s at american #1 port\endcsname{%
+ \pgfmathloop%
+ \ifnum\pgfmathcounter>\pgf at circ@res at count%
+ \else%
+ %\pgfutil at ifundefined{pgf at anchor@american #1 port at in \pgfmathcounter}{%
+ \expandafter\xdef\csname pgf at anchor@american #1 port at in \pgfmathcounter\endcsname{%
+ \noexpand\pgf at circ@logicport at input{\pgfmathcounter}% defined above
+ }%
+ \expandafter\xdef\csname pgf at anchor@american #1 port at bin \pgfmathcounter\endcsname{%
+ \noexpand\pgf at circ@logicport at baseinput{\pgfmathcounter}{#2}{#1}% defined above
+ }%
+ %}{}%
+ \repeatpgfmathloop%
+ }
+
+ \anchor{out}{\northeast\pgf at y=0pt}
+ \anchor{bout}{\right\pgf at y=0pt}
+
+
+ \anchor{left}{\left}% edges of component mius leads
+ \anchor{right}{\right}
+
+ \anchor{north east}{\northeast}% see \Compass macro
+ \anchor{south west}{\southwest}
+ \anchor{north}{\pgfextracty{\pgf at circ@res at up}{\northeast}%
+ \pgfpoint{0cm}{\pgf at circ@res at up}}
+ \anchor{north west}{\pgfextracty{\pgf at circ@res at up}{\northeast}%
+ \pgfextractx{\pgf at circ@res at left}{\southwest}%
+ \pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at up}}
+ \anchor{west}{\pgfextractx{\pgf at circ@res at left}{\southwest}%
+ \pgfpoint{\pgf at circ@res at left}{0cm}}
+ \anchor{south}{\pgfextracty{\pgf at circ@res at down}{\southwest}%
+ \pgfpoint{0cm}{\pgf at circ@res at down}}
+ \anchor{south east}{\pgfextracty{\pgf at circ@res at down}{\southwest}%
+ \pgfextractx{\pgf at circ@res at right}{\northeast}%
+ \pgfpoint{\pgf at circ@res at right}{\pgf at circ@res at down}}
+ \anchor{east}{\pgfextractx{\pgf at circ@res at right}{\northeast}%
+ \pgfpoint{\pgf at circ@res at right}{0cm}}
+
+ \backgroundpath{
+ \pgfsetcolor{\ctikzvalof{color}}
+ #3
+ }
+}
+}
+%%% american and %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{and}{1}{
+ \pgfextracty{\pgf at circ@res at temp}{\step}%
+ \pgf at circ@res at step = \dimexpr 2\pgf at circ@res at temp 2\pgf at circ@res at up\relax
+ \pgf at circ@res at count = \inputs\relax
+ \loop\ifnum\pgf at circ@res at count>0
+ \advance\pgf at circ@res at temp by \pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp}}%
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/american and port/port width}\pgf at circ@res at left}
+ {\pgf at circ@res at temp}}
+ \advance\pgf at circ@res at count by 1
+ \repeat
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/american and port/port width}\pgf at circ@res at right}
+ {0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf at circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgf at circ@res at other=\ctikzvalof{tripoles/american and port/port width}\pgf at circ@res at left
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+ \pgfpatharc{90}{90}{2\pgf at circ@res at other and \pgf at circ@res at up}
+ \pgfpathclose
+ \pgf at circ@draworfill
+ }
+%%% american nand %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \pgfcircdeclarelogicport{nand}{1}{
+ \pgfextracty{\pgf at circ@res at temp}{\step}%
+ \pgf at circ@res at step = \dimexpr 2\pgf at circ@res at temp 2\pgf at circ@res at up\relax
+ \pgf at circ@res at count = \inputs\relax
+ \loop\ifnum\pgf at circ@res at count>0
+ \advance\pgf at circ@res at temp by \pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp}}%
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/american nand port/port width}\pgf at circ@res at left}
+ {\pgf at circ@res at temp}}
+ \advance\pgf at circ@res at count by 1
+ \repeat
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+ \pgfpathlineto{\pgfpoint
+ {\ctikzvalof{tripoles/american nand port/port width}\pgf at circ@res at right} {0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf at circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgf at circ@res at step = \ctikzvalof{tripoles/american nand port/circle width}\pgf at circ@res at right
+ \pgf at circ@res at other = \ctikzvalof{tripoles/american nand port/port width}\pgf at circ@res at right
+ \pgf at circ@res at temp = \dimexpr 2\pgf at circ@res at other  \pgf at circ@res at step\relax
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at up}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at down}}
+ \pgfpatharc{90}{90}{\pgf at circ@res at temp and \pgf at circ@res at up}
+ \pgfpathclose
+
+ \pgfpathellipse
+ {\pgfpoint{\pgf at circ@res at other.5\pgf at circ@res at step}{0pt}}
+ {\pgfpoint{.5\pgf at circ@res at step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf at circ@res at step}}
+
+ \pgf at circ@draworfill
+}
+%%% american nor %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{nor}{2}{
+ \edef\pgf at circ@math at angle{\ctikzvalof{tripoles/american nor port/angle}}%
+ \pgf at circ@res at other=\ctikzvalof{tripoles/american nor port/inner}\pgf at circ@res at right
+ \pgfmathsetlengthmacro{\pgf at circ@math at xradius}{\pgf at circ@res at other /(1  cos(\pgf at circ@math at angle)}%
+ \pgfmathsetlengthmacro{\pgf at circ@math at yradius}{\pgf at circ@res at up /sin(\pgf at circ@math at angle)}%
+ \pgf at circ@res at other=\ctikzvalof{tripoles/american nor port/port width}\pgf at circ@res at right
+ \pgfmathsetlengthmacro{\pgf at circ@math at xorigin}{\pgf at circ@res at other + \pgf at circ@math at xradius*cos(\pgf at circ@math at angle)}%
+
+ \pgfextracty{\pgf at circ@res at temp}{\step}%
+ \pgf at circ@res at step = \dimexpr 2\pgf at circ@res at temp 2\pgf at circ@res at up\relax
+ \pgf at circ@res at count = \inputs\relax
+ \loop\ifnum\pgf at circ@res at count>0
+ \advance\pgf at circ@res at temp by \pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp}}%
+ \pgfmathsetmacro{\pgf at circ@math at angle}{asin(\pgf at circ@res at temp/\pgf at circ@math at yradius)}%
+ \pgfmathsetlength{\pgf at circ@res at other}{\pgf at circ@math at xradius*cos(\pgf at circ@math at angle)\pgf at circ@math at xorigin}%
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{\pgf at circ@res at temp}}%
+ \advance\pgf at circ@res at count by 1
+ \repeat
+
+ \pgf at circ@res at other=\ctikzvalof{tripoles/american nor port/port width}\pgf at circ@res at right
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at right}{0pt}}
+ \pgfpathlineto{\pgfpoint{\pgf at circ@res at other}{0pt}}
+
+ \pgfusepath{draw}
+
+ \pgf at circ@setlinewidth{tripoles}{\pgflinewidth}
+
+ \edef\pgf at circ@math at angle{\ctikzvalof{tripoles/american nor port/angle}}%
+ \pgf at circ@res at step = \ctikzvalof{tripoles/american nor port/circle width}\pgf at circ@res at right
+ \pgf at circ@res at temp = \dimexpr 2\pgf at circ@res at other  \pgf at circ@res at step\relax
+ \advance\pgf at circ@res at other by \pgf at circ@res at step
+
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at other}{0pt}}% for symmetry
+ \pgfpatharc{0}{90}{\pgf at circ@res at temp and \pgf at circ@res at up}%
+ \pgfpatharc{\pgf at circ@math at angle}{\pgf at circ@math at angle}{\pgf at circ@math at xradius and \pgf at circ@math at yradius}%
+ \pgfpatharc{90}{0}{\pgf at circ@res at temp and \pgf at circ@res at up}%
+ \pgfpathclose
+
+ \pgfpathellipse
+ {\pgfpoint{\pgf at circ@res at other+.5\pgf at circ@res at step}{0pt}}
+ {\pgfpoint{.5\pgf at circ@res at step}{0pt}}
+ {\pgfpoint{0pt}{.5\pgf at circ@res at step}}
+
+ \pgf at circ@draworfill
+}
+%%% american or %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+\pgfcircdeclarelogicport{or}{2}{
+ \edef\pgf at circ@math at angle{\ctikzvalof{tripoles/american or port/angle}}%
+ \pgf at circ@res at other=\ctikzvalof{tripoles/american or port/inner}\pgf at circ@res at right
+ \pgfmathsetlengthmacro{\pgf at circ@math at xradius}{\pgf at circ@res at other /(1  cos(\pgf at circ@math at angle)}%
+ \pgfmathsetlengthmacro{\pgf at circ@math at yradius}{\pgf at circ@res at up /sin(\pgf at circ@math at angle)}%
+ \pgf at circ@res at other=\ctikzvalof{tripoles/american or port/port width}\pgf at circ@res at right
+ \pgfmathsetlengthmacro{\pgf at circ@math at xorigin}{\pgf at circ@res at other + \pgf at circ@math at xradius*cos(\pgf at circ@math at angle)}%
+
+ \pgfextracty{\pgf at circ@res at temp}{\step}%
+ \pgf at circ@res at step = \dimexpr 2\pgf at circ@res at temp 2\pgf at circ@res at up\relax
+ \pgf at circ@res at count = \inputs\relax
+ \loop\ifnum\pgf at circ@res at count>0
+ \advance\pgf at circ@res at temp by \pgf at circ@res at step
+ \pgfpathmoveto{\pgfpoint{\pgf at circ@res at left}{\pgf at circ@res at temp}}%
+ \pgfmathsetmacro{\pgf at circ@math at angle}{asin(\pgf at circ@res at temp/\pgf at circ@math at yradi