我正在尝试在 MacOs Mojave 10.14.6 上使用 manim 绘制以下电路:
from manimlib.imports import *
class TikzMobject(TextMobject):
CONFIG = {
"stroke_width": 3,
"fill_opacity": 0,
"stroke_opacity": 1,
}
class ExampleTikz(Scene):
def construct(self):
circuit = TikzMobject(r"""
\begin{circuitikz}[american voltages]
\draw
(0,0) to [short, *-] (6,0)
to [V, l_=$\mathrm{j}{\omega}_m \underline{\psi}^s_R$] (6,2)
to [R, l_=$R_R$] (6,4)
to [short, i_=$\underline{i}^s_R$] (5,4)
(0,0) to [open,v^>=$\underline{u}^s_s$] (0,4)
to [short, *- ,i=$\underline{i}^s_s$] (1,4)
to [R, l=$R_s$] (3,4)
to [L, l=$L_{\sigma}$] (5,4)
to [short, i_=$\underline{i}^s_M$] (5,3)
to [L, l_=$L_M$] (5,0);
\end{circuitikz}
"""
)
self.play(Write(circuit))
self.wait()
应该可以正常工作并画出漂亮的电路。但后来我得到的结果是这个:
有谁知道这是否只是 MacOs 问题或如何解决?
编辑:我在 Linux (Fedora) 上试过,效果很好。一定是MacOs的问题