
Security News
New React Server Components Vulnerabilities: DoS and Source Code Exposure
New DoS and source code exposure bugs in React Server Components and Next.js: whatβs affected and how to update safely.
manimvtk
Advanced tools
ManimVTK is a fork of Manim Community that integrates VTK (Visualization Toolkit) for scientific visualization and export capabilities. It keeps Manim's elegant syntax and animation system while adding the ability to:
Users can now render scenes with VTK and export scientific visualization data:
# Export both an MP4 video AND VTK scene files
manimvtk -pqh MyScene --renderer vtk --vtk-export
# Export time series for ParaView animation scrubbing
manimvtk MyScene --renderer vtk --vtk-time-series
ManimVTK depends on ManimPango, which requires system dependencies on Linux since pre-built wheels are not available. Install them first:
Debian/Ubuntu (including Google Colab):
sudo apt install libpango1.0-dev pkg-config python3-dev
Fedora:
sudo dnf install pango-devel pkg-config python3-devel
Arch Linux:
sudo pacman -S pango pkgconf
# Clone the repository
git clone https://github.com/mathifylabs/manimVTK.git
cd manimVTK
# Install with VTK support
pip install -e ".[vtk]"
# Or install with full scientific stack (includes PyVista)
pip install -e ".[scientific]"
Or install from PyPI:
pip install manimvtk[vtk]
from manimvtk import *
class CFDVisualization(Scene):
def construct(self):
# Create a surface (e.g., representing pressure field)
surface = Surface(
lambda u, v: np.array([u, v, np.sin(u) * np.cos(v)]),
u_range=[-2, 2],
v_range=[-2, 2],
resolution=(50, 50),
)
surface.set_color(BLUE)
self.play(Create(surface))
self.wait()
Render with VTK export:
manimvtk -pqh example.py CFDVisualization --renderer vtk --vtk-export
This produces:
media/videos/example/1080p60/CFDVisualization.mp4 - Standard video outputmedia/vtk/CFDVisualization/CFDVisualization_final.vtm - VTK MultiBlock file--vtk-export)Exports the final scene state to VTK format:
.vtp (PolyData).vtm (MultiBlock)--vtk-time-series)Exports frame-by-frame VTK files with a .pvd collection file:
media/vtk/MyScene/
βββ MyScene.pvd # ParaView Data collection file
βββ MyScene_00000.vtp # Frame 0
βββ MyScene_00001.vtp # Frame 1
βββ ...
βββ MyScene_viewer.html # Basic HTML viewer template
Load the .pvd file in ParaView to scrub through animations using its native time slider.
| Option | Description |
|---|---|
--renderer vtk | Use VTK renderer |
--vtk-export | Export final scene to VTK format |
--vtk-time-series | Export all frames as VTK time series |
from manimvtk import *
from manimvtk.vtk import add_scalar_field, add_vector_field
class PressureField(Scene):
def construct(self):
# Create surface mesh
surface = Surface(
lambda u, v: np.array([u, v, 0]),
u_range=[-2, 2],
v_range=[-2, 2],
)
# Color by pressure (handled in VTK export)
self.add(surface)
self.wait()
The exported .vtkjs files can be embedded in web applications using vtk.js, perfect for:
ManimVTK adds a new renderer layer:
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Manim Core β
β (Scene, Mobject, VMobject, Animation, play, etc.) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Renderer Abstraction β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββ β
β βCairoRendererβ βOpenGLRendererβ β VTKRenderer β¨ β β
β βββββββββββββββ βββββββββββββββ βββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β VTK Export / Viewer Layer β
β β’ vtk_exporter.py - File export (.vtp, .vtm, .pvd) β
β β’ vtk_mobject_adapter.py - Manim β VTK conversion β
β β’ HTML/vtk.js viewer template β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
| Mobject Type | VTK Export | Notes |
|---|---|---|
VMobject (2D shapes) | β | Converted to PolyData with colors |
Surface | β | Full mesh with UV coordinates |
Sphere, Cube, etc. | β | 3D primitives |
ParametricSurface | β | Parametric surfaces |
VGroup | β | Exported as MultiBlock |
Attach scalar data (pressure, temperature) to VTK exports:
from manimvtk.vtk import add_scalar_field
# After creating polydata
add_scalar_field(polydata, "pressure", pressure_values)
Attach velocity/force fields for glyphs and streamlines:
from manimvtk.vtk import add_vector_field
# Attach velocity (U, V, W components)
add_vector_field(polydata, "velocity", velocity_vectors)
The project includes a comprehensive test suite for VTK functionality with 61 tests covering:
To run the tests:
# Install dev dependencies
pip install -e ".[vtk]"
pip install pytest pytest-cov pytest-xdist
# Run VTK tests (headless environments require xvfb)
xvfb-run -a pytest tests/test_vtk/ -v
# Run with display available
pytest tests/test_vtk/ -v
Try the example scenes in example_scenes/vtk_examples.py to verify VTK functionality:
# Basic 2D example with VTK export
manimvtk -pql example_scenes/vtk_examples.py Circle2DExample --vtk-export
# 3D surface example
manimvtk -pql example_scenes/vtk_examples.py ParametricSurfaceExample --vtk-export
# Time series export for ParaView
manimvtk -pql example_scenes/vtk_examples.py AnimatedCircle --vtk-time-series
# List all available example scenes
python -c "from example_scenes.vtk_examples import EXAMPLE_SCENES; print([s.__name__ for s in EXAMPLE_SCENES])"
Available example categories:
Contributions are welcome! This fork is particularly interested in:
See CONTRIBUTING.md for guidelines.
The software is double-licensed under the MIT license:
Describe your simulation β get both a video and an interactive 3D dataset.
FAQs
Animation engine for explanatory math videos with VTK scientific visualization support.
We found that manimvtk demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: whatβs affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.

Security News
GitHub has revoked npm classic tokens for publishing; maintainers must migrate, but OpenJS warns OIDC trusted publishing still has risky gaps for critical projects.