Test if surface is completely inside another surface

Hi all,

I have a scenario where I have a big surface and then a few other surfaces. But from the smaller surfaces only one of them is completely inside the bigger surface. The rest might only intersect or not intersect at all. See sketch below. I’m trying to find a logic to find that surface that is completely inside the bigger surface. We only have a Geometry.Intersect node but not useful in my scenario.

The workflow that I am thinking of is to join the intersected surfaces with bigger one. Then get the area of the polysurface. If the area of polysurface (joined surfaces) equals the area of the big surface, then it means that those surfaces are completely inside another. But there must be a smarter way of doing it.

Any help would be appreciated.
Cheers.

Have a look at the Polygon.ContainmentTest node.

Thanks Andreas.

This node tests if a point inside a polygon.
Are you suggesting to get corner points of all my surfaces and check to see if all of them are inside the bigger surface?

Cheers.

Indeed I am.
If the node returns true for all points of a surface you can discard that surface.
If the node returns true for some points of a surface you can join that surface with the surface you test against.

1 Like

Just to give my 5 cents back to the community: I came across different scenarios which one was like the sketch below. The above solution won’t work on concave shapes like this. I ended up using Surface.SubtractFrom for every instance of smaller surfaces with bigger surface and then check areas to see if the subtraction of their intersected surface areas equals the subtraction of their areas.

2 Likes