MCPcopy Create free account
hub / github.com/microsoft/SandDance / filterPoints

Function filterPoints

docs/tests/v2/es6/js/sanddance.js:69375–69396  ·  view source on GitHub ↗
(start, end)

Source from the content-addressed store, hash-verified

69373
69374// eliminate colinear or duplicate points
69375function filterPoints(start, end) {
69376 if (!start) return start;
69377 if (!end) end = start;
69378
69379 var p = start,
69380 again;
69381 do {
69382 again = false;
69383
69384 if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {
69385 removeNode(p);
69386 p = end = p.prev;
69387 if (p === p.next) break;
69388 again = true;
69389
69390 } else {
69391 p = p.next;
69392 }
69393 } while (again || p !== end);
69394
69395 return end;
69396}
69397
69398// main ear slicing loop which triangulates a polygon (given as a linked list)
69399function earcutLinked(ear, triangles, dim, minX, minY, invSize, pass) {

Callers 5

earcutLinkedFunction · 0.70
cureLocalIntersectionsFunction · 0.70
splitEarcutFunction · 0.70
eliminateHolesFunction · 0.70
eliminateHoleFunction · 0.70

Calls 3

equalsFunction · 0.70
areaFunction · 0.70
removeNodeFunction · 0.70

Tested by

no test coverage detected