Open kunitsyn opened 2 years ago
Thanks for reporting this, I'll see what I can do. In general I have a lot of problems with floating point precision for which there seems to be no simple solution. Usually I solve specific cases by tweaking the various epsilon values, but often this just breaks something else.
First of all, thank you for the library, it's awesome. I understand it's in development, and I believe it would benefit from another test case. The following code yields non-optimal results, on the current master branch:
Mesh R will look like this (with A shown in wireframe):
There is a hole on top, and a lone polygon (behind) not having any volume.
Here, it's not really important what B is, it looks like most CSG operations with A will have problems like these. As fair as I understand, A is watertight and otherwise "legal" to use with CSG operations.
I took some time to look into this, and it seems to me that the problem occurs during building BSP of mesh A, where the polygon with vertex positions
is marked as spanning with regard to another polygon's plane that's equal to
normal = (x = 0.52861031077292353, y = 0, z = -0.84886461779517774) w = 1.2299564728393015
, where it's probably should have been marked as a back polygon. However, I don't know exactly how to solve this problem.