⬛️⬜️
⬜️⬛️
Inspired by Craig Kaplan's Swirled Series, though it's far too late to be included (and not in the right format, anyway).
This uses ImageDifference
and Rasterize
to get the effect, though I'm sure there's a better way.
Here's the code for an interactive Manipulate
version (because of ongoing bugs in how Wolfram Community renders special characters, I am leaving π as \[Pi]
):
smootheststep[t_] := -20 t^7 + 70 t^6 - 84 t^5 + 35 t^4;
DynamicModule[{t, r = 3},
Manipulate[
t = Floor[Mod[s, 2 r + 1]] + smootheststep[Mod[s, 1]];
ImageDifference[
Rasterize[
Graphics[
{AbsoluteThickness[.25],
Table[
Polygon[
{x, x} + # & /@ ({{-.25, -10}, {-.25, 10}, {.25, 10}, {.25, -10}}.
RotationMatrix[If[s <= 2 r + 1, \[Pi]/2, 0] + \[Pi]/2 Clip[t - Abs[x + r], {0, 1}]])],
{x, -r, r, 1}]},
PlotRange -> r + .25, ImageSize -> 540]],
Rasterize[
Graphics[
{AbsoluteThickness[.25],
Table[
Polygon[
{{x - .25, -10}, {x - .25, 10}, {x + .25, 10}, {x + .25, -10}}.RotationMatrix[\[Pi]/2]],
{x, -r, r, 1}]},
PlotRange -> r + .25, ImageSize -> 540]]],
{s, 0, 4 r + 2 - .001}]
]