3

I'm very new to coding and am mostly trying to learn on my own. I'm starting to pick up the basics of manim, but am still having difficulties with troubleshooting. I've been trying to get manim to draw tikz diagrams. I started by drawing a simple opamp. I am getting an incomplete output i.e. one edge of the opamp is missing.

Here is the code:

from manimlib.imports import *

class OpAmp(Scene):
    def construct(self):
        circuit = TikzMobject(r"""
        \begin{circuitikz}[american]
        \draw (0,0) node[op amp](OpAmp){};
        \end{circuitikz}""")
        self.add(circuit)

Here is the output that I am getting:

Output

Its such a small error but I am not able to find the answer. Please help! I appreciate it greatly!

1 Answers1

2

Upon digging into manim I found out that this issue was due to the shortcoming of manim's SVG parser. The z (closepath) type was not recognized by the parser. A simple line of code solved the problem. Open manimlib\mobject\svg\svg_mobject.py Add this line at line 406

self.add_line_to(self.points[0])