Need help using Grasshopper to create dynamic grid of points



Hi, I’m working on creating a rectangular grid of points and have them be manipulable and moveable relative to each other. What I’m envisioning is that there would be a number of “anchor points”(say 5 points along the perimeter of the grid) that when I move them, the rest of the grid points will move according to their distance from the anchor points. So, if I move an anchor point, the farther a grid point is from that anchor, the less it will move. And the function would work through the list of points and evaluate them with some expression (like 1/x) and create vectors to move them.
I’ve started, but my two main problems are that the “anchor” or attractor points I’m using are set points, and I want them to actually be points from the grid. Also, when I have more than one attractor point, the farther away they are, the points start to bunch together instead of spreading apart like I want them to.
Can anybody help or offer advice?

My first attempts:
The expression in the evaluate component is 1/x+y

(Brian James) #2


Here’s a quick try at what I think you’re after. Assign some real Rhino points to the attractor components… I hope it helps! (15.8 KB)


Thank you, this seems to work much better than what I was doing.



I’m new to grasshopper, and I was wondering if you could connect the points with lines? eg. make it into a net/mesh. Sorry if this is bit of a novice question.

Mesh from points using Grasshopper
(Andres Gonzalez) #5

You should try Paneling Tools if you want to connect that grid of points…


Is it possible to have equal spacing between every point?

(Brian James) #7

With the def I posted the non-uniform spacing will occur due to the measurements from the pt grid to the attraction points. If you are looking to make a uniform pt grid over some other geometry, you can use the Paneling Tools add on for GH or the plugin itself to divide by distance. I might be misunderstanding though so post more details about what you’re doing in a new thread and I will try to help more.

(Dizzy) #8

Hi, i’m trying to develop this algorithm in order to have moving points toward the attractors points instead of scaling, i split the list of points based on a circle of attractor point so just some of them will move. The problem is that as a result i have a list that is not correct to interpolate, i tried with some list operation but i haven’t figure it out. does someone knows how to do it? (14.7 KB)



Hi. @dizzy.
You can do it with native GH components or a plugin like pufferfish
Take a look at the attached. Best. (18.0 KB)

(Dizzy) #10

Thank you very much @HS_Kim , i tried to play a bit with your definitions, and i have some question about if you would like to continue this topic… :slight_smile:

-in the first definition, is it possible to constrain points on the border like you did in the second one?
the first one from my point of view has a final results more accurate than the second, especially if we use just one attractor point, if we put more it start to act a bit weird in between the attractors point, do you think it is possible to have the same deformation for those lines? and is it possible to have different strenght for the attractors?

-i tried to modify the second definition and it looks very good even when i added new attractors with different strenght, but the problem in this case is that it looks good just when points go away from the attractors, when i try to make the opposite thing it look weird, is like the points are moving the same distance.

I know there are several open discussion on this topic but i noticed that every solution has always something weird in the final result, i hope to find something more accurate!

Thank you very much (9.5 KB)

(Dizzy) #11

this is the second one that looks very good but not in the opposite way

(Michael Pryor) #12

They don’t all go the same distance in the Pufferfish version, the strength is based on distance to the attractor. The effect is because as a spread you go to the outer points, as a pinch you go all to one point (the attractor). I could add some fall-off options in a future update.

Opposite of Attractor?

(Dizzy) #14

Thank you @Michael_Pryor and @HS_Kim i tried with Pufferfish and i obtained something more close to what i had in my mind but for sure i know there is definetely a shorter definition because mine its pretty rough but unfortunately i don’t know many components so i’m not able to find it.

Do you know a shorter way to do that? (21.8 KB)


(Michael Pryor) #15

What you are doing there is essentially a fall off (Ill have to add it in the code.) @HS_Kim first definition does this already with a graph mapper.


We just had a thread on that subject recently: (having trouble pasting a link to it…?)

(Dizzy) #17

thanks @Michael_Pryor i’ve noticed that but in the first definition i’m not able to make the border’s points constrained and in the second definition i havent figure out how connect fall off with the graph mapper! so basically i’m trying to have the curves that i see in the first definition (that for me looks pretty good) with constrained points of the second one!

#18 (19.1 KB)


Check this as well… (11.8 KB)

(Dizzy) #20

This is pretty good! i was looking also to the first one you posted but there was a strange thing, there was a deformation also in the part of the grid outside the circle. This one its really close to what i would like to do, i think i have just to balance some parameters. Thank you very much @HS_Kim you’re so helpful, i’m gonna study your definition because there are some components that i’m don’t know very well!