# sakurawhispers/manim architecture

> Architecture diagram of the GitHub repository sakurawhispers/manim, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sakurawhispers/manim
- Repository: https://github.com/sakurawhispers/manim

## Overview

Manim is a programmatic animation engine for explanatory math videos. A user defines a Scene from mobjects and animations, then invokes the CLI to render it to a video; the README also documents notebook use and previewing. The graph captures scene orchestration, object and animation modeling, rendering, and output, plus text/TeX, graphing, 3D, and OpenGL capabilities. Edges are limited to relationships in the README or source-index references; unsampled subsystems are represented by their existing directories, and their internal calls are not inferred.

Main entry points: [`manim/scene/scene.py`](https://github.com/sakurawhispers/manim/blob/main/manim/scene/scene.py) (Scene orchestration), [`manim/manager.py`](https://github.com/sakurawhispers/manim/blob/main/manim/manager.py) (Render manager), [`manim/animation/animation.py`](https://github.com/sakurawhispers/manim/blob/main/manim/animation/animation.py) (Animation base), [`manim/renderer/opengl_renderer.py`](https://github.com/sakurawhispers/manim/blob/main/manim/renderer/opengl_renderer.py) (OpenGL renderer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and control"]
  node_cli["Render CLI"]
  node_scene["Scene orchestration<br/>[scene.py]"]
  node_manager["Render manager<br/>[manager.py]"]
end

subgraph group_model["Scene modeling"]
  node_mobject["Scene objects<br/>[mobject.py]"]
  node_vector["Vector objects"]
  node_geometry["Geometry and graphs"]
  node_text["Text and TeX<br/>[tex_mobject.py]"]
  node_three_d["3D objects"]
  node_animation["Animation base<br/>[animation.py]"]
  node_transform["Transform animations<br/>[transform.py]"]
  node_updates["Object updaters<br/>[update.py]"]
end

subgraph group_render["Rendering"]
  node_camera["Camera<br/>[camera.py]"]
  node_cairo["Cairo renderer<br/>[cairo_renderer.py]"]
  node_opengl["OpenGL renderer<br/>[opengl_renderer.py]"]
  node_shader["Shader support<br/>[shader.py]"]
end

subgraph group_output["Output and integrations"]
  node_writer["Scene file writer"]
  node_config["Render configuration<br/>[render_session.py]"]
  node_video["Rendered video"]
  node_notebook["IPython notebook<br/>[ipython_magic.py]"]
end

node_user(("Scene author"))

node_user -->|"defines scene"| node_scene
node_user -->|"invokes render"| node_cli
node_cli -->|"renders scene"| node_scene
node_scene -->|"delegates rendering"| node_manager
node_manager -->|"loads scenes"| node_scene
node_scene -->|"plays animations"| node_animation
node_animation -->|"animates objects"| node_mobject
node_transform -->|"extends"| node_animation
node_animation -->|"updates objects"| node_updates
node_mobject -->|"supports vector types"| node_vector
node_scene -->|"uses camera"| node_camera
node_scene -->|"selects renderer"| node_cairo
node_scene -->|"selects renderer"| node_opengl
node_opengl -->|"uses shaders"| node_shader
node_manager -->|"dispatches rendering"| node_opengl
node_manager -->|"dispatches rendering"| node_cairo
node_opengl -->|"writes scene output"| node_writer
node_manager -->|"creates render session"| node_config
node_writer -.->|"writes video"| node_video
node_user -->|"uses notebook magic"| node_notebook

click node_cli "https://github.com/sakurawhispers/manim/tree/main/manim/cli/render"
click node_scene "https://github.com/sakurawhispers/manim/blob/main/manim/scene/scene.py"
click node_manager "https://github.com/sakurawhispers/manim/blob/main/manim/manager.py"
click node_mobject "https://github.com/sakurawhispers/manim/blob/main/manim/mobject/mobject.py"
click node_vector "https://github.com/sakurawhispers/manim/blob/main/manim/mobject/types/vectorized_mobject.py"
click node_geometry "https://github.com/sakurawhispers/manim/tree/main/manim/mobject/graphing"
click node_text "https://github.com/sakurawhispers/manim/blob/main/manim/mobject/text/tex_mobject.py"
click node_three_d "https://github.com/sakurawhispers/manim/tree/main/manim/mobject/three_d"
click node_animation "https://github.com/sakurawhispers/manim/blob/main/manim/animation/animation.py"
click node_transform "https://github.com/sakurawhispers/manim/blob/main/manim/animation/transform.py"
click node_updates "https://github.com/sakurawhispers/manim/blob/main/manim/animation/updaters/update.py"
click node_camera "https://github.com/sakurawhispers/manim/blob/main/manim/camera/camera.py"
click node_cairo "https://github.com/sakurawhispers/manim/blob/main/manim/renderer/cairo_renderer.py"
click node_opengl "https://github.com/sakurawhispers/manim/blob/main/manim/renderer/opengl_renderer.py"
click node_shader "https://github.com/sakurawhispers/manim/blob/main/manim/renderer/shader.py"
click node_writer "https://github.com/sakurawhispers/manim/blob/main/manim/scene/scene_file_writer.py"
click node_config "https://github.com/sakurawhispers/manim/blob/main/manim/_config/render_session.py"
click node_notebook "https://github.com/sakurawhispers/manim/blob/main/manim/utils/ipython_magic.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_scene,node_manager toneBlue
class node_mobject,node_vector,node_geometry,node_text,node_three_d,node_animation,node_transform,node_updates toneAmber
class node_camera,node_cairo,node_opengl,node_shader toneMint
class node_writer,node_config,node_video,node_notebook toneRose
class node_user toneIndigo
```

## Components

### Entry and control

- [Render CLI](https://github.com/sakurawhispers/manim/tree/main/manim/cli/render): `manim/cli/render`
- [Scene orchestration](https://github.com/sakurawhispers/manim/blob/main/manim/scene/scene.py): `manim/scene/scene.py`
- [Render manager](https://github.com/sakurawhispers/manim/blob/main/manim/manager.py): `manim/manager.py`

### Scene modeling

- [Scene objects](https://github.com/sakurawhispers/manim/blob/main/manim/mobject/mobject.py): `manim/mobject/mobject.py`
- [Vector objects](https://github.com/sakurawhispers/manim/blob/main/manim/mobject/types/vectorized_mobject.py): `manim/mobject/types/vectorized_mobject.py`
- [Geometry and graphs](https://github.com/sakurawhispers/manim/tree/main/manim/mobject/graphing): `manim/mobject/graphing`
- [Text and TeX](https://github.com/sakurawhispers/manim/blob/main/manim/mobject/text/tex_mobject.py): `manim/mobject/text/tex_mobject.py`
- [3D objects](https://github.com/sakurawhispers/manim/tree/main/manim/mobject/three_d): `manim/mobject/three_d`
- [Animation base](https://github.com/sakurawhispers/manim/blob/main/manim/animation/animation.py): `manim/animation/animation.py`
- [Transform animations](https://github.com/sakurawhispers/manim/blob/main/manim/animation/transform.py): `manim/animation/transform.py`
- [Object updaters](https://github.com/sakurawhispers/manim/blob/main/manim/animation/updaters/update.py): `manim/animation/updaters/update.py`

### Rendering

- [Camera](https://github.com/sakurawhispers/manim/blob/main/manim/camera/camera.py): `manim/camera/camera.py`
- [Cairo renderer](https://github.com/sakurawhispers/manim/blob/main/manim/renderer/cairo_renderer.py): `manim/renderer/cairo_renderer.py`
- [OpenGL renderer](https://github.com/sakurawhispers/manim/blob/main/manim/renderer/opengl_renderer.py): `manim/renderer/opengl_renderer.py`
- [Shader support](https://github.com/sakurawhispers/manim/blob/main/manim/renderer/shader.py): `manim/renderer/shader.py`

### Output and integrations

- [Scene file writer](https://github.com/sakurawhispers/manim/blob/main/manim/scene/scene_file_writer.py): `manim/scene/scene_file_writer.py`
- [Render configuration](https://github.com/sakurawhispers/manim/blob/main/manim/_config/render_session.py): `manim/_config/render_session.py`
- **Rendered video**
- [IPython notebook](https://github.com/sakurawhispers/manim/blob/main/manim/utils/ipython_magic.py): `manim/utils/ipython_magic.py`

### Other components

- **Scene author**

## Connections

- Scene author → Scene orchestration: defines scene (evidence: `README.md`)
- Scene author → Render CLI: invokes render (evidence: `README.md`)
- Render CLI → Scene orchestration: renders scene (evidence: `README.md`)
- Scene orchestration → Render manager: delegates rendering (evidence: `manim/scene/scene.py`)
- Render manager → Scene orchestration: loads scenes (evidence: `manim/manager.py`)
- Scene orchestration → Animation base: plays animations (evidence: `manim/scene/scene.py`)
- Animation base → Scene objects: animates objects (evidence: `manim/animation/animation.py`)
- Transform animations → Animation base: extends (evidence: `manim/animation/transform.py`)
- Animation base → Object updaters: updates objects (evidence: `manim/animation/updaters/update.py`)
- Scene objects → Vector objects: supports vector types (evidence: `manim/mobject/mobject.py`)
- Scene orchestration → Camera: uses camera (evidence: `manim/scene/scene.py`)
- Scene orchestration → Cairo renderer: selects renderer (evidence: `manim/scene/scene.py`)
- Scene orchestration → OpenGL renderer: selects renderer (evidence: `manim/scene/scene.py`)
- OpenGL renderer → Shader support: uses shaders (evidence: `manim/renderer/opengl_renderer.py`)
- Render manager → OpenGL renderer: dispatches rendering (evidence: `manim/manager.py`)
- Render manager → Cairo renderer: dispatches rendering (evidence: `manim/manager.py`)
- OpenGL renderer → Scene file writer: writes scene output (evidence: `manim/renderer/opengl_renderer.py`)
- Render manager → Render configuration: creates render session (evidence: `manim/manager.py`)
- Scene file writer → Rendered video: writes video
- Scene author → IPython notebook: uses notebook magic (evidence: `README.md`)
