Missing cast in dataset_adapter.UnstructuredGrid.SetCells
With vtk 8.1.1 (both from anaconda and pypi) on linux:
import numpy as np
import vtk
from vtk.numpy_interface.dataset_adapter import WrapDataObject
ug = WrapDataObject(vtk.vtkUnstructuredGrid())
ug.SetCells(np.array([vtk.VTK_TRIANGLE]), np.array([0]), np.array([0,1,2]))
raises
TypeError: SetCells argument 1: method requires a vtkUnsignedCharArray, a vtkLongLongArray was provided.
It looks like a type conversion is missing inside dataset_adapter.UnstructuredGrid.SetCells
:
cellTypes = numpyTovtkDataArray(cellTypes, array_type=vtk.VTK_UNSIGNED_CHAR)