# [GIF] Up and Down (Broken triangular grid)

Posted 3 years ago
3755 Views
|
|
4 Total Likes
|
 Up and DownNo fancy math this time, just the tiling of the plane by equilateral triangles, with the up-pointing and down-pointing triangles rotating on separate schedules.Here's the code: smootheststep[t_] := -20 t^7 + 70 t^6 - 84 t^5 + 35 t^4; With[{n = 3, cols = RGBColor /@ {"#FF5964", "#6BF178", "#FFFFFF", "#0a6713"}}, Manipulate[ Graphics[ {EdgeForm[Directive[cols[[3]], Thickness[.005]]], Table[ {FaceForm[cols[[1]]], Polygon[CirclePoints[{Sqrt[3] x + (-1)^y Sqrt[3]/4, 3/2 y}, {1, ?/2 + 2 ?/3 smootheststep[Clip[t - 3 + (y + n)/(2 n), {0, 1}]]}, 3]], FaceForm[cols[[2]]], Polygon[CirclePoints[{Sqrt[3] x - (-1)^y Sqrt[3]/4, 3/2 y + 1/2}, {1, ?/6 + 2 ?/3 smootheststep[Clip[t - (y + n)/(2 n), {0, 1}]]}, 3]]}, {x, -n, n}, {y, -n, n}]}, PlotRange -> {{-Sqrt[3] n + Sqrt[3]/4, Sqrt[3] n + Sqrt[3]/4}, {-Sqrt[3] n + 1/4 - .09, Sqrt[3] n + 1/4 + .07}}, ImageSize -> 540, Background -> cols[[-1]]], {t, 0, 4}] ]