KDTree.nearest_neighbors

KDTree.nearest_neighbors(point, number, distance_sort=False)[source]

Find the N nearest neighbors to a given point.

Parameters
  • point (list) – XYZ coordinates of the bbase point.

  • number (int) – The number of nearest neighbors.

  • distance_sort (bool, optional) – Sort the nearest neighbors by distance to the base point. Default is False.

Returns

list – A list of N nearest neighbors.