lundi 4 janvier 2016

Bonne Année - Happy New Year 2016





\documentclass{article}
%\begin{pspicture}(-3,0)(3,3)
\usepackage[paperwidth=6cm,paperheight=3cm,hmargin={0cm,0cm},vmargin={0cm,0cm},dvips]{geometry}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\usepackage{pst-text,multido}
\DeclareFixedFont{\RM}{T1}{ptm}{b}{n}{3cm}
\makeatletter
%% adapté de \psRandom du package pstricks-add
%% pour rendre aléatoire la taille des points
\define@key[psset]{pstricks}{randomPoints}{\def\psk@randomPoints{#1}}
\define@key[psset]{pstricks}{DotScale}{\def\psk@DotScale{#1 }}
\define@boolkey[psset]{pstricks}[Pst@]{color}[true]{}
\psset[pstricks]{randomPoints=1000,color=false,DotScale=1}
\def\psRandomDots{\pst@object{psRandomDots}}%
\def\psRandomDots@i{\@ifnextchar({\psRandomDots@ii}{\psRandomDots@iii(0,0)(1,1)}}
\def\psRandomDots@ii(#1){\@ifnextchar({\psRandomDots@iii(#1)}{\psRandomDots@iii(0,0)(#1)}}
\def\psRandomDots@iii(#1)(#2)#3{%
  \def\pst@tempA{#3}%
  \ifx\pst@tempA\pst@empty\psclip{\psframe(#2)}\else\psclip{#3}\fi
  \pst@getcoor{#1}\pst@tempA
  \pst@getcoor{#2}\pst@tempB
  \begin@SpecialObj
  \addto@pscode{
    \pst@tempA\space /yMin exch def
    /xMin exch def
    \pst@tempB\space /yMax exch def
    /xMax exch def
    /dy yMax yMin sub def
    /dx xMax xMin sub def
    rrand srand                 % initializes the random generator
    /getRandReal { rand 2147483647 div } def
     \psk@randomPoints {
    /DS \psk@DotScale getRandReal mul def
     getRandReal dx mul xMin add
     getRandReal dy mul yMin add
     DS 0 360 arc
     \ifPst@color getRandReal 1 1 sethsbcolor
     \else
    \pst@usecolor\psfillcolor
    \fi
     fill
    } repeat
  }%
  \end@SpecialObj
  \endpsclip
  \ignorespaces
}
\begin{document}
\begin{center}
\begin{pspicture}[showgrid=false](-3,0)(3,3)
\rput(0,1.5){\red\RM 2015}%
\end{pspicture}
\multido{\i=5000+-100}{50}{%
\begin{pspicture}[showgrid=false](-3,0)(3,3)
\rput(0,1.5){\red\RM 201\hphantom{5}}%
\begin{pscharclip}[linewidth=0.1pt,linestyle=none]{%
\rput(0,1.5){\RM 2015}}%
\psRandomDots[fillcolor=red,
    randomPoints=\i,DotScale=0.5,color=false](1.5,0)(3,3){\psframe(1.5,0)(3,3)}
\end{pscharclip}
\end{pspicture}\newpage}
%
\multido{\i=0+100}{50}{%
\begin{pspicture}[showgrid=false](-3,0)(3,3)
\rput(0,1.5){\red\RM 201\hphantom{6}}%
\begin{pscharclip}[linewidth=0.1pt,linestyle=none]{%
\rput(0,1.5){\RM 2016}}%
\psRandomDots[fillcolor=red,
    randomPoints=\i,DotScale=1,color=true](1.5,0)(3,3){\psframe(1.5,0)(3,3)}
\end{pscharclip}
\end{pspicture}\newpage}
\begin{pspicture}[showgrid=false](-3,0)(3,3)
\rput(0,1.5){\red\RM 201\hphantom{6}}%
\begin{pscharclip}[linewidth=0.1pt,linestyle=none]{%
\rput(0,1.5){\RM 2016}}%
\psRandomDots[fillcolor=red,
    randomPoints=10000,DotScale=1,color=true](1.5,0)(3,3){\psframe(1.5,0)(3,3)}
\end{pscharclip}
\end{pspicture}
\end{center}
\end{document}

Aucun commentaire:

Enregistrer un commentaire