## Single Point Attractor – Example 2.1

A common method for form management in parametric modeling systems and contemporary design is to use a concept known as an attractor. This example of a single point attractor has very limited practical use, but the concept can be adapted to more complex situations with multiple point attractors and curve attractors, which I’ll show in the next exercises. The general concept, however, is that a process or form is scaled incrementally based on its proximity to another object. In this example, circles are scaled down based on their proximity to a point; the closer a circle is to the point, the smaller they get. If the point is moved to a new location, the circles impacted change. It also includes a gradient tool to color circles based on their distance. Variables that can be changed are maximum circle size and the range of the scaling affect.

Step One – Basic Setup

Setup a hexagonal grid and flatten the points. Draw a circle at each one of these points. The radius can be left blank for now.

Step Two – Measure distances between each circle and an attractor point

A point (drawn in Rhino, not grasshopper) is linked into the script using a Point Parameter container. The distance function then measures the distance from each point in the hexagonal grid and this input point. You will not see any output from the distance function on the screen, but you can add a panel after the distance to see the values.

Step Three – Use distances for radii

This involves a bit of math. The distance is divided by a factor, which will affect the rate of scaling as you move away from the point. These results are input into the circle’s radius. In the example above, the distance scaling factor is “8”. So if a circle’s center point is 1 unit away from the attractor point, this divided by 8 is .125, which will be that circle’s radius. If the center point is 10 units away, the radius would be 1.25 and so on.

Step Four – Setup a maximum radius size

At some point, you will probably want the scaling to stop, otherwise the circles will get too big and create a messy design. So before being input into the circle radius, one other component, the “Minimum” component is used. This compares two values and uses the lesser of the two. If the maximum circle size is set at 1.7, as in the example above, but the result of the ( Distance / Factor) is 8.5, for example, the lesser of the two values is 1.7 and this will be used for the circle’s radius instead of 8.5. Its a bit counterintuitive at times, using a Minimum component to set a Maximum, but when you think about the math it makes sense.