-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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 multiple issues with CSG module. #36422
Conversation
that is impressive |
- Replaces BuildPoly with Build2DFaces, which creates faces as each pair of face intersections are processed, instead of trying to create them after all the intersections are processed. Ensures that faces are merged when possible, and removes degenerate triangles. - Treats the child as inside the parent when faces are coplanar. - General clean up of csg.h and csg.cpp.
Thanks a lot for working on this 🙂 Correctness is important to have, but is performance as good or better than the current implementation? |
@Calinou Do you have a benchmark we can test it against? |
@madmiraal I made one: test_csg.zip It may not be representative of a real-world use case, but it's a start. Try moving the CSGSphere node called "MoveMe" and see how fast the editor reacts (compare the current |
@Calinou I've tested it against your scene (and many of my own scenes during debugging) and the subjective experience is the same. |
In the absence of an existing benchmark, I've created the attached scene to push the CSG calculations beyond what they're designed for: It consists of a On my laptop I get the following frame times: So the fixed version is marginally slower, but I wouldn't say significantly so. |
@madmiraal Sounds good to me 🙂 In the future, we could add a debouncing delay to CSG mesh rebuilds to make the editor more responsive. |
Thanks! |
Replaces BuildPoly with Build2DFaces, which creates faces as each pair of face intersections are processed, instead of trying to create them after all the intersections are processed. Ensures that faces are merged when possible, and removes degenerate triangles.
Treats the child as inside the parent when faces are coplanar.
Includes a general clean up of csg.h and csg.cpp.
Fixes #21125
Fixes #33117
Fixes #33121
Fixes #33665