Blockbench Reference Docs
    Preparing search index...

    Class MeshFace

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    mesh: Mesh
    texture: string | false
    uv: { [vertex: string]: ArrayVector2 }
    vertices: string[]

    The vertices that make up the face, as vertex keys. The vertices go around the face counter-clockwise when looking at the front side of the face. That also means that reversing the vertex order reverses the face direction.

    Methods

    • Get the adjacent face in the specified side

      Parameters

      • side_index: number

      Returns { edge: MeshEdge; face: MeshFace; index: number; key: string }

    • Returns the face normal in mesh space as calculated from the vertex positions

      Parameters

      • normalize: boolean

        If true, the values will be normalized.

      • Optionalalt_tri: boolean

        On quads, if true, this will return the normal of the second tri instead of the first

      Returns ArrayVector3

    • Returns the vertices of a quad in an order that creates a convex quad shape if possible. If the face has less than 4 vertices, it just returns the vertices in original order.

      Returns string[]

    • Get the keys of this face and all faces that are connected with it on the UV map

      Returns string[]

    • Takes a 3D coordinate in local space of the mesh, and turns it into a coordinate on the UV map using barycentric coordinates. On quads, the first triangle is used for calculation, so the coordinates on warped quads may be inaccurate.

      Parameters

      • vector: Vector3

      Returns ArrayVector2

    • Takes a UV coordinate and turns it into a 3D space coordinate in local space of the mesh. On quads, the first triangle is used for calculation, so the coordinates on warped quads may be inaccurate.

      Parameters

      Returns Vector3