Class: GluTesselator

libtess.GluTesselator()

new GluTesselator()

The tesselator main class, providing the public API.
Source:

Members

dict :libtess.Dict

edge dictionary for sweep line
Type:
Source:

event :libtess.GluVertex

current sweep event being processed
Type:
Source:

fatalError :boolean

fatal error: needed combine callback
Type:
  • boolean
Source:

mesh :libtess.GluMesh

stores the input contours, and eventually the tessellation itself
Type:
Source:

(non-null) mesh :libtess.GluMesh

Type:
Source:

pq :libtess.PriorityQ

priority queue of vertex events
Type:
Source:

windingRule :libtess.windingRule

rule for determining polygon interior
Type:
Source:

Methods

callBeginCallback(type)

Call callback to indicate the start of a primitive, to be followed by emitted vertices, if any. In libtess.js, `type` will always be `GL_TRIANGLES`.
Parameters:
Name Type Description
type libtess.primitiveType
Source:

callCombineCallback(coordsnon-null, datanon-null, weightnon-null) → (nullable) {Object}

Call callback for combining vertices at edge intersection requiring the creation of a new vertex.
Parameters:
Name Type Description
coords Array.<number> Intersection coordinates.
data Array.<Object> Array of vertex data, one per edge vertices.
weight Array.<number> Coefficients used for the linear combination of vertex coordinates that gives coords.
Source:
Returns:
Interpolated vertex.
Type
Object

callEdgeFlagCallback(flag)

Call callback to indicate whether the vertices to follow begin edges which lie on a polygon boundary.
Parameters:
Name Type Description
flag boolean
Source:

callEndCallback()

Call callback to indicate the end of tessellation.
Source:

callErrorCallback(errno)

Call error callback, if specified, with errno.
Parameters:
Name Type Description
errno libtess.errorType | libtess.gluEnum
Source:

callVertexCallback(data)

Call callback to emit a vertex of the tessellated polygon.
Parameters:
Name Type Description
data Object
Source:

gluDeleteTess()

Destory the tesselator object. See README.
Source:

gluGetTessProperty(which) → {number|boolean}

Returns tessellator property
Parameters:
Name Type Description
which libtess.gluEnum [description].
Source:
Returns:
[description].
Type
number | boolean

gluTessBeginContour()

[gluTessBeginContour description]
Source:

gluTessBeginPolygon(data)

[gluTessBeginPolygon description]
Parameters:
Name Type Description
data Object Client data for current polygon.
Source:

gluTessCallback(which, opt_fnopt, nullable)

Specify callbacks. See README for callback descriptions. A null or undefined opt_fn removes current callback.
Parameters:
Name Type Attributes Description
which libtess.gluEnum The callback-type gluEnum value.
opt_fn function <optional>
<nullable>
Source:

gluTessEndContour()

[gluTessEndContour description]
Source:

gluTessEndPolygon()

[gluTessEndPolygon description]
Source:

gluTessNormal(x, y, z)

Lets the user supply the polygon normal, if known. All input data is projected into a plane perpendicular to the normal before tesselation. All output triangles are oriented CCW with respect to the normal (CW orientation can be obtained by reversing the sign of the supplied normal). For example, if you know that all polygons lie in the x-y plane, call `tess.gluTessNormal(0.0, 0.0, 1.0)` before rendering any polygons.
Parameters:
Name Type Description
x number
y number
z number
Source:

gluTessProperty(which, value)

Set properties for control over tesselation. See README.
Parameters:
Name Type Description
which libtess.gluEnum [description].
value number | boolean [description].
Source:

gluTessVertex(coordsnon-null, data)

Specify a vertex and associated data. Must be within calls to beginContour/endContour. See README.
Parameters:
Name Type Description
coords Array.<number>
data Object
Source: