diff options
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex')
-rw-r--r-- | graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex | 228 |
1 files changed, 87 insertions, 141 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex index 36ddd5d079..d9b8e7ca4d 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex @@ -205,6 +205,35 @@ } } +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%% anchor adjustment macros +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +% Extend the border anchor position by the specified factors on the right-top (north east corner) +% and the left-down (southwest border). Argument must be number (possibly decimal) without sign + +\def\pgfcirc@border@extend@full#1#2#3#4{% right, top, left, down + \anchorborder{% + \ifpgf@circuit@bipole@inverted + \pgf@circ@res@left=-\pgf@x + \pgf@circ@res@up=-\pgf@y + \else + \pgf@circ@res@left=\pgf@x + \pgf@circ@res@up=\pgf@y + \fi + \ifdim\pgf@circ@res@up>0cm + \northeastborder + \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{#1\pgf@x}{#2\pgf@y}} + \else + \southwestborder + \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{-#3\pgf@x}{-#4\pgf@y}} + \fi + } +} + +% Just up and down (very common) +\def\pgfcirc@border@extend@updown#1#2{\pgfcirc@border@extend@full{1}{#1}{1}{#2}} + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %% Standard bipole shapes declarations %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -440,13 +469,14 @@ %% Thermistor \pgfcircdeclarebipolescaled{resistors} -{{% anchor for labelling the type of dependency +{% anchor for labelling the type of dependency \anchor{label}{% \southwest \pgf@x=0.4\pgf@x \pgf@y=1.2\pgf@y }% -}} + \pgfcirc@border@extend@updown{1}{1.2} +} {\ctikzvalof{bipoles/thermistor/height}} {thermistor} {\ctikzvalof{bipoles/thermistor/height}} @@ -713,6 +743,7 @@ \pgfcircdeclarebipolescaled{capacitors} { \anchor{label}{\southwest\pgf@x=2.6\pgf@x\pgf@y=1.2\pgf@y}% + \pgfcirc@border@extend@full{2.6}{1}{4.4}{1.2} } {\ctikzvalof{bipoles/capacitor/height}} {capacitivesens} @@ -943,6 +974,7 @@ } } \anchor{midtap}{\midtap} + \pgfcirc@border@extend@full{1}{2}{1.6}{2.6} } {\ctikzvalof{bipoles/cuteinductor/lower coil height}} {scuteinductor} @@ -1132,6 +1164,7 @@ } } \anchor{midtap}{\midtap} + \pgfcirc@border@extend@full{1}{2}{1.6}{2.6} } {\ctikzvalof{bipoles/americaninductor/height 2}} {samericaninductor} @@ -1227,6 +1260,7 @@ {% anchor for labelling the type of dependency \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} } {\ctikzvalof{bipoles/fullgeneric/height}} {sfullgeneric} @@ -1665,7 +1699,7 @@ \pgftransformscale{-.015\pgf@circ@res@left*#1} \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} \pgftransformrotate{-\pgfcircmathresult} - + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpointorigin} @@ -1682,16 +1716,16 @@ \pgftransformscale{-.015\pgf@circ@res@left*#1} \def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil} \pgftransformrotate{-\pgfcircmathresult} - + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathmoveto{\pgfpointorigin} \pgfpathlineto{\pgfpointpolar{90}{.5\pgf@circ@res@up}} \pgfpathlineto{\pgfpointpolar{60}{\pgf@circ@res@up}} - + \pgfpathmoveto{\pgfpointorigin} \pgfpathlineto{\pgfpointpolar{210}{.5\pgf@circ@res@up}} \pgfpathlineto{\pgfpointpolar{0}{\pgf@circ@res@down}} - + \pgfpathmoveto{\pgfpointorigin} \pgfpathlineto{\pgfpointpolar{330}{.5\pgf@circ@res@up}} \pgfpathlineto{\pgfpointpolar{-60}{\pgf@circ@res@up}} @@ -1707,7 +1741,7 @@ {\ctikzvalof{bipoles/oosourcetrans/height}} {\ctikzvalof{bipoles/oosourcetrans/width}} { - + \pgfpointorigin \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosourcetrans/circleoffset}\pgf@circ@res@left}{0}} @@ -1719,43 +1753,43 @@ \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosourcetrans/circleoffset}\pgf@circ@res@left}{0}} {\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@left} \pgfusepath{draw} - - + + % % % % draw inner symbols - + %%primary winding \ifpgf@circ@prim@delta \pgfscope \pgftransformxshift{\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@left} \pgf@circ@delta{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} \endpgfscope - + \else\ifpgf@circ@prim@wye \pgfscope \pgftransformxshift{\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@left} \pgf@circ@wye{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} \endpgfscope - + \else\ifpgf@circ@prim@zig \pgfscope \pgftransformxshift{\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@left} \pgf@circ@zig{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} \endpgfscope \fi\fi\fi - + %%secondary winding \ifpgf@circ@sec@delta \pgfscope \pgftransformxshift{\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@right} \pgf@circ@delta{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} \endpgfscope - + \else\ifpgf@circ@sec@wye \pgfscope \pgftransformxshift{\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@right} \pgf@circ@wye{\ctikzvalof{bipoles/oosourcetrans/vectorgroupscale}} \endpgfscope - + \else\ifpgf@circ@sec@zig \pgfscope \pgftransformxshift{\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@right} @@ -1767,7 +1801,7 @@ % % % % ooosource for three phase transformer \pgfcircdeclarebipolescaled{sources} -{ +{ \anchor{right}{ \northeast \pgf@y=0pt @@ -1814,7 +1848,7 @@ \anchor{centertert}{ \centertert } - + % add some anchors in case the are needed :) \anchor{prim1}{ \pgf@circ@scaled@Rlen=\ctikzvalof{bipoles/ooosource/height}\pgf@circ@Rlen @@ -1863,13 +1897,13 @@ {\ctikzvalof{bipoles/ooosource/height}} { % \pgf@circ@res@other = \ctikzvalof{bipoles/ooosource/vectorgroup} \pgf@circ@scaled@Rlen - + % % filling % left \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/ooosource/circleoffset}\pgf@circ@res@left}{0}}{\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@left} - \pgf@circ@maybefill - + \pgf@circ@maybefill + % up \pgfscope \pgfpointorigin @@ -1887,14 +1921,14 @@ % left \pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/ooosource/circleoffset}\pgf@circ@res@left}{0}}{\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@left} \pgfusepath{draw} - + % up \pgfscope \pgfpointorigin \pgfpathcircle{\pgfpointpolar{60}{\ctikzvalof{bipoles/ooosource/circleoffset}\pgf@circ@res@right}}{\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@right} \pgfusepath{draw} \endpgfscope - + % % % draw inner symbols % % primary winding @@ -1903,20 +1937,20 @@ \pgftransformxshift{\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@left} \pgf@circ@delta{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} \endpgfscope - + \else\ifpgf@circ@prim@wye \pgfscope \pgftransformxshift{.6\pgf@circ@res@left} \pgf@circ@wye{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} \endpgfscope - + \else\ifpgf@circ@prim@zig \pgfscope \pgftransformxshift{.6\pgf@circ@res@left} \pgf@circ@zig{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} \endpgfscope \fi\fi\fi - + % % secondary winding \ifpgf@circ@sec@delta \pgfscope @@ -1924,33 +1958,33 @@ \pgftransformshift{\pgfpointpolar{60}{\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@right}} \pgf@circ@delta{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} \endpgfscope - + \else\ifpgf@circ@sec@wye \pgfscope \pgftransformshift{\pgfpointpolar{60}{\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@right}} \pgf@circ@wye{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} \endpgfscope - + \else\ifpgf@circ@sec@zig \pgfscope \pgftransformshift{\pgfpointpolar{60}{\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@right}} \pgf@circ@zig{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} \endpgfscope \fi\fi\fi - + % % tertiary winding \ifpgf@circ@tert@delta \pgfscope \pgftransformshift{\pgfpointpolar{-60}{\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@right}} \pgf@circ@delta{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} \endpgfscope - + \else\ifpgf@circ@tert@wye \pgfscope \pgftransformshift{\pgfpointpolar{-60}{\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@right}} \pgf@circ@wye{\ctikzvalof{bipoles/ooosource/vectorgroupscale}} \endpgfscope - + \else\ifpgf@circ@tert@zig \pgfscope \pgftransformshift{\pgfpointpolar{-60}{\ctikzvalof{bipoles/ooosource/circlesize}\pgf@circ@res@right}} @@ -2437,22 +2471,7 @@ %% Black alternative zigzag Zener diode \pgfcircdeclarebipolescaled{diodes} {% fix the anchor border - \anchorborder{% - \ifpgf@circuit@bipole@inverted - \pgf@circ@res@left=-\pgf@x - \pgf@circ@res@up=-\pgf@y - \else - \pgf@circ@res@left=\pgf@x - \pgf@circ@res@up=\pgf@y - \fi - \ifdim\pgf@circ@res@up>0cm - \northeastborder - \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@x}{1.3\pgf@y}} - \else - \southwestborder - \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{-\pgf@x}{-1.3\pgf@y}} - \fi - } + \pgfcirc@border@extend@updown{1.3}{1.3} } {\ctikzvalof{bipoles/diode/height}} {fullzzdiode} @@ -2580,22 +2599,7 @@ %% Black light emitting diode \pgfcircdeclarebipolescaled{diodes} {% fix the anchor border - \anchorborder{% - \ifpgf@circuit@bipole@inverted - \pgf@circ@res@left=-\pgf@x - \pgf@circ@res@up=-\pgf@y - \else - \pgf@circ@res@left=\pgf@x - \pgf@circ@res@up=\pgf@y - \fi - \ifdim\pgf@circ@res@up>0cm - \northeastborder - \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@x}{1.8\pgf@y}} - \else - \southwestborder - \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{-\pgf@x}{-\pgf@y}} - \fi - } + \pgfcirc@border@extend@updown{1.8}{1} } {\ctikzvalof{bipoles/diode/height}} {fulllediode} @@ -2622,22 +2626,7 @@ %% Black photodiode \pgfcircdeclarebipolescaled{diodes} {% fix the anchor border - \anchorborder{% - \ifpgf@circuit@bipole@inverted - \pgf@circ@res@left=-\pgf@x - \pgf@circ@res@up=-\pgf@y - \else - \pgf@circ@res@left=\pgf@x - \pgf@circ@res@up=\pgf@y - \fi - \ifdim\pgf@circ@res@up>0cm - \northeastborder - \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@x}{1.8\pgf@y}} - \else - \southwestborder - \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{-\pgf@x}{-\pgf@y}} - \fi - } + \pgfcirc@border@extend@updown{1.8}{1} } {\ctikzvalof{bipoles/diode/height}} {fullpdiode} @@ -2745,22 +2734,7 @@ %% Empty alternative zigzag Zener diode \pgfcircdeclarebipolescaled{diodes} {% fix the anchor border - \anchorborder{% - \ifpgf@circuit@bipole@inverted - \pgf@circ@res@left=-\pgf@x - \pgf@circ@res@up=-\pgf@y - \else - \pgf@circ@res@left=\pgf@x - \pgf@circ@res@up=\pgf@y - \fi - \ifdim\pgf@circ@res@up>0cm - \northeastborder - \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@x}{1.3\pgf@y}} - \else - \southwestborder - \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{-\pgf@x}{-1.3\pgf@y}} - \fi - } + \pgfcirc@border@extend@updown{1.3}{1.3} } {\ctikzvalof{bipoles/diode/height}} {emptyzzdiode} @@ -2826,22 +2800,7 @@ %% Empty light emitting diode \pgfcircdeclarebipolescaled{diodes} {% fix the anchor border - \anchorborder{% - \ifpgf@circuit@bipole@inverted - \pgf@circ@res@left=-\pgf@x - \pgf@circ@res@up=-\pgf@y - \else - \pgf@circ@res@left=\pgf@x - \pgf@circ@res@up=\pgf@y - \fi - \ifdim\pgf@circ@res@up>0cm - \northeastborder - \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@x}{1.8\pgf@y}} - \else - \southwestborder - \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{-\pgf@x}{-\pgf@y}} - \fi - } + \pgfcirc@border@extend@updown{1.8}{1} } {\ctikzvalof{bipoles/diode/height}} {emptylediode} @@ -2863,22 +2822,7 @@ %% Empty photodiode \pgfcircdeclarebipolescaled{diodes} {% fix the anchor border - \anchorborder{% - \ifpgf@circuit@bipole@inverted - \pgf@circ@res@left=-\pgf@x - \pgf@circ@res@up=-\pgf@y - \else - \pgf@circ@res@left=\pgf@x - \pgf@circ@res@up=\pgf@y - \fi - \ifdim\pgf@circ@res@up>0cm - \northeastborder - \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@x}{1.8\pgf@y}} - \else - \southwestborder - \pgfpointborderrectangle{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{-\pgf@x}{-\pgf@y}} - \fi - } + \pgfcirc@border@extend@updown{1.8}{1} } {\ctikzvalof{bipoles/diode/height}} {emptypdiode} @@ -3974,7 +3918,9 @@ %% Varistor \pgfcircdeclarebipolescaled{resistors} -{} +{ + \pgfcirc@border@extend@updown{1}{1.4} +} {\ctikzvalof{bipoles/varistor/height}} {varistor} {\ctikzvalof{bipoles/varistor/height}} @@ -5232,7 +5178,7 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfusepath{draw} - + % draw sin wave \pgfpathmoveto{\pgfpoint{-.76\pgf@circ@res@step}{.5\pgf@circ@res@step}} \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} @@ -5240,7 +5186,7 @@ \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} \pgfusepath{draw} - + % draw equal sign \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-.375\pgf@circ@res@step}} \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@step}{-0.375\pgf@circ@res@step}} @@ -5312,7 +5258,7 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfusepath{draw} - + % draw sin wave \pgfpathmoveto{\pgfpoint{.14\pgf@circ@res@step}{-.5\pgf@circ@res@step}} \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} @@ -5320,7 +5266,7 @@ \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} \pgfusepath{draw} - + % draw equal sign \pgfpathmoveto{\pgfpoint{-.2\pgf@circ@res@step}{.375\pgf@circ@res@step}} \pgfpathlineto{\pgfpoint{-0.7\pgf@circ@res@step}{0.375\pgf@circ@res@step}} @@ -5404,7 +5350,7 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfusepath{draw} - + % draw sin waves \pgfpathmoveto{\pgfpoint{-.76\pgf@circ@res@step}{.65\pgf@circ@res@step}} \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} @@ -5424,10 +5370,10 @@ \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} \pgfusepath{draw} - - - - + + + + % draw equal sign \pgfpathmoveto{\pgfpoint{.2\pgf@circ@res@step}{-.375\pgf@circ@res@step}} \pgfpathlineto{\pgfpoint{0.7\pgf@circ@res@step}{-0.375\pgf@circ@res@step}} @@ -5510,7 +5456,7 @@ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfusepath{draw} - + % draw sin waves \pgfpathmoveto{\pgfpoint{.14\pgf@circ@res@step}{-.65\pgf@circ@res@step}} \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} @@ -5530,10 +5476,10 @@ \pgfpathsine{\pgfpoint{.17\pgf@circ@res@step}{-.17\pgf@circ@res@step}} \pgfpathcosine{\pgfpoint{.17\pgf@circ@res@step}{.17\pgf@circ@res@step}} \pgfusepath{draw} - - - - + + + + % draw equal sign \pgfpathmoveto{\pgfpoint{-.2\pgf@circ@res@step}{.375\pgf@circ@res@step}} \pgfpathlineto{\pgfpoint{-0.7\pgf@circ@res@step}{0.375\pgf@circ@res@step}} |