HalfEdgeList

References
Provides access to the halfedges and HalfEdge related functionality of a Mesh. Derived from Plankton, (c) 2013 Daniel Piker and Will Pearson, licensed LGPL v3 or later.

Properties

Count

#
Gets the number of halfedges.
public int Count { get; }

Indexers

this[]

#
Returns the HalfEdge at the given index.
public HalfEdge this[
index
Index of halfedge to get. Must be larger than or equal to zero and smaller than the Halfedge Count of the mesh.
] { get; }
The halfedge at the given index.

Methods

Add

#
Adds a new halfedge to the end of the Halfedge list.
public int Add(
halfedge
Halfedge to add.
)
The index of the newly added halfedge.

CollapseEdge

#
Collapse an edge by combining 2 vertices
public int CollapseEdge(
index
The index of a halfedge in the edge to collapse. The end vertex will be removed
)
The successor to index around its vertex, or -1 on failure.

EndVertex

#
Gets the index of the vertex at the end of a halfedge.
public int EndVertex(
halfedgeIndex
The index of a halfedge.
)
Remarks: This helper actually returns the start vertex of the other halfedge in the pair.
The index of vertex at the end of the specified halfedge.

FindHalfedge

#
Gets the halfedge index between two vertices.
public int FindHalfedge(
start,
A vertex index.
end
A vertex index.
)
If it exists, the index of the halfedge which originates from start and terminates at end. Otherwise -1 is returned.

FlipEdge

#
Performs an edge flip. This works by shifting the start/end vertices of the edge anticlockwise around their faces (by one vertex) and as such can be applied to any n-gon mesh, not just triangulations.
public bool FlipEdge(
index
The index of a halfedge in the edge to be flipped.
)
True on success, otherwise false.

GetEnumerator

#
Gets an enumerator that yields all halfedges in this collection.
public IEnumerator<HalfEdge> GetEnumerator()
An enumerator.

GetFaceCirculator

#
Traverses anticlockwise around the adjacent face of a halfedge.
public IEnumerable<int> GetFaceCirculator(
halfedgeIndex
The index of a halfedge.
)
Remarks: Lazily evaluated so if you change the mesh topology whilst using this circulator, you'll know about it!
An enumerable of halfedge indices incident to the adjacent face of halfedgeIndex. Ordered anticlockwise around the face.

GetLength

#
Measure the length of a single halfedge
public double GetLength(
index
)
The length of the halfedge, or -1 if unused

GetLengths

#
Measure the lengths of all the halfedges
public double[] GetLengths()
An array of lengths for all halfedges, or -1 for dead ones

GetNextHalfEdge

#
Gets the halfedge a given number of 'next's around a face from a starting halfedge
public int GetNextHalfEdge(
startHalfEdge,
The halfedge to start from
around
How many steps around the face. 0 returns the start_he
)
obsoleteGetNextHalfedge(int,int) is deprecated, please useGetFaceCirculator(int).ElementAt(int) instead (LINQ).
The resulting halfedge

GetPairHalfedge

#
Gets the opposing halfedge in a pair.
public int GetPairHalfedge(
halfedgeIndex
A halfedge index.
)
The halfedge index with which the specified halfedge is paired.

GetVertexCirculator

#
Traverses clockwise around the starting vertex of a halfedge.
public IEnumerable<int> GetVertexCirculator(
halfedgeIndex
The index of a halfedge.
)
Remarks: Lazily evaluated so if you change the mesh topology whilst using this circulator, you'll know about it!
An enumerable of halfedge indices incident to the starting vertex of halfedgeIndex. Ordered clockwise around the vertex. The returned enumerable will start with the specified halfedge.

GetVertices

#
Gets the two vertices for a halfedge.
public int[] GetVertices(
index
A halfedge index.
)
The pair of vertex indices connected by the specified halfedge. The order follows the direction of the halfedge.

IsBoundary

#
A halfedge is on a boundary if it only has a face on one side.
public bool IsBoundary(
index
The index of a halfedge.
)
true if the specified halfedge is on a boundary; otherwise, false.

PairHalfedge

#
public int PairHalfedge(
halfedgeIndex
)
obsoletePairHalfedge is deprecated, pease use GetPairHalfedge instead.

PinchOff

#
Given a halfedge which is on the boundary at each end, but is not a boundary edge itself separate the mesh here by flipping edges so 2 faces can be removed without changing vertex count
public bool PinchOff(
index
The index of a halfedge in the edge to pinch
)
True on success, otherwise false.

SplitEdge

#
Creates a new vertex, and inserts it along an existing edge, splitting it in 2.
public int SplitEdge(
index
The index of a halfedge in the edge to be split.
)
The index of the newly created halfedge in the same direction as the input halfedge.
Explicit

IEnumerable.GetEnumerator

#
IEnumerator IEnumerable.GetEnumerator()

TriangleSplitEdge

#
Split 2 adjacent triangles into 4 by inserting a new vertex along the edge
public int TriangleSplitEdge(
index
The index of the halfedge to split. Must be between 2 triangles.
)
The index of the halfedge going from the new vertex to the end of the input halfedge, or -1 on failure