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