Reading a .VTK polydata file and converting it into Numpy array
You can use dataset_adapter
from vtk.numpy_interface
:
from vtk.numpy_interface import dataset_adapter as dsapolydata = reader.GetOutput()numpy_array_of_points = dsa.WrapDataObject(polydata).Points
From Kitware blog:
It is possible to access PointData, CellData, FieldData, Points (subclasses of vtkPointSet only), Polygons (vtkPolyData only) this way.