Class: DCEL

DCEL(points=opt, edges=opt)

The Doubly-Connected Edge List (DCEL) data structure.

Constructor

new DCEL(points=opt, edges=opt)

Create a new DCEL.
Parameters:
Name Type Attributes Description
points= Array <optional>
The vertices of the DCEL. [[x1, y1], [x2, y2], ...].
edges= Array <optional>
The edges of the DCEL. [[start1, end1], [start2, end2]...]. Starts and Ends are indices of vertices.
Source:
See:

Members

faces :Array.<Face>

The faces of the DCEL.
Type:
Source:

hedges :Array.<Hedge>

The half edges of the DCEL.
Type:
Source:

vertices :Array.<Vertex>

The vertices of the DCEL.
Type:
Source:

Methods

addEdge(x1, y1, x2, y2)

Add an edge to the DCEL.
Parameters:
Name Type Description
x1 number The x coordinate of the start vertex.
y1 number The y coordinate of the start vertex.
x2 number The x coordinate of the end vertex.
y2 number The y coordinate of the end vertex.
Source:

dispose()

Dispose old datas.
Source:

externalFaces() → {Array.<Face>}

Get all external (area <= 0) faces
Source:
Returns:
- External faces
Type
Array.<Face>

findHedge(x1, y1, x2, y2) → {Hedge|null}

Find half edge by start and end vertices coordinates.
Parameters:
Name Type Description
x1 number The x coordinate of the start vertex.
y1 number The y coordinate of the start vertex.
x2 number The x coordinate of the end vertex.
y2 number The y coordinate of the end vertex.
Source:
Returns:
- The half edge.
Type
Hedge | null

findVertex(x, y) → {Vertex|null}

Find vertex by x and y coordinate.
Parameters:
Name Type Description
x number The x coordinate of the vertex.
y number The y coordinate of the vertex.
Source:
Returns:
- The vertex.
Type
Vertex | null

internalFaces() → {Array.<Face>}

Get all internal (area > 0) faces
Source:
Returns:
- Internal faces
Type
Array.<Face>

removeEdge(x1, y1, x2, y2)

Remove an edge from the DCEL.
Parameters:
Name Type Description
x1 number The x coordinate of the start vertex.
y1 number The y coordinate of the start vertex.
x2 number The x coordinate of the end vertex.
y2 number The y coordinate of the end vertex.
Source:

setDatas(points=opt, edges=opt)

Set the vertices and edges of the DCEL.
Parameters:
Name Type Attributes Description
points= Array <optional>
The vertices of the DCEL. [[x1, y1], [x2, y2], ...].
edges= Array <optional>
The edges of the DCEL. [[start1, end1], [start2, end2]...]. Starts and Ends are indices of vertices.
Source:

splitEdge(x1, y1, x2, y2, splitX, splitY)

Split an edge of the DCEL.
Parameters:
Name Type Description
x1 number The x coordinate of the start vertex.
y1 number The y coordinate of the start vertex.
x2 number The x coordinate of the end vertex.
y2 number The y coordinate of the end vertex.
splitX number The x coordinate of the split vertex.
splitY number The y coordinate of the split vertex.
Source: