texlive[72030] Master/texmf-dist: pst-coil (14aug24)

commits+karl at tug.org commits+karl at tug.org
Wed Aug 14 21:47:44 CEST 2024


Revision: 72030
          https://tug.org/svn/texlive?view=revision&revision=72030
Author:   karl
Date:     2024-08-14 21:47:44 +0200 (Wed, 14 Aug 2024)
Log Message:
-----------
pst-coil (14aug24)

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

Modified: trunk/Master/texmf-dist/doc/generic/pst-coil/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-coil/Changes	2024-08-14 19:47:30 UTC (rev 72029)
+++ trunk/Master/texmf-dist/doc/generic/pst-coil/Changes	2024-08-14 19:47:44 UTC (rev 72030)
@@ -2,6 +2,7 @@
  2010-02-01  message for loading the pro file
 
 pst-coil.tex --------
+v. 1.08  2024-08-13  - added alternative macro \psAltCoil
 v. 1.07  2015-05-13  - modified psSin
 v. 1.06  2011-09-18  - fix bug with \pszigzag
 v. 1.05  2011-07-12  - added optional argument bow for circular

Modified: trunk/Master/texmf-dist/doc/generic/pst-coil/README
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-coil/README	2024-08-14 19:47:30 UTC (rev 72029)
+++ trunk/Master/texmf-dist/doc/generic/pst-coil/README	2024-08-14 19:47:44 UTC (rev 72030)
@@ -9,4 +9,4 @@
 
 
 --
-Herbert Voss 2006-11-05
+hoss at tug.org  2024-08-13

Modified: trunk/Master/texmf-dist/doc/generic/pst-coil/pst-coil-doc.bib
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-coil/pst-coil-doc.bib	2024-08-14 19:47:30 UTC (rev 72029)
+++ trunk/Master/texmf-dist/doc/generic/pst-coil/pst-coil-doc.bib	2024-08-14 19:47:44 UTC (rev 72030)
@@ -60,7 +60,7 @@
   author	= {Michel Goosens and Frank Mittelbach and Sebastian Rahtz and Denis Roegel and Herbert Vo{\ss}},
   title		= {The {\LaTeX} {G}raphics {C}ompanion},
   publisher	= {{Addison-Wesley Publishing Company}},
-  edition	= second,
+  edition	= 2,
   year		= {2007},
   address	= {Reading, Mass.}
 }

Modified: trunk/Master/texmf-dist/doc/generic/pst-coil/pst-coil-doc.pdf
===================================================================
(Binary files differ)

Modified: trunk/Master/texmf-dist/doc/generic/pst-coil/pst-coil-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-coil/pst-coil-doc.tex	2024-08-14 19:47:30 UTC (rev 72029)
+++ trunk/Master/texmf-dist/doc/generic/pst-coil/pst-coil-doc.tex	2024-08-14 19:47:44 UTC (rev 72030)
@@ -1,9 +1,13 @@
-%% $Id: pst-coil-doc.tex 539 2011-07-12 08:22:33Z herbert $
-\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings
-    headexclude,footexclude,oneside,dvipsnames,svgnames]{pst-doc}
+%% $Id: pst-coil-doc.tex 930 2024-08-13 18:19:44Z herbert $
+\errorcontextlines=100
+%\RequirePackage{pdfmanagement-testphase}
+\DocumentMetadata{}
+\documentclass[11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,headings=small,
+    headinclude=false,footinclude=false,twoside,english]{pst-doc}
 \listfiles
 
-\usepackage[utf8]{inputenc}
+\addbibresource{\jobname.bib}
+\usepackage{csquotes,animate}
 \usepackage{pst-plot,pst-node,pst-coil}
 \SpecialCoor
 \let\pstFV\fileversion
@@ -25,7 +29,7 @@
 \author{Timothy Van Zandt\\Herbert Vo\ss\\Michael Sharpe}
 \date{\today}
 
-\maketitle
+\settitle
 
 \begin{abstract}
 Coils, springs and zigzag curves
@@ -42,7 +46,7 @@
 \vfill
 \noindent
 Thanks to:  
-Marco Daniel, Denis Girou, Uwe Siart.
+Marco Daniel, Denis Girou, Manuel Luque, Uwe Siart.
 \end{abstract}
 
 \clearpage
@@ -561,6 +565,146 @@
 package \LPack{pst-node} so that
 no further explanations are needed here.
 
