diff options
Diffstat (limited to 'Master/texmf-dist/tex/generic/pst-coil/pst-coil.tex')
-rw-r--r-- | Master/texmf-dist/tex/generic/pst-coil/pst-coil.tex | 82 |
1 files changed, 52 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/generic/pst-coil/pst-coil.tex b/Master/texmf-dist/tex/generic/pst-coil/pst-coil.tex index 077c71d5885..49a1f17a217 100644 --- a/Master/texmf-dist/tex/generic/pst-coil/pst-coil.tex +++ b/Master/texmf-dist/tex/generic/pst-coil/pst-coil.tex @@ -1,3 +1,4 @@ +%% $Id: pst-coil.tex 278 2010-02-01 12:37:08Z herbert $ %% BEGIN pst-coil.tex %% %% Coils and zigzags with PSTricks @@ -20,8 +21,8 @@ \fi \ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi % -\def\fileversion{1.01} -\def\filedate{2010/01/30} +\def\fileversion{1.03} +\def\filedate{2010/02/01} % \edef\TheAtCode{\the\catcode`\@} \catcode`\@=11 @@ -60,33 +61,6 @@ \showpointsfalse \end@OpenObj} % -\define@key[psset]{pst-coil}{frequency}[1]{\def\psk@frequency{#1 }} -\define@key[psset]{pst-coil}{amplitude}[1]{\def\psk@amplitude{#1 }} -\define@key[psset]{pst-coil}{ppoints}[360]{\def\psk@ppoints{#1 }} -\define@key[psset]{pst-coil}{function}[sin]{\def\psk@function{#1 }} -\psset[pst-coil]{frequency=1,amplitude=1,ppoints=360,function=sin} -% -\def\tx@Sin{Sin } -% -\def\pssin{\pst@object{pssin}} -\def\pssin@i{\pst@getarrows\pssin@ii} -\def\pssin@ii(#1){\@ifnextchar({\pssin@iii{1}(#1)}{\pssin@iii{\z@}(0,0)(#1)}} -\def\pssin@iii#1(#2)(#3){% - \begin@OpenObj - \pst@getcoor{#2}\pst@tempa - \pst@getcoor{#3}\pst@tempb - \pst@optcp{#1}\pst@tempa - \addto@pscode{% - \pst@tempa \pst@tempb - \psk@frequency \psk@amplitude \pst@number\psyunit mul - \psk@coilarmA \psk@coilarmB - \psk@ppoints - { \psk@function } - \pst@coildict \tx@Sin end - }% - \showpointsfalse% - \end@OpenObj} -% \def\tx@CoilLoop{CoilLoop } \def\tx@Coil{Coil } \def\psCoil{\def\pst@par{}\pst@object{psCoil}} @@ -165,13 +139,61 @@ \def\pczigzag{\def\pst@par{}\pst@object{pczigzag}} \def\pczigzag@i{\pc@object\nczigzag@ii} % +\def\pst@checkUnit#1#2{\expandafter\pst@checkUnit@i#1!!#2} +\def\pst@checkUnit@i{\@ifnextchar*% + {\def\pst@roundValue{true }\pst@checkUnit@ii}% + {\def\pst@roundValue{false }\pst@checkUnit@ii*}} +\def\pst@checkUnit@ii*#1!!#2{% + \edef\ps@next{#1}% + \ifx\ps@next\@empty\let\pst@num\z@% + \else\expandafter\pst@@checknum\ps@next..\@nil% + \fi% + \ifnum\pst@num=\z@\pst@getlength{#1}{#2}\def\pst@relativePeriod{false }% + \else% + \def\pst@relativePeriod{true }% + \edef#2{\ifnum\pst@num=\tw@-\fi\the\pst@cntg.% + \expandafter\@gobble\the\pst@cnth\space}% + \fi} +% +\define@key[psset]{pst-coil}{periods}[1]{\pst@checkUnit{#1}{\psk@periods}} +\define@key[psset]{pst-coil}{amplitude}[1]{\def\psk@amplitude{#1 }} +\define@key[psset]{pst-coil}{ppoints}[360]{\def\psk@ppoints{#1 }} +\define@key[psset]{pst-coil}{function}[sin]{\def\psk@function{#1 }} +\psset[pst-coil]{periods=1,amplitude=1,ppoints=360,function=sin} +% +\def\tx@Sin{Sin } +\def\pssin{\pst@object{pssin}} +\def\pssin@i{\pst@getarrows\pssin@ii} +\def\pssin@ii(#1){\@ifnextchar({\pssin@iii{1}(#1)}{\pssin@iii{\z@}(0,0)(#1)}} +\def\pssin@iii#1(#2)(#3){% + \begin@OpenObj + \pst@getcoor{#2}\pst@tempa + \pst@getcoor{#3}\pst@tempb + \pst@optcp{#1}\pst@tempa + \addto@pscode{% + \pst@tempa \pst@tempb + \psk@periods + \pst@relativePeriod + \pst@roundValue + \psk@amplitude \pst@number\psyunit mul + \psk@coilarmA \psk@coilarmB + \psk@ppoints + { \psk@function } + \pst@coildict \tx@Sin end + }% + \showpointsfalse% + \end@OpenObj} +% \def\ncsin{\pst@object{ncsin}} \def\ncsin@i{\check@arrow{\ncsin@ii}} \def\ncsin@ii#1#2{\nc@object{Open}{#1}{#2}{.5}{% \tx@NCCoor tx@Dict begin 4 2 roll - \psk@frequency \psk@amplitude \pst@number\psyunit mul + \psk@periods + \pst@relativePeriod + \pst@roundValue + \psk@amplitude \pst@number\psyunit mul \psk@coilarmA \psk@coilarmB \psk@ppoints { \psk@function } |