Boolean operation on tow high density polydata in vtk

I tried to implement boolean operations in my software using vtkBooleanOperationPolyData. This approach worked correctly with the data from vtkSphereSource, but it did not work properly and resulted in errors when used with high-density STL files. After encountering this problem, we switched to CGAL and VESPA with vtkCGALBooleanOperation. However, the new solution, like before, works correctly with vtkSphereSource’s data but still has the previous error. Friends, do you have any suggestions on how I can solve this problem?

This is my error :

ERROR: vtkCGALBooleanOperation.cxx, line 116
vtkCgalBooleanOperation [00000211 8D382B40]: CGAL Exception: Unauthorized intersections of constraints

ERROR: In vtkExecutive.cxx, line 741
vtkCompositeDataPipeLine [000002118D33D720]: Algorithm vtkCGALBooleanOperation [000002118D382B40] returned failure for request:
vtkInformation :
Modified Time: 20330
Reference Count: 1
Registered Events: [none]
Request: REQUEST DATA
FORWARD _DIRECTION: 0
ALGORITHM_AFTER_FORWARD: 1
FROM_OUTPUT_PORT: 0

Could you please help me @mwestphal ?

Have you tried with other STL files other than just the high density ones? You might create a simple test with a few examples?

Perhaps there might be something weird in your STL files, have you run them through something like vtkCleanPolyData?

Another obvious place to look would be line 116 of vtkCGALBooleanOperation.cxx. I don’t seem to have that in my local copy of VTK, but I imagine that there might be some comments there, or some hints based on the logic near that part of the code.

Have you tried vtkbool?

Hi @Amir !

Could you please share your dataset? Or any dataset that would help to reproduce the error?

In any case, this is a CGAL issue so you may also want to check with CGAL people directly: GitHub - CGAL/cgal: The public CGAL repository, see the README below

Best,

François