[vtkusers] adding and deleting cells/triangles to a polydata

David Doria daviddoria at gmail.com
Fri Oct 29 08:17:54 EDT 2010


On Fri, Oct 29, 2010 at 7:54 AM, Anders Wallin
<anders.e.e.wallin at gmail.com>wrote:

> Hi group,
> I have an algorithm that outputs triangles for an
> animation/simulation[1]. For each new time-step the number of
> triangles that change is a small number compared to the total number
> of triangles. I would therefore not like to create a new polydata for
> each time-step, but rather use the same polydata and delete some
> cells/triangles, and add some new cells/triangles at each time-step.
>
> I was looking here:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/PolyData/DeletePoints
> and here:
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/PolyData/Delete_cells
>
> but both of these are in the "broken" category of examples.
>
> Any ideas for how to do this easily/efficiently ?
> To save memory I should probably delete old/unused points also, not only
> cells?
>
> thanks,
> Anders W
> [1] something like this: http://www.youtube.com/watch?v=17mpgQ4KVLg


A few days ago Eric suggested using the ExtractSelection filter in "INVERT"
mode to do this. That is, specify that you want to select/extract the cells
that you want to delete, but then invert the selection so what is extracted
is the remaining cells.

These may help:

http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractSelectionCells
<http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractSelectionCells>
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/ExtractCellsUsingPoints

David
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20101029/61be3078/attachment.htm>


More information about the vtkusers mailing list