-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Orphaned Triangles After Operation #183
Comments
Thanks for the details!
It would be useful to add a simple scene with a bounding box to inspect the issue more easily. |
Ok I retooled the example with a scene and a bounding box: https://codepen.io/jakedluhy/pen/YzBJgPp?editors=0010 Unfortunately the zoom/dolly isn't working for the controls (I think because there's a multiple versions of THREE.js issue due to weird Codepen imports). Let me know if you need anything else! |
It looks like this has been happening all the way back to v0.0.3 (didn't check earlier versions) with the SUBTRACTION operation. However with the ADDITION operation this only started happening in v0.0.12. The extra points were not present in v0.0.11. |
It looks like this is occurring because the provided geometry contains degenerate triangles with an area of 0, 0, 0 causing the barycoordinate calculations to be incorrect. I think by some measures this may be at odds with the idea that a geometry needs to be watertight / two-manifold but this shouldn't be too big of an issue to handle. |
Thanks so much for jumping on this! |
I believe this may be related to #182, as it may explain the larger bounding box. I am exploring using
three-bvh-csg
with React and have built up a scene where I extrude a shape and then cut off the bottom (don't get me started on extrude geometry not having a single side option). It looks great:I also want to export to an STL, however when I do that there are some weird things that show up. In short, when I add it to blender I am able to see the issue:
There are some orphaned triangles in a very weird way. It kind of looks like they're in the shape of a projection of the first object (extruded shape) onto the second one (a large box geometry underneath). Here's another example:
I created a minimal reproduction using just JS here: https://codepen.io/jakedluhy/pen/YzBJgPp. I didn't create an actual THREE scene, since the scene itself looks fine. Let me know if you would like me to add that.
EDIT: One more detail - all of those orphaned triangles all have the exact same point for the vertices
The text was updated successfully, but these errors were encountered: