or run

npx @tessl/cli init
Log in

Version

Tile

Overview

Evals

Files

docs

3d-objects.mdadvanced-animations.mdanimation-system.mdboolean-operations.mdcoordinate-systems.mdindex.mdinteractive-controls.mdmathematical-objects.mdmatrix-visualization.mdprobability-stats.mdscene-framework.mdtext-and-latex.mdutilities-and-constants.mdvalue-tracking.mdvector-fields.md
tile.json

tessl/pypi-manimgl

Animation engine for explanatory math videos with programmatic mathematical visualization capabilities

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
pypipkg:pypi/manimgl@1.7.x

To install, run

npx @tessl/cli install tessl/pypi-manimgl@1.7.0

index.mddocs/

ManimGL

ManimGL is a sophisticated Python animation engine specifically designed for creating precise programmatic animations for explanatory mathematics videos. Originally developed by 3Blue1Brown, it provides a comprehensive framework for mathematical visualization with support for LaTeX rendering, OpenGL-based graphics, and real-time interactive animation development.

Package Information

  • Package Name: manimgl
  • Language: Python
  • Installation: pip install manimgl
  • System Requirements: FFmpeg, OpenGL, LaTeX (optional), Pango (Linux)

Core Imports

import manimgl

Common imports for most animations:

from manimgl import *

Import specific components:

from manimgl import Scene, Mobject, Animation
from manimgl import Circle, Square, Text, Tex
from manimgl import ShowCreation, FadeIn, Transform

Basic Usage

from manimgl import *

class BasicExample(Scene):
    def construct(self):
        # Create mathematical objects
        circle = Circle(radius=1, color=BLUE)
        square = Square(side_length=2, color=RED)
        text = Text("Hello ManimGL", font_size=48)
        
        # Position objects
        circle.shift(LEFT * 2)
        square.shift(RIGHT * 2)
        text.shift(UP * 2)
        
        # Animate objects
        self.play(ShowCreation(circle))
        self.play(ShowCreation(square))
        self.play(FadeIn(text))
        self.play(Transform(circle, square))
        self.wait()

# Run with: manimgl example.py BasicExample

Architecture

ManimGL uses a hierarchical architecture built around mathematical objects (Mobjects) and their animations:

  • Scene: Top-level container managing the animation timeline and camera
  • Mobject: Base class for all mathematical objects that can be displayed and animated
  • Animation: Base class for all animations that transform mobjects over time
  • Camera: Manages the viewport, coordinate system, and rendering
  • Window: Handles display, user interaction, and real-time preview

This design enables complex mathematical animations with precise control over timing, positioning, and visual effects, making it ideal for educational content creation and mathematical demonstrations.

Capabilities

Core Scene Framework

Essential scene management for creating animations, including base scene classes, interactive development, 3D scene support, and animation timeline control.

class Scene:
    def construct(self): ...
    def play(*animations, **kwargs): ...
    def add(*mobjects): ...
    def remove(*mobjects): ...
    def wait(duration=None): ...

class InteractiveScene(Scene): ...
class ThreeDScene(Scene): ...

Scene Framework

Mathematical Objects

Comprehensive collection of mathematical objects including basic geometry, 3D shapes, coordinate systems, text rendering, and complex mathematical constructs.

class Mobject:
    def shift(vector): ...
    def scale(factor): ...
    def rotate(angle): ...

class Circle(VMobject): ...
class Square(VMobject): ...
class Line(VMobject): ...
class Text(VMobject): ...
class Tex(VMobject): ...

Mathematical Objects

Animation System

Extensive animation framework with over 80 animation classes covering transforms, creation effects, movement, indication, fading, and specialized mathematical animations.

class Animation:
    def __init__(mobject, **kwargs): ...
    
class Transform(Animation): ...
class ShowCreation(Animation): ...
class FadeIn(Animation): ...
class Rotate(Animation): ...
class Indicate(Animation): ...

Animation System

Text and LaTeX Rendering

Advanced text rendering capabilities including plain text, LaTeX mathematical expressions, code highlighting, and markup support with precise typographical control.

class Text(VMobject):
    def __init__(text, **kwargs): ...

class Tex(VMobject):
    def __init__(*tex_strings, **kwargs): ...

class TexText(VMobject): ...
class Code(VMobject): ...
class BulletedList(VMobject): ...

Text and LaTeX

Coordinate Systems and Graphs

Mathematical coordinate systems, number lines, function plotting, and graph visualization with support for 2D and 3D coordinate systems.

class Axes(VMobject):
    def __init__(x_range, y_range, **kwargs): ...
    def plot(function, **kwargs): ...

class NumberPlane(VMobject): ...
class ComplexPlane(Axes): ...
class FunctionGraph(VMobject): ...
class ParametricCurve(VMobject): ...

