CircuitTikZ 4 针 FET 符号

CircuitTikZ 4 针 FET 符号

有人知道 CircuitTikZ 中自定义的 4 针/腿 FET 符号吗?类似这样的符号就完美了: enter image description here

原包装中有一个合理的部分,但这对于我的目的来说会更好

答案1

这可以通过一种非常丑陋的技巧来实现,即将 Gateline 移动到源极/漏极线上,并使用选项“nogate”抑制栅极连接的绘制:

\begin{circuitikz}
\ctikzset{tripoles/nigfetd/gate width/.initial=.5}%move gate over drain/source-line
\draw (0,0)node[nigfetd,nogate](t){};
\draw(t.G)++(0,0.35)coordinate(G1)--++(0.4,0){--++(0,0.25)};
\draw(t.G)coordinate(G2)--++(0.4,0){--++(0,0.25)};

\draw(G1)node[left]{$G_1$};
\draw(G2)node[left]{$G_2$};
\end{circuitikz}

enter image description here

谨致问候,Stefan

答案2

由于无法使用,这有点复杂\drawfetcore

\documentclass[border=1pt]{standalone}
\usepackage{circuitikz}

\makeatletter
% ***************************** nig2fetd *********************************

\ctikzset{tripoles/nig2fectd/.is family}
\ctikzset{tripoles/nig2fetd/width/.initial=.7}
\ctikzset{tripoles/nig2fetd/gate height/.initial=.35}% also used to locate top and bottom connections
\ctikzset{tripoles/nig2fetd/base height/.initial=.5}
\ctikzset{tripoles/nig2fetd/conn height/.initial=.35}
\ctikzset{tripoles/nig2fetd/height/.initial=1.1}
\ctikzset{tripoles/nig2fetd/base width/.initial=.5}
\ctikzset{tripoles/nig2fetd/gate width/.initial=.62}
\ctikzset{tripoles/nig2fetd/bodydiode scale/.initial=.3}
\ctikzset{tripoles/nig2fetd/bodydiode distance/.initial=.3}
\ctikzset{tripoles/nig2fetd/bodydiode conn/.initial=.6}
\ctikzset{tripoles/nig2fetd/curr direction/.initial=1}
\ctikzset{tripoles/nig2fetd/sub gate/.initial=.15}

\pgf@circ@definetranspath{nig2fetd}% not sure what this does


% N-CHANNEL IGFET DEPLETION TYPE
\pgfdeclaretransistorwrapperaddbulk{nig2fetd}{%
  \anchor{G1}{
             \northeast
             \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/sub gate}\pgf@y
             \left
             \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/curr direction}\pgf@circ@res@step
  }
    \anchor{G2}{
             \northeast
             \pgf@circ@res@step=\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/conn height}\pgf@y
             \left
             \pgf@y=-\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/curr direction}\pgf@circ@res@step
  }
}{%
    \pgf@circuit@trans@depletiontypetrue
    \pgftransformationadjustments
        %top connection
      \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
      \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate height}\pgf@circ@res@up}}
      \pgfpathlineto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate height}\pgf@circ@res@up}}
        \pgfusepath{draw}
        \pgfscope
      \pgfpathmoveto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base height}\pgf@circ@res@up}}
        \ifpgf@circuit@trans@depletiontype
              \pgfpathlineto{\pgfpoint
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
                {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base height}\pgf@circ@res@down}}
        \else

      \pgfpathlineto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base height}\pgf@circ@res@up*0.45}}
      \pgfpathmoveto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base height}\pgf@circ@res@up*0.25}}
      \pgfpathlineto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base height}\pgf@circ@res@down*0.25}}
      \pgfpathmoveto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nfet/base height}\pgf@circ@res@down*0.45}}
      \pgfpathlineto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base height}\pgf@circ@res@down}}
        \fi
      \pgfsetlinewidth{2\pgflinewidth}
        \pgfusepath{draw}
        \endpgfscope
        %Bulk connection line
      \pgfpathmoveto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgf@circ@res@up+\pgf@circ@res@down}}
      \pgfpathlineto{\pgfpoint{\pgf@circ@res@right+\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}
        {\pgf@circ@res@up+\pgf@circ@res@down}}

      %bottom connection
      \pgfpathmoveto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate height}\pgf@circ@res@down}}
      \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}
       {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate height}\pgf@circ@res@down}}
      \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}    
      \pgfusepath{draw}

     %draw thick gate lines
    \pgfscope
    \pgfpathmoveto{\pgfpoint
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate width}\pgf@circ@res@left}
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/sub gate}\pgf@circ@res@down+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
    \pgfpathlineto{\pgfpoint
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate width}\pgf@circ@res@left}
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate height}\pgf@circ@res@down-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
    \pgfpathmoveto{\pgfpoint
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate width}\pgf@circ@res@left}
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/sub gate}\pgf@circ@res@up-\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
    \pgfpathlineto{\pgfpoint
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate width}\pgf@circ@res@left}
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate height}\pgf@circ@res@up+\pgfverticaltransformationadjustment*.5*\pgflinewidth}}
    \pgfsetlinewidth{2\pgflinewidth}
    \pgfusepath{draw}
    \endpgfscope

      \pgfscope
          \pgfslopedattimetrue 
          \pgfallowupsidedownattimetrue
          \pgfresetnontranslationattimefalse

          \pgftransformlineattime{.6}{%
            \pgfpoint
              {\pgf@circ@res@right}%
              {\pgf@circ@res@up+\pgf@circ@res@down}%
          }{%
            \pgfpoint%
              {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/base width}\pgf@circ@res@left}%
              {\pgf@circ@res@up+\pgf@circ@res@down}%
          }
              \ifpgf@circuit@trans@ntype
              \else
              \pgftransformrotate{180}
              \fi
          \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
          \endpgfscope

        % GATE CONNECTION
        \ifpgf@circuit@bpt@drawgate
            \ifpgf@circuit@trans@ntype
                \pgfpathmoveto{\pgfpoint
                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate width}\pgf@circ@res@left}
                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/conn height}\pgf@circ@res@down}}
                \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/conn height}\pgf@circ@res@down}}
            \pgfpathmoveto{\pgfpoint
                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate width}\pgf@circ@res@left}
                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/sub gate}\pgf@circ@res@up}}
                \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/sub gate}\pgf@circ@res@up}}
            \else
                \pgfpathmoveto{\pgfpoint
                    {\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate width}\pgf@circ@res@left}
                    {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/conn height}\pgf@circ@res@down}}
                \pgfpathlineto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*.5*\pgflinewidth}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/conn height}\pgf@circ@res@down}}       
            \fi
        \pgfusepath{draw}
        \fi

      % SOURCE CONNECTION
      \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
      \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}    
      \pgfusepath{draw}

      % SOLDER DOT at source-bulk connection
      \ifpgf@circuit@fet@solderdot
      \pgfscope
        \pgftransformshift{\pgfpoint{\pgf@circ@res@right}{
          \pgfkeysvalueof{/tikz/circuitikz/tripoles/nig2fetd/gate height}\pgf@circ@res@down}}
        \pgfnode{circ}{center}{}{}{}
      \endpgfscope{}
      \fi
}
\makeatother

\begin{document}
\begin{circuitikz}
\node[nig2fetd] (T) {};
\node[left] at (T.G1) {G1};
\node[left] at (T.G2) {G2};
\node[below] at (T.S) {S};
\node[above] at (T.D) {D};

\end{circuitikz}
\end{document}

demo

相关内容