[vtkusers] Deleting a point from vtkPoints using GetData() method

David Gobbi david.gobbi at gmail.com
Mon Mar 12 14:04:25 EDT 2018


Hi Andrea,

The cells in the polydata refer to the points by their position within the
vtkPoints array.  So if you remove point i, then you will also have to go
through all the cells and:
1) if the cell array refers to any point j where j > i, it will have to be
modified to refer to point j-1
2) if the cell refers to point i, then that point will have to be removed
from the cell

To make a long story short, removing a point from vtkPoints causes the
vtkCellArray to become invalid.  And unless you fix the vtkCellArray, the
IBO will be invalid.

 - David


On Mon, Mar 12, 2018 at 11:42 AM, PhD Andrea Vitali <andrea.vitali1 at unibg.it
> wrote:

> Dear All,
>
> the generic question is relative to "how to delete a point from a
> polydata".
> I found several examples in which the point can be deleted by copying the
> points array without the point that I want to remove.
>
> In this case, I would like to delete a single point with no copy from an
> array to another one. I saw there is the GetData() method with which it is
> possible to remove a tuple by index.
>
> This is an example:
>
> poly->GetPoints()->GetData()->RemoveTuple(i);
>
> There are no errors, but the polydata is not rendered. I think there are
> some issues relative to topology or during VBO/IBO updating. I think I have
> to do other operation in order to correctly visualize my polydata.
>
> Do you have any idea how to do it?
>
> I hope it is not too general to really understand the problem.
>
> Thanks in advance,
>
> Andrea
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://vtk.org/pipermail/vtkusers/attachments/20180312/54210dd2/attachment.html>


More information about the vtkusers mailing list