Intro to Attractors

Intro to Attractors

Attractors are basically data that is used as a way to control other parts of our Algorithm. In this case, our Attractor will be the Point in the middle. We will be using distance as the driving force of our Algorithm. 

Looking into our data

All those output slots we are connecting are holding on to data. To continue to understand Algorithms we need to know how Grasshopper handles data. I will keep it very simple but if you are confused don't be disheartened. It took me countless hours to wrap my head around this single aspect of Grasshopper. Their is much more in depth books and pdfs that can help you understand. Be warned though, this is barely scratching the surface. It gets much, much more complex. That is for another day though. I will try to keep it as simple as possible

Panels and Param Viewer

  1. Param tab> input> add a Panel
  2. Param tab> utility> add the Param Viewer Component
  3. Connect the Output slot of our Distance tool into each of these components. 
  4. Duplicate the Param Viewer and double click on the center to view the tree.  

What we are seeing in the panel is a list of all the measurements between that one point and all the grid we created. In the Param Viewer we are seeing a single branch. Since we flattened our Points in the previous steps it keeps everything very simple. We just have a giant list of these measurements. I will be placing panels in my screenshots just for the sake of education. So if you see one placed, it will usually be to help explain the process.

Using and Remapping that data

Now that we have this data we need to remap it into other aspects of our design. We will start by placing circles on our grid points and using the raw distances data as the radius. Then we will manipulate the data finding the bounds of the distances, and remapping that to a domain that is more suitable for our scaling exercise. I know this might sound complex if you have never used these terms before. In layman terms, we will find the closest distance and farthest distance, and scale those numbers closer to what we need. 

Add Circles

  1. Curve Tab > Primitive > add the Circle Component
  2. Connect our grid points output slot into the Circle Input P slot
  3. Connect the Distance output slot into the circle Radius input slot
  4. Hide the other components by selecting them>Spacebar >Disable Preview

Just adding this already gives us a very cool pattern by surprise. This is another thing I love about Grasshopper. Sometimes accidents can become beautiful patterns that you would've never thought of. 

Remapping the Number

  1. Math Tab > Domain > add a Bounds components
  2. Math Tab > Domain > add Remap Numbers components
  3. Math Tab > Domain > add Construct Domain components
  4. Add two Number sliders
  5. Connect the Distance output into the Bound components
  6. Connect the Number sliders into the Construct Domain components
  7. Connect the Distance output to the Value input in the Remapping component
  8. Connect the bounds output into the S input in the Remapping component
  9. Connect the Construct Domain output into the T Input in the Remapping component
  10. Move the Number sliders around 

Adding a Distance Threshold

Their will be times where you don't want the whole grid. For this we will use our friend math. This is the first time you will be introduced to Culling. Culling just means removing the data from our algorithms. In layman's terms, I am just telling grasshopper I only want the closest 25 percent.. 

Culling the points

  1. Make the Domain sliders into 0 and 1
  2. Math Tab > Operators > add a Smaller Than component
  3. Add a Number slider and place it at .25
  4. Set > Sequences > add two Cull Pattern component
  5. Connect the Remapping output R into Smaller Than A input
  6. Connect the .25 Number Slider into Smaller Than B input
  7. Connect the grid Points into one of the Cull Pattern L input
  8. Connect the Smaller Than ">" output slot into Cull Pattern P input
  9. Connect the Remapping output R into the other Cull Pattern L
  10. Connect the culled points into Circle P input
  11. Connect the culled Remapped numbers into Circle R input

Remapping our new Point

As you can see we are using the same remapping for distance threshold and scaling. What we need to do is use remapping twice. Once to eliminate the points we want, then again to remap the new points into a scale we want. We have already gone over these concepts so I want you to try it on your own. Remember you have a new set of closer numbers, we need to remap those and apply them to our scale. If you get lost just deconstruct the Algorithm by looking at my image, 

Understanding Culling

Culling is just removing data you don't want. If we go back to our simple Dice example, we can simplify the concept. I am using a Larger Than component to figure out which numbers are great than 5. This give me a culling pattern I can use to separate the data. I can use the Cull Pattern component to remove all the unwanted numbers. In this case only 5 didn't meet the condition. So once I run it though the Cull Pattern component, my 5 is removed. I can also use a components called Dispatch to separate the list into those who passed and didn't. 

 

Putting what we learned to work

Even though our example is quite simple. If you understand these concepts you actually have giving yourself an incredible new tool for your design process.