pyFM.mesh.geometry.per_vertex_normal

pyFM.mesh.geometry.per_vertex_normal(vertices, faces, face_normals=None, weighting='uniform')

Compute per-vertex normals of a triangular mesh, with a chosen weighting scheme.

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

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

  • face_normals ((m, 3) np.ndarray, optional) – Per-face normals.

  • weighting (str, optional) – Weighting scheme, either ‘area’ or ‘uniform’.

Returns:

vert_normals – Array of per-vertex normals.

Return type:

(n, 3) np.ndarray