[vtkusers] how to call vtkKdTree::FindClosestPoint from python?

Rodrigo Valiña Gutiérrez rodrigo.valina at usc.es
Mon Apr 12 12:46:17 EDT 2010


On Mon, Apr 12, 2010 at 6:05 PM, Elvis Chen <elvis.chen at gmail.com> wrote:

> Greetings,
>
> Can someone please shed some lights into what is the correct syntax in
> calling vtkKdTree::FindClosestPoint from python:
>
>
> >>> import os, sys, math, vtk
> >>> points = vtk.vtkPoints()
> >>> points.InsertNextPoint( 0, 0, 0 )
> 0
> >>> points.InsertNextPoint( 1, 0, 0 )
> 1
> >>> points.InsertNextPoint( 1, 1, 0 )
> 2
> >>> points.InsertNextPoint( 0, 1, 0 )
> 3
> >>> kd = vtk.vtkKdTree()
> >>> kd.BuildLocatorFromPoints( points )
> >>> kd.FindPoint( 1, 1, 0 )
> 2
> >>> dist = 0.0
> >>> kd.FindClosestPoint( 0, 0, 0, dist )
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> AttributeError: FindClosestPoint
>
>
> Thanks,
>
>
Hi,

It seems that some methods are missing from the Python interface.

I also found some ones:

vtk.vtkCellLocator.FindClosestPoint
and
vtk.vtkDataSet.FindCell

see:

http://www.vtk.org/pipermail/vtkusers/2010-April/108057.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100412/91d543af/attachment.htm>


More information about the vtkusers mailing list