Class: Graphable

Graphable(parentopt)

Class representing a graphable object. Provides support for graphing options including color and opacity, in addition to a local coordinate system via its parent class, Coords.

Constructor

new Graphable(parentopt)

Parameters:
Name Type Attributes Default Description
parent Graphable | Coords <optional>
null
Source:

Extends

Classes

Graphable

Members

dv :number

Nominal step-count for parametric curves and surfaces.
Type:
  • number
Overrides:
Source:

Methods

color(color) → {this}

Parameters:
Name Type Description
color string
Source:
Returns:
Type
this

dupe() → {this}

Get a new duplicate transformed Coords object.
Overrides:
Source:
Returns:
Type
this

grey(valueopt) → {this}

Parameters:
Name Type Attributes Default Description
value number <optional>
0 grey value (0-100)
Source:
Returns:
Type
this

hue(hueopt) → {this}

Parameters:
Name Type Attributes Default Description
hue number <optional>
0 hue as degrees on a color wheel (0-360)
Source:
Returns:
Type
this

lightness(lightnessopt) → {this}

Parameters:
Name Type Attributes Default Description
lightness number <optional>
0 lightness percentage
Source:
Returns:
Type
this

opacity(opacity) → {this}

Parameters:
Name Type Description
opacity number
Source:
Returns:
Type
this

options() → {geometryOptions}

Returns a deep clone of the options object.
Source:
Returns:
Type
geometryOptions

orient(v) → {Array.<number>}

Apply current un-translated coordinate transform to vector v.
Parameters:
Name Type Description
v Array.<number>
Overrides:
Source:
Returns:
Type
Array.<number>

quaternion(q) → {this}

Rotate by a quaternion
Parameters:
Name Type Description
q Array.<number> a quaternion
Overrides:
Source:
Returns:
Type
this

resetTransform() → {this}

Overrides:
Source:
Returns:
Type
this

rotate(angleopt, axisopt) → {this}

Parameters:
Name Type Attributes Default Description
angle number <optional>
0
axis number | Array.<number> <optional>
0 either an axis index (0, 1, 2) or an axis vector
Overrides:
Source:
Returns:
Type
this

rotateTo(srcAxis, dstAxis)

Rotate so that srcAxis goes into dstAxis.
Parameters:
Name Type Description
srcAxis Array.<number>
dstAxis Array.<number>
Overrides:
Source:

saturation(saturationopt) → {this}

Parameters:
Name Type Attributes Default Description
saturation number <optional>
0 saturation percentage
Source:
Returns:
Type
this

scale(sopt) → {this}

Parameters:
Name Type Attributes Default Description
s number <optional>
1
Overrides:
Source:
Returns:
Type
this

setOptions(options) → {this}

Parameters:
Name Type Description
options geometryOptions
Source:
Returns:
Type
this

setSubOptions(options) → {this}

Should only be given settings for object-valued options.
Parameters:
Name Type Description
options geometrySubOptions
Source:
Returns:
Type
this

stretch(xopt, yopt, zopt) → {this}

Parameters:
Name Type Attributes Default Description
x number <optional>
1
y number <optional>
1
z number <optional>
1
Overrides:
Source:
Returns:
Type
this

transform(v) → {Array.<number>}

Apply current coordinate transform to vector v.
Parameters:
Name Type Description
v Array.<number>
Overrides:
Source:
Returns:
Type
Array.<number>

translate(xopt, yopt, zopt) → {this}

Parameters:
Name Type Attributes Default Description
x number <optional>
0
y number <optional>
0
z number <optional>
0
Overrides:
Source:
Returns:
Type
this