Blockbench Reference Docs
    Preparing search index...

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    direction?: string
    mesh: Mesh
    spline: any
    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>>

    Accessors

    • get element(): any

      Returns any

    Methods

    • 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 any

    • Get a copy for undo tracking

      Returns Face

    • 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