HarryStevens / geometric

A JavaScript library for doing geometry.
https://www.npmjs.com/package/geometric
MIT License
980 stars 49 forks source link

polygonIntersectsPolygon() returns false if overlapping rectangles share two edges #1

Closed HarryStevens closed 5 years ago

HarryStevens commented 5 years ago
var a = [
  [562.6875, 304.4375],
  [601.09375, 304.4375],
  [601.09375, 322.9375],
  [562.6875, 322.9375]
];

var b = [
  [562.6875, 298.4375],
  [601.09375, 298.4375],
  [601.09375, 316.9375],
  [562.6875, 316.9375],
];

geometric.polygonIntersectsPolygon(a, b); // false but should be true