Is there a way to tell whether or not a surface, or more particularly a polysurface has holes in it?
Are you looking to tell if an object is closed (no open edges anywhere) or if there are interior holes in, say an open surface/polysurface?
Looking to see if there are any interior holes in a surface
OK, below is a quickie python script that will tell you if your Brep (surface or polysurface) has any interior holes, and if so how many…
TestDetectInteriorLoops.py (808 Bytes)
Awesome that works and shows me how you did it. Thanks. I am surprised that the rhinoscriptsyntax doesn’t have anything for detecting edges of a surface. Also can you use the same brep.loops to detect outer trims?
Well, with rhinoscriptsyntax, you could use rs.DuplicateSurfaceBorder(id,type) where type can be used to return inner, outer, or both inner and outer borders. You can then see what’s returned. The main disadvantage with rs is these edges are added to the document automatically, so if you don’t want them, you need to delete them afterwards. RhinoCommon simply allows you to do this without adding any geometry to the document.
Yes. As a matter of fact the script tests for NOT outer.
Is it also possible to delete these holes with your python script.
The functionality behind Rhino’s “Untrim” commands has not been make available yet. It’s on the list.
RH-12326 is fixed in the latest WIP