Closed codand closed 10 months ago
Interesting - I'm also seeing that "intersectionEdges" is reporting some odd extraneous edges:
Can you please produce a simpler example that just includes the two geometries and the clipping operation and the wireframe?
isWaterTight reports true for this mesh,
Also note that is water tight is not documented and not currently fully functional.
Can you please produce a simpler example that just includes the two geometries and the clipping operation and the wireframe?
I fixed #183 in v0.0.15 which seemed to be related but it does not seem to have fixed this issue. Are you seeing this same kind of issue with any simpler models? Ideally generated models from the three.js primitives?
I've not yet seen it happen from a single subtraction between two threejs primitives, but I have seen it happen after multiple consecutive subtractions. I'll see if I can produce a simpler example on the latest update this week. Thank you for investigating!
It looks this this is happening as part of the "full triangle" accumulation step - ie the step where unclipped triangles are appended to the result.
These edges look like they intersect the the clip volume but the intersection detection skips triangles marked as "degenerate". It seems they're inadvertently being added to the result geometry elsewhere, instead.
They're gone if we filter triangles with area === 0 when building the result geometry:
These degenerate triangles are in the original model, as well - 563 of them. I guess these will have to be filtered out during the clip process. I'll just have to think abut the right place to do it.
I still want to check out the "intersection edges" issue listed above, though.
Looks like the eges issue can't be easily reproduced at the moment - we can track it down when it arrises another time:
Subtracting a box (or any shape) from a 3DBenchy (popular 3D print) produces a geometry with several incorrect edges contained in the subtraction area. These are only visible when rendering the result wireframe.
Repro: Open this codesandbox link (adapted from the Simple CSG example) and set brush 1's shape to "mesh".
Additional info:
isWaterTight reports true for this mesh,
Blender's 3D print checker also reports zero non-manifold edges.
Hope this report might help figure out some edge cases.