Core Mesh Data Structures in C++


HalfEdges


 class HalfEdges : public Edges {
  public:
           HalfEdges(const int nV, const vector& coordIndex);
   int     getNumberOfCorners()                       const;
   int     getFace(const int iC)                      const;
   int     getSrc(const int iC)                       const;
   int     getDst(const int iC)                       const;
   int     getNext(const int iC)                      const;
   int     getPrev(const int iC)                      const;
   int     getTwin(const int iC)                      const;
   int     getNumberOfEdgeHalfEdges(const int iE)     const;
   int     getEdgeHalfEdge(const int iE, const int j) const;
 }

The constructor converts to oriented manifold. Only consistently oriented half edges corresponding to regular mesh edges are made twins. All the other edges are made boundary half edges.

Half-edges are in one-to-one correspondence with the corners of a mesh, i.e., with the indices of the coordIndex array which do not correspond to face separators. However, to simplify further processing the method getNumberOfCorners() returns the number of elements of the coordIndex array.

The method getFace(iC) returns the index of the face containing the half edge corresponding to the corner index iC. If the corner index is out of range, or it corresponds to a face separator, this method returns -1;

If the corner index iC is in the range 0≤iC<coordIndex.size(), and if it does not correspond to a face separator (coordIndex[iC]≥0), then the methods getSrc(iC) and getDst(iC) return the two ends of a half edge. Otherwise they return -1;

The mesh faces define loops of half edges. The methods getNext(iC) and getPrev(iC) can be used to move back and forth along these loops.

A regular edge of a mesh has exactly two incident half-edges; if the half-edge associated with corner iC corresponds to a regular edge of the mesh, the method getTwin(iC) returns the other half edge. Otherwise it returns -1.

// int getNumberOfEdgeHalfEdges(const int iE) const; // if the edge index iE is in range, this method returns the number // of half edges incident to the given edge; otherwise it returns 0

If the edge index iE is in range, and 0≤j<getNumberOfEdgeHalfEdges(iE), the method getEdgeHalfEdge(iE,j) returns the j-th corner corresponding to a half edge incident to the given edge.

Next : PolygonEdge


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