将 CircuiTikz 接地符号重新定义为 IEC 60417 变体

将 CircuiTikz 接地符号重新定义为 IEC 60417 变体

是否可以将 CircuiTikz 接地符号更改为更像 IEC 60417 接地符号?

在此处输入图片描述

答案1

是的!

我稍微改变了坐标和线宽,使其看起来更相似:

在此处输入图片描述

您要求的符号全部都是单极子,它们在文件中定义pgfcircmonopoles.tex

以下是重新定义的单极子的代码:

\makeatletter
\pgfdeclareshape{ground}{
  \anchor{center}{
    \pgfpointorigin
  }
  \behindforegroundpath{
    \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
    \pgfscope
      \pgfstartlinewidth=\pgflinewidth
      \pgfsetlinewidth{2\pgflinewidth}
      \pgfpathmoveto{\pgfpointorigin}
      \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
      \pgfusepath{draw}
      \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
      \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
      \pgfusepath{draw}
      \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
      \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
      \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
      \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
      \pgfusepath{draw}
      \pgfsetlinewidth{\pgfstartlinewidth}
    \endpgfscope
  }
}

\pgfdeclareshape{nground}{
  \anchor{center}{
    \pgfpointorigin
  }
  \behindforegroundpath{
    \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
    \pgfscope
      \pgfstartlinewidth=\pgflinewidth
      \pgfsetlinewidth{2\pgflinewidth}
      \pgfpathmoveto{\pgfpointorigin}
      \pgfpathlineto{\pgfpoint{0pt}{-1.2\pgf@circ@res@step}}
      \pgfusepath{draw}
      \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
      \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
      \pgfusepath{draw}
      \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
      \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
      \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
      \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
      \pgfusepath{draw}
      \pgfpathmoveto{\pgfpoint{0.9\pgf@circ@res@step}{-1.6\pgf@circ@res@step}}
      \pgfpatharc{0}{180}{0.9\pgf@circ@res@step}
      \pgfusepath{draw}
      \pgfsetlinewidth{\pgfstartlinewidth}
    \endpgfscope
  }
}

\pgfdeclareshape{pground}{
  \anchor{center}{
    \pgfpointorigin
  }
  \behindforegroundpath{
    \pgf@circ@res@step=\ctikzvalof{monopoles/ground/width}\pgf@circ@Rlen
    \pgfscope
      \pgfsetlinewidth{2\pgflinewidth}
      \pgfstartlinewidth=\pgflinewidth
      \pgfpathmoveto{\pgfpointorigin}
      \pgfpathlineto{\pgfpoint{0pt}{-1\pgf@circ@res@step}}
      \pgfusepath{draw}
      \pgfpathmoveto{\pgfpoint{-.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
      \pgfpathlineto{\pgfpoint{.6\pgf@circ@res@step}{-1\pgf@circ@res@step}}
      \pgfusepath{draw}
      \pgfpathmoveto{\pgfpoint{-.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
      \pgfpathlineto{\pgfpoint{.4\pgf@circ@res@step}{-1.2\pgf@circ@res@step}}
      \pgfpathmoveto{\pgfpoint{-.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
      \pgfpathlineto{\pgfpoint{.25\pgf@circ@res@step}{-1.4\pgf@circ@res@step}}
      \pgfusepath{draw}
      \pgfpathcircle{\pgfpoint{0pt}{-0.75\pgf@circ@res@step}}{0.9\pgf@circ@res@step}
      \pgfusepath{draw}
      \pgfsetlinewidth{\pgfstartlinewidth}
    \endpgfscope
  }
}

\pgfdeclareshape{cground}{
\anchor{center}{
    \pgfpointorigin
}
\behindforegroundpath{
    \pgf@circ@res@step=\ctikzvalof{monopoles/chassis/width}\pgf@circ@Rlen
    \pgfscope
      \pgfstartlinewidth=\pgflinewidth
      \pgfsetlinewidth{2\pgflinewidth}
      \pgfpathmoveto{\pgfpointorigin}
      \pgfpathlineto{\pgfpoint{0pt}{-1.5\pgf@circ@res@step}}
      \pgfusepath{draw}
      \pgfpathmoveto{\pgfpoint{-1.00\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
      \pgfpathlineto{\pgfpoint{-0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
      \pgfpathlineto{\pgfpoint{ 0.75\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
      \pgfpathlineto{\pgfpoint{ 0.50\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
      \pgfpathmoveto{\pgfpoint{ 0.00\pgf@circ@res@step}{-1.50\pgf@circ@res@step}}
      \pgfpathlineto{\pgfpoint{-0.25\pgf@circ@res@step}{-2.10\pgf@circ@res@step}}
      \pgfusepath{draw}
      \pgfsetlinewidth{\pgfstartlinewidth}
    \endpgfscope
    }
}
\makeatother

您可以将其另存为 newmonopoles.tex,然后就可以了\input{newmonopoles}。或者,您也可以直接将此代码粘贴到您的 .tex 文件中。

以下是我上面展示的示例文档:

\documentclass{article}

\usepackage{tabularx}
\newcolumntype{C}{>{\centering\arraybackslash}X}

\usepackage{circuitikz}

\begin{document}
\pagenumbering{gobble}

CircuiTi\emph{k}Z versions:\hfill
\begin{tabularx}{0.6\textwidth}{*{4}{C}}
\tikz\draw (0,0) node [ground] {};&
\tikz\draw (0,0) node [nground] {};&
\tikz\draw (0,0) node [pground] {};&
\tikz\draw (0,0) node [cground] {};
\end{tabularx}

\input{newmonopoles}

ISO 7000/IEC 60417:\hfill
\begin{tabularx}{0.6\textwidth}{*{4}{C}}
\tikz\draw (0,0) node [ground] {};&
\tikz\draw (0,0) node [nground] {};&
\tikz\draw (0,0) node [pground] {};&
\tikz\draw (0,0) node [cground] {};
\end{tabularx}

\end{document}

相关内容