Bitbybit Docs
    Preparing search index...

    Class Text3D

    Turns a string into geometry: flat letter faces or extruded letter solids built from the outlines of a font, either standing free in space or laid onto the surface of a face. Each create method returns a text model, and the getters here read its whole compound, its characters, their centers and the faces left where text was cut into a face. Repeating motifs on faces live beside it in advanced.patterns.

    Index

    Constructors

    create

    • Builds a text from one of the shipped fonts as flat letter faces or extruded letter solids.

      The letters are drawn on the XZ plane and extruded along Y by height in model units; the text is then spun by rotation degrees about Y, Y is turned to direction, and the point picked by originAlignment lands on origin. A height of 0 returns faces instead of solids.

      Parameters

      • inputs: Text3DDto

        The text, font, size, extrusion height and placement

      Returns Promise<Text3DData<TopoDSShapePointer>>

      A text model holding the compound of all letters, one shape per character and their centers

    • Builds a text from a font file loaded from a URL, as flat letter faces or extruded letter solids.

      Use it for a typeface the shipped fonts do not cover; placement works as in create. The font file must be TTF, OTF or WOFF; WOFF2 is not read, and outlines that cross themselves can fail to build.

      Parameters

      • inputs: Text3DUrlDto

        The text, font URL, size, extrusion height and placement

      Returns Promise<Text3DData<TopoDSShapePointer>>

      A text model holding the compound of all letters, one shape per character and their centers

    • Lays a text from one of the shipped fonts onto a face so that it follows the surface.

      The text is drawn in the face's UV space: fontSize is measured in the face's real U and V values, not model units, and originParamU and originParamV place the anchor as fractions of the face's range. faceTextVar decides whether you get the letters alone, raised letters sewn into the cut face, or the face with the letters cut out.

      Parameters

      Returns Promise<Text3DData<TopoDSShapePointer>>

      A text model holding the result as one shape, one shape per character and any cutout faces

    • Lays a text from a font file loaded from a URL onto a face so that it follows the surface.

      Placement and faceTextVar work as in createTextOnFace. The font file must be TTF, OTF or WOFF; WOFF2 is not read, and outlines that cross themselves can fail to build.

      Parameters

      Returns Promise<Text3DData<TopoDSShapePointer>>

      A text model holding the result as one shape, one shape per character and any cutout faces

    • Lays several texts onto one face in a single result, each with its own font, size, placement and style.

      Each entry of definitions is placed as createTextOnFace places one text. The face is cut once by every text set to cutout or integratedExtrusion, raised letters are sewn into that cut face, and separatedExtrusion letters are added beside it as separate shapes.

      Parameters

      Returns Promise<Text3DData<TopoDSShapePointer>>

      A text model holding the combined result, the characters of every text and any cutout faces

    • Lays several texts, each with a font file loaded from its own URL, onto one face in a single result.

      Each definition is placed and combined as in createTextsOnFace. The font file must be TTF, OTF or WOFF; WOFF2 is not read, and outlines that cross themselves can fail to build.

      Parameters

      Returns Promise<Text3DData<TopoDSShapePointer>>

      A text model holding the combined result, the characters of every text and any cutout faces

    definitions

    dimensions

    • Returns how far the text advances along its line, as the font's spacing sets it at the chosen size.

      It is read from the font, so it includes the spacing after the last character and is in the units of fontSize. create records it; text on a face records it only when built from a font URL, one text at a time.

      Parameters

      Returns number

      The advance width

    get

    • Returns the center of each character of a text model as a point.

      Extruded letters use the center of mass of their solids and flat letters that of their faces, listed in the same order as the character shapes. Models from the methods that place several texts on a face carry no centers, so nothing is returned for them.

      Parameters

      Returns Bit.Inputs.Base.Point3[]

      One center point per character

    get from face

    • Returns every face left after cutting the letters out of the face, including the pieces inside letters.

      The main cutout comes first, followed by the pieces enclosed by characters, such as the inside of an O. A model made without cutting a face throws.

      Parameters

      Returns TopoDSShapePointer[]

      The main cutout face followed by the faces inside characters

    • Returns the pieces of the face that stay enclosed inside characters after the letters are cut out.

      These are the islands such as the inside of an O or an A; the main cutout face is left out. A model made without cutting a face throws.

      Parameters

      Returns TopoDSShapePointer[]

      The faces inside characters