Skip to main content

Module curvature

Module curvature 

Source
Expand description

The curvature of a triangle mesh at its vertices, read from a local quadric fitted to the vertices about each one.

§The local quadric

About a vertex p, the neighbourhood is the NEIGHBOURS vertices nearest it within size, p itself among them. Its radius r is the distance to the next vertex out, the first left out, or size where fewer are that near. Each neighbour at distance d weighs (1 − (d/r)²)²: one at p, falling smoothly to zero at r, so a vertex entering or leaving the neighbourhood as the mesh moves changes nothing abruptly.

Each vertex has a normal: the sum of the area normals of the faces at it, as they wind. The neighbourhood’s normal n is the weighted sum of its vertices’ normals. Over the plane through p normal to n, with coordinates x, y along two directions in it, the height of each neighbour along n is fitted by a quadric, h(x, y) = a + b x + c y + d x² + e xy + f y², by weighted least squares. The fit has linear terms, so a neighbourhood normal off the surface’s by a small angle tilts the frame and not the surface it finds.

The quadric’s surface above p is the point p + a n. Its curvature there is that of the graph of h at the origin: the shape operator from the first and second fundamental forms of h, exact for the quadric however the frame is tilted. Its eigenvalues are the principal curvatures, and its eigenvectors, lifted onto the graph, the principal directions.

A neighbourhood whose vertices do not fix the six coefficients, fewer than six with weight or all on one conic of the plane, has no quadric: the normal equations are taken as singular where a Cholesky pivot is no more than the rounding of the largest diagonal entry.

§Sign

Curvature is positive where the surface bends away from its outward normal, as everywhere on a sphere wound outward: a sphere of radius R reads 1/R for both principal curvatures.

Structs§

Curvature
The curvature of a mesh’s surface at one vertex.

Constants§

NEIGHBOURS
How many vertices nearest each one its local quadric is fitted to.

Functions§

curvature
The curvature of mesh at each of its vertices, from the local quadric over the vertices within size of it, as the module documentation describes. Computed in parallel; the answers are the same at any thread count.