
Mon, 02/24/2025 - 13:19
Forums:
Hi all,
As boolean operations, including BRepAlgoAPI_Common are quite error prone, i was wondering if there is an alternative function to find out if 2 shapes intersect (all i need is True/False result, not the exact intersection).
Thanks in advance for any tips!
Best regards,
Daiva
Mon, 02/24/2025 - 13:25
Hello, you just need to detect collusion (status of collision). OCCT offers the Collision Detection component: Collision Detection Component - OCCT3D
Or you can develop some algo based on OCCT to detect that on mesh by yourself or request development from us for that feature: Custom Software Development - OCCT3D
Best regards, Dmitrii
Wed, 02/26/2025 - 13:28
Thanks Dmitrii,
Since finding these few collisions is a tiny part of the product i'm making, it's not feasible to purchase a whole collision detection component.
The only approach that comes to mind making my own function would be to take the shapes apart and see if any of the vertices of shape 1 are in shape 2 (and vice versa) or any of the faces intersect, probably using another library.
Any ideas how to do it better would be highly appreciated!
Wed, 02/26/2025 - 14:58
You can develop an algorithms based on OCC't BVH. The logic will be possible to implement on Mesh or geometry. OCCT't components is not a final application, it is a component to be a part of application.
Best regards, Dmitrii.
Thu, 02/27/2025 - 00:09
To find if 2 shapes intersect you can use the class BRepExtrema_DistShapeShape. However, it is an old class that does not use any acceleration structures and may be slow.
Another more modern tool is the class BRepExtrema_ShapeProximity. It uses BVH structures built on triangulations, and may show much better performance. However its precision is restricted by the mesh deflection.
To know how to use it you can see the implementation of the Draw command 'proximity', that is located in the file BRepTest_ExtremaCommands.cxx.
The tool works in two modes: checking overlapping, and computing proximity. You need the first one. To check intersection just pass the value 0 for the tolerance.