我花了一个小时来制作这个,这是我的第一个 Tikz 电路。我正在尝试重新制作它。
我还没有完成。我有一些疑问,因为在画图时我感到困惑,不确定我是否做对了。
- 您将如何创建类似这样的内部带有正方形和 X 的图钉?
- 我的绘图比原图大很多。这正常吗?我必须这样做,因为每个组件的尺寸似乎都是 1 厘米长。
- 我怎样才能添加这样的“电源电压”?
\documentclass[border={5mm}]{standalone}
\usepackage[american,siunitx]{circuitikz}
\begin{document}
\begin{tikzpicture}[line width = 0.5, voltage shift=0.5]
\draw [gray] (0,0) rectangle (4,9);
\draw (0,2) to [short,-*] ++(-1,0) coordinate(C1) to [short, -o] ++(-3,0);
\draw (C1) to [C] ++(0,-1) node[ground]{};
\draw (0,4) to [short,-*] ++(-1,0) coordinate(C2) to [short] ++(-1,0) to [cute inductor] ++(-1,0) to [short, -o]++(-1,0);
\draw (C2) to [C] ++(0,-1) node[ground]{};
\draw (0,6) to [short,-*] ++(-1,0) coordinate(C3) to [short] ++(-1,0) to [cute inductor] ++(-1,0) to [short, -o]++(-1,0);
\draw (C3) to [C] ++(0,-1) node[ground]{};
\draw (0,8) to [short,-*] ++(-1,0) coordinate(C4) to [short] ++(-1,0) to [cute inductor] ++(-1,0) to [short, -o]++(-1,0);
\draw (C4) to [C] ++(0,-1) node[ground]{};
\end{tikzpicture}
\end{document}
答案1
\documentclass[tikz, border=1cm]{standalone}
\usepackage[american, siunitx]{circuitikz}
\begin{document}
\begin{tikzpicture}[transform shape, scale=1,]
\ctikzset{
inductors/scale=0.5,
capacitors/scale=0.3,
power supplies/scale=0.5,
}
\draw[ultra thick, gray] (2.8,4) rectangle +(3,-5);
\draw[yshift=3cm] (0,0) to[short, o-] ++(1.6,0) to[cute inductor] ++(0.4,0) to[short,-*] ++(0.4,0) coordinate(C1) to[short] (2.8,0) node[osquarepole]{} to[short] ++(0.8,0) node[draw, fill=white, minimum height=1.2cm, minimum width=1.8cm, right]{Core};
\draw (C1) to[C] ++(0,-0.4) node[vee]{};
\draw[yshift=2cm] (0,0) to[short, o-] ++(1.2,0) to[cute inductor] ++(0.4,0) to[short,-*] ++(0.4,0) coordinate(C2) to[short] (2.8,0) node[osquarepole]{} to[short] ++(0.6,0) node[draw, fill=white, minimum height=1.2cm, minimum width=1.8cm, right]{Memory};
\draw (C2) to[C] ++(0,-0.4) node[vee]{};
\draw[yshift=1cm] (0,0) to[short, o-] ++(0.8,0) to[cute inductor] ++(0.4,0) to[short,-*] ++(0.4,0) coordinate(C3) to[short] (2.8,0) node[osquarepole]{} to[short] ++(0.4,0) node[draw, fill=white, minimum height=1.2cm, minimum width=1.8cm, right]{Camera};
\draw (C3) to[C] ++(0,-0.4) node[vee]{};
\draw[yshift=0cm] (0,0) to[short, o-] ++(0.8,0) to[short,-*] ++(0.4,0) coordinate(C4) to[short] (2.8,0) node[osquarepole]{} to[short] ++(0.2,0) node[draw, fill=white, minimum height=1.2cm, minimum width=1.8cm, right, align=center]{LED\\Driver};
\draw (C4) to[C] ++(0,-0.4) node[vee]{};
\end{tikzpicture}
\end{document}
编辑:配有定制十字销
\documentclass[tikz, border=1cm]{standalone}
\usepackage[american, siunitx]{circuitikz}
\begin{document}
\begin{tikzpicture}
\tikzset{
cross/.style={
draw, fill=white, inner sep=2pt,
path picture={\draw
(path picture bounding box.south east) --
(path picture bounding box.north west)
(path picture bounding box.south west) --
(path picture bounding box.north east);
}}}
\ctikzset{
inductors/scale=0.5,
capacitors/scale=0.3,
power supplies/scale=0.5,
}
\draw[ultra thick, gray] (2.8,4) rectangle +(3,-5);
\draw[yshift=3cm] (0,0) to[short, o-] ++(1.6,0) to[cute inductor] ++(0.4,0) to[short,-*] ++(0.4,0) coordinate(C1) to[short] (2.8,0) node[cross]{} to[short] ++(0.8,0) node[draw, fill=white, minimum height=1.2cm, minimum width=1.8cm, right]{Core};
\draw (C1) to[C] ++(0,-0.4) node[vee]{};
\draw[yshift=2cm] (0,0) to[short, o-] ++(1.2,0) to[cute inductor] ++(0.4,0) to[short,-*] ++(0.4,0) coordinate(C2) to[short] (2.8,0) node[cross]{} to[short] ++(0.6,0) node[draw, fill=white, minimum height=1.2cm, minimum width=1.8cm, right]{Memory};
\draw (C2) to[C] ++(0,-0.4) node[vee]{};
\draw[yshift=1cm] (0,0) to[short, o-] ++(0.8,0) to[cute inductor] ++(0.4,0) to[short,-*] ++(0.4,0) coordinate(C3) to[short] (2.8,0) node[cross]{} to[short] ++(0.4,0) node[draw, fill=white, minimum height=1.2cm, minimum width=1.8cm, right]{Camera};
\draw (C3) to[C] ++(0,-0.4) node[vee]{};
\draw[yshift=0cm] (0,0) to[short, o-] ++(0.8,0) to[short,-*] ++(0.4,0) coordinate(C4) to[short] (2.8,0) node[cross]{} to[short] ++(0.2,0) node[draw, fill=white, minimum height=1.2cm, minimum width=1.8cm, right, align=center]{LED\\Driver};
\draw (C4) to[C] ++(0,-0.4) node[vee]{};
\end{tikzpicture}
\end{document}