Skip to main content

What is VTK Integration?

ManimVTK extends the original Manim animation engine with VTK (Visualization Toolkit) integration, enabling you to:
  1. Render with VTK: Use VTK’s rendering engine for high-quality 3D visualization
  2. Export to VTK formats: Save scenes as .vtp, .vtm, and .pvd files
  3. Create time series: Export frame-by-frame animations for ParaView
  4. Add scientific data: Attach scalar and vector fields to exported geometry

VTK Renderer

High-quality 3D rendering using VTK

VTK Export

Export scenes to VTK file formats

Time Series

Frame-by-frame export for ParaView

ParaView Integration

Visualize exports in ParaView

Key Capabilities

1. VTK Rendering

Render scenes using VTK’s powerful rendering engine instead of Cairo or OpenGL:
Benefits:
  • High-quality 3D rendering with proper lighting and shading
  • Better performance for complex 3D geometry
  • Native support for scientific visualization

2. VTK File Export

Export your scenes to industry-standard VTK formats:
Output:
  • Single mobject → .vtp (VTK PolyData)
  • Multiple mobjects → .vtm (VTK MultiBlock)

3. Scientific Data Fields

Attach scalar and vector fields to VTK exports for scientific visualization:
Use cases:
  • CFD (Computational Fluid Dynamics) visualization
  • FEA (Finite Element Analysis) results
  • Temperature distributions
  • Velocity fields and streamlines

Supported Mobject Types

Mobject TypeVTK ExportNotes
2D ShapesCircle, Square, Polygon, etc.
VMobjectConverted to PolyData with colors
SurfaceFull mesh with UV coordinates
ParametricSurfaceParametric surfaces
3D PrimitivesSphere, Cube, Cone, etc.
VGroupExported as VTK MultiBlock
Text / TexExported as filled paths
Arrow / VectorStroke-based or filled
NumberPlane / AxesExported as line geometry
Nearly all Manim mobjects are supported for VTK export!

File Format Reference

VTK PolyData (.vtp)

Single object with points, lines, and polygons. Best for:
  • Single surfaces or meshes
  • Simple geometry
  • Quick visualization
Structure:

VTK MultiBlock (.vtm)

Collection of multiple datasets. Best for:
  • Scenes with multiple objects
  • Hierarchical data
  • Complex assemblies
Structure:

ParaView Data (.pvd)

Time series collection file. Best for:
  • Animations
  • Temporal data
  • Time-varying simulations
Structure:

Workflow Examples

Basic Workflow

Output:
  1. MyScene.mp4 - Video animation
  2. MyScene_final.vtp - VTK export of final frame

Scientific Visualization Workflow

Workflow:
  1. Create animation in ManimVTK
  2. Export time series
  3. Open .pvd in ParaView
  4. Apply filters (contours, glyphs, etc.)
  5. Add scalar/vector field visualization

Interactive Web Workflow

Embed in web applications using vtk.js for interactive 3D visualization.

Performance Considerations

  • Faster for complex 3D scenes with many polygons
  • Slower initial startup (VTK initialization)
  • Best for: High-quality final renders
  • Text format (.vtp): Human-readable but larger
  • Binary format: Smaller but not human-readable
  • Compression: Use ParaView to compress exported files
  • High-resolution surfaces consume more memory
  • Time series exports can be large (one file per frame)
  • Recommended: Export at lower quality, then upscale if needed

Compatibility

ParaView Versions

  • ✅ ParaView 5.9+
  • ✅ ParaView 5.10+
  • ✅ ParaView 5.11+

VTK Versions

  • ✅ VTK 9.0+
  • ✅ VTK 9.1+
  • ✅ VTK 9.2+

PyVista Integration

Next Steps

VTK Renderer Guide

Learn about VTK rendering options

Export Guide

Master VTK file export

Time Series Tutorial

Create animations for ParaView

ParaView Workflow

Visualize in ParaView