Repository

TextOpentype

Extends:

Mesh → TextOpentype

3D Text is created from a standard font file compatible with opentype.js.

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public
public
public
public
public

depth: *

public
public
public
public
public
public
public
public

indices: *[]

public
public
public
public

steps: *

public

text: *

public
Private Members
private

_extrudeSettings: {"steps": *, "depth": *, "bevelEnabled": *, "bevelThickness": *, "bevelSize": *, "bevelSegments": *}

private

_font: *

private

_mesh: *

Method Summary

Public Methods
public

createTextGeometry(shapes: *)

public

createTextLines(shapes: *)

public

makeShapes(text: *): *

public

setText(text: *)

Inherited Summary

From class Mesh
public static

generateStrokeMesh(mesh: Mesh, inflateValue: Number): Mesh

Static Utils to generate the stroke Mesh from a given shape

public static

generateStrokeShape(mesh: Mesh, inflateValue: Number): *

Static Utils to generate the stroke for the given vertices with the given stroke width

public static

geometryIsCW(geometry: Geometry): Boolean

Static Utils to check the direction of a geometry (ccw o cw)

public

events: *

public
public
public
public
public
public

indices: *[]

public
public
public

name: *

public
public
public
public

type: *

public
public
private

_mesh: *

public

Attach the material to this mesh.

public

clone(): *

deep clone this Mesh return {Mesh} a new clone (copy) of this Mesh in a new Mesh object

public

compute Face and Vertex Normals for the current geometry

public

Call this method to construct a custom mesh

public

erase(recursive: Boolean)

Erase this mesh's geometry and material from memory

public

generateFillMesh(vertices: *)

Generate the mesh for the given vertices and generates flat uvs for it.

public

Generate the flat uvs for this mesh.

public

genereate a mesh from already made geometry and material

public

Compute and returns the bounding box of the current geometry or Node, which is an object made of 2 Vector3.

public

Compute and returns the bounding sphere of the current geometry or Node, which is an object with a radius :

public

Returns the center of the geometry (vertices) based on boundingbox

public

Shortcut for getSize().y

public

Shortcut for getSize().z

public
public
public

Returns the size of the geometry (vertices) based on boundingbox

public

getUVs(index: integer): Array

Get the UV of this mesh geometry

public

Get the vertexColors of this mesh geometry's vertices

public

Get the vertices of this mesh geometry

public

Get the visibility of this mesh

public

Shortcut for getSize().x

public

Generate Float32Array and BufferAttribute for this geometry

public

Adds a Normal to the current geometry

public

pushQuad(v1: Vector3, v2: Vector3, v3: Vector3, v4: Vector3)

Adds a Quad to the current geometry

public

Adds a triangle to the current geometry

public

pushUV(uv1: Vector2, uv2: Vector2, uv3: Vector2)

Adds a UV to the current geometry

public

Adds a vertex to the current geometry

public

convinient method to reverse this Mesh geometry's normals

public

setCastShadow

public

Defines the position of the geometry's center (NOT the transform!).

public

setEventEmitterTrigger(scope: *, eventType: *)

public

Sets this Mesh material.

public
public

setReceiveShadow

public
public

setRotationX(value: float)

Set the rotation around x axis of the vertices (not the transform!)

public

setRotationY(value: float)

Set the rotation around y axis of the vertices (not the transform!)

public

setRotationZ(value: float)

Set the rotation around z axis of the vertices (not the transform!)

public

setScale(number|Vector3|Vector2: float | Vector3 | Vector2, Number: float, Number: float)

Set the scale of the geometry (vertices) - this is not like scaling the transform.

public

setTranslation(value: float, value: float, value: float)

Set the translation along all axis of the vertices (not the transform!)

public

setUVs(index: integer, uvs: Array)

Set the UV of this mesh geometry

public

setVertex(index: *, vertex: *)

public

Set the vertexColors of this mesh geometry's vertices

public

setVertices(vertices: Object)

Set the vertices of this mesh geometry

public

Set the visibility of this mesh

private

Updates this mesh material

Public Constructors

public constructor(params: Object) source

Construct an empty and unfinished Mesh for which a geometry must be constructed. Once filled with vertices, constructMesh method must be called, or a method generating a complete Mesh must be used (i.e generateFillMesh)

Override:

Mesh#constructor

Params:

NameTypeAttributeDescription
paramsObject

Parameters object, given by the constructor.

params.textNumber
  • optional
  • default: "text"

the text string

params.fontSizeNumber
  • optional
  • default: 1

the text font height

params.depthNumber
  • optional
  • default: 1

the glyph extrusion height. 0 to have flat letters.

params.bevelSegmentsNumber
  • optional
  • default: 5

the text bevel details and tesselation

params.bevelEnabledBoolean
  • optional
  • default: false

the text geometry uses curves

params.bevelSizeNumber
  • optional
  • default: 1

the text geometry bevel

params.fontNumber

the text font to use.

Public Members

public bevelEnabled: * source

public bevelSegments: * source

public bevelSize: * source

public bevelThickness: * source

public depth: * source

public fontFile: * source

public fontSize: * source

public geometry: * source

Override:

Mesh#geometry

public geometryNormalAttributes: * source

Override:

Mesh#geometryNormalAttributes

public geometryUVAttributes: * source

Override:

Mesh#geometryUVAttributes

public geometryVerticesAttributes: * source

Override:

Mesh#geometryVerticesAttributes

public index: number source

public indices: *[] source

Override:

Mesh#indices

public lineMode: * source

public lineModeDivision: * source

public material: * source

Override:

Mesh#material

public steps: * source

public text: * source

public transform: * source

Override:

Mesh#transform

Private Members

private _extrudeSettings: {"steps": *, "depth": *, "bevelEnabled": *, "bevelThickness": *, "bevelSize": *, "bevelSegments": *} source

private _font: * source

private _mesh: * source

Override:

Mesh#_mesh

Public Methods

public createTextGeometry(shapes: *) source

Params:

NameTypeAttributeDescription
shapes*

public createTextLines(shapes: *) source

Params:

NameTypeAttributeDescription
shapes*

public makeShapes(text: *): * source

Params:

NameTypeAttributeDescription
text*

Return:

*

public setText(text: *) source

Params:

NameTypeAttributeDescription
text*