vendredi 2 mars 2018

Moiré : une réalisation de Gilg Juergen

D'après une carte postale ``turn the top part'', achetée à la boutique du centre Beaubourg à Paris, exploitant le phénomène de moiré,  redessinée avec PSTricks, dont le code est donné après le Gif.
\documentclass{article}
\usepackage{pstricks-add,animate}
\usepackage[a4paper]{geometry}
\pagestyle{empty}
\begin{document}
\def\myMoire{%
\psset{dimen=inner,linewidth=0pt}
\def\carre{%
\pnodes{AL}(0,0)(-1.5,1.5)(-1.5,1.2)(-1.5,0.9)(-1.5,0.7)(-1.5,0.4)(-1.5,0.2)(-1.5,0)%
(-1.5,-0.2)(-1.5,-0.4)(-1.5,-0.6)(-1.5,-0.75)(-1.5,-0.9)(-1.5,-1.05)(-1.5,-1.15)%
(-1.5,-1.25)(-1.5,-1.3)(-1.5,-1.4)(-1.5,-1.45)
\pnodes{AR}(0,0)(1.5,-1.5)(1.5,-1.2)(1.5,-0.9)(1.5,-0.7)(1.5,-0.4)(1.5,-0.2)(1.5,0)%
(1.5,0.2)(1.5,0.4)(1.5,0.6)(1.5,0.75)(1.5,0.9)(1.5,1.05)(1.5,1.15)(1.5,1.25)%
(1.5,1.3)(1.5,1.4)(1.5,1.45)
\multido{\iA=1+2,\iB=2+2}{9}{\pspolygon*(AL\iA)(AR\iA)(AR\iB)(AL\iB)}%
\pnodes{BL}(0,0)(-1.2,1.5)(-0.9,1.5)(-0.7,1.5)(-0.4,1.5)(-0.2,1.5)(0.0,1.5)(0.2,1.5)%
(0.4,1.5)(0.6,1.5)(0.75,1.5)(0.9,1.5)(1.05,1.5)(1.15,1.5)(1.25,1.5)(1.3,1.5)%
(1.4,1.5)(1.45,1.5)(1.5,1.5)
\pnodes{BR}(0,0)(1.2,-1.5)(0.9,-1.5)(0.7,-1.5)(0.4,-1.5)(0.2,-1.5)(0,-1.5)(-0.2,-1.5)%
(-0.4,-1.5)(-0.6,-1.5)(-0.75,-1.5)(-0.9,-1.5)(-1.05,-1.5)(-1.15,-1.5)(-1.25,-1.5)%
(-1.3,-1.5)(-1.4,-1.5)(-1.45,-1.5)(-1.5,-1.5)
\multido{\iA=1+2,\iB=2+2}{9}{\pspolygon*(BL\iA)(BR\iA)(BR\iB)(BL\iB)}%
}%
\def\half{%
\rput(0,0){\carre}
\rput(-3,0){\psscalebox{-1 1}{\carre}}
}
\def\pattern{%
\rput(0,0){\half}
\rput(0,-3){\psscalebox{1 -1}{\half}}
}
\multido{\iA=0+6}{2}{%
  \multido{\iB=0+-6}{3}{%
    \rput(\iA,\iB){\pattern}
}}
}

\psset{unit=0.75}
\begin{animateinline}[controls,loop,
    begin={\begin{pspicture}(-7,-19)(10,5)},
    end={\end{pspicture}}]{10}% 10 frames/s (velocity of the animation)
\multiframe{11}{i=0+2}{% number of frames
\rput(0,0){\myMoire}
\psrotate(1.5,-7){\i}{\myMoire}
}
\multiframe{21}{i=20+-2}{%
\rput(0,0){\myMoire}
\psrotate(1.5,-7){\i}{\myMoire}
}
\multiframe{10}{i=-20+2}{%
\rput(0,0){\myMoire}
\psrotate(1.5,-7){\i}{\myMoire}
}
\end{animateinline}
\end{document}





2 commentaires:

  1. a shorter \carre:

    \def\carre{%
    \pnodes{AL}(0,0)(-1.5,1.5)(-1.5,1.2)(-1.5,0.9)(-1.5,0.7)(-1.5,0.4)(-1.5,0.2)(-1.5,0)%
    (-1.5,-0.2)(-1.5,-0.4)(-1.5,-0.6)(-1.5,-0.75)(-1.5,-0.9)(-1.5,-1.05)(-1.5,-1.15)%
    (-1.5,-1.25)(-1.5,-1.3)(-1.5,-1.4)(-1.5,-1.45)
    \pnodes{AR}(0,0)(1.5,-1.5)(1.5,-1.2)(1.5,-0.9)(1.5,-0.7)(1.5,-0.4)(1.5,-0.2)(1.5,0)%
    (1.5,0.2)(1.5,0.4)(1.5,0.6)(1.5,0.75)(1.5,0.9)(1.5,1.05)(1.5,1.15)(1.5,1.25)%
    (1.5,1.3)(1.5,1.4)(1.5,1.45)
    \multido{\iA=1+2,\iB=2+2}{9}{\pspolygon*(AL\iA)(AR\iA)(AR\iB)(AL\iB)}%
    \pnodes{BL}(0,0)(-1.2,1.5)(-0.9,1.5)(-0.7,1.5)(-0.4,1.5)(-0.2,1.5)(0.0,1.5)(0.2,1.5)%
    (0.4,1.5)(0.6,1.5)(0.75,1.5)(0.9,1.5)(1.05,1.5)(1.15,1.5)(1.25,1.5)(1.3,1.5)%
    (1.4,1.5)(1.45,1.5)(1.5,1.5)
    \pnodes{BR}(0,0)(1.2,-1.5)(0.9,-1.5)(0.7,-1.5)(0.4,-1.5)(0.2,-1.5)(0,-1.5)(-0.2,-1.5)%
    (-0.4,-1.5)(-0.6,-1.5)(-0.75,-1.5)(-0.9,-1.5)(-1.05,-1.5)(-1.15,-1.5)(-1.25,-1.5)%
    (-1.3,-1.5)(-1.4,-1.5)(-1.45,-1.5)(-1.5,-1.5)
    \multido{\iA=1+2,\iB=2+2}{9}{\pspolygon*(BL\iA)(BR\iA)(BR\iB)(BL\iB)}%
    }%

    RépondreSupprimer
  2. Merci Herbert. Le code a été modifié d'après le fichier envoyé par Juergen qui tient compte des simplifications suggérées par Herbert.

    RépondreSupprimer