我正在尝试访问电感器中导线在 circuitikz 中连接的点。我在文档中找不到锚点的名称(它们真的存在吗?),我尝试使用普通的 tikz 锚点来帮助我。但正如您在结果中看到的那样,存在一个我不想要的间隙。有人试过这个吗?或者可以告诉我,这是否可行?非常感谢!
为了说明我的意思:
\documentclass{standalone}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usepackage[americaninductors]{circuitikz}
\tikzset{measure/.style={circuitikz/inductors/coils = 2,circuitikz/inductors/width = 0.35}}
\begin{document}
\begin{tikzpicture}[transform shape]
\node (SO) [rectangle, draw] at (0,0) {SO};
\coordinate[node distance = 1.5cm, left = of SO] (l) {};
\coordinate[node distance = 1.5cm, right = of SO] (r) {};
\draw (l) to[short] (SO)
(r) -- (SO);
\node (l_i) [americaninductorshape,measure,yshift = -0.1cm] at ($(SO.west)!0.5!(l)$) {};
\node (r_i) [americaninductorshape,measure,yshift = -0.1cm] at ($(SO.east)!0.5!(r)$) {};
\draw (l_i.south east) -- ++ (0,-1) node (l_m) {} -| (r_i.south west)
(l_i.south west) -- ++ (0,-3) node (l_u) {} -| (r_i.south east);
\coordinate (m_o) at (SO |- l_m) {};
\coordinate (m_u) at (SO |- l_u) {};
\node (I) [rectangle, draw] at ($(m_o)!0.5!(m_u)$) {$\Delta I>$};
\draw (m_o) to [short,*-] (I)
(m_u) to [short,*-] (I);
\end{tikzpicture}
\end{document}
答案1
您可以使用左锚点和右锚点,但正如您所注意到的,这里有一个问题(使用最低限度例子):
\documentclass[border=3mm]{standalone}
\usepackage[americaninductors]{circuitikz}
\tikzset{measure/.style={circuitikz/inductors/coils = 2,circuitikz/inductors/width = 0.35}}
\begin{document}
\begin{tikzpicture}
\node (l_i) [americaninductorshape,measure,yshift = -0.1cm] at (0,0) {};
\draw (l_i.left) -- ++(0,-1);
\end{tikzpicture}
\end{document}
...这可以说是软件包的一个错误(锚点应该位于粗线的中心),但由于它一直都是这样,而且对于很多设备来说,我不知道是否可以更改它。我有时间会研究一下……但不要抱太大希望。
答案2
可爱的电感锚点似乎偏离了相同的 0.4pt(线条粗细)。
\documentclass[border=3mm]{standalone}
\usepackage[americaninductors]{circuitikz}
\tikzset{measure/.style={circuitikz/inductors/coils = 2,circuitikz/inductors/width = 0.35}}
\begin{document}
\begin{tikzpicture}
\node (I) [americaninductorshape,measure] at (0,0) {};
\draw[red] (I.north east) -- (I.north west) -- (I.south west) -- (I.south east) -- cycle;
\draw[red] (I.east) -- (I.west) (I.north) -- (I.south);
\draw (I.left) ++(-.4pt,0pt) -- ++(0,-.5);
\draw (I.right) ++(.4pt,0pt) -- ++(0,-.5);
\end{tikzpicture}
\end{document}