pyFM.spectral.projection_utils.project_pc_to_triangles¶
- pyFM.spectral.projection_utils.project_pc_to_triangles(vert_emb, faces, points_emb, precompute_dmin=True, batch_size=None, n_jobs=None, return_sparse=False, verbose=False)¶
Project a pointcloud on a set of triangles in p-dimension.
Projection is defined as barycentric coordinates on one of the triangles. Line i of the output has 3 non-zero values at indices j, k and l of the vertices of the triangle point i was projected on.
- 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.
precompute_dmin (bool, optional) – Whether to precompute all the values of delta_min. Faster but heavier in memory.
batch_size (int, optional) – If precompute_dmin is False, projects batches of points on the surface.
n_jobs (int, optional) – Number of parallel jobs. None (default) decides automatically.
return_sparse (bool, optional) – Whether to return a sparse matrix instead of the face_match and barycentric coordinates.
verbose (bool, optional) – Whether to display progress information.
- Returns:
precise_map (scipy.sparse.csr_matrix) – (n2, n1) precise point to point map. Returned ONLY if return_sparse is True.
face_match ((n2,) np.ndarray) – Indices of the face assigned to each point. Returned ONLY if return_sparse is False.
bary_coord ((n2, 3) np.ndarray) – Barycentric coordinates of each point within the face. Returned ONLY if return_sparse is False.