[vtkusers] vtkCutter ordering of output

David E DeMarle dave.demarle at kitware.com
Fri Aug 3 11:58:04 EDT 2012


An alternative approach would be to add an array and use that to
record the identify of each line. The output of the cutter should keep
the array and you could use that to determine what line each
intersection came from. The globalid and pedigreeid datasetattribute
types were added to make things like this easier to do, so it may help
to mark the array with one of those flags.

David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909


On Fri, Aug 3, 2012 at 11:45 AM, Michael Curry <mcurry14 at amherst.edu> wrote:
> 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!
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list