mesh.faceNormal

Unit normal of one face, outward for a counter-clockwise face.

GeometricSince 0.3.0

Usage

TypeScript
mesh.faceNormal(f: number): Vector3 | null

Parameters

  • fnumber

    Face index.

    Required

Returns

The unit normal; null when f is not a face or the face has no area.

Guarantees

  • the result has length 1 (Vector3.length)
  • The same result on every machine.

Example

TypeScript
Mesh.box().value.faceNormal(1) // → { x: 0, y: 0, z: 1 }

See also