pyFM.mesh.geometry.compute_vertex_areas

pyFM.mesh.geometry.compute_vertex_areas(vertices, faces, faces_areas=None)

Compute per-vertex areas of a triangular mesh.

The area of a vertex is approximated as one third of the sum of the areas of its adjacent triangles.

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

  • faces ((m, 3) np.ndarray or None) – Vertex indices defining the faces. If None (point cloud), uniform unit areas are returned.

  • faces_areas ((m,) np.ndarray, optional) – Per-face areas. Computed from the mesh if not provided.

Returns:

vert_areas – Array of per-vertex areas.

Return type:

(n,) np.ndarray