[vtkusers] vtkCutter ordering of output

Michael Curry mcurry14 at amherst.edu
Fri Aug 3 11:45:42 EDT 2012


Hello. I'm looking for some help with the vtkCutter class.

Basically, I have a polydata file consisting of lots of lines. I want
to use a vtkCutter with a plane as the implicit function to find the
intersections of these lines with the plane. I then want to use these
intersections to get values from a separate function, and assign them
as scalars to the lines they came from.

Right now, I'm reading each line out of the vtkPolyData, assigning it
to its own new polydata, and then using the vtkCutter on that to get
the intersection. (The input is a polydata with one line, the output
is a polydata with one vert.) This is slow and unwieldy, but it's the
only way I can be sure that the value computed from the intersection
gets assigned to the correct line. I can pass the whole dataset to
vtkCutter and compute the intersections much more quickly, but I
cannot be sure which intersection corresponds to which line.

Is there a way to guarantee that the verts in the output from
vtkCutter will be sorted in the same order as the lines from the
input? It seems like vtkCutter::SetSortBy() and associated functions
might do this, but I don't understand their actual descriptions.

Thanks for your help!



More information about the vtkusers mailing list