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

Eric E. Monson emonson at cs.duke.edu
Fri Oct 29 09:26:17 EDT 2010


On Oct 29, 2010, at 6:17 AM, David Doria wrote:

> 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/ExtractCellsUsingPoints
> 
> David 

One thing to note, though, is that using vtkExtractSelection will only hide the fact that he's really creating a new polydata on each time step. It may be a nice solution and perform well enough, though.

I'd advise going ahead and creating the new polydata on each time step and see how that performs. More knowledgeable people can speak up, but I'm not sure that the polydata data structures are really made to efficiently add and remove pieces in arbitrary spots over time, anyway.

-Eric

------------------------------------------------------
Eric E Monson
Duke Visualization Technology Group

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


More information about the vtkusers mailing list