pyFM.mesh.laplacian.cotangent_weights

pyFM.mesh.laplacian.cotangent_weights(vertices, faces)

Compute the cotangent weight (stiffness) matrix W for the mesh Laplacian.

Off-diagonal entry (i, j) accumulates half the sum of the cotangents of the angles opposite edge (i, j), and each diagonal entry holds the negative sum of the off-diagonal weights on its row.

Parameters:
  • vertices ((n, 3) np.ndarray) – Coordinates of the mesh vertices.

  • faces ((m, 3) np.ndarray) – Vertex indices defining the faces.

Returns:

W – Sparse cotangent weight matrix in csc format.

Return type:

(n, n) scipy.sparse.csc_matrix