Introduction
ManimVTK allows you to export your animations to VTK (Visualization Toolkit) file formats, enabling visualization in ParaView, PyVista, and other scientific tools.VTK export works with any renderer - you can use Cairo, OpenGL, or VTK renderer and still export to VTK formats.
Export Methods
Static Export (Final Frame)
Export the final state of your scene:- Single mobject →
.vtp(VTK PolyData) - Multiple mobjects →
.vtm(VTK MultiBlock Dataset)
Time Series Export (All Frames)
Export every frame as a VTK file:.pvd- ParaView Data collection file.vtpfiles - One per frameviewer.html- Basic HTML viewer template
Time Series Guide
Detailed guide on time series export
File Formats
VTK PolyData (.vtp)
Used for single objects with points, lines, and polygons. When created:- Scene contains a single mobject
- Explicitly exporting one mobject
VTK MultiBlock (.vtm)
Used for scenes with multiple objects. When created:- Scene contains multiple mobjects
- Complex hierarchical structures
Basic Examples
Export a Simple Shape
media/vtk/CircleExport/CircleExport_final.vtp
Export Multiple Objects
Export 3D Surfaces
Export Location
By default, VTK files are saved to:Programmatic Export
You can also export VTK files programmatically:Data Preservation
Colors
Mobject colors are preserved in VTK export:PointData arrays named “Colors” with RGBA values.
Geometry
Different mobject types are converted appropriately:| Mobject | VTK Representation |
|---|---|
| Filled shapes | Polygons (triangulated) |
| Stroked shapes | PolyLines |
| Surfaces | Polygonal mesh |
| Text/Tex | Filled paths (polygons) |
Transformations
All transformations (position, rotation, scale) are applied before export:Advanced Features
Scalar Fields
Attach scalar data to exported geometry:Vector Fields
Attach vector data for flow visualization:Viewing Exported Files
ParaView
- Open ParaView
- File → Open
- Select
.vtp,.vtm, or.pvdfile - Click “Apply” in the Properties panel
ParaView Guide
Detailed ParaView visualization guide
PyVista (Python)
vtk.js (Web)
Best Practices
File Sizes
File Sizes
VTK XML formats are human-readable but can be large. Considerations:
- Use compression in ParaView: File → Save Data → check “Compressed”
- Lower resolution for testing:
resolution=(20, 20)instead of(50, 50) - Use binary format for production (requires VTK binary writer)
Organization
Organization
Keep exports organized:
When to Use Static vs Time Series
When to Use Static vs Time Series
Use static export when:
- You only need the final result
- Creating static visualizations
- File size is a concern
- Analyzing animation in ParaView
- Need frame-by-frame data
- Creating interactive temporal visualizations
Performance
Performance
Export adds minimal overhead:
- Cairo/OpenGL rendering time: ~90%
- VTK export time: ~10%
Troubleshooting
Export file not created
Export file not created
Possible causes:
- Forgot
--vtk-exportflag - Scene has no mobjects
- Permission issues in output directory
ParaView won't open file
ParaView won't open file
Possible causes:
- VTK file corrupted
- ParaView version too old
- Re-export the file
- Update ParaView to 5.9+
- Check file with text editor (XML should be valid)
Colors missing or wrong
Colors missing or wrong
Cause: Color data not exported correctlyCheck:
- Are colors set before rendering?
- Does the mobject have a stroke or fill?

