HalfEdgeList
ReferencesProvides 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
Indexers
Methods
Add
#Adds a new halfedge to the end of the Halfedge list.
Parameters:
| halfedge (HalfEdge) | Halfedge to add. |
Returns: The index of the newly added halfedge.
CollapseEdge
#Collapse an edge by combining 2 vertices
Parameters:
| index (int) | The index of a halfedge in the edge to collapse. The end vertex will be removed |
Returns: The successor to
index around its vertex, or -1 on failure.EndVertex
#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.
Parameters:
| halfedgeIndex (int) | The index of a halfedge. |
Returns: The index of vertex at the end of the specified halfedge.
FindHalfedge
#Gets the halfedge index between two vertices.
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.
Parameters:
| index (int) | The index of a halfedge in the edge to be flipped. |
Returns: True on success, otherwise false.
GetEnumerator
#Gets an enumerator that yields all halfedges in this collection.
Returns: An enumerator.
GetFaceCirculator
#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!
Parameters:
| halfedgeIndex (int) | The index of a halfedge. |
Returns: 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
Parameters:
| index (int) |
Returns: The length of the halfedge, or -1 if unused
GetLengths
#Measure the lengths of all the halfedges
Returns: An array of lengths for all halfedges, or -1 for dead ones
GetNextHalfEdge
#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
GetPairHalfedge
#Gets the opposing halfedge in a pair.
Parameters:
| halfedgeIndex (int) | A halfedge index. |
Returns: The halfedge index with which the specified halfedge is paired.
GetVertexCirculator
#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!
Parameters:
| halfedgeIndex (int) | The index of a halfedge. |
Returns: 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.
Parameters:
| index (int) | A halfedge index. |
Returns: 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.
Parameters:
| index (int) | The index of a halfedge. |
Returns:
true if the specified halfedge is on a boundary; otherwise, false.PairHalfedge
#obsoletePairHalfedge is deprecated, pease use GetPairHalfedge instead.
Parameters:
| halfedgeIndex (int) |
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
Parameters:
| index (int) | The index of a halfedge in the edge to pinch |
Returns: True on success, otherwise false.
SplitEdge
#Creates a new vertex, and inserts it along an existing edge, splitting it in 2.
Parameters:
| index (int) | The index of a halfedge in the edge to be split. |
Returns: The index of the newly created halfedge in the same direction as the input halfedge.