buildEdgeMateIndices MethodStatic

Build the edgeMate index array into the polyface's PolyfaceData. After this method:

  • The array polyface.data.edgeMateIndex is defined with the same length as the other PolyfaceData index arrays.
  • For each interior edge, polyface.data.edgeIndexToEdgeMateIndex returns the edgeIndex on the other side of the edge in the adjacent facet.
  • The conditions for edgeMate matching are:
    • Given facetIndex f, let k0 = polyface.facetIndex0(f) and k1 = polyface.facetIndex1(f).
    • Every edgeIndex k in the face loop of facet f satisfies k0 <= k < k1.
    • The edge with edgeIndex k starts at the point with index polyface.data.pointIndex[k].
    • Let kA be an edgeIndex in this range [k0,k1), and let kB be its in-range successor with cyclic wrap, i.e., kB === (kA + 1 === k1) ? k0 : kA + 1.
    • Then polyface.data.pointIndex[kA] and polyface.data.pointIndex[kB] are the indices of the points at the start and end of an edge of that facet.
    • We call kA the edgeIndex for that edge, and kB the edgeIndex for the next edge around the facet.
    • If kA is an interior edge in a 2-manifold mesh with properly oriented facets, then there is an adjacent facet whose face loop contains edgeIndices kC and kD referencing the same edge vertices in reverse order, i.e.,
      • polyface.data.pointIndex[kA] === polyface.data.pointIndex[kD]
      • polyface.data.pointIndex[kB] === polyface.data.pointIndex[kC]
    • Given this relationship, we say that edgeIndices kA and kC are edge mates.
    • A non-interior edge either lies on the boundary of the mesh or is non-manifold (having more than two adjacent facets, or one with the wrong orientation). These edges have no edge mate.
  • These conditions define a conventional manifold mesh where each edge of a facet has at most one partner edge with opposite orientation in an adjacent facet.
  • After calling this method, the caller can construct IndexedPolyfaceWalker objects to traverse the mesh by walking across edges, around faces, and around vertices. Let walkerA have edgeIndex value kA. Then with the aforementioned edgeIndices:
    • walkerC = walkerA.edgeMate() moves across the edge to its other end, at kC.
    • walkerB = walkerA.nextAroundFacet() moves around the facet to the next edge, at kB.
    • walkerB.previousAroundFacet() moves from kB back to kA.
    • walkerD = walkerA.previousAroundVertex() moves around the vertex to the next edge kD.
    • walkerD1 = walkerC.nextAroundFacet() also moves to kD.
    • walkerD.nextAroundVertex() moves from kD back to kA.

buildEdgeMateIndices(polyface: IndexedPolyface): void

Parameter Type Description
polyface IndexedPolyface  

Returns - void

Defined in

Last Updated: 21 February, 2025