HalfEdgeVertexList
ReferencesProvides 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
Indexers
this[]
#Returns the HalfEdgeVertex at the given index.
Parameters:
| index (int) | Index of vertex to get. Must be larger than or equal to zero and smaller than the Vertex Count of the mesh. |
Returns: The vertex at the given index.
Methods
Add
#Adds a new vertex to the end of the Vertex list.
AddVertices
#Adds a series of new vertices to the end of the vertex list.
Parameters:
| vertices (IEnumerable<Vector3d>) | A list, an array or any enumerable set of Vector3d. |
Returns: Indices of the newly created vertices.
CullUnused
#Removes all vertices that are currently not used by the Halfedge list.
Returns: The number of unused vertices that were removed.
EraseCenterVertex
#Erases a vertex and all incident halfedges by merging its incident faces.
Parameters:
| 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. |
Returns: The successor of
halfedgeIndex around its original face.GetHalfedges
#Gets the halfedges which originate from a vertex.
Parameters:
| v (int) | A vertex index. |
Returns: The indices of halfedges incident to a particular vertex. Ordered clockwise around the vertex.
GetHalfedgesCirculator
#obsoleteGetHalfedgesCirculator(int,int) is deprecated, please useHalfedges.GetVertexCirculator(int) instead.
Traverses the halfedge indices which originate from a vertex.
Parameters:
| v (int) | A vertex index. |
| first (int) | A halfedge index. Halfedge must start at the specified vertex. |
Returns: An enumerable of halfedge indices incident to the specified vertex. Ordered clockwise around the vertex. The returned enumerable will start with the specified halfedge.
Exceptions:
| ArgumentOutOfRangeException | The specified halfedge does not originate from the specified vertex. |
GetHalfedgesCirculator
#obsoleteGetHalfedgesCirculator(int) is deprecated, please useHalfedges.GetVertexCirculator(int) instead.
Traverses the halfedge indices which originate from a vertex.
Parameters:
| v (int) | A vertex index. |
Returns: An enumerable of halfedge indices incident to the specified vertex. Ordered clockwise around the vertex.
GetIncomingHalfedge
#Gets the first incoming halfedge for a vertex.
Parameters:
| v (int) | A vertex index. |
Returns: The index of the halfedge paired with the specified vertex's .
GetIncomingHalfedges
#Gets the halfedges which end at a vertex.
Parameters:
| v (int) | A vertex index. |
Returns: The opposing halfedge for each returned by GetHalfedges(int). Ordered clockwise around the vertex.
GetNormal
#Gets the normal vector at a vertex.
Parameters:
| index (int) | The index of a vertex. |
Returns: The area weighted vertex normal.
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.
Returns: The area weighted vertex normals of all vertices in the mesh.
GetValence
#Gets the number of edges incident to this vertex.
Parameters:
| v (int) | A vertex index. |
Returns: The number of incident edges.
GetVertexFaces
#Gets faces incident to a vertex.
Parameters:
| v (int) | A vertex index. |
Returns: An array of face indices incident to the specified vertex. Ordered clockwise around the vertex
GetVertexNeighbours
#Gets vertex neighbours (a.k.a. 1-ring).
Parameters:
| v (int) | A vertex index. |
Returns: 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.
Parameters:
| index (int) | The index of a vertex. |
Returns:
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)Remarks: The invariant
mesh.Vertices.MergeVertices(mesh.Vertices.SplitVertex(a, b)) will return a, leaving the mesh unchanged.Parameters:
| halfedge (int) | The index of a halfedge between the two vertices to be merged. The starting vertex of this halfedge will be retained. |
Returns: The successor of
halfedge around its vertex, or -1 on failure.NakedEdgeCount
#Gets the number of naked edges incident to this vertex.
Parameters:
| v (int) | A vertex index. |
Returns: 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.
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.
SplitVertex
#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.Parameters:
| 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. |
Returns: The new halfedge which starts at the existing vertex.