![CircuiTikZ —如何创建 Warburg 元素](https://linux22.com/image/402581/CircuiTikZ%20%E2%80%94%E5%A6%82%E4%BD%95%E5%88%9B%E5%BB%BA%20Warburg%20%E5%85%83%E7%B4%A0.png)
答案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}