How to get "islands" from cut operations

Hello suppose I have object A which is a box and object B which is a cylindrical shell. If I perform a cut operation cut(A, B) the resulting box now has a "island" that was cut out by the cylindrical shell. I was wondering if there is a quick way to retrieve this "island". I was not able to find anyone talking about this on the forums sorry in advance if this has already been discussed here.

Currently I implemented a naive solution where I perform a BFS search to group faces together. With this method I am able to get the "islands" but I was wondering if OCCT has a native implementation for this or if someone has a better suggestion than my BFS search implementation.

Thank you !
- Alfredo

Alfredo Gutierrez's picture

I was able to figure out a better solution !

Using the TopExp and re looking at the documentation. More specially this line "The result of the Boolean operation is a compound (if defined). Each sub-shape of the compound has shared sub-shapes in accordance with interferences between the arguments." helped.

Thanks

Kishore Banothu's picture

Hello, I'm also on similar page where i'm trying to recognise island feature. But the algo which i'm trying is not working. basically i'm trying to find the internal loop on a face and then trying to see if each edge is convex or convcav. But i'm unable to get edge convex/concave properly. can you help me if you have any sort of idea on this. Thanks!

Kimra01's picture

sorry man... this platform isn't as helpful as one would hope it to be. we'll try to be more active and hopefully make it a better learning environment!