#DM2 - WS2024-25 - Group Hirschberg 3 #Raphael Wieser #hue2 - 2d pattern #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 = 30 #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): myran = ran.randint(0,30) #randominteger between 0 and 9 if (i > 2) and (myran < 15): #Bedingung aufstellen box = rs.AddBox(corners) rs.MoveObjects(box, (i*offs,j*offs) ) #i startet mit 0 rs.ObjectColor(box, (1*(255/num), i*(255/num), (j*(255/num)))) #addcolor RED depending on location in space rs.EnableRedraw(1) #enables the live view of the code execution