-
Notifications
You must be signed in to change notification settings - Fork 96
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
Properly handle negative volume meshes #745
Comments
@pca006132 After thinking about this for quite a while, I think it's going to be pretty difficult, algorithmically, to make negative objects work intuitively with Boolean operations. After all, they do work now (they're manifold), they're just surprising, as with overlapping manifolds. I think the better approach is to follow what we're already doing in 2D: make all Manifolds non-overlapping. Of course, I haven't yet made an algorithm to remove overlaps from a Manifold, but I plan to. When that happens, negative volume objects will also be removed, due to the positive fill rule. So I think our best stepping-stone for now is to detect and remove negative-volume meshes as a Manifold is constructed. This leaves the question of how to handle We could remove the vugs from the output, which might be confusing. We could invert them, so they become positive volume objects in their own right. Or we could just ignore all of this and put in the documentation that negative volume meshes are not epsilon-valid, so it's up to you to avoid them, just like self-intersecting meshes. What do you think? |
Agreed. I am more inclined towards subtracting the vugs from the output volumes (which is just composing them if they intersect?), this matches my intuition about how the objects are defined (the holes are part of the enclosing object) and how |
That's a good point, and IIRC our 2D decompose already acts that way. Sounds like a good approach. |
Btw, I'm thinking if we should just treat imported meshes with negative volumes as invalid meshes now. This seems to be a common issue that causes confusion to users: |
Yeah, probably. The only trouble is it's not trivial to set a threshold for negative volume. Maybe volume < surface area * tolerance? |
Yeah this makes sense |
Discussed in #693
Originally posted by pca006132 January 11, 2024
It would be intuitive for negative volume meshes to be basically equivalent to a union becoming a difference, but we need to figure out if this is compatible with Julian Smith's algorithm.
The text was updated successfully, but these errors were encountered: