Improving Performance While Repeatedly Cutting A Shape

I am working on a project that involves real-time simulation of cutting one object with another. So, I have two shapes and I am cutting one of them with another repeatedly. I know it will get slower inevitably but my file size is going from 100-200 kb to 20 mb and cut operation takes 500 ms initially and goes to 7-8 seconds after 30+ cuts. I am using BRepAlgoAPI_Cut only. Can you suggest any way to improve performance for this type of task ?
Thanks in advance.

Mikhail Sazonov's picture

Try using shape simplification after each operation. The class ShapeUpgrade_UnifySameDomain can merge adjacent entities if they are based on the same geometry and thus reduce the overall number of entities.

Ali Can KESKİN's picture

Thank you for your reply, I was using simplification but it was not enough. Will try UnifySameDomain though. Thanks again.

Edit: in SimplfyResult() it says that it is using UnifySameDomain. So, I believe I do not need to use it again seperately.