summaryrefslogtreecommitdiff
path: root/info/drawing-with-metapost/src/illusions-pinna.mp
blob: 070802a5d955d3e925d43da5ddcc3c4a505254ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
\documentclass[border=5mm]{standalone}
\usepackage{luamplib}
\begin{document}
\mplibtextextlabel{enable}
\begin{mplibcode}
beginfig(1);
    path s; s = unitsquare shifted -(1/2, 1/2) scaled 23;
    for n = 1 upto 4:
        numeric N; N = 10n + 8;
        numeric a; a = 30 normaldeviate;
        for t=0 upto N-1:
            draw s rotated if odd n: - fi 13 shifted (5N * right) rotated (360 / N * t + a)
                withcolor t mod 2;
        endfor
    endfor
    picture P;
    P = currentpicture; currentpicture := nullpicture;
    fill bbox P withcolor 0.42;
    draw P;
endfig;
\end{mplibcode}
\end{document}