[vtkusers] Re: Speed up vtkKdTree::FindClosestPoint

lee ann fisk lafisk at sandia.gov
Tue Feb 1 12:11:47 EST 2005

On Tue, 2005-02-01 at 09:33, sigmunau at idi.ntnu.no wrote:
> At last a question about the KdTree: Would it be possible to extend this
> class to also support finding closest point on a more general dataset?	I am
> thinking about something like this: 
> * Find closest point among cell-node and cell centroids
> * Find closest point on cell(s) containing this point.
> * Return closest point of points return in above statement.
> I guess this approch isn't 100% correct in all situations, but will do very
> often provided the dataset doesn't represent too exotic shapes.

The locator is built from a list of points, and doesn't know
about cell membership.  I think you would need to write
another BuildLocatorFromPoints that also takes a vtkCellArray
and a location array (giving the location of the start of
each cell in the vtkCellArray), and manages these lists along
with the list of points.  Then you could answer cell-based

Lee Ann

Lee Ann Fisk                                 lafisk at sandia.gov
Department 9215                             Phone 505-844-2059
Discrete Algorithms and Math                  Fax 505-845-7442
Sandia National Laboratories                    Mail stop 1110
Albuquerque, NM, USA                             Office 980/15

More information about the vtkusers mailing list