texlive[54295] Master/texmf-dist: pst-spirograph (14mar20)

commits+karl at tug.org commits+karl at tug.org
Sat Mar 14 21:42:01 CET 2020


Revision: 54295
          http://tug.org/svn/texlive?view=revision&revision=54295
Author:   karl
Date:     2020-03-14 21:42:00 +0100 (Sat, 14 Mar 2020)
Log Message:
-----------
pst-spirograph (14mar20)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/pst-spirograph/Changes
    trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/README.anim
    trunk/Master/texmf-dist/doc/generic/pst-spirograph/pst-spirograph-doc.pdf
    trunk/Master/texmf-dist/doc/generic/pst-spirograph/pst-spirograph-doc.tex
    trunk/Master/texmf-dist/dvips/pst-spirograph/pst-spirograph.pro
    trunk/Master/texmf-dist/tex/generic/pst-spirograph/pst-spirograph.tex
    trunk/Master/texmf-dist/tex/latex/pst-spirograph/pst-spirograph.sty

Added Paths:
-----------
    trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/anim9.tex
    trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animA.tex
    trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animB.tex
    trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animC.tex

Modified: trunk/Master/texmf-dist/doc/generic/pst-spirograph/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-spirograph/Changes	2020-03-14 20:40:07 UTC (rev 54294)
+++ trunk/Master/texmf-dist/doc/generic/pst-spirograph/Changes	2020-03-14 20:42:00 UTC (rev 54295)
@@ -1,4 +1,6 @@
 ----- pst-spirograph.tex
+0.51  2020-03-14  - added new optional argument for a rubber band connection
+                    of two gears
 0.50  2020-03-11  - added new optional argument TypeA for special graphs
 0.41  2014-08-23  - updated documentation
                   - move some more PS functions into the pro file 
@@ -6,6 +8,7 @@
 
 
 ----- pst-spirograph.pro
+0.51  2020-03-14  - added some more functions 
 0.50  2020-03-11  - added some more functions 
 0.41  2014-08-23  - added some more functions 
 0.40  2014-08-18  - first CTAN version (hv) 
@@ -12,6 +15,7 @@
 
 
 ----- pst-spirograph.sty
+0.51  2020-03-14  - load more required files 
 0.50  2020-03-11  - updated file dates 
 0.41  2014-08-23  - updated file dates 
 0.40  2014-08-18  - first CTAN version (hv) 

Modified: trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/README.anim
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/README.anim	2020-03-14 20:40:07 UTC (rev 54294)
+++ trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/README.anim	2020-03-14 20:42:00 UTC (rev 54295)
@@ -2,7 +2,7 @@
 
 latex <file>
 dvips <file>
-ps2pdf <file>.ps
+ps2pdf -dNOSAFER <file>.ps
 
 and then view the pdf with the acrobat reader, available from Adobe
 if not already installed on your current system.
\ No newline at end of file

Added: trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/anim9.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/anim9.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/anim9.tex	2020-03-14 20:42:00 UTC (rev 54295)
@@ -0,0 +1,24 @@
+\documentclass[border=5mm]{standalone}
+\usepackage{animate}
+\usepackage{pst-spirograph}
+\addtopsstyle{gridstyle}{gridlabels=0pt}
+
+\begin{document}
+
+\psset{unit=0.25cm}
+\begin{animateinline}[
+  width=0.9\linewidth,begin={\begin{pspicture}(-20,-20)(20,20)},end={\end{pspicture}},palindrome,controls]{5}
+\multiframe{325}{i=0+10}{%
+\psgrid[subgriddiv=0,gridcolor=black!20,unit=2](-10,-10)(10,10)%
+\ifnum\i=325 \psset{gearwheels=false}\fi
+\psSpirograph[Z1=72,Z2=16,m=0.2,ap=10,TypeA=false,linewidth=0.02,linecolor={[rgb]{0.5 0 0 }},fillstyle=solid,
+  opacity=0.75,polarangle=\i,circles=false,thetamax=\i,curvecolor=blue,curvewidth=2pt,
+    HolePos=0.5,color1=cyan!10,color2=cyan!10,strokeopacity=0.5]%
+\psSpirograph[Z1=72,Z2=16,m=0.2,ap=10,TypeA=false,linewidth=0.02,linecolor={[rgb]{0.5 0 0 }},fillstyle=solid,
+  opacity=0.75,polarangle=\i,circles=false,thetamax=\i,curvecolor=green,curvewidth=2pt,
+    HolePos=1.5,color1=cyan!10,color2=cyan!10,strokeopacity=0.5,gearwheels=false]
+}
+\end{animateinline}
+
+\end{document}
+


