texlive[72694] Master/texmf-dist: pst-optic (28oct24)

commits+karl at tug.org commits+karl at tug.org
Mon Oct 28 21:26:54 CET 2024


Revision: 72694
          https://tug.org/svn/texlive?view=revision&revision=72694
Author:   karl
Date:     2024-10-28 21:26:54 +0100 (Mon, 28 Oct 2024)
Log Message:
-----------
pst-optic (28oct24)

Modified Paths:
--------------
    trunk/Master/texmf-dist/doc/generic/pst-optic/Changes
    trunk/Master/texmf-dist/doc/generic/pst-optic/README
    trunk/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.bib
    trunk/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.pdf
    trunk/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.tex
    trunk/Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex

Modified: trunk/Master/texmf-dist/doc/generic/pst-optic/Changes
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-optic/Changes	2024-10-28 20:26:42 UTC (rev 72693)
+++ trunk/Master/texmf-dist/doc/generic/pst-optic/Changes	2024-10-28 20:26:54 UTC (rev 72694)
@@ -1,4 +1,5 @@
 ---- pst-optic.tex
+1.05  2024-10-28  - added individueal color setting for the focal, center amd parallel beam
 1.04  2024-06-02  - small fixes to code and documentation
 1.03  2024-05-17  - small fixes to code and documentation
 1.02a 2023-05-07  - fix documentation for \psRefractionRay

Modified: trunk/Master/texmf-dist/doc/generic/pst-optic/README
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-optic/README	2024-10-28 20:26:42 UTC (rev 72693)
+++ trunk/Master/texmf-dist/doc/generic/pst-optic/README	2024-10-28 20:26:54 UTC (rev 72694)
@@ -3,7 +3,7 @@
 %% Manuel Luque <Mluque5130 at aol.com> (France)
 %% Herbert Voss <hvoss at tug.org> (Germany)
 %%
-%% 2024-06-02
+%% 2024-10-28
 %%
 
 Save the files
@@ -21,6 +21,5 @@
 
 to get a PostScript file. But pay attention, that the pst-optic
 files are saved in the above mentioned way, before you run
-latex on the documentation file. Or simply use lualatex to get
-directly the pdf.
+latex on the documentation file.
 

Modified: trunk/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.bib
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.bib	2024-10-28 20:26:42 UTC (rev 72693)
+++ trunk/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.bib	2024-10-28 20:26:54 UTC (rev 72694)
@@ -105,7 +105,6 @@
   altnumber	= 14,
   month		= mar,
   pages		= {40--47},
