I want to extract data arrays from a .vtu file using the Python VTK module. The file looks like this (the raw data at the end of the file is ommitted):
A more lightweight solution would be to use meshio (which I authored). It has no required dependencies except numpy. Install with
pip install meshio
and read the file with
import meshio mesh = meshio.read("foo.vtu") # mesh.points, mesh.cells, mesh.point_data, ...