[vtkusers] Problems using vtkGenericClip

David Thompson dcthomp at sandia.gov
Thu Apr 8 12:30:09 EDT 2010


> Hi everybody... I need some help...
>
> I have an unstructured grid called 'grid' and i want to extract some
> points using the vtkGenericClip function.

Hi Luca,

You need to use vtkClipDataSet not vtkGenericClip. vtkGenericClip  
inherits vtkUnstructuredGridAlgorithm because it *outputs*  
unstructured grids, not because it takes them as input. Also, as Bill  
Lorensen pointed out, you may need to set a clip value.

	David

> 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
> ---------------------------
>
>
>
> --
> Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e  
> SMTP autenticato? GRATIS solo con Email.it http://www.email.it/f
>
> Sponsor:
> Apri Conto Arancio entro il 28 febbraio 2010 e ricevi 50 Euro da  
> spendere presso Media World. Aprilo adesso
> Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=10034&d=8-4
> _______________________________________________
> 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
>





More information about the vtkusers mailing list