import rhinoscriptsyntax as rs allobjs = rs.AllObjects() rs.DeleteObjects(allobjs) bsize = 10 #side length of box dist = 1 #distance between boxes offs = bsize + dist #offset of boxes num = 10 #number of boxes in one row n = 1 #create a box 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)] rs.EnableRedraw(False) """ fibonacci = [0] a, b = 3,3 while b < (num ** 3): fibonacci.append(b) a, b = b, a+b print fibonacci """ for i in range(num): for j in range(num): for p in range(num): if ((i+j+p) % 5) and ((i+j-p)%3) and ((i-j-p)%3) and ((i-j+p)%3): box = rs.AddBox (corners) rs.MoveObject (box, (i*offs, j*offs, p*offs)) #colors rs.ObjectColor (box, (i* (50/num), j* (160/num), p* (255/num))) rs.EnableRedraw(True)