let vtk decide on the file extension
This commit is contained in:
parent
2394880741
commit
60feb96afd
|
@ -67,7 +67,6 @@ elif vtk_ext == '.vtk':
|
|||
reader.Update()
|
||||
rGrid = reader.GetRectilinearGridOutput()
|
||||
writer = vtk.vtkXMLRectilinearGridWriter()
|
||||
vtk_ext = '.vtr'
|
||||
elif vtk_ext == '.vtu':
|
||||
reader = vtk.vtkXMLUnstructuredGridReader()
|
||||
reader.SetFileName(options.vtk)
|
||||
|
@ -77,7 +76,7 @@ elif vtk_ext == '.vtu':
|
|||
else:
|
||||
parser.error('Unsupported VTK file type extension.')
|
||||
|
||||
writer.SetFileName(vtk_file+vtk_ext)
|
||||
writer.SetFileName(vtk_file+'.'+writer.GetDefaultFileExtension())
|
||||
|
||||
Npoints = rGrid.GetNumberOfPoints()
|
||||
Ncells = rGrid.GetNumberOfCells()
|
||||
|
|
|
@ -61,7 +61,6 @@ elif vtk_ext == '.vtk':
|
|||
reader.SetFileName(options.vtk)
|
||||
reader.Update()
|
||||
Polydata = reader.GetPolyDataOutput()
|
||||
vtk_ext = '.vtp'
|
||||
else:
|
||||
parser.error('unsupported VTK file type extension.')
|
||||
|
||||
|
@ -152,7 +151,7 @@ for name in filenames:
|
|||
writer = vtk.vtkXMLPolyDataWriter()
|
||||
writer.SetDataModeToBinary()
|
||||
writer.SetCompressorTypeToZLib()
|
||||
writer.SetFileName(vtk_file+vtk_ext)
|
||||
writer.SetFileName(vtk_file+'.'+writer.GetDefaultFileExtension())
|
||||
writer.SetInputData(Polydata)
|
||||
writer.Write()
|
||||
|
||||
|
|
|
@ -64,7 +64,6 @@ elif vtk_ext == '.vtk':
|
|||
reader.SetFileName(options.vtk)
|
||||
reader.Update()
|
||||
rGrid = reader.GetRectilinearGridOutput()
|
||||
vtk_ext = '.vtr'
|
||||
else:
|
||||
parser.error('unsupported VTK file type extension.')
|
||||
|
||||
|
@ -161,7 +160,7 @@ for name in filenames:
|
|||
writer = vtk.vtkXMLRectilinearGridWriter()
|
||||
writer.SetDataModeToBinary()
|
||||
writer.SetCompressorTypeToZLib()
|
||||
writer.SetFileName(vtk_file+vtk_ext)
|
||||
writer.SetFileName(vtk_file+'.'+writer.GetDefaultFileExtension())
|
||||
writer.SetInputData(rGrid)
|
||||
writer.Write()
|
||||
|
||||
|
|
Loading…
Reference in New Issue