manim README

The project's README from github.com/ManimCommunity/manim. As one markdown file: README.md.

Manim Community logo

PyPI Latest Release Docker image Launch Binder MIT License Reddit Twitter Discord Documentation Status CI

An animation engine for explanatory math videos


Manim is an animation engine for explanatory math videos. It's used to create precise animations programmatically, as demonstrated in the videos of 3Blue1Brown.

[!NOTE] The community edition of Manim (ManimCE) is a version maintained and developed by the community. It was forked from 3b1b/manim, a tool originally created and open-sourced by Grant Sanderson, also creator of the 3Blue1Brown educational math videos. While Grant Sanderson continues to maintain his own repository, we recommend this version for its continued development, improved features, enhanced documentation, and more active community-driven maintenance. If you would like to study how Grant makes his videos, head over to his repository (3b1b/manim).

Table of Contents:

Installation

[!CAUTION] These instructions are for the community version only. Trying to use these instructions to install 3b1b/manim or instructions there to install this version will cause problems. Read this and decide which version you wish to install, then only follow the instructions for your desired version.

Manim requires a few dependencies that must be installed prior to using it. If you want to try it out first before installing it locally, you can do so in our online Jupyter environment.

For local installation, please visit the Documentation and follow the appropriate instructions for your operating system.

Usage

Manim is an extremely versatile package. The following is an example Scene you can construct:

from manim import *


class SquareToCircle(Scene):
    def construct(self):
        circle = Circle()
        square = Square()
        square.flip(RIGHT)
        square.rotate(-3 * TAU / 8)
        circle.set_fill(PINK, opacity=0.5)

        self.play(Create(square))
        self.play(Transform(square, circle))
        self.play(FadeOut(square))

In order to view the output of this scene, save the code in a file called example.py. Then, run the following in a terminal window:

manim -p -ql example.py SquareToCircle

You should see your native video player program pop up and play a simple scene in which a square is transformed into a circle. You may find some more simple examples within this GitHub repository. You can also visit the official gallery for more advanced examples.

Manim also ships with a %%manim IPython magic which allows to use it conveniently in JupyterLab (as well as classic Jupyter) notebooks. See the corresponding documentation for some guidance and try it out online.

Command line arguments

The general usage of Manim is as follows:

manim-illustration

The -p flag in the command above is for previewing, meaning the video file will automatically open when it is done rendering. The -ql flag is for a faster rendering at a lower quality.

Some other useful flags include:

For a thorough list of command line arguments, visit the documentation.

Documentation

Documentation is in progress at ReadTheDocs.

Docker

The community also maintains a docker image (manimcommunity/manim), which can be found on DockerHub. Instructions on how to install and use it can be found in our documentation.

Help with Manim

If you need help installing or using Manim, feel free to reach out to our Discord Server or Reddit Community. If you would like to submit a bug report or feature request, please open an issue.

Contributing

Contributions to Manim are always welcome. In particular, there is a dire need for tests and documentation. For contribution guidelines, please see the documentation.

However, please note that Manim is currently undergoing a major refactor. In general, contributions implementing new features will not be accepted in this period. The contribution guide may become outdated quickly; we highly recommend joining our Discord server to discuss any potential contributions and keep up to date with the latest developments.

Most developers on the project use uv for management. You'll want to have uv installed and available in your environment. Learn more about uv at its documentation and find out how to install manim with uv at the manim dev-installation guide in the manim documentation.

How to Cite Manim

We acknowledge the importance of good software to support research, and we note that research becomes more valuable when it is communicated effectively. To demonstrate the value of Manim, we ask that you cite Manim in your work. Currently, the best way to cite Manim is to go to our repository page (if you aren't already) and click the "cite this repository" button on the right sidebar. This will generate a citation in your preferred format, and will also integrate well with citation managers.

Code of Conduct

Our full code of conduct, and how we enforce it, can be read on our website.

License

The software is double-licensed under the MIT license, with copyright by 3blue1brown LLC (see LICENSE), and copyright by Manim Community Developers (see LICENSE.community).

manim (ManimCommunity/manim)

Searching Database…

41.6K ·GitHub
这是什么?Manim 是一个由社区维护的 Python 框架,可以用代码生成精确的数学动画——3Blue1Brown 风格的数学讲解视频背后用的就是它。
我是把它当 Python 库用,还是它是一个独立的软件?两者都算:它既是一个用来编写动画代码的 Python 库,也附带一个命令行工具——你用 Python 描述一个 Scene,然后在终端里把它渲染成视频文件。
我怎么创建并渲染第一个动画?在一个文件里(比如 example.py)写一个 Scene 类,然后在终端运行 manim 命令,加上 -p 参数让结果自动播放,再加上 -ql 参数快速渲染一个低画质版本;渲染完成后,系统自带的视频播放器会自动弹出来。
我需要先在系统里装别的东西吗?需要——Manim 有几个依赖必须提前安装好,文档里有针对不同操作系统的说明。如果你暂时不想安装任何东西,也可以在在线 Jupyter 环境里先试用。
它免费吗?我能用在自己的项目里吗?可以——这个软件采用 MIT 许可证双重授权,版权由 3blue1brown LLC 和 Manim Community Developers 持有,因此可以自由使用、修改和分发,包括商业用途。
我在哪里能看到 Manim 动画实际是什么样子?README 里指向了官方示例画廊,里面有更多进阶示例,仓库本身也附带几个简单的示例场景。最经典的参考是 3Blue1Brown 的 YouTube 视频,它们是用这个分支所基于的原始版本制作的。
为什么研究人员应该引用 Manim?维护者希望当 Manim 对研究有帮助时能被引用,他们认为研究成果得到有效传播时会更有价值。最简单的方式是使用 GitHub 上的“引用此仓库”按钮,它能按你喜欢的格式生成引用,并且可以与文献管理软件配合使用。
What are similar projects?manim, Gource, math-as-code, mlcourse.ai, git-sim, fframes, videos, engine
Size
47.1 MB
Stars
41.6K
Age
6y
Commits · 90 Days