Detecting Closed Shapes

by Tuğrul Yazar | August 26, 2013 12:36

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][1]

2013_08_26-closedr-def
2013_08_26-closedr

As you see from the image, this only counts the closed shapes with valid edges.

Endnotes:
  1. [GHX:0.9.0056]: https://www.designcoding.net/decoder/wp-content/uploads/2013/08/2013_08_26-closedr.ghx

Source URL: https://www.designcoding.net/detecting-closed-shapes/