+
+\section{Alternative macro}
+
+The macro \Lcs{psAltCoil} depends on the code from Manuel Luque. It uses a different way
+to draw coils with a kind of perspective view. The possible optional parameter are:
+
+\begin{itemize}
+  \item \Lkeyword{N}\textsf{=10} : number of coils
+  \item \Lkeyword{l0}\texttt{=5} : initial length in cm
+  \item \Lkeyword{R}\texttt{=0.5} : initial radius in cm
+  \item \Lkeyword{arm}\texttt{=0} : arm length in cm
+  \item \Lkeyword{alpha}\texttt{=15} : projection angle
+  \item \Lkeyword{nS}\texttt{=25} : number of steps per coil
+\end{itemize}
+
+
+\begin{LTXexample}[pos=t]
+\begin{pspicture}[showgrid,arrowsize=0.2,arrowinset=0.1](-2,-1.4)(14,2)
+\psAltCoil[N=20,l0=10,alpha=20,arm=0.5,linewidth=0.05]{*-*}(0,0)(11,0)
+\psline[linewidth=0.5\pslinewidth](0.5,0)(0.5,1.25)
+\psline[linewidth=0.5\pslinewidth](10.5,0)(10.5,1.25)
+\psline{<->}(0.5,1)(10.5,1)
+\uput[u](5.5,1){l0=10 cm}
+\psline[linewidth=0.5\pslinewidth](0,0)(0,1.25)
+\psline{>-}(-0.22,1)(0.5,1)
+\uput[u](0.25,1){dl}
+\psline[linewidth=0.5\pslinewidth](11,0)(11,1.25)
+\psline{-<}(10.5,1)(11.25,1)
+\uput[u](10.75,1){dl}
+\end{pspicture}
+\end{LTXexample}
+
+
+\begin{LTXexample}[pos=t]
+\begin{pspicture}[showgrid,arrowsize=0.2,arrowinset=0.1](-2,-1.4)(14,2)
+\psAltCoil[N=20,l0=10,R=0.5,alpha=20,arm=0.5,linewidth=0.05]{*-*}(-2,0)(14,0)
+\psline[linewidth=0.5\pslinewidth](-1.5,0)(-1.5,1.25)
+\psline[linewidth=0.5\pslinewidth](13.5,0)(13.5,1.25)
+\psline{<->}(-1.5,1)(13.5,1)
+\uput[u](5.5,1){L=15 cm}
+\psline[linewidth=0.5\pslinewidth](-2,0)(-2,1.25)
+\psline{>-}(-2.25,1)(-1.5,1)
+\uput[u](-1.75,1){dl}
+\psline[linewidth=0.5\pslinewidth](14,0)(14,1.25)
+\psline{-<}(13.5,1)(14.25,1)
+\uput[u](13.75,1){dl}
+\end{pspicture}
+\end{LTXexample}
+
+
+
+The next animation needs Adobe Acrobat to view:
+
+\begin{minipage}{4cm}
+\psset{unit=0.5}
+\def\nFrames{44}% 44 images
+\def\calc{
+         /Z0 -16 def
+         /OMEGA 20 0.1 div sqrt def % pulsation des oscillations
+         /Period TwoPi OMEGA div def % 0.4442883
+         /ti \rt\space def
+         /ZR Z0 -5 OMEGA RadtoDeg ti mul cos mul add def }
+\newcommand\bille{%
+  \psset{linewidth=0.02,fillstyle=solid,fillcolor=yellow!50}
+  \pscircle*[linecolor=yellow](0,0){0.5}
+  \psarc[linecolor=black](0,0){0.425}{-110}{90}
+  \psarc[linecolor=black](0,0){0.3}{-90}{70}
+  \psarc[linecolor=black](0,0){0.2}{-70}{60}}
+
+\begin{animateinline}[controls,loop,%
+                     begin={\begin{pspicture}(-2,1)(2,-23)},
+                     end={\end{pspicture}}]{5}% 5 images/s
+\multiframe{\nFrames}{rt=0+0.01}{%
+  \psframe*(-2,1)(2,-23)
+  \psframe[fillstyle=hlines,linestyle=none,hatchcolor=white](-1,0)(1,0.2)
+  \psline[linecolor=white](-1,0)(1,0)
+  \psdot[linecolor=white](0,0)
+  \psgrid[subgriddiv=0,gridcolor=white,griddots=10,gridlabels=0pt]
+  \psAltCoil[arm=0.5,alpha=25,N=20,l0=10,linecolor=white,linewidth=0.05](0,0)(! 0 \calc ZR)
+  \rput(! 0 \calc ZR 0.5 sub){\pscircle*[linecolor=yellow](0,0){0.5}}
+}
+\end{animateinline}
+\end{minipage}%
+\begin{minipage}{\dimexpr\linewidth-4cm}
+\begin{verbatim}
+\psset{unit=0.75}
+\def\nFrames{44}% 44 images
+\def\calc{
+  /Z0 -16 def
+  /OMEGA 20 0.1 div sqrt def 
+  /Period TwoPi OMEGA div def % 0.4442883
+  /ti \rt\space def % rt variable from animate
+  /ZR Z0 -5 OMEGA RadtoDeg ti mul cos mul add def }
+\begin{animateinline}[controls,loop,%
+                     begin={\begin{pspicture}(-2,1)(2,-23)},
+                     end={\end{pspicture}}]{5}% 5 images/s
+\multiframe{\nFrames}{rt=0+0.01}{%
+  \psframe*(-2,1)(2,-23)
+  \psframe[fillstyle=hlines,linestyle=none,
+    hatchcolor=white](-1,0)(1,0.2)
+  \psline[linecolor=white](-1,0)(1,0)
+  \psdot[linecolor=white](0,0)
+  \psgrid[subgriddiv=0,gridcolor=white,griddots=10,gridlabels=0pt]
+  \psAltCoil[arm=0.5,alpha=25,N=20,l0=10,linecolor=white,
+    linewidth=0.05](0,0)(! 0 \calc ZR)
+  \rput(! 0 \calc ZR 0.5 sub){\pscircle*[linecolor=yellow](0,0){0.5}}
+}
+\end{animateinline}
+\end{verbatim}
+\end{minipage}
+
+
+
+\begin{LTXexample}[pos=l]
+\begin{pspicture}[showgrid](0,0)(6,11)
+\psAltCoil[linecolor=blue,N=20,linewidth=0.1,
+  alpha=-20,arm=1,arrowinset=0.1]{<->}(1,2)(5,10)
+\end{pspicture}
+\end{LTXexample}
+
+
+\begin{LTXexample}[pos=l]
+\begin{pspicture}[showgrid](0,0)(4,6)
+\psAltCoil[linecolor=red,N=20](1,5)(3,1)
+\end{pspicture}
+\end{LTXexample}
+
+
+\begin{LTXexample}[pos=t]
+\begin{pspicture}[showgrid](0,-5)(16,5)
+\psAltCoil[linecolor=blue,N=25,R=1,l0=5,arm=0.5,alpha=-20,
+  doubleline=true](0,3)(16,3)
+\psAltCoil[linecolor=red,N=8,alpha=25](0,0)(4,0)
+\psAltCoil[linecolor=black,N=8,alpha=25](16,0)
+\psAltCoil[linecolor=blue,N=15.5,l0=5,arm=0.5,alpha=0](0,-2)(16,-2)
+\end{pspicture}
+\end{LTXexample}
+
+
+
 \clearpage
 
 \section{List of all optional arguments for \texttt{pst-coil}}
