mymesh.tree.QuadtreeNode.query_knn#

QuadtreeNode.query_knn(x, k=1)[source]#

Find the k-nearest neighbor points in the tree to a point. Note: This currently only works for a point cloud tree (e.g. created with Points2Quadtree())

Parameters:
  • x (np.ndarray) – Point coordinates (shape=(2,))

  • k (int, optional) – Number of nearest neighbor points to identify, by default 1

Returns:

  • dist (np.ndarray) – Array of distance between x and the nearest neighbors (shape=(k,))

  • coordinates (np.ndarray) – Array of coordinates for the nearest neighbor points (shape=(k,2))