OpenSource-Hub

manim

라이브러리

3b1b/manim

정확한 수학 해설 영상을 제작하기 위한 애니메이션 엔진.

개요

Manim은 정밀한 수학 설명 영상을 제작하기 위한 Python 애니메이션 엔진입니다. 객체와 애니메이션을 정의하기 위한 직관적인 구문을 제공하며, OpenGL과 LaTeX를 통해 고품질 출력 렌더링을 지원합니다.

README 미리보기

\n    \n        \n    \n\n\n[](https://pypi.org/project/manimgl/)\n[](http://choosealicense.com/licenses/mit/)\n[](https://www.reddit.com/r/manim/)\n[](https://discord.com/invite/bYCyhM9Kz2)\n[](https://3b1b.github.io/manim/)\n\nManim is an engine for precise programmatic animations, designed for creating explanatory math videos.\n\nNote, there are two versions of manim.  This repository began as a personal project by the author of [3Blue1Brown](https://www.3blue1brown.com/) for the purpose of animating those videos, with video-specific code available [here](https://github.com/3b1b/videos).  In 2020 a group of developers forked it into what is now the [community edition](https://github.com/ManimCommunity/manim/), with a goal of being more stable, better tested, quicker to respond to community contributions, and all around friendlier to get started with. See [this page](https://docs.manim.community/en/stable/faq/installation.html#different-versions) for more details.\n\n## Installation\n> [!Warning]\n> **WARNING:** These instructions are for ManimGL _only_. Trying to use these instructions to install [Manim Community/manim](https://github.com/ManimCommunity/manim) or instructions there to install this version will cause problems. You should first decide which version you wish to install, then only follow the instructions for your desired version.\n\n> [!Note]\n> **Note**: To install manim directly through pip, please pay attention to the name of the installed package. This repository is ManimGL of 3b1b. The package name is `manimgl` instead of `manim` or `manimlib`. Please use `pip install manimgl` to install the version in this repository.\n\nManim runs on Python 3.10 or higher.\n\nSystem requirements are [FFmpeg](https://ffmpeg.org/), [OpenGL](https://www.opengl.org/) and [LaTeX](https://www.latex-project.org) (optional, if you want to use LaTeX).\nFor Linux, [Pango](https://pango.org) along with its development headers are required. See instruction [here](https://

FAQ (5)

문제 해결
pip install -e .로 Manim을 설치한 후 "ModuleNotFoundError: No module named 'trimesh' or 'pywavefront'" 오류를 해결하는 방법은?

이 오류는 trimesh와 pywavefront가 requirements.txt에는 포함되어 있지만 setup.cfg의 install_requires에는 누락되어 있어, editable install 시 이 패키지들이 설치되지 않았기 때문에 발생합니다.

즉시 해결 방법:

# 먼저 가상 환경을 활성화하세요
source venv/bin/activate        # macOS/Linux
venv\Scripts\activate.bat       # Windows 명령 프롬프트
.\venv\Scripts\Activate.ps1     # Windows PowerShell

# 누락된 종속성 설치
pip install trimesh pywavefront

영구적인 해결 방법: setup.cfg의 install_requires에 두 패키지를 모두 추가한 다음 다시 설치하세요:

pip install -e .

이 패키징 문제는 커밋 4cec571c0에서 수정되었습니다. 해당 커밋이 포함된 버전으로 업데이트해도 문제가 해결됩니다.

원본 Issue #2459
문제 해결
Manim에서 SVGMobject로 SVG를 불러올 때 왜 SVG 스트로크가 누락되나요?

Manim v1.7.2에서 SVGMobject는 stroke_width의 기본값이 0.0으로 설정되어 있어 SVG 내부에 정의된 stroke width를 덮어씁니다. 이를 우회하려면 stroke_width=None을 전달하여 SVG 자체의 stroke width가 유지되도록 하세요:

p = SVGMobject("Simple.svg", stroke_width=None)

영구적인 해결 방법은 "Honor stroke widths declared in SVG files" PR이 포함된 Manim 버전으로 업그레이드하는 것입니다. 이 PR은 기본 동작을 변경하여 파싱된 경로별 stroke width가 0.0으로 재설정되지 않도록 합니다.

원본 Issue #2343
문제 해결
Python 3.13에서 manimgl을 실행할 때 발생하는 'pkg_resources is deprecated as an API' 경고를 해결하는 방법은?

패키지의 __init__.py에서 pkg_resources를 최신 importlib.metadata API로 교체하세요:

try:
    from importlib.metadata import version, PackageNotFoundError
except ImportError:  # Python < 3.8
    from importlib_metadata import version, PackageNotFoundError  # type: ignore

try:
    __version__ = version("manimgl")
except PackageNotFoundError:
    __version__ = "unknown"

기존 코드를 제거하세요:

import pkg_resources
__version__ = pkg_resources.get_distribution("manimgl").version

Python 3.8 미만 버전에서는 pip install importlib-metadata로 백포트를 설치하세요. 이렇게 하면 Python 3.13 이상에서 발생하는 deprecation 경고가 제거됩니다.

원본 Issue #2388
문제 해결
Manim에서 VectorField와 함께 rotate_vector를 사용할 때 발생하는 ValueError: shapes (N,2) and (3,3) not aligned 오류를 해결하는 방법

이 문제는 VectorField가 모든 샘플 포인트를 배치된 (N, 2) 배열 형태로 함수에 전달하는 반면, rotate_vector는 이를 3×3 회전 행렬과 곱하려고 하기 때문에 발생합니다. 배치된 2D 회전 수정이 포함된 최신 master로 Manim을 업데이트하세요:

pip install -U git+https://github.com/3b1b/manim.git

로컬 클론에서 설치한 경우:

git pull
pip install -e .

즉각적인 해결 방법으로, rotate_vector를 호출하는 대신 2D 회전을 직접 적용하세요:

def rotate_2d(vector, angle):
    c, s = np.cos(angle), np.sin(angle)
    rotation = np.array([
        [c, -s],
        [s,  c],
    ])
    return np.asarray(vector) @ rotation.T

def curl_func(p):
    return rotate_2d(p / 3, PI / 2)

field_curl = VectorField(curl_func, axes)

이 방법은 단일 벡터와 (N, 2) 형태의 배치된 배열 모두에서 작동합니다.

원본 Issue #2336
문제 해결
Python 3.8에서 manim을 설치할 때 'No matching distribution found for ipython>=8.18.0' 오류를 어떻게 해결하나요?

설치가 실패하는 이유는 ipython>=8.18.0이 Python 3.9 이상을 요구하기 때문입니다. 지원되는 Python 버전으로 Conda 환경을 생성하세요. Python 3.9에서는 manimlib 임포트도 실패할 수 있으므로 Python 3.10을 사용하세요:

conda create -n manim python=3.10
conda activate manim
pip install -e .

기존 환경이 이미 존재하는 경우, conda env remove -n manim으로 먼저 제거한 다음 다시 생성하세요.

원본 Issue #2405