Message Boards Message Boards

7
|
7723 Views
|
2 Replies
|
9 Total Likes
View groups...
Share
Share this post:

[GIF] Reinvention (Morphing the triangular grid)

Morphing the triangular grid

Reinvention

I seem to be stuck on a theme, but I'm having fun.

Here's the code:

DynamicModule[{cols, f},
 cols = RGBColor /@ {"#bcd6c0", "#f56791", "#46454d"};
 f[θ_] := Piecewise[{{0, θ <  0}, 
     {π/6 (1/2 - 1/2 Cos[π θ]), 0 <= θ < 1}, 
     {π/6, 1 <= θ < 2}, 
     {π/6 (3/2 - 1/2 Cos[π θ]), 2 <= θ < 3}, 
     {π/3, θ >= 3}}];
 Manipulate[
  Graphics[{Thickness[.005], 
    Table[{Blend[cols[[{1, 2, 1}]], 3/π f[(j + 3)/6 + θ]], 
      Line[{Sqrt[3] (i + (-1)^j/4), 3/2 j} + # & /@ {#, -#} 
          &[{Cos[2 π k/3 + (-1)^(i + j) f[(j + 3)/6 + θ]], 
              Sin[2 π k/3 + (-1)^(i + j) f[(j + 3)/6 + θ]]}]]}, 
      {i, -3, 3}, {j, -3, 3}, {k, 0, 2}]}, 
   PlotRange -> 5, ImageSize -> 540, Background -> cols[[3]]], {θ, -1, 3}]
 ]
2 Replies

Nice! I find your color picking always very elegant. :)

POSTED BY: Silvia Hao

Very kind of you to say. Thank you!

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract