Circuitikz 美国热敏电阻符号

Circuitikz 美国热敏电阻符号

有没有办法在 circuitikz 中获取热敏电阻的美国符号?
到目前为止,即使american加载了选项,当我绘制热敏电阻时

\begin{circuitikz}
    \draw
    (0, 0) to[thermistor ntc] (2, 0);
\end{circuitikz}

我得到了欧洲符号:

在此处输入图片描述

有没有什么办法可以获得美国符号?

在此处输入图片描述

谢谢

答案1

这是一种最小转换,因为它仍然使用线下方的相同符号。此外,我移动了线,使其穿过中心。

有很多组件使用欧洲电阻器,因此我添加了一个宏以使转换更容易。

\documentclass{standalone}
\usepackage{circuitikz}

\makeatletter
\newcommand{\drawamericanresistor}[3]% #1=width (factor), #2=height, #3=depth
{\pgfscope
  \pgftransformationadjustments
    \pgfmathsetlength{\pgf@circ@res@step}{#1\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
    \divide \pgf@circ@res@step by 12
  \pgf@circ@res@up=#2
  \pgf@circ@res@down=#3

    \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
    \pgf@circ@res@other = \pgf@circ@res@left
    \advance\pgf@circ@res@other by \pgf@circ@res@step 
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
    \advance\pgf@circ@res@other by 2\pgf@circ@res@step 
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
    \advance\pgf@circ@res@other by 2\pgf@circ@res@step
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
    \advance\pgf@circ@res@other by 2\pgf@circ@res@step
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
    \advance\pgf@circ@res@other by 2\pgf@circ@res@step
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@up}}
    \advance\pgf@circ@res@other by 2\pgf@circ@res@step
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@down}}
    \advance\pgf@circ@res@other by \pgf@circ@res@step
    \pgfpathlineto{\pgfpoint{\pgf@circ@res@other}{\pgf@circ@res@zero}}
    \pgfsetbeveljoin
    \pgfusepath{draw}
\endpgfscope}

%% Thermistor NTC
\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/thermistorntc/height 2}}{thermistorntc}{\ctikzvalof{bipoles/thermistorntc/height}}{\ctikzvalof{bipoles/thermistorntc/width}}{
    \pgf@circ@res@other=\ctikzvalof{bipoles/thermistorntc/main}\pgf@circ@res@up
        \drawamericanresistor{\ctikzvalof{bipoles/thermistorntc/width}}{\pgf@circ@res@other}{-\pgf@circ@res@other}

        \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@left}{\pgf@circ@res@up}}
        \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@left}{-\pgf@circ@res@up}}
        \pgfpathlineto{\pgfpoint{\pgf@circ@res@left}{-\pgf@circ@res@up}}
        \pgfusepath{draw}

        \pgfsetlinewidth{\pgfstartlinewidth}
        \pgftext[top,x=.85\pgf@circ@res@left,y=.75\pgf@circ@res@down]{\tiny$\vartheta$}
        \pgfsetarrowsend{latex'}
        \pgfpathmoveto{\pgfpoint{.62\pgf@circ@res@left}{\pgf@circ@res@down}}
        \pgfpathlineto{\pgfpoint{.62\pgf@circ@res@left}{.7\pgf@circ@res@down}}
        \pgfusepath{draw}
        \pgfpathmoveto{\pgfpoint{.45\pgf@circ@res@left}{.7\pgf@circ@res@down}}
        \pgfpathlineto{\pgfpoint{.45\pgf@circ@res@left}{\pgf@circ@res@down}}
        \pgfusepath{draw}
}
\makeatother

\begin{document}
\begin{circuitikz}
    \draw
    (0, 0) to[thermistor ntc] (2, 0);
\end{circuitikz}
\end{document}

在此处输入图片描述

相关内容