Skip to content

Documentation / @ripl/3d / Face3D

Interface: Face3D ​

Defined in: 3d/src/core/shape.ts:98

A single face of a 3D mesh, defined by its vertices and an optional precomputed normal.

Properties ​

PropertyTypeDescriptionDefined in
colors?string[]Per-vertex colours, parallel to vertices, used when the material sets vertexColors. The GPU interpolates these across the face; the CPU painter averages them, so a mesh relying on this wants enough subdivision that each face is close to one colour.3d/src/core/shape.ts:117
normal?Vector3The precomputed surface normal. When omitted, it is derived from the first three vertices.3d/src/core/shape.ts:102
normals?Vector3[]Per-vertex normals, parallel to vertices, enabling smooth shading. The GPU interpolates these across the face. The CPU painter can only fill a flat polygon, so it shades from their average — closer to the true surface than the face normal, but still one colour per face.3d/src/core/shape.ts:110
uvs?Vector2[]Per-vertex texture coordinates, parallel to vertices, used when the material has a map.3d/src/core/shape.ts:119
verticesVector3[]The face's vertices in local (model) space, ordered counter-clockwise when viewed from the front.3d/src/core/shape.ts:100