🟢

Example: Using Attractor Logic to Control Rhino Points & Spheres

Overview

This Grasshopper example implements the familiar Attractor Point logic, but uses a different scheme for choosing and scaling the circles that will be affected:

  • A “Sphere of Influence” is created and only the circles that fall within this radius are rescaled.
  • The scaling (of the circles within the Sphere of influence) is linear — using the simple formula: distanceToAttractorPoint / radiusOfSphereOfInfluence.
image

Steps

  • Step 1 - Create a Grid of Points
  • image
  • Step 2 - Draw Circles at the Grid Points
  • image
  • Step 3 - Create an Attractor Point
  • image
  • Step 4 - Set a “Sphere of Influence” and Determine if a Circle falls within the Sphere of Influence
    1. image
    2. Create a Circle with a radius equal to the Influence Radius.
    3. Compute the Distance between each grid point and the Sphere of Influence Circle.
    4. Use the Min function to determine if the Distance is less than the Sphere of Influence Radius and output the smaller value.
  • Scale the Circles based on the distance values passed in:
    1. image
    2. If a point is within the Sphere of Influence, the distance will be passed thru to scale the circle linearly using the formula Distance / Sphere of Influence Radius.
    3. If a point is outside the Sphere of Influence, the Sphere of Influence radius will be passed thru, so the formula will be yield the value 1 and the circle will not be scale.

Download Files

Use the Google Drive menu to ZIP the files in this shared folder and download them as a single ZIP file: