[vtkusers] Splitting vtkPolyData using scalars

David Doria daviddoria+vtk at gmail.com
Mon Aug 9 11:52:44 EDT 2010


On Mon, Aug 9, 2010 at 11:41 AM, Chris Turner
<cturnercomplex at googlemail.com> wrote:
> Hi,
>
> I have a surface model whose cells are assigned to scalar integers.
> Now I want to split the model accordingly to it's scalar values. So
> for every value I want a new vtkPolyData.
>
> basically something like this (pseudo code):
>
> for each c in poly.GetCells()
>   newPolyData[c.GetValue()].AddCell(c)
>
> I know you can do this by hand but I was wondering if there is a
> filter or a method which can help me with that.
>
>
> Thanks,
> Chris


I think this is what you're looking for?

http://www.vtk.org/Wiki/VTK/Examples/PolyData/ExtractSelectionCells
http://www.vtk.org/Wiki/VTK/Examples/PolyData/ExtractSelection

Thanks,

David



More information about the vtkusers mailing list