need to use deep copy when converting np array to vtk array

for batch array conversion, it is necessary to use the deep copy to ensure numpy_support.numpy_to_vtk works as it should.
This commit is contained in:
chen 2016-09-14 15:06:00 -04:00
parent 53d2df6058
commit ae16ccae61
2 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ for name in filenames:
VTKdata[:,2] = VTKdata[:,6] = 0.5*(VTKdata[:,2]+VTKdata[:,6])
VTKdata[:,5] = VTKdata[:,7] = 0.5*(VTKdata[:,5]+VTKdata[:,7])
VTKarray[me] = numpy_support.numpy_to_vtk(num_array=VTKdata,array_type=VTKtype)
VTKarray[me] = numpy_support.numpy_to_vtk(num_array=VTKdata,deep=True,array_type=VTKtype)
VTKarray[me].SetName(me)
if datatype == 'color':

View File

@ -135,7 +135,7 @@ for name in filenames:
VTKdata[:,2] = VTKdata[:,6] = 0.5*(VTKdata[:,2]+VTKdata[:,6])
VTKdata[:,5] = VTKdata[:,7] = 0.5*(VTKdata[:,5]+VTKdata[:,7])
VTKarray[me] = numpy_support.numpy_to_vtk(num_array=VTKdata,array_type=VTKtype)
VTKarray[me] = numpy_support.numpy_to_vtk(num_array=VTKdata,deep=True,array_type=VTKtype)
VTKarray[me].SetName(me)
table.close() # close input ASCII table