fixed pointcloud issues for vtk < 7.0 (going back to old, non-XML format)
This commit is contained in:
parent
34aa11f197
commit
26f437b507
|
@ -82,16 +82,16 @@ for name in filenames:
|
||||||
|
|
||||||
# ------------------------------------------ output result ---------------------------------------
|
# ------------------------------------------ output result ---------------------------------------
|
||||||
|
|
||||||
writer = vtk.vtkXMLPolyDataWriter()
|
|
||||||
writer.SetCompressorTypeToZLib()
|
|
||||||
|
|
||||||
if name:
|
if name:
|
||||||
|
writer = vtk.vtkXMLPolyDataWriter()
|
||||||
|
writer.SetCompressorTypeToZLib()
|
||||||
writer.SetDataModeToBinary()
|
writer.SetDataModeToBinary()
|
||||||
writer.SetFileName(os.path.join(os.path.split(name)[0],
|
writer.SetFileName(os.path.join(os.path.split(name)[0],
|
||||||
os.path.splitext(os.path.split(name)[1])[0] +
|
os.path.splitext(os.path.split(name)[1])[0] +
|
||||||
'.' + writer.GetDefaultFileExtension()))
|
'.' + writer.GetDefaultFileExtension()))
|
||||||
else:
|
else:
|
||||||
writer.SetDataModeToAscii()
|
writer = vtk.vtkDataSetWriter()
|
||||||
|
writer.SetHeader('# powered by '+scriptID)
|
||||||
writer.WriteToOutputStringOn()
|
writer.WriteToOutputStringOn()
|
||||||
|
|
||||||
if vtk.VTK_MAJOR_VERSION <= 5: writer.SetInput(Polydata)
|
if vtk.VTK_MAJOR_VERSION <= 5: writer.SetInput(Polydata)
|
||||||
|
@ -99,6 +99,6 @@ for name in filenames:
|
||||||
|
|
||||||
writer.Write()
|
writer.Write()
|
||||||
|
|
||||||
if name is None: sys.stdout.write(writer.GetOutputString())
|
if name is None: sys.stdout.write(writer.GetOutputString()[:writer.GetOutputStringLength()]) # limiting of outputString is fix for vtk <7.0
|
||||||
|
|
||||||
table.close()
|
table.close()
|
||||||
|
|
|
@ -6,7 +6,6 @@ import numpy as np
|
||||||
import damask
|
import damask
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
|
|
||||||
|
|
||||||
scriptName = os.path.splitext(os.path.basename(__file__))[0]
|
scriptName = os.path.splitext(os.path.basename(__file__))[0]
|
||||||
scriptID = ' '.join([scriptName,damask.version])
|
scriptID = ' '.join([scriptName,damask.version])
|
||||||
|
|
||||||
|
@ -144,7 +143,6 @@ for name in filenames:
|
||||||
|
|
||||||
writer.Write()
|
writer.Write()
|
||||||
|
|
||||||
if name is None: sys.stdout.write(writer.GetOutputString() if name else
|
if name is None: sys.stdout.write(writer.GetOutputString()[:writer.GetOutputStringLength()]) # limiting of outputString is fix for vtk <7.0
|
||||||
writer.GetOutputString()[0:writer.GetOutputStringLength()])
|
|
||||||
|
|
||||||
table.close()
|
table.close()
|
||||||
|
|
Loading…
Reference in New Issue