HalfEdge

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

Import

HalfEdge is an add-on, and must be imported explicitly. See Installation / Addons.

import { HalfEdge } from 'three/addons/math/ConvexHull.js';

Constructor

HalfEdge( vertex : VertexNode, face : Face )

vertex – VertexNode A reference to its destination vertex.

face – Face A reference to its face.

Creates a new instance of HalfEdge.

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.

.prev : HalfEdge

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

.next : 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 destination 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 ) : this

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.

Leave a comment

Your email address will not be published. Required fields are marked *