[vtkusers] Python FindClosestPoint

Andy Bauer andy.bauer at kitware.com
Fri Apr 24 09:14:57 EDT 2015


I think the issue is that you didn't create the actual point locator
object. It should look something like but possibly missing more stuff:
pl = vtk.vtkPointLocator()
pl.SetDataSet(dataset)
pl.FindClosestPoint(x, y, z)

There's a C++ example at
http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointLocator_Radius that
you can look at for reference.

On Fri, Apr 24, 2015 at 3:49 AM, Jean-Michel <jm.lucas at gantha.com> wrote:

>  Thank you very much for your suggestion Andy. Using the FindPoint()
> method works well.
>
> Is there a reason why I could not use FindClosestPoint() ? Does it come
> from the data type I am manipulating ?
>
>
>
> Jean-Michel
>
>
>
> *De :* Andy Bauer [mailto:andy.bauer at kitware.com]
> *Envoyé :* jeudi 23 avril 2015 21:53
> *À :* Jean-Michel
> *Cc :* VTK Users
> *Objet :* Re: [vtkusers] Python FindClosestPoint
>
>
>
> Did you try using the FindPoint() method in the vtkUnstructuredGrid class?
> It's implemented in vtkPointSet.
>
>
>
> On Thu, Apr 23, 2015 at 12:05 PM, Jean-Michel <jm.lucas at gantha.com> wrote:
>
> Dear all,
>
>
>
> I have an Unstructured Grid and I am trying to find the id of the closest
> point to a given point defined by three coordinates (x,y,z).
>
> I tried using the FindClosestPoint function of the PointLocator, but it
> did not work so far. Running
> pid=vtk.vtkPointLocator.FindClosestPoint(x,y,z) returns "TypeError: unbound
> method requires a vtkPointLocator as the first argument".
>
>
>
> I would appreciate if someone could explain to me what I am doing wrong or
> missing. Thanks in advance for your time.
>
>
>
> Jean-Michel
>
>
>  ------------------------------
>
> [image: Avast logo] <http://www.avast.com/>
>
> L'absence de virus dans ce courrier électronique a été vérifiée par le
> logiciel antivirus Avast.
> www.avast.com
>
>
>
>
> _______________________________________________
> 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
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
>
>
>
> ------------------------------
>   [image: Avast logo] <http://www.avast.com/>
>
> L'absence de virus dans ce courrier électronique a été vérifiée par le
> logiciel antivirus Avast.
> www.avast.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20150424/8bd7d3eb/attachment.html>


More information about the vtkusers mailing list