gcherchi / InteractiveAndRobustMeshBooleans

MIT License
192 stars 32 forks source link

main.cpp crashing when using meshes other than included example meshes #20

Closed eparrott closed 1 year ago

eparrott commented 1 year ago

Hi, I've been attempting to use this code for some mesh boolean operations I'm working on and I've managed to successfully install the code and use the included examples. However, when I attempt to use meshes other than the included examples or apply the functions herein to other projects, the code crashes.

Specifically, I get a "Segmentation fault (core dumped)" error somewhere (it varies between executions) in the FOctree::build(uint max_depth, uint items_per_leaf, bool parallel) in "foctree.cpp". Most typically though, it fails at the line group.wait(); in the parallel section of the if statement.

Any input you could provide on why this might be happening would be greatly appreciated.

gcherchi commented 1 year ago

Hello, First of all, thank you for your interest in our work.

Your statement that meshes other than those we provided crashes surprises me a lot. We tested our algorithm on thousands and thousands of meshes with excellent results, as described in our paper. Please, could you provide me with a zip with all the models you tested on which the algorithm crashes? I would also ask you to provide me with more information about what functions you call "in other projects" and how.

Moreover, the crashes seem to occur in the octree. As stated in the README of this repository, we have a bug that occurs in some (sporadic) cases. So we have provided a solution in another branch (you can find all the details in the README at the beginning of the "Usage" section). Have you tried this alternative branch yet?

Screenshot 2023-08-02 alle 20 43 36

Please let me know if you can solve with these suggestions, and please send me all the models on which the algorithm crashed; they will be very useful for us in order to possibly fix the code.

Thank you very much. Gianmarco

eparrott commented 1 year ago

Hi Gianmarco,

I installed the alternate branch and tried the code again, and got a similar error. I'm using the attached files, the mesh_booleans executable with a subtraction operation, and the attached files. Let me know if they also fail for you. If not I'll try to provide more context as to what's happening on my end.

Thanks,

Ted

test_files_eparrott.zip

gcherchi commented 1 year ago

Dear Ted, You probably did not read our paper before testing the algorithm. Our algorithm takes as input triangle meshes with the following properties: they must be manifold, watertight, self-intersections free, and well-oriented. This is not the case with the mesh you sent me. First of all, they are not triangle meshes, but more significantly, they do not meet all the requirements for our algorithm. In this project, we also included an executable that can be used to test the input meshes before passing them to our algorithm, to ensure that all requirements are met. This is also described in the README of this repository:

Screenshot 2023-08-03 alle 19 05 06

I am sorry that our tool is not what you are looking for. Please do not hesitate to contact us if you have any other problems (with meshes that meet our requirements). We will be happy to help you. Regards, Gianmarco