(ear)
| 1749 | |
| 1750 | // check whether a polygon node forms a valid ear with adjacent nodes |
| 1751 | function isEar(ear) { |
| 1752 | var a = ear.prev, |
| 1753 | b = ear, |
| 1754 | c = ear.next; |
| 1755 | |
| 1756 | if (area(a, b, c) >= 0) return false; // reflex, can't be an ear |
| 1757 | |
| 1758 | // now make sure we don't have other points inside the potential ear |
| 1759 | var p = ear.next.next; |
| 1760 | |
| 1761 | while (p !== ear.prev) { |
| 1762 | if (pointInTriangle(a.x, a.y, b.x, b.y, c.x, c.y, p.x, p.y) && area(p.prev, p, p.next) >= 0) return false; |
| 1763 | p = p.next; |
| 1764 | } |
| 1765 | |
| 1766 | return true; |
| 1767 | } |
| 1768 | |
| 1769 | function isEarHashed(ear, minX, minY, size) { |
| 1770 | var a = ear.prev, |
no test coverage detected