-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
Fix for infinite loop in Build2DFaces::_find_edge_intersections #76520
Conversation
modules/csg/csg.cpp
Outdated
@@ -1079,14 +1081,30 @@ void CSGBrushOperation::Build2DFaces::_find_edge_intersections(const Vector2 p_s | |||
|
|||
// Check each edge. | |||
for (int face_edge_idx = 0; face_edge_idx < 3; ++face_edge_idx) { | |||
Vector2 edge_points[2] = { | |||
Vector<Vector2> edge_points_and_uvs = { |
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.
Try LocalVector
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.
LocalVector doesn't work here as the .find(), both for LocalVector (core/templates/local_vector.h(251)) and std Vector, don't seem able to parse LocalVector as a type for equality checking:
error C2678: binary '==': no operator found which takes a left-hand operand of type 'const T' (or there is no acceptable conversion)
with
[
T=LocalVector<Vector2,uint32_t,false,false>
]
I'm a little over my head here trying to parse what would need to change for this to be allowed.
Also read our PR guidelines. https://docs.godotengine.org/en/stable/contributing/workflow/pr_workflow.html As far as I can tell you need to git squash and address comments. |
Thanks, will do. |
ed535f0
to
bf66a10
Compare
Removes documentation generation (docgen) from the GDScript compiler to its own file. Adds support for GDScript enums and signal parameters and quite a few other assorted fixes and improvements.
bf66a10
to
0b88e7f
Compare
I've well and truly destroyed this PR trying to squash it :( Remaking according to the PR Guidelines. Sorry about that. |
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
Also this is my first time touching both the Godot source and C++ so uh... don't hold back :D