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:
parent
53d2df6058
commit
ae16ccae61
|
@ -137,7 +137,7 @@ for name in filenames:
|
||||||
VTKdata[:,2] = VTKdata[:,6] = 0.5*(VTKdata[:,2]+VTKdata[:,6])
|
VTKdata[:,2] = VTKdata[:,6] = 0.5*(VTKdata[:,2]+VTKdata[:,6])
|
||||||
VTKdata[:,5] = VTKdata[:,7] = 0.5*(VTKdata[:,5]+VTKdata[:,7])
|
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)
|
VTKarray[me].SetName(me)
|
||||||
|
|
||||||
if datatype == 'color':
|
if datatype == 'color':
|
||||||
|
|
|
@ -135,7 +135,7 @@ for name in filenames:
|
||||||
VTKdata[:,2] = VTKdata[:,6] = 0.5*(VTKdata[:,2]+VTKdata[:,6])
|
VTKdata[:,2] = VTKdata[:,6] = 0.5*(VTKdata[:,2]+VTKdata[:,6])
|
||||||
VTKdata[:,5] = VTKdata[:,7] = 0.5*(VTKdata[:,5]+VTKdata[:,7])
|
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)
|
VTKarray[me].SetName(me)
|
||||||
|
|
||||||
table.close() # close input ASCII table
|
table.close() # close input ASCII table
|
||||||
|
|
Loading…
Reference in New Issue