trimesh_principal_curvature
- compas_rhino.geometry.trimesh.trimesh_principal_curvature(M)[source]
Compute the principal curvature of a triangle mesh. :Parameters: M (tuple[sequence[[float, float, float] or
compas.geometry.Point
], sequence[[int, int, int]]]) – A mesh represented by a list of vertices and a list of faces.- Returns
list[float] – The max curvature per vertex.
list[float] – The min curvature per vertex.
Notes
Description: The discrete principal curvature is computed by mean curvature, Gaussian curvature, and vertex area.
- Notation Convention:
\(\kappa^1_i, \kappa^2_i\) - The max principal curvature and the min principal curvature at the vertex i
\(H_i\) - the discrete mean curvature at vertex i
\(K_i\) - the discrete Gaussian curvature at vertex i
\(A_i\) - the area of the dual cell centered at vertex i
Formula:
\[\kappa^1_i, \kappa^2_i = \frac{H_i}{A_i}\pm\sqrt{\left( \,\frac{H_i}{A_i}\right)\,^2-\frac{K_i}{A_i}}\]References
- 1
Formula of Discrete Principal 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 principal curvature >>> H = trimesh_principal_curvature(M)