# Rainbow cubes dance

## Script

#Bottom A1 = (1, 1, -1) A2 = (1, -1, -1) A3 = (-1, 1, -1) A4 = (-1, -1, -1) #Top A5 = (1, 1, 1) A6 = (1, -1, 1) A7 = (-1, 1, 1) A8 = (-1, -1, 1) c1 = Cube(A3, A4, A2) t = Slider(0, 1, 0.01, 1, 170, false, true, false, false) SetValue(t, 0) f = 0 O = (0,0,0) n = 15 Ln = 1..n Lname = Zip("cube"+k, k, Ln) Execute(Zip( name+" = Rotate( Rotate( Dilate(c1, "+k+"), f, O, Line(O, (1; f; f + "+k+" * 2 pi/n)) ), f, O, Line(O, (1; f; f + "+k+" * 2 pi/n)) ) ", k, Ln, name, Lname)) mapping(v, x, y, z, w) = z + (v - x) * (w- z) / (y - x); Execute(Zip(" ShowLabel("+name+", false) ", name, Lname)) Execute(Zip(" SetLineThickness("+name+", floor(mapping("+k+", 1, 15, 2, 6))) ", k, Ln, name, Lname)) Execute(Zip(" SetDynamicColor("+name+", "+k+"/15, 1, 0.8) ", k, Ln, name, Lname)) Execute(Zip(" SetFilling("+name+", 0) ", name, Lname)) #l1 = Zip( Rotate( Rotate( Dilate(c1, k), f, (0, 0, 0), Line(O, (1; f; f + k * 2 pi/n)) ), f, (0, 0, 0), Line(O, (1; f; f + k * 2 pi/n)) ) , k, 1..n) StartAnimation(t)