[GIF] Transition (Shifting string art)

Posted 4 years ago
1982 Views
|
0 Replies
|
4 Total Likes
|
 TransitionNo fancy math this time. Here's what happens when you connect points on edges two apart in a regular octagon by straight lines, then let the odd-numbered vertices of the octagon go to the origin and let even-numbered vertices move away from the origin (plus various other bits of nonsense).Code: DynamicModule[{cols, r, u, verts}, cols = RGBColor /@ {"#35342f", "#f1f2f0"}; Manipulate[ r = 1/2 - Cos[s]/2; u = If[s < ?, s, s + 2 ?]; verts = Table[(1 - r (-1)^(If[s < ?, i + 1, i])) {Cos[ 2 ? i/8 - u/8 - ?/8], Sin[2 ? i/8 - u/8 - ?/8]}, {i, 0, 7}]; Graphics[{Thickness[.005], CapForm["Round"], cols[[1]], Table[Line[{t verts[[i]] + (1 - t) RotateRight[verts][[i]], t RotateLeft[verts][[i]] + (1 - t) RotateLeft[verts, 2][[i]]}], {i, 1, 7, 2}, {t, 0, 1, 1/8}]}, PlotRange -> 3, ImageSize -> 540, Background -> cols[[2]]], {s, 0., 2 ?}]] 
Answer
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments