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] |
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:
κ1i,κ2i - The max principal curvature and the min principal curvature at the vertex i
Hi - the discrete mean curvature at vertex i
Ki - the discrete Gaussian curvature at vertex i
Ai - the area of the dual cell centered at vertex i
Formula:
κ1i,κ2i=HiAi±√(HiAi)2−KiAiReferences
- 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)