[vtkusers] How to really delete cells?

Dominik Szczerba dominik at itis.ethz.ch
Tue Jul 28 09:41:48 EDT 2009


And what does calling ->Update() ?

Corinne Tith wrote:
> Thanks for your help. I tried to put your code after 
> my_polyData->RemoveDeletedCells();
> Unfortunately It doesn't work.
> I tried to delete lot of cells, they are never really removed.
> 
> My VTK version is 5.2, does it matter?
> 
> 
> 2009/7/28 Dominik Szczerba <dominik at itis.ethz.ch 
> <mailto:dominik at itis.ethz.ch>>
> 
>     my_polyData->Modified()
> 
>     Corinne Tith wrote:
> 
>         Hi all,
> 
>         I get a polydata volume with a vtkContourFilter and a
>         vtkWindowSincPolyDataFilter.
>         Some cells are not connected to the largest volume. They seem to
>         be 'on' the mesh but have no vertice in common.
> 
>         I tried the filters vtkCleanPolyData and
>         vtkPolyDataConnectivityFilter, but most of my unconnected cells
>         are not removed.
>         Finally, I tried to delete them 'manually', but nothing happens.
> 
>         How can I really remove my unconnected cells?
> 
>         Any help is appreciated, thanks!
> 
> 
>         // generate my volume
>         my_vtkWindowSincPolyDataFilter->SetInputConnection(my_vtkContourFilter->GetOutputPort());
> 
>         // no effect on my cells
>         my_vtkCleanPolyData->SetInputConnection(my_vtkWindowSincPolyDataFilter->GetOutputPort());
> 
>         my_vtkCleanPolyData->PointMergingOn();
>         my_vtkPolyDataConnectivityFilter->SetInputConnection(my_vtkContourFilter->GetOutputPort());
>         my_vtkPolyDataConnectivityFilter->SetExtractionModeToLargestRegion();
>         // manual remove
>         my_vtkPolyDataConnectivityFilter->Update();
>         my_polyData = my_vtkPolyDataConnectivityFilter->GetOutput();
>         for(int i = 0; i < n; i++){
>               my_polyData->DeleteCell(cellsToRemove[i]);
>         }
>         my_polyData->RemoveDeletedCells();
> 
> 
>         ------------------------------------------------------------------------
> 
>         _______________________________________________
>         Powered by www.kitware.com <http://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