diff options
author | Karl Berry <karl@freefriends.org> | 2014-08-23 22:46:16 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2014-08-23 22:46:16 +0000 |
commit | 714d34bcd751b70118d43b9592878923b509fa02 (patch) | |
tree | 765ece91f34f3d5665eb96b80cfeb80dd6c56e9a /Master/texmf-dist/tex/generic/pst-spirograph | |
parent | 5caddc787b889e7f0a38ec359b4d9fc9ba22488d (diff) |
pst-spirograph (23aug14)
git-svn-id: svn://tug.org/texlive/trunk@35026 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-spirograph')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-spirograph/pst-spirograph.tex | 250 |
1 files changed, 53 insertions, 197 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-spirograph/pst-spirograph.tex b/Master/texmf-dist/tex/generic/pst-spirograph/pst-spirograph.tex index 57b941240e6..c015ca5bca2 100644 --- a/Master/texmf-dist/tex/generic/pst-spirograph/pst-spirograph.tex +++ b/Master/texmf-dist/tex/generic/pst-spirograph/pst-spirograph.tex @@ -1,4 +1,4 @@ -%% $Id: pst-spirograph.tex 75 2014-08-19 18:38:05Z herbert $ +%% $Id: pst-spirograph.tex 80 2014-08-23 05:50:14Z herbert $ %% %% This is file `pst-spirograph.tex', %% @@ -7,7 +7,7 @@ %% Package `pst-spirograph.tex' %% %% COPYRIGHT 2015 by -%% Manuel Luque +%% Manuel Luque <manuel.luque27@gmail.com> %% Herbert Voss <hvoss@tug.org> %% %% This program can be redistributed and/or modified under the terms @@ -15,7 +15,7 @@ %% in directory CTAN:/macros/latex/base/lppl.txt. %% %% DESCRIPTION: -%% `pst-spirograph' is a PSTricks package to show sprograph curves +%% `pst-spirograph' is a PSTricks package to show spirograph curves %% %% \csname PSTSPIROGRAPHLoaded\endcsname @@ -23,9 +23,9 @@ % Requires some packages \ifx\PSTricksLoaded\endinput\else \input pstricks \fi \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi -\def\fileversion{0.40} -\def\filedate{2014/08/18} -\message{`PSTSPIROGRAPH' v\fileversion, \filedate} +\def\fileversion{0.41} +\def\filedate{2014/08/23} +\message{`PSTSPIROGRAPH' v\fileversion, \filedate\ (ml,hv)} \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax @@ -68,198 +68,54 @@ \def\psSpirograph{\def\pst@par{}\pst@object{psSpirograph}} \def\psSpirograph@i{\@ifnextchar({\psSpirograph@ii}{\psSpirograph@ii(0,0)}} \def\psSpirograph@ii(#1){% -\begin@SpecialObj -\pst@@getcoor{#1}% -\addto@pscode{ -tx@spirographDict begin -\pst@coor /t@@y ED /t@@x ED -1 setlinejoin -/cm {\pst@number\psunit mul } bind def -/Z1 \psk@ZA def -/m1 \psk@m def -/Z2 \psk@ZB def -/m2 \psk@m def -/ap \psk@ap def -/polarAngle \psk@polarangle def -/ni \psk@holenumber def % numero du trou -ni 8 ge {/ni 8 def} if -/thetamax \psk@thetamax def -/ifinner \ifPst@spirograph@inner true \else false \fi def -/ki 1 ni 9 div sub def -/r2 m1 Z2 mul 2 div def -/qi Z1 Z2 div 1 sub def -/qi2 Z1 Z2 div 1 add def -thetamax 0 le {/pas -1 def}{/pas 1 def} ifelse -/tabSpirograph [ % tableau des points de l'hypocycloide -0 pas thetamax {/i_ exch def [i_ coorPen]} for - ] def -/tabSpirograph2 [ % tableau des points de l'epicycloide -0 pas thetamax {/i_ exch def [i_ coorPen2]} for - ] def -/nPts tabSpirograph length 1 sub def -/nPts2 tabSpirograph2 length 1 sub def -/color1 {\pst@usecolor\pscolora } def -/color2 {\pst@usecolor\pscolorb } def -/circlescolor {\pst@usecolor\pscolorc } def -/curvecolor {\pst@usecolor\pscolord } def -/linecolor {\pst@usecolor\pslinecolor} def -/fillopacity \psk@opacityalpha def + \begin@SpecialObj + \pst@@getcoor{#1}% + \addto@pscode{ + tx@spirographDict begin + \pst@coor /t@@y ED /t@@x ED + 1 setlinejoin + /cm { \pst@number\psunit mul } bind def + /Z1 \psk@ZA def + /m1 \psk@m def + /Z2 \psk@ZB def + /m2 \psk@m def + /ap \psk@ap def + /polarAngle \psk@polarangle def + /setlinedash { [ \psk@dash\space ] 0 setdash } def + /ni \psk@holenumber def % numero du trou + ni 8 gt {/ni 8 def} if + /thetamax \psk@thetamax def % -/Circles { -gsave -[ \psk@dash\space ] 0 setdash -newpath -0 0 R@ cm 0 360 arc -closepath -circlescolor -stroke -% on ne dessine pas le cercle de base -%newpath -%0 0 Rb cm 0 360 arc -%closepath -%stroke -grestore -} def -/trous { -1 dict begin - /a@ {R@ cm 3 div 3.14159 div} bind def - gsave - positionAngular rotate - 0 60 540 {/THETA exch def - untrou - 1 setgray -/fill \tx@setTransparency /fill load def - fill - untrou - linecolor - stroke - } for - grestore - end -}def -%%% Les dessins de l'engrenage %%%%%% -%%%%%%%%%% Roue N°1 %%%%%%%%%%%%%%%%% -/Roue1{ -1 dict begin -/wheel 1 def -gsave -t@@x t@@y translate -m1 Z1 -ifinner { - Datas2 - Calculs - Beta_ rotate - Roue - COURONNE - closepath - \ifx\psk@fillstyle\relax\else color1 /fill \tx@setTransparency /fill load def fill \fi -Roue -closepath -linecolor -stroke -COURONNE -closepath -linecolor -stroke -\ifPst@spirograph@circles Circles \fi -}{ - Datas1 - Calculs - Beta_ rotate - Roue - closepath - \ifx\psk@fillstyle\relax\else color1 /fill \tx@setTransparency /fill load def fill \fi -Roue -closepath -linecolor -stroke -\ifPst@spirograph@circles Circles \fi -} ifelse -grestore -% dessin de l'hypocycloide ou de l'epicycloide -gsave -t@@x t@@y translate -\ifPst@spirograph@inner -tabSpirograph 0 get aload pop moveto -1 1 nPts {/nP exch def - tabSpirograph nP get aload pop lineto - } for -\else -tabSpirograph2 0 get aload pop moveto -1 1 nPts2 {/nP exch def - tabSpirograph2 nP get aload pop lineto - } for -\fi -curvecolor -\pst@number\pscurvewidth SLW -stroke -grestore -end -} def -Roue1 -%%%%%%%%%% Roue N°2 %%%%%%%%%%%%%%%%% -/Roue2 { -5 dict begin -/wheel 2 def -gsave -m2 Z2 Datas1 -Calculs -/a@ex m2 Z1 Z2 add mul 2 div cm def % entraxe engrenage exterieur -/a@in m2 Z1 Z2 sub mul 2 div cm def % entraxe engrenage interieur -/a@ {R@ cm 3 div 3.14159 div} bind def -\ifPst@spirograph@inner - a@in polarAngle cos mul t@@x add a@in polarAngle sin mul t@@y add translate - Beta_ polarAngle Z1 Z2 sub Z2 div mul sub rotate - /positionAngular 2Beta 2 div def -\else - a@ex polarAngle cos mul t@@x add a@ex polarAngle sin mul t@@y add translate - DeltaSdeg DeltaP add neg 180 Z2 div add 180 add polarAngle Z1 Z2 add Z2 div mul add rotate - /positionAngular Beta_ neg def -\fi -Roue -closepath -\ifx\psk@fillstyle\relax\else - color2 -/fill \tx@setTransparency /fill load def - fill -\fi -Roue -closepath -linecolor -stroke -trous -\ifPst@spirograph@circles Circles \fi -grestore -gsave -newpath -\ifPst@spirograph@inner - a@in polarAngle cos mul t@@x add a@in polarAngle sin mul t@@y add translate - Beta_ polarAngle Z1 Z2 sub Z2 div mul sub rotate - /THETA 540 ni 60 mul sub def - positionAngular rotate - a@ THETA DegtoRad mul THETA cos mul neg - a@ THETA DegtoRad mul THETA sin mul - 0.06 cm 0 360 arc - \else - a@ex polarAngle cos mul t@@x add a@ex polarAngle sin mul t@@y add translate - DeltaSdeg DeltaP add neg 180 Z2 div add 180 add polarAngle Z1 Z2 add Z2 div mul add rotate - /a@ {R@ cm 3 div 3.14159 div} bind def - /THETA 540 ni 60 mul sub def - positionAngular rotate - a@ THETA DegtoRad mul THETA cos mul neg - a@ THETA DegtoRad mul THETA sin mul - 0.06 cm 0 360 arc -\fi -closepath -curvecolor -fill -grestore - end - } def -Roue2 -end -}% -\end@SpecialObj}% % fin de la commande PSTricks + /ifinner \ifPst@spirograph@inner true \else false \fi def + /ifcircles \ifPst@spirograph@circles true \else false \fi def + /iffill \ifx\psk@fillstyle\relax false \else true \fi def + /Fill { \tx@setTransparency fill } def +% + /ki 1 ni 9 div sub def + /r2 m1 Z2 mul 2 div def + /qi Z1 Z2 div 1 sub def + /qi2 Z1 Z2 div 1 add def + thetamax 0 le {/pas -1 def}{/pas 1 def} ifelse +% tableau des points de l'hypocycloide + /tabSpirograph [ 0 pas thetamax {/i_ exch def [i_ coorPen]} for ] def +% tableau des points de l'epicycloide + /tabSpirograph2 [ 0 pas thetamax {/i_ exch def [i_ coorPen2]} for ] def + /nPts tabSpirograph length 1 sub def + /nPts2 tabSpirograph2 length 1 sub def + /color1 {\pst@usecolor\pscolora } def + /color2 {\pst@usecolor\pscolorb } def + /circlescolor {\pst@usecolor\pscolorc } def + /curvecolor {\pst@usecolor\pscolord } def + /linecolor {\pst@usecolor\pslinecolor} def + /fillopacity \psk@opacityalpha def + /SetCurveWidth { \pst@number\pscurvewidth SLW } def +% + Roue1 + Roue2 + end + }% + \end@SpecialObj + \ignorespaces} % \catcode`\@=\PstAtCode\relax % |