trimesh_vertexarea_matrix

compas.datastructures.trimesh_vertexarea_matrix(mesh)[source]

Compute the n x n diagonal matrix of per-vertex voronoi areas.

Parameters

mesh (compas.datastructures.Mesh) – The triangle mesh data structure.

Returns

sparse matrix – The diagonal voronoi area matrix.

Examples

>>> from compas.datastructures import Mesh
>>> mesh = Mesh.from_polygons([[[0, 0, 0], [1, 0, 0], [0, 1, 0]]])
>>> A = trimesh_vertexarea_matrix(mesh)
>>> A.diagonal().tolist()
[0.1666, 0.1666, 0.1666]