Csg
Csg copied to clipboard
Unexpected output in some cases.
I'm trying to subtract one mesh from another but it gives a unexpected output.
I have uploaded a zip file with 3 stl files in it. http://downloads.icore9.com/2019-07-04-09-44-50.zip
I'm running the nuget version 0.3.26.
The first mesh is a representation of a slab of a building, and the second mesh that represents a hole in the slab. The third is the slab - the hole.
The hole is generated correctly, but other parts of the slab are totally broken.
By the way, some faces of the hole and the slab seem to be coplanar, I don't know if this could cause the problem.
Any help would be appreciated.
By the way, I just tried scaling the hole by 1.01, so the faces aren't coplanar any more, but the problem still persists.
I am using this library in my project, but I have no such issue http://notecad.xyz/?filename=bool-test.xml You can see - objects is big - length is 54000. Even is this case operation performed successfully.
Could I know which version you are using? Is there some parameter/property/method that should be set before calling Substract?
https://github.com/NoteCAD/Csg https://github.com/NoteCAD/NoteCAD/blob/master/Assets/Code/DetailEditor/DetailEditor.cs#L247
Hi @Evil-Spirit it seems that your Csg fork is 4 commits ahead and 40 commits behind from the praeclarum's master branch. Did you fix any issue in your fork? Should I expect praeclarum's master branch to work the same way?
No, I haven't fix anything except performance and allocations. Also, I made minor features I need. Nothing about stability.
@falkartis I suppose, you can switch to commit before my changes on master and check how it works. If this will work, after you can use git bisect to find the commit that introduces this wrong behaviour.
Hi, I wasn't able to compile the project on ms visual studio 2019. But I tried to downgrade the version 0.3.24 and it seems to work fine. I don't know why it fails on version 0.3.26.
I don't get the expected result as well when subtracting a hole from a wall, see the attached zip file for the input and result stl files (result = wall.Subtract(hole)). It seems as though the hole is output as the final result. I've tried both version 0.3.24 and 0.3.26, but to no avail. Does anyone know how to fix this? Wall_and_hole.zip
@m1900 It seems like some faces of the hole are coplanar with some faces of the wall. This kind of setups usually cause some kind of trouble. If it's possible increase the size of the hole by a very small amount, just enough that the faces aren't coplanar any more.
I should have mentioned that I have indeed tried this with an increased hole (see screenshot) to circumvent the coplanar issue, but the outcome remained the same.

@m1900 In this case I don't know either what's causes the problem. I don't have that much experience in 3D geometry.
@falkartis thank you for trying to help me.