trimesh_mean_curvature

compas_rhino.geometry.trimesh_mean_curvature(M)[source]

Compute the discrete mean curvature of a triangle mesh.

Parameters:
Mtuple[sequence[[float, float, float] | compas.geometry.Point], sequence[[int, int, int]]]

A mesh represented by a list of vertices and a list of faces.

Returns:
list[float]

The discrete mean curvature per vertex.

Notes

Description: The discrete mean curvature is computed by edge length and its dihedral angle.

Notation Convention:
  • Hi - discrete mean curvature at vertex i

  • E - all the edges connected to vertex i

  • j - a vertex connected to vertex i

  • lij - the length of edge ij

  • ϕij - the dihedral angle of edge ij

Formula:

Hi=14ijElijϕij

References

[1]

Formula of Discrete Mean Curvature available at Keenan Crane’s lecture, 03:16-07:11, at https://youtu.be/sokeN5VxBB8

[2]

Formula of dihedral angle available at Keenan Crane’s lecture, 04:20-05:43, at https://youtu.be/NlU1m-OfumE

Examples

Make a mesh from scratch >>> from compas.geometry import Sphere >>> sphere = Sphere([1, 1, 1], 1) >>> sphere = Mesh.from_shape(sphere, u=30, v=30) >>> sphere.quads_to_triangles() >>> M = sphere.to_vertices_and_faces()

Compute the discrete mean curvature >>> H = trimesh_mean_curvature(M)