Class: Surface

Surface()

Class representing a factory for various simple 2D surfaces.

Constructor

new Surface()

Source:

Extends

Members

dv :number

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

Methods

conic(r1opt, r2opt, hopt, angleopt) → {Array.<Geometry>}

Generate a conic section, or a portion of one (annulus, cylinder, cone, etc.)
Parameters:
Name Type Attributes Default Description
r1 number <optional>
0 inner radius
r2 number <optional>
1 outer radius
h number <optional>
1 height
angle number <optional>
2*pi included arc angle
Source:
Returns:
Type
Array.<Geometry>

cylinder(ropt, hopt, angleopt) → {Array.<Geometry>}

Generate a cylinder, or a portion of one.
Parameters:
Name Type Attributes Default Description
r number <optional>
1 radius
h number <optional>
1 height
angle number <optional>
2*pi included arc angle
Source:
Returns:
Type
Array.<Geometry>

disc(ropt, angleopt) → {Array.<Geometry>}

Generate a disc, or a portion of one.
Parameters:
Name Type Attributes Default Description
r number <optional>
1 radius
angle number <optional>
2*pi included arc angle
Source:
Returns:
Type
Array.<Geometry>

dupe() → {this}

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

hemisphere(ropt, revopt) → {Array.<Geometry>}

Generate a hemisphere with cubic tesselation.
Parameters:
Name Type Attributes Default Description
r number <optional>
1 radius
rev boolean <optional>
false reverse orientation (normal pointing inward)
Source:
Returns:
Type
Array.<Geometry>

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

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

polygon(nopt, ropt) → {Array.<Geometry>}

Generate a regular polygon with N sides.
Parameters:
Name Type Attributes Default Description
n number <optional>
5 number of sides
r number <optional>
1 radius of circumscribed circle
Source:
Returns:
Type
Array.<Geometry>

quaternion(q) → {this}

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

rect(wopt, hopt) → {Array.<Geometry>}

Parameters:
Name Type Attributes Default Description
w number <optional>
1 width
h number <optional>
height
Source:
Returns:
Type
Array.<Geometry>

resetTransform() → {this}

Inherited From:
Source:
Returns:
Type
this

rightTriangle(wopt, hopt) → {Array.<Geometry>}

Parameters:
Name Type Attributes Default Description
w number <optional>
1 width
h number <optional>
height
Source:
Returns:
Type
Array.<Geometry>

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
Inherited From:
Source:
Returns:
Type
this

rotateTo(srcAxis, dstAxis)

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

scale(sopt) → {this}

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

sphereBand(ropt, angleopt, azimuthopt, offsetopt, revopt) → {Array.<Geometry>}

Generate a sphere with lat/lon tesselation, or a portion of a spherical surface.
Parameters:
Name Type Attributes Default Description
r number <optional>
1 radius
angle number | function <optional>
2*pi longitudinal segment size (0 to 2*pi)
azimuth number <optional>
pi latitudinal segment size (0 to pi)
offset number <optional>
0 latitudinal offset (+/-(pi - azimuth)/2)
rev boolean <optional>
false reverse orientation (normal pointing inward)
Source:
Returns:
Type
Array.<Geometry>

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

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

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

Apply current coordinate transform to vector v.
Parameters:
Name Type Description
v Array.<number>
Inherited From:
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
Inherited From:
Source:
Returns:
Type
this