-  annote	= bretter,
   abstract	= { \PS, faktisch genauso alt wie {\TeX}, ist im
 		  Verh{\"a}ltnis dazu allgemein noch weniger bekannt, wenn es
 		  darum geht zu beurteilen, was es denn nun im eigentlichen

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

Modified: trunk/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.tex
===================================================================
--- trunk/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.tex	2024-10-28 20:26:42 UTC (rev 72693)
+++ trunk/Master/texmf-dist/doc/generic/pst-optic/pst-optic-doc.tex	2024-10-28 20:26:54 UTC (rev 72694)
@@ -1,4 +1,4 @@
-%% $Id: pst-optic-doc.tex 903 2024-06-02 06:16:43Z herbert $
+%% $Id: pst-optic-doc.tex 1019 2024-10-28 07:59:50Z herbert $
 \DocumentMetadata{}
 
 \documentclass[11pt,english,bibliography=totoc,parskip=false,headings=small,
@@ -69,7 +69,7 @@
 	Node A as string		& \Lkeyword{nameA}	& A\\
 	Angle A in degrees		& \Lkeyword{spotA}	& 270\\
 	Node B as string		& \Lkeyword{nameB}	& B\\
-	Angle B in degrees		& \Lkeyword{spotB}	& 270\\
+	Angle B in degrees		& \Lkeyword{spotB}	& 90\\
 	Node F as string		& \Lkeyword{nameF}	& F\\
 	Angle F in degrees		& \Lkeyword{spotF}	& 270\\
 	Node O as string		& \Lkeyword{nameO}	& O\\
@@ -144,9 +144,23 @@
 %      \fill[fillstyle=solid,fillcolor=BleuVerre]
 
 
-The predefined options for \Lcs{lens} are \texttt{xLeft=-7.5, xRight=7.5, yBottom=-3, yTop=3}.
+The predefined options for \Lcs{lens} are \texttt{xLeft=-7.5, xRight=7.5, 
+yBottom=-3, yTop=3}.  The default color for the rays is red, which can be changed
+with the key \Lkeyword{raycolor}. An individual color setting is possible
+for the focal, center, and parallel ray with the keywords:
+\Lkeyword{parallelrayColor},
+\Lkeyword{focalrayColor},
+and \Lkeyword{centerrayColor}
 
 
+\begin{LTXexample}
+\begin{pspicture*}(-5,-3)(5,3) 
+\rput(0,0){\lens[lensType=DVG, parallelrayColor=blue, focalrayColor=red!80!blue!30,
+  centerrayColor=green, lensScale=1,focus=1,OA=-3,lensGlass,lensWidth=0.5]}
+\end{pspicture*}
+\end{LTXexample}
+
+
 \subsection{Short forms}
 The two macros \Lcs{lensCVG} and \Lcs{lensDVG} draw some more rays as the main macro \Lcs{lens}
 with the setting \Lkeyval{lensType}\texttt{=CVG|DVG}.
@@ -230,7 +244,8 @@
 \caption{Available options for lenses with the defaults}\label{tab:defaultLens}
 \begin{tabular}{@{} l l l @{}}
 	\emph{Option} & \emph{Name} & \emph{Default}\\\hline
-	Lense type (\Lkeyval{CVG}|\Lkeyval{DVG}|\Lkeyval{PCVG}|\Lkeyval{PDVG}) & \Lkeyword{lensType}	& \Lkeyval{CVG}\\
+	Lense type (\Lkeyval{CVG}|\Lkeyval{DVG}|\Lkeyval{PCVG}|\Lkeyval{PDVG}) 
+	       & \Lkeyword{lensType}	& \Lkeyval{CVG}\\
 	Lense height in cm		& \Lkeyword{lensHeight} & 5cm\\
 	Lense width in cm 		& \Lkeyword{lensWidth}  & 0.5cm\footnotemark\\
 	vertical scale (obsolet)	& \Lkeyword{lensScale}  & 1\\
@@ -244,7 +259,8 @@
 	Arrow length in cm		& \Lkeyword{lensArrowSize}${}^2$  & 0.2\\
 	Arrow inset in cm		& \Lkeyword{lensArrowInset}${}^2$ & 0.5\\
 \end{tabular}
-\footnotetext{\textsuperscript{1} only for \Lkeyset{lensGlass=true}, otherwise set to \texttt{2\textbackslash pslinewidth}}
+\footnotetext{\textsuperscript{1} only for \Lkeyset{lensGlass=true}, 
+otherwise set to \texttt{2\textbackslash pslinewidth}}
 \footnotetext{\textsuperscript{2} only for \Lkeyset{lensGlass=false}}
 \end{minipage}
 \end{table}

Modified: trunk/Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex
===================================================================
--- trunk/Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex	2024-10-28 20:26:42 UTC (rev 72693)
+++ trunk/Master/texmf-dist/tex/generic/pst-optic/pst-optic.tex	2024-10-28 20:26:54 UTC (rev 72694)
@@ -1,4 +1,4 @@
-%%%% $Id: pst-optic.tex 903 2024-06-02 06:16:43Z herbert $
+%%%% $Id: pst-optic.tex 1019 2024-10-28 07:59:50Z herbert $
 %% This is file `pst-optic.tex',
 %% 
 %% IMPORTANT NOTICE:
@@ -8,8 +8,6 @@
 %% Manuel Luque <Mluque5130 at aol.com> (France)
 %% Herbert Voss <hvoss at tug.org> (Germany)
 %%
-%% 2024-06-02
-%%
 %% This program can be redistributed and/or modified under the terms
 %% of the LaTeX Project Public License Distributed from CTAN archives
 %% in directory macros/latex/base/lppl.txt.
@@ -30,8 +28,8 @@
 \ifx\PSTMultidoLoaded\endinput\else\input multido.tex\fi
 \ifx\PSTXKeyLoaded\endinput\else   \input pst-xkey\fi
 %
-\def\fileversion{1.04}
-\def\filedate{2024/06/02}
+\def\fileversion{1.05}
+\def\filedate{2024/10/28}
 \message{`PST-Optic' v\fileversion, \filedate\space (Manuel Luque and Herbert Voss)}
 %
 \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
@@ -169,7 +167,20 @@
 \definecolor{BleuVerre}{cmyk}{0.2,0,0,0}
 \definecolor{JauneVert}{cmyk}{0.3,0,1,0}
 \newpsstyle{rayuresJaunes}{fillstyle=hlines,hatchsep=2\pslinewidth,hatchcolor=JauneVert}
-\define at key[psset]{pst-optic}{rayColor}[red]{\pst at getcolor{#1}\psk at optic@rayColor}
+
+\define at key[psset]{pst-optic}{rayColor}[red]{%
+  \pst at getcolor{#1}\psk at optic@rayColor
+  \pst at getcolor{#1}\psk at optic@parallelrayColor
+  \def\psk at optic@paralleltipcolor{#1}%
+  \pst at getcolor{#1}\psk at optic@focalrayColor
+  \def\psk at optic@focaltipcolor{#1}%
+  \pst at getcolor{#1}\psk at optic@centerrayColor
+  \def\psk at optic@centertipcolor{#1}%
+}
+\define at key[psset]{pst-optic}{parallelrayColor}[red]{\pst at getcolor{#1}\psk at optic@parallelrayColor}
+\define at key[psset]{pst-optic}{focalrayColor}[red]{\pst at getcolor{#1}\psk at optic@focalrayColor}
+\define at key[psset]{pst-optic}{centerrayColor}[red]{\pst at getcolor{#1}\psk at optic@centerrayColor}
+
 \psset[pst-optic]{rayColor=red}
 \define at key[psset]{pst-optic}{rayWidth}[1.5\pslinewidth]{\def\psk at optic@rayWidth{#1}}
 \psset[pst-optic]{rayWidth=1.5\pslinewidth}
@@ -176,7 +187,7 @@
 %
 \newpsstyle{opticalAxis}{linewidth=0.5pt,linecolor=black,linestyle=solid}
 %
-%
+
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 
 % Utility stuff
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -491,7 +502,7 @@
     \uput[-90](Center'){Center'}
     \psdots(Center)
     \uput[-90](Center){Center}
-    \psset{linecolor=\psk at optic@rayColor}
+    \psset{linecolor=\psk at optic@rayColor}   %%%%%%%%%%%%%%%%%%%%%%
     \psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A)(B)
     \ifx\psk at optic@lensType\lensTypeCVG
       % the parallel ray
@@ -682,18 +693,21 @@
 % dessin de l'image
     \psline[linewidth=1.5\pslinewidth,arrowinset=0,linestyle=dashed]{->}(A')(B')
 %dessin des rayons
-    \psset{linecolor=\psk at optic@rayColor}
-    \Arrows[length=16,arrows=-](B)(O)
-    \Arrows(B)(I)
-    \psline(B)(I)
-    \psOutLine[arrows=->,length=1](B')(I){END1}
-    \psOutLine[length=5](B')(I){END2}
-    \psline[linestyle=dashed](F')(I)
-    \Arrows[arrows=->>](B)(I')
-    \psline(B)(I')
-    \psOutLine[arrows=->>,length=2](B')(I'){END3}
-    \psOutLine[length=10](B')(I'){END4}
-    \psline[linestyle=dashed](B')(I')
+%%    \psset{linecolor=\psk at optic@rayColor}
+    %% center beam
+    \Arrows[linecolor=\psk at optic@centerrayColor,length=16,arrows=-](B)(O)
+    %% parallel beam
+    \Arrows[linecolor=\psk at optic@parallelrayColor](B)(I)
+    \psline[linecolor=\psk at optic@parallelrayColor](B)(I)
+    \psOutLine[linecolor=\psk at optic@parallelrayColor,arrows=->,length=1](B')(I){END1}
+    \psOutLine[linecolor=\psk at optic@parallelrayColor,length=5](B')(I){END2}
+    \psline[linecolor=\psk at optic@parallelrayColor,linestyle=dashed](F')(I)
+    %% focal beam
+    \Arrows[linecolor=\psk at optic@focalrayColor,arrows=->>](B)(I')
+    \psline[linecolor=\psk at optic@focalrayColor](B)(I')
+    \psOutLine[linecolor=\psk at optic@focalrayColor,arrows=->>,length=2](B')(I'){END3}
+    \psOutLine[linecolor=\psk at optic@focalrayColor,length=10](B')(I'){END4}
+    \psline[linecolor=\psk at optic@focalrayColor,linestyle=dashed](B')(I')
     %\uput[45](I'){I'}
     %\uput[45](I){I}
     \uput[\psk at optic@spotA](A){$\mathrm{\psk at optic@nameA}$}%
@@ -713,17 +727,22 @@
 % dessin de l'image
   \psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A')(B')
 %dessin des rayons
-  \psset{linecolor=\psk at optic@rayColor}
-  \pcline(B)(B')
-  \Arrows[length=16,arrows=-](B)(O)
-  \Arrows(B)(I)
-  \psline(B)(I)
-  \Arrows[length=10,posStart=0,arrows=-](I)(F')
-  \Arrows[posStart=1,arrows=->](I)(F')
-  \Arrows[arrows=->>](B)(I')
-  \psline(B)(I')(B')
-  \Arrows[length=10,arrows=-](I')(B')
-  \Arrows[length=2,posStart=0.5,arrows=->>](I')(B')
+%  \psset{linecolor=\psk at optic@rayColor}%% No global setting
+  %% Center beam
+  \pcline[linecolor=\psk at optic@centerrayColor](B)(B')%%CMittelpunktsstrahl
+  \Arrows[linecolor=\psk at optic@centerrayColor,length=16,arrows=-](B)(O)
+  \Arrows[linecolor=\psk at optic@centerrayColor](B)(I)
+  %% parallel beam
+  \psline[linecolor=\psk at optic@parallelrayColor,tipcolor=\psk at optic@paralleltipcolor](B)(I)
+  \Arrows[linecolor=\psk at optic@parallelrayColor](B)(I)
+  \Arrows[linecolor=\psk at optic@parallelrayColor,length=10,posStart=0,arrows=-](I)(F')
+  \Arrows[linecolor=\psk at optic@parallelrayColor,posStart=1,arrows=->](I)(F')
+  %% focal beam
+  \psline[linecolor=\psk at optic@focalrayColor](B)(I')(B')
+  \Arrows[linecolor=\psk at optic@focalrayColor,arrows=->>](B)(I')
+  \Arrows[linecolor=\psk at optic@focalrayColor,length=10,arrows=-](I')(B')
+  \Arrows[linecolor=\psk at optic@focalrayColor,length=2,posStart=0.5,
+          arrows=->>,tipcolor=\psk at optic@focaltipcolor](I')(B')
   %\uput[-45](I'){I'}
   %\uput[45](I){I}
   \uput[\psk at optic@spotA](A){$\mathrm{\psk at optic@nameA}$}
@@ -736,7 +755,8 @@
 %Lentille convergente : CVG
 %(#2) est l'abscisse du centre optique
 \def\lens{\@ifnextchar[{\pst at lens}{\pst at lens[]}}
-\def\pst at lens[#1]{{%
+\def\pst at lens[#1]{%
+  \begingroup
   \psset[pst-optic,pstricks]{xLeft=-7.5,xRight=7.5,yBottom=-3,yTop=3,#1}%
 %  \psset[pst-optic,pstricks]{#1}%
   \pst at killglue%
@@ -771,7 +791,7 @@
       \pnode(! \psk at optic@xRight\space A'B' YO add){I1}
       \pnode(! \psk at optic@xRight\space neg A'B' YO add){I2}
     \else%
-      \pnode(!%
+      \pnode(!
 	   /OF' \psk at optic@focus\space def
 	   /AB \psk at optic@AB\space def
 	   /OA \psk at optic@OA\space def
@@ -812,7 +832,8 @@
             \psset{arrows=<->}%
 	    \fi\fi
         \psline[linecolor=\psk at optic@lensColor,
-          linewidth=\psk at optic@lensWidth,arrowsize=\psk at optic@lensArrowSize,
+          linewidth=2\pslinewidth, %\psk at optic@lensWidth,
+          arrowsize=\psk at optic@lensArrowSize,
           arrowinset=\psk at optic@lensArrowInset]%
           (! XO -0.5 \psk at optic@lensHeight\space mul 
              \psk at optic@lensScale\space mul YO add)%
@@ -829,7 +850,8 @@
         \pst at drawCVGRays\fi\fi
   \fi
   \end{pspicture*}%
-}\ignorespaces}
+  \endgroup
+  \ignorespaces}
 %
 % 25 december 2002 Herbert <voss at perce.de>
 % make the lenses dynamical to width _and_ height
@@ -1243,7 +1265,9 @@
      \uput[-45](B'){B'}
     \fi
     \end{pspicture}%
-}\ignorespaces}
+  }%
+  \ignorespaces
+}
 %
 %
 \def\mirrorDVG{\@ifnextchar[{%  Herbert Voss 2003/01/05
@@ -1640,12 +1664,12 @@
     \pst at getcoor{#8}\pst at tempp
     \def\pst at optic@cIn{#6}	% refraction number 1
     \def\pst at optic@cOut{#7}	% refraction number 2
-    \pnode(!%
-    	/YA \pst at tempA exch pop \pst at number\psyunit div def
+    \pnode(!
+    /YA \pst at tempA exch pop \pst at number\psyunit div def
 	/XA \pst at tempA pop \pst at number\psxunit div def
 	/YB \pst at tempB exch pop \pst at number\psyunit div def
 	/XB \pst at tempB pop \pst at number\psxunit div def
-    	/YC \pst at tempc exch pop \pst at number\psyunit div def
+    /YC \pst at tempc exch pop \pst at number\psyunit div def
 	/XC \pst at tempc pop \pst at number\psxunit div def
 	/YD \pst at tempd exch pop \pst at number\psyunit div def
 	/XD \pst at tempd pop \pst at number\psxunit div def
@@ -1656,8 +1680,11 @@
 	/dY2 YD YC sub def
 	/dX2 XD XC sub def
 % the gradient of the material (if negativ then it must be the nominator)
-	/Gamma dY2 dX2 mul 0 lt {dY2 abs neg dX2 abs}{dY2 dX2} ifelse atan def
-% the perpendicular line is: 90\xB0-Gamma
+% if = 0 then substract 180°
+	/Gamma dY2 dX2 mul 0 ge {dY2 dX2}{dY2 abs neg dX2 abs} ifelse atan 
+	  %dup 0 eq { 180 sub } if 
+	  def 
+% the perpendicular line is: 90°-Gamma
 	/GammaStrich 90 Gamma sub def
 % the angle of the incoming ray
 	/AlphaStrich dY1 dX1 atan def
@@ -1667,7 +1694,7 @@
 % the law of Snell: sin(Alpha)/sin(Beta) = n2/n1
 % sin(Beta)>1 is a total reflection instead of a refraction
 	/sinBeta \pst at optic@cIn\space \pst at optic@cOut\space div Alpha sin mul def
-	sinBeta abs 1 le{
+	sinBeta abs 1 le {
 		/Root 1 sinBeta dup mul sub Sqrt def
 		/Beta sinBeta Root atan def
 	}{
@@ -1677,7 +1704,7 @@
 	/BetaStrich 90 Gamma sub Beta add def 
 % Determine the intermediate point
 	XP BetaStrich cos sub
-	YP BetaStrich sin add ){#8'}%
+	YP BetaStrich sin add ){#8'}
 %\qdisk(#8){5pt}
 }\ignorespaces}
 %



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