我在 tikz 中绘制电路并发现了问题。
第一个问题:我无法将垂直打开的节点对齐到左侧。有没有简单的解决方案?
第二个问题:有没有办法获取 T.A1 的 Y 坐标并将其放入另一个坐标中?例如:\draw (0,T.A1) -- (3,T.A1);
\begin{tikzpicture}%[european]
\ctikzset{transformer L2/.style={inductors/coils=8,inductors/width=1.2}}
% \ctikzset{quadpoles/transformer/width=1, quadpoles/transformer/height=6}
\ctikzset{bipoles/capacitor/width=.1}
\draw (0,0) to [short,o-] (0.5,0) to [/tikz/circuitikz/bipoles/length=1cm,R=$R_z$] (2.5,0) node[transformer core, anchor=A1](T){};
\draw (T.B1) to [/tikz/circuitikz/bipoles/length=1cm,R=$R_t$] (6.5,0) to [/tikz/circuitikz/bipoles/length=1cm,C=$C_1$] (8,0) to [/tikz/circuitikz/bipoles/length=1cm,D*=$P_1$] (10,0) to [short,-o] (11,0) node[anchor=south west] {A};
\draw (8,-2) to [/tikz/circuitikz/bipoles/length=1cm,D*=$P_2$] (8,0);
\draw (10,-2) to [/tikz/circuitikz/bipoles/length=1cm,C=$C_2$] (10,0);
\draw (6.5,0) to [/tikz/circuitikz/bipoles/length=0.75cm,C=$C'_d$] (6.5,-1) to [/tikz/circuitikz/bipoles/length=.75cm,C=$C''_d$] (6.5,-2);
\draw (T.B2) to [-] ($(T.B2)+(2,0)$) -| (6.5,-2);
\draw (T.B2) to [-] ($(T.B2)+(2,0)$) -| (8,-2);
\draw (T.B2) to [-] ($(T.B2)+(2,0)$) -| (10,-2);
\draw (10,-2) node[ground](GND){};
% \draw (and_2.in 2) to[short, -o] ++ (-60pt, 0) coordinate(x3) node[left]{$x_3$};
\draw (T.A2) to [short,-o] ++(-60pt,0) coordinate(x3);% -| (0,-2);
\end{tikzpicture}
答案1
有一种语法允许您选择一个坐标,该坐标采用X另一个坐标的值和是另一个坐标的值。语法的(A |- B)
含义是X的坐标值A
和是的坐标值B
。还有,(A -| B)
然后使用X的坐标值B
。
因此,基于此,我可能会执行以下操作:
\documentclass[border=10pt]{standalone}
\usepackage{circuitikz}
\ctikzset{
transformer L2/.style={
inductors/coils=8,
inductors/width=1.2,
},
quadpoles/transformer core/height=2.5,
bipoles/capacitor/width=.1,
bipoles/length=1cm,
/tikz/short bipole/.style={
/tikz/circuitikz/bipoles/length=.75cm,
}
}
\begin{document}
\begin{circuitikz}
\draw (0,0) to [short, o-] (0.5,0)
to[R=$R_z$] (2.5,0)
node[transformer core, anchor=A1] (T) {};
\draw (T.A2)
to[short, -o] (T.A2 -| 0,0);
\draw (T.B1)
to[R=$R_t$] (6.5,0)
to[C=$C_1$] (8,0)
to[D*=$P_1$] (10,0)
to[short, -o] (11,0) node[anchor=south west] {A};
\draw (8,0 |- T.A2)
to[D*=$P_2$] (8,0);
\draw (10,0 |- T.A2)
node[ground] (GND) {}
to[C=$C_2$] (10,0);
\draw (6.5,0)
to[short bipole, C=$C'_d$] (6.5,0 |- T.center)
to[short bipole, C=$C''_d$] (6.5,0 |- T.A2);
\draw (T.B2) to (GND.center);
\end{circuitikz}
\end{document}