magnet.geometric_utils.closest_to_face#
- magnet.geometric_utils.closest_to_face(face_verts: ndarray, p: ndarray) ndarray #
Compute the point of a face closest to a given point.
Utility function that selects closest_to_triangle if the face has 3 sides, or linear_constrained_least_squares if it has more than 3, to compute the point on the face closest to p.
- Parameters:
face_verts (np.ndarray of float) – Array of shape (N, 3) of the coordinates of the vertices of the face.
p (np.ndarray of float) – Coordinates of the point of interest.
- Returns:
The coordinates of the point closest to p.
- Return type:
np.ndarray of float