euclid.js icon indicating copy to clipboard operation
euclid.js copied to clipboard

Incorrect intersections when intersecting vertices

Open accounts01 opened this issue 2 years ago • 1 comments

The following produces no intersections but seems like it should:

intersections(
    new Circle( new Point(2, 3), 1),
    new Polygon( new Point(2, 3), new Point(3, 3), new Point(3, 4), new Point(2, 4) 
);

Intersections should be reported at 3, 3 and 2, 4. It seems that when the intersections occur at the polygon's vertices, they are not reported. Is this a bug or have I misunderstood how to use intersections? Thanks!

accounts01 avatar Jun 20 '23 13:06 accounts01

The Polygon.collision function appears to be marred by the same sort of issue. Collisions are not reported if the smaller polygon's vertices are along the larger polygon's edges.

accounts01 avatar Jun 21 '23 05:06 accounts01