summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/circuitikz
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2020-12-17 22:17:39 +0000
committerKarl Berry <karl@freefriends.org>2020-12-17 22:17:39 +0000
commitc5b62b0d4c370c8fa4d9ec0771dac3922839076a (patch)
treefac1ff5ed2b40d51f4bcbae8393b83505fe8c5d7 /Master/texmf-dist/tex/generic/circuitikz
parente789646aa26e1d56b7ccb6945e9d43784d0bbfde (diff)
circuitikz (17dec20)
git-svn-id: svn://tug.org/texlive/trunk@57160 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/circuitikz')
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-legacy.tex6
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-romano.tex4
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex15
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex66
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex90
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex6
-rw-r--r--Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex174
7 files changed, 341 insertions, 20 deletions
diff --git a/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-legacy.tex b/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-legacy.tex
index 5708adc84aa..b35cb69166e 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-legacy.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-legacy.tex
@@ -113,9 +113,9 @@ logic ports origin=legacy, % it can be "center" (better)
american or shape=roundy,% could be pointy
%
% flip-flops
-flipflops/scale=1.0
-flipflops/fill=none
-flipflops/thickness=none
+flipflops/scale=1.0,
+flipflops/fill=none,
+flipflops/thickness=none,
%
% Integrated circuits
chips/scale=1.0,
diff --git a/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-romano.tex b/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-romano.tex
index 4505e31056f..15e3e1e9cf1 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-romano.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/ctikzstyle-romano.tex
@@ -59,8 +59,8 @@ logic ports origin=center,
american or shape=pointy,
%
% flip-flops
-flipflops/scale=1.0
-flipflops/thickness=2.0
+flipflops/scale=1.0,
+flipflops/thickness=2.0,
%
% Switches
bipoles/cuteswitch/thickness=0.5,
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex
index cf0e4ee28b3..0ed0d2b5860 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirc.defines.tex
@@ -897,7 +897,7 @@
\ctikzset{bipoles/bulb/height/.initial=.8}
\ctikzset{bipoles/bulb/width/.initial=.8}
\ctikzset{bipoles/tline/height/.initial=.3}
-\ctikzset{bipoles/tline/width/.initial=.8}
+\ctikzset{bipoles/tline/width/.initial=.6}
\ctikzset{bipoles/squid/height/.initial=.60}
\ctikzset{bipoles/squid/width/.initial=.60}
\ctikzset{bipoles/barrier/height/.initial=.60}
@@ -1067,7 +1067,7 @@
\ctikzset{schottky base/.add code={}{\pgf@circuit@bpt@schottkytrue}}
\pgfkeys{/tikz/no schottky base/.add code={}{\pgf@circuit@bpt@schottkyfalse}}
\ctikzset{no schottky base/.add code={}{\pgf@circuit@bpt@schottkyfalse}}
-\ctikzset{tripoles/schottky base size/.initial=0.07}
+\ctikzset{tripoles/schottky base size/.initial=0.05}
% Option draw bpt without base connection
\newif\ifpgf@circuit@bpt@drawbase
@@ -1592,6 +1592,17 @@
\tikzset{all leads/.code={\pgfcirc@draw@output@leadstrue\pgfcirc@draw@input@leadstrue}}
\tikzset{no leads/.code={\pgfcirc@draw@output@leadsfalse\pgfcirc@draw@input@leadsfalse}}
+% adding a different style of xnor port
+% see https://github.com/circuitikz/circuitikz/issues/467
+\ctikzset{european xnor style/.is choice}
+\ctikzset{european xnor style/default/.code={%
+ \pgfcircdeclareeurologicport{xnor}{$=1$}{\pgf@circ@res@count}{not}}%
+}
+\ctikzset{european xnor style/direct/.code={%
+ \pgfcircdeclareeurologicport{xnor}{$=$}{\pgf@circ@res@count}{}}%
+}
+
+
% old, legacy keys that should be killed over
\ctikzset{bipoles/buffer/height/.initial=1}
\ctikzset{bipoles/buffer/width/.initial=1}
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
index 7cd5baff47c..47fab3e5a52 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircbipoles.tex
@@ -3242,7 +3242,9 @@
%% Push Button
\pgfcircdeclarebipolescaled{switches}
-{}
+{
+ \anchor{tip}{\northeast\pgf@x=0pt\relax}
+}
{\ctikzvalof{bipoles/pushbutton/height 2}}
{pushbutton}
{\ctikzvalof{bipoles/pushbutton/height}}
@@ -3263,7 +3265,9 @@
%% Normally closed Push Button
\pgfcircdeclarebipolescaled{switches}
-{}
+{
+ \anchor{tip}{\northeast\pgf@x=0pt\relax}
+}
{\ctikzvalof{bipoles/pushbutton/height 2}}
{ncpushbutton}
{\ctikzvalof{bipoles/pushbutton/height}}
@@ -3284,6 +3288,64 @@
\pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
\pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
}
+%% Push Button (normally closed but now open :-) see
+%% https://github.com/circuitikz/circuitikz/issues/128#issuecomment-731771299
+\pgfcircdeclarebipolescaled{switches}
+{
+ \anchor{tip}{
+ \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \northeast\divide\pgf@y by 2\advance\pgf@y by \pgf@circ@res@temp
+ \pgf@x=0pt\relax
+ }
+}
+{\ctikzvalof{bipoles/pushbutton/height 2}}
+{pushbuttonc}
+{\ctikzvalof{bipoles/pushbutton/height}}
+{\ctikzvalof{bipoles/pushbutton/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@temp}}
+ \pgfpathmoveto{\pgfpoint{0}{\pgf@circ@res@temp}}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up/2+\pgf@circ@res@temp}}
+ \pgfusepath{draw}
+
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+}
+
+%% Normally closed Push Button now open
+\pgfcircdeclarebipolescaled{switches}
+{
+ \anchor{tip}{
+ \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \northeast\divide\pgf@y by 2\advance\pgf@y by \pgf@circ@res@temp
+ \pgf@x=0pt\relax
+ }
+}
+{\ctikzvalof{bipoles/pushbutton/height 2}}
+{ncpushbuttono}
+{\ctikzvalof{bipoles/pushbutton/height}}
+{\ctikzvalof{bipoles/pushbutton/width}}
+{
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ % This is the radius of the "ocirc" shape (see pgfcircshapes.tex)
+ % Warning, if the nodes will have a class, we have to touch this.
+ \pgf@circ@res@temp=\ctikzvalof{nodes width}\pgf@circ@Rlen
+ \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up/2}}
+ \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@up/2}}
+ \pgfpathmoveto{\pgfpoint{0}{-\pgf@circ@res@up/2}}
+ \pgfpathlineto{\pgfpoint{0}{\pgf@circ@res@up/2+\pgf@circ@res@temp}}
+ \pgfusepath{draw}
+ %
+ \pgftransformshift{\pgfpoint{\pgf@circ@res@left}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+ \pgftransformshift{\pgfpoint{2\pgf@circ@res@right}{0pt}}
+ \pgfnode{ocirc}{center}{}{}{\pgfusepath{draw}}
+}
%%% reed switches
\pgfcircdeclarebipolescaled{switches}
{}
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
index 2da88c450bb..5087f696780 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircmonopoles.tex
@@ -380,12 +380,15 @@
\anchor{south east}{\northeast\pgf@y=-\pgf@y}
\anchor{south west}{\northeast\pgf@x=0cm\pgf@y=-\pgf@y}
\anchor{center}{\pgfpointorigin}
+ % this is not exact, but it's better than nothing
+ \anchor{text}{\northeast\pgf@xa=\pgf@x\pgf@ya=\pgf@y
+ \pgfpoint{\dimexpr-.5\wd\pgfnodeparttextbox+.8\pgf@xa}
+ {\dimexpr-.5\dp\pgfnodeparttextbox+.5\ht\pgfnodeparttextbox+\pgf@ya}}
\behindforegroundpath{
\pgfstartlinewidth=\pgflinewidth
\pgf@circ@scaled@Rlen=\scaledRlen
- \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width} \pgf@circ@scaled@Rlen
- \pgf@circ@res@step=0.6\pgf@circ@scaled@Rlen
+ \pgf@circ@res@step=\ctikzvalof{bipoles/tline/width}\pgf@circ@scaled@Rlen
\pgfscope\begin{pgftransparencygroup}
\pgfpathellipse{\pgfpoint{0.5\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0.125\pgf@circ@res@step}{0\pgf@circ@res@step}}{\pgfpoint{0\pgf@circ@res@step}{0.25\pgf@circ@res@step}}
@@ -618,6 +621,89 @@
}
}
+%%% dynodes (see https://github.com/circuitikz/circuitikz/issues/469)
+\ctikzset{monopoles/dynode/width/.initial=0.4}
+\ctikzset{monopoles/dynode/height/.initial=0.8}
+\ctikzset{monopoles/dynode/arc pos/.initial=0.5}
+\ctikzset{monopoles/dynode/arc angle/.initial=30}
+\ctikzset{monopoles/dynode/top width/.initial=1.0}
+
+\pgfdeclareshape{dynode}{
+ \savedmacro{\ctikzclass}{\edef\ctikzclass{tubes}}
+ \saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \anchor{center}{\pgfpointorigin}
+ \savedanchor{\northeast}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/dynode/width}\pgf@circ@scaled@Rlen
+ \pgf@x=0.5\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/dynode/height}\pgf@circ@scaled@Rlen
+ }
+ \savedanchor{\arcpos}{% bottom part of the arc pos
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=0pt
+ \pgf@y=\ctikzvalof{monopoles/dynode/height}\pgf@circ@scaled@Rlen
+ \pgf@y=\ctikzvalof{monopoles/dynode/arc pos}\pgf@y
+ }
+ \savedanchor{\topright}{%
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@x=\ctikzvalof{monopoles/dynode/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\ctikzvalof{monopoles/dynode/top width}\pgf@x
+ \pgf@x=0.5\pgf@x
+ \pgf@y=\ctikzvalof{monopoles/dynode/height}\pgf@circ@scaled@Rlen
+ }
+ \anchor{arc}{\arcpos}
+ \anchor{top right}{\topright}
+ \anchor{top left}{\topright\pgf@x=-\pgf@x}
+ \anchor{text}{
+ \northeast
+ \advance\pgf@x by 4pt\relax
+ \pgf@y=\dimexpr0.5\pgf@y+.5\dp\pgfnodeparttextbox-.5\ht\pgfnodeparttextbox\relax
+ }
+ \anchor{top}{\northeast\pgf@x=0pt}
+ \anchor{right}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{left}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{bottom}{\pgfpointorigin}
+ \anchor{north}{\northeast\pgf@x=0pt}
+ \anchor{east}{\northeast\pgf@y=0.5\pgf@y}
+ \anchor{west}{\northeast\pgf@x=-\pgf@x\pgf@y=0.5\pgf@y}
+ \anchor{south}{\pgfpointorigin}
+ \anchor{north east}{\northeast}
+ \anchor{north west}{\northeast\pgf@x=-\pgf@x}
+ \anchor{south east}{\northeast\pgf@y=0pt\relax}
+ \anchor{south west}{\northeast\pgf@y=0pt\pgf@x=-\pgf@x}
+ \behindforegroundpath{
+ \pgfstartlinewidth=\pgflinewidth
+ \pgf@circ@scaled@Rlen=\scaledRlen
+ \pgfsetcolor{\ctikzvalof{color}}
+ \northeast
+ \pgf@circ@res@right=\pgf@x
+ \pgf@circ@res@up=\pgf@y
+ \arcpos
+ \pgf@circ@res@step=\pgf@y
+ % top
+ \pgfscope
+ \pgf@circ@setlinewidth{bipoles}{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-\ctikzvalof{monopoles/dynode/top width}*\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfpathlineto{\pgfpoint{\ctikzvalof{monopoles/dynode/top width}*\pgf@circ@res@right}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ \endpgfscope
+ % arc
+ \edef\@@angle{\ctikzvalof{monopoles/dynode/arc angle}}
+ \ifnum90=\@@angle\else % avoid divisions by zero
+ % radius
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@circ@res@right/cos(\@@angle)}
+ % start angle y position
+ \pgfmathsetlength{\pgf@circ@res@step}{\pgf@circ@res@step+\pgf@circ@res@other*(1-sin(\@@angle))}
+ \pgfsetlinewidth{\pgfstartlinewidth}
+ \pgfpathmoveto{\pgfpoint{-\pgf@circ@res@right}{\pgf@circ@res@step}}
+ \pgfpatharc{-180+\@@angle}{-\@@angle}{\pgf@circ@res@other}
+ \fi
+ % tail
+ \pgfpathmoveto{\pgfpointorigin}
+ \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
+ \pgfusepath{draw}
+ }
+}
% Microstrip monopoles
\pgfdeclareshape{mslstub}{
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex
index e4926c9931b..0b15f0f160e 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcircpath.tex
@@ -337,6 +337,8 @@
\def\pgf@circ@ncs@path#1{\pgf@circ@bipole@path{ncs}{#1}}
\def\pgf@circ@pushbutton@path#1{\pgf@circ@bipole@path{pushbutton}{#1}}
\def\pgf@circ@ncpushbutton@path#1{\pgf@circ@bipole@path{ncpushbutton}{#1}}
+\def\pgf@circ@pushbuttonc@path#1{\pgf@circ@bipole@path{pushbuttonc}{#1}}
+\def\pgf@circ@ncpushbuttono@path#1{\pgf@circ@bipole@path{ncpushbuttono}{#1}}
\def\pgf@circ@open@path#1{\pgf@circ@bipole@path{open}{#1}}
\def\pgf@circ@generic@path#1{\pgf@circ@bipole@path{generic}{#1}}
\def\pgf@circ@ageneric@path#1{\pgf@circ@bipole@path{ageneric}{#1}}
@@ -668,6 +670,10 @@
\compattikzset{normally open push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbutton@path, l=#1}}
\compattikzset{ncpb/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
\compattikzset{normally closed push button/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbutton@path, l=#1}}
+\compattikzset{nopbc/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbuttonc@path, l=#1}}
+\compattikzset{normally open push button closed/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@pushbuttonc@path, l=#1}}
+\compattikzset{ncpbo/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbuttono@path, l=#1}}
+\compattikzset{normally closed push button open/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ncpushbuttono@path, l=#1}}
\compattikzset{toggle switch/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@toggleswitch@path}}
\compattikzset{ammeter/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@ammeter@path}}
diff --git a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
index 95f001618e2..8fb072ae71e 100644
--- a/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
+++ b/Master/texmf-dist/tex/generic/circuitikz/pgfcirctripoles.tex
@@ -1571,12 +1571,112 @@
%% Transistors
%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% definitions for transistor circles
+%
+\ctikzset{transistor circle/.is family}
+\ctikzset{transistor circle/relative thickness/.initial=1}
+\ctikzset{transistor circle/color/.initial=default}
+\ctikzset{transistor circle/dash/.initial=none}
+\ctikzset{transistor circle/scale circle radius/.initial=1}
+\ctikzset{transistor circle/default base in/.initial=0.9}
+\ctikzset{transistor circle/njfet base in/.initial=1.05}
+\ctikzset{transistor circle/pjfet base in/.initial=1.05}
+\ctikzset{transistor circle/isfet base in/.initial=0.65}
+
+\newif\ifpgf@circ@trcircle\pgf@circ@trcirclefalse
+\ctikzset{tr circle/.is if=pgf@circ@trcircle}
+\tikzset{tr circle/.is if=pgf@circ@trcircle}
+%
+% add a circle to the transistor:
+%
+\def\pgfcirc@transistorcircle{
+ \ifpgf@circ@trcircle
+ \pgfscope
+ \pgf@circ@setlinewidth{tripoles}{\pgflinewidth}
+ \pgfsetlinewidth{\ctikzvalof{transistor circle/relative thickness}\pgflinewidth}
+ \edef\@@none{none}\edef\@@default{default}
+ \edef\@@tmp{\ctikzvalof{transistor circle/color}}
+ \ifx\@@tmp\@@default\else
+ \pgfsetcolor{\@@tmp}
+ \fi
+ \edef\@@tmp{\ctikzvalof{transistor circle/dash}}
+ \ifx\@@tmp\@@none\else
+ \expandafter\pgfsetdash\expandafter{\@@tmp}{0cm}
+ \fi
+ % radius of the circle
+ % \pgfmathsetlength{\pgf@circ@res@temp}{((#2+\extrabodydiodelen)-(#1)+(#3)*(#3)/((#2+\extrabodydiodelen)-(#1)))/2}
+ % \pgfpathcircle{\pgfpoint{#1+\pgf@circ@res@temp}{0pt}}{\pgf@circ@res@temp}
+ \pgfpathcircle{\pgfpoint{\circleleft+\circleradius}{0pt}}{\circleradius}
+ \pgf@circ@draworfill
+ \endpgfscope
+ \fi
+}
\long\def\pgfcircdeclaretransistor#1#2#3{
\pgfdeclareshape{#1}
{
\savedmacro{\ctikzclass}{\edef\ctikzclass{transistors}}
\saveddimen{\scaledRlen}{\pgfmathsetlength{\pgf@x}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}}
+ \savedmacro{\circlebase}{
+ \pgfkeysifdefined{\circuitikzbasekey/transistor circle/#1 base in}%
+ {% yes, we have it
+ \edef\circlebase{\ctikzvalof{transistor circle/#1 base in}}%
+ }{% no, use default
+ \edef\circlebase{\ctikzvalof{transistor circle/default base in}}
+ }}
+ % \savedmacro{\thistypeoftr}{\edef\thistypeoftr{#1}}
+ \saveddimen{\extrabodydiodelen}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \ifpgf@circuit@fet@bodydiode
+ % try to put the text to the right of the flyback diode
+ \pgfmathsetlength{\pgf@x}{(
+ \ctikzvalof{tripoles/#1/bodydiode distance}*
+ \ctikzvalof{tripoles/#1/width} +
+ \ctikzvalof{tripoles/#1/bodydiode scale}*
+ \ctikzvalof{bipoles/diode/height}/2
+ )*\pgf@circ@scaled@Rlen}
+ \else
+ \pgf@x=0pt\relax
+ \fi
+ }
+ \savedmacro{\scaecircleradius}{
+ \edef\scalecircleradius{\ctikzvalof{transistor circle/scale circle radius}}
+ }
+ \saveddimen{\circleradius}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ % repeat the extrabodydiodelen (grrr)
+ \ifpgf@circuit@fet@bodydiode
+ % try to put the text to the right of the flyback diode
+ \pgfmathsetlength{\pgf@circ@res@other}{(
+ \ctikzvalof{tripoles/#1/bodydiode distance}*
+ \ctikzvalof{tripoles/#1/width} +
+ \ctikzvalof{tripoles/#1/bodydiode scale}*
+ \ctikzvalof{bipoles/diode/height}/2
+ )*\pgf@circ@scaled@Rlen}
+ \else
+ \pgf@circ@res@other=0pt\relax
+ \fi
+ % left
+ \pgf@xa=-\ctikzvalof{tripoles/#1/width}\pgf@circ@scaled@Rlen
+ \pgf@xa=\circlebase\pgf@xa % this is the base point of the circle
+ % northeast
+ \pgf@yb=\ctikzvalof{tripoles/#1/height}\pgf@circ@scaled@Rlen % y of the left point of circle
+ \pgf@yb=.5\pgf@yb
+ \pgf@xb=\pgf@circ@res@other % this is the x of the right points of the circle
+ %
+ \pgf@yb=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@yb %this is #3 of the circle
+ % find the radius of the circle
+ \pgfmathsetlength{\pgf@x}{((\pgf@xb)-(\pgf@xa)+(\pgf@yb)*(\pgf@yb)/((\pgf@xb)-(\pgf@xa)))/2*\scalecircleradius}
+ }
+ \saveddimen{\circleleft}{
+ \pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
+ \pgf@xa=-\ctikzvalof{tripoles/#1/width}\pgf@circ@scaled@Rlen
+ \pgf@x=\circlebase\pgf@xa
+ }
+ \anchor{circle center}{
+ \pgf@y=0pt\pgf@x=\circleleft\advance\pgf@x by\circleradius
+ }
\anchor{center}{
\pgfpointorigin
}
@@ -1600,14 +1700,12 @@
\pgfmathsetlength{\pgf@circ@scaled@Rlen}{\ctikzvalof{\ctikzclass/scale}\pgf@circ@Rlen}
\ifpgf@circuit@transisors@fixlabels
\ifpgf@circuit@fet@bodydiode
- % try to put the text to the right of the flyback diode
- \pgfmathsetlength{\pgf@circ@res@other}{(
- \ctikzvalof{tripoles/#1/bodydiode distance}*
- \ctikzvalof{tripoles/#1/width} +
- \ctikzvalof{tripoles/#1/bodydiode scale}*
- \ctikzvalof{bipoles/diode/height}/2
- )*\pgf@circ@scaled@Rlen}
- \advance\pgf@x by \pgf@circ@res@other
+ \advance \pgf@x by \extrabodydiodelen
+ \fi
+ \ifpgf@circ@trcircle
+ \left\pgf@xa=\pgf@x
+ \pgfmathsetlength{\pgf@x}{\circleleft+2*\circleradius}
+ % \advance \pgf@x by \circleradius
\fi
% add a bit of space to avoid central (substrate) terminal if drawn
\advance\pgf@x by 0.05\pgf@circ@scaled@Rlen\relax
@@ -1703,6 +1801,10 @@
\left
\pgf@x=\ctikzvalof{tripoles/#1/base width}\pgf@x
}
+ \anchor{circle base}{
+ \left
+ \pgf@x=\circlebase\pgf@x
+ }
\anchor{nogate}{
\left
\pgf@x=\ctikzvalof{tripoles/#1/gate width}\pgf@x
@@ -1744,6 +1846,33 @@
\pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@y
\pgf@y=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@y
}
+ \anchor{circle C}{
+ \left
+ \pgf@xa=\circlebase\pgf@x % this is #1 of the circle
+ \northeast
+ \pgf@xb=\pgf@x %this is #2 of the circle
+ \pgf@yb=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@y %this is #3 of the circle
+ % the base of the triangle is x_2 - x_1 - r
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@xb-\pgf@xa-\circleradius}
+ % so let's go with the height
+ \pgfmathsetlength{\pgf@ya}{sqrt(abs(\circleradius*\circleradius-\pgf@circ@res@other*\pgf@circ@res@other))}
+ % finally, direction
+ \pgf@y=\ctikzvalof{tripoles/#1/curr direction}\pgf@ya
+ }
+ \anchor{circle E}{
+ \left
+ \pgf@xa=\circlebase\pgf@x % this is #1 of the circle
+ \northeast
+ \pgf@xb=\pgf@x %this is #2 of the circle
+ \pgf@yb=\ctikzvalof{tripoles/#1/bodydiode conn}\pgf@y %this is #3 of the circle
+ % the base of the triangle is x_2 - x_1 - r
+ \pgfmathsetlength{\pgf@circ@res@other}{\pgf@xb-\pgf@xa-\circleradius}
+ % so let's go with the height
+ \pgfmathsetlength{\pgf@ya}{sqrt(abs(\circleradius*\circleradius-\pgf@circ@res@other*\pgf@circ@res@other))}
+ % finally, direction
+ % finally, direction
+ \pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@ya
+ }
\anchor{body E in}{
\northeast
\pgf@y=-\ctikzvalof{tripoles/#1/curr direction}\pgf@y
@@ -1853,6 +1982,10 @@
\pgf@y=-\ctikzvalof{tripoles/#1/base height}\pgf@y
}
}{
+
+ % add the circle if requested (before everything else, so we can fill it)
+ \pgfcirc@transistorcircle
+
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
{\ctikzvalof{tripoles/#1/base height}\pgf@circ@res@up}}
@@ -2360,6 +2493,8 @@
}
}
{
+ % add the circle if requested (before everything else, so we can fill it)
+ \pgfcirc@transistorcircle
%draw upper connection
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
@@ -2468,6 +2603,9 @@
\pgf@y=-\ctikzvalof{tripoles/nmos/gate height}\pgf@y
}
}{%
+ % add the circle if requested (before everything else, so we can fill it)
+ \pgfcirc@transistorcircle
+
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
{\ctikzvalof{tripoles/nmos/gate height}\pgf@circ@res@up}}
@@ -2552,6 +2690,8 @@
\pgf@y=-\ctikzvalof{tripoles/pmos/gate height}\pgf@y
}
}{%
+ % add the circle if requested (before everything else, so we can fill it)
+ \pgfcirc@transistorcircle
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
{\ctikzvalof{tripoles/pmos/gate height}\pgf@circ@res@up}}
@@ -2682,6 +2822,8 @@
}
}{%
% draw depletion channel
+ % add the circle if requested (before everything else, so we can fill it)
+ \pgfcirc@transistorcircle
\pgfscope
\pgfpathrectanglecorners
{\pgfpoint
@@ -2782,6 +2924,8 @@
\advance\pgf@x by -\pgf@circ@res@temp
}
}{%
+ % add the circle if requested (before everything else, so we can fill it)
+ \pgfcirc@transistorcircle
% draw depletion channel
\pgfscope
\pgfpathrectanglecorners
@@ -2893,6 +3037,8 @@
\pgf@y=-\ctikzvalof{tripoles/hemt/gate height}\pgf@y
}
}{%
+ % add the circle if requested (before everything else, so we can fill it)
+ \pgfcirc@transistorcircle
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
{\ctikzvalof{tripoles/hemt/gate height}\pgf@circ@res@up}}
@@ -2928,6 +3074,9 @@
\long\def\drawfetcore#1{
\pgftransformationadjustments
+ % add the circle if requested (before everything else, so we can fill it)
+ \pgfcirc@transistorcircle
+
%top connection
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
@@ -3192,6 +3341,8 @@
\pgf@y=-\ctikzvalof{tripoles/njfet/gate height 2}\pgf@y
}
}{%
+ % add the circle if requested (before everything else, so we can fill it)
+ \pgfcirc@transistorcircle
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
{\ctikzvalof{tripoles/njfet/gate height 2}\pgf@circ@res@up}}
@@ -3257,6 +3408,8 @@
\pgf@y=-\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@y
}
}{%
+ % add the circle if requested (before everything else, so we can fill it)
+ \pgfcirc@transistorcircle
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
{\ctikzvalof{tripoles/pjfet/gate height 2}\pgf@circ@res@up}}
@@ -3311,7 +3464,10 @@
\pgfusepath{draw}
}
-\pgfdeclaretransistorwrapperaddbulk{isfet}{}{%
+\pgfdeclaretransistorwrapperaddbulk{isfet}{
+ }{%
+ % add the circle if requested (before everything else, so we can fill it)
+ \pgfcirc@transistorcircle
\pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
% DRAIN CONNECTION
\pgfpathlineto{\pgfpoint{\pgf@circ@res@right}