diff options
author | Karl Berry <karl@freefriends.org> | 2019-07-13 21:39:36 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2019-07-13 21:39:36 +0000 |
commit | 8e8c05aa6d6db2c28633a8924de4a0b941b52030 (patch) | |
tree | ed7cecc6f4771974edc2e2e0fd76c60597e99dab /Master/texmf-dist/tex/generic | |
parent | ac24b25f17ff492d41266a15f5c9aa894ffd74d7 (diff) |
circuitikz (13jul19)
git-svn-id: svn://tug.org/texlive/trunk@51634 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic')
5 files changed, 451 insertions, 350 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex index ca121a6e0c7..22bcf58f930 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex @@ -1,6 +1,8 @@ +%% Counters -%% Options - +\newcount\pgf@circ@count@a +\newcount\pgf@circ@count@b +\newcount\pgf@circ@count@c %%%%%%%%%%%% %% Dimensions @@ -427,6 +429,8 @@ \ctikzset{tripoles/mos style/.is choice} \ctikzset{tripoles/mos style/no arrows/.code={\pgf@circuit@mos@arrowsfalse}} \ctikzset{tripoles/mos style/arrows/.code={\pgf@circuit@mos@arrowstrue}} +\pgfkeys{/tikz/arrowmos/.add code={}{\pgf@circuit@mos@arrowstrue}} +\pgfkeys{/tikz/noarrowmos/.add code={}{\pgf@circuit@mos@arrowsfalse}} % Option solderdot for fet \newif\ifpgf@circuit@fet@solderdot @@ -468,10 +472,17 @@ % Option draw pmos with empty circle \newif\ifpgf@circuit@pmos@emptycircle -\newif\ifpgf@circuit@pmos@emptycircle \pgf@circuit@pmos@emptycirclefalse \pgfkeys{/tikz/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}} \ctikzset{tripoles/pmos style/emptycircle/.add code={}{\pgf@circuit@pmos@emptycircletrue}} +% Option draw pmos with no circle +\newif\ifpgf@circuit@pmos@nocircle +\pgf@circuit@pmos@nocirclefalse +\pgfkeys{/tikz/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}} +\ctikzset{tripoles/pmos style/nocircle/.add code={}{\pgf@circuit@pmos@nocircletrue}} +% back to normal +\pgfkeys{/tikz/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}} +\ctikzset{tripoles/pmos style/fullcircle/.add code={}{\pgf@circuit@pmos@emptycirclefalse\pgf@circuit@pmos@nocirclefalse}} \newif\ifpgf@circuit@trans@ntype diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex index 7c7dccb2f27..c6fe8bfdb29 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex @@ -286,11 +286,11 @@ \pgfpathclose \pgfusepath{clip} % ...and build the waves as clipped circles - \c@pgf@counta=8\pgf@circ@res@other=0.5\pgf@circ@res@step + \pgf@circ@count@a=8\pgf@circ@res@other=0.5\pgf@circ@res@step \pgfmathloop% - \ifnum\c@pgf@counta>2 - \pgfpathcircle{\pgfpoint{0pt}{\pgf@circ@res@step}}{\the\c@pgf@counta*\pgf@circ@res@other} - \advance\c@pgf@counta-1\relax% + \ifnum\pgf@circ@count@a>2 + \pgfpathcircle{\pgfpoint{0pt}{\pgf@circ@res@step}}{\the\pgf@circ@count@a*\pgf@circ@res@other} + \advance\pgf@circ@count@a-1\relax% \repeatpgfmathloop \pgfusepath{draw} \endpgfscope diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex index b2a626b63d9..04734a19543 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmultipoles.tex @@ -13,8 +13,6 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % counters for pin accounting... -\newcount\pgf@circ@count@c -\newcount\pgf@circ@count@b \def\pgf@circ@dip@pin@shift{0.5} \def\pgf@circ@qfp@pin@shift{0.25} @@ -28,8 +26,8 @@ \pgfdeclareshape{dipchip}{ \savedmacro\numpins{% - \c@pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins}% - \def\numpins{\the\c@pgf@counta} + \pgf@circ@count@a=\pgfkeysvalueof{/tikz/circuitikz/multipoles/dipchip/num pins}% + \def\numpins{\the\pgf@circ@count@a} } \savedanchor\centerpoint{% \pgf@x=-.5\wd\pgfnodeparttextbox% @@ -94,8 +92,8 @@ \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} % Adding the pin number \ifpgf@circuit@chip@shownumbers - \c@pgf@counta=\numpins\relax - \divide\c@pgf@counta by 2 \pgf@circ@count@b=\c@pgf@counta + \pgf@circ@count@a=\numpins\relax + \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080 \ifpgf@circuit@chip@straightnumbers \pgfgettransformentries\a\b\temp\temp\temp\temp @@ -108,85 +106,85 @@ \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax} \def\mytext{\pgfkeysvalueof{/tikz/circuitikz/multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space} \pgfmathloop% - \ifnum\c@pgf@counta>0 + \ifnum\pgf@circ@count@a>0 \ifcase\quadrant % rotation 0 % left - \pgf@circ@count@c=\c@pgf@counta + \pgf@circ@count@c=\pgf@circ@count@a \pgftext[left, - at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} % right - \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\c@pgf@counta+1\relax + \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax \pgftext[right, - at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} \or % rotation -90 % left - \pgf@circ@count@c=\c@pgf@counta + \pgf@circ@count@c=\pgf@circ@count@a \pgftext[top, - at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} % right - \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\c@pgf@counta+1\relax + \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax \pgftext[bottom, - at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} \or %rotation 180 % left - \pgf@circ@count@c=\c@pgf@counta + \pgf@circ@count@c=\pgf@circ@count@a \pgftext[right, - at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} % right - \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\c@pgf@counta+1\relax + \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax \pgftext[left, - at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} \or % rotation +90 % left - \pgf@circ@count@c=\c@pgf@counta + \pgf@circ@count@c=\pgf@circ@count@a \pgftext[bottom, - at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} % right - \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\c@pgf@counta+1\relax + \pgf@circ@count@c=\numexpr2*\pgf@circ@count@b-\pgf@circ@count@a+1\relax \pgftext[top, - at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} \fi - \advance\c@pgf@counta-1\relax% + \advance\pgf@circ@count@a-1\relax% \repeatpgfmathloop \fi \endpgfscope \ifdim\pgf@circ@res@other>0pt \pgfscope \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins thickness}\pgflinewidth} - \c@pgf@counta=\numpins\relax - \divide\c@pgf@counta by 2 \pgf@circ@count@b=\c@pgf@counta + \pgf@circ@count@a=\numpins\relax + \divide\pgf@circ@count@a by 2 \pgf@circ@count@b=\pgf@circ@count@a \pgfmathloop% - \ifnum\c@pgf@counta>0 + \ifnum\pgf@circ@count@a>0 \edef\padfrac{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pad fraction}} \ifnum\padfrac>0 \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac % left side pads - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} % right side pads - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} \else % left side pins - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} % right side pins - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@dip@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} \fi - \advance\c@pgf@counta by -1\relax% + \advance\pgf@circ@count@a by -1\relax% \repeatpgfmathloop \pgfusepath{stroke} \endpgfscope @@ -196,19 +194,19 @@ % and is executed just before a node is drawn. \pgfutil@g@addto@macro\pgf@sh@s@dipchip{% % Start with the maximum pin number and go backwards. - \c@pgf@counta=\numpins\relax + \pgf@circ@count@a=\numpins\relax \pgfmathloop% - \ifnum\c@pgf@counta>0 + \ifnum\pgf@circ@count@a>0 % we will create two anchors per pin: the "normal one" like `pin 1` for the % electrical contact, and the "border one" like `bpin 1` for labels. % they will coincide if `external pins width` is set to 0. - \expandafter\xdef\csname pgf@anchor@dipchip@pin\space\the\c@pgf@counta\endcsname{% - \noexpand\pgf@circ@dippinanchor{\the\c@pgf@counta}{1}% + \expandafter\xdef\csname pgf@anchor@dipchip@pin\space\the\pgf@circ@count@a\endcsname{% + \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{1}% } - \expandafter\xdef\csname pgf@anchor@dipchip@bpin\space\the\c@pgf@counta\endcsname{% - \noexpand\pgf@circ@dippinanchor{\the\c@pgf@counta}{0}% + \expandafter\xdef\csname pgf@anchor@dipchip@bpin\space\the\pgf@circ@count@a\endcsname{% + \noexpand\pgf@circ@dippinanchor{\the\pgf@circ@count@a}{0}% } - \advance\c@pgf@counta by -1\relax% + \advance\pgf@circ@count@a by -1\relax% \repeatpgfmathloop% }% } @@ -217,8 +215,8 @@ \pgfdeclareshape{qfpchip}{ \savedmacro\numpins{% - \c@pgf@counta=\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}% - \def\numpins{\the\c@pgf@counta} + \pgf@circ@count@a=\pgfkeysvalueof{/tikz/circuitikz/multipoles/qfpchip/num pins}% + \def\numpins{\the\pgf@circ@count@a} } \savedanchor\centerpoint{% \pgf@x=-.5\wd\pgfnodeparttextbox% @@ -291,8 +289,8 @@ % Adding the pin number \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}} \ifpgf@circuit@chip@shownumbers - \c@pgf@counta=\numpins% - \divide\c@pgf@counta by 4 \pgf@circ@count@b=\c@pgf@counta + \pgf@circ@count@a=\numpins% + \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a % thanks to @marmot: https://tex.stackexchange.com/a/473571/38080 \ifpgf@circuit@chip@straightnumbers \pgfgettransformentries\a\b\temp\temp\temp\temp @@ -305,141 +303,141 @@ \def\pgf@circ@strut{\vrule width 0pt height 1em depth 0.4em\relax} \def\mytext{\pgfkeysvalueof{/tikz/circuitikz/multipoles/font}\space\pgf@circ@strut\the\pgf@circ@count@c\space} \pgfmathloop% - \ifnum\c@pgf@counta>0 + \ifnum\pgf@circ@count@a>0 \ifcase\quadrant % rotation 0 % left - \pgf@circ@count@c=\c@pgf@counta + \pgf@circ@count@c=\pgf@circ@count@a \pgftext[left, - at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} % bottom - \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\c@pgf@counta\relax + \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax \pgftext[bottom, - at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down}, + at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}, rotate=\rot]{\mytext} % right - \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\c@pgf@counta+1\relax + \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax \pgftext[right, - at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} % top - \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\c@pgf@counta\relax + \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax \pgftext[top, - at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up}, + at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}, rotate=\rot]{\mytext} \or % rotation -90 % left - \pgf@circ@count@c=\c@pgf@counta + \pgf@circ@count@c=\pgf@circ@count@a \pgftext[top, - at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} % bottom - \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\c@pgf@counta\relax + \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax \pgftext[left, - at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down}, + at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}, rotate=\rot]{\mytext} % right - \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\c@pgf@counta+1\relax + \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax \pgftext[bottom, - at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} % top - \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\c@pgf@counta\relax + \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax \pgftext[right, - at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up}, + at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}, rotate=\rot]{\mytext} \or %rotation 180 % left - \pgf@circ@count@c=\c@pgf@counta + \pgf@circ@count@c=\pgf@circ@count@a \pgftext[right, - at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} % bottom - \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\c@pgf@counta\relax + \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax \pgftext[top, - at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down}, + at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}, rotate=\rot]{\mytext} % right - \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\c@pgf@counta+1\relax + \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax \pgftext[left, - at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} % top - \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\c@pgf@counta\relax + \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax \pgftext[bottom, - at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up}, + at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}, rotate=\rot]{\mytext} \or % rotation +90 % left - \pgf@circ@count@c=\c@pgf@counta + \pgf@circ@count@c=\pgf@circ@count@a \pgftext[bottom, - at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} % bottom - \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\c@pgf@counta\relax + \pgf@circ@count@c=\numexpr\pgf@circ@count@b+\pgf@circ@count@a\relax \pgftext[right, - at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down}, + at=\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}, rotate=\rot]{\mytext} % right - \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\c@pgf@counta+1\relax + \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b-\pgf@circ@count@a+1\relax \pgftext[top, - at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}, + at=\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}, rotate=\rot]{\mytext} % top - \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\c@pgf@counta\relax + \pgf@circ@count@c=\numexpr3*\pgf@circ@count@b+\pgf@circ@count@a\relax \pgftext[left, - at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up}, + at=\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}, rotate=\rot]{\mytext} \fi - \advance\c@pgf@counta-1\relax% + \advance\pgf@circ@count@a-1\relax% \repeatpgfmathloop \fi \endpgfscope \ifdim\pgf@circ@res@other>0pt \pgfscope \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pins thickness}\pgflinewidth} - \c@pgf@counta=\numpins% - \divide\c@pgf@counta by 4 \pgf@circ@count@b=\c@pgf@counta + \pgf@circ@count@a=\numpins% + \divide\pgf@circ@count@a by 4 \pgf@circ@count@b=\pgf@circ@count@a \pgfmathloop% - \ifnum\c@pgf@counta>0 + \ifnum\pgf@circ@count@a>0 \edef\padfrac{\pgfkeysvalueof{/tikz/circuitikz/multipoles/external pad fraction}} \ifnum\padfrac>0 \pgf@circ@res@temp=\pgf@circ@res@step\divide\pgf@circ@res@temp by \padfrac % left side pads - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} % bottom side pads - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}} % right side pads - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp+\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} % top side pads - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}} - \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}} - \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}} + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@temp+\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}} \else % left side pins - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} % bottom side pins - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@down-\pgf@circ@res@other}} % right side pins - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@other}{\pgf@circ@res@up+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}} % top side pins - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\c@pgf@counta)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+(\pgf@circ@qfp@pin@shift-\the\pgf@circ@count@a)*\pgf@circ@res@step}{\pgf@circ@res@up+\pgf@circ@res@other}} \fi - \advance\c@pgf@counta-1\relax% + \advance\pgf@circ@count@a-1\relax% \repeatpgfmathloop \pgfusepath{stroke} \endpgfscope @@ -449,16 +447,16 @@ % and is executed just before a node is drawn. \pgfutil@g@addto@macro\pgf@sh@s@qfpchip{% % Start with the maximum pin number and go backwards. - \c@pgf@counta=\numpins% + \pgf@circ@count@a=\numpins% \pgfmathloop% - \ifnum\c@pgf@counta>0 - \expandafter\xdef\csname pgf@anchor@qfpchip@pin\space\the\c@pgf@counta\endcsname{% - \noexpand\pgf@circ@qfppinanchor{\the\c@pgf@counta}{1}% + \ifnum\pgf@circ@count@a>0 + \expandafter\xdef\csname pgf@anchor@qfpchip@pin\space\the\pgf@circ@count@a\endcsname{% + \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{1}% } - \expandafter\xdef\csname pgf@anchor@qfpchip@bpin\space\the\c@pgf@counta\endcsname{% - \noexpand\pgf@circ@qfppinanchor{\the\c@pgf@counta}{0}% + \expandafter\xdef\csname pgf@anchor@qfpchip@bpin\space\the\pgf@circ@count@a\endcsname{% + \noexpand\pgf@circ@qfppinanchor{\the\pgf@circ@count@a}{0}% } - \advance\c@pgf@counta-1\relax% + \advance\pgf@circ@count@a-1\relax% \repeatpgfmathloop% }% } @@ -619,18 +617,19 @@ \endpgfscope \fi - % \typeout{CHANNELS\space\channels\space ANGLE\space\angle} - \c@pgf@counta=\channels\relax + % \typeout{CHANNELS\space\channels\space ANGLE\space\angle STEPA\space\stepa} + \pgf@circ@count@a=\channels\relax \pgfmathsetmacro{\currenta}{-\angle} \pgfmathloop% - \ifnum\c@pgf@counta>0 - % \typeout{LOOP\space\the\c@pgf@counta\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right} + \ifnum\pgf@circ@count@a>0 + % \typeout{LOOPIN\space\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right} \pgfscope \pgftransformshift{\pgfpointadd{\pgfpoint{\pgf@circ@res@left}{0pt}}{\pgfpointpolar{\currenta}{2\pgf@circ@res@right}}} - \pgfnode{\cshape}{center}{}{\thisshape-out \the\c@pgf@counta}{\pgfusepath{stroke}} + \pgfnode{\cshape}{center}{}{\thisshape-out \the\pgf@circ@count@a}{\pgfusepath{stroke}} \endpgfscope \pgfmathsetmacro{\currenta}{\currenta+\stepa} - \advance\c@pgf@counta by -1\relax% + % \typeout{LOOPOUT\space\the\pgf@circ@count@a\space CURRENTA\space\currenta\space RIGHT\space\the\pgf@circ@res@right} + \advance\pgf@circ@count@a by -1\relax% \repeatpgfmathloop \pgfscope % input @@ -642,25 +641,25 @@ % and is executed just before a node is drawn. \pgfutil@g@addto@macro\pgf@sh@s@rotaryswitch{% % Start with the maximum pin number and go backwards. - \c@pgf@counta=\channels\relax + \pgf@circ@count@a=\channels\relax \pgfmathloop% - \ifnum\c@pgf@counta>0 + \ifnum\pgf@circ@count@a>0 % we will create two anchors per pin: the "normal one" like `pin 1` for the % electrical contact, and the "border one" like `bpin 1` for labels. % they will coincide if `external pins width` is set to 0. - \expandafter\xdef\csname pgf@anchor@rotaryswitch@out\space\the\c@pgf@counta\endcsname{% - \noexpand\pgf@circ@rotaryanchor{\the\c@pgf@counta}{1}{0}% + \expandafter\xdef\csname pgf@anchor@rotaryswitch@out\space\the\pgf@circ@count@a\endcsname{% + \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{1}{0}% } - \expandafter\xdef\csname pgf@anchor@rotaryswitch@cout\space\the\c@pgf@counta\endcsname{% - \noexpand\pgf@circ@rotaryanchor{\the\c@pgf@counta}{0}{0}% + \expandafter\xdef\csname pgf@anchor@rotaryswitch@cout\space\the\pgf@circ@count@a\endcsname{% + \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{0}% } - \expandafter\xdef\csname pgf@anchor@rotaryswitch@aout\space\the\c@pgf@counta\endcsname{% - \noexpand\pgf@circ@rotaryanchor{\the\c@pgf@counta}{0}{1}% + \expandafter\xdef\csname pgf@anchor@rotaryswitch@aout\space\the\pgf@circ@count@a\endcsname{% + \noexpand\pgf@circ@rotaryanchor{\the\pgf@circ@count@a}{0}{1}% } - \expandafter\xdef\csname pgf@anchor@rotaryswitch@sqout\space\the\c@pgf@counta\endcsname{% - \noexpand\pgf@circ@rotarysqanchor{\the\c@pgf@counta}{0}% + \expandafter\xdef\csname pgf@anchor@rotaryswitch@sqout\space\the\pgf@circ@count@a\endcsname{% + \noexpand\pgf@circ@rotarysqanchor{\the\pgf@circ@count@a}{0}% } - \advance\c@pgf@counta by -1\relax% + \advance\pgf@circ@count@a by -1\relax% \repeatpgfmathloop% }% } diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex index a09d2076e66..fc9960b4a09 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircquadpoles.tex @@ -464,23 +464,30 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0.5\pgf@circ@res@down}} \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}} - \pgfpatharc{0}{90} {0.4\pgf@circ@res@up} - \pgfsetarrowsend{latex} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}} - \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up} - \pgfsetarrowsend{latex} - \pgfusepath{draw} - - \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}} - \pgfpatharc{180}{90} {0.4\pgf@circ@res@up} - \pgfsetarrowsend{latex} - \pgfusepath{draw} - \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}} - \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up} - \pgfsetarrowsend{latex} - \pgfusepath{draw} + \pgfscope + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}} + \pgfpatharc{0}{90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + \endpgfscope + \pgfscope + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}} + \pgfpatharc{0}{-90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + \endpgfscope + \pgfscope + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}} + \pgfpatharc{180}{90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + \endpgfscope + \pgfscope + \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}} + \pgfpatharc{-180}{-90} {0.4\pgf@circ@res@up} + \pgfsetarrowsend{latex} + \pgfusepath{draw} + \endpgfscope } % contrib Kristofer M. Monisit diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex index bfcffe9d359..c64f400d214 100644 --- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex +++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex @@ -1644,13 +1644,15 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgf@circ@res@up+\pgf@circ@res@down}} \pgfusepath{draw} \fi - \pgfpathcircle{\pgfpoint - {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen} - {\pgf@circ@res@up+\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen} - \ifpgf@circuit@pmos@emptycircle - \pgfsetfillcolor{white} + \ifpgf@circuit@pmos@nocircle\else + \pgfpathcircle{\pgfpoint + {\pgfkeysvalueof{/tikz/circuitikz/tripoles/pmos/gate width}\pgf@circ@res@left - \pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen} + {\pgf@circ@res@up+\pgf@circ@res@down}}{\pgfkeysvalueof{/tikz/circuitikz/nodes width}*\pgf@circ@Rlen} + \ifpgf@circuit@pmos@emptycircle + \pgfsetfillcolor{white} + \fi + \pgfusepath{draw,fill} \fi - \pgfusepath{draw,fill} } %% HEMT FET Transistor @@ -4193,21 +4195,21 @@ % Draw tube outline \def\pgf@circ@tubes@drawtube{% \ifdim\ctikzvalof{tubes/width}pt>\ctikzvalof{tubes/height}pt\relax - \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfutil@tempdima=\pgf@circ@res@right - \advance\pgfutil@tempdima by -\pgf@circ@res@up - \pgfpathlineto{\pgfpoint{\pgfutil@tempdima}{\pgf@circ@res@up}} - \pgfpatharc{90}{-90}{\pgf@circ@res@up} - \pgfpathlineto{\pgfpoint{-\pgfutil@tempdima}{-\pgf@circ@res@up}} - \pgfpatharc{270}{90}{\pgf@circ@res@up} + \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfutil@tempdima=\pgf@circ@res@right + \advance\pgfutil@tempdima by -\pgf@circ@res@up + \pgfpathlineto{\pgfpoint{\pgfutil@tempdima}{\pgf@circ@res@up}} + \pgfpatharc{90}{-90}{\pgf@circ@res@up} + \pgfpathlineto{\pgfpoint{-\pgfutil@tempdima}{-\pgf@circ@res@up}} + \pgfpatharc{270}{90}{\pgf@circ@res@up} \else - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{0pt}} - \pgfutil@tempdima=\pgf@circ@res@up - \advance\pgfutil@tempdima by -\pgf@circ@res@right - \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}} - \pgfpatharc{180}{0}{\pgf@circ@res@right} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfutil@tempdima}} - \pgfpatharc{180}{0}{-\pgf@circ@res@right} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{0pt}} + \pgfutil@tempdima=\pgf@circ@res@up + \advance\pgfutil@tempdima by -\pgf@circ@res@right + \pgfpathlineto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}} + \pgfpatharc{180}{0}{\pgf@circ@res@right} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgfutil@tempdima}} + \pgfpatharc{180}{0}{-\pgf@circ@res@right} \fi \pgfpathclose } @@ -4218,52 +4220,52 @@ %% \pgfcircdeclaretube{tube name}{grid anchors}{grid drawing code} \long\def\pgfcircdeclaretube#1#2#3{% \pgfdeclareshape{#1}{ - \anchor{center}{ - \pgfpointorigin - } - \savedanchor\northwest{% - \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen + \anchor{center}{ + \pgfpointorigin + } + \savedanchor\northwest{% + \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@Rlen % x and y should be half the Rlen - \pgf@y=\pgf@circ@res@up - \pgf@y=.5\pgf@y - \pgf@x=-\pgf@circ@res@right - \pgf@x=.5\pgf@x - } + \pgf@y=\pgf@circ@res@up + \pgf@y=.5\pgf@y + \pgf@x=-\pgf@circ@res@right + \pgf@x=.5\pgf@x + } \anchor{north} {% \northwest \pgf@x=0pt } - \anchor{east}{% - \northwest - \pgf@x=-\pgf@x - \pgf@y=0pt - } + \anchor{east}{% + \northwest + \pgf@x=-\pgf@x + \pgf@y=0pt + } \anchor{south}{% - \northwest - \pgf@y=-\pgf@y + \northwest + \pgf@y=-\pgf@y \pgf@x=0pt } - \anchor{west}{% - \northwest - \pgf@y=0pt - } - \anchor{north west}{% - \northwest - } - \anchor{north east}{% - \northwest - \pgf@x=-\pgf@x - } - \anchor{south east}{ - \northwest - \pgf@x=-\pgf@x - \pgf@y=-\pgf@y - } - \anchor{south west}{ - \northwest - \pgf@y=-\pgf@y - } + \anchor{west}{% + \northwest + \pgf@y=0pt + } + \anchor{north west}{% + \northwest + } + \anchor{north east}{% + \northwest + \pgf@x=-\pgf@x + } + \anchor{south east}{ + \northwest + \pgf@x=-\pgf@x + \pgf@y=-\pgf@y + } + \anchor{south west}{ + \northwest + \pgf@y=-\pgf@y + } \anchor{anode} {% \northwest \pgf@x=0pt @@ -4295,85 +4297,85 @@ \pgf@x=-\pgfmathresult\pgf@x \pgf@y=-\pgf@y } - + % Extra anchors #2 - + \backgroundpath{ \pgfscope - % Line width for tripoles - \pgfsetlinewidth{\ctikzvalof{tripoles/thickness}\pgflinewidth} - - % Setup to draw tube - \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen - \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@Rlen - \pgf@circ@res@up=\ctikzvalof{tubes/tube radius}\pgf@circ@res@up - \pgf@circ@res@right=\ctikzvalof{tubes/tube radius}\pgf@circ@res@right - - % Tube fill color (if any) - \ifx\tikz@fillcolor\pgfutil@empty - \else - \pgfscope - \pgfsetfillcolor{\tikz@fillcolor} - \pgf@circ@tubes@drawtube - \pgfusepath{fill} - \endpgfscope - \fi - - % Tube outline - \pgf@circ@tubes@drawtube - - % Setup to draw grid, filament, anode and cathode - \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen - \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@Rlen - \pgf@circ@res@up=0.5\pgf@circ@res@up - \pgf@circ@res@right=0.5\pgf@circ@res@right - - % Grid drawing - #3 - - % Filament (is not drawn by default) - \ifpgf@circuit@tubes@filament - \pgf@circ@res@temp=-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up - \advance\pgf@circ@res@temp by -\ctikzvalof{tubes/filament distance}\pgf@circ@res@up - \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})} - \pgf@xa=\pgfmathresult\pgf@circ@res@right - \pgfmathparse{\ctikzvalof{tubes/tube radius}+\ctikzvalof{tubes/tube radius}*cos(\ctikzvalof{tubes/filament angle}} - \pgf@ya=\pgfmathresult\pgf@circ@res@up - \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}} - \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@ya}} - \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}} - \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@ya}} - \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@circ@res@up}} - \pgf@circuit@tubes@filamentfalse - \fi - - % Anode (or plate) - \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} % north - \pgfpathlineto{\pgfpoint{0pt}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}} - - % Cathode - \ifpgf@circuit@tubes@nocathode - \pgf@circuit@tubes@nocathodefalse - \else - \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}} - \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}} - \ifpgf@circuit@tubes@fullcathode - \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}} - \pgf@circuit@tubes@fullcathodefalse - \else - \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up-\ctikzvalof{tubes/cathode right extend}\pgf@circ@res@up}} - \fi - \fi - - % Draw the background - \pgfusepath{draw} - + % Line width for tripoles + \pgfsetlinewidth{\ctikzvalof{tripoles/thickness}\pgflinewidth} + + % Setup to draw tube + \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen + \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@Rlen + \pgf@circ@res@up=\ctikzvalof{tubes/tube radius}\pgf@circ@res@up + \pgf@circ@res@right=\ctikzvalof{tubes/tube radius}\pgf@circ@res@right + + % Tube fill color (if any) + \ifx\tikz@fillcolor\pgfutil@empty + \else + \pgfscope + \pgfsetfillcolor{\tikz@fillcolor} + \pgf@circ@tubes@drawtube + \pgfusepath{fill} + \endpgfscope + \fi + + % Tube outline + \pgf@circ@tubes@drawtube + + % Setup to draw grid, filament, anode and cathode + \pgf@circ@res@up=\ctikzvalof{tubes/height}\pgf@circ@Rlen + \pgf@circ@res@right=\ctikzvalof{tubes/width}\pgf@circ@Rlen + \pgf@circ@res@up=0.5\pgf@circ@res@up + \pgf@circ@res@right=0.5\pgf@circ@res@right + + % Grid drawing + #3 + + % Filament (is not drawn by default) + \ifpgf@circuit@tubes@filament + \pgf@circ@res@temp=-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up + \advance\pgf@circ@res@temp by -\ctikzvalof{tubes/filament distance}\pgf@circ@res@up + \pgfmathparse{(\ctikzvalof{tubes/tube radius}*sin(\ctikzvalof{tubes/filament angle})} + \pgf@xa=\pgfmathresult\pgf@circ@res@right + \pgfmathparse{\ctikzvalof{tubes/tube radius}+\ctikzvalof{tubes/tube radius}*cos(\ctikzvalof{tubes/filament angle}} + \pgf@ya=\pgfmathresult\pgf@circ@res@up + \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}} + \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@ya}} + \pgfpathlineto{\pgfpoint{-\pgf@xa}{-\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@temp}} + \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@ya}} + \pgfpathlineto{\pgfpoint{\pgf@xa}{-\pgf@circ@res@up}} + \pgf@circuit@tubes@filamentfalse + \fi + + % Anode (or plate) + \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}} % north + \pgfpathlineto{\pgfpoint{0pt}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/anode width}\pgf@circ@res@right}{\ctikzvalof{tubes/anode distance}\pgf@circ@res@up}} + + % Cathode + \ifpgf@circuit@tubes@nocathode + \pgf@circuit@tubes@nocathodefalse + \else + \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}} + \pgfpathmoveto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up}} + \ifpgf@circuit@tubes@fullcathode + \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\pgf@circ@res@up}} + \pgf@circuit@tubes@fullcathodefalse + \else + \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up-\ctikzvalof{tubes/cathode right extend}\pgf@circ@res@up}} + \fi + \fi + + % Draw the background + \pgfusepath{draw} + \endpgfscope } } @@ -4383,10 +4385,14 @@ \pgfcircdeclaretube{triode} { - \anchor{grid} {% - \northwest + \anchor{grid} {% should not be used + \northwest \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y - } + } + \anchor{control} {% + \northwest + \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y + } } { % Grid protrusion @@ -4397,40 +4403,47 @@ % Grid dashes: calculations \pgf@xb=2\pgf@circ@res@right \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb - \@tempcnta=\ctikzvalof{tubes/grid dashes} % dashes*2+1 - \multiply\@tempcnta by 2\relax - \advance\@tempcnta by 1\relax + \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1 + \multiply\pgf@circ@count@a by 2\relax + \advance\pgf@circ@count@a by 1\relax \advance\pgf@circ@res@step by -\pgf@xa - \divide\pgf@circ@res@step by \@tempcnta + \divide\pgf@circ@res@step by \pgf@circ@count@a % Grid dashes: draw \pgf@circ@res@temp=\pgf@xa - \@tempcnta=\ctikzvalof{tubes/grid dashes} + \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} \loop - \advance\pgf@circ@res@temp by\pgf@circ@res@step - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}} - \advance\pgf@circ@res@temp by\pgf@circ@res@step - \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}} - \advance\@tempcnta by-1 - \ifnum\@tempcnta>0\relax + \advance\pgf@circ@res@temp by\pgf@circ@res@step + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}} + \advance\pgf@circ@res@temp by\pgf@circ@res@step + \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\ctikzvalof{tubes/grid shift}\pgf@circ@res@up}} + \advance\pgf@circ@count@a by-1 + \ifnum\pgf@circ@count@a>0\relax \repeat } \pgfcircdeclaretube{tetrode} { - \anchor{grid} {% - \northwest + \anchor{grid} {% should not be used + \northwest \pgfutil@tempdima=\pgf@y \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y \pgf@y=0.5\pgf@y \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima - } + } + \anchor{control} {% + \northwest + \pgfutil@tempdima=\pgf@y + \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y + \pgf@y=0.5\pgf@y + \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima + } \anchor{screen} {% - \northwest + \northwest \pgfutil@tempdima=\pgf@y \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y \pgf@y=0.5\pgf@y \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima - } + } } { % Grid x/y points @@ -4450,44 +4463,50 @@ % Grid dashes: calculations \pgf@xb=2\pgf@circ@res@right \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb - \@tempcnta=\ctikzvalof{tubes/grid dashes} % dashes*2+1 - \multiply\@tempcnta by 2\relax - \advance\@tempcnta by 1\relax + \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1 + \multiply\pgf@circ@count@a by 2\relax + \advance\pgf@circ@count@a by 1\relax \advance\pgf@circ@res@step by -\pgf@xa - \divide\pgf@circ@res@step by \@tempcnta + \divide\pgf@circ@res@step by \pgf@circ@count@a % Grid dashes: draw \pgf@circ@res@temp=\pgf@xa - \@tempcnta=\ctikzvalof{tubes/grid dashes} + \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} \loop - \advance\pgf@circ@res@temp by\pgf@circ@res@step - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}} - \advance\pgf@circ@res@temp by\pgf@circ@res@step - \advance\@tempcnta by-1 - \ifnum\@tempcnta>0\relax + \advance\pgf@circ@res@temp by\pgf@circ@res@step + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}} + \advance\pgf@circ@res@temp by\pgf@circ@res@step + \advance\pgf@circ@count@a by-1 + \ifnum\pgf@circ@count@a>0\relax \repeat } \pgfcircdeclaretube{pentode} { - \anchor{grid} {% - \northwest + \anchor{grid} {% should not be used + \northwest \pgfutil@tempdima=\pgf@y \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima - } + } + \anchor{control} {% + \northwest + \pgfutil@tempdima=\pgf@y + \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y + \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima + } \anchor{screen} {% - \northwest + \northwest \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y - } + } \anchor{suppressor} {% - \northwest + \northwest \pgfutil@tempdima=\pgf@y \pgf@y=\ctikzvalof{tubes/grid separation}\pgf@y \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima - } + } } { % Grid x/y points @@ -4497,37 +4516,102 @@ \pgfutil@tempdimb=-\pgfutil@tempdima \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up - \@tempdimc=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up + \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up % Grid protrusion \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}} \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}} \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdima}} \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdima}} - \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\@tempdimc}} - \pgfpathlineto{\pgfpoint{\pgf@xa}{\@tempdimc}} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}} + \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}} + % Grid dashes: calculations + \pgf@xb=2\pgf@circ@res@right + \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb + \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1 + \multiply\pgf@circ@count@a by 2\relax + \advance\pgf@circ@count@a by 1\relax + \advance\pgf@circ@res@step by -\pgf@xa + \divide\pgf@circ@res@step by \pgf@circ@count@a + % Grid dashes: draw + \pgf@circ@res@temp=\pgf@xa + \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} + \loop + \advance\pgf@circ@res@temp by\pgf@circ@res@step + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}} + \advance\pgf@circ@res@temp by\pgf@circ@res@step + \advance\pgf@circ@count@a by-1 + \ifnum\pgf@circ@count@a>0\relax + \repeat +} + +\pgfcircdeclaretube{pentode suppressor to cathode} +{ + \anchor{grid} {% should not be used + \northwest + \pgfutil@tempdima=\pgf@y + \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y + \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima + } + \anchor{control} {% + \northwest + \pgfutil@tempdima=\pgf@y + \pgf@y=-\ctikzvalof{tubes/grid separation}\pgf@y + \advance\pgf@y by \ctikzvalof{tubes/grid shift}\pgfutil@tempdima + } + \anchor{screen} {% + \northwest + \pgf@y=\ctikzvalof{tubes/grid shift}\pgf@y + } +} +{ + % Grid x/y points + \pgf@xa=-\ctikzvalof{tubes/tube radius}\pgf@circ@res@right + \advance\pgf@xa by -\ctikzvalof{tubes/grid protrusion}\pgf@circ@res@right + \pgfutil@tempdima=\ctikzvalof{tubes/grid separation}\pgf@circ@res@up + \pgfutil@tempdimb=-\pgfutil@tempdima + \advance\pgfutil@tempdima by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up + \advance\pgfutil@tempdimb by \ctikzvalof{tubes/grid shift}\pgf@circ@res@up + \pgf@circ@res@other=\ctikzvalof{tubes/grid shift}\pgf@circ@res@up + % Grid protrusion + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgfutil@tempdimb}} + \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgfutil@tempdimb}} + \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@other}} + \pgfpathlineto{\pgfpoint{\pgf@xa}{\pgf@circ@res@other}} % Grid dashes: calculations \pgf@xb=2\pgf@circ@res@right \pgf@circ@res@step=\ctikzvalof{tubes/tube radius}\pgf@xb - \@tempcnta=\ctikzvalof{tubes/grid dashes} % dashes*2+1 - \multiply\@tempcnta by 2\relax - \advance\@tempcnta by 1\relax + \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} % dashes*2+1 + \multiply\pgf@circ@count@a by 2\relax + \advance\pgf@circ@count@a by 1\relax \advance\pgf@circ@res@step by -\pgf@xa - \divide\pgf@circ@res@step by \@tempcnta + \divide\pgf@circ@res@step by \pgf@circ@count@a % Grid dashes: draw \pgf@circ@res@temp=\pgf@xa - \@tempcnta=\ctikzvalof{tubes/grid dashes} + \pgf@circ@count@a=\ctikzvalof{tubes/grid dashes} \loop - \advance\pgf@circ@res@temp by\pgf@circ@res@step - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\@tempdimc}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\@tempdimc}} - \advance\pgf@circ@res@temp by\pgf@circ@res@step - \advance\@tempcnta by-1 - \ifnum\@tempcnta>0\relax + \advance\pgf@circ@res@temp by\pgf@circ@res@step + \ifnum\pgf@circ@count@a>1\relax + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdimb}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdimb}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgf@circ@res@other}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgf@circ@res@other}} + \fi + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp+\pgf@circ@res@step}{\pgfutil@tempdima}} + \advance\pgf@circ@res@temp by\pgf@circ@res@step + \advance\pgf@circ@count@a by-1 + \ifnum\pgf@circ@count@a>0\relax \repeat + % Grid: connection from suppressor to cathode + \pgfsetcornersarced{\pgfpoint{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}{\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{\pgfutil@tempdima-2*\ctikzvalof{tubes/grid separation}\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\ctikzvalof{tubes/cathode width}\pgf@circ@res@right-0.4142136*\ctikzvalof{tubes/cathode corners}\pgf@circ@res@right}{-\ctikzvalof{tubes/cathode distance}\pgf@circ@res@up-0.4142136*\ctikzvalof{tubes/cathode corners}\pgf@circ@res@up}} + } \endinput |