[vtkusers] Fwd: Polydata points missing after clipping

Laurent Chauvin lchauvin at bwh.harvard.edu
Tue Apr 1 13:36:41 EDT 2014


Hello,

I trying to clip a vtk polydata model (with vtkClipPolyData) using a sphere
I created with vtkSphereSource, and converted to implicit function with
vtkImplicitDataSet (using Delaunay and ElevationFilter like in this
example: http://www.vtk.org/Wiki/VTK/Examples/Python/vtkImplicitDataSet)
and then run through all polygons (cells) and get their area (triangle
area).
However, when I get cell ( polydata->GetCell(cellIndex) ) and then get the
area of the cell ( cell->ComputeArea() ), it returns NaN.

I looked into it, and it seems some cells at the borders have empty points.
ComputeArea() tries to get the 3 points of the cell defining the triangle,
but if I take a cell on the border of the model clipped, 1 or 2 points of
the cell are [NaN, NaN, NaN] and 1 or 2 is valid coordinates.

I tried to use vtkCleanPolyData after clipping, but it didn't change
anything.

Is there a way to update cells so the coordinate of the points become valid
?

Thank you.

-Laurent

-- 
Laurent Chauvin, MS
Surgical Navigation and Robotics Laboratory, Radiology Department
Brigham And Women's Hospital, Harvard Medical School
http://wiki.ncigt.org/index.php/User:Lchauvin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20140401/20bc3104/attachment.html>


More information about the vtkusers mailing list