[vtkusers] vtkClipPolyData: unwanted points on clipped vtkPolyData

julien von siebenthal jdesiebenthal at gmail.com
Wed Feb 8 08:18:18 EST 2012


Hi Tristan,

You can use a vtkCleanPolyData with default settings on your output. It
will remap the points to the topology you get from the clipping process.

Best,
Julien

On Wed, Feb 8, 2012 at 2:11 PM, Trystan Louboutin <tanstry at gmail.com> wrote:

> 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
>
> _______________________________________________
> Powered by 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
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120208/6b8c4916/attachment.htm>


More information about the vtkusers mailing list