MCPcopy Index your code
hub / github.com/microsoft/SandDance / isEar

Function isEar

docs/app/js/sanddance-app.js:101793–101804  ·  view source on GitHub ↗
(ear)

Source from the content-addressed store, hash-verified

101791 }
101792}
101793function isEar(ear) {
101794 const a = ear.prev;
101795 const b = ear;
101796 const c = ear.next;
101797 if (area(a, b, c) >= 0) return false;
101798 let p = ear.next.next;
101799 while(p !== ear.prev){
101800 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;
101801 p = p.next;
101802 }
101803 return true;
101804}
101805function isEarHashed(ear, minX, minY, invSize) {
101806 const a = ear.prev;
101807 const b = ear;

Callers 1

earcutLinkedFunction · 0.70

Calls 2

areaFunction · 0.70
pointInTriangleFunction · 0.70

Tested by

no test coverage detected