Coordinate Systems

3D Objects and Surfaces

Three-dimensional objects, surfaces, and specialized 3D mathematical constructs with camera controls and depth management.

class Surface(VMobject):
    def __init__(func, **kwargs): ...

class ParametricSurface(Surface): ...
class TexturedSurface(Surface): ...
class ThreeDAxes(Axes): ...

3D Objects

Utilities and Constants

Essential utilities including mathematical constants, color definitions, rate functions, vector operations, and development tools.

# Constants
PI, TAU, DEGREES, RADIANS
UP, DOWN, LEFT, RIGHT, ORIGIN
BLUE, RED, GREEN, YELLOW, WHITE, BLACK

# Rate functions
def linear(t): ...
def smooth(t): ...
def there_and_back(t): ...

# Vector operations
def normalize(vector): ...
def rotate_vector(vector, angle): ...

Utilities and Constants

Interactive Controls

Comprehensive interactive controls including UI widgets, buttons, sliders, color pickers, and text input for real-time parameter manipulation and user interaction.

class MotionMobject(Mobject):
    def __init__(mobject, **kwargs): ...

class Button(Mobject):
    def __init__(mobject, on_click, **kwargs): ...

class LinearNumberSlider(ControlMobject):
    def __init__(value, min_value, max_value, **kwargs): ...

class ColorSliders(ControlMobject): ...
class Textbox(ControlMobject): ...
class ControlPanel(Group): ...

Interactive Controls

Boolean Operations

Precise geometric boolean operations for 2D shapes using Skia-Path Ops integration, enabling complex shape construction and geometric analysis.

class Union(VMobject):
    def __init__(*vmobjects, **kwargs): ...

class Difference(VMobject):
    def __init__(subject, clip, **kwargs): ...

class Intersection(VMobject):
    def __init__(*vmobjects, **kwargs): ...

class Exclusion(VMobject):
    def __init__(*vmobjects, **kwargs): ...

Boolean Operations

Value Tracking

Powerful numeric parameter tracking system for animation state management, enabling complex parameter-dependent animations and interactive controls.

class ValueTracker(Mobject):
    def __init__(value=0, **kwargs): ...
    def get_value(): ...
    def set_value(value): ...

class ExponentialValueTracker(ValueTracker): ...
class ComplexValueTracker(ValueTracker): ...

Value Tracking

Vector Fields

Comprehensive vector field visualization including static fields, time-dependent fields, streamlines, and animated flow visualization for physics simulations.

class VectorField(VMobject):
    def __init__(func, coordinate_system, **kwargs): ...

class TimeVaryingVectorField(VectorField): ...
class StreamLines(VGroup): ...
class AnimatedStreamLines(VGroup): ...

def move_along_vector_field(mobject, func): ...

Vector Fields

Probability and Statistics

Specialized tools for probability demonstrations and statistical visualizations including sample spaces, bar charts, and interactive probability tools.

class SampleSpace(Rectangle):
    def __init__(width=3, height=3, **kwargs): ...
    def divide_horizontally(p_list, **kwargs): ...
    def divide_vertically(p_list, **kwargs): ...

class BarChart(VGroup):
    def __init__(values, **kwargs): ...
    def change_bar_values(values): ...

Probability and Statistics

Matrix Visualization

Linear algebra visualization tools for displaying matrices, vectors, and matrix operations with proper mathematical formatting and interactive capabilities.

class Matrix(VMobject):
    def __init__(matrix, **kwargs): ...
    def get_entries(): ...
    def set_column_colors(*colors): ...

class Vector(Matrix): ...
class IntegerMatrix(Matrix): ...
class DecimalMatrix(Matrix): ...

def get_det_text(matrix, determinant=None): ...

Matrix Visualization

Advanced Animations

Sophisticated animation techniques including transform matching, homotopy deformations, complex animation composition, and specialized mathematical animations.

class TransformMatchingParts(AnimationGroup):
    def __init__(mobject, target_mobject, **kwargs): ...

class TransformMatchingTex(TransformMatchingParts): ...
class Homotopy(Animation): ...
class ComplexHomotopy(Homotopy): ...

class AnimationGroup(Animation): ...
class LaggedStart(AnimationGroup): ...
class UpdateFromFunc(Animation): ...

Advanced Animations

Command Line Interface

ManimGL provides a command-line interface for rendering animations and interactive development:

# Interactive scene selection
manimgl

# Render specific scene
manimgl scene_file.py SceneName

# Preview with low quality
manimgl scene_file.py SceneName -l

# High quality render
manimgl scene_file.py SceneName -m

# Save to specific file
manimgl scene_file.py SceneName -o output.mp4