Copyright © 2021 by K4.org
  (v.0.48.124)

A PolyFaceMesh is a geometric representation primitive made of triangular faces, or facets, which can also have normals defined on them. In addition, the vertices can also be defined with individual normals per face, as well as UV coordinates for texture mapping.

Nearly all objects rendered are actually built from polyface meshes, sometimes just called 'mesh' geometry. As a consequence, all imported geometry is converted to mesh form when loaded.

PolyfaceMesh renders as a Mesh object in three.js.

Note: Faces should be defined counter-clockwise when viewed from the outside of the object. For 'solid' objects, the faces should each share one edge, used in opposite directions, and fully enclose a volume.

Index

Rules

faceSets

faceSets: Array

An array of arrays, each defining a single face as a array of 3 face indices, as faceSets[0] => [0, 1, 2], meaning face 0 is the first 3 entries in the vertices array.

Flags : Cached, Parameter (Note this is uncached)

Expression : const a = []; const farr = this.faces; for ( let i=0; i<farr.length; i += 3) { a.push([farr[i], farr[i+1], farr[i+2]]); } return a;

faceVertexUvs

faceVertexUvs: Array

An array identical in structure to faceSets, but instead of vertex indices for each vertex, it constains an object with u and v coordinates, as in { u: number, v: number }. This allows definition of the uv coordinates for each face. This is usually required only for texture-mapping.

Flags : Cached, Parameter (Note this is uncached)

Expression : []

faces

faces: Array

A flat array of faces, defined by their 3 vertex indices (0-based) into the vertices array. For example, face 0 is defined by faces[0], faces[1], and faces[2]. Face 1 is defined by faces[3], faces[4], faces[5]. And so on. Each face consumes 3 items in the faces array, so it should have n*3 entries, where n is the number of faces. For a slightly more convenient form, use faceSets.

Flags : Cached, Parameter (Note this is uncached)

Expression : []

normals

normals: Array

An array identical in structure to faceSets, but instead of vertex indices for each vertex, it contains a normal vector. This allows independent definition of the normal at each vertex, even for faces which share a vertex. Faces which have the same normals at shared vertices will appear smooth, where if they have different normals, they will appear to have a crease or sharp edge.

Flags : Cached, Parameter (Note this is uncached)

Expression : []

vertices

vertices: Array

An array of Point objects.

Flags : Cached, Parameter (Note this is uncached)

Expression : []