#DM2 - WS2024-25 - Group Hirschberg 3 #Raphael Wieser #hue2 - 3d #importlibrarys import rhinoscriptsyntax as rs import random as ran #delete everything and start from scratch allobjs = rs.AllObjects() rs.DeleteObjects(allobjs) rs.EnableRedraw(0) #disables the live view of the code execution #setup base variables bsize = 10 #sidelengthofbox dist = 1 #distance between boxes offs = bsize + dist #offset of boxes num = 10 #number of boxes in 1 row #setup corners list corners = [(0,0,0),(bsize,0,0),(bsize,bsize,0),(0,bsize,0), (0,0,bsize),(bsize,0,bsize),(bsize,bsize,bsize),(0,bsize,bsize)] #setup fibonacci row gz = range (0, num**3, 2) #start,end,stepsize #for-loop for creating boxes for i in range(num): for j in range (num): for p in range (num): myran = ran.randint(0,10) #randominteger between 0 and 9 if (i+j >= 3) and (myran > 3) and (myran <7): #Bedingung aufstellen box = rs.AddBox(corners) rs.MoveObjects(box, (i*offs,j*offs,p*offs)) #i startet mit 0 rs.ObjectColor(box, (i*(255/num), j*(255/num), (p*(255/num)))) #addcolor RED depending on location in space rs.EnableRedraw(1) #enables the live view of the code execution