HalfEdge

优质
小牛编辑
125浏览
2023-12-01

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.

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 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

examples/jsm/math/ConvexHull.js