algorithmic modeling for Rhino
the every branch should be different random,but now is the same random ,i tried different seed in every branch loop(in Bold),but it has no effects,thank you for help~~~
import random
import rhinoscriptsyntax as rs
import Grasshopper as gh
dt= gh.DataTree[int]()
Length=10000
brickLength=(2000,1500)
brickLengthList=[]
sumLength=0
LastTempLength=0
tempLength=0
sameCount=0
for i in range(4):
p=gh.Kernel.Data.GH_Path(i)
random.seed(i)
while sumLength<Length:
tempLength=random.choice(brickLength)
if tempLength==LastTempLength:
sameCount+=1
if sameCount>=2:
sameCount=0
continue
LastTempLength=tempLength
brickLengthList.append(tempLength)
sumLength+=tempLength
dt.AddRange(brickLengthList,p)
a=dt
Tags:
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by