# trumanling/manim architecture

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

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

## Overview

Manim is a Python engine for authoring and rendering explanatory math animations. A user defines a Scene with visual objects and animation instructions, then invokes the CLI to render it and optionally preview the resulting video. The architecture also supports mathematical plots, text and TeX, 3D scenes, an OpenGL renderer, and Jupyter magic. The graph combines README-documented workflow with relationships visible in the supplied source index; unsampled renderer internals and some subsystem wiring are therefore not expanded.

Main entry points: [`manim/scene/scene.py`](https://github.com/trumanling/manim/blob/main/manim/scene/scene.py) (Scene runtime), [`manim/mobject/mobject.py`](https://github.com/trumanling/manim/blob/main/manim/mobject/mobject.py) (Object model), [`manim/cli/render/commands.py`](https://github.com/trumanling/manim/blob/main/manim/cli/render/commands.py) (Render CLI), [`manim/animation/animation.py`](https://github.com/trumanling/manim/blob/main/manim/animation/animation.py) (Animation system)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_authoring["Scene authoring"]
  node_scene["Scene runtime<br/>[scene.py]"]
  node_animation["Animation system<br/>[animation.py]"]
  node_transforms["Transform animations<br/>[transform.py]"]
end

subgraph group_visuals["Visual objects"]
  node_mobject["Object model<br/>[mobject.py]"]
  node_vector["Vector graphics"]
  node_geometry["Geometry primitives<br/>[line.py]"]
  node_plots["Math plots"]
  node_text["Text and TeX<br/>[tex_mobject.py]"]
  node_three_d["3D objects"]
end

subgraph group_rendering["Rendering"]
  node_camera["Camera<br/>[camera.py]"]
  node_cairo["Cairo renderer<br/>[cairo_renderer.py]"]
  node_opengl["OpenGL renderer<br/>[opengl_renderer.py]"]
  node_writer["Scene file writer"]
end

subgraph group_interfaces["User interfaces"]
  node_cli["Render CLI<br/>[commands.py]"]
  node_config["Configuration<br/>[utils.py]"]
  node_jupyter["Jupyter magic<br/>[ipython_magic.py]"]
end

node_user(("Scene author"))
node_video["Rendered video"]

node_user -->|"runs render"| node_cli
node_cli -->|"renders scene"| node_scene
node_scene -->|"plays animations"| node_animation
node_animation -->|"animates objects"| node_mobject
node_transforms -->|"extends animation"| node_animation
node_scene -->|"manages objects"| node_mobject
node_scene -->|"uses camera"| node_camera
node_scene -->|"selects renderer"| node_cairo
node_scene -->|"selects renderer"| node_opengl
node_scene -->|"writes scene output"| node_writer
node_vector -->|"extends object model"| node_mobject
node_geometry -->|"builds vector objects"| node_vector
node_plots -->|"uses primitives"| node_geometry
node_text -.->|"creates visual objects"| node_mobject
node_three_d -.->|"creates visual objects"| node_mobject
node_cli -.->|"loads settings"| node_config
node_writer -.->|"produces video"| node_video
node_user -->|"uses notebook magic"| node_jupyter

click node_cli "https://github.com/trumanling/manim/blob/main/manim/cli/render/commands.py"
click node_scene "https://github.com/trumanling/manim/blob/main/manim/scene/scene.py"
click node_animation "https://github.com/trumanling/manim/blob/main/manim/animation/animation.py"
click node_transforms "https://github.com/trumanling/manim/blob/main/manim/animation/transform.py"
click node_config "https://github.com/trumanling/manim/blob/main/manim/_config/utils.py"
click node_mobject "https://github.com/trumanling/manim/blob/main/manim/mobject/mobject.py"
click node_vector "https://github.com/trumanling/manim/blob/main/manim/mobject/types/vectorized_mobject.py"
click node_geometry "https://github.com/trumanling/manim/blob/main/manim/mobject/geometry/line.py"
click node_plots "https://github.com/trumanling/manim/blob/main/manim/mobject/graphing/coordinate_systems.py"
click node_text "https://github.com/trumanling/manim/blob/main/manim/mobject/text/tex_mobject.py"
click node_three_d "https://github.com/trumanling/manim/blob/main/manim/mobject/three_d/three_dimensions.py"
click node_camera "https://github.com/trumanling/manim/blob/main/manim/camera/camera.py"
click node_cairo "https://github.com/trumanling/manim/blob/main/manim/renderer/cairo_renderer.py"
click node_opengl "https://github.com/trumanling/manim/blob/main/manim/renderer/opengl_renderer.py"
click node_writer "https://github.com/trumanling/manim/blob/main/manim/scene/scene_file_writer.py"
click node_jupyter "https://github.com/trumanling/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_scene,node_animation,node_transforms toneBlue
class node_mobject,node_vector,node_geometry,node_plots,node_text,node_three_d toneAmber
class node_camera,node_cairo,node_opengl,node_writer toneMint
class node_cli,node_config,node_jupyter toneRose
class node_user,node_video toneIndigo
```

## Components

### Scene authoring

- [Scene runtime](https://github.com/trumanling/manim/blob/main/manim/scene/scene.py): `manim/scene/scene.py`
- [Animation system](https://github.com/trumanling/manim/blob/main/manim/animation/animation.py): `manim/animation/animation.py`
- [Transform animations](https://github.com/trumanling/manim/blob/main/manim/animation/transform.py): `manim/animation/transform.py`

### Visual objects

- [Object model](https://github.com/trumanling/manim/blob/main/manim/mobject/mobject.py): `manim/mobject/mobject.py`
- [Vector graphics](https://github.com/trumanling/manim/blob/main/manim/mobject/types/vectorized_mobject.py): `manim/mobject/types/vectorized_mobject.py`
- [Geometry primitives](https://github.com/trumanling/manim/blob/main/manim/mobject/geometry/line.py): `manim/mobject/geometry/line.py`
- [Math plots](https://github.com/trumanling/manim/blob/main/manim/mobject/graphing/coordinate_systems.py): `manim/mobject/graphing/coordinate_systems.py`
- [Text and TeX](https://github.com/trumanling/manim/blob/main/manim/mobject/text/tex_mobject.py): `manim/mobject/text/tex_mobject.py`
- [3D objects](https://github.com/trumanling/manim/blob/main/manim/mobject/three_d/three_dimensions.py): `manim/mobject/three_d/three_dimensions.py`

### Rendering

- [Camera](https://github.com/trumanling/manim/blob/main/manim/camera/camera.py): `manim/camera/camera.py`
- [Cairo renderer](https://github.com/trumanling/manim/blob/main/manim/renderer/cairo_renderer.py): `manim/renderer/cairo_renderer.py`
- [OpenGL renderer](https://github.com/trumanling/manim/blob/main/manim/renderer/opengl_renderer.py): `manim/renderer/opengl_renderer.py`
- [Scene file writer](https://github.com/trumanling/manim/blob/main/manim/scene/scene_file_writer.py): `manim/scene/scene_file_writer.py`

### User interfaces

- [Render CLI](https://github.com/trumanling/manim/blob/main/manim/cli/render/commands.py): `manim/cli/render/commands.py`
- [Configuration](https://github.com/trumanling/manim/blob/main/manim/_config/utils.py): `manim/_config/utils.py`
- [Jupyter magic](https://github.com/trumanling/manim/blob/main/manim/utils/ipython_magic.py): `manim/utils/ipython_magic.py`

### Other components

- **Scene author**
- **Rendered video**

## Connections

- Scene author → Render CLI: runs render
- Render CLI → Scene runtime: renders scene
- Scene runtime → Animation system: plays animations (evidence: `manim/scene/scene.py`)
- Animation system → Object model: animates objects (evidence: `manim/animation/animation.py`)
- Transform animations → Animation system: extends animation (evidence: `manim/animation/transform.py`)
- Scene runtime → Object model: manages objects (evidence: `manim/scene/scene.py`)
- Scene runtime → Camera: uses camera (evidence: `manim/scene/scene.py`)
- Scene runtime → Cairo renderer: selects renderer (evidence: `manim/scene/scene.py`)
- Scene runtime → OpenGL renderer: selects renderer (evidence: `manim/scene/scene.py`)
- Scene runtime → Scene file writer: writes scene output (evidence: `manim/scene/scene.py`)
- Vector graphics → Object model: extends object model (evidence: `manim/mobject/types/vectorized_mobject.py`)
- Geometry primitives → Vector graphics: builds vector objects (evidence: `manim/mobject/geometry/line.py`)
- Math plots → Geometry primitives: uses primitives (evidence: `manim/mobject/graphing/coordinate_systems.py`)
- Text and TeX → Object model: creates visual objects
- 3D objects → Object model: creates visual objects
- Render CLI → Configuration: loads settings
- Scene file writer → Rendered video: produces video
- Scene author → Jupyter magic: uses notebook magic
