使用circuitikz电压源图标作为节点

使用circuitikz电压源图标作为节点

我正在使用 circuitikz 绘制单线图:

输出

但我不知道如何去掉电压源上方的线。有没有简单的方法可以做到?

这是我当前的代码:

\documentclass[a4paper]{report}
\usepackage{circuitikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{circuitikz}
    \draw [help lines] (0,0) grid (15,20);
    \draw (2,18) to [sV] (2,16); %voltage source
    \draw [ultra thick] (1,16) node[anchor=south]{b1} -- (3,16);
    \draw (1.5,16) -- (1.5,13);
    \draw [ultra thick] (1,13) node[anchor=south]{b3} -- (3,13);
    \draw(2.5,13) |- +(0,0.5) -- +(4,0.5) |- +(4,0);
    \draw [ultra thick] (6,13) node[anchor=south]{b4} -- +(2,0);
    \draw (7.5,13) -- (7.5,16);
    \draw [ultra thick] (6,16) node[anchor=south]{b2} -- +(2,0);
    \draw(6.5,16) |- +(0,-0.5) -- +(-4,-0.5) |- +(-4,-0);
    \draw (2,16) -- +(0,-0.5) node[fill=white,shape=regular polygon, rotate=180, regular polygon sides=3,minimum size=0.8,draw]{};
    \draw (2,13) -- +(0,-0.5) node[fill=white,shape=regular polygon, rotate=180, regular polygon sides=3,minimum size=0.8,draw]{};
    \draw (7,16) -- +(0,-0.5) node[fill=white,shape=regular polygon, rotate=180, regular polygon sides=3,minimum size=0.8,draw]{};
    \draw (7,13) -- +(0,-0.5) node[fill=white,shape=regular polygon, rotate=180, regular polygon sides=3,minimum size=0.8,draw]{};

    \draw (2.3,12.4)--(3,12) [anchor= west] node{\emph{Load}};
    \draw (2.3,17.4)--(3,18) [anchor= west] node{\emph{Fixed voltage}};
\end{circuitikz}
\end{document}

答案1

画出与圆直径相等长度的电压源!然后单独连接。

\documentclass[a4paper]{report}
\usepackage{circuitikz}
\usetikzlibrary{shapes}
\begin{document}
\begin{circuitikz}
    %\draw [help lines] (0,0) grid (15,20);
    \draw (2,17.85) to [sV] (2,17); %voltage source
    \draw (2,17) -- (2,16); %% Connecting the voltage source.
    \draw [ultra thick] (1,16) node[anchor=south]{b1} -- (3,16);
    \draw (1.5,16) -- (1.5,13);
    \draw [ultra thick] (1,13) node[anchor=south]{b3} -- (3,13);
    \draw(2.5,13) |- +(0,0.5) -- +(4,0.5) |- +(4,0);
    \draw [ultra thick] (6,13) node[anchor=south]{b4} -- +(2,0);
    \draw (7.5,13) -- (7.5,16);
    \draw [ultra thick] (6,16) node[anchor=south]{b2} -- +(2,0);
    \draw(6.5,16) |- +(0,-0.5) -- +(-4,-0.5) |- +(-4,-0);
    \draw (2,16) -- +(0,-0.5) node[fill=white,shape=regular polygon, rotate=180, regular polygon sides=3,minimum size=0.8,draw]{};
    \draw (2,13) -- +(0,-0.5) node[fill=white,shape=regular polygon, rotate=180, regular polygon sides=3,minimum size=0.8,draw]{};
    \draw (7,16) -- +(0,-0.5) node[fill=white,shape=regular polygon, rotate=180, regular polygon sides=3,minimum size=0.8,draw]{};
    \draw (7,13) -- +(0,-0.5) node[fill=white,shape=regular polygon, rotate=180, regular polygon sides=3,minimum size=0.8,draw]{};

    \draw (2.3,12.4)--(3,12) [anchor= west] node{\emph{Load}};
    \draw (2.3,17.4)--(3,18) [anchor= west] node{\emph{Fixed voltage}};
\end{circuitikz}
\end{document}

在此处输入图片描述

答案2

另一种解决方案,不那么黑客:)

每个双极子都有一个底层节点形状,其名称类似于 xxxshape。大多数都很容易推断(resistorshape例如),但其余的必须在 中查找pgfcircbipoles.sty。在本例中,它是vsourcesinshape

如果您更新到新版本的软件包(我几天前刚刚发布过),您也可以使用新的地面sground

\begin{circuitikz}
    \draw (2,17) node[vsourcesinshape, rotate=90] (V1) {}
          (V1.left) -- (2,15.5) node[sground]{};
    \draw [ultra thick] (1,16) node[anchor=south]{b1} -- (3,16);
    \draw (1.5,16) -- (1.5,13);
    \draw [ultra thick] (1,13) node[anchor=south]{b3} -- (3,13);
    \draw(2.5,13) |- +(0,0.5) -- +(4,0.5) |- +(4,0);
    \draw [ultra thick] (6,13) node[anchor=south]{b4} -- +(2,0);
    \draw (7.5,13) -- (7.5,16);
    \draw [ultra thick] (6,16) node[anchor=south]{b2} -- +(2,0);
    \draw(6.5,16) |- +(0,-0.5) -- +(-4,-0.5) |- +(-4,-0);
    \draw (0,-0.5) ;
    \draw (2,13) -- +(0,-0.5) node[sground]{};
    \draw (7,16) -- +(0,-0.5) node[sground]{};
    \draw (7,13) -- +(0,-0.5) node[sground]{};

    \draw (2.3,12.4)--(3,12) [anchor= west] node{\emph{Load}};
    \draw (2.3,17.4)--(3,18) [anchor= west] node{\emph{Fixed voltage}};

\end{circuitikz}

答案3

一个简单的解决方案就是将其添加到您的代码中

```

\draw [white,thick](2,17.997)--(2,17.434)       ;   % covers unwanted line
\draw[gray,very thin](2,17.997)--(2,17.434)     ;   % matches with background

```

相关内容