KDTree.nearest_neighbors

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

Find the N nearest neighbors to a given point.

Parameters:
point[float, float, float] | compas.geometry.Point

XYZ coordinates of the base point.

numberint

The number of nearest neighbors.

distance_sortbool, optional

Sort the nearest neighbors by distance to the base point.

Returns:
list[[[float, float, float], int or str, float]]

A list of N nearest neighbors.