文章摘要
Manim是一款用于精确编程动画的引擎,主要用于制作数学解释视频。它有两个版本:一个是3Blue1Brown作者的个人项目ManimGL,另一个是2020年开发者分叉出的社区版,旨在更稳定、易用且响应社区贡献。安装时需注意区分版本,ManimGL通过pip install manimgl安装,要求Python 3.7及以上,并依赖FFmpeg、OpenGL和LaTeX等系统组件。
文章总结
Manim 是一个用于精确编程动画的引擎,专门设计用于创建解释性数学视频。需要注意的是,Manim 有两个版本。最初,这个项目是 3Blue1Brown 作者的个人项目,用于制作动画视频,相关代码可在其仓库中找到。2020 年,一群开发者将其分叉为社区版,目标是更稳定、测试更完善、对社区贡献响应更快,并且更易于上手。
安装说明
警告:以下安装说明仅适用于 ManimGL 版本。若尝试使用这些说明安装 Manim Community 版本,或反之,将会导致问题。因此,首先应确定要安装的版本,然后仅遵循相应版本的安装说明。
注意:通过 pip 直接安装 Manim 时,请注意安装包的名称。本仓库的 ManimGL 版本包名为 manimgl,而非 manim 或 manimlib。请使用 pip install manimgl 来安装此版本。
Manim 需要 Python 3.7 或更高版本,系统要求包括 FFmpeg、OpenGL 和 LaTeX(可选)。Linux 系统还需安装 Pango 及其开发头文件。
直接安装
```bash
安装 manimgl
pip install manimgl
尝试运行
manimgl ```
从源码安装
若想直接修改 Manim 源码,可克隆仓库并在目录中执行:
```bash
安装 manimgl
pip install -e .
尝试运行
manimgl example_scenes.py OpeningManimExample ```
Windows 安装
- 安装 FFmpeg。
- 安装 LaTeX 发行版,推荐 MiKTeX。
- 安装剩余的 Python 包。
- 克隆仓库并安装:
bash
git clone https://github.com/3b1b/manim.git
cd manim
pip install -e .
manimgl example_scenes.py OpeningManimExample
Mac OSX 安装
- 使用 Homebrew 安装 FFmpeg 和 LaTeX:
bash
brew install ffmpeg mactex
- 若使用 ARM 处理器,需安装 Cairo:
bash
arch -arm64 brew install pkg-config cairo
- 安装最新版 Manim:
bash
git clone https://github.com/3b1b/manim.git
cd manim
pip install -e .
manimgl example_scenes.py OpeningManimExample
Anaconda 安装
- 安装 LaTeX。
- 创建并激活 conda 环境:
bash
conda create -n manim python=3.8
conda activate manim
- 安装 ManimGL:
bash
pip install -e .
使用 Manim
尝试运行以下命令:
bash
manimgl example_scenes.py OpeningManimExample
这将弹出一个窗口播放简单场景。可通过示例场景了解库的语法、动画类型和对象类型。在 3b1b/videos 仓库中,可查看所有 3Blue1Brown 视频的代码,但旧视频的代码可能与最新版 Manim 不兼容。
命令行参数
-w:将场景写入文件-o:将场景写入文件并打开结果-s:跳过动画,仅显示最后一帧-so:保存最后一帧为图片并显示-n <number>:跳转到场景的第 n 个动画-f:使播放窗口全屏
配置文件
可通过 custom_config.yml 进行进一步配置。可编辑此文件,或在运行 Manim 的目录中添加同名文件以自定义配置。
文档
文档正在 3b1b.github.io/manim 编写中,中文版由 @manim-kindergarten 维护:docs.manim.org.cn。
贡献
欢迎贡献。社区版拥有最活跃的贡献生态系统,但本仓库也欢迎提交拉取请求。请解释更改的动机及其效果示例。
许可证
本项目采用 MIT 许可证。
评论总结
评论主要围绕数学动画工具Manim及其相关资源展开,观点多样,认可度较高。以下是总结:
Manim的实用性与效果
- 多位用户提到Manim在制作数学解释视频中的实用性,尽管有时AI会出错,但通过多次迭代可以获得很好的效果。
- "Some of the results are not perfect (AI sometimes misaligns some shapes), but it's quite helpful and with a couple of iterations you get to a really good explainer video."
- "I used Manim for one of my class presentations, absolutely a delight to use and as expected many people recognized the style and overall the presentation was well received."
3Blue1Brown与Manim的贡献
- 用户高度评价Grant和3Blue1Brown的工作,认为其视频质量高,视觉效果出色,尤其适合解释抽象数学概念。
- "Grant's work with 3blue1brown and Manim is simply amazing. The quality of the videos is so high, not the least thanks to the visualizations."
- "3b1b is truly a wonder of the internet world. Such beautiful animations, such well thought out explanations."
其他相关资源与工具
- 用户分享了其他数学动画工具和资源,如Animation vs Math视频、Swaptube、Common Lisp的数学动画包等。
- "This is cool. I immediately clicked because I thought of this awesome video from a couple years ago, Animation vs Math."
- "another youtuber-math-video-library: https://github.com/2swap/swaptube"
Manim的多样性与技术挑战
- 有用户对Manim能够处理多种数学概念的动画表示惊讶,认为这通常需要定制化工作。
- "What I don't quite understand is how one library can animate so many different concepts. To me they seem like they'd all be a custom job."
互动性与未来发展
- 有用户询问Manim是否支持交互式3D图表,显示出对工具未来功能的期待。
- "Can in it do interactive 3d diagrams."
总结:评论普遍认可Manim在数学可视化中的价值,并对其背后的开发者Grant和3Blue1Brown表示赞赏。同时,用户也分享了其他相关资源,并对工具的未来发展提出了期待。