diff --git a/PRIVATE b/PRIVATE index 4a83e6082..b17c5cfe6 160000 --- a/PRIVATE +++ b/PRIVATE @@ -1 +1 @@ -Subproject commit 4a83e608245830af2b762c66f3bbd1fb04cef94a +Subproject commit b17c5cfe67e8db6a80d9b832e789e24561b829dd diff --git a/processing/post/vtk_addPointCloudData.py b/processing/post/vtk_addPointCloudData.py index 833bfc88e..1ec590f0c 100755 --- a/processing/post/vtk_addPointCloudData.py +++ b/processing/post/vtk_addPointCloudData.py @@ -73,25 +73,20 @@ else: parser.error('unsupported VTK file type extension.') Npoints = Polydata.GetNumberOfPoints() -Ncells = Polydata.GetNumberOfCells() -Nvertices = Polydata.GetNumberOfVerts() -if Npoints != Ncells or Npoints != Nvertices: - parser.error('number of points, cells, and vertices in VTK differ from each other.') - -damask.util.croak('{}: {} points/vertices/cells...'.format(options.vtk,Npoints)) +damask.util.croak('{}: {} points...'.format(options.vtk,Npoints)) for name in filenames: damask.util.report(scriptName,name) table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name) - + VTKarray = {} for data in options.data: VTKarray[data] = numpy_support.numpy_to_vtk(table.get(data).copy(), deep=True,array_type=vtk.VTK_DOUBLE) VTKarray[data].SetName(data) - + for color in options.color: VTKarray[color] = numpy_support.numpy_to_vtk((table.get(color)*255).astype(int).copy(), deep=True,array_type=vtk.VTK_UNSIGNED_CHAR) diff --git a/processing/post/vtk_pointCloud.py b/processing/post/vtk_pointCloud.py index 44f719267..d73402ef6 100755 --- a/processing/post/vtk_pointCloud.py +++ b/processing/post/vtk_pointCloud.py @@ -40,22 +40,17 @@ for name in filenames: table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name) -# ------------------------------------------ process data --------------------------------------- - +# ------------------------------------------ process data --------------------------------------- Polydata = vtk.vtkPolyData() Points = vtk.vtkPoints() - Vertices = vtk.vtkCellArray() for p in table.get(options.pos): pointID = Points.InsertNextPoint(p) - Vertices.InsertNextCell(1) - Vertices.InsertCellPoint(pointID) Polydata.SetPoints(Points) - Polydata.SetVerts(Vertices) Polydata.Modified() - -# ------------------------------------------ output result --------------------------------------- + +# ------------------------------------------ output result --------------------------------------- if name: writer = vtk.vtkXMLPolyDataWriter() @@ -68,8 +63,8 @@ for name in filenames: writer = vtk.vtkDataSetWriter() writer.SetHeader('# powered by '+scriptID) writer.WriteToOutputStringOn() - - + + writer.SetInputData(Polydata) writer.Write()