HalfEdgeFaceList
ReferencesProvides access to the faces and HalfEdgeFace 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 HalfEdgeFace at the given index.
Parameters:
| index (int) | Index of face to get. Must be larger than or equal to zero and smaller than the Face Count of the mesh. |
Returns: The face at the given index.
Methods
AddFace
#Adds a new face to the end of the Face list. Creates any halfedge pairs that are required.
Remarks: The mesh must remain 2-manifold and orientable at all times.
Parameters:
| indices (IEnumerable<int>) | The vertex indices which define the face, ordered anticlockwise. |
Returns: The index of the newly added face (-1 in the case that the face could not be added).
AddFace
#Appends a new quadragular face to the end of the mesh face list. Creates any halfedge pairs that are required.
AddFace
#Appends a new triangular face to the end of the mesh face list. Creates any halfedge pairs that are required.
AddFaces
#Appends a list of faces to the end of the mesh face list.
Parameters:
| faces (IEnumerable<IEnumerable<int>>) | Faces to add. |
Returns: Indices of the newly created faces.
FaceCentroid
#obsoleteFaceCentroid is deprecated, please use GetFaceCenter instead.
Parameters:
| f (int) |
GetFaceCenter
#Gets the barycenter of a face's vertices.
Parameters:
| f (int) | A face index. |
Returns: The location of the specified face's barycenter.
GetFaceVertices
#Gets vertex indices of a face.
Parameters:
| f (int) | A face index. |
Returns: An array of vertex indices incident to the specified face. Ordered anticlockwise around the face.
GetHalfedges
#Gets the halfedges which bound a face.
Parameters:
| f (int) | A face index. |
Returns: The indices of halfedges incident to a particular face. Ordered anticlockwise around the face.
GetHalfedgesCirculator
#obsoleteGetHalfedgesCirculator(int) is deprecated, please useHalfedges.GetFaceCirculator(int) instead.
Traverses the halfedge indices which bound a face.
Parameters:
| f (int) | A face index. |
Returns: An enumerable of halfedge indices incident to the specified face. Ordered anticlockwise around the face.
GetVertices
#obsoleteGetVertices is deprecated, please use GetFaceVertices instead.
Parameters:
| f (int) |
MergeFaces
#Merges the two faces incident to the specified halfedge pair.
SplitFace(int, int)Remarks: The invariant
mesh.Faces.MergeFaces(mesh.Faces.SplitFace(a, b)) will return a, leaving the mesh unchanged.Parameters:
| index (int) | The index of a halfedge inbetween the two faces to merge. The face adjacent to this halfedge will be retained. |
Returns: The successor of
index around the face, or -1 on failure.NakedEdgeCount
#Gets the number of naked edges which bound this face.
Parameters:
| f (int) | A face index. |
Returns: The number of halfedges for which the opposite halfedge has no face (i.e. adjacent face index is -1).
RemoveFace
#Removes a face from the mesh without affecting the remaining geometry.
Ensures that the topology of the halfedge mesh remains fully intact.
Parameters:
| index (int) | The index of the face to be removed. |
SplitFace
#Split a face into two faces by inserting a new edge
MergeFaces(int)Parameters:
| to (int) | The index of a second halfedge adjacent to the face to split. The new edge will end at the start of this halfedge. |
| from (int) | The index of a halfedge adjacent to the face to split. The new edge will begin at the start of this halfedge. |
Returns: The index of one of the newly created halfedges, or -1 on failure. The returned halfedge will be adjacent to the pre-existing face.
Stellate
#Divides an n-sided face into n triangles, adding a new vertex in the center of the face.
Parameters:
| f (int) | The index of the face to stellate |
Returns: The index of the central vertex