On Mon, Apr 12, 2010 at 6:05 PM, Elvis Chen <span dir="ltr">&lt;<a href="mailto:elvis.chen@gmail.com">elvis.chen@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Greetings,<div><br></div><div>Can someone please shed some lights into what is the correct syntax in calling vtkKdTree::FindClosestPoint from python:</div><div><br></div><div><br></div><div><div>&gt;&gt;&gt; import os, sys, math, vtk</div>

<div>&gt;&gt;&gt; points = vtk.vtkPoints()</div><div>&gt;&gt;&gt; points.InsertNextPoint( 0, 0, 0 )</div><div>0</div><div>&gt;&gt;&gt; points.InsertNextPoint( 1, 0, 0 )</div><div>1</div><div>&gt;&gt;&gt; points.InsertNextPoint( 1, 1, 0 )</div>

<div>2</div><div>&gt;&gt;&gt; points.InsertNextPoint( 0, 1, 0 )</div><div>3</div><div>&gt;&gt;&gt; kd = vtk.vtkKdTree()</div><div>&gt;&gt;&gt; kd.BuildLocatorFromPoints( points )</div><div>&gt;&gt;&gt; kd.FindPoint( 1, 1, 0 )</div>

<div>2</div><div>&gt;&gt;&gt; dist = 0.0</div><div>&gt;&gt;&gt; kd.FindClosestPoint( 0, 0, 0, dist )</div><div>Traceback (most recent call last):</div><div>  File &quot;&lt;stdin&gt;&quot;, line 1, in &lt;module&gt;</div>

<div>AttributeError: FindClosestPoint</div><div><br></div><div><br></div><div>Thanks,</div></div><br></blockquote></div><br>Hi,<br><br>It seems that some methods are missing from the Python interface.<br><br>I also found some ones:<br>
<br>vtk.vtkCellLocator.FindClosestPoint<br>and<br>vtk.vtkDataSet.FindCell<br><br>see:<br><br><a href="http://www.vtk.org/pipermail/vtkusers/2010-April/108057.html">http://www.vtk.org/pipermail/vtkusers/2010-April/108057.html</a><br>

<br>