# Boolean operation on tow high density polydata in vtk

**URL:** <https://discourse.vtk.org/t/boolean-operation-on-tow-high-density-polydata-in-vtk/12465>\
**Category:** Support\
**Created:** [October 10, 2023, 5:14pm UTC](https://discourse.vtk.org/t/boolean-operation-on-tow-high-density-polydata-in-vtk/12465 "2023-10-10T17:14:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amir](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amir/32/8464_2.png) [@Amir](https://discourse.vtk.org/u/Amir)\
**Post date:** [October 10, 2023, 5:14pm UTC](https://discourse.vtk.org/t/boolean-operation-on-tow-high-density-polydata-in-vtk/12465/1 "2023-10-10T17:14:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Amir](https://discourse.vtk.org/user_avatar/discourse.vtk.org/amir/32/8464_2.png) [@Amir](https://discourse.vtk.org/u/Amir)\
**Post date:** [October 11, 2023, 6:00am UTC](https://discourse.vtk.org/t/boolean-operation-on-tow-high-density-polydata-in-vtk/12465/2 "2023-10-11T06:00:44Z")

</div>

Could you please help me @mwestphal ?

---

<div class="post-metadata">

**Author:** ![rexthor](https://discourse.vtk.org/user_avatar/discourse.vtk.org/rexthor/32/6481_2.png) [@rexthor](https://discourse.vtk.org/u/rexthor)\
**Post date:** [October 11, 2023, 12:27pm UTC](https://discourse.vtk.org/t/boolean-operation-on-tow-high-density-polydata-in-vtk/12465/3 "2023-10-11T12:27:48Z")

</div>

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

- The [Utah Teapot](https://en.m.wikipedia.org/wiki/File:Utah_teapot_(solid).stl).
- The [Stanford Bunny](https://en.m.wikipedia.org/wiki/File:Stanford_Bunny.stl).
- Or one of [many other](https://en.wikipedia.org/wiki/List_of_common_3D_test_models) test models …

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.

---

<div class="post-metadata">

**Author:** ![gongwaner](https://discourse.vtk.org/user_avatar/discourse.vtk.org/gongwaner/32/6996_2.png) [@gongwaner](https://discourse.vtk.org/u/gongwaner)\
**Post date:** [October 11, 2023, 4:42pm UTC](https://discourse.vtk.org/t/boolean-operation-on-tow-high-density-polydata-in-vtk/12465/4 "2023-10-11T16:42:21Z")

</div>

Have you tried [vtkbool](https://github.com/zippy84/vtkbool)?

---

<div class="post-metadata">

**Author:** ![Francois\_Mazen](https://discourse.vtk.org/user_avatar/discourse.vtk.org/francois_mazen/32/3290_2.png) [@Francois\_Mazen](https://discourse.vtk.org/u/Francois_Mazen)\
**Post date:** [October 12, 2023, 8:27am UTC](https://discourse.vtk.org/t/boolean-operation-on-tow-high-density-polydata-in-vtk/12465/5 "2023-10-12T08:27:59Z")

</div>

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](https://github.com/CGAL/cgal)

Best,

François
