Circuitikz 逆变器开路集电极符号

Circuitikz 逆变器开路集电极符号

我在 Circuitikz 中寻找开路集电极逆变器的符号,但找不到。有人知道怎么做吗?

答案1

由于此版本在文本区域中绘制了一个符号,我注释掉了文本区域的代码(但将其保留在那里以防有人想要修复美国非端口)。

\documentclass{standalone}
\usepackage{circuitikz}

\makeatletter
\pgfdeclareshape{inverter}
    {
    \anchor{center}{\pgfpointorigin}
%    \anchor{text}{% this is used to center the text in the node
%      \pgf@x = \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}%
%      \pgf@x = 0.5\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@x
%      \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@x
%      \pgfpoint{\dimexpr-\pgf@circ@[email protected]\wd\pgfnodeparttextbox}{-.5\ht\pgfnodeparttextbox}%
%    }%
    \savedanchor\northwest{%
        \pgf@y= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
        \pgf@y=\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/height}\pgf@y
        \pgf@y=.5\pgf@y
        \pgf@x= \pgfkeysvalueof{/tikz/circuitikz/bipoles/length}
        \pgf@x=-\pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/width}\pgf@x
        \pgf@x=.5\pgf@x
      }
      \savedanchor\left{%
        \pgf@y=0pt
      }
      \anchor{in}{
        \northwest
        \pgf@y=0pt
      }
      \anchor{out}{
        \northwest
        \pgf@y=0pt
        \pgf@x=-\pgf@x
      }
      \anchor{center}{
        \pgfpointorigin
      }
      \anchor{east}{
        \left
        \pgf@x=-.8\pgf@x  
      }
      \anchor{west}{
        \left
      }
      \anchor{south}{
        \northwest
        \pgf@x=0pt
        \pgf@y=-\pgf@y
      }
      \anchor{north}{
        \northwest
        \pgf@x=0pt
      }
          \anchor{south west}{
        \northwest
        \pgf@y=-\pgf@y
      }
      \anchor{north east}{
        \northwest
        \pgf@x=-\pgf@x
      }
      \anchor{north west}{
        \northwest
      }
      \anchor{south east}{
        \northwest
        \pgf@x=-\pgf@x
        \pgf@y=-\pgf@y
      }   
      \backgroundpath{          
            \pgfsetcolor{\pgfkeysvalueof{/tikz/circuitikz/color}}   


            \northwest
            \pgf@circ@res@up = \pgf@y 
            \pgf@circ@res@down = -\pgf@y
            \pgf@circ@res@right = -\pgf@x
            \pgf@circ@res@left = \pgf@x

        \pgf@circ@res@other = \pgfkeysvalueof{/tikz/circuitikz/bipoles/not port/circle width}\pgf@circ@res@right

    \pgfscope% draw borders (shift origin to left side)
        \pgfsetlinewidth{2\pgflinewidth}
        \pgftransformxshift{.7\pgf@circ@res@left}
        \pgf@circ@res@step=\pgf@circ@res@right
        \advance\pgf@circ@res@step by -\pgf@circ@res@left
        \pgf@circ@res@step=.7\pgf@circ@res@step

        \pgfpathmoveto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}
        \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@up}}
        \pgfpathlineto{\pgfpoint{0pt}{\pgf@circ@res@down}}
        \pgfpathlineto{\pgfpoint{\pgf@circ@res@step-\pgf@circ@res@other}{0pt}}

        \pgfpathellipse
            {\pgfpoint{\pgf@circ@[email protected]\pgf@circ@res@other}{0pt}}
            {\pgfpoint{.5\pgf@circ@res@other}{0pt}}
            {\pgfpoint{0pt}{.5\pgf@circ@res@other}}
        \pgfusepath{draw}
    \endpgfscope

    \pgfscope% draw undelined diamond
        \pgfsetlinewidth{1.5\pgflinewidth}
        \pgftransformxshift{0.3\pgf@circ@res@left}

        \pgfpathmoveto{\pgfpoint{0pt}{0.3\pgf@circ@res@down}}
        \pgfpathlineto{\pgfpoint{0.1\pgf@circ@res@right}{0pt}}
        \pgfpathlineto{\pgfpoint{0pt}{0.3\pgf@circ@res@up}}
        \pgfpathlineto{\pgfpoint{0.1\pgf@circ@res@left}{0pt}}
        \pgfpathclose
        \pgfpathmoveto{\pgfpoint{0.1\pgf@circ@res@left}{0.4\pgf@circ@res@down}}
        \pgfpathlineto{\pgfpoint{0.1\pgf@circ@res@right}{0.4\pgf@circ@res@down}}
        \pgfusepath{draw}
    \endpgfscope
        % draw leads
        \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left}{0pt}}
        \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@left}{0pt}}

        \pgfpathmoveto{\pgfpoint{\pgf@circ@res@right}{0pt}}
        \pgfpathlineto{\pgfpoint{.7\pgf@circ@res@right}{0pt}}

        \pgfusepath{draw}
      }
    }
  \makeatother

\begin{document}

\begin{circuitikz}
\node[inverter] {};
\end{circuitikz}

\end{document}

演示

相关内容