Skip to main content

Manim-Circuit Plugin

Description

A manim-plugin that adds customized Mobject and VMobject(s) to create some electrical components. Some electrical components include: Resistors, Inductors, and Capacitors.

Ok... But WHY?

Manim is an animation library for mathematics. So... what am I doing over here, making some basic circuit elements in the form of customized Mobjects? Well, as it turns out, much of circuit analysis has some pretty cool mathematics behind it, and so I wished that there was a library that could give me those customized Mobjects. I am making this library alongside the production of my Practical Engineering series on YouTube.

"airight man, but you do know that other libraries exist, you know... CircuiTikz via LaTex, circuitanimlib for ManimGL just to name a few... Stop insisting on re-inventing the wheel".

Alright, let's talk about CircuiTikz. I am fully aware that this wonderful LaTex package exists. You can choose to use CircuitTikz to render the circuit, but you cannot select components of that Tex Mobject like you would when using this manim-plugin. Also, I saw a few bugs on forums relating manim and CircuitTikz together, on other GitHub repositories.CircuitTikz is great at making PDFs, drawing circuit diagrams in papers, but it just simply does not fit nicely with Manim.

And for circuitanimlib, the library seemed promising, until I realized its latest commit renders it broken, and its unmaintained. Also, it uses ManimGL which, although faster, has limited documentation on it.

This library is written for ManimCE, not ManimGL. Additionally, there are more resrouces for ManimCE as opposed to ManimGL. Additionally still, ManimCE even has a nice plugin repository and active community plugins. I'd like to make a contribution onto it!

Inspiration

Why I made this library

Roadmap/To-Do

  • Add transistors
  • If I have time, make logic gates too

Completed

  • Make this my first open-source package that I, FuzzyPenguin (online alias: Pete Aptenodyte Forsteri) will maintain.
  • Release this to Pypi
  • Make this a manim-plugin named manim-circuit
  • Clean up the Code
  • Prettify by using VMobjects, and make the point selection more accurate.
  • Optimized Resistors, fully prettified.
  • Maybe make a Circuit Mobject in order to help with circuit analysis
  • Use this library for AT LEAST one of my future videos whatever it may be*

*Supernode Analysis. Unfortunately, the code for this is not published, as I was using ManimGL, and a local fork of manim-circuit to make it compatible with ManimGL. The video is here if you want some inspiration/ideas as to what you could use this library for! I might consider releasing the source code if enough people show interest, but I don't have the time to write a proper disclaimer and make it compatible with ManimCE. I would love to put it in examples/ in the near future though. Leave some comments on the video if you're interested!

Documentation

Resistor(), Inductor(), Capacitor(), supports labels. For example: Inductor(label="0.3", direction=UP) will make a 0.3 H inductor with a label on the top.

All customized Mobjects will have a .get_terminals(self, val) method where passing something in val will return the coordinate of a pin of any circuit Element.

Examples in examples/

License

MIT

Release files for manim-circuit 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for manim-circuit 0.0.3
File Size Uploaded
manim_circuit-0.0.3.tar.gz 7.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for manim-circuit 0.0.3
File Interpreter ABI Platform
manim_circuit-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 15.4 kB

Release files / manim_circuit-0.0.3.tar.gz

Download URL manim_circuit-0.0.3.tar.gz
Size 7.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a6dbbb74d850186935105f480ce80eeca991c59d8d1e17e8445e8dedd8a93768
BLAKE2b-256 checksum
How to use checksums
58ae31278d30110c59c689c93ccbbd9e0eed53b765a7caa6a1eaf46f8957ef0b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.0 CPython/3.12.7 Linux/6.12.1-arch1-1

Release files / manim_circuit-0.0.3-py3-none-any.whl

Download URL manim_circuit-0.0.3-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d17ec5721ddde7f3958abe75be5eda0a1668481b02d0e9d4dfdc882b8a85bb81
BLAKE2b-256 checksum
How to use checksums
47589fd7a94063b8a08f983d4ebbfe2c7a2f6ee9d532f04e352915776a9e0f44
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.0.0 CPython/3.12.7 Linux/6.12.1-arch1-1

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page