From the course: Learning Grasshopper

Understanding attractor points in Grasshopper

From the course: Learning Grasshopper

Understanding attractor points in Grasshopper

- [Instructor] In dynamic systems, like our Grasshopper definitions, there's a concept of something called an attractor, which will tend to pull elements of that system toward a certain value. A great example of an attractor from physics is the gravitational field of a planet. Now, a planet is literally an attractor in that it attracts things to its surface by its gravitational pull, but it also behaves like an attractor in Grasshopper because it's pull drops off over distance. In this exercise file, we're using a single point parameter to act as an attractor. The point has a field of influence over this grid of circles and that's shown by the larger circle centered on the point. Inside that field, the circles are scaled down in proportion with their distance to the point, and as I move that point around, we can see how its properties as an attractor affect the grid of circles. So let's walk through how this Grasshopper definition is set up. First, we'll make a grid of circles. Then we'll define a point parameter and give that point a radius of influence. You can see as we adjust that radius, the area of influence gets larger or smaller. Then for each circle in the grid, we'll calculate the distance from the point of influence to that circle. If a circle is within the point's field of influence, we'll scale it down in proportion to its distance from the point. So circles closest to the point, get scaled down the most and circles outside the field of influence don't get scaled down at all. Now that we understand how this algorithm works, we can work together to build it from scratch.

Contents