Detect holes/openings in breps

Hi all,

does anybody have any idea how to properly detect openings in breps.
If I have a surface it’s not a problem to detect a naked edge or interior edge, but what if you have a closed brep (let’s say a profile).

I would go the way to look for openings in each face and see which one is close to another one, but it seems kind of clunky.

Any input or ideas?


Each Rhino.Geometry.BrepFace has a single outer loop BrepFace.OuterLoop.
So BrepFace.Loops is equal to all holes and the outer loop.

To exclude the outer loop from the list of the Brep.Loops property, you can use BrepLoop.LoopIndex.


Thanks, @jmv.
So you mean by getting the inner loops out of the looplist I might be able to get a relation inbetween curves that are close enough?

Sorry, I’m not sure I understand (my English is not good).
What I’m saying is:

InnerLoops = BrepFace.Loops - BrepFace.OuterLoop;

@jmv I think your English is just fine. :slight_smile:
I might be a bit unspecific.

I am trying to get holes out of profiles (something like a feature recognition). So I am able to get every single cutout in the faces but I cannot get a real connection. In the picture I posted I want to know the geometry I could fill the opening with…
But I guess that might be the way. Detecting the curves that are close enough to each other. Or get the brep face which has a 2 connections to the filtered loop edges.

I see, you need a Rhino.Geometry.Mesh.TopologyEdges but for a BRep?

Each sub-object is connected, for example

  • BrepFace has a Loops property.
  • BrepLoop has a Trims property.
  • BrepTrim has an Edge property.

It’s more complicated because you have to create a dependency graph yourself.
I see it exists:

  • BrepEdge.AdjacentFaces/TrimIndices()
  • BrepFace.AdjacentEdges/AdjacentFaces()
1 Like