diff options
Diffstat (limited to 'graphics/pstricks/contrib')
30 files changed, 581 insertions, 244 deletions
diff --git a/graphics/pstricks/contrib/pst-circ/Changes b/graphics/pstricks/contrib/pst-circ/Changes index 7c65cba773..4e7aef8965 100644 --- a/graphics/pstricks/contrib/pst-circ/Changes +++ b/graphics/pstricks/contrib/pst-circ/Changes @@ -1,3 +1,4 @@ +2.20 2024-10-10 reset fillstyle for OA until the connections are drawn 2.19 2021-09-09 fixes for use with lualatex 2.18 2021-04-28 Added new transistors: JFET (N and P channels), D-MOSFET (N and P channels), and IGBT diff --git a/graphics/pstricks/contrib/pst-circ/doc/pst-circ-doc.pdf b/graphics/pstricks/contrib/pst-circ/doc/pst-circ-doc.pdf Binary files differindex 1d65756456..d66436aff7 100644 --- a/graphics/pstricks/contrib/pst-circ/doc/pst-circ-doc.pdf +++ b/graphics/pstricks/contrib/pst-circ/doc/pst-circ-doc.pdf diff --git a/graphics/pstricks/contrib/pst-circ/tex/pst-circ.tex b/graphics/pstricks/contrib/pst-circ/tex/pst-circ.tex index 4a3e81fde0..298ac906bc 100644 --- a/graphics/pstricks/contrib/pst-circ/tex/pst-circ.tex +++ b/graphics/pstricks/contrib/pst-circ/tex/pst-circ.tex @@ -1,4 +1,4 @@ -%% $Id: pst-circ.tex 210 2021-09-10 07:52:09Z herbert $ +%% $Id: pst-circ.tex 1015 2024-10-10 12:02:54Z herbert $ %% This is file `pst-circ.tex' %% %% IMPORTANT NOTICE: @@ -26,8 +26,8 @@ \ifx\PSTXKeyLoaded\endinput \else\input pst-xkey \fi \ifx\PSTMultidoLoaded\endinput\else\input multido.tex\fi % -\def\fileversion{2.19} -\def\filedate{2021/09/09} +\def\fileversion{2.20} +\def\filedate{2024/10/10} \message{`pst-circ' v\fileversion (hv)} % \edef\PstAtCode{\the\catcode`\@} @@ -1022,6 +1022,7 @@ /YC Y1 Y2 add 2 div def XC YC end ){C@} \rput(C@){\pst@draw@OA} + \psset{fillstyle=none}% reset, otherwise the connectionlines are also used for a fillstyle \ncangle[arrows=-,arm=.5,angleA=0,angleB=180]{#1}{\ifPst@OAinvert Minus@\else Plus@\fi} \ncput[npos=2]{\pnode{\ifPst@OAinvert Minus@@\else Plus@@\fi}} \ifPst@OAiplus @@ -1905,9 +1906,9 @@ \fi \pcline[fillstyle=none,linestyle=none](#2)(#3) %%%%% - \pst@intensity{#2}{#3} - \pst@tension{#2}{#3} - \fi% + \pst@intensity{#2}{#3}% + \pst@tension{#2}{#3}% + \fi }% % \def\pst@intensity#1#2{% @@ -2112,15 +2113,15 @@ \pnode(0.5,0){dipole@2} \psframe[linewidth=1.5\pslinewidth,fillstyle=solid,fillcolor=black](-0.5,-0.25)(0.5,0.25) \else - \pscurve[arrows=-,linewidth=1.5\pslinewidth](-1,0)(-0.75,0.5)(-0.5,0) - \pscurve[arrows=-,linewidth=1.5\pslinewidth](-0.5,0)(-0.25,0.5)(0,0) - \pscurve[arrows=-,linewidth=1.5\pslinewidth](0,0)(0.25,0.5)(0.5,0) - \pscurve[arrows=-,linewidth=1.5\pslinewidth](0.5,0)(0.75,0.5)(1,0) - \pnode(-1,0){dipole@1} - \pnode(1,0){dipole@2} - \fi\fi\fi\fi% - \ifPst@variable\psline{->}(-0.75,-0.5)(0.75,0.5)\fi% - } + \pscurve[arrows=-,linewidth=1.5\pslinewidth](-1,0)(-0.75,0.5)(-0.5,0)% + \pscurve[arrows=-,linewidth=1.5\pslinewidth](-0.5,0)(-0.25,0.5)(0,0)% + \pscurve[arrows=-,linewidth=1.5\pslinewidth](0,0)(0.25,0.5)(0.5,0)% + \pscurve[arrows=-,linewidth=1.5\pslinewidth](0.5,0)(0.75,0.5)(1,0)% + \pnode(-1,0){dipole@1}% + \pnode(1,0){dipole@2}% + \fi\fi\fi\fi + \ifPst@variable\psline{->}(-0.75,-0.5)(0.75,0.5)\fi +} % \def\pst@draw@Ucc{% \pnode(-0.5,0){dipole@1} diff --git a/graphics/pstricks/contrib/pst-coil/Changes b/graphics/pstricks/contrib/pst-coil/Changes index d9028ebf31..c9fa1b1dae 100644 --- a/graphics/pstricks/contrib/pst-coil/Changes +++ b/graphics/pstricks/contrib/pst-coil/Changes @@ -2,6 +2,7 @@ pst-coil.sty -------- 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 diff --git a/graphics/pstricks/contrib/pst-coil/README b/graphics/pstricks/contrib/pst-coil/README index 8f8b07cfa0..0484bb5078 100644 --- a/graphics/pstricks/contrib/pst-coil/README +++ b/graphics/pstricks/contrib/pst-coil/README @@ -9,4 +9,4 @@ pst-coil-doc.bib - The documentation, bibfile -- -Herbert Voss 2006-11-05 +hoss@tug.org 2024-08-13 diff --git a/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.bib b/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.bib index b29fe53b65..1281ed1318 100644 --- a/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.bib +++ b/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.bib @@ -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.} } diff --git a/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.pdf b/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.pdf Binary files differindex 26f0e655ba..13ae4342bb 100644 --- a/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.pdf +++ b/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.pdf diff --git a/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.tex b/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.tex index 201f8298c0..ebcd0aa051 100644 --- a/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.tex +++ b/graphics/pstricks/contrib/pst-coil/doc/pst-coil-doc.tex @@ -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 @@ elaborated on at the corresponding places. \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 @@ Th other connections behave completely analogue to those dealt with the 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 @@ no further explanations are needed here. \nocite{*} \bgroup \RaggedRight -\bibliographystyle{plain} -\bibliography{pst-coil-doc} +\printbibliography \egroup \printindex diff --git a/graphics/pstricks/contrib/pst-coil/dvips/pst-coil.pro b/graphics/pstricks/contrib/pst-coil/dvips/pst-coil.pro index 9513e99194..b5484af58c 100644 --- a/graphics/pstricks/contrib/pst-coil/dvips/pst-coil.pro +++ b/graphics/pstricks/contrib/pst-coil/dvips/pst-coil.pro @@ -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 diff --git a/graphics/pstricks/contrib/pst-coil/latex/pst-coil.sty b/graphics/pstricks/contrib/pst-coil/latex/pst-coil.sty index d5b0311532..1def1526c0 100644 --- a/graphics/pstricks/contrib/pst-coil/latex/pst-coil.sty +++ b/graphics/pstricks/contrib/pst-coil/latex/pst-coil.sty @@ -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)] diff --git a/graphics/pstricks/contrib/pst-coil/tex/pst-coil.tex b/graphics/pstricks/contrib/pst-coil/tex/pst-coil.tex index cd15fa0537..0aff59732c 100644 --- a/graphics/pstricks/contrib/pst-coil/tex/pst-coil.tex +++ b/graphics/pstricks/contrib/pst-coil/tex/pst-coil.tex @@ -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@nwu.edu. -%% 2006-2015 Herbert Voss, hvoss@tug.org +%% 2006-2024 Herbert Voss, hvoss@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@coilarmB\psk@coilarmA} \define@key[psset]{pst-coil}{coilaspect}[45]{\pst@getangle{#1}\psk@coilaspect} \define@key[psset]{pst-coil}{coilinc}[10]{\pst@getangle{#1}\psk@coilinc} -% +%%%%%% alternative macro +\define@key[psset]{pst-coil}{N}[10]{\def\psk@NoOfSpirals{#1 }} +\define@key[psset]{pst-coil}{R}[1]{\def\psk@InitialWidth{#1 }}% in cm +\define@key[psset]{pst-coil}{l0}[10]{\def\psk@InitialLength{#1 }} +\define@key[psset]{pst-coil}{alpha}[15]{\def\psk@coil@Alpha{#1 }} +\define@key[psset]{pst-coil}{arm}[0]{\def\psk@coil@arm{#1 }} +\define@key[psset]{pst-coil}{nS}[25]{\def\psk@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@par{}\pst@object{pscoil}} @@ -198,7 +206,7 @@ { \psk@function } \tx@Sin }% - \showpointsfalse% + \showpointsfalse \end@OpenObj} % \def\ncsin{\pst@object{ncsin}} @@ -220,6 +228,49 @@ \def\pcsin{\def\pst@par{}\pst@object{pcsin}} \def\pcsin@i{\pc@object\ncsin@ii} % +\def\psAltCoil{\def\pst@par{}\pst@object{psAltCoil}} +\def\psAltCoil@i{\pst@getarrows\psAltCoil@ii} +\def\psAltCoil@ii(#1){\@ifnextchar({\psAltCoil@iii{1}(#1)}{\psAltCoil@iii{\z@}(0,0)(#1)}} +\def\psAltCoil@iii#1(#2)(#3){% + \begin@OpenObj + \pst@getcoor{#2}\pst@tempa + \pst@getcoor{#3}\pst@tempb + \addto@pscode{% + \pst@tempa \pst@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@NoOfSpirals def % nombre de spires + /Alpha \psk@coil@Alpha def + /R_0 \psk@InitialWidth \pst@number\psunit mul def + /arm \psk@coil@arm \pst@number\psunit mul def + /l_0 \psk@InitialLength \pst@number\psunit mul def + /nS \psk@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@OpenObj} % \catcode`\@=\TheAtCode\relax \endinput diff --git a/graphics/pstricks/contrib/pst-diffraction/Changes b/graphics/pstricks/contrib/pst-diffraction/Changes index 9f4fe42b2b..d40c814ac7 100644 --- a/graphics/pstricks/contrib/pst-diffraction/Changes +++ b/graphics/pstricks/contrib/pst-diffraction/Changes @@ -1,4 +1,7 @@ pst-diffraction.tex -------- +2.06a 2024-07-15 - small fix in the documentation +2.06 2024-07-10 - fix for missing contrast option for \psdiffractionCircular (Keno Wehr) +2.05 2024-07-10 - removed unused optional argument gamma 2.04a 2024-06-29 - bugfix for the documentation header - removed german and french docs 2.04 2010-01-05 - fix bug with missing \space for keywords diff --git a/graphics/pstricks/contrib/pst-diffraction/README b/graphics/pstricks/contrib/pst-diffraction/README index 86d7c0bb59..3d95ca6feb 100644 --- a/graphics/pstricks/contrib/pst-diffraction/README +++ b/graphics/pstricks/contrib/pst-diffraction/README @@ -1,7 +1,7 @@ %% Package `pst-diffraction.tex' %% -%% Manuel Luque (ml _at_ pstricks.de) (France) -%% Herbert Voss (hv _at_ pstricks.de) (Germany) +%% Manuel Luque (France) +%% Herbert Voss (hvoss _at_ tug.org) (Germany) %% %% 2024-06-29 %% @@ -19,24 +19,14 @@ Save the files pst-diffraction.sty pst-diffraction.tex -pst-diffraction.pro in any place, where latex or any other TeX program will find it. -The pro file should go into $TEXMF$/dvips/pstricks/. - -pst-diffraction uses the extended version of the keyval package. So -be sure that you -- have installed xkeyval with the special pst-xkey - (CTAN: tex-archive/macros/latex/contrib/xkeyval/) -- do not load another package after pst-diffraction, which loads - the old keyval.sty or pst-key.tex You can run the documentation with -make DE -make E -make FR -or for all make all ;-) this will take a lot of time, because +make + +or for all make all ;-) this may take some time, because the images are very big. If you like to get the documentation file in another format run @@ -50,8 +40,7 @@ to get a PostScript file. But pay attention, that the pst-diffraction files are saved in the above mentioned way, before you run latex on the documentation file. -The intermediate DVI file works only with viewers which can -interprete the embedded PostScript code. +Running the files with lualatex is possible, but may take a lot of +time in fact of the heavy calculations. -For another PDF output read the introduction from -the documentation. +hvoss@tug.org diff --git a/graphics/pstricks/contrib/pst-diffraction/doc/pst-diffraction-doc.bib b/graphics/pstricks/contrib/pst-diffraction/doc/pst-diffraction-doc.bib index 737b6dbba9..0d2ecefe77 100644 --- a/graphics/pstricks/contrib/pst-diffraction/doc/pst-diffraction-doc.bib +++ b/graphics/pstricks/contrib/pst-diffraction/doc/pst-diffraction-doc.bib @@ -1,45 +1,105 @@ -@STRING{dtk = {{D}ie {\TeX}nische {K}om{\"o}die} } +@STRING{tugboat = {TUGboat} } +@STRING{dtk = {Die {\TeX}nische Komödie} } +@STRING{bretter = {Bretter, die die Welt bedeuten } } + +@Book{companion, + author = {Michel Goosens and Frank Mittelbach and Sebastian Rahtz and Dennis Roegel and Herbert Voß}, + title = {The {\LaTeX} Graphics Companion}, + publisher = {Lehmanns Media}, + edition = {2}, + date = {2022}, + location = {Berlin}, + note={Preprint of the english version, 2nd edition} +} + +@Article{girou:01:, + author = {Denis Girou}, + title = {Présentation de PSTricks}, + journal = {Cahier {GUT}enberg}, + year = 1994, + volume = {16}, + month = apr, + pages = {21-70} +} + +@Article{girou:02:, + author = {Timothy Van Zandt and Denis Girou}, + title = {Inside {PST}ricks}, + journal = TUGboat, + year = 1994, + volume = {15}, + month = sep, + pages = {239-246} +} @Book{PostScript, Author = {Kollock, Nikolai G.}, - Title = {PostScript richtig eingesetzt: vom Konzept zum - praktischen Einsatz}, + Title = {PostScript richtig eingesetzt: vom Konzept zum praktischen Einsatz}, Publisher = {IWT}, Address = {Vaterstetten}, year = 1989, } -@Manual{pstricks, - Title = {PSTricks - {\PS} macros for Generic TeX}, - Author = {Timothy Van Zandt}, - Organization = {}, - Address = {\url{http://www.tug.org/application/PSTricks}}, - Note = {}, - year = 1993, +@ctan{multido, +title = {The Multido package}, +subtitle = {A loop facility for Generic TeX}, +author = {Van Zandt, Timothy and Voß, Herbert and Niepraschk, Rolf}, +url = {macros/latex/multido}, +urldate = {2018-09-01}, +version = {1.42} } -@Manual{pdftricks, - Title = {PSTricks Support for pdf}, - Author = {Herbert Voss}, - Organization = {}, - Address = {\url{http://PSTricks.de/pdf/pdfoutput.phtml}}, - Note = {}, - year = 2002, +@Book{PSTricks2, + author = {Herbert Voß}, + title = {\texttt{PSTricks} -- {G}rafik f\"ur \TeX{} und \LaTeX}, + edition = {7}, + publisher = {DANTE {\eV} and Lehmanns Media}, + date = {2016}, + address = {Heidelberg and Hamburg} } -@Manual{miwi, - Title = {References for \TeX{} and Friends}, - Author = {Michael Wiedmann and Peter Karp}, - Organization = {}, - Address = {\url{http://www.miwie.org/tex-refs/}}, - Note = {}, - year = 2003, +@Book{PSTricksE, + author = {Herbert Voß}, + title = {\texttt{PSTricks} -- Graphics and PostScript for \LaTeX}, + edition = {1}, + publisher = {UIT}, + date = {2011}, + address = {Cambridge -- UK} +} + +@Book{LTXquick, + author = {Herbert Voß}, + title = {{\LaTeX} quick reference}, + edition = {1}, + publisher = {UIT}, + year = {2012}, + address = {Cambridge -- UK} +} + +@Book{presentations, + author = {Herbert Voß}, + title = {Presentations with \LaTeX}, + edition = {2}, + publisher = {DANTE {\eV} and Lehmanns Media}, + year = {2019}, + address = {Heidelberg and Berlin} } +@Book{tbt, + author = {Victor Eijkhout}, + title = {\TeX\ by Topic -- {A} \TeX{}nician Reference}, + edition = {1}, + publisher = {DANTE {\eV} and Lehmanns Media}, + year = {2014}, + address = {Heidelberg and Berlin} +} + + + @Article{dtk02.1:voss:mathematischen, - author = {Herbert Vo{\ss}}, + author = {Herbert Voß}, title = {Die mathematischen {F}unktionen von {P}ostscript}, journal = dtk, year = 2002, @@ -49,7 +109,6 @@ month = mar, pages = {40-47}, annote = bretter, - keywords = {}, 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 @@ -61,31 +120,30 @@ gezeigt. } } -@Book{companion, - 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 = 2, - year = {2007}, - address = {Reading, Mass.} + +@Book{PostScript, + Author = {Kollock, Nikolai G.}, + Title = {PostScript richtig eingesetzt: vom Konzept zum + praktischen Einsatz}, + Publisher = {IWT}, + Address = {Vaterstetten}, + year = 1989, } -@Book{PSTricks2, - author = {Herbert Vo\ss}, - title = {\texttt{PSTricks} -- {G}rafik f\"ur \TeX{} und \LaTeX}, - edition = {4.}, - publisher = {DANTE -- Lehmanns}, - year = {2007}, - address = {Heidelberg/Hamburg} +@online{pstricks, + Title = {PSTricks - {\PS} macros for Generic TeX}, + Author = {Timothy Van Zandt}, + Organization = {}, + url = {http://www.tug.org/application/PSTricks}, + year = 1993, } -@Book{LaTeXRef, - author = {Herbert Vo\ss}, - title = {\LaTeX\ Referenz}, - edition = {1.}, - publisher = {DANTE -- Lehmanns}, - year = {2007}, - address = {Heidelberg/Hamburg} + +@online{pdftricks, + Title = {PSTricks Support for pdf}, + Author = {Herbert Voß}, + url = {http://PSTricks.de/pdf/pdfoutput.phtml}, + year = 2002, } @Book{diffraction, @@ -107,12 +165,11 @@ publisher = {Society of {P}hoto {O}ptical} } -@Manual{Fresnel, +@online{Fresnel, Title = {Augustin Fresnel}, Author = {Manuel Luque}, Organization = {}, - Address = {\url{http://melusine.eu.org/syracuse/mluque/fresnel/augustin/fresnel.html}}, - Note = {}, + url = {http://melusine.eu.org/syracuse/mluque/fresnel/augustin/fresnel.html}, year = 2004 } diff --git a/graphics/pstricks/contrib/pst-diffraction/doc/pst-diffraction-doc.pdf b/graphics/pstricks/contrib/pst-diffraction/doc/pst-diffraction-doc.pdf Binary files differindex 33256a5b76..d6e0b803ac 100644 --- a/graphics/pstricks/contrib/pst-diffraction/doc/pst-diffraction-doc.pdf +++ b/graphics/pstricks/contrib/pst-diffraction/doc/pst-diffraction-doc.pdf diff --git a/graphics/pstricks/contrib/pst-diffraction/doc/pst-diffraction-doc.tex b/graphics/pstricks/contrib/pst-diffraction/doc/pst-diffraction-doc.tex index f38f06f02e..382907d86c 100644 --- a/graphics/pstricks/contrib/pst-diffraction/doc/pst-diffraction-doc.tex +++ b/graphics/pstricks/contrib/pst-diffraction/doc/pst-diffraction-doc.tex @@ -1,13 +1,16 @@ %% $Id: pst-diffraction-docE.tex 134 2009-09-27 12:28:50Z herbert $ -\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings, - headexclude,footexclude,oneside]{pst-doc} -\usepackage{pst-grad,pst-diffraction} -\let\pstDiffractionFV\fileversion +\documentclass[11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,headings=small, + headinclude=false,footinclude=false,twoside,english]{pst-doc} -\usepackage{libertinus} +%\usepackage{libertinus} \usepackage{biblatex} \addbibresource{pst-diffraction-doc.bib} +\usepackage{xurl,pst-grad,pst-diffraction} +\let\pstDiffractionFV\fileversion + + + \lstset{pos=t,wide=true,language=PSTricks, morekeywords={psdiffractionRectangle,psdiffractionCircle,psdiffractionCircular},basicstyle=\footnotesize\ttfamily} \lstdefinestyle{syntax}{backgroundcolor=\color{blue!20},numbers=none,xleftmargin=0pt,xrightmargin=0pt, @@ -16,6 +19,15 @@ frame=single} \newcommand*\psp{\texttt{pspicture}\xspace} % + +\renewcommand\bgImage{% +\begin{pspicture}(-3.5,-3.5)(3.5,3.5) +\psdiffractionCircular[f=10,showFunc=true] +\end{pspicture} +} + +\def\eV{e.\kern-1pt{}V\kern-1pt} + \begin{document} \title{\texttt{pst-diffraction}} @@ -24,21 +36,18 @@ apertures; v.\pstDiffractionFV} \author{Manuel Luque \\ Herbert Vo\ss} \docauthor{Herbert Voß} \date{\today} -\maketitle +%\maketitle +\settitle \tableofcontents - -\clearpage - -\begin{abstract} -\noindent +\psset{unit=1cm} \vfill\noindent Thanks to: Julien Cubizolles, Doris Wagner, Timothy Van Zandt, Keno Wehr, Michael Zedler. -\end{abstract} + \section{Optical setup} @@ -136,7 +145,7 @@ By default the settings are as follows: \begin{tabular}{@{}lll@{}} \Lkeyword{a}=0.2e-3 in m; & \Lkeyword{k}=1; & \Lkeyword{f}=5 in m;\\ -\Lkeyword{lambda}=650 in nm; & \Lkeyword{pixel}=0.5; & \Lkeyword{contrast}=38, greates value;\\ +\Lkeyword{lambda}=650 in nm; & \Lkeyword{pixel}=0.5; & \Lkeyword{contrast}=38, greatest value;\\ \Lkeyword{colorMode}=3; & \Lkeyword{IIID}=\false. \end{tabular} @@ -156,7 +165,7 @@ By default the settings are as follows: \end{pspicture} \hfill \begin{pspicture}(-1.5,-2.5)(3.5,3.5) -\psdiffractionRectangle[IIID,Alpha=30,f=2.5] +\psdiffractionRectangle[IIID,Alpha=30,f=2.5]% for Alpha see package pst-3dplot \end{pspicture} \end{lstlisting} @@ -200,6 +209,7 @@ By default the settings are as follows: \hfill \begin{pspicture}(-1.5,-2)(3.5,3) \psdiffractionRectangle[IIID,Alpha=20,a=0.5e-3,k=2,f=10,lambda=515,colorMode=1] +% % for Alpha see package pst-3dplot \end{pspicture} \end{lstlisting} @@ -211,6 +221,7 @@ By default the settings are as follows: \hfill \begin{pspicture}(-3.5,-1)(3.5,4) \psdiffractionRectangle[IIID,Alpha=10,a=0.5e-3,k=20,f=10,pixel=0.5,lambda=450] +% % for Alpha see package pst-3dplot \end{pspicture} \begin{lstlisting}[style=example] @@ -220,6 +231,7 @@ By default the settings are as follows: \hfill \begin{pspicture}(-3.5,-1)(3.5,4) \psdiffractionRectangle[IIID,Alpha=10,a=0.5e-3,k=20,f=10,pixel=0.5,lambda=450] +% % for Alpha see package pst-3dplot \end{pspicture} \end{lstlisting} @@ -230,7 +242,7 @@ It is also possible to render the diffraction pattern of two congruent rectangle by using the option \Lkeyword{twoSlit}. By default this option is deactivated. The distance of the two rectangles is specified by the option $s$. -The default for $s$ is $12e^{-3}\,\mathrm{m}$. +The default for $s$ is $12\cdot10^{-3}\,\mathrm{m}$. \begin{center} @@ -249,12 +261,14 @@ The default for $s$ is $12e^{-3}\,\mathrm{m}$. \begin{center} \begin{pspicture}(-2,-1)(4,4) \psdiffractionRectangle[IIID,Alpha=20,a=0.5e-3,k=10,f=10,pixel=0.5,lambda=650,twoSlit,s=2e-3] +% % for Alpha see package pst-3dplot \end{pspicture} \end{center} \begin{lstlisting}[pos=t,style=example,wide=false] \begin{pspicture}(-2,-1)(4,4) \psdiffractionRectangle[IIID,Alpha=20,a=0.5e-3,k=10,f=10,pixel=0.5,lambda=650,twoSlit,s=2e-3] +% % for Alpha see package pst-3dplot \end{pspicture} \end{lstlisting} @@ -271,9 +285,9 @@ cropped if its height exceeds the margin of the environment \Lenv{pspicture*}). \hspace*{-1cm}% \begin{LTXexample}[pos=t,style=example,wide=false] -\begin{pspicture}(-3.5,-3.5)(3.5,3.5) +\begin{pspicture*}(-3.5,-3.5)(3.5,3.5) \psdiffractionCircular[r=0.5e-3,f=10,pixel=0.5,lambda=520] -\end{pspicture} +\end{pspicture*} % \begin{pspicture}(-3.5,-1.5)(3.5,3.5) \psdiffractionCircular[IIID,r=0.5e-3,f=10,pixel=0.5,lambda=520] @@ -281,6 +295,20 @@ cropped if its height exceeds the margin of the environment \Lenv{pspicture*}). \end{LTXexample} +\begin{LTXexample}[pos=t,style=example,wide=false] +\begin{pspicture}(-3.5,-3.5)(3.5,3.5) +\psdiffractionCircular[f=10] +\end{pspicture} +\hfill +\begin{pspicture}(-3.5,-3.5)(3.5,3.5) +\psdiffractionCircular[f=10,showFunc=true] +\end{pspicture} +\end{LTXexample} + + + + + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \section{Diffraction from two circular apertures} Only the case of equal radii is provided, this common radius can be defined like in the @@ -291,7 +319,7 @@ Furthermore one has to give the half distance of the circles measured from their The rendering process could take some time in this case\dots -\begin{pspicture}(-3,-3.5)(3.5,3.5) +\begin{pspicture}(-3.5,-3.5)(4,3.5) \psdiffractionCircular[r=0.5e-3,f=10,d=3e-3,lambda=515,twoHole] \end{pspicture} % @@ -312,7 +340,7 @@ The rendering process could take some time in this case\dots \hspace*{-1cm}% -\begin{pspicture}(-3,-3)(3.5,4) +\begin{pspicture}(-4,-3)(4,4) \psdiffractionCircular[r=0.5e-3,f=10,d=2e-3,lambda=700,twoHole,colorMode=0] \end{pspicture} % @@ -336,21 +364,22 @@ or $d=\frac{2r}{1.22}$ (see \url{http://www.unice.fr/DeptPhys/optique/diff/trouscirc/diffrac.html}). \hspace*{-1cm}% -\begin{pspicture}(-3,-3.5)(3,3.5) +\begin{pspicture}(-4,-3.5)(3,4.5) \psdiffractionCircular[r=0.5e-3,f=10,d=4.1e-4,lambda=632,twoHole] \end{pspicture} % -\begin{pspicture}(-3.5,-1.5)(3.5,3) +\begin{pspicture}(-5,-2)(3.5,3) \psdiffractionCircular[IIID,r=0.5e-3,f=10,d=4.1e-4,lambda=632,twoHole] \end{pspicture} +\bigskip \begin{lstlisting}[style=example] \begin{pspicture}(-3,-3.5)(3,3.5) \psdiffractionCircular[r=0.5e-3,f=10,d=4.1e-4,lambda=632,twoHole] \end{pspicture} % -\begin{pspicture}(-3.5,-1.5)(3.5,3) +\begin{pspicture}(-5,-1.5)(3.5,3) \psdiffractionCircular[IIID,r=0.5e-3,f=10,d=4.1e-4,lambda=632,twoHole] \end{pspicture} \end{lstlisting} @@ -377,7 +406,7 @@ option \Lkeyword{colorMode}=0. \makebox[\linewidth]{% \begin{pspicture}(-3,-3)(3,2.5) -\psdiffractionTriangle[f=10,h=1e-3,lambda=515,contrast=38] +\psdiffractionTriangle[f=10,h=1e-3,lambda=515,contrast=18] \end{pspicture} \quad \begin{pspicture}(-3,-3)(3,2.5) @@ -391,7 +420,7 @@ option \Lkeyword{colorMode}=0. \begin{lstlisting}[style=example] \begin{pspicture}(-3,-3)(3,2.5) -\psdiffractionTriangle[f=10,h=1e-3,lambda=515,contrast=38] +\psdiffractionTriangle[f=10,h=1e-3,lambda=515,contrast=18] \end{pspicture} \quad \begin{pspicture}(-3,-3)(3,2.5) @@ -433,9 +462,8 @@ option \Lkeyword{colorMode}=0. -\clearpage -\section{List of all optional arguments for \texttt{pst-diff}} -\Loption{pst-diff} is the short form for the keywords in the package \LPack{pst-diffraction}. +\section{List of all optional arguments for \texttt{pst-diffraction}} +%\Loption{pst-diff} is the short form for the keywords in the package \LPack{pst-diffraction}. \xkvview{family=pst-diff,columns={key,type,default}} @@ -444,7 +472,6 @@ option \Lkeyword{colorMode}=0. \raggedright \nocite{*} \printbibliography -%\bibliography{pst-diffraction-doc} \printindex diff --git a/graphics/pstricks/contrib/pst-diffraction/tex/pst-diffraction.tex b/graphics/pstricks/contrib/pst-diffraction/tex/pst-diffraction.tex index 345fba99c4..2ff137b0a8 100644 --- a/graphics/pstricks/contrib/pst-diffraction/tex/pst-diffraction.tex +++ b/graphics/pstricks/contrib/pst-diffraction/tex/pst-diffraction.tex @@ -25,8 +25,8 @@ \ifx\PSTThreeDplotLoaded\endinput\else\input pst-3dplot.tex\fi \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey.tex \fi % -\def\fileversion{2.04a} -\def\filedate{2024/06/29} +\def\fileversion{2.06a} +\def\filedate{2024/07/15} \message{`PST-diffraction v\fileversion, \filedate\space (ML,hv)}% \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax \pst@addfams{pst-diff} @@ -40,7 +40,7 @@ \define@key[psset]{pst-diff}{s}{\def\psk@Diffraction@Slit@s{#1 }} % distance entre les fentes \define@key[psset]{pst-diff}{lambda}{\pst@checknum{#1}\psk@Diffraction@Slit@Lambda }% en nm \define@key[psset]{pst-diff}{f}{\pst@checknum{#1}\psk@Diffraction@Slit@F }% focus en m -\define@key[psset]{pst-diff}{gamma}{\pst@checknum{#1}\psk@Diffraction@gamma@G } +%\define@key[psset]{pst-diff}{gamma}{\pst@checknum{#1}\psk@Diffraction@gamma@G } \define@key[psset]{pst-diff}{pixel}{\pst@checknum{#1}\psk@Diffraction@Slit@pixel } \define@key[psset]{pst-diff}{colorMode}{\pst@getint{#1}\psk@Diffraction@colorMode } % 0 black and white inverse @@ -65,7 +65,8 @@ \psset[pst-diff]{a=0.2e-3,f=5,k=1,r=1e-3, d=6e-3,s=12e-3,h=0.5e-3, lambda=650,pixel=0.5, - contrast=38,gamma=0.8,twoHole=false,twoSlit=false,colorMode=3, scale=1, + contrast=38,%gamma=0.8, + twoHole=false,twoSlit=false,colorMode=3, scale=1, IIID=false, showFunc=false} % % load the pstricks-add.pro only, if not already done @@ -82,7 +83,7 @@ /focus \psk@Diffraction@Slit@F def /widthSlit \psk@Diffraction@Slit@A def /heightSlit \psk@Diffraction@Slit@k widthSlit mul def - /Gamma \psk@Diffraction@gamma@G def + %/Gamma \psk@Diffraction@gamma@G def /pixel \psk@Diffraction@Slit@pixel def /SlitSeparation \psk@Diffraction@Slit@s def \psk@Diffraction@Slit@Lambda tx@addDict begin wavelengthToRGB Red Green Blue end @@ -162,7 +163,7 @@ \addto@pscode{% % les dimensions sont en mètres /focus \psk@Diffraction@Slit@F def - /Gamma \psk@Diffraction@gamma@G def + %/Gamma \psk@Diffraction@gamma@G def /pixel \psk@Diffraction@Slit@pixel def /contrast 1e\psk@Diffraction@Slit@contrast def /r \psk@Diffraction@Circular@r def @@ -253,7 +254,8 @@ /y { yPts 2845 div } bind def /R { x dup mul y dup mul add sqrt } bind def % R en m /m Coeff R mul def - 1 1e38 m J1Card Facteur x mul cos dup mul mul neg exp sub + % 1 1e38 m J1Card Facteur x mul cos dup mul mul neg exp sub + 1 contrast m J1Card Facteur x mul cos dup mul mul neg exp sub % fix by Keno Wehr dup /intensity ED dup dup Red mul 3 -1 roll @@ -283,7 +285,7 @@ \ifPst@Diffraction@IIID \else newpath R_limite neg %1.5 mul - cm dup moveto + cm dup moveto R_limite 2 mul cm 0 rlineto 0 R_limite 2 mul cm rlineto R_limite neg 2 mul cm 0 rlineto @@ -294,7 +296,8 @@ R_limite -0.001 0 { /Radius exch def /m Coeff Radius 0.01 mul mul def - 1 1e38 m J1Card neg exp sub +% 1 1e38 m J1Card neg exp sub + 1 contrast m J1Card neg exp sub % fix by keno wehr dup /intensity ED dup dup Red mul 3 -1 roll % R @@ -396,7 +399,7 @@ % les dimensions sont en mètres /f \psk@Diffraction@Slit@F def /h \psk@Diffraction@Triangle@h def - /Gamma \psk@Diffraction@gamma@G def + %/Gamma \psk@Diffraction@gamma@G def /L { \psk@Diffraction@Slit@Lambda 1e-9 mul} bind def % longueur d'onde en m /pixel \psk@Diffraction@Slit@pixel def /k { TwoPi f L mul div } bind def diff --git a/graphics/pstricks/contrib/pst-node/Changes b/graphics/pstricks/contrib/pst-node/Changes index 25e9da74cc..6ef6294b36 100644 --- a/graphics/pstricks/contrib/pst-node/Changes +++ b/graphics/pstricks/contrib/pst-node/Changes @@ -1,4 +1,5 @@ ----- pst-node.tex +1.45 2024-07-10 - fix \algparnode (Erich Schmidt) 1.44 2024-07-04 - modified \psparnode and \algparnode (Erich Schmidt) 1.43 2022-10-31 - fix for lualatex and empty value in \psk@nrot 1.42a 2020-04-01 - fix typo in the documentation @@ -57,12 +58,14 @@ ----- pst-node.sty +1.02 2024-07-10 - update package versions (hv) 1.01 2012-09-18 - update package versions (hv) 1.00 2011-06-05 - make ancient variant 97 available (hv) 2008-12-12 first version (hv) ----- pst-node.pro +1.15a 2024-07-10 - typos 1.15 2014-01-27 - comment out empty lines 1.14 2012-09-18 - add subroutines for global dict 1.13 2011-11-21 - fix bug for xelatex and scaling diff --git a/graphics/pstricks/contrib/pst-node/README b/graphics/pstricks/contrib/pst-node/README index 8e820c8558..29b62ef30c 100644 --- a/graphics/pstricks/contrib/pst-node/README +++ b/graphics/pstricks/contrib/pst-node/README @@ -4,7 +4,7 @@ if these packages are new to your TeX distribution. For more information see the documentation of your LaTeX distribution on installing packages into your LaTeX distribution or the TeX Frequently Asked Questions: -(http://www.tex.ac.uk/cgi-bin/texfaq2html?label=instpackages). +(https://texfaq.org/#installing). pst-node needs pstricks, which should be part of your local TeX installation, otherwise get it from a CTAN server, f.ex. diff --git a/graphics/pstricks/contrib/pst-node/doc/pst-node-doc.pdf b/graphics/pstricks/contrib/pst-node/doc/pst-node-doc.pdf Binary files differindex 5f6e785518..f8bebfdf1e 100644 --- a/graphics/pstricks/contrib/pst-node/doc/pst-node-doc.pdf +++ b/graphics/pstricks/contrib/pst-node/doc/pst-node-doc.pdf diff --git a/graphics/pstricks/contrib/pst-node/doc/pst-node-doc.tex b/graphics/pstricks/contrib/pst-node/doc/pst-node-doc.tex index 5b23189446..a4d0faa964 100644 --- a/graphics/pstricks/contrib/pst-node/doc/pst-node-doc.tex +++ b/graphics/pstricks/contrib/pst-node/doc/pst-node-doc.tex @@ -1,7 +1,8 @@ %\RequirePackage{pdfmanagement-testphase} \DocumentMetadata{} -%% $Id: pst-node-doc.tex 438 2022-01-31 17:45:26Z herbert $ -\documentclass[fontsize=11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false,headings=small, +%% $Id: pst-node-doc.tex 920 2024-07-11 07:41:04Z herbert $ +\documentclass[fontsize=11pt,english,BCOR=10mm,DIV=12,bibliography=totoc,parskip=false, + headings=small, headinclude=false,footinclude=false,oneside]{pst-doc} \listfiles @@ -1357,7 +1358,7 @@ Here is how I used \Lcs{nput} to mark an angle in a previous example: \end{pspicture} \end{LTXexample} -\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%% +%\clearpage%%%%%%%%%%%%%%%%%%%%%%%%%% For the put macros there are several possibilities: @@ -1412,7 +1413,7 @@ will produce the same effect as \end{LTXexample} -\clearpage%%%%%%%%%%%%%%%%%%%%%%%%% +%\clearpage%%%%%%%%%%%%%%%%%%%%%%%%% \subsection{Normal behavior with rotation} If there are a point $B$ of type node and a point $A$ of any type then @@ -1590,7 +1591,7 @@ connections: You can include the node connections inside the \Lcs{psmatrix}, in the last entry and right before \Lcs{endpsmatrix}. One advantage to doing this is that -\Lkeyset{shortput=tab} is the default within a \Lcs{psmatrix}. +\Lkeyset{shortput=tab} is the default within a \Lcs{psmatrix}.\label{tab} \begin{LTXexample} $ \begin{psmatrix} @@ -2507,7 +2508,12 @@ For example, \end{verbatim} If your expression in \texttt{t} is algebraic, you must specify the keyword \texttt{algebraic}, as in - \Lcs{fnpnode}\verb|[algebraic]{0.5}{x*(x+1)/2}{P}|. + + +\begin{verbatim} +\fnpnode[algebraic]{0.5}{x*(x+1)/2}{P} +\end{verbatim} + \begin{LTXexample}[width=.35\textwidth] \begin{pspicture}[showgrid](-.5,-.5)(2.5,3) @@ -2574,7 +2580,7 @@ turn a list of coordinates into a node sequence P0 P1 ... \begin{LTXexample}[width=.35\textwidth] \begin{pspicture}[showgrid,algebraic](-.5,-.5)(2.5,2) \pnodes{B}(.1,.1)(1;10)(*2 {x^2/4})(0,1.4) -%definesuP0..P3--now join them +% defines P0..P3 -- now join them \psnline[arrowscale=2]{-D>}(0,3){B} \end{pspicture} \end{LTXexample} @@ -2635,7 +2641,7 @@ Conversion between any angle unit and radian unit \begin{LTXexample}[width=.35\textwidth] \begin{pspicture}[showgrid,algebraic](-.5,-.5)(2.5,2) \pnodes{P}(.1,.1)(1;10)(*2 {x^2/4})(0,1.4) -%defines P0..P3--now join them +% defines P0..P3 -- now join them \psncurve[arrowscale=2]{-D>}(0,3){P} \end{pspicture} \end{LTXexample} @@ -2644,7 +2650,7 @@ Conversion between any angle unit and radian unit \begin{LTXexample}[width=.35\textwidth] \begin{pspicture}[showgrid,algebraic](-.5,-.5)(2.5,2) \pnodes{P}(.1,.1)(1;10)(*2 {x^2/4})(0,1.4) -%defines P0..P3--now join them +% defines P0..P3 -- now join them \psnccurve[arrowscale=2]{-D>}(0,3){P} \end{pspicture} \end{LTXexample} @@ -2753,7 +2759,7 @@ line from \verb|<basept>+<nodexpr1>| to \verb|<basept>+<nodexpr2>|. \curvepnode{2}{\pfn}{P}% sets P, Ptang \normalvec(Ptang){Q}\uput[-45](P){P} \psxline[linecolor=red]{<->}(P){-(Ptang)}{1.5(Ptang)} -\psxline[linecolor=blue]{->}(P){}{.5(Q)}%can use } for {(0,0)} +\psxline[linecolor=blue]{->}(P){}{.5(Q)}% can use {} for {(0,0)} \end{pspicture} \end{LTXexample} \vspace{2pc} diff --git a/graphics/pstricks/contrib/pst-node/dvips/pst-node.pro b/graphics/pstricks/contrib/pst-node/dvips/pst-node.pro index b75ef89863..4c7ee95623 100644 --- a/graphics/pstricks/contrib/pst-node/dvips/pst-node.pro +++ b/graphics/pstricks/contrib/pst-node/dvips/pst-node.pro @@ -1,13 +1,13 @@ -% $Id: pst-node.pro 438 2022-01-31 17:45:26Z herbert $ +% $Id: pst-node.pro 919 2024-07-10 18:31:27Z herbert $ %% %% PostScript prologue for pst-node.tex. -%% Version 1.15, 2014/01/27. +%% Version 1.15a, 2024/07/10. %% %% 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. % -%%%% EMPTY lines are not alowed!!! Problem with pst-eps -> \par +%%%% EMPTY lines are not allowed!!! Problem with pst-eps -> \par % % tx@Dict begin % from main pstricks dict diff --git a/graphics/pstricks/contrib/pst-node/latex/pst-node.sty b/graphics/pstricks/contrib/pst-node/latex/pst-node.sty index a7f494f031..4fe6a63aa2 100644 --- a/graphics/pstricks/contrib/pst-node/latex/pst-node.sty +++ b/graphics/pstricks/contrib/pst-node/latex/pst-node.sty @@ -1,10 +1,10 @@ -% $Id: pst-node.sty 438 2022-01-31 17:45:26Z herbert $ +% $Id: pst-node.sty 919 2024-07-10 18:31:27Z herbert $ %% %% This is file `pst-node.sty'. %% %% IMPORTANT NOTICE: %% -%% pst-node.sty Copyright (C) 2004-2017 Herbert Voss <voss@perce.de> +%% pst-node.sty Copyright (C) 2004-2024 Herbert Voss <voss@perce.de> %% Rolf Niepraschk <Rolf.Niepraschk@ptb.de> %% %% This package may be distributed under the terms of the LaTeX Project @@ -14,7 +14,7 @@ \NeedsTeXFormat{LaTeX2e} \ProvidesPackage{pst-node} - [2012/09/18 v1.01 LaTeX wrapper for `pst-node' (HV)] + [2024/07/10 v1.02 LaTeX wrapper for `pst-node' (HV)] % \newif\ifpst@OldVersion\pst@OldVersionfalse \DeclareOption{97}{\pst@OldVersiontrue} @@ -32,13 +32,14 @@ \@addtofilelist{pst-node97.pro}}{}% \else \RequirePackage{pstricks} -\ProvidesPackage{pst-node}[2010/04/22 package wrapper for pst-node.tex] +\ProvidesPackage{pst-node}[2024/07/10 package wrapper for pst-node.tex] \input{pst-node.tex} \ProvidesFile{pst-node.tex} [\filedate\space \fileversion\space `pst-node' (tvz,hv)] \IfFileExists{pst-node.pro}{% \ProvidesFile{pst-node.pro} - [2014/01/27 v. 1.15, PostScript prologue file (hv)] + [2024/07/10 v. 1.15a, PostScript prologue file (hv)] \@addtofilelist{pst-node.pro}}{}% \fi + \endinput diff --git a/graphics/pstricks/contrib/pst-node/tex/pst-node.tex b/graphics/pstricks/contrib/pst-node/tex/pst-node.tex index 8e618ef220..a653d76eea 100644 --- a/graphics/pstricks/contrib/pst-node/tex/pst-node.tex +++ b/graphics/pstricks/contrib/pst-node/tex/pst-node.tex @@ -1,4 +1,4 @@ -% $Id: pst-node.tex 654 2022-11-21 06:19:14Z herbert $ +% $Id: pst-node.tex 918 2024-07-10 17:41:55Z herbert $ %% %% BEGIN pst-node.tex %% @@ -18,8 +18,8 @@ \ifx\PSTricksLoaded\endinput\else\input pstricks.tex \fi\relax \ifx\PSTXKeyLoaded\endinput\else \input pst-xkey \fi % -\def\fileversion{1.44} -\def\filedate{2024/07/04} +\def\fileversion{1.45} +\def\filedate{2024/07/10} \message{ v\fileversion, \filedate} % \edef\TheAtCode{\the\catcode`\@} @@ -1386,8 +1386,8 @@ tx@NodeDict \pst@tempg known /dy YB YA sub def /angle dy dx Atan def /linelength \pst@number\pst@dimb \pst@number\psunit div def - XA linelength angle cos mul add YA linelength angle sin mul add ){#4}% -} + XA linelength angle cos mul add YA linelength angle sin mul add ){#4}} +% \def\psRelNode{\pst@object{psRelNode}} \def\psRelNode@i(#1)(#2)#3#4{{% A - B - factor - node name \use@par @@ -1537,8 +1537,7 @@ tx@NodeDict \pst@tempg known \def\trim@ #1{\trim@@ @#1 @ #1 @ @@}% \def\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @}% \def\unbrace#1{#1}% -\unbrace{\def\trim@@@ #1 } #2@#3{\expandafter\def% - \expandafter #3\expandafter {#1}}% +\unbrace{\def\trim@@@ #1 } #2@#3{\expandafter\def\expandafter #3\expandafter {#1}}% % \def\hasparen#1(#2\@nil{%check if expression contains a (--call with \hasparen#1(\@nil \ifx\relax#2\relax \@parenfalse \else \@parentrue\fi}% @@ -1577,24 +1576,28 @@ tx@NodeDict \pst@tempg known \expandafter\testAlg\my@tempA|\@nil\my@next {#1}{#2}{#3}} % \def\psparnode#1#2#3{% -% #1=t value, #2=x(t) y(t) in PS form,#3=node name, - \pnode(! /t #1 def #2){#3}% - \pnode(! /t #1 dup abs 1 lt {0.001 sub}{dup 0 gt {0.999} {1.001} ifelse mul} ifelse def - #2 - /t #1 dup abs 1 lt {0.001 add}{dup 0 lt {0.999} {1.001} ifelse mul} ifelse def - #2 3 -1 roll sub 3 1 roll exch sub 2 copy exch dup mul exch dup mul add sqrt - dup 3 1 roll div 3 1 roll div){#3tang}% unit tangent vector at t -}% - + % #1=t value, #2=x(t) y(t) in PS form, #3=node name, + % also returns unit tangent vector at t with node #3tang + \pnode(! /t #1 def #2){#3}% + \pnode(! /t #1 dup abs 1 lt {0.001 sub} {dup 0 gt {0.999} {1.001} ifelse mul} ifelse def + #2 + /t #1 dup abs 1 lt {0.001 add} {dup 0 lt {0.999} {1.001} ifelse mul} ifelse def + #2 + 3 -1 roll sub 3 1 roll exch sub 2 copy exch dup mul exch dup mul add sqrt + dup 3 1 roll div 3 1 roll div){#3tang}% unit tangent vector at t +}% +% \def\algparnode#1#2#3{% -% #1=t value, #2=x(t) | y(t) in alg form,#3=node name, - \pstVerb{tx@Dict begin /Func (#2) AlgParser cvx def end } - \pnode(!/t #1 def Func){#3} - \pnode(!/t #1 .001 sub def - Func - /t #1 dup abs 1 lt {0.001 add}{dup 0 lt {0.999} {1.001} ifelse mul } ifelse def - Func 3 -1 roll sub 3 1 roll exch sub 2 copy exch dup mul exch dup mul add sqrt - dup 3 1 roll div 3 1 roll div){#3tang}% unit tangent vector at t +% #1=t value, #2=x(t) | y(t) in alg form, #3=node name, +% also returns unit tangent vector at t with node #3tang + \pstVerb{tx@Dict begin /Func (#2) AlgParser cvx def end }% + \pnode(! /t #1 def Func){#3}% + \pnode(! /t #1 dup abs 1 lt {0.001 sub} {dup 0 gt {0.999} {1.001} ifelse mul} ifelse def + Func + /t #1 dup abs 1 lt {0.001 add}{dup 0 lt {0.999} {1.001} ifelse mul } ifelse def + Func + 3 -1 roll sub 3 1 roll exch sub 2 copy exch dup mul exch dup mul add sqrt + dup 3 1 roll div 3 1 roll div){#3tang}% unit tangent vector at t }% % \def\nodex#1{% @@ -1635,8 +1638,7 @@ tx@NodeDict \pst@tempg known \nodexn{#3}{@TMP@a}% \AplusB(#1)(@TMP@a){@TMP@B}% \psline(@TMP@A)(@TMP@B)% -}% -\ignorespaces}% +}\ignorespaces}% % \def\curvepnodes{\pst@object{curvepnodes}} \def\curvepnodes@i#1#2#3#4{{%optional [plotpoints=xx] @@ -1686,7 +1688,7 @@ tx@NodeDict \pst@tempg known \else \multido{\i=0+1}{\pst@cntc}{\pnode(!/x \pst@number\pst@dima\space def x #3){#4\i}% \advance\pst@dima \pst@dimb}% -\fi% +\fi \expandafter\xdef \csname \PST@root nodecount\endcsname {\the\pst@cnta}% \ifnum\Pst@Debug>0 \typeout{Created nodes #40 .. #4\the\pst@cnta}\fi% }\ignorespaces}% diff --git a/graphics/pstricks/contrib/pst-optic/Changes b/graphics/pstricks/contrib/pst-optic/Changes index e51864d848..f5d28372a2 100644 --- a/graphics/pstricks/contrib/pst-optic/Changes +++ b/graphics/pstricks/contrib/pst-optic/Changes @@ -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 diff --git a/graphics/pstricks/contrib/pst-optic/README b/graphics/pstricks/contrib/pst-optic/README index 0f33952022..2fe9d76fc7 100644 --- a/graphics/pstricks/contrib/pst-optic/README +++ b/graphics/pstricks/contrib/pst-optic/README @@ -3,7 +3,7 @@ %% Manuel Luque <Mluque5130@aol.com> (France) %% Herbert Voss <hvoss@tug.org> (Germany) %% -%% 2024-06-02 +%% 2024-10-28 %% Save the files @@ -21,6 +21,5 @@ dvips pst-optic-doc.dvi 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. diff --git a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.bib b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.bib index 6eea964780..d906cfcd47 100644 --- a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.bib +++ b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.bib @@ -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 diff --git a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.pdf b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.pdf Binary files differindex 182863a16e..4a4002f476 100644 --- a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.pdf +++ b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.pdf diff --git a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.tex b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.tex index 5ec11a0297..2af432ab37 100644 --- a/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.tex +++ b/graphics/pstricks/contrib/pst-optic/doc/pst-optic-doc.tex @@ -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 @@ Table~\ref{tab:defaultLens} and \ref{tab:defaultSpiegel}. 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,7 +144,21 @@ There are macros for the convergent and divergent lens % \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} @@ -230,7 +244,8 @@ Using \Lcs{lens}\OptArg{\Lkeyword{lensType}=\ldots} gives the in figures \ref{fi \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 @@ Using \Lcs{lens}\OptArg{\Lkeyword{lensType}=\ldots} gives the in figures \ref{fi 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} diff --git a/graphics/pstricks/contrib/pst-optic/tex/pst-optic.tex b/graphics/pstricks/contrib/pst-optic/tex/pst-optic.tex index 0c06f849b3..c60869c4b4 100644 --- a/graphics/pstricks/contrib/pst-optic/tex/pst-optic.tex +++ b/graphics/pstricks/contrib/pst-optic/tex/pst-optic.tex @@ -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@aol.com> (France) %% Herbert Voss <hvoss@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,14 +167,27 @@ \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@key[psset]{pst-optic}{rayColor}[red]{\pst@getcolor{#1}\psk@optic@rayColor} + +\define@key[psset]{pst-optic}{rayColor}[red]{% + \pst@getcolor{#1}\psk@optic@rayColor + \pst@getcolor{#1}\psk@optic@parallelrayColor + \def\psk@optic@paralleltipcolor{#1}% + \pst@getcolor{#1}\psk@optic@focalrayColor + \def\psk@optic@focaltipcolor{#1}% + \pst@getcolor{#1}\psk@optic@centerrayColor + \def\psk@optic@centertipcolor{#1}% +} +\define@key[psset]{pst-optic}{parallelrayColor}[red]{\pst@getcolor{#1}\psk@optic@parallelrayColor} +\define@key[psset]{pst-optic}{focalrayColor}[red]{\pst@getcolor{#1}\psk@optic@focalrayColor} +\define@key[psset]{pst-optic}{centerrayColor}[red]{\pst@getcolor{#1}\psk@optic@centerrayColor} + \psset[pst-optic]{rayColor=red} \define@key[psset]{pst-optic}{rayWidth}[1.5\pslinewidth]{\def\psk@optic@rayWidth{#1}} \psset[pst-optic]{rayWidth=1.5\pslinewidth} % \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@optic@rayColor} + \psset{linecolor=\psk@optic@rayColor} %%%%%%%%%%%%%%%%%%%%%% \psline[linewidth=1.5\pslinewidth,arrowinset=0]{->}(A)(B) \ifx\psk@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@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@optic@rayColor} + %% center beam + \Arrows[linecolor=\psk@optic@centerrayColor,length=16,arrows=-](B)(O) + %% parallel beam + \Arrows[linecolor=\psk@optic@parallelrayColor](B)(I) + \psline[linecolor=\psk@optic@parallelrayColor](B)(I) + \psOutLine[linecolor=\psk@optic@parallelrayColor,arrows=->,length=1](B')(I){END1} + \psOutLine[linecolor=\psk@optic@parallelrayColor,length=5](B')(I){END2} + \psline[linecolor=\psk@optic@parallelrayColor,linestyle=dashed](F')(I) + %% focal beam + \Arrows[linecolor=\psk@optic@focalrayColor,arrows=->>](B)(I') + \psline[linecolor=\psk@optic@focalrayColor](B)(I') + \psOutLine[linecolor=\psk@optic@focalrayColor,arrows=->>,length=2](B')(I'){END3} + \psOutLine[linecolor=\psk@optic@focalrayColor,length=10](B')(I'){END4} + \psline[linecolor=\psk@optic@focalrayColor,linestyle=dashed](B')(I') %\uput[45](I'){I'} %\uput[45](I){I} \uput[\psk@optic@spotA](A){$\mathrm{\psk@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@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@optic@rayColor}%% No global setting + %% Center beam + \pcline[linecolor=\psk@optic@centerrayColor](B)(B')%%CMittelpunktsstrahl + \Arrows[linecolor=\psk@optic@centerrayColor,length=16,arrows=-](B)(O) + \Arrows[linecolor=\psk@optic@centerrayColor](B)(I) + %% parallel beam + \psline[linecolor=\psk@optic@parallelrayColor,tipcolor=\psk@optic@paralleltipcolor](B)(I) + \Arrows[linecolor=\psk@optic@parallelrayColor](B)(I) + \Arrows[linecolor=\psk@optic@parallelrayColor,length=10,posStart=0,arrows=-](I)(F') + \Arrows[linecolor=\psk@optic@parallelrayColor,posStart=1,arrows=->](I)(F') + %% focal beam + \psline[linecolor=\psk@optic@focalrayColor](B)(I')(B') + \Arrows[linecolor=\psk@optic@focalrayColor,arrows=->>](B)(I') + \Arrows[linecolor=\psk@optic@focalrayColor,length=10,arrows=-](I')(B') + \Arrows[linecolor=\psk@optic@focalrayColor,length=2,posStart=0.5, + arrows=->>,tipcolor=\psk@optic@focaltipcolor](I')(B') %\uput[-45](I'){I'} %\uput[45](I){I} \uput[\psk@optic@spotA](A){$\mathrm{\psk@optic@nameA}$} @@ -736,7 +755,8 @@ %Lentille convergente : CVG %(#2) est l'abscisse du centre optique \def\lens{\@ifnextchar[{\pst@lens}{\pst@lens[]}} -\def\pst@lens[#1]{{% +\def\pst@lens[#1]{% + \begingroup \psset[pst-optic,pstricks]{xLeft=-7.5,xRight=7.5,yBottom=-3,yTop=3,#1}% % \psset[pst-optic,pstricks]{#1}% \pst@killglue% @@ -771,7 +791,7 @@ \pnode(! \psk@optic@xRight\space A'B' YO add){I1} \pnode(! \psk@optic@xRight\space neg A'B' YO add){I2} \else% - \pnode(!% + \pnode(! /OF' \psk@optic@focus\space def /AB \psk@optic@AB\space def /OA \psk@optic@OA\space def @@ -812,7 +832,8 @@ \psset{arrows=<->}% \fi\fi \psline[linecolor=\psk@optic@lensColor, - linewidth=\psk@optic@lensWidth,arrowsize=\psk@optic@lensArrowSize, + linewidth=2\pslinewidth, %\psk@optic@lensWidth, + arrowsize=\psk@optic@lensArrowSize, arrowinset=\psk@optic@lensArrowInset]% (! XO -0.5 \psk@optic@lensHeight\space mul \psk@optic@lensScale\space mul YO add)% @@ -829,7 +850,8 @@ \pst@drawCVGRays\fi\fi \fi \end{pspicture*}% -}\ignorespaces} + \endgroup + \ignorespaces} % % 25 december 2002 Herbert <voss@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@getcoor{#8}\pst@tempp \def\pst@optic@cIn{#6} % refraction number 1 \def\pst@optic@cOut{#7} % refraction number 2 - \pnode(!% - /YA \pst@tempA exch pop \pst@number\psyunit div def + \pnode(! + /YA \pst@tempA exch pop \pst@number\psyunit div def /XA \pst@tempA pop \pst@number\psxunit div def /YB \pst@tempB exch pop \pst@number\psyunit div def /XB \pst@tempB pop \pst@number\psxunit div def - /YC \pst@tempc exch pop \pst@number\psyunit div def + /YC \pst@tempc exch pop \pst@number\psyunit div def /XC \pst@tempc pop \pst@number\psxunit div def /YD \pst@tempd exch pop \pst@number\psyunit div def /XD \pst@tempd pop \pst@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°-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@optic@cIn\space \pst@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} % |