3

Good day, Can anyone help with how to create a new component in circuittikz. I am trying to create the Warburg element W shown in Fig.2 and replace the ch in Fig.1 with it.

Thanks

D.

enter image description here

6

Like this ?

Edited the resistor code to make this custom element customW.

enter image description here

\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}
  • thanks for the prompt response. Yes this is okay. – Dino Oct 3 '19 at 15:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.