Blockbench Reference Docs
    Preparing search index...

    Class MeshFace

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Get the adjacent face in the specified side

      Parameters

      • side_index: number

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

    • Returns a 2D rectangle around the UV face

      Returns any

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

      Parameters

      • normalize: boolean = false

        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 a save copy of the face, ready for serialization

      Returns { texture: any; uv: any }

    • 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[]

    • Returns false | Texture

    • Get a copy for undo tracking

      Returns Face

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

      Returns string[]

    • Returns whether the face is selected

      Parameters

      • Optionalface_key: string

        Optional face key of the face, the method runs faster if this is provided

      Returns boolean

    • 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

    • Returns this

    • 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

    Properties

    direction?: string
    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.

    properties: Record<string, Property<any>>