# kritultrathod/manim architecture

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

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

## Overview

Manim is a Python engine for creating explanatory math animations. A user writes a Scene, invokes the CLI to select and render it, and receives a video or image output. Scenes compose displayable objects and animations; renderers turn each frame into pixels, while specialized object, text, graphing, and 3D modules provide the main creative capabilities. The graph follows documented and excerpted relationships; unsampled subsystems are included where the README or source index establishes their role, without asserting unverified calls.

Main entry points: [`manim/scene/scene.py`](https://github.com/kritultrathod/manim/blob/main/manim/scene/scene.py) (Scene lifecycle), [`manim/mobject/types/vectorized_mobject.py`](https://github.com/kritultrathod/manim/blob/main/manim/mobject/types/vectorized_mobject.py) (Vector graphics), [`manim/mobject/mobject.py`](https://github.com/kritultrathod/manim/blob/main/manim/mobject/mobject.py) (Object model), [`manim/cli/render/commands.py`](https://github.com/kritultrathod/manim/blob/main/manim/cli/render/commands.py) (Render CLI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and configuration"]
  node_cli["Render CLI<br/>[commands.py]"]
  node_config["Global configuration<br/>[__init__.py]"]
  node_magic["IPython magic<br/>[ipython_magic.py]"]
end

subgraph group_composition["Scene composition"]
  node_scene["Scene lifecycle<br/>[scene.py]"]
  node_animation["Animation system<br/>[animation.py]"]
  node_transforms["Transform animations<br/>[transform.py]"]
end

subgraph group_objects["Visual objects"]
  node_mobject["Object model<br/>[mobject.py]"]
  node_vector["Vector graphics"]
  node_geometry["Geometry primitives"]
  node_graphing["Graphing objects"]
  node_text["Text and TeX"]
  node_three_d["3D objects"]
end

subgraph group_render["Rendering and output"]
  node_camera["Camera and pixels<br/>[camera.py]"]
  node_cairo["Cairo renderer<br/>[cairo_renderer.py]"]
  node_opengl["OpenGL renderer<br/>[opengl_renderer.py]"]
  node_writer["Scene file writer"]
  node_output["Rendered media"]
end

subgraph group_support["Math and text support"]
  node_math["Math utilities<br/>[space_ops.py]"]
  node_bezier["Bezier paths<br/>[bezier.py]"]
end

node_user(("Scene author"))
node_ipython(("Notebook user"))

node_user -->|"runs render"| node_cli
node_user -->|"defines"| node_scene
node_cli -.->|"selects scene"| node_scene
node_cli -.->|"sets options"| node_config
node_scene -->|"plays"| node_animation
node_scene -->|"manages objects"| node_mobject
node_scene -->|"uses camera"| node_camera
node_scene -->|"dispatches rendering"| node_cairo
node_scene -->|"dispatches rendering"| node_opengl
node_transforms -->|"extends"| node_animation
node_animation -->|"animates"| node_mobject
node_vector -->|"extends"| node_mobject
node_geometry -.->|"builds shapes"| node_vector
node_graphing -.->|"builds plots"| node_vector
node_text -.->|"builds text"| node_vector
node_three_d -.->|"builds 3D objects"| node_mobject
node_camera -->|"rasterizes"| node_mobject
node_opengl -->|"writes frames"| node_writer
node_cairo -.->|"writes output"| node_writer
node_writer -.->|"encodes media"| node_output
node_math -.->|"supports geometry"| node_geometry
node_bezier -->|"supports curves"| node_vector
node_ipython -->|"invokes"| node_magic
node_magic -.->|"renders scenes"| node_scene

click node_cli "https://github.com/kritultrathod/manim/blob/main/manim/cli/render/commands.py"
click node_config "https://github.com/kritultrathod/manim/blob/main/manim/_config/__init__.py"
click node_scene "https://github.com/kritultrathod/manim/blob/main/manim/scene/scene.py"
click node_animation "https://github.com/kritultrathod/manim/blob/main/manim/animation/animation.py"
click node_transforms "https://github.com/kritultrathod/manim/blob/main/manim/animation/transform.py"
click node_mobject "https://github.com/kritultrathod/manim/blob/main/manim/mobject/mobject.py"
click node_vector "https://github.com/kritultrathod/manim/blob/main/manim/mobject/types/vectorized_mobject.py"
click node_geometry "https://github.com/kritultrathod/manim/tree/main/manim/mobject/geometry"
click node_graphing "https://github.com/kritultrathod/manim/tree/main/manim/mobject/graphing"
click node_text "https://github.com/kritultrathod/manim/tree/main/manim/mobject/text"
click node_three_d "https://github.com/kritultrathod/manim/tree/main/manim/mobject/three_d"
click node_camera "https://github.com/kritultrathod/manim/blob/main/manim/camera/camera.py"
click node_cairo "https://github.com/kritultrathod/manim/blob/main/manim/renderer/cairo_renderer.py"
click node_opengl "https://github.com/kritultrathod/manim/blob/main/manim/renderer/opengl_renderer.py"
click node_writer "https://github.com/kritultrathod/manim/blob/main/manim/scene/scene_file_writer.py"
click node_math "https://github.com/kritultrathod/manim/blob/main/manim/utils/space_ops.py"
click node_bezier "https://github.com/kritultrathod/manim/blob/main/manim/utils/bezier.py"
click node_magic "https://github.com/kritultrathod/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_config,node_magic,node_ipython toneBlue
class node_scene,node_animation,node_transforms toneAmber
class node_mobject,node_vector,node_geometry,node_graphing,node_text,node_three_d toneMint
class node_camera,node_cairo,node_opengl,node_writer,node_output toneRose
class node_math,node_bezier,node_user toneIndigo
```

## Components

### Entry and configuration

- [Render CLI](https://github.com/kritultrathod/manim/blob/main/manim/cli/render/commands.py): `manim/cli/render/commands.py`
- [Global configuration](https://github.com/kritultrathod/manim/blob/main/manim/_config/__init__.py): `manim/_config/__init__.py`
- [IPython magic](https://github.com/kritultrathod/manim/blob/main/manim/utils/ipython_magic.py): `manim/utils/ipython_magic.py`

### Scene composition

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

### Visual objects

- [Object model](https://github.com/kritultrathod/manim/blob/main/manim/mobject/mobject.py): `manim/mobject/mobject.py`
- [Vector graphics](https://github.com/kritultrathod/manim/blob/main/manim/mobject/types/vectorized_mobject.py): `manim/mobject/types/vectorized_mobject.py`
- [Geometry primitives](https://github.com/kritultrathod/manim/tree/main/manim/mobject/geometry): `manim/mobject/geometry`
- [Graphing objects](https://github.com/kritultrathod/manim/tree/main/manim/mobject/graphing): `manim/mobject/graphing`
- [Text and TeX](https://github.com/kritultrathod/manim/tree/main/manim/mobject/text): `manim/mobject/text`
- [3D objects](https://github.com/kritultrathod/manim/tree/main/manim/mobject/three_d): `manim/mobject/three_d`

### Rendering and output

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

### Math and text support

- [Math utilities](https://github.com/kritultrathod/manim/blob/main/manim/utils/space_ops.py): `manim/utils/space_ops.py`
- [Bezier paths](https://github.com/kritultrathod/manim/blob/main/manim/utils/bezier.py): `manim/utils/bezier.py`

### Other components

- **Scene author**
- **Notebook user**

## Connections

- Scene author → Render CLI: runs render
- Scene author → Scene lifecycle: defines
- Render CLI → Scene lifecycle: selects scene
- Render CLI → Global configuration: sets options
- Scene lifecycle → Animation system: plays (evidence: `manim/scene/scene.py`)
- Scene lifecycle → Object model: manages objects (evidence: `manim/scene/scene.py`)
- Scene lifecycle → Camera and pixels: uses camera (evidence: `manim/scene/scene.py`)
- Scene lifecycle → Cairo renderer: dispatches rendering (evidence: `manim/scene/scene.py`)
- Scene lifecycle → OpenGL renderer: dispatches rendering (evidence: `manim/scene/scene.py`)
- Transform animations → Animation system: extends (evidence: `manim/animation/transform.py`)
- Animation system → Object model: animates (evidence: `manim/animation/animation.py`)
- Vector graphics → Object model: extends (evidence: `manim/mobject/types/vectorized_mobject.py`)
- Geometry primitives → Vector graphics: builds shapes (evidence: `manim/mobject/geometry/line.py`)
- Graphing objects → Vector graphics: builds plots (evidence: `manim/mobject/graphing/coordinate_systems.py`)
- Text and TeX → Vector graphics: builds text (evidence: `manim/mobject/text/tex_mobject.py`)
- 3D objects → Object model: builds 3D objects
- Camera and pixels → Object model: rasterizes (evidence: `manim/camera/camera.py`)
- OpenGL renderer → Scene file writer: writes frames (evidence: `manim/renderer/opengl_renderer.py`)
- Cairo renderer → Scene file writer: writes output
- Scene file writer → Rendered media: encodes media
- Math utilities → Geometry primitives: supports geometry (evidence: `manim/mobject/geometry/line.py`)
- Bezier paths → Vector graphics: supports curves (evidence: `manim/mobject/types/vectorized_mobject.py`)
- Notebook user → IPython magic: invokes
- IPython magic → Scene lifecycle: renders scenes
