diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-moire')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-moire/pst-moire.tex | 66 |
1 files changed, 63 insertions, 3 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-moire/pst-moire.tex b/Master/texmf-dist/tex/generic/pst-moire/pst-moire.tex index 0962bd35cf2..4bf117ec4df 100644 --- a/Master/texmf-dist/tex/generic/pst-moire/pst-moire.tex +++ b/Master/texmf-dist/tex/generic/pst-moire/pst-moire.tex @@ -20,8 +20,8 @@ %% `pst-moire' is a PSTricks package to draw moire patterns %% %% %% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -\def\fileversion{2.0}% -\def\filedate{2018/11/16}% +\def\fileversion{2.1}% +\def\filedate{2018/11/22}% \message{`PST-MOIRE v\fileversion, \filedate\space (ML)}% \csname PSTMoireLoaded\endcsname % Requires PSTricks, pst-xkey and pst-node packages @@ -53,7 +53,7 @@ \define@key[psset]{pst-moire}{hole}{\def\pst@moirage@hole{#1}} % \psset[pst-moire]{Rmax=6,scale=1,Alpha=70,rotate=0,E=0.25,n=30,T=2} -\psset[pst-moire]{r=0.5,p=4,k=0.2,symbole=2,rotate=-1,PSfont=Helvetica-Bold,fontsize=4.7,vadjust=-1.5,hadjust=0,hole=round} +\psset[pst-moire]{r=0.5,p=4,k=0.2,symbole=2,rotate=0,PSfont=Helvetica-Bold,fontsize=4.7,vadjust=-1.5,hadjust=0,hole=round} % \def\variablesMoirages{% /R \psk@moire@R\space def @@ -345,6 +345,66 @@ star-shapped }% fin du code ps \end@SpecialObj }% % fin de la commande PSTricks +% +\define@key[psset]{pst-moire}{NumberDots}{\edef\psk@moire@NumberDots{#1 }} % Number of dots +\define@key[psset]{pst-moire}{coefficients}{\edef\psk@moire@coefficients{#1 }} % [a b theta tx ty] +\define@key[psset]{pst-moire}{srand}{\edef\psk@moire@srand{#1 }} % graine aléatoire pour postscript +\define@boolkey[psset]{pst-moire}[Pst@moire@]{revlayer}[true]{} +\define@boolkey[psset]{pst-moire}[Pst@moire@]{layer}[true]{} +% Default values +\psset{NumberDots=2000,coefficients=1.05 1.05 0 0 0,revlayer=true,layer=true,srand=10} +% +\def\psRandomDotPatterns{\def\pst@par{}\pst@object{psRandomDotPatterns}} +\def\psRandomDotPatterns@i{% +\addbefore@par{dotsize=2pt,fillcolor=black} +\begin@SpecialObj +\addto@pscode{% + /N_ \psk@moire@NumberDots def + \psk@dotsize + \@nameuse{psds@\psk@dotstyle} + /dotcolor {\pst@usecolor\pslinecolor } def + /dotcolor2 {\pst@usecolor\psfillcolor} def + /DOT {r 0 360 arc fill} def +\ifPst@moire@revlayer /revealinglayer true def \else /revealinglayer false def \fi +\ifPst@moire@layer /layer true def \else /layer false def \fi +/cm {\pst@number\psunit mul} bind def +/xmax 5 cm round cvi def +/ymax xmax def +/GlassPattern { +7 dict begin +/ty exch def +/tx exch def +/t exch def % theta degrees +/b exch def +/a exch def +layer { +\psk@moire@srand srand +N_ { + /x rand 2 xmax mul mod xmax sub def % -xmax<x<xmax + /y rand 2 ymax mul mod ymax sub def % -ymax<y<ymax + /r rand 2147483647 div 2 mul def + dotcolor x y DOT + } repeat + } if +% transformation +a b scale t rotate tx ty translate +\psk@moire@srand srand +revealinglayer { +N_{ + /x rand 2 xmax mul mod xmax sub def % -xmax<x<xmax + /y rand 2 ymax mul mod ymax sub def % -ymax<y<ymax + /r rand 2147483647 div 2 mul def + dotcolor2 x y DOT + } repeat + } if +grestore +end + } def +[\psk@moire@coefficients] length 3 eq {\psk@moire@coefficients 0 0} {\psk@moire@coefficients} ifelse +GlassPattern + }% fin du code ps + \end@SpecialObj + }% % fin de la commande PSTricks \catcode`\@=\PstAtCode\relax %% END: pst-moire.tex \endinput |