Detecting Inner Regions in Grasshopper

by Tuğrul Yazar | August 26, 2013 11:59

This is a simple trick that shows the utilization of the “surface split” component in Grasshopper. It is used for detecting the inner regions of any given two-dimensional linework. Thus, it resembles the hatch boundary detection of AutoCAD and similar software. There is no built-in hatch[1] component in Grasshopper. But maybe you can use this as a starting point if you want to develop it.

2013_08_26-inner-def[2]

The definition starts with drawing a circle around a point large enough. The size of this circle might be based on the boundary curves. However, here I chose to pick its size from the user. Then, I create a planar surface using the circle. Thanks to Grasshopper’s flexibility, it accepts the circle as a planar surface automatically. Sometimes these data type conversions are very useful. But in fact, these exceptions sometimes cause misunderstandings and false expectations. Anyway, I split the planar surface with the boundary curve collection. Finally, I project the point onto these surface pieces. The Project component has an output I, which tells the index number of the surface on which the point is projected. In fact, this output made all these definitions possible and easy.

In the end, I chose the particular surface split piece with the correct index number. I used the “project” component to quickly understand which of the trimmed surfaces is inside while detecting the inner regions. However, the “Point in curves” component also gives the same solution. It works as you can see above animation. Here is the Grasshopper definition if you want to try: 

[GHX: 0.9.0056]Download[3]
Endnotes:
  1. hatch: https://grasshopperdocs.com/components/human/hatchExplode.html
  2. [Image]: https://www.designcoding.net/decoder/wp-content/uploads/2013/08/2013_08_26-inner-def.jpg
  3. Download: https://www.designcoding.net/decoder/wp-content/uploads/2013/08/2013_08_26-inner.ghx

Source URL: https://www.designcoding.net/detecting-inner-regions-in-grasshopper/