summaryrefslogtreecommitdiff
path: root/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex')
-rw-r--r--graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex154
1 files changed, 152 insertions, 2 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
index 94212962fb..d09e907a8d 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
@@ -3239,6 +3239,9 @@
\ctikzset{bipoles/diode/height/.initial=.50}
\ctikzset{bipoles/diode/width/.initial=.40}
+% for horizontally-double-sided diodes, like tvs diodes (transorb)
+\ctikzset{bipoles/ddiode/width/.initial=.80}% must be 2*diode width
+% for vertically taller diodes
\ctikzset{bipoles/bidirectionaldiode/height/.initial=1.1}
\ctikzset{bipoles/bidirectionaldiode/width/.initial=1}
\ctikzset{bipoles/bidirectionaldiode/diode width left/.initial=.3}
@@ -3803,6 +3806,65 @@
\pgfusepath{draw}
}
+%% Transorbs
+%% Empty zigzag TVS diode (transorb)
+\pgfcircdeclarebipolescaled{diodes}
+{% fix the anchor border
+ \pgfcirc@border@extend@updown{1.3}{1.3}
+}
+{\ctikzvalof{bipoles/diode/height}}
+{emptytvsdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/ddiode/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgfscope
+ \pgftransformxscale{0.5}
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgf@circ@basicdiodeshape
+ \endpgfscope
+ \pgfscope
+ \pgftransformxscale{-0.5}
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgf@circ@basicdiodeshape
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{1.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{1.3\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \endpgfscope
+}
+%% Black zigzag TVS diode (transorb)
+\pgfcircdeclarebipolescaled{diodes}
+{% fix the anchor border
+ \pgfcirc@border@extend@updown{1.3}{1.3}
+}
+{\ctikzvalof{bipoles/diode/height}}
+{fulltvsdiode}
+{\ctikzvalof{bipoles/diode/height}}
+{\ctikzvalof{bipoles/ddiode/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfscope
+ \pgftransformxscale{0.5}
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgf@circ@fulldiode@triangle@shift
+ \endpgfscope
+ \pgfscope
+ \pgftransformxscale{-0.5}
+ \pgftransformxshift{\pgf@circ@res@left}
+ \pgf@circ@fulldiode@triangle@shift
+ \endpgfscope
+ \pgfpathmoveto{\pgfpoint{0.4\pgf@circ@res@left}{1.3\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0.4\pgf@circ@res@right}{1.3\pgf@circ@res@down}}
+ \pgfusepath{draw}
+}
+
+
%% Empty bidirectionaldiode
\pgfcircdeclarebipolescaled{diodes}
{}
@@ -4174,6 +4236,8 @@
\pgfcirc@style@to@style{#1 photodiode}{pD#2}
\pgfcirc@activate@bipole{l}{#1varcap}{#1varcap}{#1 varcap}
\pgfcirc@style@to@style{#1 varcap}{VC#2}
+ \pgfcirc@activate@bipole{l}{#1tvsdiode}{#1tvsdiode}{#1 TVS diode}
+ \pgfcirc@style@to@style{#1 TVS diode}{tvsD#2}
\pgfcirc@activate@bipole{l}{#1bidirectionaldiode}{#1bidirectionaldiode}{#1 bidirectionaldiode}
\pgfcirc@style@to@style{#1 bidirectionaldiode}{biD#2}
\pgfcirc@activate@bipole{l}{#1thyristor}{#1thyristor}{#1 thyristor}
@@ -4210,6 +4274,8 @@
\pgfcirc@style@to@style{#1 photodiode}{pD#2}
\pgfcirc@node@to@style{l}{emptyvarcap}{#1 varcap}{\circuitikzbasekey/bipole/is strokedsymbol=true}
\pgfcirc@style@to@style{#1 varcap}{VC#2}
+ \pgfcirc@node@to@style{l}{emptytvsdiode}{#1 TVS diode}{\circuitikzbasekey/bipole/is strokedsymbol=true}
+ \pgfcirc@style@to@style{#1 TVS diode}{tvsD#2}
\pgfcirc@node@to@style{l}{emptybidirectionaldiode}{#1 bidirectionaldiode}{\circuitikzbasekey/bipole/is strokedsymbol=true}
\pgfcirc@style@to@style{#1 bidirectionaldiode}{biD#2}
\pgfcirc@node@to@style{l}{emptythyristor}{#1 thyristor}{\circuitikzbasekey/bipole/is strokedsymbol=true}
@@ -4242,12 +4308,12 @@
\pgfcirc@style@to@style{led}{leD}
\pgfcirc@style@to@style{\pgfcircdiodestylemacro photodiode}{photodiode}
\pgfcirc@style@to@style{photodiode}{pD}
-
\pgfcirc@style@to@style{\pgfcircdiodestylemacro laser diode}{laser diode}
\pgfcirc@style@to@style{laser diode}{lasD}
-
\pgfcirc@style@to@style{\pgfcircdiodestylemacro varcap}{varcap}
\pgfcirc@style@to@style{varcap}{VC}
+\pgfcirc@style@to@style{\pgfcircdiodestylemacro TVS diode}{TVS diode}
+\pgfcirc@style@to@style{TVS diode}{tvsD}
\pgfcirc@style@to@style{\pgfcircdiodestylemacro bidirectionaldiode}{bidirectionaldiode}
\pgfcirc@style@to@style{bidirectionaldiode}{biD}
\pgfcirc@style@to@style{\pgfcircdiodestylemacro thyristor}{thyristor}
@@ -4966,6 +5032,90 @@
\pgfcirc@activate@bipole{l}{cuteopeningswitch}{cuteopeningswitch}{cute opening switch}
\pgfcirc@style@to@style{cute opening switch}{cogsw}% %>>>
+%% Proximity switch auxiliary shapes%<<<
+%% proximeter shape, for usage with switches
+\ctikzset{proximeter/width/.initial=0.3}
+\ctikzset{proximeter/hlines thickness/.initial=0.5}
+\ctikzset{proximeter/hlines position/.initial=0.3}
+\pgfdeclareshape{proximeter}
+{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{switches}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro{\hlinepos}{\edef\hlinepos{\ctikzvalof{proximeter/hlines position}}}
+ \savedanchor\northeast{%
+ \pgfmathsetlength{\pgf@y}{\ctikzvalof{proximeter/width}*\ctikzvalof{\ctikzclass/scale}*\pgf@circ@Rlen}
+ \pgf@x=\pgf@y
+ }
+ \anchor{center}{\pgfpointorigin}
+ % geo anchors based on north-east
+ \pgfcirc@northeast@symmetric@geoanchors
+ \anchor{text}{%
+ \northeast
+ \pgf@x=\dimexpr -.5\wd\pgfnodeparttextbox\relax
+ \advance\pgf@y by .6\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{hlines ne}{%
+ \northeast
+ \pgf@y=\hlinepos\pgf@y
+ \advance\pgf@x by -\pgf@y
+ }
+ \anchor{hlines nw}{%
+ \northeast
+ \pgf@y=\hlinepos\pgf@y
+ \advance\pgf@x by -\pgf@y\pgf@x=-\pgf@x
+ }
+ \anchor{hlines se}{%
+ \northeast
+ \pgf@y=\hlinepos\pgf@y
+ \advance\pgf@x by -\pgf@y
+ \pgf@y=-\pgf@y
+ }
+ \anchor{hlines sw}{%
+ \northeast
+ \pgf@y=\hlinepos\pgf@y
+ \advance\pgf@x by -\pgf@y\pgf@x=-\pgf@x
+ \pgf@y=-\pgf@y
+ }
+ \anchorborder{
+ % \typeout{IN\space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgfmathsetmacro{\@@switchx}{ifthenelse(\pgf@x>0,1,-1)}
+ \pgfmathsetmacro{\@@switchy}{ifthenelse(\pgf@y>0,1,-1)}
+ \pgfmathsetlength{\pgf@xa}{abs(\pgf@x)}
+ \pgfmathsetlength{\pgf@ya}{abs(\pgf@y)}
+ \pgfextracty{\pgf@circ@res@up}{\northeast}
+ % \typeout{MID\space X:\the\pgf@xa\space Y:\the\pgf@ya\space L:\the\pgf@circ@res@up}
+ % \typeout{MID\space SX:\@@switchx\space SY:\@@switchy}
+ \pgfpointintersectionoflines
+ {\pgfpointorigin}{\pgfqpoint{\pgf@xa}{\pgf@ya}}
+ {\pgfqpoint{0pt}{\pgf@circ@res@up}}{\pgfqpoint{\pgf@circ@res@up}{0pt}}
+ % \typeout{CROSS \space X:\the\pgf@x\space Y:\the\pgf@y}
+ \pgf@x=\@@switchx\pgf@x
+ \pgf@y=\@@switchy\pgf@y
+ }
+ \pgf@circ@draw@component{
+ \northeast\pgf@circ@res@temp=\pgf@y
+ \pgf@circ@setcolor
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@temp}{0pt}}
+ \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@temp}}
+ \pgfpathclose
+ \pgf@circ@draworfill
+ \pgfsetlinewidth{\ctikzvalof{proximeter/hlines thickness}*\pgflinewidth}
+ \pgfmathsetlength{\pgf@circ@res@up}{\hlinepos*\pgf@circ@res@temp}
+ \pgfmathsetlength{\pgf@circ@res@right}{\pgf@circ@res@temp-\pgf@circ@res@up}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{-\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ }
+
+}
+\pgfcirc@node@to@path{proximeter}{inline proximeter}{}
+% %>>>
+
%%%%%%%%%%%%%%%%%
%% Instruments
%%%%%%%%%%%%%%%%%