Property changes on: trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/anim9.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animA.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animA.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animA.tex	2020-03-14 20:42:00 UTC (rev 54295)
@@ -0,0 +1,23 @@
+\documentclass[border=5mm]{standalone}
+\usepackage{geometry}
+\geometry{paperwidth=18cm,paperheight=21cm,margin=1cm}
+\usepackage{animate}
+\usepackage{pst-spirograph}
+\addtopsstyle{gridstyle}{gridlabels=0pt}
+
+\begin{document}
+
+\psset{unit=0.5cm}
+\begin{animateinline}[
+  width=0.9\linewidth,begin={\begin{pspicture}(-18,-18)(18,18)},end={\end{pspicture}},palindrome,controls]{5}
+\multiframe{181}{i=0+10}{%
+\psgrid[style=gridstyleA]%
+\ifnum\i=181 \psset{gearwheels=false}\fi
+\psSpirograph[Z1=60,Z2=24,m=0.2,linewidth=0.025,TypeA=false,
+    linecolor=blue,fillstyle=solid,opacity=0.75,polarangle=\i,circles=false,thetamax=\i,curvecolor=red,curvewidth=2pt,HolePos=1.7,
+    gearwheels=false,
+    circles]}
+\end{animateinline}
+
+\end{document}
+


Property changes on: trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animA.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animB.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animB.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animB.tex	2020-03-14 20:42:00 UTC (rev 54295)
@@ -0,0 +1,22 @@
+\errorcontextlines=100
+\documentclass{article}
+\usepackage{geometry}
+\geometry{paperwidth=16.5cm,paperheight=12cm,margin=1cm}
+\pagestyle{empty}
+\usepackage{pst-spirograph,animate}
+\begin{document}
+
+\noindent
+\begin{animateinline}[
+  begin={\begin{pspicture}(-6,-3)(8,6)\psframe*[linecolor=yellow,opacity=0.4](-6,-3)(8,6)},
+  end={\end{pspicture}},
+  palindrome,controls,
+%  autoplay
+]{5}
+\multiframe{361}{iA=0+2}{%
+\psSpirograph[RubberBand,Z1=20,Z2=40,m=0.2,viewpoint=2 -5 3,arrowinset=0,arrowsize=0.2,wheelrotation=\iA,
+	linewidth=0.025,color1=yellow,color2=blue!50]}
+\end{animateinline}
+
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animB.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animC.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animC.tex	                        (rev 0)
+++ trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animC.tex	2020-03-14 20:42:00 UTC (rev 54295)
@@ -0,0 +1,17 @@
+\documentclass{standalone}
+\usepackage{geometry}
+\geometry{paperwidth=20cm,paperheight=16cm,margin=1cm}
+\usepackage{pst-spirograph,animate}
+
+\begin{document}
+\begin{animateinline}[
+  begin={\begin{pspicture}(-10,-5)(7,8)},
+  end={\end{pspicture}},
+  palindrome,controls,
+%  autoplay
+]{5}
+\multiframe{181}{iA=0+2}{%
+  \psSpirograph[RubberBand,Z1=40,Z2=10,m=0.2,viewpoint=-1 -5 5,arrowinset=0,arrowsize=0.2,wheelrotation=\iA,linewidth=0.025,color1=yellow,color2=cyan]}
+\end{animateinline}
+
+\end{document}


Property changes on: trunk/Master/texmf-dist/doc/generic/pst-spirograph/animation/animC.tex
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: trunk/Master/texmf-dist/doc/generic/pst-spirograph/pst-spirograph-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/pst-spirograph/pst-spirograph-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-spirograph/pst-spirograph-doc.tex	2020-03-14 20:40:07 UTC (rev 54294)
+++ trunk/Master/texmf-dist/doc/generic/pst-spirograph/pst-spirograph-doc.tex	2020-03-14 20:42:00 UTC (rev 54295)
@@ -63,7 +63,8 @@
 
 
 \begin{BDef}
-\Lcs{psSpirograph}\OptArgs\Largr{\CAny}
+\Lcs{psSpirograph}\OptArgs\Largr{\CAny}\\
+\Lcs{psSpirographB}\OptArgs\Largr{\CAny}
 \end{BDef}
 
 
