pygame-geometry icon indicating copy to clipboard operation
pygame-geometry copied to clipboard

Add intersection functions to Polygon, Line, Circle

Open itzpr3d4t0r opened this issue 2 years ago • 0 comments

All shapes have bool collision functions that return True if they overlap with another shape, both of matching, unmatching and general (collideswith) type. We should implement similar intersection methods, but these will return:

  • An empty list if 0 (or infinite) intersections were found
  • A list of intersection points if 1 or more intersections were found

The methods would be the following:

  • [x] Circle intersect()
  • [ ] Line intersect()
  • [ ] Polygon intersect()

I'm able to start this series of PRs by adding the base intersection functions ( that will be different to the ones we have now) as well as some of these complete implementations right away, just to kickstart it all.

itzpr3d4t0r avatar Jan 11 '23 20:01 itzpr3d4t0r