Skip to content

Class Argos::TopologicMesh

ClassList > Argos > TopologicMesh

Topologically-aware mesh representation. More...

  • #include <TopologicMesh.h>

Public Functions

Type Name
TopologicMesh (std::vector< Vector3D< double > > vertices, std::vector< Face > faces)
Construct a TopologicMesh from raw vertex/face data.
TopologicMesh (const Mesh & other)
Construct a TopologicMesh from an existingMesh .
size_t edgeCount () const
Number of unique edges.
size_t edgeFaceCount (size_t edgeIndex)
Get the number of faces incident to an edge.
size_t faceCount () const
Number of faces.
std::vector< HoleInfo > findAllHoles () const
Find all topological holes (border-edge loops).
std::vector< int > getAdjacentEdges (size_t edgeIndex) const
Get the indices of edges adjacent to a given edge.
std::vector< int > getAllBorderEdges () const
Get indices of all border edges.
EdgeInfo getEdge (size_t edgeIndex) const
Get a human-readable edge descriptor.
FaceInfo getFace (size_t faceIndex) const
Get a human-readable face descriptor.
Vector3D< double > getVertex (size_t index) const
Get a vertex position by index.
const std::vector< Vector3D< double > > & getVertices () const
Const access to all deduplicated vertex positions.
bool isBorder (size_t edgeIndex) const
Check whether an edge is a border edge.
TopologicMesh & operator= (const Mesh & other)
Assign from a Mesh .
size_t vertexCount () const
Number of unique vertices.

Detailed Description

Builds a deduplicated, indexed topological structure from a raw Mesh: * Deduplicates vertices within a threshold and remaps indices. * Extracts unique edges and their adjacency relationships. * Counts faces per edge to identify border edges. * Discovers holes by crawling border-edge loops.

Internal storage layout

Vertices — unique coordinates (vertices).

Edges — stored as a flat pair list so that edge[i] = [edge_vertex_pairs[2*i], edge_vertex_pairs[2*i+1]].

Faces — stored as a flat edge-index list with an offset vector so that face[i] edges are at indices [face_edge_indices[offset[i]] .. face_edge_indices[offset[i+1]-1]].

Adjacency — edge neighbours are stored contiguously: neighbours of edge i = edge_neighbor_edges[edge_neighbor_offsets[i] .. edge_neighbor_offsets[i+1]-1].

Public Functions Documentation

function TopologicMesh [1/2]

Construct a TopologicMesh from raw vertex/face data.

Argos::TopologicMesh::TopologicMesh (
    std::vector< Vector3D < double > > vertices,
    std::vector< Face > faces
) 

Parameters:

  • vertices Input vertex positions (may contain duplicates).
  • faces Input polygonal faces.

function TopologicMesh [2/2]

Construct a TopologicMesh from an existingMesh .

Argos::TopologicMesh::TopologicMesh (
    const  Mesh & other
) 

Parameters:

  • other The source Mesh to analyse topologically.

function edgeCount

Number of unique edges.

size_t Argos::TopologicMesh::edgeCount () const


function edgeFaceCount

Get the number of faces incident to an edge.

size_t Argos::TopologicMesh::edgeFaceCount (
    size_t edgeIndex
) 

Parameters:

  • edgeIndex Index of the edge.

Returns:

Face count (1 = border, 2 = interior, >2 = non-manifold).


function faceCount

Number of faces.

size_t Argos::TopologicMesh::faceCount () const


function findAllHoles

Find all topological holes (border-edge loops).

std::vector< HoleInfo > Argos::TopologicMesh::findAllHoles () const


function getAdjacentEdges

Get the indices of edges adjacent to a given edge.

std::vector< int > Argos::TopologicMesh::getAdjacentEdges (
    size_t edgeIndex
) const

Parameters:

  • edgeIndex Index of the edge.

Returns:

Vector of adjacent edge indices.


function getAllBorderEdges

Get indices of all border edges.

std::vector< int > Argos::TopologicMesh::getAllBorderEdges () const


function getEdge

Get a human-readable edge descriptor.

EdgeInfo Argos::TopologicMesh::getEdge (
    size_t edgeIndex
) const

Parameters:

  • edgeIndex Index of the edge.

Returns:

EdgeInfo containing the two endpoint vertex indices.


function getFace

Get a human-readable face descriptor.

FaceInfo Argos::TopologicMesh::getFace (
    size_t faceIndex
) const

Parameters:

  • faceIndex Index of the face.

Returns:

FaceInfo containing the edges of the face.


function getVertex

Get a vertex position by index.

Vector3D < double > Argos::TopologicMesh::getVertex (
    size_t index
) const

Parameters:

Returns:

The 3D position.


function getVertices

Const access to all deduplicated vertex positions.

const std::vector< Vector3D < double > > & Argos::TopologicMesh::getVertices () const


function isBorder

Check whether an edge is a border edge.

bool Argos::TopologicMesh::isBorder (
    size_t edgeIndex
) const

Parameters:

  • edgeIndex Index of the edge.

Returns:

true if the edge has only one incident face.


function operator=

Assign from a Mesh .

TopologicMesh & Argos::TopologicMesh::operator= (
    const  Mesh & other
) 

Parameters:

  • other Source mesh.

Returns:

Reference to this TopologicMesh.


function vertexCount

Number of unique vertices.

size_t Argos::TopologicMesh::vertexCount () const



The documentation for this class was generated from the following file include/mesh/TopologicMesh.h