designcoding
About Table of Contents Keywords Monthly Archive
Support designcoding!

Detecting Closed Shapes

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

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.

Detecting Closed Shapes Grasshopper definition
Detecting Closed Shapes computational-geometry, grasshopper

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

Grasshopper definition (GHX)Download

Cite this post

Yazar, T. (2013, August 26). Detecting Closed Shapes. designcoding. Retrieved October 3, 2026, from https://www.designcoding.net/detecting-closed-shapes/

Related Posts

Curvature Map on Terrains

September 17, 2026

This is the last of the site analysis tools we previously used in the midterm project of first-year architecture education. As you may recall, we previously introduced a tool that generates topographies based on specific parameters. Afterward, we examined two tools that perform slope and flow analyses on these topographies. Today, we are presenting a tool that analyzes curvature. This topic actually constitutes one of the interesting intersection points between architectural design and differential geometry. Curvature is not something architects…

Polar Sorting

September 13, 2026

I’d like to write down an interesting problem here. I remembered this while thinking about this post. It represents one of my favorite, simple pieces of reasoning. I frequently find myself needing to sort a number of points around a center in Grasshopper. Don’t ask why. I realized I’ve been using three different methods to achieve this. The first one that comes to mind is using the Vector Angle component, naturally. All we have to do is supply a plane…

Detecting Inner Regions in Grasshopper

August 26, 2013

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. The definition starts with drawing a circle around a point large enough. The size of…

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…

  • Chapters

    • Algorithms
    • Discourses
    • Fabrications
    • Studios
  • Explore

    • All Keywords
    • Table of Contents
    • Monthly Archive
    • #rhino-python
    • #polyhedra
    • #design-education
    • #robot
    • #parametric-surface
    • #terrain
    • #tessellation
    • #kuka-prc
    • #curvature
    • #fourier
    • #visualization
    • #dual
    • #parakeet
    • #pattern
    • #simulation
    • #vector-field
    • #growth
    • #boolean
    • #sandblasting
    • #stone
  • 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