HalfEdgeVertexList

References
Provides access to the vertices and HalfEdgeVertex 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 vertices.

Indexers

this[]

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

Methods

Add

#
public int Add(double x, double y, double z)
Adds a new vertex to the end of the Vertex list.
x (double)X component of new vertex coordinate.
y (double)Y component of new vertex coordinate.
z (double)Z component of new vertex coordinate.
The index of the newly added vertex.

AddVertices

#
public int[] AddVertices(IEnumerable<Vector3d> vertices)
Adds a series of new vertices to the end of the vertex list.
vertices (IEnumerable<Vector3d>)A list, an array or any enumerable set of Vector3d.
Indices of the newly created vertices.

CullUnused

#
public int CullUnused()
Removes all vertices that are currently not used by the Halfedge list.
The number of unused vertices that were removed.

EraseCenterVertex

#
public int EraseCenterVertex(int halfedgeIndex)
Erases a vertex and all incident halfedges by merging its incident faces.
halfedgeIndex (int)The index of a halfedge which starts at the vertex to erase. The retained face will be the one adjacent to this halfedge.
The successor of halfedgeIndex around its original face.

GetEnumerator

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

GetHalfedges

#
public int[] GetHalfedges(int v)
Gets the halfedges which originate from a vertex.
v (int)A vertex index.
The indices of halfedges incident to a particular vertex. Ordered clockwise around the vertex.

GetHalfedgesCirculator

#
public IEnumerable<int> GetHalfedgesCirculator(int v, int first)
obsoleteGetHalfedgesCirculator(int,int) is deprecated, please useHalfedges.GetVertexCirculator(int) instead.
Traverses the halfedge indices which originate from a vertex.
v (int)A vertex index.
first (int)A halfedge index. Halfedge must start at the specified vertex.
An enumerable of halfedge indices incident to the specified vertex. Ordered clockwise around the vertex. The returned enumerable will start with the specified halfedge.
ArgumentOutOfRangeExceptionThe specified halfedge does not originate from the specified vertex.

GetHalfedgesCirculator

#
public IEnumerable<int> GetHalfedgesCirculator(int v)
obsoleteGetHalfedgesCirculator(int) is deprecated, please useHalfedges.GetVertexCirculator(int) instead.
Traverses the halfedge indices which originate from a vertex.
v (int)A vertex index.
An enumerable of halfedge indices incident to the specified vertex. Ordered clockwise around the vertex.

GetIncomingHalfedge

#
public int GetIncomingHalfedge(int v)
Gets the first incoming halfedge for a vertex.
v (int)A vertex index.
The index of the halfedge paired with the specified vertex's .

GetIncomingHalfedges

#
public int[] GetIncomingHalfedges(int v)
Gets the halfedges which end at a vertex.
v (int)A vertex index.
The opposing halfedge for each returned by GetHalfedges(int). Ordered clockwise around the vertex.

GetNormal

#
public Vector3d GetNormal(int index)
Gets the normal vector at a vertex.
index (int)The index of a vertex.
The area weighted vertex normal.

GetNormals

#
public Vector3d[] GetNormals()
Gets the normal vectors for all vertices in the mesh.
Remarks: This will be accurate at the time of calling but will quickly become outdated if you start fiddling with the mesh.
The area weighted vertex normals of all vertices in the mesh.

GetPositions

#
public Vector3d[] GetPositions()
Gets the positions of all vertices.
The positions of all vertices in the mesh.

GetValence

#
public int GetValence(int v)
Gets the number of edges incident to this vertex.
v (int)A vertex index.
The number of incident edges.

GetVertexFaces

#
public int[] GetVertexFaces(int v)
Gets faces incident to a vertex.
v (int)A vertex index.
An array of face indices incident to the specified vertex. Ordered clockwise around the vertex

GetVertexNeighbours

#
public int[] GetVertexNeighbours(int v)
Gets vertex neighbours (a.k.a. 1-ring).
v (int)A vertex index.
An array of vertex indices incident to the specified vertex. Ordered clockwise around the vertex.

IsBoundary

#
public bool IsBoundary(int index)
A vertex is on a boundary if its outgoing halfedge has no adjacent face.
index (int)The index of a vertex.
true if the specified vertex is on a boundary; otherwise, false. Also returns true if the vertex is unused (i.e. no outgoing halfedge).

MergeVertices

#
public int MergeVertices(int halfedge)

Merges two vertices by collapsing the pair of halfedges between them.

HalfEdgeList.CollapseEdge(int)
Remarks: The invariant mesh.Vertices.MergeVertices(mesh.Vertices.SplitVertex(a, b)) will return a, leaving the mesh unchanged.
halfedge (int)The index of a halfedge between the two vertices to be merged. The starting vertex of this halfedge will be retained.
The successor of halfedge around its vertex, or -1 on failure.

NakedEdgeCount

#
public int NakedEdgeCount(int v)
Gets the number of naked edges incident to this vertex.
v (int)A vertex index.
The number of incident halfedges which lie on a boundary.

SetVertex

#
public bool SetVertex(int vertexIndex, double x, double y, double z)

Sets or adds a vertex to the Vertex List.

If [index] is less than [Count], the existing vertex at [index] will be modified.

If [index] equals [Count], a new vertex is appended to the end of the vertex list.

If [index] is larger than [Count], the function will return false.

vertexIndex (int)Index of vertex to set.
x (double)X component of vertex location.
y (double)Y component of vertex location.
z (double)Z component of vertex location.
true on success, false on failure.

SetVertex

#
public bool SetVertex(int vertexIndex, Vector3d position)

Sets or adds a vertex to the Vertex List.

If [index] is less than [Count], the existing vertex at [index] will be modified.

If [index] equals [Count], a new vertex is appended to the end of the vertex list.

If [index] is larger than [Count], the function will return false.

vertexIndex (int)Index of vertex to set.
position (Vector3d)Location of the vertex.
true on success, false on failure.

SplitVertex

#
public int SplitVertex(int first, int second)
Splits the vertex into two, joined by a new pair of halfedges.
Remarks: After the split, the second halfedge will be starting at the newly added vertex.
first (int)The index of a halfedge which starts at the vertex to split.
second (int)The index of a second halfedge which starts at the vertex to split.
The new halfedge which starts at the existing vertex.
Explicit

IEnumerable.GetEnumerator

#
IEnumerator IEnumerable.GetEnumerator()

TruncateVertex

#
public int TruncateVertex(int v)
Truncates a vertex by creating a face with vertices on each of the outgoing halfedges.
v (int)The index of a vertex.
The index of the newly created face.