-
Notifications
You must be signed in to change notification settings - Fork 111
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
bug fix on is_polygon_in_polygon_xy
#1130
Conversation
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.
thanks for identifying the problem and proposing a fix. could you add a test and include one or more boundary cases?
instead of -j-1 i would suggest: |
@worbit that is indeed much simpler and generates the same loop of edges :) |
also here some lint that makes the tests fail... |
Hello, Looking back at this polygon-in-polygon-fix i noticed it wasn't available yet. Is something missing ? And, my personal curiosity, wondering about the '[Merge branch 'main' into polygon-in-polygon-fix]' thing, is it part of the process before merging back a fix to the main ? I was about to submit a bunch of new polygon predicates (intersection, containment) that would require polygon-in-polygon to work fine. Thanks ! |
Hello, @tomvanmele nope, as that fix was still open here, #1153 only contains new methods, but not that fix as well (i.e. is_polygon_in_polygon is wrong in #1153) |
@gonzalocasas this would also be one for LTS |
The is_polygon_in_polygon method was sometimes mistaking returning polygon2 was inside polygon1 while it wasn't. Issue occurs when edge intersection check is required inside is_polygon_in_polygon_xy to 'help decide'. Lines are first created, both for the contour polygon and the polygon to check on. Here is part of the code :
for j in range(len(polygon2)):
line = [polygon2[-j], polygon2[j - 1]]
should be [... , polygon2[-j - 1]] to accurately loop through all the edges of polygon2
What type of change is this?
Checklist
CHANGELOG.md
file in theUnreleased
section under the most fitting heading (e.g.Added
,Changed
,Removed
).invoke test
).invoke lint
).compas.datastructures.Mesh
.