Message Boards Message Boards

GROUPS:

[GIF] Stay Connected (Rhombus tiling deformation)

Posted 2 years ago
2239 Views
|
1 Reply
|
5 Total Likes
|

Rhombus tiling deformation

Stay Conneted

I just got an invite to Dribbble and, as I was picking a few recent GIFs to upload, I looked again at Reinvention and immediately wanted to make a combination of that and of Obfuscate. Not sure I entirely succeeded, but this is the result.

Here's the code:

rhombus[{x_, y_}, ϕ_, θ_] := 
  Polygon[{x, y} + # & /@ 
      Prepend[{#[[1]], #[[1]] + #[[2]], #[[2]]}, {0, 
        0}] &[{{Cos[θ], 
      Sin[θ]}, {Cos[θ + ϕ], 
      Sin[θ + ϕ]}}]];
basicblock[{x_, y_}, ϕ_, t_, n_] := 
 Table[{rhombus[{x, y}, ϕ, θ + t], 
   rhombus[{x + Cos[θ + t] + Cos[θ + t + ϕ], 
     y + Sin[θ + t] + 
      Sin[θ + t + ϕ]}, ϕ, θ + 
     2 π/3]}, {θ, 0, 2 π - 2 π/n, 2 π/n}]

DynamicModule[{cols},
 cols = {RGBColor[
   0.7254901960784313, 0.9137254901960784, 0.21568627450980393`], 
   RGBColor[
   0.11372549019607843`, 0.16862745098039217`, 0.3254901960784314]};
 Manipulate[
  Graphics[{FaceForm[None], 
    EdgeForm[
     Directive[cols[[1]], JoinForm["Round"], Thickness[.00375]]], 
    Table[basicblock[{3 x + 3/4 (-1)^y , 3 Sqrt[3]/2 y}, 
       2 π/3 Haversine[t] - π/3, 0, 6][[;; ;; 2]], {x, -3, 
      3}, {y, -3, 3}]}, 
   PlotRange -> {{-15/2 + 3/4, 15/2 + 3/4}, {-7/2 Sqrt[3], 
      4 Sqrt[3]}}, ImageSize -> 540, Background -> cols[[2]]], {t, 
   0, π}]
 ]

enter image description here - another post of yours has been selected for the Staff Picks group, congratulations !

We are happy to see you at the top of the "Featured Contributor" board. Thank you for your wonderful contributions, and please keep them coming!

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