eigenstrapping.geometry.nearest_neighbor

eigenstrapping.geometry.nearest_neighbor(P, X, radius=None)[source]

Find the one-nearest neighbors of vertices in points P on another surface X using Delaunay triangulation and KDTree query.

Parameters:
  • P (np.ndarray of shape (N,3)) – Points to search for within the coordinate set of X. P can be a single point

  • X (np.ndarray of shape (M,3)) – Vertices of the surface to search within

  • radius (float) – Radius to search for nearest neighbors within

Returns:

nearest_indexes – Indexes of one-nearest neighbors of vertices in P. Note that if two vertices in X are the same distance away from a point in P, function returns only the first one.

Return type:

int