@@ -570,8 +714,7 @@
 \nocite{*}
 \bgroup
 \RaggedRight
-\bibliographystyle{plain}
-\bibliography{pst-coil-doc}
+\printbibliography
 \egroup
 
 \printindex

Modified: trunk/Master/texmf-dist/dvips/pst-coil/pst-coil.pro
===================================================================
--- trunk/Master/texmf-dist/dvips/pst-coil/pst-coil.pro	2024-08-14 19:47:30 UTC (rev 72029)
+++ trunk/Master/texmf-dist/dvips/pst-coil/pst-coil.pro	2024-08-14 19:47:44 UTC (rev 72030)
@@ -41,8 +41,8 @@
   /roundValue ED
   /relativePeriod ED 
   /Periods ED 
-  /y1 ED /x1 ED /y0 ED /x0 ED 
-  y1 y0 sub x1 x0 sub 2 copy Pyth 
+  /y_1 ED /x_1 ED /y_0 ED /x_0 ED 
+  y_1 y_0 sub x_1 x_0 sub 2 copy Pyth 
   dup /TotalLength ED
   ArmA sub ArmB sub /SinLength ED 
   Atan /RotAngle ED
@@ -54,7 +54,7 @@
   /dxStep SinLength 360 div def         % the default step for x pos
   /xStep 360 PointsPerPeriod div def    % the step for the for loop
   /mtrx CM def 
