Check if object(s) fully inside other

I couldn’t find a solution and hope someone has an idea. I want to test if certain objects (circle in picture) are completely within a brep, not just if there is a simple collision.

I’m trying to create a parametric deep foundation and remove all objects that are not completely within the foundation.

You can use Shape In Brep


Shape In Brep_re.gh (1.0 MB)

6 Likes

Maybe you can create union region of the circles and the bounding rectangle of the cube, than compare the area of the region and the area of the bounding rectangle.
And please post a file to get many solutions

Thank you so much, after my post I found a solution but they was not really perfect and generate some problems in some situations and was not really so perfekt as yours.

I tried to use counting objects in the Brep/Curve intersection and it works but when a circle was nearly the edge it created only one object in list and so it didn’t works. :sweat_smile:

You saved my day, your are perfekt, Thank You :smiley:

It is possible to scale this algorithm to work with multiple Boxes that have or don’t have Spheres inside and group all the Spheres with the Boxes that they are included in?

You can check if grafting input boxes work.


Shape In Brep_reV2.gh (21.9 KB)

1 Like

Thank you for the definition. However I do need to Group them, each box to be into the same group with the included spheres. So, in this example, I do need four different groups with one box and the spheres that are inside of the box.

If so, why don’t you try to merge them?


Shape In Brep_reV3.gh (27.3 KB)

1 Like

The problem that I do need to solve it is a little bit different. I tought that this definition will solve my problem but unfortunately it dosn’t.

I do need to group the parts and the exterior edges that are touching each geometry and after that to transform them flat into the XY plane as groups of geometries, each part with his coresponding edges.

Please see the bellow file for better understanding.
Group outside touching geometries.3dm (781.3 KB)