Global

Type Definitions

bezier

Source:
Properties:
Name Type Description
points Array

The control points for the bezier curve. The first and last point will also be the start and end of the curve

pointType string

A reference to the type and dimensionality of the points that the curve was created from

dimensions number

The dimensionality of the bezier

permutations Array

A pre-calculation of the bezier algorithm's co-efficients

tangentPermutations Array

A pre-calculation of the bezier algorithm's tangent co-efficients

Represents a bezier easing function.

Type:
  • Object
Example
const b = bezier.create([0,10]) // a linear progression from 0 to 10
const b = bezier.create([0, 0, 10, 10]) // a symmetrical cubic easing curve that starts slowly and ends slowly from 0 to 10
const b = bezier.create([0,0,0], [0,5,10], [10,0,-5], [10,10,10]]) // a cubic 3 dimensional easing curve that can generate position arrays for modelling
Usage:
let position = bezier.valueAt(t,b) // where 0 < t < 1
let tangent = bezier.tangentAt(t,b) // where 0 < t < 1

geom2

Source:
Properties:
Name Type Description
sides Array

list of sides, each side containing two points

transforms mat4

transforms to apply to the sides, see transform()

Represents a 2D geometry consisting of a list of sides.

Type:
  • Object

geom3

Source:
Properties:
Name Type Description
polygons Array

list of polygons, each polygon containing three or more points

isRetesselated Boolean

true if retesselation has been performed

transforms mat4

transforms to apply to the sides, see transform()

Represents a 3D geometry consisting of a list of polygons.

Type:
  • Object

line2

Source:

Represents a unbounded line in 2D space, positioned at a point of origin. A line is parametrized by a normal vector (perpendicular to the line, rotated 90 degrees counter clockwise) and distance from the origin.

Equation: A Point (P) is on Line (L) if dot(L.normal, P) == L.distance

The contents of the array are a normal [0,1] and a distance [2].

Type:
  • Array

line3

Source:
See:

Represents a unbounded line in 3D space, positioned at a point of origin. A line is parametrized by a point of origin and a directional vector. The array contents are two 3D vectors; origin and directional vector.

Type:
  • Array

mat4

Source:

Represents a 4x4 matrix which is column-major (when typed out it looks row-major). See fromValues().

Type:
  • Array

path2

Source:
Properties:
Name Type Description
points Array

list of ordered points

isClosed Boolean

true if the path is closed where start and end points are the same

transforms mat4

transforms to apply to the points, see transform()

Represents a 2D geometry consisting of a list of ordered points.

Type:
  • Object

plane

Source:
See:

Represents a plane in 3D coordinate space as determined by a normal (perpendicular to the plane) and distance from 0,0,0.

The contents of the array are a normal [0,1,2] and a distance [3].

Type:
  • Array

poly2

Source:
Properties:
Name Type Description
vertices Array

list of ordered vertices (2D)

Represents a convex 2D polygon consisting of a list of ordered vertices.

Type:
  • Object

poly3

Source:
Properties:
Name Type Description
vertices Array

list of ordered vertices (3D)

Represents a convex 3D polygon. The vertices used to initialize a polygon must be coplanar and form a convex shape. The vertices do not have to be vec3 instances but they must behave similarly.

Type:
  • Object

slice

Source:
Properties:
Name Type Description
edges Array

list of edges, each edge containing two points (3D)

Represents a 3D geometry consisting of a list of edges.

Type:
  • Object

vec2

Source:

Represents a two dimensional vector. See fromValues().

Type:
  • Array

vec3

Source:

Represents a three dimensional vector. See fromValues().

Type:
  • Array

vec4

Source:

Represents a four dimensional vector. See fromValues().

Type:
  • Array

VectorCharObject

Source:
Properties:
Name Type Description
width Float

character width

height Float

character height (uppercase)

segments Array

character segments [[[x, y], ...], ...]

Represents a character as a list of segments

Type:
  • Object