Fix infinite loop in CSG Build2DFaces::_find_edge_intersections
#76521
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Remaking this PR since I destroyed the last one doing git things... Sorry!
This PR solves issue #73927 in which _find_edge_intersections could loop infinitely while creating new faces from edge intersections by keeping track of which edges we have already processed and skipping edges with the same points and uvs that come up in subsequent loops.
Had some concern about the glitchy faces that appear in subtract mode, but that appears to also occur in the most recent master post- #74771 so I'm not sure they really need to be covered in this fix, or if its even related.
This branch working:
https://user-images.githubusercontent.com/6236852/234983317-df6c0734-25f3-4790-80c6-24844062dde8.mp4
Most recent Master branch crashing, also exhibiting similar geometry wonkiness:
https://user-images.githubusercontent.com/6236852/234984769-620a2f24-968e-4a08-9a56-f4cc383c6d27.mp4
This also includes the suggested edit of using LocalVector instead of Vector to hold the processed edges. More context here #76520 (comment)
Production edit: Fixes #73927