trimesh_gaussian_curvature

compas_rhino.geometry.trimesh_gaussian_curvature(M)[source]

Compute the discrete Gaussian 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 Gaussian curvature per vertex.

Notes

Description: The angle defect at a vertex is used to describe the Gaussian curvature in a neighborhood around a vertex.

Notation Convention:
  • \(K_{i}\) - discrete Gaussian curvature at vertex i

  • \(j,k\) - the vertices from the Star of vertex i

  • \(e_{ij},\, e_{ik}\) - the vectors from vertex i to j and i to k

  • \(\\theta_{i}^{jk}\) - interior angle at vertex i of triangle ijk

Formula:

\[\begin{split}K_{i} = 2\pi-\sum\\theta_{i}^{jk}\end{split}\]

References

[1]

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

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 Gaussian curvature >>> K = trimesh_gaussian_curvature(M)