I need to change the format of body diodes in a given transistor, such that I can change it into a filled or stroked one, but I haven't found any documentation from the circuitikz
package to do that.
I know that, for a filled body diode, I can fill it, but when a transistor circle is included, it fills the whole circle.
Example code:
\documentclass[]{standalone}
\usepackage[americanvoltages]{circuitikz}
\begin{document}
\begin{tikzpicture}
\draw[]
(0,0) to[D] ++(0,-1.25)
(2,0) to[D*] ++(0,-1.25)
(4,0) to[D-] ++(0,-1.25)
(0,-2) node[nigfete,bodydiode](){}
(2,-2) node[nigfete,bodydiode,fill=black](){}
(4,-2) node[nigfete,bodydiode,tr circle,fill=black](){}
;
\end{tikzpicture}
\end{document}
After compilation, I get this:
Best Answer
The problem with your third example is that the fill parameter acts on every shape drawn, including the surrounding circle.
The diode in the transistor is drawn with the shape in force (
full diodes
, orempty diodes
, orstroke diodes
) at the moment of the drawing. Thankfully, using the scoping properties, you can change them locally:You can change other characteristics of the body diode by looking at "Transistor bodydiode customization", around page 122 in a recent manual.
(but notice that locally enacted
full diodes
with color changes do not work correctly: that could be a bug, see https://github.com/circuitikz/circuitikz/issues/794).