Detecting Closed Shapes
Again, I continue with some simple solutions for Grasshopper. The surface split component gives all possible surfaces sliced with given curves. And it creates “invalid” curves with at least one open edge. I used this to perceive the closed regions within a given complex curve set. Just put the “Clean” component to erase the outer invalid surfaces and there remain the closed ones. However this time the question was where to put the circle and what its radius of it was. I used a new component called “Plane Through Shape” and it works perfectly to create bounding rectangles of the curves. By joining these rectangles I found the area centroid of the whole open curve set, placing the circle there. The radius of this circle can be calculated by using the “farthest point” algorithm I described here before, but this time I just exploded them and found the farthest distance between the centroid and rectangle corners. I hope this works in every condition. Again you can also put a very big number to the radius. Here is the definition file: [GHX:0.9.0056]
As you see from the image, this only counts the closed shapes with valid edges.