-  x0 y0 translate 
+  x_0 y_0 translate 
   RotAngle rotate 
   1 0 0 0 ArrowA ArmA 0 lineto 
   1 xStep 360 {                         % PointsPerPeriod times
@@ -77,7 +77,9 @@
   BeginAngle 180 div AspectCos mul add BeginAngle cos 
   /lineto load stopped { moveto } if 
   BeginAngle Inc EndAngle { CoilLoop } for 
-  EndAngle CoilLoop mtrx setmatrix } def
+  EndAngle CoilLoop mtrx setmatrix 
+} def
+%
 /ZigZag { 15 dict begin 
   /ArmB ED /ArmA ED 
   2 div /w ED 
@@ -109,7 +111,7 @@
   %/psi ang 90 sub theta sub def % angle of B from center if bow>0
   /rho HalfLength theta sin div def % radius of circle
   bow 0 gt { /direc 1 def /thetaB ang 90 sub theta sub def } % travel B to A in pos drn
-  { /direc -1 def /thetaB ang 90 add theta add def } ifelse % travel B to A in neg drn
+           { /direc -1 def /thetaB ang 90 add theta add def } ifelse % travel B to A in neg drn
   %thetaB=angle from center to B
   rho thetaB 180 add PtoC translate % origin now at center
   /h h rho div RadtoDeg def
@@ -123,9 +125,14 @@
   /arg thetaB ArmB direc mul add def % argument for 2nd point
 %  thetaB = direc = bow = HalfLength = theta = rho = arg = h = n =
   mark rho thetaB  PtoC  rho arg PtoC /arg arg h 2 div add def
-  n { w 0 gt { rhoo }{ rhoi } ifelse arg PtoC /w w neg def /arg arg h add def } repeat
+  n { 
+    w 0 gt { rhoo }{ rhoi } ifelse 
+    arg PtoC 
+    /w w neg def 
+    /arg arg h add def 
+  } repeat
   rho thetaB theta2 ArmA sub direc mul add  PtoC rho thetaB theta2 direc mul add PtoC  
-  } def 
+} def 
 %
 end
 % END pst-coil.pro

Modified: trunk/Master/texmf-dist/tex/generic/pst-coil/pst-coil.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pst-coil/pst-coil.tex	2024-08-14 19:47:30 UTC (rev 72029)
+++ trunk/Master/texmf-dist/tex/generic/pst-coil/pst-coil.tex	2024-08-14 19:47:44 UTC (rev 72030)
@@ -1,4 +1,4 @@
-%% $Id: pst-coil.tex 578 2011-09-18 17:18:46Z herbert $
+%% $Id: pst-coil.tex 930 2024-08-13 18:19:44Z herbert $
 %% BEGIN pst-coil.tex
 %%
 %% Coils and zigzags with PSTricks
@@ -7,7 +7,7 @@
 %%
 %%
 %% COPYRIGHT 1993, 1994, 1999 by Timothy Van Zandt, tvz at nwu.edu.
-%%           2006-2015 Herbert Voss, hvoss at tug.org
+%%           2006-2024 Herbert Voss, hvoss at tug.org
 %%
 %% This program can be redistributed and/or modified under the terms
 %% of the LaTeX Project Public License Distributed from CTAN
@@ -21,8 +21,8 @@
 \ifx\PSTnodeLoaded\endinput   \else\input pst-node.tex\fi
 \ifx\PSTXKeyLoaded\endinput   \else\input pst-xkey \fi
 %
