# Strange in boolean (difference) operation

**URL:** <https://discourse.vtk.org/t/strange-in-boolean-difference-operation/9410>\
**Category:** Development\
**Created:** [September 21, 2022, 2:44am UTC](https://discourse.vtk.org/t/strange-in-boolean-difference-operation/9410 "2022-09-21T02:44:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![szm](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/5e9695/32.png) [@szm](https://discourse.vtk.org/u/szm)\
**Post date:** [September 21, 2022, 2:44am UTC](https://discourse.vtk.org/t/strange-in-boolean-difference-operation/9410/1 "2022-09-21T02:44:55Z")

</div>

Hi, I have two shapes. One is named slab, and the other named hole. I want to obtain a new slab excluding the hole shape. So I tried vtkBooleanOperationPolyDataFilter with difference operation in VTK 9.1.0. In the result, a region belongs to the hole shape is not removed (see the red region in the result figure) although I confirmed the hole shape can penetrate the slab, which is strange to me. Attached are the two shapes (STL files) and result figures. Any comments are welcome. Thanks in advance.  
[slab.stl](https://discourse.vtk.org/uploads/short-url/vGIwTibKXHQBI1vFHqfO5ARuxPv.stl) (1.5 KB)  
[hole.stl](https://discourse.vtk.org/uploads/short-url/4gVRCKUYMBSJBxFrXD3vxOO7aU9.stl) (172.2 KB)  
[result.stl](https://discourse.vtk.org/uploads/short-url/9jrKeuqy9fSzIJeYUqaAHqtAMpl.stl) (345.5 KB)

 ![20220921_1](https://discourse.vtk.org/uploads/default/original/2X/f/f986caf24e9f36bb70c52e6a2cb94f0ef523590e.png)  
 ![20220921_2](https://discourse.vtk.org/uploads/default/original/2X/e/ed6cb20e84b93e48315c47ba807c5abb05bda242.png)  
 ![20220921_3](https://discourse.vtk.org/uploads/default/original/2X/9/9ebe2db71c05ae66e1c81c7c2d1ce08855030925.png)

---

<div class="post-metadata">

**Author:** ![Christos\_Tsolakis](https://discourse.vtk.org/user_avatar/discourse.vtk.org/christos_tsolakis/32/2076_2.png) [@Christos\_Tsolakis](https://discourse.vtk.org/u/Christos_Tsolakis)\
**Post date:** [September 21, 2022, 6:30pm UTC](https://discourse.vtk.org/t/strange-in-boolean-difference-operation/9410/2 "2022-09-21T18:30:31Z")

</div>

It could be that the big difference in feature size of the two models which causes roundoff issues. Try to apply `vtkLinearSubdivisionFilter` to “slab.stl” before applying the Boolean operation

---

<div class="post-metadata">

**Author:** ![szm](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/s/5e9695/32.png) [@szm](https://discourse.vtk.org/u/szm)\
**Post date:** [September 22, 2022, 2:22am UTC](https://discourse.vtk.org/t/strange-in-boolean-difference-operation/9410/3 "2022-09-22T02:22:29Z")

</div>

@Christos_Tsolakis Thanks for your suggestion. The result looks correct after apply vtkLinearSubdivisionFilter with number of subdivisions equals 1.
