<div dir="ltr"><div><div>It is not clear that attached picture corresponds to your claims.<br></div>There is no visible relation between trianglePoint and geometry->GetNumberOfPoints().<br></div>Also for (vtkIdType ptId = 0; ptId < geometry->GetNumberOfPoints(); ++ptId)<br>
<div>loop does not make any sense cause nothing changes in the loop.<br><br></div><div>So I guess your trianglePoint is not what you think it is.<br></div><div>For example if this point is shared by 2 triangles you will have the same effect.<br>
</div><div>Another possible problem might be absolute value 0.1 used. <br></div><div>For example your triangle may have size smaller than it, which will be a source of such effect too.<br><br></div><div>Your example is not complete , you could create much better example initializing all available variables so the behavior can be reproduced.<br>
<br></div><div>Alex</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 8, 2013 at 3:44 PM, shinpei <span dir="ltr"><<a href="mailto:noro_shinpei@web.de" target="_blank">noro_shinpei@web.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have two triangle cells in my vtkCellLocator and I create a little bb<br>
around a point of one triangle (see picture). Now I use FindCell(bb, idList)<br>
and I should get one id, but I get two. Is this a bug, or must I change<br>
something?<br>
<br>
<<a href="http://vtk.1045678.n5.nabble.com/file/n5721831/Unbenannt.png" target="_blank">http://vtk.1045678.n5.nabble.com/file/n5721831/Unbenannt.png</a>><br>
- two trinagles (red)<br>
- bb (blue)<br>
<br>
My code:<br>
<br>
for (vtkIdType ptId = 0; ptId < geometry->GetNumberOfPoints(); ++ptId)<br>
{<br>
bounds[0] = trianglePoint[0] - 0.01;<br>
bounds[1] = trianglePoint[0] + 0.01;<br>
bounds[2] = trianglePoint[1] - 0.01;<br>
bounds[3] = trianglePoint[1] + 0.01;<br>
bounds[4] = trianglePoint[2] - 0.01;<br>
bounds[5] = trianglePoint[2] + 0.01;<br>
<br>
cellLocator->FindCellsWithinBounds(bounds, foundCells);<br>
<br>
int size = foundCells->GetNumberOfIds(); // is always two<br>
}<br>
<br>
<br>
Thx<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/FindCell-method-of-vtkCellLocator-tp5721831.html" target="_blank">http://vtk.1045678.n5.nabble.com/FindCell-method-of-vtkCellLocator-tp5721831.html</a><br>
Sent from the VTK - Users mailing list archive at Nabble.com.<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>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div><br></div>