[vtkusers] octree search

xx.cger xx.cger at gmail.com
Mon Feb 18 17:35:21 EST 2013


I happened to find there is an octree implementation documented here:


I'm curious how to find a closest data point if the query point is inside a
leaf node.  From vtkOctreePointLocator.cxx, function "FindClosestPoint(
double x, double y, double z, double &dist2)" detects this situation and do
a further search if the distance to the closest data point is bigger than
the distance to the leaf boundary,  which is conducted by another function

However, this  "FindClosestPointInSphere" seems only search within child
nodes, and stops if no child nodes exist, which seems a bit suspicious
since first, leaf node won't have children and second, there should be a
search within neighbours if a boundary situation detected in the above
"FindClosestPoint" function, shouldn't it?

Sorry I might miss something since I didn't have a proper test cases and
run the code. Any feedback would be appreciated.

Xiao Xian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130219/d167ea85/attachment.htm>

More information about the vtkusers mailing list