@@ -125,15 +126,18 @@
 
 \begin{LTXexample}[pos=t]
 \psset{unit=0.75}
-\begin{pspicture}[showgrid=top,opacity=0.5](-7,-7)(7,7)
-\psframe*[linecolor=yellow!30](-7,-7)(7,7)
+\begin{pspicture}[showgrid=top,opacity=0.5](-11,-11)(11,11)
+\psframe*[linecolor=yellow!30](-11,-11)(11,11)
 \psset{thetamax=720,Z1=120,Z2=48,ap=10,linewidth=0.025,fillstyle=solid}
+\psSpirograph[inner=false,m=0.1,polarangle=200,holenumber=0,linecolor=blue,curvecolor=blue]
 \psSpirograph[m=0.1,polarangle=200,holenumber=0,linecolor=red]
-\psSpirograph[m=0.05,polarangle=340,holenumber=3,curvecolor=blue,linecolor=blue]
-\psSpirograph[m=0.075,polarangle=90,holenumber=6,curvecolor=green,linecolor=green]
 \end{pspicture}
 \end{LTXexample}
 
+
+
+
+
 \subsection{Pencil position}
 
 \noindent\begin{tabularx}{\linewidth}{@{} XX @{}}
@@ -267,7 +271,7 @@
   palindrome,controls,
 %  autoplay
 ]{5}
-\multiframe{100}{iA=0+8}{%
+\multiframe{80}{iA=0+10}{%
   \psSpirograph[thetamax=\iA,Z1=59,Z2=24,m=0.1,ap=10,curvewidth=1.1pt,
     linewidth=0.025,fillstyle=solid,polarangle=\iA,holenumber=5,opacity=0.5](0,0)}
 \end{animateinline}
@@ -274,8 +278,8 @@
 \end{LTXexample}
 
 
+\iffalse
 \psset{linewidth=0.1pt}
-
 \begin{LTXexample}[pos=t]
 \psset{unit=0.3cm}
 \begin{animateinline}[
@@ -289,7 +293,6 @@
 \end{LTXexample}
 
 
-\iffalse
 \begin{LTXexample}[pos=t]
 \psset{unit=0.5cm}
 \begin{animateinline}[
@@ -313,7 +316,7 @@
   \psgrid[style=gridstyleA,unit=1.4](-10,-10)(10,10)%
   \ifnum\i=181 \psset{gearwheels=false}\fi
   \psSpirograph[Z1=50,Z2=20,m=0.2,linewidth=0.025,fillstyle=solid,opacity=0.75,polarangle=\i,circles,TypeA=false,
-    thetamax=\i,curvecolor=red,curvewidth=2pt,HolePos=1.05]}
+    thetamax=\i,curvecolor=red,curvewidth=2pt,HolePos=1.5]}
 \end{animateinline}
 \end{LTXexample}
 
@@ -330,7 +333,6 @@
     linecolor=blue,fillstyle=solid,opacity=0.75,polarangle=\i,circles=false,thetamax=\i,curvecolor=red,curvewidth=2pt,HolePos=1.7]}
 \end{animateinline}
 \end{LTXexample}
-\fi
 
 
 
@@ -350,9 +352,37 @@
 }
 \end{animateinline}
 \end{LTXexample}
+\fi
 
 
+\clearpage
 
