summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/circuitikz
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-06-01 21:07:44 +0000
committerKarl Berry <karl@freefriends.org>2021-06-01 21:07:44 +0000
commit7a08751902da1ad6b2400c35d26943af68d88574 (patch)
treed073f35a0539d07ce8a34b8a301f081e6fa35d77 /Master/texmf-dist/tex/generic/circuitikz
parentf6793bebbc42a626264c84d12b142609cd8b3750 (diff)
circuitikz (1jun21)
git-svn-id: svn://tug.org/texlive/trunk@59421 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/circuitikz')
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex47
1 files changed, 34 insertions, 13 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
index b29aea51355..6fc5db6b935 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
@@ -1648,6 +1648,12 @@
% noise sources
\ctikzset{bipoles/noise sources/fillcolor/.initial=gray!50}
+% for special symbols in the sources: sin, square, triangle, delta, wye, zig, etc.
+\ctikzset{sources/symbol/thickness/.initial={1}}
+\ctikzset{csources/symbol/thickness/.initial={1}}
+\ctikzset{sources/symbol/rotate/.initial={90}}
+\ctikzset{csources/symbol/rotate/.initial={90}}
+
% % % ootransformer
\ctikzset{bipoles/oosourcetrans/height/.initial=.6}
\ctikzset{bipoles/oosourcetrans/width/.initial=.6}
@@ -1687,6 +1693,7 @@
\pgfkeys{tikz/tert/delta/.add code={}{\pgf@circ@tert@deltatrue}}
\pgfkeys{tikz/tert/wye/.add code={}{\pgf@circ@tert@wyetrue}}
\pgfkeys{tikz/tert/zig/.add code={}{\pgf@circ@tert@zigtrue}}%
+
%%>>>
%% Nodes definitions for sources%<<<
@@ -1803,6 +1810,17 @@
%% Round and diamond sources
%%%%%%%%%%%
+% % % symbol drawing macros (NOT for delta, wye, zig)
+\def\pgf@circ@sources@symbol@setup{% called in a pgfscope
+ \edef\@@@auto{auto}\edef\@@@rotate{\ctikzvalof{\ctikzclass/symbol/rotate}}
+ \ifx\@@@auto\@@@rotate
+ \pgfgettransformentries\a\b\temp\temp\temp\temp
+ \pgfmathsetmacro{\@@@rotate}{-atan2(\b,\a)}
+ \fi
+ \pgftransformrotate{\@@@rotate}%
+ \pgf@circ@set@relative@thickness{symbol/thickness}%
+}
+
%% Independent voltage source
\pgfcircdeclarebipolescaled{sources}
{}
@@ -1861,7 +1879,7 @@
\pgf@circ@res@up = .5\pgf@circ@res@up
\pgfscope
- \pgftransformrotate{90}
+ \pgf@circ@sources@symbol@setup
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
@@ -1884,7 +1902,7 @@
\pgf@circ@draworfill
\pgf@circ@res@up = .5\pgf@circ@res@up
\pgfscope
- \pgftransformrotate{90}
+ \pgf@circ@sources@symbol@setup
\pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
\pgfpathlineto{\pgfpoint{-1\pgf@circ@res@up}{1\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{0\pgf@circ@res@up}{1\pgf@circ@res@up}}
@@ -1910,7 +1928,7 @@
\pgf@circ@res@up = .5\pgf@circ@res@up
\pgfscope
- \pgftransformrotate{90}
+ \pgf@circ@sources@symbol@setup
\pgfpathmoveto{\pgfpoint{-1\pgf@circ@res@up}{0cm}}
\pgfpathlineto{\pgfpoint{-0.5\pgf@circ@res@up}{0.75\pgf@circ@res@up}}
\pgfpathlineto{\pgfpoint{0.5\pgf@circ@res@up}{-0.75\pgf@circ@res@up}}
@@ -2088,14 +2106,18 @@
}
% % % winding symbols
+\ctikzset{sources/symbol/delta scale/.initial={1}}
+\ctikzset{sources/symbol/wye scale/.initial={1}}
+\ctikzset{sources/symbol/zig scale/.initial={1}}
% triangle
\def\pgf@circ@delta#1{
\pgfscope
- \pgftransformscale{-.01\pgf@circ@res@left*#1}
+ \pgftransformscale{-.01*\ctikzvalof{\ctikzclass/symbol/delta scale}*\pgf@circ@res@left*#1}
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\pgftransformrotate{-\pgfcircmathresult}
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@set@relative@thickness{symbol/thickness}
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpoint{0}{.866\pgf@circ@res@up}}
@@ -2107,11 +2129,12 @@
% star
\def\pgf@circ@wye#1{
\pgfscope
- \pgftransformscale{-.015\pgf@circ@res@left*#1}
+ \pgftransformscale{-.015*\ctikzvalof{\ctikzclass/symbol/wye scale}*\pgf@circ@res@left*#1}
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\pgftransformrotate{-\pgfcircmathresult}
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@set@relative@thickness{symbol/thickness}
\pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@down}}
\pgfpathlineto{\pgfpointorigin}
\pgfpathlineto{\pgfpointpolar{-30}{\pgf@circ@res@down}}
@@ -2124,11 +2147,12 @@
% zigzag
\def\pgf@circ@zig#1{
\pgfscope
- \pgftransformscale{-.015\pgf@circ@res@left*#1}
+ \pgftransformscale{-.015*\ctikzvalof{\ctikzclass/symbol/zig scale}*\pgf@circ@res@left*#1}
\def\pgfcircmathresult{\expandafter\pgf@circ@stripdecimals\pgf@circ@direction\pgf@nil}
\pgftransformrotate{-\pgfcircmathresult}
\pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@set@relative@thickness{symbol/thickness}
\pgfpathmoveto{\pgfpointorigin}
\pgfpathlineto{\pgfpointpolar{90}{.5\pgf@circ@res@up}}
\pgfpathlineto{\pgfpointpolar{60}{\pgf@circ@res@up}}
@@ -2164,10 +2188,7 @@
\pgfpathcircle{\pgfpoint{\ctikzvalof{bipoles/oosourcetrans/circleoffset}\pgf@circ@res@left}{0}}
{\ctikzvalof{bipoles/oosourcetrans/circlesize}\pgf@circ@res@left}
\pgfusepath{draw}
-
-
-% % % % draw inner symbols
-
+ % % % % draw inner symbols
%%primary winding
\ifpgf@circ@prim@delta
\pgfscope
@@ -2441,7 +2462,7 @@
\pgf@circ@res@up = .5\pgf@circ@res@up
\pgfscope
- \pgftransformrotate{90}
+ \pgf@circ@sources@symbol@setup
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
@@ -2544,7 +2565,7 @@
\pgf@circ@res@up = .5\pgf@circ@res@up
\pgfscope
- \pgftransformrotate{90}
+ \pgf@circ@sources@symbol@setup
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}
@@ -2576,7 +2597,7 @@
\pgf@circ@res@up = .5\pgf@circ@res@up
\pgfscope
- \pgftransformrotate{90}
+ \pgf@circ@sources@symbol@setup
\pgfpathmoveto{\pgfpoint{-\pgf@circ@res@up}{0cm}}
\pgfpathsine{\pgfpoint{.5\pgf@circ@res@up}{.5\pgf@circ@res@up}}
\pgfpathcosine{\pgfpoint{.5\pgf@circ@res@up}{-.5\pgf@circ@res@up}}