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.tex78
1 files changed, 62 insertions, 16 deletions
diff --git a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
index 626ed28812..b30e741458 100644
--- a/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
+++ b/graphics/pgf/contrib/circuitikz/tex/pgfcircbipoles.tex
@@ -632,13 +632,21 @@
\pgfusepath{draw}
\endpgfscope
}%
-
%% Zig-zag resistors
+% see https://github.com/circuitikz/circuitikz/discussions/814
+\ctikzset{resistors/zigzag stub/.initial=0}
+\ctikzset{resistors/zigzag hook/.code={}}
\def\pgf@circ@zigzag#1{%
+ \pgf@circ@res@temp=\ctikzvalof{resistors/zigzag stub}\pgf@circ@res@step
+ \advance \pgf@circ@res@step by -2\pgf@circ@res@temp
\divide \pgf@circ@res@step by \numexpr4*\zigs\relax
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \ifdim\pgf@circ@res@temp>0pt
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left+\pgf@circ@res@temp -\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \fi
\pgf@circ@res@other = \pgf@circ@res@left
+ \advance\pgf@circ@res@other by \pgf@circ@res@temp
\pgf@circ@count@a=\zigs\relax
% first half zig
\advance\pgf@circ@res@other by \pgf@circ@res@step
@@ -655,11 +663,14 @@
\advance\pgf@circ@res@other by 2\pgf@circ@res@step
\pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{#1\pgf@circ@res@down}}
\advance\pgf@circ@res@other by \pgf@circ@res@step
- \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \ifdim\pgf@circ@res@temp>0pt
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@other+\pgf@circ@res@temp+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \fi
\pgfsetbeveljoin
+ \pgfkeys{/tikz/circuitikz/resistors/zigzag hook}
\pgfusepath{draw}
}
-
%% Resistor
\pgfcircdeclarebipolescaled{resistors}
{
@@ -672,7 +683,7 @@
{
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgftransformationadjustments
- \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}*\scaledRlen}
\pgf@circ@zigzag{1}
}
@@ -692,7 +703,7 @@
{
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgftransformationadjustments
- \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/vresistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/vresistor/width}*\scaledRlen}
\pgf@circ@zigzag{.5}
\pgfscope
@@ -731,7 +742,7 @@
{
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgftransformationadjustments
- \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/potentiometer/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/potentiometer/width}*\scaledRlen}
\pgf@circ@zigzag{1}
\pgfscope
@@ -761,7 +772,7 @@
{%
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgftransformationadjustments
- \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistivesens/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistivesens/width}*\scaledRlen}
\pgf@circ@zigzag{.5}
\pgfscope
@@ -810,7 +821,7 @@
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right/\@@intscale+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{+0pt}}
\pgftransformationadjustments
- \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/ldresistor/width}*\scaledRlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
+ \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/ldresistor/width}*\scaledRlen}
\pgf@circ@zigzag{\@@hscale}
}%
@@ -6031,6 +6042,13 @@
\ctikzset{bipoles/qpprobe/voltage/additional shift/.initial=.5}
\ctikzset{bipoles/iloop/width/.initial=.40}
\ctikzset{bipoles/iloop/height/.initial=.60}
+% currtap see https://github.com/circuitikz/circuitikz/issues/807
+\ctikzset{bipoles/currtap/height/.initial=0.4}
+\ctikzset{bipoles/currtap/dot size/.initial=0.5}
+\ctikzset{bipoles/currtap/fill/.initial=default}
+\ctikzset{bipoles/currtap/dash/.initial=none}
+\ctikzset{bipoles/currtap/color/.initial=default}
+\ctikzset{bipoles/currtap/thickness/.initial=default}
\ctikzset{bipoles/oscope/height/.initial=.60}
\ctikzset{bipoles/oscope/width/.initial=.60}
@@ -6607,6 +6625,28 @@
\pgfusepath{draw}
\endpgfscope
}
+%% currtap
+\pgfcircdeclarebipolescaled{instruments}
+{
+ \savedmacro{\@@dotsize}{\def\@@dotsize{\ctikzvalof{bipoles/currtap/dot size}}}
+ \anchor{tap}{\northeast\pgf@x=0pt\pgf@y=\@@dotsize\pgf@y\pgf@y=-\pgf@y}
+}
+{\ctikzvalof{bipoles/currtap/height}}
+{currtap}
+{\ctikzvalof{bipoles/currtap/height}}
+{\ctikzvalof{bipoles/currtap/height}}
+{
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfpathlineto{\pgfpoint{0.95\pgf@circ@res@left}{0pt}}
+ \pgfpatharc{180}{0}{0.95\pgf@circ@res@right}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0pt}}
+ \pgfusepath{draw}
+ \pgf@circ@subset@color@dash{bipoles/currtap}
+ \pgf@circ@subset@thickness{bipoles/currtap}
+ \pgfusepath{draw}
+ \pgfpathcircle{\pgfpoint{0pt}{0pt}}{\@@dotsize*\pgf@circ@res@up}
+ \pgf@circ@subset@fill@or@draw{bipoles/currtap}
+}
% %>>>
% Path definitions for Instruments%<<<
@@ -6619,8 +6659,8 @@
\pgfcirc@activate@bipole@simple{l}{rmeterwa}
\pgfcirc@activate@bipole@simple{l}{smeter}
\pgfcirc@activate@bipole@simple{l}{iloop}
-% \pgfcirc@activate@bipole@simple{l}{iloop2} that was wrong
\pgfcirc@activate@bipole{l}{ilooptwo}{iloop2}{iloop2}
+\pgfcirc@activate@bipole@simple{l}{currtap}
\pgfcirc@activate@bipole@simple{l}{qvprobe}
\pgfcirc@activate@bipole@simple{l}{qiprobe}
\pgfcirc@activate@bipole@simple{l}{qpprobe}
@@ -6774,16 +6814,22 @@
% spring into the damper
\pgfscope
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@zero}}
+ \pgfscope
+ \pgftransformationadjustments
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
+ \pgfpathlineto{\pgfpoint{.95\pgf@circ@res@left}{\pgf@circ@res@zero}}
\pgfsetcornersarced{\pgfpoint{.25\pgf@circ@res@up}{.25\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{.75\pgf@circ@res@left}{.75\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{.5\pgf@circ@res@left}{-.75\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{.25\pgf@circ@res@left}{.75\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{0pt}{-.75\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{\ctikzvalof{bipoles/damper/length}\pgf@circ@res@right}{.75\pgf@circ@res@up}}
+ \pgfsetbuttcap
+ \pgfsetbeveljoin
\pgfusepath{stroke}
\endpgfscope
+ \endpgfscope
% damper box
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
@@ -7171,18 +7217,18 @@
{\ctikzvalof{bipoles/thermocouple/height}}
{\ctikzvalof{bipoles/thermocouple/width}}
{
+ \pgfsetrectcap
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
- \pgfusepath{draw}
- \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
- \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
\pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}}
- \pgfusepath{draw}
- \pgfsetlinewidth{\pgfstartlinewidth}
- \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{.5\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
\pgfusepath{draw}
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfsetroundcap
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{.5\pgf@circ@res@down}}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
}
%% fuse
\pgfcircdeclarebipolescaled{misc}