Some parts of the python library Manim need to be executed fast. This library contains code for these computations, but written in Rust to improve speed. This is an offshoot of ManimCommunity/manim#3808.
Note that not everything is rewritten in Rust, but only the parts that are called extremely frequently.
First, install manim. After that, it should just be
pip install manimforge
In the off-chance your operating system doesn't have prebuilt wheels, you'll need to install Rust.
After that, it should be as simple as inserting the following before rendering a scene:
import manimforge as mf
mf.setup()
This library is only tested with the following:
- Windows (x86-64)
- macOS (x86-64)
- macOS (aarch64)
- Linux (x86-64 glibc)
- Linux (x86 glibc)
This library supports the versions of python that Manim itself supports. However, there are some exceptions: namely that free-threaded builds of python are not supported.
- Clone the repo
- Create a virtual environment using something like
uv
(uv venv
) - Install dev dependencies (
uv sync
) - Build the library (
uv run maturin develop --uv
) - Run the example (
uv run manim -p examples/circle.py --disable_caching
)