-
-
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
Odd triangle holes will appear in CSG subtraction #22988
Comments
I have a very similar issue but with cubes. As you can see from the gif, I used 3 cubes:
Depending on the position of the door it shows or not the artifacts. |
I get a lot of artifacts when I try to subtract one aggregate union from another in this project: Edit: Oops. Messed up archiving the project. Recreated one with similar problems. (Using 89f8b84) |
Here are the results of a debugging session using the sandbox project 😅 In the sandbox project I see 3 holes and get exactly 3 failed polygon triangulations. One example:
When putting the values into some online delaunay triangulation demo, I get a working triangulation. Just use javascript console and put in the following:
which should result in the following: So my current assumption is that either our triangulation is faulty or not tolerant enough since other implementation seem to be able to triangulate the polygon just fine? |
After some more debugging and tinkering with the source code: The failed polygons do not seem to be the ones belonging to the holes / missing triangles :( I added delaunay triangulation to CSG in case polygon triangulation fails and the resulting triangles seem to belong to the shape(s) that are being subtracted with: So I suspect it really is the CSG algorithm itself that is having trouble finding and closing all holes. Polygon triangulation seems fine and the invalid polygons should indeed not be triangulated. |
Just a wild guess, but.. could it be that some vertices/edges/faces are assigned wrongly, thus creating the bad polygons and holes at once? |
I found a way to fix the holes in the example by @fire. Please retest your csg shapes. If you can please upload small example projects. Screenshots are pretty hard to debug. |
@ptrojahn There's a new approximate equal function that scales epsilon. It may be useful. |
Line 290 in 45be9c6
|
The issue opener seems to have done that: If you want more I can provide mine. |
Related to godotengine#22988 (Fixes the holes in the shape of the first comment)
My original test case is solved. Please open a new issue if you have other test cases. |
Related to godotengine#22988 (Fixes the holes in the shape of the first comment)
Similiar Issues:
#18476
Godot version:
43c2868
OS/device including version:
Nvidia GTX 1080 on Windows 10
Issue description:
Steps to reproduce:
Create CSG nodes consisting of a plane of sufficient size and then use a cylinder to subtract. Odd triangle holes will appear.
Minimal reproduction project:
epoch_packet_hidden_node.zip
The text was updated successfully, but these errors were encountered: