多发射极晶体管

多发射极晶体管

我正在尝试绘制一个多发射极 npn 晶体管和多集电极 pnp 晶体管。我使用 tikz 绘制所有电路,但文档和本网站均未提供相关信息。

我需要在此图像中绘制类似 Q1 的内容: 多发射极晶体管

答案1

修改后的解决方案将 E2 移至 E 的右侧。还修正了罗盘锚点,使其比所有其他晶体管的尺寸更大。B、C、E 仍然与中心锚点对齐。

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

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% two emitter npn %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\ctikzset{tripoles/npn2/height/.initial=1.1}% before expansion
\ctikzset{tripoles/npn2/width/.initial=.6}% before expansion
\ctikzset{tripoles/npn2/gate height/.initial=.45}
\ctikzset{tripoles/npn2/gate height 2/.initial=.15}
\ctikzset{tripoles/npn2/base height/.initial=.4}
\ctikzset{tripoles/npn2/step/.initial=.15}% both vertical and horizontal separation
\ctikzset{tripoles/npn2/slope/.initial=.6}% (height - height 2) / (gate width)
\ctikzset{tripoles/npn2/gate width/.initial=.5}
\ctikzset{tripoles/npn2/curr direction/.initial=1}

\pgfcircdeclaretransistor{npn2}{
  \savedanchor{\southeast}{% \northeast is actually north (x=0pt)
    \pgf@x=\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/step}\pgf@circ@Rlen
    \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/height}\pgf@circ@Rlen
    \pgf@y=-.5\pgf@y
    \advance\pgf@y by -\pgf@x
  }
% redefine anchors for larger size
  \anchor{north east}{
    \southeast
    \pgf@circ@res@temp=\pgf@x
    \northeast
    \pgf@x=\pgf@circ@res@temp
  }
  \anchor{south east}{\southeast}
  \anchor{east}{
    \southeast
    \pgf@y=0pt
  }
  \anchor{south}{
    \southeast
    \pgf@x=0pt
  }
  \anchor{south west}{
    \southeast
    \pgf@circ@res@temp=\pgf@y
    \left
    \pgf@y=\pgf@circ@res@temp
  }
  \anchor{text}{
    \northeast
    \pgfpoint{.333em}{0.6\pgf@y}
  }

  \anchor{C}{\northeast}
  \anchor{collector}{\northeast}

  \anchor{B}{\left}
  \anchor{base}{\left}

  \anchor{E}{
    \southeast
    \pgf@x=-0pt
  }
  \anchor{emitter}{
    \southeast
    \pgf@x=-0pt
  }

  \anchor{E2}{\southeast}
}{%
    \southeast
    \pgf@circ@res@right=\pgf@x
    \pgf@circ@res@down=\pgf@y
    \pgf@circ@res@step=\pgf@circ@res@right

    \pgfpathmoveto{\pgfpoint{0pt}{\pgf@circ@res@up}}
    \pgfpathlineto{\pgfpoint{0pt}
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate height}\pgf@circ@res@up}}
    \pgfpathlineto{\pgfpoint
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate width}\pgf@circ@res@left}
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate height 2}\pgf@circ@res@up}}
    \pgfusepath{draw}

      \pgfscope
     \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/base height}\pgf@circ@res@up
     \pgfpathmoveto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate width}\pgf@circ@res@left}
        {\pgf@circ@res@temp}}
     \advance\pgf@circ@res@temp by \pgf@circ@res@step
      \pgfpathlineto{\pgfpoint
       {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate width}\pgf@circ@res@left}
       {-\pgf@circ@res@temp}}
      \pgfsetlinewidth{2\pgflinewidth}
      \pgfusepath{draw}
      \endpgfscope

      \pgfpathmoveto{\pgfpoint
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate width}\pgf@circ@res@left}
      {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate height 2}\pgf@circ@res@up}}
    \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate height}\pgf@circ@res@up
    \advance\pgf@circ@res@temp by \pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/slope}\pgf@circ@res@step
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{-\pgf@circ@res@temp}}
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@right}{\pgf@circ@res@down}}      
    \pgfusepath{draw}

    \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate height 2}\pgf@circ@res@up
    \advance\pgf@circ@res@temp by \pgf@circ@res@step
    \pgfpathmoveto{\pgfpoint
      {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate width}\pgf@circ@res@left}
      {-\pgf@circ@res@temp}}
    \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate height}\pgf@circ@res@up
    \advance\pgf@circ@res@temp by \pgf@circ@res@step
    \pgfpathlineto{\pgfpoint{0pt}{-\pgf@circ@res@temp}}%
    \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}%
    \pgfusepath{draw}

    \pgfscope
      \pgfslopedattimetrue
      \pgfallowupsidedownattimetrue
      \pgfresetnontranslationattimefalse
      \pgftransformlineattime{.5}{%
        \pgfpoint%
          {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate width}\pgf@circ@res@left}%
          {-\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate height 2}\pgf@circ@res@up}%
      }{\pgfpoint{0pt}{-\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate height}\pgf@circ@res@up}}%
      \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
    \endpgfscope

    \pgfscope
      \pgfslopedattimetrue
      \pgfallowupsidedownattimetrue
      \pgfresetnontranslationattimefalse

      \pgf@circ@res@temp=\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate height 2}\pgf@circ@res@up
      \advance\pgf@circ@res@temp by \pgf@circ@res@step
      \pgf@circ@res@other=\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate height}\pgf@circ@res@up
      \advance\pgf@circ@res@other by \pgf@circ@res@step

      \pgftransformlineattime{.5}{%
        \pgfpoint%
          {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate width}\pgf@circ@res@left}%
          {-\pgf@circ@res@temp}%
      }{\pgfpoint{0pt}{-\pgf@circ@res@other}}%
      \pgfnode{currarrow}{center}{}{}{\pgfusepath{stroke}}
    \endpgfscope

    \pgfpathmoveto{\pgfpoint
        {\pgfkeysvalueof{/tikz/circuitikz/tripoles/npn2/gate width}\pgf@circ@res@left}
        {0pt}}
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{0pt}}
    \pgfusepath{draw}
}
% create Tnpn2 to-path style
\pgf@circ@definetranspath{npn2}
\makeatother

\begin{document}
\begin{circuitikz}
\draw (0,0) node[npn2] (Q1) {npn2};
\node[above] at (Q1.C) {C};
\node[left] at (Q1.B) {B};
\node[below] at (Q1.E) {E};
\node[below right] at (Q1.E2) {E2};
%\draw[red] (Q1.north) -- (Q1.north east) -- (Q1.east) -- (Q1.south east) --
%  (Q1.south) -- (Q1.south west) -- (Q1.west) -- (Q1.north west) -- cycle;
\path (2,0);
\end{circuitikz}
\end{document}

双发射极 npn

相关内容