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

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

Indexers

this[]

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

Methods

Add

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

CollapseEdge

#
public int CollapseEdge(int index)
Collapse an edge by combining 2 vertices
index (int)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

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

FindHalfedge

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

FlipEdge

#
public bool FlipEdge(int index)
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.
index (int)The index of a halfedge in the edge to be flipped.
True on success, otherwise false.

GetEnumerator

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

GetFaceCirculator

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

GetLength

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

GetLengths

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

GetNextHalfEdge

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

GetPairHalfedge

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

GetVertexCirculator

#
public IEnumerable<int> GetVertexCirculator(int halfedgeIndex)
Traverses clockwise around the starting vertex of a halfedge.
Remarks: Lazily evaluated so if you change the mesh topology whilst using this circulator, you'll know about it!
halfedgeIndex (int)The index of a halfedge.
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

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

IsBoundary

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

PairHalfedge

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

PinchOff

#
public bool PinchOff(int index)
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
index (int)The index of a halfedge in the edge to pinch
True on success, otherwise false.

SplitEdge

#
public int SplitEdge(int index)
Creates a new vertex, and inserts it along an existing edge, splitting it in 2.
index (int)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

#
public int TriangleSplitEdge(int index)
Split 2 adjacent triangles into 4 by inserting a new vertex along the edge
index (int)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