[vtkusers] vtkClipPolyData: unwanted points on clipped vtkPolyData

Trystan Louboutin tanstry at gmail.com
Wed Feb 8 08:11:02 EST 2012


Hi all,

I am using a vtkClipPolyData to clip a vtkPolyData with a sphere.

I need the two complementary parts of the clipping,

   - first one generating the outside part of the sphere:

vtkClipPolyData * l_clipper = vtkClipPolyData::New() ;
l_clipper->SetInput( myPolyDataToClip );
l_clipper->SetClipFunction( mySphereFunction );
l_clipper->Update();

vtkPolyData * l_outside = l_clipper->GetOutput();

   - second one generating the inside part of the sphere:

vtkClipPolyData *l_clipper = vtkClipPolyData::New() ;
l_clipper->SetInput( myPolyDataToClip  );
l_clipper->SetClipFunction( mySphereFunction  );
l_clipper->GenerateClippedOutputOn();
l_clipper->Update();

vtkPolyData * l_inside = l_clipper->GetClippedOutput();

Then, I am processing those generated vtkPolyData and especially their
points using polydata->GetPoints(id, point[]).

The problem is that the second generated vtkPolyData does not only contain
points that are inside the sphere but all points from the input vtkPolyData.

In display scene, no problem: clipped in + clipped away = original polydata.
But in terms of points the "clipped in" part contains points of the
original polydata.

Is there any way to make the vtkPolyData containing only the points inside
the sphere used for clipping ?

Thanks in advance.
Trystan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120208/721c13dc/attachment.htm>


More information about the vtkusers mailing list