แผนผังพร้อมสวิตช์
Oct 23 2020
ฉันต้องการทำแผนภาพนี้ด้วยน้ำยาง ฉันรู้วิธีวาดสี่เหลี่ยมและลูกศร (ผู้ใช้ tikz พื้นฐาน) แต่การทำแบบสมมาตรเพื่อให้หัวลูกศรอยู่ตรงกลางกล่องนั้นใช้เวลามาก (โดยปกติจะต้องทำบนกระดาษก่อนโดยระบุความยาวทั้งหมด) มีวิธีที่เร็วกว่าในการทำแผนภาพประเภทนี้หรือไม่? นอกจากนี้หากคุณสามารถช่วยในส่วนใดส่วนหนึ่งของแผนภาพนี้ฉันสามารถทำส่วนที่เหลือให้เสร็จได้ ขอบคุณ
คำตอบ
5 Rmano Oct 23 2020 at 00:17
หากคุณพบว่าตัวเองทำการคำนวณด้วยตนเองจำนวนมากเพื่อรักษาความสมมาตรฉันมีคำแนะนำสองประการสำหรับคุณ:
- เรียนรู้การใช้พิกัดสัมพัทธ์
coordinateและจุดยึดที่ถูกต้อง - เรียนรู้การใช้ไลบรารี
calcTi k Z (ไม่จำเป็นที่นี่ แต่ ... )
วิธีหนึ่งในการสร้างไดอะแกรมของคุณคือวิธีต่อไปนี้ (สามารถบีบอัดได้ แต่ฉันไม่ต้องการใช้เทคนิคหรือสิ่งอื่นที่คล้ายคลึงกัน - โค้ดควรตรงไปตรงมา)
\documentclass[border=10pt]{standalone}
\usepackage[siunitx, RPvoltages]{circuitikz}
\begin{document}
\begin{circuitikz}
\draw (0,0) coordinate(A) to[rmeterwa] ++(3,0) coordinate(B);
% circuitikz manual page 105
\node [cute spdt up arrow, anchor=in](sw-r) at (B){};
\node [cute spdt up arrow, anchor=in, xscale=-1](sw-l) at (A){};
\draw [dashed] (sw-l-in) -- (sw-l-out 2);
\draw [dashed] (sw-r-in) -- (sw-r-out 2);
\draw (sw-l.out 1) -- ++(-2,0);
\draw (sw-l.out 2) to[generic, name=G] ++(-2,0);
\node at (G.center) {D};
% circuitikz manual page 71
% put the adder midway between the switch and ++(2,0)
\draw (sw-r.out 1) ++(1,0) node[adder, circuitikz/blocks/scale=0.5](ADD){} ++(1,0) coordinate(Aend);
\draw (sw-r.out 1) -- (ADD.w) node[inputarrow]{} (ADD.e) -- (Aend) node[inputarrow]{};
\draw (ADD.n) node[inputarrow, rotate=-90]{} -- ++(0,0.5);
\end{circuitikz}
\end{document}
5 Bernard Oct 23 2020 at 02:59
โซลูชัน pstricks พร้อมpst-circแพ็คเกจ:
\documentclass[11pt, border=6pt, svgnames]{standalone}
\usepackage{pst-circ}
\usepackage{sansmath}
\begin{document}
\begin{pspicture}(-5,-1)(6.5,2.5)
\sffamily\psset{dash=4pt 3pt, linewidth=1pt, arrowinset=0, linejoin=1}%,
\SpecialCoor
\pnodes{A}(0,0)(-1.5,0)(1.5,0)
\pnodes{B}(-5,0.75)(-2.5,0.75)(2.5,0.75)(6.4,0.75)
\pnodes{C}(-5,-0.75)(-2.5,-0.75)(2.5,-0.75)
\pnodes(0,0){O}(4.45,2.5){C}
\pcline(B0)(B1)
\resistor[labeloffset=0](C0)(C1){D}
\Ucc(A1)(A2){}
{\psset{linewidth=0.8pt}\psline{->}(0.9;-120)(0.9;60)
\psarc{->}(A1){0.75}{110}{170}\psarcn{->}(A2){0.75}{70}{10}}
{\psset{linewidth=1.5pt}\pcline{-*}(A1)(B1)\pcline[linestyle=dashed]{o-*}(A1)(C1)%
\pcline{-*}(A2)(B2)\pcline[linestyle=dashed]{o-*}(A2)(C2)}
\Ucc[labeloffset=0](B2)(B3){\Large\bfseries+}
\psline{->}(C)(4.45,1.25)\psline{->}(B2)(3.96,0.75)\psline{->}(5,0.75)(6.5,0.75)
\end{pspicture}
\end{document}