diff --git a/dist/martinez.js b/dist/martinez.js index 66c143d..e434699 100644 --- a/dist/martinez.js +++ b/dist/martinez.js @@ -1483,6 +1483,8 @@ module.exports = function possibleIntersection(se1, se2, queue) { },{"./compare_events":4,"./divide_segment":8,"./edge_type":9,"./equals":10,"./segment_intersection":15}],15:[function(require,module,exports){ 'use strict'; +//var EPS = 1e-9; + /** * Finds the magnitude of the cross product of two vectors (if we pretend * they're in three dimensions) @@ -1561,7 +1563,7 @@ module.exports = function (a1, a2, b1, b2, noEndpointTouch) { // cross product is the 0 vector. The full calculation involves relative error // to account for possible very small line segments. See Schneider & Eberly // for details. - if (sqrKross > 0) { + if (sqrKross > 0/* EPS * sqrLenB * sqLenA */) { // If they're not parallel, then (because these are line segments) they // still might not actually intersect. This code checks that the // intersection point of the lines is actually on both line segments. @@ -1596,7 +1598,7 @@ module.exports = function (a1, a2, b1, b2, noEndpointTouch) { kross = crossProduct(e, va); sqrKross = kross * kross; - if (sqrKross > 0) { + if (sqrKross > 0 /* EPS * sqLenB * sqLenE */) { // Lines are just parallel, not the same. No overlap. return null; } diff --git a/package.json b/package.json index 77144b7..6c8f628 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "martinez-polygon-clipping", - "version": "0.3.3", + "version": "0.3.4", "description": "Martinez polygon clipping algorithm, does boolean operation on polygons (multipolygons, polygons with holes etc): intersection, union, difference, xor", "main": "dist/martinez.js", "types": "index.d.ts",