[vtkusers] Re: Use vtkCleanPolyData to delete points/cell in the vtkPolyData!

Goodwin Lawlor goodwin.lawlor at ucd.ie
Sun Jul 24 05:25:49 EDT 2005


Hi Leon,

Have a look at this class:
http://www.bioengineering-research.com/vtk/vtkRemoveCellsFilter.htm

It needs to be updated for vtk5.0 but should give you a good idea of 
what has to be done.

hth

Goodwin

Leon Chen wrote:
> Hi everyone,
> 
> I just write this mail as a reminder, because I searched the vtk
> achieves to find the solution to modify polydata, there is not such a
> 'clear' answer. (or I simply miss it)...
> 
> -----
> The problem is,
> 
> How to modify a vtkPolyData? Here we want to delete a point or a cell
> in the polydata. (not add or edit a point/cell). Obviously, the method
> provided in vtkPolyData can not REALLY delete the point/cell
> immediately.
> 
> Some suggested that use copy into a new polydata, or something like
> that. But it really complicated...
> Some said we should have a new method to implement the function of
> 'REALLY delete the point/cell'
> 
> -----
> Just now I found that the vtkCleanPolyData is the right
> polydatatopolydatafilter to do the job.
> 
> First, delete the point/cell via the method in the vtkPolyData
> Then just 'update' the polydata via the vtkCleanPolyData
> Now, you can get the number of the points or cells to see the result!
> They become smaller!
> (The number of points/cell is important. For example, if you deleted
> some cells without 'update' the polydata, you can see the polydata
> model is different from the old one. However, the number point will
> not change -- just because they are isolated and you can not see
> them!)
> 
> ----
> So what happened?
> 
> We know that the delete method in the vtkpolydata doesn't remove the
> point from the data actually. As for a cell, it give the cell a label
> whose value is '0', for a point, it cut all the link which caonnect
> the corresponding cell that is using it. Until now, the points are
> still there... the cells are still there...
> 
> Simply use the vtkCleanPolyData filter, it will remove unused points
> and cell. What's more, it can merge duplicate points (within specified
> tolerance and if enabled). For more detail, can refer the documents.
> 
> ----
> 
> I am not sure if I am complete right about this, please correct me if
> I made any mistake. Anyway I just want to share it, because i has been
> confusing me for a long time...
> 
> :P
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the 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