Populating a surface with points randomly each time

I was just wondering if anyone could possibly help!

So i have a surface in grasshopper, and i want to populate it with random points, but i want the points to change location each time. The random command doesnt work for this as points still appear and disappear in the same spot.

Does anyone know what to do in this situation?
I have attached my grasshopper file.
(it has to connect to the surface component in the green grouping)


Did you try using the populate geometry component? Its under Vector - Grid - Populate Geometry. You can change the seed value to get random points every time.

Yeah i did try that earlier, but it seemed to do the same as random. It populates points in the same spot.

You need to change the Seed(S) input.
This could be with an integer slider, and you move it when you want a different solution…
or if you want it to automatically generate different values each time the solution is refreshed, you could do it with a script like this that uses the current system time. Then it will change whenever you press f5 to refresh your solution.

1 Like

Thank you, i will try this,
Could i just ask, what do you plug the C# script into? is it the populate geometry component?

I showed it with the Random component, but it would work the same with the PopulateGeometry component - just connect it to the seed input.

Every what time? The file is opened? You press a button? You adjust a slider? Every 20 milliseconds?

Eventually I will be running the script through Wallacei, and each time it analyses a variation I need to ensure that the points are in different locations, or else I will get variations that double up / are the same. Before I do this I can check it with the button and shuffler components to see if the location of the points are generating in the same spot. button%20shuffler

Wallacei? Sorry but that script has too much calculation time, 172 slider, 7744 slider values and a search space of 1e279 since you duplicate so many sliders and their operations - this isn’t a script for Wallacei.

I would recommend to learn the basics of how to work efficient with the grasshoper data structure before using Wallacei.

Hi Manish,
If you use the PopulateGeometry component as @DanielPiker suggested, you can simply rename the seed input with the prefix of wlc_, then gene shuffler will recognize this slider and shuffle it as well. Every time you change the seed input, the results of PopulateGeometry will be different.
Also, I opened your GH file, and as @danielbent mentioned, it takes a long time to calculate the canvas (for my PC is almost 30 seconds) however I can assure you that Wallacei can easily handle it as well. I have seen users running Wallacei simulations with over 1 min calculation time per solution. However, as Daniel suggested, I recommend you to go through your GH script and try to clean it to decrease the calculation time.
and one more side note, principally it is not recommended to use the random seed as a gene in the evolutionary optimization.