# Move random 2D populated points away from attractor point

random distribution.3dm (27.6 KB)

Hi everyone,

It’s my first time posting question here, so I hope the description is clear enough.
I am trying to create randomly distributed poles that are pushed away from a few attractor points. Now I have made those poles, but I can’t get them to move away from the attractor point. All the other posts I found are about getting those populated points pulled closer to the attractor points.

random distribution.gh (11.9 KB)

you can start by creating a Vector from your attractor point to each of the points that have to be influenced:

the you can move each point along its vector, and change each vector length based on functions of your choice, graph-based remapping, whatever you prefere

here is a graph-based remapping on -uncapped- distance from the attractor point:

random distribution_Re.gh (17.6 KB)

by the way: you can get repulsion by reversing an attractor vector so any thread you might find on this same topic will be applicable also to your case

Thank you! This is amazing! I tried to add more attractor points, but it seems to be only responsive to one point. What’s the way to make those random points respond to several attractor point in this situation? My another question is if I don’t use the graph mapper, is there other simpler way to adjust those random points’ distance to the attractor. Thank you very much for your time!

it depends, how do you want your points to be influenced by the attractors?
each point is influenced by all the attractor points? (their effect sum up together?)
each point is influenced only by the closest attractor point?

yes, you can bypass the graph mapper and just connect its input and output links together (1),
or you can just set the graph mapper to linear (2)

Thank you! maybe each point is influenced only by the closest attractor point.

Here I tried to create a grid of points and have those points react to the attractor point, but instead of reacting to the point as individual point, the how row of points react to attractor point together. If I create a rectangular grid of points, they will always react as group of points rather than individual points?

disperser.gh (16.5 KB)
disperse.3dm (71.7 KB)

I didnt look at your gh, but I’m going to guess you might need to Graft the points output from the Grid.

1 Like

It works! the next problem I am facing is, once I have grid points react to the attractor point, they move beyond the rectangular boundary. How do I keep them within a rectangle?

Here is a way but there are many variations possible. I use Isovist in order to get a ray toward the border
here the rectangle border

here a Voronoi border

move points atrractor.gh (30.7 KB)

2 Likes