[vtkusers] Problems using vtkGenericClip

David Doria daviddoria+vtk at gmail.com
Thu Apr 8 11:53:22 EDT 2010


On Thu, Apr 8, 2010 at 11:03 AM, Luca Penasa <luca.penasa at email.it> wrote:
> Hi everybody... I need some help...
>
> I have an unstructured grid called 'grid' and i want to extract some
> points using the vtkGenericClip function. As clip fuction i used a
> vtkSphere object... this is the code i wrote:
>
>        sphere = vtkSphere()
>        sphere.SetCenter(x_coord, y_coord, z_coord)
>        sphere.SetRadius(radius)
>
>        cutter = vtkGenericClip()
>        cutter.SetClipFunction(sphere)
>        cutter.SetInsideOut(0)
>        cutter.SetInput(grid)
>        cutter.Update()
>
>        smallgrid = cutter.GetOutput()
>        smallgrid.Update()
>
>
> after that 'cutter.GetNumberOfPoints()' always gives me 0 as result!!
> i cannot understend why...
> coordinates and radius of sphere are correctly set...
> 'smallgrid' object is an unstructured grid object as expected...
>
>
> thank you!!
>
>
>
> --
> ---------------------------
> Luca Penasa
> Student at Geosciences Dpt.
> University of Padua (IT)
> luca.penasa at email.it

I tried to make an example of this, but I'm not sure what a GenericDataSet is?

http://www.vtk.org/Wiki/VTK/Examples/GenericClip

Maybe you can mold this example into something more reasonable / what
you're doing and then someone can help you?

Thanks,

David



More information about the vtkusers mailing list