Write particle states as separate lines in track VTK files. (#3628)

This commit is contained in:
Patrick Shriwise 2025-11-12 00:29:19 -06:00 committed by GitHub
parent 8cd3911cbe
commit 5c2bfe771e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -296,16 +296,16 @@ class Tracks(list):
for state in pt.states:
points.InsertNextPoint(state['r'])
# Create VTK line and assign points to line.
n = pt.states.size
line = vtk.vtkPolyLine()
line.GetPointIds().SetNumberOfIds(n)
for i in range(n):
line.GetPointIds().SetId(i, point_offset + i)
point_offset += n
# Create VTK line and assign points to line.
n = pt.states.size
line = vtk.vtkPolyLine()
line.GetPointIds().SetNumberOfIds(n)
for i in range(n):
line.GetPointIds().SetId(i, point_offset + i)
point_offset += n
# Add line to cell array
cells.InsertNextCell(line)
# Add line to cell array
cells.InsertNextCell(line)
data = vtk.vtkPolyData()
data.SetPoints(points)