-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Vectorio intersects() #9483
Vectorio intersects() #9483
Conversation
I do prefer |
the latest commits have renamed the function to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed intersecting
to intersects
: I think that's what you wanted?
Co-authored-by: Dan Halbert <[email protected]>
Yes, thank you! The recent commits have changed everything over to intersects. I've also added the function implementation on the Circle class now. I performed minimal testing only so far, with an updated version of the script above to switch around which shapes are tested, and tested against. |
The addition of It appears the docs build failed too, but it may have been an intermittent issue with the network in the container, or the server that hosts the svg file that dogs build attempts to fetch. I found these warnings in the action log:
|
These failures are not due to overflow, I believe, but instead are multiple GitHub actions network issues. See https://github.com/adafruit/circuitpython/actions/runs/10277146885. I think you should revert f11cd0c and try again. |
I'm curious about how to tell the difference between those types of actions failures? I noticed after the latest commit reverting those disables it seems to have skipped building the ports so it didn't re-attempt any of the builds from last time that didn't succeed. In the actions log from the prior attempt where failures were reported, I found a few of them with errors like this: https://github.com/adafruit/circuitpython/actions/runs/10277146885/job/28438883955#step:10:1361 and 20 lines down from here at line 1381 it shows the negative space readout:
Are those builds failing like a knock-on effect that occurred down the line afterward, but due to the network issue? |
It is a mix of actual storage overflows and transient CI failures. The C3 failures look like actual overflow. The It's worth considering whether to turn something else off to make things fit on the C3 builds, especially those with displays. For instance, the OHS2020 is a badge with a display, so I'd prioritize |
Ahhh I see the logs for the transient ones now. Thank you. I was confused and only seeing a few of them before. And that does make sense to me as well to leave vectorio enabled for devices that have a built-in display. |
Maybe it would make sense to move this out of vectorio, or at least out of the Rectangle and Circle classes. If they were separated from those it would mean we could have a single With the current implementation on Rectangle and Circle we basically end up having mostly duplicated copies of these functions because there is one circle compared to rectange, and one rectangle compared to circle. If Polygon were to end up getting similar functionality it would mean then essentially 3 copies of each function if all permutations were supported. I'm not sure where would be the best place to move it to if it does get moved. Maybe still inside vectorio, but just as module functions instead of functions on each class would make sense? |
# Conflicts: # ports/atmel-samd/boards/mini_sam_m4/mpconfigboard.mk
Converting to draft for now. The latest commit has started refactoring these to be module functions instead of class functions on Circle and Rectangle, that will ultimately lead to de-duplication of this logic. As of now only the new implementations are added, the old class functions are not removed yet. Once I do remove them and any other requisite changes I'll mark this ready. |
closing this in favor or #9753 |
This change is an initial working implementation of collision detection for vectorio. Specifically it supports Circle and Rectangle only right now, and currently the
is_colliding()
function has been added to Rectangle only but it accepts either another Rectangle or a Circle to test against. But my intention would be to also this function to the Circle as well so that the test can be done either way.I wanted to open this up to get feedback before I went further adding it to Circle though, mainly on the following points:
is_colliding()
? That was the first name that came to mind for me when I started writing it, but now that it's implemented I am thinking thatoverlaps()
might be a better function name for it because I believe the implementation is technically testing for at least 1 pixel of overlap, not just two adjacent pixels "colliding".other_shape
? Theoretically it should be able to test against Tilegrid also to allow for testing images against vectorio shapes.I tested this on a Pygamer with this code: