do not add vertices to point cloud
This commit is contained in:
parent
becb04c234
commit
5a90982d85
2
PRIVATE
2
PRIVATE
|
@ -1 +1 @@
|
||||||
Subproject commit 4a83e608245830af2b762c66f3bbd1fb04cef94a
|
Subproject commit b17c5cfe67e8db6a80d9b832e789e24561b829dd
|
|
@ -73,13 +73,8 @@ else:
|
||||||
parser.error('unsupported VTK file type extension.')
|
parser.error('unsupported VTK file type extension.')
|
||||||
|
|
||||||
Npoints = Polydata.GetNumberOfPoints()
|
Npoints = Polydata.GetNumberOfPoints()
|
||||||
Ncells = Polydata.GetNumberOfCells()
|
|
||||||
Nvertices = Polydata.GetNumberOfVerts()
|
|
||||||
|
|
||||||
if Npoints != Ncells or Npoints != Nvertices:
|
damask.util.croak('{}: {} points...'.format(options.vtk,Npoints))
|
||||||
parser.error('number of points, cells, and vertices in VTK differ from each other.')
|
|
||||||
|
|
||||||
damask.util.croak('{}: {} points/vertices/cells...'.format(options.vtk,Npoints))
|
|
||||||
|
|
||||||
for name in filenames:
|
for name in filenames:
|
||||||
damask.util.report(scriptName,name)
|
damask.util.report(scriptName,name)
|
||||||
|
|
|
@ -41,18 +41,13 @@ for name in filenames:
|
||||||
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
|
table = damask.Table.from_ASCII(StringIO(''.join(sys.stdin.read())) if name is None else name)
|
||||||
|
|
||||||
# ------------------------------------------ process data ---------------------------------------
|
# ------------------------------------------ process data ---------------------------------------
|
||||||
|
|
||||||
Polydata = vtk.vtkPolyData()
|
Polydata = vtk.vtkPolyData()
|
||||||
Points = vtk.vtkPoints()
|
Points = vtk.vtkPoints()
|
||||||
Vertices = vtk.vtkCellArray()
|
|
||||||
|
|
||||||
for p in table.get(options.pos):
|
for p in table.get(options.pos):
|
||||||
pointID = Points.InsertNextPoint(p)
|
pointID = Points.InsertNextPoint(p)
|
||||||
Vertices.InsertNextCell(1)
|
|
||||||
Vertices.InsertCellPoint(pointID)
|
|
||||||
|
|
||||||
Polydata.SetPoints(Points)
|
Polydata.SetPoints(Points)
|
||||||
Polydata.SetVerts(Vertices)
|
|
||||||
Polydata.Modified()
|
Polydata.Modified()
|
||||||
|
|
||||||
# ------------------------------------------ output result ---------------------------------------
|
# ------------------------------------------ output result ---------------------------------------
|
||||||
|
|
Loading…
Reference in New Issue