gilbo/cork

Degenerate case that fails

Narusaki opened this issue · 6 comments

Hi,
I'm using the code to merge some simple geometries under VS 2012, MS Windows 7 x64. I've compiled the code and successfully run the program with the two example ball models. But when I try to operate a union on the following cylinders, an error is triggered by the code as "Ran out of tries to perturb the mesh". I think this might be a degenerate case but I'm not quite sure. Is there any way to deal with this issue? Thanks.

primitives

gilbo commented

Is this constructed via multiple Boolean operations?

Yes, there are more than ten cylinders to execute the "union" and "different" operations.
I can send you the mesh files of these cylinders (in .obj or .off format) if you want.

gilbo commented

So, there's a known issue with Cork, which is that it doesn't do anything to remove small geometry (small edges and triangles) from the model after performing the Boolean operation. Those features are likely causing problems in later Boolean operations. Unfortunately, I don't have a fool-proof way to address this problem, so I usually just recommend applying some kind of remeshing operation to remove these tiny bits of geometry in-between Boolean operations.

If you're sure that this is a different issue, then please let me know, and I can look into it in more detail.

Also, sorry I don't have a better fix for you, but I don't have the time to do the research that would be needed to prevent these problems. =(

Well thank you, I think it probably is the issue you mentioned above. Thanks for your reply :)

is there a way to adjust numerical tolerances in cork?

gilbo commented

Cork doesn't use epsilon tolerances on it's expression testing. It uses exact arithmetic, and floating-point filters to accelerate it.