trimesh_massmatrix

trimesh_massmatrix(M)[source]

Compute massmatrix on a triangle mesh using a scalarfield of data points assigned to its vertices.

Parameters:
Mtuple or compas.datastructures.Mesh

A mesh represented by a list of vertices and a list of faces or by a COMPAS mesh object.

Returns:
array

The mass per vertex.

Examples

>>> import compas
>>> import compas_libigl
>>> from compas.datastructures import Mesh
>>> mesh = Mesh.from_off(compas.get('tubemesh.off'))
>>> mesh.quads_to_triangles()
>>> M = mesh.to_vertices_and_faces()
>>> mass = compas_libigl.trimesh_massmatrix(M)