designcoding
About Table of Contents Keywords Monthly Archive
Support designcoding!

Detecting Inner Regions in Grasshopper

August 26, 2013 | Algorithms
#computational-geometry #grasshopper

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 component in Grasshopper. But maybe you can use this as a starting point if you want to develop it.

Detecting Inner Regions in Grasshopper Grasshopper definition

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.

Detecting Inner Regions in Grasshopper animation

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: 

Grasshopper definition (GHX)Download

Cite this post

Yazar, T. (2013, August 26). Detecting Inner Regions in Grasshopper. designcoding. Retrieved August 24, 2026, from https://www.designcoding.net/detecting-inner-regions-in-grasshopper/

Related Posts

Detecting Closed Shapes

August 26, 2013

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…

Curve Farthest Point

August 26, 2013

Today’s tip is about two-dimensional curve-point calculations. It is very handy to use “closest point” components in Grasshopper. You can calculate distances and directions between curves, surfaces, and points. Then, place point objects in relation to the proximity of another object. However, there is no “farthest point” implemented yet. I tried to calculate the farthest point from a curve. First, I tried to translate the curve in a fashion that would result in the opposite of the closest point calculation….

Shortest Path Generator

April 30, 2012

This is the continuation of my scripting experiment within Grasshopper. Like the minimum spanning tree algorithm, this is also a famous problem of computational geometry; the shortest path problem. I’m now coding faster and understanding the namespace more easily in Grasshopper. This time, the challenge was implementing Dijkstra’s algorithm for the Shortest Path Generator. Again, it’s a quite powerful algorithm, I even plan to use it in my current project. Although there is a faster alternative, Shortest Walk-in Food4Rhino and it…

Minimum Spanning Tree

April 26, 2012

This is the updated version of my MST code from 2012. After over a hundred hours of Rhinocommon and Grasshopper SDK studies, and lots of dead ends, I was finally able to calculate the minimum spanning tree of any given curve network in Grasshopper. Problems like these are interesting to me because of their clear logic and diverse areas of applications in design. I tried to simulate Dijkstra’s, Kruskal’s, and Prim’s algorithms, but no chance. There are similar solutions such…

Convex Hull with Rhino Python

July 28, 2017

This Rhino Python code calculates the cross-product determinant used to determine the orientation of three points (current, next_point, and point) to see if they form a left turn or a right turn. This is a well-known technique in computational geometry to check the relative orientation of points. In this script, the direction is the cross-product determinant that determines the relative orientation of the points. If the result is negative, the point is to the right of the line from current…

  • Chapters

    • Algorithms
    • Discourses
    • Fabrications
    • Studios
  • Explore

    • All Keywords
    • Table of Contents
    • Monthly Archive
    • #rhino-python
    • #polyhedra
    • #parametric-surface
    • #robot
    • #tessellation
    • #boolean
    • #kuka-prc
    • #dome
    • #design-object
    • #image-sampler
    • #terrain
    • #sandblasting
    • #stone
    • #parametric-curve
    • #animation
    • #cycloid
    • #art
    • #simulation
    • #aperiodic
    • #tiling
  • Search

  • Support designcoding!

  • Enjoying designcoding? Support me on Patreon to keep it growing. Thank you!

  • copyright 2026 designcoding.net | about | privacy policy | end user license agreement