m3sh.traits.

vertex_normals#

vertex_normals(mesh, weight=None, broadcast=False)#

Vertex normals.

Changed in version 1.1.0: Add weight argument.

Compute vertex normals as average of face normals.

Parameters:
meshMesh

A mesh instance.

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

Weighting scheme. Weights are only used if broadcast evaluates to False.

broadcastbool, optional

Broadcast (outer loop visits faces) or gather (outer loop visits vertices) face normals. For non-triangle meshes it is strongly recommended to disable broadcasting.

Returns:
normalsndarray, shape (n, 3)

Unit length normal vectors for a mesh with n vertices.

See also

vertex_normal

Notes

Vertex normals are not well defined for deleted or isolated vertices. The returned array includes rows of nan values in this case.