<div dir="ltr"><div><div><div><div>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:<br></div>pl = vtk.vtkPointLocator()<br></div>pl.SetDataSet(dataset)<br></div>pl.FindClosestPoint(x, y, z)<br><br></div>There's a C++ example at <a href="http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointLocator_Radius">http://www.vtk.org/Wiki/VTK/Examples/Cxx/PolyData/PointLocator_Radius</a> that you can look at for reference.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Apr 24, 2015 at 3:49 AM, Jean-Michel <span dir="ltr"><<a href="mailto:jm.lucas@gantha.com" target="_blank">jm.lucas@gantha.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">









<div link="blue" vlink="purple" lang="FR">

<div>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">Thank
you very much for your suggestion Andy. Using the FindPoint() method works well.<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">Is
there a reason why I could not use FindClosestPoint() ? Does it come from the
data type I am manipulating ?<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US"><u></u> <u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">Jean-Michel<u></u><u></u></span></p>

<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p>

<div style="border:none;border-top:solid #b5c4df 1.0pt;padding:3.0pt 0cm 0cm 0cm">

<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">De :</span></b><span style="font-size:10.0pt;font-family:"Tahoma","sans-serif""> Andy Bauer
[mailto:<a href="mailto:andy.bauer@kitware.com" target="_blank">andy.bauer@kitware.com</a>] <br>
<b>Envoyé :</b> jeudi 23 avril 2015 21:53<br>
<b>À :</b> Jean-Michel<br>
<b>Cc :</b> VTK Users<br>
<b>Objet :</b> Re: [vtkusers] Python FindClosestPoint<u></u><u></u></span></p>

</div>

<p class="MsoNormal"><u></u> <u></u></p>

<div>

<p class="MsoNormal">Did you try using the FindPoint() method in the
vtkUnstructuredGrid class? It's implemented in vtkPointSet.<u></u><u></u></p>

</div>

<div>

<p class="MsoNormal"><u></u> <u></u></p>

<div>

<p class="MsoNormal">On Thu, Apr 23, 2015 at 12:05 PM, Jean-Michel <<a href="mailto:jm.lucas@gantha.com" target="_blank">jm.lucas@gantha.com</a>>
wrote:<u></u><u></u></p>

<div>

<div>

<p class="MsoNormal"><span lang="EN-US">Dear all,</span><u></u><u></u></p>

<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>

<p class="MsoNormal"><span lang="EN-US">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).</span><u></u><u></u></p>

<p class="MsoNormal"><span lang="EN-US">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".</span><u></u><u></u></p>

<p class="MsoNormal"><span lang="EN-US"> </span><u></u><u></u></p>

<p class="MsoNormal"><span lang="EN-US">I would appreciate if someone could explain to me what I am doing
wrong or missing. </span>Thanks in advance for your time.<u></u><u></u></p>

<p class="MsoNormal"> <u></u><u></u></p>

<p class="MsoNormal">Jean-Michel<u></u><u></u></p>

</div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>

<div class="MsoNormal" style="text-align:center" align="center">

<hr style="color:#909090" align="center" noshade size="2" width="99%">

</div>

<table style="border-collapse:collapse" border="0" cellpadding="0" cellspacing="0">
 <tbody><tr>
  <td style="padding:0cm 11.25pt 0cm 6.0pt">
  <p class="MsoNormal"><a href="http://www.avast.com/" target="_blank"><span style="text-decoration:none"><img src="http://static.avast.com/emails/avast-mail-stamp.png" alt="Avast logo" border="0"></span></a><u></u><u></u></p>
  </td>
  <td style="padding:.75pt .75pt .75pt .75pt">
  <p><span style="font-family:"Calibri","sans-serif";color:#3d4d5a">L'absence
  de virus dans ce courrier électronique a été vérifiée par le logiciel
  antivirus Avast. <br>
  <a href="http://www.avast.com/" target="_blank">www.avast.com</a> <u></u><u></u></span></p>
  </td>
 </tr>
</tbody></table>

<p class="MsoNormal"><u></u> <u></u></p>

</div>

<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtkusers" target="_blank">http://markmail.org/search/?q=vtkusers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtkusers" target="_blank">http://public.kitware.com/mailman/listinfo/vtkusers</a><u></u><u></u></p>

</div>

<p class="MsoNormal"><u></u> <u></u></p>

</div>

</div>


<br><br>
<hr style="border:none;color:#909090;background-color:#b0b0b0;min-height:1px;width:99%">
<table style="border-collapse:collapse;border:none">
        <tbody><tr>
                <td style="border:none;padding:0px 15px 0px 8px">
                        <a href="http://www.avast.com/" target="_blank">
                                <img src="http://static.avast.com/emails/avast-mail-stamp.png" alt="Avast logo" border="0">
                        </a>
                </td>
                <td>
                        <p style="color:#3d4d5a;font-family:"Calibri","Verdana","Arial","Helvetica";font-size:12pt">
                                L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
                                <br><a href="http://www.avast.com/" target="_blank">www.avast.com</a>
                        </p>
                </td>
        </tr>
</tbody></table>
<br>
</div>


</blockquote></div><br></div>