diff options
author | Norbert Preining <norbert@preining.info> | 2022-04-23 03:00:42 +0000 |
---|---|---|
committer | Norbert Preining <norbert@preining.info> | 2022-04-23 03:00:42 +0000 |
commit | 4acee1a3ab0aae587d4f0a4327141056ee7e6081 (patch) | |
tree | 1cde72d1e942ae756d750c665cd346533074171b /graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex | |
parent | c65c806536b3d6b228d5d71f0e0c835968a3733a (diff) |
CTAN sync 202204230300
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex')
-rw-r--r-- | graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex | 440 |
1 files changed, 278 insertions, 162 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex index d41ba541b3..94212962fb 100644 --- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex +++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex @@ -246,6 +246,7 @@ {\ctikzvalof{bipoles/generic/height}} {\ctikzvalof{bipoles/generic/width}} { + % \pgf@circ@debug@colors \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgf@circ@draworfill @@ -420,7 +421,6 @@ \endpgfscope \pgfsetlinewidth{\pgfstartlinewidth} - \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$} \pgfsetarrowsend{latexslim} \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}} @@ -428,6 +428,8 @@ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}} \pgfusepath{draw} + \pgf@circ@text@strokecolor + \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$} } %% Thermistor NTC @@ -450,7 +452,6 @@ \endpgfscope \pgfsetlinewidth{\pgfstartlinewidth} - \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$} \pgfsetarrowsend{latexslim} \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}} @@ -458,6 +459,8 @@ \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfusepath{draw} + \pgf@circ@text@strokecolor + \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\pgf@circ@font@tiny$\vartheta$} } %% Varistor @@ -480,7 +483,7 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfusepath{draw} \endpgfscope - + \pgf@circ@text@strokecolor \pgftext[top,x=.65\pgf@circ@res@left,y=1.2\pgf@circ@res@down]{{\pgf@circ@font@tiny\textsf{U}}} } @@ -896,25 +899,28 @@ {\ctikzvalof{bipoles/ecapacitor/height}} {\ctikzvalof{bipoles/ecapacitor/width}} { - \pgfsetrectcap - % % % Draw plus pole - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgf@circ@draworfill - % % Draw minus pole - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfsetfillcolor{\ctikzvalof{color}} - \pgfusepath{draw,fill} - \pgfsetfillcolor{\ctikzvalof{color}} + \pgfscope + \pgfsetrectcap + % % % Draw plus pole + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgf@circ@draworfill + % % Draw minus pole + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgf@circ@setcolor + \pgf@circ@fill@strokecolor + \pgfusepath{draw,fill} + \endpgfscope % % plus pole annotation + \pgf@circ@text@strokecolor \pgftext[right,at=\pgfpoint{1.2\pgf@circ@res@left}{.6\pgf@circ@res@up}] {\ctikzvalof{bipoles/ecapacitor/font} $+$} } @@ -1125,14 +1131,38 @@ % % generic core anchor settings \ctikzset{bipoles/inductors/core distance/.initial={2pt}} +\ctikzset{bipoles/inductors/dot x distance/.initial={4pt}} +\ctikzset{bipoles/inductors/dot y distance/.initial={1pt}} \def\pgfcir@basic@core@anchors{% \saveddimen{\coredistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/core distance}}} + \saveddimen{\dotXdistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/dot x distance}}} + \saveddimen{\dotYdistance}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{bipoles/inductors/dot y distance}}} \anchor{core east}{% \northeast\advance\pgf@y by\coredistance } \anchor{core west}{% \northeast\advance\pgf@y by\coredistance\pgf@x=-\pgf@x } + \anchor{ll dot}{% + \southwestborder + \advance\pgf@x by -\dotXdistance + \advance\pgf@y by -\dotYdistance + } + \anchor{ul dot}{% + \northeastborder + \advance\pgf@x by \dotXdistance\pgf@x=-\pgf@x + \advance\pgf@y by \dotYdistance + } + \anchor{lr dot}{% + \southwestborder + \advance\pgf@x by -\dotXdistance\pgf@x=-\pgf@x + \advance\pgf@y by -\dotYdistance + } + \anchor{ur dot}{% + \northeastborder + \advance\pgf@x by \dotXdistance + \advance\pgf@y by \dotYdistance + } } % \ctikzset{bipoles/americaninductor/height/.initial=.3} @@ -1524,6 +1554,7 @@ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgf@circ@fill@strokecolor \pgfusepath{draw,fill} } @@ -1543,6 +1574,7 @@ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgf@circ@fill@strokecolor \pgfusepath{draw,fill} \pgfscope \pgf@circ@set@relative@thickness{modifier thickness} @@ -1575,6 +1607,7 @@ \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{.4\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{.4\pgf@circ@res@down}} \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgf@circ@fill@strokecolor \pgfusepath{draw,fill} \pgfscope @@ -1772,6 +1805,12 @@ \pgfkeys{tikz/tert/wye/.add code={}{\pgf@circ@tert@wyetrue}} \pgfkeys{tikz/tert/zig/.add code={}{\pgf@circ@tert@zigtrue}}% +% nullator and norator +\ctikzset{bipoles/nullator/height/.initial=.30} +\ctikzset{bipoles/nullator/width/.initial=.60} +\ctikzset{bipoles/norator/height/.initial=.25} +\ctikzset{bipoles/norator/width/.initial=.60}%must be greater than 2*height + %%>>> %% Nodes definitions for sources%<<< @@ -1929,12 +1968,14 @@ {\ctikzvalof{bipoles/vsourceam/width}} { - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} - \pgf@circ@draworfill - \pgfsetcolor{\ctikzvalof{color}} + \pgfscope + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgf@circ@draworfill + \endpgfscope + \pgf@circ@text@strokecolor \ifpgf@circ@oldvoltagedirection - \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{\ctikzvalof{bipoles/vsourceam/inner plus}} + \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{\ctikzvalof{bipoles/vsourceam/inner plus}} \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@up]{\ctikzvalof{bipoles/vsourceam/inner minus}} \else \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/vsourceam/margin}\pgf@circ@res@down]{\ctikzvalof{bipoles/vsourceam/inner minus}} @@ -2075,14 +2116,13 @@ \pgf@circ@draworfill % Draw triangle - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@right}{0}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgf@circ@draworfill - - \pgfusepath{draw} + \pgfusepath{draw} } %% Empty Source @@ -2109,8 +2149,10 @@ { \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfpathmoveto{\pgfpointorigin} - \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} - \pgf@circ@maybefill + \pgfscope + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgf@circ@maybefill + \endpgfscope \edef\@@angle{\ctikzvalof{bipoles/dcisource/angle}} \pgfpathmoveto{\pgfpointpolar{\@@angle}{\pgf@circ@res@up}} \pgfpatharc{\@@angle}{-\@@angle}{\pgf@circ@res@up} @@ -2636,15 +2678,16 @@ {\ctikzvalof{bipoles/cvsourceam/height}} {\ctikzvalof{bipoles/cvsourceam/width}} { - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} - \pgfpathclose - \pgf@circ@draworfill - - \pgfsetcolor{\ctikzvalof{color}} + \pgfscope + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@zero}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@zero}{\pgf@circ@res@down}} + \pgfpathclose + \pgf@circ@draworfill + \endpgfscope + \pgf@circ@text@strokecolor \ifpgf@circ@oldvoltagedirection \pgftext[bottom,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@left]{\ctikzvalof{bipoles/cvsourceam/inner plus}} \pgftext[top,rotate=90,y=\ctikzvalof{bipoles/cvsourceam/margin}\pgf@circ@res@right]{\ctikzvalof{bipoles/cvsourceam/inner minus}} @@ -2957,6 +3000,49 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{.6\pgf@circ@res@down}} \pgfsetroundcap\pgfusepath{draw} } + +% nullator +\pgfcircdeclarebipolescaled{sources} +{} +{\ctikzvalof{bipoles/nullator/height}} +{nullator} +{\ctikzvalof{bipoles/nullator/height}} +{\ctikzvalof{bipoles/nullator/width}} +{ + \pgfpointorigin + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgf@circ@draworfill +} +% norator +\pgfcircdeclarebipolescaled{sources} +{} +{\ctikzvalof{bipoles/norator/height}} +{norator} +{\ctikzvalof{bipoles/norator/height}} +{\ctikzvalof{bipoles/norator/width}} +{ + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgf@circ@res@other=\dimexpr\pgf@circ@res@right-\pgf@circ@res@up\relax + \pgfmathsetmacro{\@@angle}{atan2(\pgf@circ@res@other,\pgf@circ@res@up)} + % \typeout{ANGLE\space\@@angle} + \pgfmathsetlength{\pgf@circ@res@step}{\pgf@circ@res@up*cos(\@@angle)} + \pgfmathsetlength{\pgf@circ@res@temp}{\pgf@circ@res@up*sin(\@@angle)} + % right semicircle + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgf@circ@res@temp}} + \pgfpatharc{180-\@@angle}{-180+\@@angle}{\pgf@circ@res@up} + % connect to left semicircle + \pgfpathlineto + {\pgfpoint{-\pgf@circ@res@other+\pgf@circ@res@step}{\pgf@circ@res@temp}} + % left semicircle + \pgfpatharc{\@@angle}{360-\@@angle}{\pgf@circ@res@up} + % connect to right semicircle + \pgfpathlineto + {\pgfpoint{\pgf@circ@res@other-\pgf@circ@res@step}{\pgf@circ@res@temp}} + \pgfpathclose + \pgf@circ@draworfill +} + % %>>> %% Paths definitions for Sources%<<< @@ -3119,6 +3205,10 @@ \pgfcirc@style@to@style{noise current source}{isourceN} \pgfcirc@style@to@style{noise current source}{nI} +% norator, nullator +\pgfcirc@activate@bipole@simple{l}{nullator} +\pgfcirc@activate@bipole@simple{l}{norator} + % build alias with voltage and current directions (legacy) \def\pgf@temp#1{ @@ -3140,6 +3230,7 @@ \pgf@temp{>} \pgf@temp{<} \pgf@temp{^} \pgf@temp{_} % %>>> + %%%%%%%%%%%%%% %% Diodes %%%%%%%%%%%%%% @@ -3239,6 +3330,18 @@ %% Node components for diodes %<<<1 +% beware, this shift to the left the coordinates +\def\pgf@circ@fulldiode@triangle@shift{% + \pgftransformxshift{\pgf@circ@res@left} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} + \pgf@circ@fill@strokecolor + \pgfusepath{draw,fill} + % \pgf@circ@debug@colors +} + %% Black generic diode \pgfcircdeclarebipolescaled{diodes} {} @@ -3249,14 +3352,8 @@ { \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} + \pgf@circ@fulldiode@triangle@shift \endpgfscope \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} @@ -3271,21 +3368,12 @@ {\ctikzvalof{bipoles/diode/height}} {\ctikzvalof{bipoles/diode/width}} { - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope + \pgf@circ@fulldiode@triangle@shift + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfusepath{draw} } %% Black alternative zigzag Zener diode @@ -3298,22 +3386,13 @@ {\ctikzvalof{bipoles/diode/height}} {\ctikzvalof{bipoles/diode/width}} { - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-1.8\pgf@circ@res@left}{\pgf@circ@res@down-0.5\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.2\pgf@circ@res@left}{\pgf@circ@res@up-0.5\pgf@circ@res@down}} - \pgfusepath{draw} - \endpgfscope + \pgf@circ@fulldiode@triangle@shift + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-1.8\pgf@circ@res@left}{\pgf@circ@res@down-0.5\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-0.2\pgf@circ@res@left}{\pgf@circ@res@up-0.5\pgf@circ@res@down}} + \pgfusepath{draw} } %% Black Schottky diode @@ -3324,26 +3403,16 @@ {\ctikzvalof{bipoles/diode/height}} {\ctikzvalof{bipoles/diode/width}} { - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{.6\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{.6\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope - + \pgf@circ@fulldiode@triangle@shift + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{.6\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-1.4\pgf@circ@res@left}{.6\pgf@circ@res@up}} + \pgfusepath{draw} } %% Black tunnel diode @@ -3354,22 +3423,13 @@ {\ctikzvalof{bipoles/diode/height}} {\ctikzvalof{bipoles/diode/width}} { - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} - - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}} - \pgfusepath{draw} - \endpgfscope + \pgf@circ@fulldiode@triangle@shift + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@down}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-.6\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfusepath{draw} } % @@ -3377,6 +3437,7 @@ % \def\pgf@circ@draw@ledarrows{% \pgfsetlinewidth{\pgfstartlinewidth} + \pgf@circ@fill@strokecolor \pgfsetarrowsend{latexslim} \ifpgf@led@fliparrows \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}} @@ -3399,6 +3460,7 @@ % \def\pgf@circ@draw@pdarrows{% \pgfsetlinewidth{\pgfstartlinewidth} + \pgf@circ@fill@strokecolor \pgfsetarrowsstart{latexslim} \ifpgf@pd@fliparrows \pgfpathmoveto{\pgfpoint{0pt}{0.8\pgf@circ@res@up}} @@ -3421,6 +3483,7 @@ % \def\pgf@circ@draw@laserarrows{% \pgfsetlinewidth{\pgfstartlinewidth} + \pgf@circ@fill@strokecolor \pgfsetarrowsend{latexslim} \pgfpathmoveto{\pgfpoint{-0.4\pgf@circ@res@right}{1.1\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{-0.4\pgf@circ@res@right}{2.1\pgf@circ@res@up}} @@ -3439,20 +3502,13 @@ {\ctikzvalof{bipoles/diode/height}} {\ctikzvalof{bipoles/diode/width}} { - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} + \pgf@circ@fulldiode@triangle@shift \endpgfscope \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfusepath{draw} - \pgf@circ@draw@ledarrows } @@ -3466,22 +3522,15 @@ {\ctikzvalof{bipoles/diode/height}} {\ctikzvalof{bipoles/diode/width}} { - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} + \pgf@circ@fulldiode@triangle@shift \endpgfscope \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfusepath{draw} - \pgf@circ@draw@laserarrows } @@ -3495,20 +3544,13 @@ {\ctikzvalof{bipoles/diode/height}} {\ctikzvalof{bipoles/diode/width}} { - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} \pgfscope - \pgftransformxshift{\pgf@circ@res@left} - \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}} - \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}} - \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-\pgf@circ@res@left}{0pt}} - \pgfusepath{draw,fill} + \pgf@circ@fulldiode@triangle@shift \endpgfscope \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} \pgfusepath{draw} - \pgf@circ@draw@pdarrows } @@ -3526,6 +3568,7 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{0pt}} + \pgf@circ@fill@strokecolor \pgfusepath{draw,fill} % \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right-2\pgf@circ@res@temp}{\pgf@circ@res@down}} @@ -3821,6 +3864,7 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{-1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} + \pgf@circ@fill@strokecolor \pgfusepath{draw, fill} \pgfsetlinewidth{\pgfstartlinewidth} @@ -3865,6 +3909,7 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{0pt}} \pgfpathclose \ifnum#2=0\relax + \pgf@circ@fill@strokecolor \pgfusepath{draw,fill} \else \pgf@circ@draworfill @@ -3884,7 +3929,7 @@ \fi % draw the gate thing; - #4 + #4% % draw the leads in/out \pgfpathmoveto{\pgfpoint{\pgf@circ@res@other}{0pt}} @@ -4076,7 +4121,8 @@ \pgfpathlineto{\pgfpoint{\pgf@circ@res@step}{1.414*(\pgf@circ@res@other-\pgf@circ@res@step)}} \ifnum#2=0\relax - \pgfusepath{draw,fill} + \pgf@circ@fill@strokecolor + \pgfusepath{draw,fill} \else \pgf@circ@draworfill \fi @@ -4520,7 +4566,7 @@ {\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 + % If connecting nodes are scaled, we have to modify this \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen \pgf@circ@res@temp=\ctikzvalof{bipoles/cuteswitch/thickness}\pgf@circ@res@temp \pgfsetlinewidth{2\pgf@circ@res@temp} @@ -4529,7 +4575,8 @@ \pgfsetroundcap\pgfusepath{draw} \endpgfscope \pgfscope % arrow - #3 + \pgf@circ@fill@strokecolor + #3% \endpgfscope \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}} \pgfnode{\cshape}{center}{}{\thisshape-in}{\pgfusepath{draw}} @@ -4695,8 +4742,8 @@ \pgf@x=-\pgf@x \pgf@y=-\pgf@y } - \backgroundpath{ - \pgfsetcolor{\ctikzvalof{color}} + \pgf@circ@draw@component{ + \pgf@circ@setcolor \northwest \pgf@circ@res@up = \pgf@y @@ -4798,8 +4845,8 @@ \anchor{north west}{ \northwest } \anchor{south east}{ \northwest \pgf@x=-\pgf@x \pgf@y=-\pgf@y } - \backgroundpath{ - \pgfsetcolor{\ctikzvalof{color}} + \pgf@circ@draw@component{ + \pgf@circ@setcolor \northwest \pgf@circ@res@up = \pgf@y \pgf@circ@res@down = -\pgf@y @@ -4816,7 +4863,8 @@ \pgfsetroundcap\pgfusepath{draw} \endpgfscope \pgfscope % arrow - #3 + \pgf@circ@fill@strokecolor + #3% \endpgfscope % terminals \pgfscope @@ -5151,9 +5199,11 @@ {\ctikzvalof{bipoles/esource/width}} { \pgfpointorigin - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} - \pgf@circ@draworfill + \pgfscope + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgf@circ@draworfill + \endpgfscope % draw the text label % get the rotation \ifpgf@circuit@straightinstruments @@ -5164,7 +5214,7 @@ \fi % and unrotate the scope \pgfscope - \pgfsetcolor{\ctikzvalof{color}} + \pgf@circ@text@strokecolor \pgftransformrotate{\rot} \pgftext[center,x=0,y=0]{\ctikzvalof{bipoles/twoport/text}} \endpgfscope @@ -5179,9 +5229,11 @@ {\ctikzvalof{bipoles/esource/width}} { \pgfpointorigin - \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} - \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} - \pgf@circ@draworfill + \pgfscope + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathellipse{\pgfpointorigin}{\pgfpoint{0}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@left}{0}} + \pgf@circ@draworfill + \endpgfscope % draw the text label % get the rotation \ifpgf@circuit@straightinstruments @@ -5193,7 +5245,7 @@ % and unrotate the scope \pgfscope \pgftransformrotate{\rot} - \pgfsetcolor{\ctikzvalof{color}} + \pgf@circ@setcolor \pgfsetlinewidth{\pgfstartlinewidth} % arrow: create a center hole to have better visual \pgfscope @@ -5212,6 +5264,7 @@ \pgfpathlineto{\pgfpoint{.8\pgf@circ@res@right}{1.2\pgf@circ@res@up}} \pgfusepath{draw} \endpgfscope + \pgf@circ@text@strokecolor \pgftext[center]{\ctikzvalof{bipoles/twoport/text}} \endpgfscope } @@ -5268,6 +5321,7 @@ \pgfpathlineto{\pgfpointpolar{80}{2.4\pgf@circ@res@up}} \pgfusepath{draw} \endpgfscope + \pgf@circ@text@strokecolor \pgftext[center, y=0.5\pgf@circ@res@down]{\ctikzvalof{bipoles/twoport/text}} \endpgfscope } @@ -5302,7 +5356,7 @@ \pgfscope \pgfsetcornersarced{\pgfpoint{\pgf@circ@res@step}{\pgf@circ@res@step}} \pgfpathrectanglecorners{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} - \pgf@circ@draworfill + \pgf@circ@draworfill \endpgfscope \def\@starta{103}\def\@stopa{77} \pgfsetlinewidth{\pgfstartlinewidth} @@ -5318,7 +5372,7 @@ \pgfusepath{draw} \pgf@circ@draworfill \endpgfscope - #2 + #2% \endpgfscope } } @@ -5401,7 +5455,7 @@ \pgf@circ@res@left=-\pgf@circ@res@right \pgfscope \pgfstartlinewidth=\pgflinewidth - \pgfsetcolor{\ctikzvalof{color}} + \pgf@circ@setcolor % external ellipse \pgfscope \pgf@circ@setlinewidth{bipoles}{\pgflinewidth} @@ -5476,7 +5530,7 @@ \def\@minus{\pgfpointpolar{75}{\pgf@circ@res@step and \pgf@circ@res@other}} \pgfscope \pgfstartlinewidth=\pgflinewidth - \pgfsetcolor{\ctikzvalof{color}} + \pgf@circ@setcolor % external ellipse \pgfscope \pgf@circ@setlinewidth{bipoles}{\pgflinewidth} @@ -5823,8 +5877,8 @@ \pgf@y=-\pgf@y \pgf@x=0.5\pgf@x } - \behindbackgroundpath{ - \pgfsetcolor{\ctikzvalof{color}} + \pgf@circ@draw@component{ + \pgf@circ@setcolor \pgf@circ@scaled@Rlen=\scaledRlen \pgf@circ@res@step=\ctikzvalof{tripoles/elmech/width}\pgf@circ@scaled@Rlen \pgf@circ@res@up=\ctikzvalof{tripoles/elmech/height}\pgf@circ@scaled@Rlen @@ -5837,7 +5891,7 @@ \pgfseteorule \pgfusepath{clip} \pgfpathrectangle{\pgfpoint{-.25\pgf@circ@res@step}{-.5\pgf@circ@res@up}}{\pgfpoint{.5\pgf@circ@res@step}{\pgf@circ@res@up}} - \pgfsetfillcolor{\ctikzvalof{color}} + \pgf@circ@fill@strokecolor \pgfusepath{fill, draw} \endpgfscope \pgfpathcircle{\pgfpoint{0}{0}} {0.5\pgf@circ@res@step} @@ -6091,6 +6145,7 @@ \pgfusepath{draw} \pgfpathrectanglecorners{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@up}}{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}} + \pgf@circ@fill@strokecolor \pgfusepath{stroke,fill} } @@ -6223,5 +6278,66 @@ \pgfcirc@activate@bipole@simple{l}{loudspeaker} % %>>> +%% Buzzer and reverse buzzer %<<< +\ctikzset{bipoles/buzzer/height/.initial=0.6} +\ctikzset{bipoles/buzzer/width/.initial=.4}% +\ctikzset{bipoles/buzzer/span/.initial=.6}% + +\pgfcircdeclarebipolescaled{misc} +{} +{0} +{buzzer} +{\ctikzvalof{bipoles/buzzer/height}} +{\ctikzvalof{bipoles/buzzer/width}}{ + % this is the height of the semicircle + \pgf@circ@res@other=\dimexpr\pgf@circ@res@up-\pgf@circ@res@right\relax + \pgfscope + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@other}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@other}} + \pgfpatharc{0}{180}{\pgf@circ@res@right} + \pgfpathclose + \pgf@circ@draworfill + \endpgfscope + \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@left}{\pgf@circ@res@other}} + \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@right}{\pgf@circ@res@other}} + \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfusepath{draw} +} +\pgfcirc@activate@bipole@simple{l}{buzzer} +% +\pgfcircdeclarebipolescaled{misc} +{} +{0} +{rbuzzer} +{\ctikzvalof{bipoles/buzzer/height}} +{\ctikzvalof{bipoles/buzzer/width}}{ + % this is the height of the semicircle + \pgf@circ@res@other=\dimexpr\pgf@circ@res@up-\pgf@circ@res@right\relax + % this is the height where the pins touch the semicircle + \pgfmathsetlength\pgf@circ@res@temp{\pgf@circ@res@up- + \pgf@circ@res@right*sqrt(1-\ctikzvalof{bipoles/buzzer/span}*\ctikzvalof{bipoles/buzzer/span})} + \pgfscope + \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth} + \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@up}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}} + \pgfpatharc{0}{-180}{\pgf@circ@res@right} + \pgfpathclose + \pgf@circ@draworfill + \endpgfscope + \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@left}{\pgf@circ@res@temp}} + \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@left}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}} + \pgfpathmoveto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@right}{\pgf@circ@res@temp}} + \pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/buzzer/span}*\pgf@circ@res@right}{0pt}} + \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}} + \pgfusepath{draw} +} +\pgfcirc@activate@bipole@simple{l}{rbuzzer} +% %>>> + % end of pgfcircbipoles.tex % vim: set fdm=marker fmr=%<<<,%>>>: |