DiscussionsIssue archiveModeling Data and Algorithms

Archived discussion

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

Modeling Data and AlgorithmsThu, 08/22/2024 - 09:026 replies

Browse this forum
QuestionAuthor

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?

Discussion

6 archived replies

Posts are displayed in their archived order.

01Commenter-1

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, Commenter-1.

02Author

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

03Author

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

04Commenter-1

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, Commenter-1.

05Author

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.

06Commenter-2

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