findResultEdges method

void findResultEdges()

Find all edges whose depths indicates that they are in the result area(s). Since we want polygon shells to be oriented CW, choose dirEdges with the interior of the result on the RHS. Mark them as being in the result. Interior Area edges are the result of dimensional collapses. They do not form part of the result area boundary.

Implementation

void findResultEdges() {
  for (DirectedEdge de in dirEdgeList) {
    /**
     * Select edges which have an interior depth on the RHS
     * and an exterior depth on the LHS.
     * Note that because of weird rounding effects there may be
     * edges which have negative depths!  Negative depths
     * count as "outside".
     */
    // <FIX> - handle negative depths
    if (de.getDepth(Position.RIGHT) >= 1 &&
        de.getDepth(Position.LEFT) <= 0 &&
        !de.isInteriorAreaEdge()) {
      de.setInResult(true);
//Debug.print("in result "); Debug.println(de);
    }
  }
}