Boolean operation is very expensive. In my case, it takes 29 minutes to make a Boolean difference. I want to start parallel calc

Boolean operation is very expensive. In my case, it takes 29 minutes to make a Boolean difference. I want to start parallel calculation and speed up Boolean difference. I use mingw and msvc. How can I use it?

Dmitrii Pasukhin's picture

Hello, TBB is optional. Native thread support already is a part of default build.

To turn on parallel execution, you need to use specific method in your Boolean class. Set parallel(true).

As for a TBB VS native threads, there no big differences.

Best regards, Dmitrii.

ye na's picture

Thank you very much for your reply
I found this flag, Set parallel(true). I'm going to test the actual effect.
Thanks

ye na's picture

Thank you very much for your reply
I found this flag, Set parallel(true). I'm going to test the actual effect.
Thanks

Dmitrii Pasukhin's picture

29m is a non-usual. Did you try to play with tolerance? Or for example, fix shape or unify your model before BO?

Best regards, Dmitrii.

ye na's picture

hello, Thank you very much for your reply.
This is the test result on my machine.
```
// open parallel and use native boolean = 989791 ms
// close parallel and use native boolean = 1009063 ms
// close parallel and use tbb boolean = 1024792 ms
// open parallel and use tbb boolean = ???????? ms // no try
```
I found that opening and closing parallelism didn't seem to improve significantly.
Of course, I also found that you said that using native or tbb seems to have the same effect.

Your reply is just one of my puzzles. In fact, I just want to significantly improve the performance of my program in some way.
My case doesn't have complicated geometric shapes, but it is a TopoDS_Face composed of a lot of basic geometric elements (circles, polygons, rectangles, etc.), but the remarkable feature of my data is that the number is very large.

I will also try these methods: tolerance fixshape or unify model
If you have any good suggestions for me, I will be very grateful.

Michael Holm's picture

You could optimize it with a KD-tree or something, and only consider shapes that overlaps?