Attractors

Hi, I would like to know how can I add a point attractor to my algorithm. Also, I have a question is it the curve working as an attractor?
I dont know if its possible to make something similar to the second algorithm, that is using a point attractor to modify the curve as the point move.

For example if I want the hexagons to get higher as I move the point, how could I could I make that happen.

Let me know if I made myself understood

I would really appreciate your help!

Proyecto 1 attractors.gh (13.2 KB)
ejercicio 2.gh (6.9 KB)

Both your scripts already do exactly what you’re asking for?

Script 1 curve attractor:

Script 2 point attractor:
Rhino_0Mn5Kgxm0c

Yes, the second script is an example of what I want the hexagons in the first script to do. I want the hexagons in the first script to move with a point attractor is it possible?

well, you have several “layers” of things going on in the definition…

after creating the hexagon grid, you measure the distance between each hexagon center and the curve, and just delete any hexagon that is closer than 8 units from the curve:

then you take the -reduced- list of distances from hexes centers to the curve, and use it in the Graph Mappers:
A to define scaling of each hexagon, and
B to define extrusion height of each just-scaled hexa

if you want to add an attractor point on the first file, you can for instance control color based on a gradient which is defined as distance between the point itself and the center of each hexagon:

Proyecto 1 attractors_inno.gh (20.0 KB)

so the general “core mechanic” of an attractor is to use “distances from stuff to something else to control stuff’s transformations / stuff’s properties”

to do that in GH, the easiest/basic way is by using components like these:

Thank you so much!! So could I define the extrusion height of each hexagon with an attractor point instead of using the graph mapper? Is it possible?