+\section{Connect the two gears with a rubberband}
+
+This is an adaptation with PSTricks of an idea of Alejandro Teutli which he realized with Mathematica:
+\url{https://demonstrations.wolfram.com/ParametricMovementOfARubberBand/} which is a  variation of a spirograph.
+A rubber band is fixed by its ends on two gears. A pencil tied in the middle of the elastic rubberband draws the curve obtained when the gears are
+rotating. The optional argument \Lkeyword{RubberBand} must be used, if you want such a spirograph. It is only available
+in 3D.
+
+
+\begin{LTXexample}[pos=t]
+\begin{animateinline}[
+  width=0.9\linewidth,
+  begin={\begin{pspicture}(-6,-3)(8,6)\psframe*[linecolor=yellow,opacity=0.4](-6,-3)(8,6)},
+  end={\end{pspicture}},
+  palindrome,controls,
+%  autoplay
+]{5}
+\multiframe{181}{iA=0+4}{%
+\psSpirograph[RubberBand,Z1=20,Z2=40,m=0.2,viewpoint=2 -5 3,arrowinset=0,arrowsize=0.2,wheelrotation=\iA,
+	linewidth=0.025,color1=yellow,color2=blue!50]}
+\end{animateinline}
+\end{LTXexample}
+
+
+
+
 %There are some more examples in the documention directory of the package.
 
 \clearpage

Modified: trunk/Master/texmf-dist/dvips/pst-spirograph/pst-spirograph.pro
===================================================================
--- trunk/Master/texmf-dist/dvips/pst-spirograph/pst-spirograph.pro	2020-03-14 20:40:07 UTC (rev 54294)
+++ trunk/Master/texmf-dist/dvips/pst-spirograph/pst-spirograph.pro	2020-03-14 20:42:00 UTC (rev 54295)
@@ -1,8 +1,8 @@
-%% $Id: pst-spirograph.pro 1159 2020-03-12 15:13:17Z herbert $
+%% $Id: pst-spirograph.pro 1160 2020-03-14 14:08:31Z herbert $
 %%
 % PostScript prologue for pst-spirograph.tex.
 %
-% Version 0.50, 2020/03/11 
+% Version 0.51, 2020/03/14 
 %
 /tx at spirographDict 50 dict def 
 tx at spirographDict begin
@@ -288,7 +288,7 @@
     positionAngular rotate
     a@ THETA DegtoRad mul THETA cos mul neg
     a@ THETA DegtoRad mul THETA sin mul
-    0.06 cm 0 360 arc
+    0.12 cm 0 360 arc
   }{
      a at ex polarAngle cos mul t@@x add a at 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
@@ -297,7 +297,7 @@
     positionAngular rotate
     a@ THETA DegtoRad mul THETA cos mul neg
     a@ THETA DegtoRad mul THETA sin mul
-    0.06 cm 0 360 arc
+    0.12 cm 0 360 arc
   } ifelse
   closepath
   curvecolor
@@ -332,7 +332,6 @@
         } for
       } def
       %%%% fin de la definition de la roue dentee %%%
-      /COURONNE { 0 0 Rt 1.25 mul cm 360 0 arcn } def
       /plaquette {
         Beta_ neg rotate
         /alpha1 1 R1 2 mul atan 2 div def
@@ -360,6 +359,8 @@
 	closepath
 	linecolor
 	stroke
+      } def
+      /drawHole {
 	R1 cm HolePos mul 0 GetCurveWidth 1.5 mul 0 360 arc
 	curvecolor
 	fill
@@ -380,6 +381,34 @@
         R1 HolePos mul beta sin mul yC add cm
         end
       } def
+    /AXE {
+      %newpath
+      Raxe 4 div cm
+      A at 0 cos Raxe mul cm moveto
+      0 0 Raxe cm 90 A at 0 sub 90 A at 0 add arcn
+      Raxe 4 div cm neg
+      A at 0 cos Raxe mul cm
+      lineto
+      Raxe 4 div cm neg
+      Raxe A at 0 cos 0.2 add mul cm
+      lineto
+      Raxe 4 div cm
+      Raxe A at 0 cos 0.2 add mul cm
+      lineto
+    } def
+    %%% clavette %%%
+    /CLAVETTE {
+      newpath
+      Raxe 4 div cm
+      A at 0 cos 0.2 sub Raxe mul cm moveto
+      Raxe 4 div cm
+      Raxe A at 0 cos 0.2 add mul cm lineto
+      Raxe 4 div cm neg
+      Raxe A at 0 cos 0.2 add mul cm lineto
+      Raxe 4 div cm neg
+      A at 0 cos 0.2 sub Raxe mul cm lineto
+      closepath
+    } def
 %
 end
 %%
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/generic/pst-spirograph/pst-spirograph.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pst-spirograph/pst-spirograph.tex	2020-03-14 20:40:07 UTC (rev 54294)
+++ trunk/Master/texmf-dist/tex/generic/pst-spirograph/pst-spirograph.tex	2020-03-14 20:42:00 UTC (rev 54295)
@@ -21,10 +21,14 @@
 \csname PSTSPIROGRAPHLoaded\endcsname
 \let\PSTSPIROGRAPHLoaded\endinput
 % Requires some packages
