Skip to content

Instantly share code, notes, and snippets.

@uwezi
Last active June 17, 2026 12:55
Show Gist options
  • Select an option

  • Save uwezi/9b4f2bc51ab13ce32bd2d76bc6597785 to your computer and use it in GitHub Desktop.

Select an option

Save uwezi/9b4f2bc51ab13ce32bd2d76bc6597785 to your computer and use it in GitHub Desktop.
[SVG import from KiCAD] Importing schematic drawings into Manim. #manim #svg #electronics #kicad
from manim import *
class kicadSVGImport(Scene):
def construct(self):
self.camera.background_color=WHITE
self.add(NumberPlane())
svg = SVGMobject("bilder/20260617_manim_test.svg").scale_to_fit_height(6)
svg.set_stroke(width=2)
self.add(svg)
config.frame_rate=1
config.pixel_width=800
config.pixel_height=450
class kicadSVGImport2(Scene):
def construct(self):
self.camera.background_color=WHITE
self.add(NumberPlane())
svg = SVGMobject("bilder/20260617_manim_test.svg").scale_to_fit_height(6)
svg.set_stroke(width=2)
self.add(svg)
self.wait()
for i in range(int(len(svg)/36)):
lbls = VGroup()
for j in range(i*36, min((i+1)*36,len(svg))):
lbl = Text(f"{j}", font_size=35,color=BLACK)
lbl.move_to([6*np.sin(j*10*DEGREES),3.5*np.cos(j*10*DEGREES),0])
lbl.add(Line(svg[j],lbl,stroke_width=1,stroke_color=PURE_RED))
lbls += lbl
self.add(lbls)
self.wait(2)
self.remove(lbls)
Display the source blob
Display the rendered blob
Raw
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
image image

The disadvantage for later manipulations/animations is the huge amount of submobjects created in the SVG by KiCAD, especially for the text...

kicadSVGImport_ManimCE_v0 20 1

A dark theme in KiCAD allows for an easy dark import into Manim as well

image image
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment