| 574 | } |
| 575 | |
| 576 | inline bool Path2ContainsPath1(OutPt* op1, OutPt* op2) |
| 577 | { |
| 578 | // this function accommodates rounding errors that |
| 579 | // can cause path micro intersections |
| 580 | PointInPolygonResult pip = PointInPolygonResult::IsOn; |
| 581 | OutPt* op = op1; |
| 582 | do { |
| 583 | switch (PointInOpPolygon(op->pt, op2)) |
| 584 | { |
| 585 | case PointInPolygonResult::IsOutside: |
| 586 | if (pip == PointInPolygonResult::IsOutside) return false; |
| 587 | pip = PointInPolygonResult::IsOutside; |
| 588 | break; |
| 589 | case PointInPolygonResult::IsInside: |
| 590 | if (pip == PointInPolygonResult::IsInside) return true; |
| 591 | pip = PointInPolygonResult::IsInside; |
| 592 | break; |
| 593 | default: break; |
| 594 | } |
| 595 | op = op->next; |
| 596 | } while (op != op1); |
| 597 | // result unclear, so try again using cleaned paths |
| 598 | return Path2ContainsPath1(GetCleanPath(op1), GetCleanPath(op2)); // (#973) |
| 599 | } |
| 600 | |
| 601 | void AddLocMin(LocalMinimaList& list, |
| 602 | Vertex& vert, PathType polytype, bool is_open) |
no test coverage detected