Computes vertex normals from a mesh.
tfg.geometry.representation.mesh.normals.vertex_normals(
vertices: type_alias.TensorLike,
indices: type_alias.TensorLike,
clockwise: bool = True,
name: str = 'normals_vertex_normals'
) -> type_alias.TensorLike
This function computes vertex normals as the weighted sum of the adjacent face normals, where the weights correspond to the area of each face. This function supports planar convex polygon faces. For non-triangular meshes, this function converts them into triangular meshes to calculate vertex normals.
Note | |
---|---|
In the following, A1 to An are optional batch dimensions. |
Returns | |
---|---|
A tensor of shape [A1, ..., An, V, 3] containing vertex normals. If
vertices and indices have different batch dimensions, this function
broadcasts them into the same batch dimensions and the output batch
dimensions are the broadcasted.
|