CircuiTikZ —如何创建 Warburg 元素

CircuiTikZ —如何创建 Warburg 元素

大家好,有人能帮忙在 circuittikz 中创建新组件吗?我正在尝试创建图 2 中所示的 Warburg 元素 W,并用它替换图 1 中的 ch。

谢谢

D.

在此处输入图片描述

答案1

像这样 ?

编辑电阻器代码以制作此自定义元素customW

在此处输入图片描述

\documentclass[border=3mm]{standalone}
\usepackage{circuitikz}

\makeatletter
\pgfcircdeclarebipole{}{\ctikzvalof{bipoles/resistor/height}}{customW}{\ctikzvalof{bipoles/resistor/height}}{\ctikzvalof{bipoles/resistor/width}}{
    \pgfsetlinewidth{\pgfkeysvalueof{/tikz/circuitikz/bipoles/thickness}\pgfstartlinewidth}
    \pgftransformationadjustments
    \pgfmathsetlength{\pgf@circ@res@step}{\ctikzvalof{bipoles/resistor/width}\pgf@circ@Rlen+\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}
    \divide \pgf@circ@res@step by 8

 \pgfpathmoveto{\pgfpoint{\pgf@circ@res@left-\pgfhorizontaltransformationadjustment*0.5*\pgflinewidth}{\pgf@circ@res@zero}}
    \pgf@circ@res@other = \pgf@circ@res@left
    \pgfpathmoveto{\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}}
    \pgfsetbeveljoin
    \pgfusepath{draw}
}
  \def\pgf@circ@customW@path#1{\pgf@circ@bipole@path{customW}{#1}}
  \compattikzset{customW/.style = {\circuitikzbasekey, /tikz/to path=\pgf@circ@customW@path, label=#1}}
\makeatother

\begin{document}
\begin{circuitikz}
\draw (3.5,0) to[customW] ++(3,0);
\end{circuitikz}
\end{document}

相关内容