# [name]

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

## Import

[name] is an add-on, and must be imported explicitly. See [link:#manual/introduction/Installation Installation / Addons].

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

## Constructor

### [name]( [param:VertexNode vertex], [param:Face face] )

[page:VertexNode vertex] - [page:VertexNode] A reference to its destination vertex.
[page:Face face] - [page:Face] A reference to its face.
Creates a new instance of [name].

## Properties

### [property:VertexNode vertex]

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.

### [property:HalfEdge prev]

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

### [property:HalfEdge next]

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

### [property:HalfEdge twin]

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

### [property:Face face]

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

## Methods

### [method:VertexNode head]()

Returns the destination vertex.

### [method:VertexNode tail]()

Returns the origin vertex.

### [method:Float length]()

Returns the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length] (straight-line length) of the edge.

### [method:Float lengthSquared]()

Returns the square of the [link:https://en.wikipedia.org/wiki/Euclidean_distance Euclidean length] (straight-line length) of the edge.

### [method:this setTwin]( [param:HalfEdge edge] )

[page: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

[link:https://github.com/mrdoob/three.js/blob/master/examples/jsm/math/ConvexHull.js examples/jsm/math/ConvexHull.js]