m3sh.traits.

vertex_normal#

vertex_normal(vertex, weight=None)#

Vertex normal.

Changed in version 1.1.0: Add weight argument.

Compute vertex normal as average of triangle normals. Assumes that vertex coordinates live in Euclidean 3-space.

Parameters:
vertexVertex

Vertex of a mesh.

weight{None, ‘angle’, ‘area’, ‘nelson’}, optional

Weighting scheme, see [1] and [2].

Returns:
normalndarray, shape (3,)

Unit length normal vector. Deleted and isolated vertices are assigned a vector of nan values.

See also

vertex_normals

Notes

For non-triangular meshes, incident triangles are defined by the planes spanned by neighboring edges in a counter-clockwise traversal of incident edges.

References

[1]

M. Nelson: Weights for computing vertex normals from facet normals, Journal of Graphics Tools 4 (2):1-6, 1999.

[2]

S. Jin, R. Lewis, and D. West: A comparison of algorithms for vertex normal computation, The Visual Computer 21, 2005.