MCPcopy Create free account
hub / github.com/SuperMap/iClient-JavaScript / filterPoints

Function filterPoints

libs/mapv/mapv.js:1674–1694  ·  view source on GitHub ↗
(start, end)

Source from the content-addressed store, hash-verified

1672
1673// eliminate colinear or duplicate points
1674function filterPoints(start, end) {
1675 if (!start) return start;
1676 if (!end) end = start;
1677
1678 var p = start,
1679 again;
1680 do {
1681 again = false;
1682
1683 if (!p.steiner && (equals(p, p.next) || area(p.prev, p, p.next) === 0)) {
1684 removeNode(p);
1685 p = end = p.prev;
1686 if (p === p.next) return null;
1687 again = true;
1688 } else {
1689 p = p.next;
1690 }
1691 } while (again || p !== end);
1692
1693 return end;
1694}
1695
1696// main ear slicing loop which triangulates a polygon (given as a linked list)
1697function earcutLinked(ear, triangles, dim, minX, minY, size, pass) {

Callers 4

earcutLinkedFunction · 0.85
splitEarcutFunction · 0.85
eliminateHolesFunction · 0.85
eliminateHoleFunction · 0.85

Calls 3

equalsFunction · 0.85
areaFunction · 0.85
removeNodeFunction · 0.85

Tested by

no test coverage detected