diff options
author | Norbert Preining <norbert@preining.info> | 2021-04-05 03:00:44 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2021-04-05 03:00:44 +0000 |
commit | f0b3901f183621b9000493d3ec263c69ac868156 (patch) | |
tree | 307f40bdcc97503979fc6bfa9c14726ffb277abb /graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex | |
parent | 6c7f24a5336de85c7db50c5037772288964c607b (diff) |
CTAN sync 202104050300
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex')
-rw-r--r-- | graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex | 123 |
1 files changed, 97 insertions, 26 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex index 5a4d5b0d28..78dd1379fb 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex @@ -13,6 +13,18 @@ %% Standard bipole shapes declarations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% Generic macro and flags for bipoles %<<< +% Fixing tunable directions +\newif\ifpgf@circ@fixtunable@dir +\ctikzset{bipoles/fix tunable direction/.is if=pgf@circ@fixtunable@dir} +\ctikzset{bipoles/fix tunable direction=true} +% choosing several arrows +\pgf@circ@declare@family@arrows{tunable} +\pgf@circ@declare@family@arrows{wiper} +\pgf@circ@declare@family@arrows{switch} +%>>> + + %%%%%%%%%%%%%%%%%%%%%%%% % Resistive components: generics, resistors, wires %%%%%%%%%%%%%%%%%%%%%%%% @@ -104,6 +116,7 @@ \ctikzset{bipoles/multiwire/spacing/.initial=0.05} % crossing wires \ctikzset{bipoles/crossing/size/.initial=.2} + %%>>> %% Shapes for generic, resistives and wires components %<<< @@ -269,9 +282,14 @@ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgf@circ@draworfill \pgfscope - \pgfsetarrowsend{latexslim} - \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfcirc@set@arrows{tunable}{}{latexslim} + \ifpgf@circ@fixtunable@dir + \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@up}} + \else + \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}} + \fi \pgfusepath{draw} \endpgfscope } @@ -493,7 +511,7 @@ \endpgfscope \pgfscope %\pgfsetlinewidth{\pgfstartlinewidth} - \pgfsetarrowsend{latexslim} + \pgfcirc@set@arrows{wiper}{}{latexslim} \pgfextractx{\pgf@circ@res@other}{\wiper} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}} @@ -501,7 +519,7 @@ \endpgfscope } -%% Zig zag resistores +%% Zig-zag resistors \def\pgf@circ@zigzag#1{% \divide \pgf@circ@res@step by \numexpr4*\zigs\relax @@ -561,9 +579,14 @@ \pgf@circ@zigzag{.5} \pgfscope - \pgfsetarrowsend{latexslim} - \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}} + \pgfcirc@set@arrows{tunable}{}{latexslim} + \ifpgf@circ@fixtunable@dir + \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}} + \else + \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@other}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@other}{\pgf@circ@res@down}} + \fi \pgfusepath{draw} \endpgfscope } @@ -594,7 +617,7 @@ \pgfscope %\pgfsetlinewidth{\pgfstartlinewidth} - \pgfsetarrowsend{latexslim} + \pgfcirc@set@arrows{wiper}{}{latexslim} \pgfextractx{\pgf@circ@res@other}{\wiper} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{-\pgf@circ@res@down}} @@ -857,9 +880,14 @@ \pgfusepath{draw} \pgfscope - \pgfsetarrowsend{latexslim} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfcirc@set@arrows{tunable}{}{latexslim} + \ifpgf@circ@fixtunable@dir + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \else + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \fi \pgfusepath{draw} \endpgfscope @@ -967,6 +995,18 @@ \pgfkeys{/tikz/twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}} \ctikzset{twolineschoke/.add code={}{\pgf@circuit@bipole@twolineschoketrue}} % +% generic core anchor settings +\ctikzset{bipoles/inductors/core distance/.initial={2pt}} +\def\pgfcir@basic@core@anchors{% + \saveddimen{\coredistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/core distance}}} + \anchor{core east}{% + \northeast\advance\pgf@y by\coredistance + } + \anchor{core west}{% + \northeast\advance\pgf@y by\coredistance\pgf@x=-\pgf@x + } +} +% \ctikzset{bipoles/americaninductor/height/.initial=.3} \ctikzset{bipoles/americaninductor/height 2/.initial=.1} \ctikzset{bipoles/americaninductor/width/.initial=.8} @@ -1013,7 +1053,8 @@ } } \anchor{midtap}{\midtap} -} + \pgfcir@basic@core@anchors + } {\ctikzvalof{bipoles/cuteinductor/lower coil height}} {cuteinductor} {\ctikzvalof{bipoles/cuteinductor/height}} @@ -1056,6 +1097,7 @@ } \anchor{midtap}{\midtap} \pgfcirc@border@extend@full{1}{2}{1.6}{2.6} + \pgfcir@basic@core@anchors } {\ctikzvalof{bipoles/cuteinductor/lower coil height}} {scuteinductor} @@ -1158,6 +1200,13 @@ } } \anchor{midtap}{\midtap} + \saveddimen{\coredistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/core distance}}} + \anchor{core east}{% + \northeast\pgf@y=0.5\pgf@y\advance\pgf@y by\coredistance + } + \anchor{core west}{% + \northeast\pgf@y=0.5\pgf@y\advance\pgf@y by\coredistance\pgf@x=-\pgf@x + } } {\ctikzvalof{bipoles/vcuteinductor/lower coil height}} {vcuteinductor} @@ -1175,7 +1224,7 @@ {(\ctikzvalof{bipoles/vcuteinductor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment\pgflinewidth+(\ctikzvalof{bipoles/vcuteinductor/coils}-1)*2*\pgf@circ@res@other)/\ctikzvalof{bipoles/vcuteinductor/coils}/2} \pgfscope - \pgfsetarrowsend{latexslim} + \pgfcirc@set@arrows{tunable}{}{latexslim} \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfusepath{draw} @@ -1206,6 +1255,7 @@ } } \anchor{midtap}{\midtap} + \pgfcir@basic@core@anchors } {\ctikzvalof{bipoles/americaninductor/height 2}} {americaninductor} @@ -1246,6 +1296,7 @@ } \anchor{midtap}{\midtap} \pgfcirc@border@extend@full{1}{2}{1.6}{2.6} + \pgfcir@basic@core@anchors } {\ctikzvalof{bipoles/americaninductor/height 2}} {samericaninductor} @@ -1289,6 +1340,13 @@ } } \anchor{midtap}{\midtap} + \saveddimen{\coredistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/core distance}}} + \anchor{core east}{% + \northeast\pgf@y=0.5\pgf@y\advance\pgf@y by\coredistance + } + \anchor{core west}{% + \northeast\pgf@y=0.5\pgf@y\advance\pgf@y by\coredistance\pgf@x=-\pgf@x + } } {\ctikzvalof{bipoles/vamericaninductor/height 2}} {vamericaninductor} @@ -1313,7 +1371,7 @@ \pgfusepath{stroke} \pgfscope - \pgfsetarrowsend{latexslim} + \pgfcirc@set@arrows{tunable}{}{latexslim} \pgfpathmoveto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfusepath{draw} @@ -1324,6 +1382,7 @@ \pgfcircdeclarebipolescaled{inductors} { \anchor{midtap}{\northeast\pgf@x=0pt\relax} + \pgfcir@basic@core@anchors } {\ctikzvalof{bipoles/fullgeneric/height}} {fullgeneric} @@ -1342,6 +1401,7 @@ \anchor{label}{\southwest\pgf@x=0.4\pgf@x\pgf@y=2\pgf@y}% \anchor{midtap}{\northeast\pgf@x=0pt\relax} \pgfcirc@border@extend@full{1}{2}{1}{2} + \pgfcir@basic@core@anchors } {\ctikzvalof{bipoles/fullgeneric/height}} {sfullgeneric} @@ -1364,6 +1424,13 @@ \pgfcircdeclarebipolescaled{inductors} { \anchor{midtap}{\northeast\pgf@x=0pt\relax} + \saveddimen{\coredistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/core distance}}} + \anchor{core east}{% + \northeast\pgf@y=0.4\pgf@y\advance\pgf@y by \coredistance + } + \anchor{core west}{% + \northeast\pgf@y=0.4\pgf@y\advance\pgf@y by \coredistance\pgf@x=-\pgf@x + } } {\ctikzvalof{bipoles/tfullgeneric/height}} {tfullgeneric} @@ -1378,9 +1445,14 @@ \pgfusepath{draw,fill} \pgfscope - \pgfsetarrowsend{latexslim} - \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfcirc@set@arrows{tunable}{}{latexslim} + \ifpgf@circ@fixtunable@dir + \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@up}} + \else + \pgfpathmoveto{\pgfpoint{.5\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{-.5\pgf@circ@res@left}{\pgf@circ@res@down}} + \fi \pgfusepath{draw} \endpgfscope } @@ -3777,7 +3849,7 @@ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} \pgfpathmoveto{\pgfpointpolar{90}{1.2\pgf@circ@res@right}} \pgfpatharc{90}{-20}{1.2\pgf@circ@res@right} - \pgfsetarrowsend{latexslim} + \pgfcirc@set@arrows{switch}{}{latexslim} \pgfsetbeveljoin \pgfusepath{draw} \endpgfscope @@ -3801,7 +3873,7 @@ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}} \pgfpatharc{-10}{90}{1.2\pgf@circ@res@right} - \pgfsetarrowsend{latexslim} + \pgfcirc@set@arrows{switch}{}{latexslim} \pgfsetbeveljoin \pgfusepath{draw} \endpgfscope @@ -4059,7 +4131,7 @@ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node \pgfpathmoveto{\pgfpointpolar{70}{1.2\pgf@circ@res@right}} \pgfpatharc{70}{-10}{1.2\pgf@circ@res@right} - \pgfsetarrowsend{latexslim} + \pgfcirc@set@arrows{switch}{}{latexslim} \pgfusepath{draw} } @@ -4071,7 +4143,7 @@ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node \pgfpathmoveto{\pgfpointpolar{-10}{1.2\pgf@circ@res@right}} \pgfpatharc{-10}{60}{1.2\pgf@circ@res@right} - \pgfsetarrowsend{latexslim} + \pgfcirc@set@arrows{switch}{}{latexslim} \pgfusepath{draw} } @@ -4358,7 +4430,7 @@ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node \pgfpathmoveto{\pgfpointpolar{70}{1.5\pgf@circ@res@right}} \pgfpatharc{70}{-50}{1.5\pgf@circ@res@right} - \pgfsetarrowsend{latexslim} + \pgfcirc@set@arrows{switch}{}{latexslim} \pgfusepath{draw} } @@ -4367,10 +4439,9 @@ { \pgf@circ@setlinewidth{bipoles}{\pgflinewidth} \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node - \pgfsetarrowsstart{latexslim} + \pgfcirc@set@arrows{switch}{latexslim}{latexslim} \pgfpathmoveto{\pgfpointpolar{-60}{1.5\pgf@circ@res@right}} \pgfpatharc{-60}{60}{1.5\pgf@circ@res@right} - \pgfsetarrowsend{latexslim} \pgfusepath{draw} } @@ -4381,7 +4452,7 @@ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} % in node \pgfpathmoveto{\pgfpointpolar{-50}{1.5\pgf@circ@res@right}} \pgfpatharc{-50}{70}{1.5\pgf@circ@res@right} - \pgfsetarrowsend{latexslim} + \pgfcirc@set@arrows{switch}{}{latexslim} \pgfusepath{draw} } % %>>> |