Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add intersection functions to Polygon, Line, Circle #169

Open
1 of 3 tasks
itzpr3d4t0r opened this issue Jan 11, 2023 · 0 comments
Open
1 of 3 tasks

Add intersection functions to Polygon, Line, Circle #169

itzpr3d4t0r opened this issue Jan 11, 2023 · 0 comments

Comments

@itzpr3d4t0r
Copy link
Member

itzpr3d4t0r commented Jan 11, 2023

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:

  • 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 itzpr3d4t0r converted this from a draft issue Jan 11, 2023
@itzpr3d4t0r itzpr3d4t0r moved this from Todo: General to In Progress in pygame.geometry Jan 12, 2023
@itzpr3d4t0r itzpr3d4t0r moved this from In Progress to Todo: General in pygame.geometry Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant