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

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

Indexers

this[]

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

Methods

Add

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

AddVertices

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

CullUnused

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

EraseCenterVertex

#
Erases a vertex and all incident halfedges by merging its incident faces.
public int EraseCenterVertex(
halfedgeIndex
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

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

GetHalfedges

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

GetHalfedgesCirculator

#
Traverses the halfedge indices which originate from a vertex.
public IEnumerable<int> GetHalfedgesCirculator(
v,
A vertex index.
first
A halfedge index. Halfedge must start at the specified vertex.
)
obsoleteGetHalfedgesCirculator(int,int) is deprecated, please useHalfedges.GetVertexCirculator(int) instead.
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

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

GetIncomingHalfedge

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

GetIncomingHalfedges

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

GetNormal

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

GetNormals

#
Gets the normal vectors for all vertices in the mesh.
public Vector3d[] GetNormals()
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

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

GetValence

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

GetVertexFaces

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

GetVertexNeighbours

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

IsBoundary

#
A vertex is on a boundary if its outgoing halfedge has no adjacent face.
public bool IsBoundary(
index
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

#

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

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

NakedEdgeCount

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

SetVertex

#

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.

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

SetVertex

#

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.

public bool SetVertex(
vertexIndex,
Index of vertex to set.
position
Location of the vertex.
)
true on success, false on failure.

SplitVertex

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

IEnumerable.GetEnumerator

#
IEnumerator IEnumerable.GetEnumerator()

TruncateVertex

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