pyFM.spectral.projection_utils.project_to_mesh¶
- pyFM.spectral.projection_utils.project_to_mesh(vert_emb, faces, points_emb, vertind, lmax, Deltamin, dmin=None, dmin_params=None)¶
Project a single point of a pointcloud on a p-dimensional triangle mesh.
- Parameters:
vert_emb ((n1, p) np.ndarray) – Coordinates of the mesh vertices.
faces ((m1, 3) np.ndarray) – Faces of the mesh defined as indices of vertices.
points_emb ((n2, p) np.ndarray) – Coordinates of the pointcloud.
vertind (int) – Index of the vertex to project.
lmax ((m1,) np.ndarray) – Value of lmax (max edge length for each face).
Deltamin ((n2,) np.ndarray) – Value of Deltamin (distance to nearest vertex).
dmin ((m1, n2) np.ndarray, optional) – Values of dmin (distance to the nearest vertex of each face for each vertex). Can be computed on the fly.
dmin_params (dict, optional) – If dmin is None, stores ‘vert_sqnorms’ a (n1,) array of squared norms of vertex embeddings, and ‘points_sqnorm’ a (n2,) array of squared norms of point embeddings. Helps speed up computation of dmin.
- Returns:
min_faceind (int) – Index of the face on which the vertex is projected.
min_bary ((3,) np.ndarray) – Barycentric coordinates on the chosen face.