-\def\fileversion{1.07}
-\def\filedate{2015/05/13}
+\def\fileversion{1.08}
+\def\filedate{2024/08/13}
 %
 \edef\TheAtCode{\the\catcode`\@}
 \catcode`\@=11
@@ -48,7 +48,15 @@
   \let\psk at coilarmB\psk at coilarmA}
 \define at key[psset]{pst-coil}{coilaspect}[45]{\pst at getangle{#1}\psk at coilaspect}
 \define at key[psset]{pst-coil}{coilinc}[10]{\pst at getangle{#1}\psk at coilinc}
-%
+%%%%%% alternative macro
+\define at key[psset]{pst-coil}{N}[10]{\def\psk at NoOfSpirals{#1 }}
+\define at key[psset]{pst-coil}{R}[1]{\def\psk at InitialWidth{#1 }}%  in cm
+\define at key[psset]{pst-coil}{l0}[10]{\def\psk at InitialLength{#1 }}
+\define at key[psset]{pst-coil}{alpha}[15]{\def\psk at coil@Alpha{#1 }}
+\define at key[psset]{pst-coil}{arm}[0]{\def\psk at coil@arm{#1 }}
+\define at key[psset]{pst-coil}{nS}[25]{\def\psk at coil@NoOfPointsPerCoil{#1 }}
+\psset[pst-coil]{N=10,R=0.5,alpha=15,arm=0,l0=5,nS=25}
+
 \psset[pst-coil]{coilaspect=45,coilarm=.5cm,coilheight=1,coilwidth=1cm,coilinc=10}
 %
 \def\pscoil{\def\pst at par{}\pst at object{pscoil}}
@@ -198,7 +206,7 @@
     { \psk at function }
     \tx at Sin
   }%
-  \showpointsfalse%
+  \showpointsfalse
   \end at OpenObj}
 %
 \def\ncsin{\pst at object{ncsin}}
@@ -220,6 +228,49 @@
 \def\pcsin{\def\pst at par{}\pst at object{pcsin}}
 \def\pcsin at i{\pc at object\ncsin at ii}
 %
+\def\psAltCoil{\def\pst at par{}\pst at object{psAltCoil}}
+\def\psAltCoil at i{\pst at getarrows\psAltCoil at ii}
+\def\psAltCoil at ii(#1){\@ifnextchar({\psAltCoil at iii{1}(#1)}{\psAltCoil at iii{\z@}(0,0)(#1)}}
+\def\psAltCoil at iii#1(#2)(#3){%
+  \begin at OpenObj
+  \pst at getcoor{#2}\pst at tempa
+  \pst at getcoor{#3}\pst at tempb
+  \addto at pscode{%
+    \pst at tempa \pst at tempb
+    /y1 ED /x1 ED /y0 ED /x0 ED
+     x0 y0 translate
+     y1 y0 sub x1 x0 sub 2 copy Pyth
+    /Longueur ED
+     Atan rotate
+    /NoOfSpirals \psk at NoOfSpirals def % nombre de spires
+    /Alpha \psk at coil@Alpha def
+    /R_0 \psk at InitialWidth \pst at number\psunit mul def
+    /arm \psk at coil@arm \pst at number\psunit mul def
+    /l_0 \psk at InitialLength \pst at number\psunit mul def
+    /nS \psk at coil@NoOfPointsPerCoil def
+    /Pas_0 l_0 NoOfSpirals div def
+    /Pas Longueur 2 arm mul sub NoOfSpirals div def
+    % longueur de l'hélice sur un tour
+    % = sqrt(4*pi^2*R^2+p^2)
+    /Longueur_Helice_pas 39.47842 R_0 dup mul mul Pas_0 dup mul add sqrt def
+    % R=1/(2*pi)*sqrt(L^2-p^2)
+    /Radius 0.1591549 Longueur_Helice_pas dup mul Pas dup mul sub sqrt mul def
+    /xH {Radius 360 t mul cos mul Radius sub} def
+    /yH {Radius 360 t mul sin mul} def
+    /zH {Pas t mul arm add} def
+    /Inc 1 NoOfSpirals nS mul div def % nS(50) points par spires
+     1 setlinejoin
+      1 0 0 0 ArrowA arm 0 lineto
+     0 Inc NoOfSpirals {
+       /t ED
+       zH xH Alpha tan mul sub
+       yH
+       lineto
+     } for
+     Longueur 0
+     ArrowB lineto
+   }%
+  \end at OpenObj}
 %
 \catcode`\@=\TheAtCode\relax
 \endinput

Modified: trunk/Master/texmf-dist/tex/latex/pst-coil/pst-coil.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/pst-coil/pst-coil.sty	2024-08-14 19:47:30 UTC (rev 72029)
+++ trunk/Master/texmf-dist/tex/latex/pst-coil/pst-coil.sty	2024-08-14 19:47:44 UTC (rev 72030)
@@ -1,4 +1,4 @@
-%% $Id: pst-coil.sty 539 2011-07-12 08:22:33Z herbert $
+%% $Id: pst-coil.sty 930 2024-08-13 18:19:44Z herbert $
 \RequirePackage{pstricks}
 \ProvidesPackage{pst-coil}[2010/02/01 package wrapper for 
   pst-coil.tex (hv)]



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