summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2017-03-08 22:59:29 +0000
committerKarl Berry <karl@freefriends.org>2017-03-08 22:59:29 +0000
commit147bfcd0c0aafd20e8893a1be104f51602906d5e (patch)
tree5f2fa1794dd7413d2770769d9c4072909bf93f5d /Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
parentca4dab97ce02af391dc3582183a1c50d5709535f (diff)
circuitikz (8mar17)
git-svn-id: svn://tug.org/texlive/trunk@43430 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex')
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex107
1 files changed, 67 insertions, 40 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
index a66e907e656..28470321cd8 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
@@ -329,7 +329,7 @@
}
-%% Battery 1
+%% Battery 1 % poles with equl thickness
\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery1/height}}{battery1}{\ctikzvalof{bipoles/battery1/height}}{\ctikzvalof{bipoles/battery1/width}}{
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
@@ -344,15 +344,29 @@
\pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
-
+ \pgfusepath{draw}
+}
+%% Battery 2 % negative pole thicker
+\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/battery2/height}}{battery2}{\ctikzvalof{bipoles/battery2/height}}{\ctikzvalof{bipoles/battery2/width}}{
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{0}}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{0}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@left}{\pgf@circ@res@down}}
+ \pgfusepath{draw}
+ \pgfsetlinewidth{3\pgflinewidth}
+ \pgfpathmoveto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{.33\pgf@circ@res@right}{.5\pgf@circ@res@down}}
\pgfusepath{draw}
}
-
%% cute inductor
\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/cuteinductor/lower coil height}}{cuteinductor}{\ctikzvalof{bipoles/cuteinductor/height}}{\ctikzvalof{bipoles/cuteinductor/width}}{
@@ -422,10 +436,10 @@
\pgf@circ@res@other = \ctikzvalof{bipoles/americaninductor/coil height}\pgf@circ@Rlen
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {1,...,\ctikzvalof{bipoles/americaninductor/coils}}
+ {
\pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
- \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
- \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
- \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ }
\pgfsetbuttcap
\pgfsetbeveljoin
\pgfusepath{stroke}
@@ -443,10 +457,10 @@
\pgf@circ@res@other = \ctikzvalof{bipoles/vamericaninductor/coil height}\pgf@circ@Rlen
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{-\pgfverticaltransformationadjustment*0.4*\pgfstartlinewidth}}%correct value would be 0.5 but arcs are not really flat, therefore 0.4 is better is (almost) all cases
+ \foreach \x in {1,...,\ctikzvalof{bipoles/vamericaninductor/coils}}
+ {
\pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
- \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
- \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
- \pgfpatharc{180}{0}{\pgf@circ@res@step and \pgf@circ@res@other}
+ }
\pgfsetbuttcap
\pgfsetbeveljoin
\pgfusepath{stroke}
@@ -875,8 +889,16 @@
\pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{\pgf@circ@res@zero}}
\pgfusepath{draw}
\pgfscope
- \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
- \pgfnode{currarrow}{center}{}{}{\pgfusepath{draw}}
+ \ifpgf@circ@oldvoltagedirection
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \else
+ \ifpgf@circuit@bipole@current@backward
+ \pgftransformshift{\pgfpoint{-.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \pgftransformrotate{180}
+ \else
+ \pgftransformshift{\pgfpoint{.5\pgf@circ@res@right}{\pgf@circ@res@zero}}
+ \fi\fi
+ \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
\endpgfscope
}
@@ -1719,6 +1741,16 @@
\ctikzset{*-d/.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=diamond}}
\ctikzset{d-d/.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=diamond}}
+\ctikzset{.-/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=none}}
+\ctikzset{.-*/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=full}}
+\ctikzset{.-o/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=empty}}
+\ctikzset{.-d/.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=diamond}}
+\ctikzset{-./.style = {\circuitikzbasekey/bipole/nodes/left=none, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{o-./.style = {\circuitikzbasekey/bipole/nodes/left=empty, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{*-./.style = {\circuitikzbasekey/bipole/nodes/left=full, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{d-./.style = {\circuitikzbasekey/bipole/nodes/left=diamond, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+\ctikzset{.-./.style = {\circuitikzbasekey/bipole/nodes/left=rectjoinfill, \circuitikzbasekey/bipole/nodes/right=rectjoinfill}}
+
\tikzset{reversed/.style = {\circuitikzbasekey/bipole/inverted=true}}
@@ -1727,29 +1759,41 @@
\def\drawpoles{
\pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{diamond} }
\ifx\pgf@temp\pgf@circ@temp
- { (\tikztostart) node[diamondpole] {} }
+ (\tikztostart) node[diamondpole] {}
\else
- \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/left}} \def\pgf@temp{empty} }
+ \pgfextra{ \def\pgf@temp{empty} }
\ifx\pgf@temp\pgf@circ@temp
- { (\tikztostart) node[ocirc] {} }
+ (\tikztostart) node[ocirc] {}
\else
- \pgfextra{ \def\pgf@temp{full} }
- \ifx\pgf@temp\pgf@circ@temp
- { (\tikztostart) node[circ] {} }
+ \pgfextra{ \def\pgf@temp{full} }
+ \ifx\pgf@temp\pgf@circ@temp
+ (\tikztostart) node[circ] {}
+ \else
+ \pgfextra{ \def\pgf@temp{rectjoinfill} }
+ \ifx\pgf@temp\pgf@circ@temp
+ (\tikztostart) node[rectjoinfill] {}
+ \else
+ \fi
\fi
\fi
\fi
\pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} \def\pgf@temp{diamond} }
\ifx\pgf@temp\pgf@circ@temp
- { (\tikztotarget) node[diamondpole] {} }
+ (\tikztotarget) node[diamondpole] {}
\else
- \pgfextra{ \edef\pgf@circ@temp{\ctikzvalof{bipole/nodes/right}} \def\pgf@temp{empty} }
+ \pgfextra{ \def\pgf@temp{empty} }
\ifx\pgf@temp\pgf@circ@temp
- { (\tikztotarget) node[ocirc] {} }
+ (\tikztotarget) node[ocirc] {}
\else
- \pgfextra{ \def\pgf@temp{full} }
- \ifx\pgf@temp\pgf@circ@temp
- { (\tikztotarget) node[circ] {} }
+ \pgfextra{ \def\pgf@temp{full} }
+ \ifx\pgf@temp\pgf@circ@temp
+ (\tikztotarget) node[circ] {}
+ \else
+ \pgfextra{ \def\pgf@temp{rectjoinfill} }
+ \ifx\pgf@temp\pgf@circ@temp
+ (\tikztotarget) node[rectjoinfill] {}
+ \else
+ \fi
\fi
\fi
\fi
@@ -1757,23 +1801,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
%% Lamp
\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/lamp/height}}{lamp}{\ctikzvalof{bipoles/lamp/height}}{\ctikzvalof{bipoles/lamp/width}}{