Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Problem on generating multiple iterations

$
0
0

Hello, I would like to pick a random point in each generation to form a box. However, if I change the slide in grasshopper, it seems to recalculate the whole generation rather than to add a new one upon the previous generation. (see gif1) And if I use seed to control the randon index, the result doesn’t seem “so random” (see gif2). Is there any solution to add new iteration on the previous one?

Thanks!

my code:

addedPoints = []
for i in range(iteration):
    random.seed(40)
    index = random.randint(0, (len(a)-1))
    selectedPoint = a[index]
    a.remove(selectedPoint)
    addedPoints.append(selectedPoint)

i = addedPoints
  • variable “a” is the initial point pool

ezgif.com-gif-maker

ezgif.com-gif-maker (1)

5 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles