Interface IMesh<TPosition>
Abstract class for a polyhedral mesh data structure.
Namespace: BRIDGES.DataStructures.PolyhedralMeshes
Assembly: BRIDGES.dll
Syntax
public interface IMesh<TPosition>
where TPosition : IEquatable<TPosition>
Type Parameters
Name | Description |
---|---|
TPosition | Type of the vertex position. |
Properties
| Improve this Doc View SourceEdgeCount
Gets the number of edges in the current mesh.
Declaration
int EdgeCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
FaceCount
Gets the number of faces in the current mesh.
Declaration
int FaceCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
VertexCount
Gets the number of vertices in the current mesh.
Declaration
int VertexCount { get; }
Property Value
Type | Description |
---|---|
Int32 |
Methods
| Improve this Doc View SourceAddEdge(Int32, Int32)
Adds a new edge to the current mesh.
Declaration
IEdge<TPosition> AddEdge(int startIndex, int endIndex)
Parameters
Type | Name | Description |
---|---|---|
Int32 | startIndex | Index of the start vertex for the new edge. |
Int32 | endIndex | Index of the end vertex for the new edge. |
Returns
Type | Description |
---|---|
IEdge<TPosition> | The new edge if it was added, null otherwise. |
AddFace(List<Int32>)
Adds a new face to the current mesh.
Declaration
IFace<TPosition> AddFace(List<int> indices)
Parameters
Type | Name | Description |
---|---|---|
List<Int32> | indices | Ordered list of the face's vertex indices. |
Returns
Type | Description |
---|---|
IFace<TPosition> | The newly created face. |
AddFace(Int32, Int32, Int32, Int32)
Adds a new quadrangular face to the current mesh.
Declaration
IFace<TPosition> AddFace(int indexA, int indexB, int indexC, int indexD)
Parameters
Type | Name | Description |
---|---|---|
Int32 | indexA | Index of the first vertex for the new face. |
Int32 | indexB | Index of the second vertex for the new face. |
Int32 | indexC | Index of the third vertex for the new face. |
Int32 | indexD | Index of the fourth vertex for the new face. |
Returns
Type | Description |
---|---|
IFace<TPosition> | The newly created quadrangular face. |
AddFace(Int32, Int32, Int32)
Adds a new triangular face to the current mesh.
Declaration
IFace<TPosition> AddFace(int indexA, int indexB, int indexC)
Parameters
Type | Name | Description |
---|---|---|
Int32 | indexA | Index of the first vertex for the new face. |
Int32 | indexB | Index of the second vertex for the new face. |
Int32 | indexC | Index of the third vertex for the new face. |
Returns
Type | Description |
---|---|
IFace<TPosition> | The newly created triangular face. |
AddVertex(TPosition)
Adds a vertex in the mesh.
Declaration
IVertex<TPosition> AddVertex(TPosition position)
Parameters
Type | Name | Description |
---|---|---|
TPosition | position | Position of the vertex. |
Returns
Type | Description |
---|---|
IVertex<TPosition> | The new vertex if it was added, null otherwise. |
CleanMesh(Boolean)
Cleans the current mesh by reindexing the faces, edges and vertices.
Declaration
void CleanMesh(bool cullIsolated = true)
Parameters
Type | Name | Description |
---|---|---|
Boolean | cullIsolated | Evaluates whether isolated members should be removed in the process. |
EdgeBetween(Int32, Int32)
Looks for the edge between two vertices.
Declaration
IEdge<TPosition> EdgeBetween(int indexA, int indexB)
Parameters
Type | Name | Description |
---|---|---|
Int32 | indexA | Index of the first end vertex of the edge. |
Int32 | indexB | Index of the second end vertex of the edge. |
Returns
Type | Description |
---|---|
IEdge<TPosition> | The edge if it exists, null otherwise. |
EraseEdge(Int32)
Erases the edge at the given index in the mesh. The mesh may be non-manifold after this operation.
Declaration
void EraseEdge(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of the edge to erase. |
EraseFace(Int32)
Erases the face at the given index in the mesh. The mesh may be non-manifold after this operation.
Declaration
void EraseFace(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of the face to erase. |
EraseVertex(Int32)
Erases the vertex at the given index in the mesh. Every reference to this vertex should be deleted before it is erased.
Declaration
void EraseVertex(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of the vertex to erase. |
GetEdge(Int32)
Returns the edge at the given index in the mesh.
Declaration
IEdge<TPosition> GetEdge(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index |
Returns
Type | Description |
---|---|
IEdge<TPosition> | The edge at the given index in the mesh. |
GetEdges()
Returns the list of edges of the current mesh.
Declaration
IReadOnlyList<IEdge<TPosition>> GetEdges()
Returns
Type | Description |
---|---|
IReadOnlyList<IEdge<TPosition>> | List of edges of the mesh. |
Remarks
If some edges were removed from the mesh, the index of the edge in the returned list might not match the edge index in the mesh.
The index of the edges in the mesh is accessible through Index.
GetFace(Int32)
Returns the face at the given index in the mesh.
Declaration
IFace<TPosition> GetFace(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index |
Returns
Type | Description |
---|---|
IFace<TPosition> | The face at the given index in the mesh. |
GetFaces()
Returns the list of faces of the current mesh.
Declaration
IReadOnlyList<IFace<TPosition>> GetFaces()
Returns
Type | Description |
---|---|
IReadOnlyList<IFace<TPosition>> | List of faces of the mesh. |
Remarks
If some faces were removed from the mesh, the index of the face in the returned list might not match the face index in the mesh.
The index of the faces in the mesh is accessible through Index.
GetVertex(Int32)
Returns the vertex at the given index in the mesh.
Declaration
IVertex<TPosition> GetVertex(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index |
Returns
Type | Description |
---|---|
IVertex<TPosition> | The vertex at the given index in the mesh. |
GetVertices()
Returns the list of vertices of the current mesh.
Declaration
IReadOnlyList<IVertex<TPosition>> GetVertices()
Returns
Type | Description |
---|---|
IReadOnlyList<IVertex<TPosition>> | List of vertices of the mesh. |
Remarks
If some vertices were removed from the mesh, the index of the vertex in the returned list might not match the vertex index in the mesh.
The index of the vertices in the mesh is accessible through Index.
RemoveEdge(Int32)
Removes the edge at the given index in the mesh by keeping the mesh manifold.
Declaration
void RemoveEdge(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of the edge to remove. |
RemoveFace(Int32)
Removes the face at the given index in the mesh by keeping the mesh manifold.
Declaration
void RemoveFace(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of the face to remove. |
RemoveVertex(Int32)
Removes the vertex at the given index in the mesh by keeping the mesh manifold.
Declaration
void RemoveVertex(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | Index of the vertex to remove. |
TryGetEdge(Int32)
Returns the edge at the given index in the mesh if it exists, null otherwise.
Declaration
IEdge<TPosition> TryGetEdge(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of the edge to look for. |
Returns
Type | Description |
---|---|
IEdge<TPosition> | The edge if it exists, null otherwise. |
TryGetFace(Int32)
Returns the face at the given index in the mesh if it exists, null otherwise.
Declaration
IFace<TPosition> TryGetFace(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of the face to look for. |
Returns
Type | Description |
---|---|
IFace<TPosition> | The face if it exists, null otherwise. |
TryGetVertex(Int32)
Returns the vertex at the given index in the mesh if it exists, null otherwise.
Declaration
IVertex<TPosition> TryGetVertex(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of the vertex to look for. |
Returns
Type | Description |
---|---|
IVertex<TPosition> | The vertex if it exists, null otherwise. |