Hi!
I've two rectangles that are overlapping only a tiny bit. However, as a result I'm getting back the polygon2.
import { polygon, BooleanOperations } from '@flatten-js/core';
const { intersect } = BooleanOperations;
const coords1 = [
{ x: -268, y: -334.18 },
{ x: -1768, y: -334.18 },
{ x: -1768, y: -686.18 },
{ x: -268, y: -686.18 },
];
const coords2 = [
{ x: -968, y: -334.17999999999995 },
{ x: -868, y: -334.17999999999995 },
{ x: -868, y: -234.17999999999995 },
{ x: -968, y: -234.17999999999995 },
];
const poly1 = polygon(coords1.map(p => [p.x, p.y]));
const poly2 = polygon(coords2.map(p => [p.x, p.y]));
const intersection = intersect(poly1, poly2);
console.log(intersection.vertices);