vtkExplicitStructuredGrid DeepCopy is broken on master
I installed VTK from the wheel published on this repos package index (latest master):
$ pip install vtk --pre --no-cache --extra-index-url https://gitlab.kitware.com/api/v4/projects/13/packages/pypi/simple
Looking in indexes: https://pypi.org/simple, https://gitlab.kitware.com/api/v4/projects/13/packages/pypi/simple
Collecting vtk
Downloading https://gitlab.kitware.com/api/v4/projects/13/packages/pypi/files/f425da2d4e26cb22d8ca767452b00330d0c5957744e94821d1c0b75033c77bca/vtk-9.2.20221210.dev0-cp39-cp39-macosx_11_0_arm64.whl (67.3 MB)
When attempting to DeepCopy
a vtkExplicitStructuredGrid
, there is a segfault. This works fine on 9.2.2
import vtk
# Read and cast VTU b/c there is no ExplicitStructuredGrid format
reader = vtk.vtkXMLUnstructuredGridReader()
reader.SetFileName('explicit.vtu')
reader.Update()
reader.GetOutput()
alg = vtk.vtkUnstructuredGridToExplicitStructuredGrid()
alg.SetInputData(reader.GetOutput())
alg.SetInputArrayToProcess(0, 0, 0, 1, 'BLOCK_I')
alg.SetInputArrayToProcess(1, 0, 0, 1, 'BLOCK_J')
alg.SetInputArrayToProcess(2, 0, 0, 1, 'BLOCK_K')
alg.Update()
grid = alg.GetOutput()
grid
is a vtkExplicitStructuredGrid
# Problem code
grid2 = vtk.vtkExplicitStructuredGrid()
grid2.DeepCopy(grid)
Input data: explicit.vtu
Edited by Bane Sullivan