Core Mesh Data Structures in C++


PolygonMesh

The PolygonMesh data structure provides random access to vertices, edges and faces of a polygon mesh defined by a coord array and a coordIndex array, some of their incidence relations, and classifies the vertices and edges as sigular or regular, and boundary or internal.

 class PolygonMesh : public HalfEdges {
   public:
                 PolygonMesh(const int nV, vector<int>& coordIndex);
                ~PolygonMesh();
    int          getNumberOfFaces()                        const;
    int          getNumberOfEdgeFaces(const int iE)        const;
    int          getEdgeFace(const int iE, const int j)    const;
    bool         isEdgeFace(const int iE, const int iF)    const;
    bool         isBoundaryEdge(const int iE)              const;
    bool         isRegularEdge(const int iE)               const;
    bool         isSingularEdge(const int iE)              const;
    bool         isBoundaryVertex(const int iV)            const;
    bool         isInternalVertex(const int iE)            const;
    bool         isSingularVertex(const int iV)            const;
    bool         isRegular()                               const;
    bool         hasBoundary()                             const;
 }

The method getNumberOfEdgeFaces(iE) returns the number of faces incident to the edge associated with edge index iE. If the edge index is invalid this method returns 0. The constructor establishes an order for the faces incident to each edge.

The method getEdgeFace(iE,j) returns the index of the j-th face in the list of faces incident to the edge associated with the edge index iE. If either iE is an invalid edge index, or j is out of the range 0≤j<getNumberOfEdgeFaces(iE) then the method getEdgeFace(iE,j) returns the value -1

The method isEdgeFace(iE,iF) returns the value true if the face iF is incident to the edge iE, and otherwise it returns false.

An edge of a polygon mesh is a boundary edge if it only have one incident face, it is a regular edge if it has two incident faces, and it is a singular edge if it has three or more incident faces. The methods isBoundaryEdge(iE), isRegularEdge(iE), and isSingularEdge(iE) provide answers to these questions if the edge index iE is valid, and return the value false otherwise.

Every end of a boundary edge is a boundary vertex. The method isBoundaryVertex(iV) answers this question if the vertex index iV is in range. Otherwise it returns the value false.

Every end of a singular edge is a singular vertex, but not all singular vertices are ends of singular edges. Meshes may have singular vertices such that every edge which has the vertex as an end is either boundary or regular. The method isSingularVertex(iV) answers these questions if the vertex index iV is in range. Otherwise it returns the value false.

A polygon mesh is regular if all its vertices and edges are regular. The method isRegular() answers whether or not a polygon mesh is regular. A polygon mesh has boundary if it has one or more boundary edges. The method hasBoundary() answers whether or not a polygon mesh has boundary.

The dual graph of a polygon mesh is a graph which has the faces of the mesh as dual vertices, and for each regular edge of the polygon mesh, the dual graph has a dual edge connecting the two faces incident to the regular edge. The method makeDualGraph() creates the dual graph of the current polygon mesh.

Next : Queue


Core Mesh | Faces | Edges | Graph | HalfEdges | Partition | PolygonMesh | Queue