HalfEdge

The basis for a half-edge data structure, also known as doubly connected edge list (DCEL).

Constructor

HalfEdge(vertex : VertexNode, face : Face)

vertex - VertexNode A reference to its destination vertex.

face - Face A reference to its face.

Properties

.vertex : VertexNode

Reference to the destination vertex. The origin vertex can be obtained by querying the destination of its twin, or of the previous half-edge. Default is undefined.

. : HalfEdge

Reference to the previous half-edge of the same face. Default is null.

. : HalfEdge

Reference to the next half-edge of the same face. Default is null.

.twin : HalfEdge

Reference to the twin half-edge to reach the opposite face. Default is null.

.face : Face

Each half-edge bounds a single face and thus has a reference to that face. Default is undefined.

Methods

.head () : VertexNode

Returns the destintation vertex.

.tail () : VertexNode

Returns the origin vertex.

.length () : Float

Returns the Euclidean length (straight-line length) of the edge.

.lengthSquared () : Float

Returns the square of the Euclidean length (straight-line length) of the edge.

.setTwin (edge : HalfEdge) : HalfEdge

edge - Any half-edge.

Sets the twin edge of this half-edge. It also ensures that the twin reference of the given half-edge is correctly set.

Source

For more info on how to obtain the source code of this module see this page.