do not add vertices to point cloud

This commit is contained in:
Martin Diehl 2020-03-16 19:55:26 +01:00
parent becb04c234
commit 5a90982d85
3 changed files with 9 additions and 19 deletions

@ -1 +1 @@
Subproject commit 4a83e608245830af2b762c66f3bbd1fb04cef94a
Subproject commit b17c5cfe67e8db6a80d9b832e789e24561b829dd

View File

@ -73,13 +73,8 @@ 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)

View File

@ -41,18 +41,13 @@ for name in filenames:
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
# ------------------------------------------ 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 ---------------------------------------