[vtkusers] How to fix PointData correspondence when point ids change?

David Doria daviddoria+vtk at gmail.com
Thu Apr 22 10:42:48 EDT 2010


As David Gobbi explained a few days ago, some filters traverse the
cells (e.g. vtkExtractEdges) and hence change the point ids. If I have
an array (say a vtkFloatArray of the point normals) in the PointData
and the point ids get changed, the normals no longer correspond to the
correct point. How is this typically dealt with?

I started to write a filter called vtkRestorePolyDataPointIds that
would take 2 inputs, an object with the original ids (the target ids)
and an object with the changed ids. It would then use a kdTree to find
the closest point in the target data set to each point in the changed
data set, and then rebuild the polydata using that point id
correspondence. Although this seems like it would work, it seems like
an outrageous thing to do haha.

Is there a better way?

Thanks,

David



More information about the vtkusers mailing list