TF 2.0 is out! Get hands-on practice at TF World, Oct 28-31. Use code TF20 for 20% off select passes. Register now

tfg.geometry.representation.mesh.normals.face_normals

Computes face normals for meshes.

tfg.geometry.representation.mesh.normals.face_normals(
    faces,
    clockwise=True,
    normalize=True,
    name=None
)

Defined in geometry/representation/mesh/normals.py.

This function supports planar convex polygon faces. Note that for non-triangular faces, this function uses the first 3 vertices of each face to calculate the face normal.

Note:

In the following, A1 to An are optional batch dimensions.

Args:

  • faces: A tensor of shape [A1, ..., An, M, 3], which stores vertices positions of each face, where M is the number of vertices of each face. The rank of this tensor should be at least 2.
  • clockwise: Winding order to determine front-facing faces. The order of vertices should be either clockwise or counterclockwise.
  • normalize: A bool defining whether output normals are normalized.
  • name: A name for this op. Defaults to "normals_face_normals".

Returns:

A tensor of shape [A1, ..., An, 3] containing the face normals.

Raises:

  • ValueError: If the shape of vertices, faces is not supported.