-\ifx\PSTricksLoaded\endinput\else \input pstricks \fi
-\ifx\PSTXKeyLoaded\endinput\else  \input pst-xkey \fi
-\def\fileversion{0.50}
-\def\filedate{2020/03/11}
+\ifx\PSTricksLoaded\endinput \else \input pstricks \fi
+\ifx\PSTXKeyLoaded\endinput  \else \input pst-xkey \fi
+\ifx\PSTthreeDLoaded\endinput\else \input pst-3d   \fi
+\ifx\PSTnodesLoaded\endinput \else \input pst-node \fi
+\ifx\PSTplotLoaded\endinput  \else \input pst-plot \fi
+
+\def\fileversion{0.51}
+\def\filedate{2020/03/14}
 \message{`PSTSPIROGRAPH' v\fileversion, \filedate\ (ml,hv)}
 
 \edef\PstAtCode{\the\catcode`\@} 
@@ -45,6 +49,18 @@
 \psset[pst-spirograph]{holenumber=1}
 \define at key[psset]{pst-spirograph}{thetamax}[360]{\def\psk at thetamax{#1 }}
 \psset[pst-spirograph]{thetamax=360}
+
+\define at key[psset]{pst-spirograph}{Rarct}{\def\psk at Rarct{#1 }}
+\psset[pst-spirograph]{Rarct=0.1}
+\define at key[psset]{pst-spirograph}{wheelrotation}{\def\psk at wheelrotation{#1 }}
+\psset[pst-spirograph]{wheelrotation=0}
+
+\define at boolkey[psset]{pst-spirograph}[Pst at spirograph@]{int}[true]{}
+\psset[pst-spirograph]{int=false}
+
+\define at boolkey[psset]{pst-spirograph}[Pst at spirograph@]{notdrawWheel}[true]{}
+\psset[pst-spirograph]{notdrawWheel=false}
+
 %
 \define at key[psset]{pst-spirograph}{color1}[{[rgb]{0.625 0.75 1}}]{\pst at getcolor{#1}\pscolora}
 \psset[pst-spirograph]{color1={[rgb]{0.625 0.75 1}}}
@@ -65,7 +81,6 @@
 \define at boolkey[psset]{pst-spirograph}[Pst at spirograph@]{circles}[true]{}
 \psset[pst-spirograph]{circles=false}
 
-
 %% hole position
 \define at key[psset]{pst-spirograph}{HolePos}{\def\psk at HolePos{#1 }}
 \psset[pst-spirograph]{HolePos=1.5} % 1<HolePos<2
@@ -76,11 +91,20 @@
 \define at boolkey[psset]{pst-spirograph}[Pst at spirograph@]{TypeA}[true]{}
 \psset[pst-spirograph]{TypeA}
 
+\define at boolkey[psset]{pst-spirograph}[Pst at spirograph@]{RubberBand}[true]{}
+\psset[pst-spirograph]{RubberBand=false}
 
+\define at key[psset]{pst-spirograph}{theta1}{\def\psk at thetaA{#1}}
+\define at key[psset]{pst-spirograph}{theta2}{\def\psk at thetaB{#1}}
+\psset[pst-spirograph]{theta1=-90,theta2=90}
+
 \def\psSpirograph{\def\pst at par{}\pst at object{psSpirograph}}
 \def\psSpirograph at i{\@ifnextchar({\psSpirograph at ii}{\psSpirograph at ii(0,0)}}
 \def\psSpirograph at ii(#1){%
-  \begin at ClosedObj
+  \begin at SpecialObj
+  \ifPst at spirograph@RubberBand \psSpirograph at iv(#1)\else\psSpirograph at iii(#1)\fi
+}  
+\def\psSpirograph at iii(#1){%
   \pst@@getcoor{#1}%
   \addto at pscode{
     tx at spirographDict begin
@@ -209,15 +233,233 @@
         linecolor
         stroke
         plaquette
+        drawHole
         \ifPst at spirograph@circles Circles \fi
         grestore
+      \else
+        gsave
+        m2 Z2 Datas1
+        Calculs
+        /a at ex m2 Z1 Z2 add mul 2 div cm def % entraxe engrenage exterieur
+        /a at in m2 Z1 Z2 sub mul 2 div cm def % entraxe engrenage interieur
+        a at in polarAngle cos mul a at in polarAngle sin mul translate
+        polarAngle Z1 Z2 sub Z1 div mul rotate
+        m1 Z1
+        Datas2
+        Calculs
+        Beta_ rotate
+        Beta_ neg rotate
+        drawHole
+        grestore
       \fi
     \fi
     end
   }%
-  \end at ClosedObj
+  \end at SpecialObj
   \ignorespaces}
 %
+\def\psSpirograph at iv(#1){%
+  \def\RA{\psCalc{\psk at ZA*\psk at m/2}}%
+  \def\RB{\psCalc{\psk at ZB*\psk at m/2}}% les rayons
+  \def\OB{\psCalc{\RA+\RB}}%
+  \def\RAp{\psCalc{(\RA*2-2.5*0.2)/2}}% cercles de pied
+  \def\RBp{\psCalc{(\RB*2-2.5*0.2)/2}}%
+  % la vitesse de rotation
+  \def\OMEGAA{-1}%
+  \def\OMEGAB{\psCalc{(-\OMEGAA)*\psk at ZA/\psk at ZB}}%
+  \def\ANGLE{\psCalc{\psk at wheelrotation}}% degrees
+  \def\ANGLErad{\psCalc{\ANGLE*3.14/180}}% radians
+  \def\nombrePoints{\psCalc{trunc(2*\ANGLE+5,0)}}%
+  % positionnement angulaire des 2 points de fixation de l'\xE9lastique
+  \def\thetaA{\psCalc{(\psk at thetaA)*3.14/180}}%
+  \def\thetaB{\psCalc{(\psk at thetaB)*3.14/180}}%
+  % les coordonn\xE9es des 2 points
+  \def\xA{\psCalc{0.9*\RAp*cos(\thetaA+\OMEGAA*\ANGLErad)}}%
+  \def\yA{\psCalc{sin(\thetaA+\OMEGAA*\ANGLErad)*\RAp*0.9}}%
+  \def\xB{\psCalc{cos(\thetaB+\OMEGAB*\ANGLErad)*\RBp*0.9}}%
+  \def\yB{\psCalc{sin(\thetaB+\OMEGAB*\ANGLErad)*\RBp*0.9+\OB}}%
+  % le milieu
+  \def\xM{\psCalc{(\xA+\xB)/2}}\def\yM{\psCalc{(\yA+\yB)/2}}%
+  \ThreeDput[normal=0 0 1](0,0,0){%
+    \psgrid[subgriddiv=0,gridlabels=0pt]%\psframe(-5,-5)(5,7)
+    \rput(0.05,-0.05){\psSpirographB[circles=false,polarangle=90,fillstyle=solid,color1=black,color2=black]}%
+    \psSpirographB[circles=false,polarangle=90,fillstyle=solid]%
+    \parametricplot[linecolor=red,plotpoints=\nombrePoints,algebraic,linewidth=0.1]{0}{\ANGLErad}{
+                      (\RAp*0.9*cos(\thetaA+\OMEGAA*t)+\RBp*0.9*cos(\thetaB+\OMEGAB*t))/2|
+                      (\RAp*0.9*sin(\thetaA+\OMEGAA*t)+\RBp*0.9*sin(\thetaB+\OMEGAB*t)+\OB)/2}%
+    \psline{->}(0,0)(0,1)\psline{->}(0,0)(1,0)%
+    % les cercles de contact
+    \pscircle[linestyle=dotted](0,0){\RA}\pscircle[linestyle=dotted](0,\OB){\RB}%
+    % les cercles de pied
+    %\pscircle[linestyle=dotted](0,0){\RAp}
+    %\pscircle[linestyle=dotted](0,\OB){\RBp}
+  }%
+  % les tiges de fixation des extr\xE9mit\xE9s de l'\xE9lastique
+  \ThreeDput[normal=0 1 0](\xA,\yA,0){\psline[linewidth=0.1]{-*}(0,0)(0,1)\pnode(0,1){P1}}%
+  \ThreeDput[normal=0 1 0](\xB,\yB,0){\psline[linewidth=0.1]{-*}(0,0)(0,1)\pnode(0,1){P2}}%
+  % le milieu
+  \ThreeDput[normal=0 1 0](\xM,\yM,0){\pnodes(0,1){P3}(0,0){P4}}%
+  \psline[linecolor=blue](P1)(P2)%
+  \psline[linecolor=red]{->}(P3)(P4)%
+  \psdot[linecolor=blue](P3)%
+  \end at SpecialObj
+  \ignorespaces}
+%
+\def\psSpirographB{\def\pst at par{}\pst at object{psSpirographB}}
+\def\psSpirographB at i{\@ifnextchar({\psSpirographB at ii}{\psSpirographB at ii(0,0)}}
+\def\psSpirographB at ii(#1){%
+  \begin at SpecialObj
+  \pst@@getcoor{#1}%
+  \addto at pscode{%
+    \pst at coor /t@@y ED /t@@x ED
+    /cm {\pst at number\psunit mul } bind def
+    /Z1 \psk at ZA def
+    /m1 \psk at m def
+    /Z2 \psk at ZB def
+    /m2 \psk at m def
+    /ap \psk at ap def
+    /facteurRayonRaccord {\psk at Rarct mul} def
+    /polarAngle  \psk at polarangle def
+    /color1 {\pst at usecolor\pscolora } def
+    /color2 {\pst at usecolor\pscolorb } def
+    /colorcircles {\pst at usecolor\pscolorc } def
+    /curvecolor  {\pst at usecolor\pscolord} def
+    /linecolor  {\pst at usecolor\pslinecolor} def
+    /ni \psk at holenumber def ni 8 gt { /ni 8 def } if
+    /thetamax \psk at thetamax def
+      Z1 2 mod 1 eq { /Z1 Z1 1 sub def } if
+      Z2 2 mod 1 eq { /Z2 Z2 1 sub def } if
+      /HolePos \psk at HolePos def
+      HolePos 0 lt HolePos 2 ge or { /HolePos 1.5 def } if
+      /Fill { \psk at opacityalpha .setopacityalpha fill } def
+      /R1 Z1 m1 mul 2 div def
+      /R2 Z2 m1 mul 2 div 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
+    %
+    tx at spirographDict begin
+    %%%% definition de la roue dentee %%%%%%
+    /Roue3d {
+      % arc de d\xE9veloppante
+      /tabArcDev [ 0 1 ThetaTdeg { /i@ exch def [i@ devCercle] } for ] def
+      /n@ tabArcDev length def
+      /tabDent [
+	% l'arc de developpante initial
+	tabArcDev aload pop
+	% l'arc ce cercle de tete
+	DeltaT 0.1 2Beta DeltaT sub {/i@ exch def [Rt cm i@ cos mul Rt cm i@ sin mul] } for 
+	% le symetrique de l'arc de developpante par rapport a l'axe de la dent
+	n@ 1 sub -1 0  { /compteur exch def [tabArcDev compteur get aload pop symAxe] } for 
+      ] def
+      % trac\xE9 de la dent
+      /n2@ tabDent length def
+      newpath
+      ptC moveto
+      0 1 Z@ 1 sub 
+        { /i@ exch AngleDent mul def
+	  \ifPst at spirograph@int
+	    wheel 2 eq { ptA RotDent ptB RotDent Rarct arct ptB RotDent lineto }
+            	       { ptA RotDent lineto ptB RotDent lineto } ifelse
+	  \else
+	    Rp Rb eq { ptA RotDent lineto ptB RotDent lineto }
+            	     { ptA RotDent ptB RotDent Rarct arct ptB RotDent lineto } ifelse
+	  \fi
+	  0 1 n2@ 1 sub { /compteur exch def tabDent compteur get aload pop RotDent lineto } for
+	  \ifPst at spirograph@int
+	    wheel 2 eq { Rp Rb eq { ptA' RotDent lineto ptC' RotDent lineto }
+                                  { ptA' RotDent ptC' RotDent Rarct arct ptC' RotDent lineto } ifelse } 
+                                  { ptA' RotDent lineto ptC' RotDent lineto } ifelse
+	  \else
+	    Rp Rb eq { ptA' RotDent lineto ptC' RotDent lineto }
+        	     { ptA' RotDent ptC' RotDent Rarct arct ptC' RotDent lineto } ifelse
+	  \fi
+	} for
+    } def % Roue3d
+    %
+%%%%%%%%%%%%%%%%%5
+      thetamax 0 le { /pas -1 def }{ /pas 1 def } ifelse
+      /tabSpirograph [ 0 pas thetamax {/i_ exch def [ i_ coorPen3 ] } for ] def
+%      gsave
+%      tabSpirograph 0 get aload pop moveto
+%      1 1 tabSpirograph length 1 sub {/nP exch def tabSpirograph nP get aload pop lineto } for
+%      curvecolor
+%      \pst at number\pscurvewidth SLW
+%      stroke
+%      grestore
+%%%%%%%%%%%%%%%
+    /AngleRotation \psk at wheelrotation def
+    %%% Les dessins de l'engrenage %%%%%%
+    %%%%%%%%%% Roue N\xB01 %%%%%%%%%%%%%%%%%
+    \ifPst at spirograph@notdrawWheel
+    \else
+        /wheel 1 def
+        gsave
+        t@@x t@@y translate
+        m1 Z1
+        \ifPst at spirograph@int
+	  Datas2 Calculs Beta_ AngleRotation sub rotate Roue3d COURONNE closepath
+	  \ifx\psk at fillstyle\relax\else color1 fill \fi
+	  Roue3d closepath linecolor stroke
+	  COURONNE closepath linecolor stroke
+	  \ifPst at spirograph@circles Circles \fi
+        \else
+	  Datas1 Calculs Beta_ AngleRotation sub rotate Roue3d AXE closepath
+	  \ifx\psk at fillstyle\relax\else color1 fill \fi
+	  Roue3d closepath linecolor stroke
+	  AXE closepath
+	  \ifx\psk at fillstyle\relax\else 0.8 setgray fill \fi
+	  AXE closepath linecolor stroke
+  	  CLAVETTE
+	  \ifx\psk at fillstyle\relax\else 0 0.125 0.25 0.25 setcmykcolor fill \fi
+	  CLAVETTE linecolor stroke
+	  \ifPst at spirograph@circles  Circles \fi
+        \fi
+        grestore
+    \fi
+    %%%%%%%%%% Roue N\xB02 %%%%%%%%%%%%%%%%%
+    /wheel 2 def
+    gsave
+    m2 Z2 Datas1
+    Calculs
+    /a at ex m2 Z1 Z2 add mul 2 div cm def % entraxe engrenage exterieur
+    /a at in m2 Z1 Z2 sub mul 2 div cm def % entraxe engrenage interieur
+    \ifPst at spirograph@int
+      a at in polarAngle cos mul t@@x add a at in polarAngle sin mul t@@y add translate
+      Beta_ Z1 Z2 div AngleRotation mul sub polarAngle Z1 Z2 sub Z2 div mul sub rotate
+    \else
+      a at ex polarAngle cos mul t@@x add a at ex polarAngle sin mul t@@y add translate
+      DeltaSdeg DeltaP add neg 180 Z2 div add 180 add Z1 Z2 div AngleRotation mul add polarAngle Z1 Z2 add Z2 div mul add rotate
+    \fi
+    Roue3d
+    AXE
+    closepath
+    \ifx\psk at fillstyle\relax\else color2 fill \fi
+    Roue3d
+    closepath
+    linecolor
+    stroke
+    AXE
+    closepath
+    \ifx\psk at fillstyle\relax\else 0.8 setgray fill \fi
+    AXE
+    closepath
+    linecolor
+    stroke
+    CLAVETTE
+    \ifx\psk at fillstyle\relax\else 0 0.125 0.25 0.25 setcmykcolor fill \fi
+    CLAVETTE
+    linecolor
+    stroke
+    \ifPst at spirograph@circles Circles \fi
+    grestore
+    end
+  }%
+  \end at SpecialObj
+  \ignorespaces
+}% % fin de la commande PSTricks
+%
 \catcode`\@=\PstAtCode\relax
 %
 \endinput 
\ No newline at end of file

Modified: trunk/Master/texmf-dist/tex/latex/pst-spirograph/pst-spirograph.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pst-spirograph/pst-spirograph.sty	2020-03-14 20:40:07 UTC (rev 54294)
+++ trunk/Master/texmf-dist/tex/latex/pst-spirograph/pst-spirograph.sty	2020-03-14 20:42:00 UTC (rev 54295)
@@ -15,9 +15,10 @@
 \NeedsTeXFormat{LaTeX2e}
 
 \ProvidesPackage{pst-spirograph}
-  [2014/08/23 v0.41 LaTeX wrapper for `pst-spirograph' (hv)]
+  [2020/03/14 v0.51 LaTeX wrapper for `pst-spirograph' (hv)]
 %
-\RequirePackage{pstricks}
+\RequirePackage{pstricks,pst-plot,pst-3d,pst-node,pst-calculate}
+\let\psCalc\pscalculate
 \ProvidesPackage{pst-spirograph}[2020/03/11 package wrapper for pst-spirograph.tex]
 \input{pst-spirograph.tex}
 \ProvidesFile{pst-spirograph.tex}
@@ -24,6 +25,6 @@
   [\filedate\space \fileversion\space `pst-spirograph' (ml,hv)]
 \IfFileExists{pst-spirograph.pro}{%
     \ProvidesFile{pst-spirograph.pro}
-      [2020/03/11 v. 0.50,  PostScript prologue file (hv)]
+      [2020/03/14 v. 0.51,  PostScript prologue file (hv)]
       \@addtofilelist{pst-spirograph.pro}}{}%
 \endinput



More information about the tex-live-commits mailing list.