summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pst-optexp
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-02-27 21:41:46 +0000
committerKarl Berry <karl@freefriends.org>2021-02-27 21:41:46 +0000
commitda18e0a6fa23719ec60c8796f7d3b48443f40ca6 (patch)
tree5c309e19e992c2bacaef9d3a64b7db52eb8b71a7 /Master/texmf-dist/tex/latex/pst-optexp
parentd9fc9e3b6c88ffc70b84a33e722f78e9888b8ddf (diff)
pst-optexp (27feb21)
git-svn-id: svn://tug.org/texlive/trunk@57977 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pst-optexp')
-rw-r--r--Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty285
1 files changed, 129 insertions, 156 deletions
diff --git a/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty b/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
index 14878a3afea..cbef8cf71b9 100644
--- a/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
+++ b/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
@@ -9,9 +9,9 @@
%% This is a generated file.
%%
%% Project: pst-optexp
-%% Version: 5.2 (2014/11/26)
+%% Version: 6.0 (2021/02/26)
%%
-%% Copyright (C) 2007-2014 by Christoph Bersch <usenet@bersch.net>
+%% Copyright (C) 2007-2021 by Christoph Bersch <usenet@bersch.net>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
@@ -31,7 +31,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{pst-optexp}
- [2014/11/26 v5.2 Optical experimental setups with PSTricks]
+ [2021/02/26 v6.0 Optical experimental setups with PSTricks]
\RequirePackage{ifthen}
\RequirePackage{pstricks}
\RequirePackage{pst-xkey}
@@ -123,6 +123,7 @@
\newcount\POE@cnt
\newcount\POE@oldcnt
\newcount\POE@nodecnt
+\newcount\POE@couplernodecount
\def\POE@str@absolute{absolute}
\def\POE@str@auto{auto}
\def\POE@str@bandpass{bandpass}
@@ -542,21 +543,10 @@
\def\POE@getref@rotate@l{\def\POE@key@rotate@xref{-1}}%
\def\POE@getref@rotate@r{\def\POE@key@rotate@xref{1}}%
\psset[optexp]{rotateref=c}%
-\define@choicekey*[psset]{optexp}{namingscheme}%
- [\val\nr]{old,new}[new]{%
- \ifcase\nr\relax
- \edef\POE@str@basicname@default{tempNode}%
- \edef\POE@str@basicname@prefix{}%
- \gdef\POE@str@basicname@sep{Intern}%
- \edef\POE@str@extnode@postfix{ExtNode}%
- \or
- \edef\POE@str@basicname@default{@}%
- \edef\POE@str@basicname@prefix{OE@}%
- \gdef\POE@str@basicname@sep{}%
- \edef\POE@str@extnode@postfix{Ext}%
- \fi
-}%
-\psset[optexp]{namingscheme=new}%
+\edef\POE@str@basicname@default{@}%
+\edef\POE@str@basicname@prefix{OE@}%
+\gdef\POE@str@basicname@sep{}%
+\edef\POE@str@extnode@postfix{Ext}%
\define@key[psset]{optexp}{b@sicname}{%
\edef\POE@key@b@sicname{\POE@str@basicname@prefix#1}%
}%
@@ -738,14 +728,6 @@
\define@boolkey[psset]{optexp}[POE@]{voltage}[true]{}
\define@boolkey[psset]{optexp}[POE@]{caxisinv}[true]{}
\define@boolkey[psset]{optexp}[POE@]{lamp}[true]{}
-\define@key[psset]{optexp}{lampscale}{%
- \pst@checknum{#1}\POE@key@lampscale
- \pst@divide{\POE@key@lampscale pt}{0.3pt}{\POE@key@lampscale}
- \addtopsstyle{CrystalLamp}{unit=\POE@key@lampscale}
- \PackageWarning{pst-optexp}{%
- Parameter 'lampscale' is deprecated, \MessageBreak
- use style 'CrystalLamp' instead.}%
-}
\psset[optexp]{%
crystalwidth=1.4,
crystalheight=0.6,
@@ -890,15 +872,8 @@
\define@key[psset]{optexp}{polsize}{%
\pst@checknum{#1}\POE@key@polsize
}
-\define@key[psset]{optexp}{pollinewidth}{%
- \edef\POE@key@pollinewidth{#1}%
- \PackageWarning{pst-optexp}{%
- Parameter 'pollinewidth' is deprecated, \MessageBreak
- use style 'Polarization'.}%
-}%
-\def\POE@key@pollinewidth{0.7\pslinewidth}%
\newpsstyle{Polarization}{%
- linewidth=\POE@key@pollinewidth,
+ linewidth=0.7\pslinewidth,
arrowscale=0.8, dotsize=3\pslinewidth}
\define@choicekey+[psset]{optexp}{poltype}%
[\val\nr]{parallel,misc,perp,rcirc,lcirc}%
@@ -1056,43 +1031,6 @@
wedgeheight=0.8,
wedgewidth=0
}%
-\define@key[psset]{optexp}{optgridcount}{%
- \pst@checknum{#1}\POE@key@gratingcount
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridcount' is deprecated,\MessageBreak
- use 'gratingcount' instead.}%
-}%
-\define@key[psset]{optexp}{optgridwidth}{%
- \pst@checknum{#1}\POE@key@gratingwidth
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridwidth' is deprecated,\MessageBreak
- use 'gratingwidth' instead.}%
-}%
-\define@key[psset]{optexp}{optgridheight}{%
- \pst@checknum{#1}\POE@key@gratingheight
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridheight' is deprecated,\MessageBreak
- use 'gratingheight' instead.}%
-}%
-\define@choicekey*[psset]{optexp}{optgridtype}%
- [\val\nr]{binary,blazed}{%
- \edef\POE@key@gratingtype{#1}%
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridtype' is deprecated,\MessageBreak
- use 'gratingtype' instead.}%
-}%
-\define@key[psset]{optexp}{optgriddepth}{%
- \pst@checknum{#1}\POE@key@gratingdepth
- \PackageWarning{pst-optexp}{%
- Parameter 'optgriddepth' is deprecated,\MessageBreak
- use 'gratingdepth' instead.}%
-}%
-\define@key[psset]{optexp}{optgridlinewidth}{%
- \edef\POE@key@gratinglinewidth{#1}%
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridlinewidth' is deprecated,\MessageBreak
- use 'gratinglinewidth' instead.}%
-}%
\define@key[psset]{optexp}{gratingcount}{%
\pst@checknum{#1}\POE@key@gratingcount
}
@@ -1429,12 +1367,6 @@
\fi
}%
{\PackageError{pst-optexp}{Unknown value '\val' for couplertype}}
-\define@key[psset]{optexp}{align}{%
- \psset[optexp]{coupleralign=#1}%
- \PackageWarning{pst-optexp}{%
- Parameter 'align' is deprecated,\MessageBreak
- use 'coupleralign' instead.}%
-}
\define@choicekey+[psset]{optexp}{coupleralign}%
[\val\nr]{t,b,c,top,bottom,center}%
{%
@@ -2183,13 +2115,8 @@
wirealign=relative,
wirestyle=angle
}%
-\define@choicekey+[psset]{optexp}{startnode}%
- [\val\nr]{auto,1,2,3,4,N}%
- {\edef\POE@key@startnode{\val}}
- {\PackageError{pst-optexp}{Unknown startnode number '\val'}}
-\define@choicekey+[psset]{optexp}{stopnode}[\val\nr]{auto,1,2,3,4,N}%
- {\edef\POE@key@stopnode{\val}}
- {\PackageError{pst-optexp}{Unknown stopnode number '\val'}}
+\define@key[psset]{optexp}{startnode}{\edef\POE@key@startnode{#1}}%
+\define@key[psset]{optexp}{stopnode}{\edef\POE@key@stopnode{#1}}%
\psset[optexp]{%
startnode=auto,
stopnode=auto
@@ -3466,95 +3393,135 @@
\end@OptexpObj
}%
\def\wdmsplitter{\pst@object{wdmsplitter}}%
-\def\wdmsplitter@i(#1)(#2){%
- \@ifnextchar(%)
- {\wdmsplitter@ii(#1)(#2)}%
- {\wdmsplitter@ii(#1)(#2)(#2)}%
-}%
-\def\wdmsplitter@ii(#1)(#2)(#3){%
+\def\wdmsplitter@i{%
+ \def\my@aftercoors{\wdmsplitter@ii}%
+ \POE@couplernodecount=0\relax
+ \def\coupler@coors{}%
+ \coupler@@getcoors
+}
+\def\wdmsplitter@ii{%
\@ifnextchar\bgroup%
- {\wdmsplitter@iii(#1)(#2)(#3)}%
- {\wdmsplitter@iii(#1)(#2)(#3){}}%
+ {\wdmsplitter@iii}%
+ {\wdmsplitter@iii{}}%
}%
-\def\wdmsplitter@iii(#1)(#2)(#3)#4{%
+\def\wdmsplitter@iii#1{%
+ \ifnum\POE@couplernodecount>1\else
+ \PackageError{pst-optexp}%
+ {A wdmsplitter expects at least two nodes, one input and one output node}%
+ \fi
\begin@OptexpObj
\ifPOE@backlayer
- \pnode(#1){\oenodeRefA{}}
+ \pnode(! [ \coupler@coors 1 \POE@dict{GetCoordinatePair} \tx@UserCoor){\oenodeRefA{}}
\ifx\POE@key@coupleralign\POE@str@top
- \pnode(#2){\oenodeRefB{}}
+ \pnode(! [ \coupler@coors 2 \POE@dict{GetCoordinatePair} \tx@UserCoor){\oenodeRefB{}}
\else\ifx\POE@key@coupleralign\POE@str@bottom
- \pnode(#3){\oenodeRefB{}}
+ \pnode(! [ \coupler@coors counttomark 2 idiv \POE@dict{GetCoordinatePair} \tx@UserCoor){\oenodeRefB{}}
\else
- \pst@getcoor{#2}\POE@tempa%
- \pst@getcoor{#3}\POE@tempb%
- \pnode(!\POE@tempa \POE@tempb
- \POE@dict{VecAdd 0.5 VecScale}
- \tx@UserCoor){\oenodeRefB{}}
+ \pnode(! [ \coupler@coors
+pop pop
+counttomark 2 idiv dup counttomark 1 add 1 roll
+1 sub { \POE@dict{VecAdd} } repeat
+4 -1 roll 1 exch div \POE@dict{VecScale} 3 -1 roll pop \tx@UserCoor){\oenodeRefB{}}
\fi\fi
\fi
- \POE@drawcomponent{wdmsplitter}{#4}
+ \POE@drawcomponent{wdmsplitter}{#1}
\ifPOE@backlayer
\POE@Verb{%
- (1) (2) (\oenode{}{}) CorrectDipoleIfc
- (1) (3) (\oenode{}{}) CorrectDipoleIfc
+ 2 1 \the\POE@couplernodecount\space
+ {
+ inttostr (1) exch (\oenode{}{}) CorrectDipoleIfc
+ } for
}%
\ifPOE@fiberpresetin@
- \drawfiber@{FiberIn}[stopnode=1](#1){}
+ \drawfiber@{FiberIn}[stopnode=1](! [ \coupler@coors 1 \POE@dict{GetCoordinatePair} \tx@UserCoor){}
\fi
\ifPOE@fiberpresetout@
\ifPOE@fiberpresetout@top
- \drawfiber@{FiberOut1}[startnode=2]{}(#2)
+ \drawfiber@{FiberOut1}[startnode=2]{}(! [ \coupler@coors 2 \POE@dict{GetCoordinatePair} \tx@UserCoor)
\fi
\ifPOE@fiberpresetout@bottom
- \drawfiber@{FiberOut2}[startnode=N]{}(#3)
+ \drawfiber@{FiberOut2}[startnode=N]{}(! [ \coupler@coors \the\POE@couplernodecount\space \POE@dict{GetCoordinatePair} \tx@UserCoor)
\fi
\fi
+ \ifPOE@fiberpresetout@top\ifPOE@fiberpresetout@bottom
+ \@tempcnta=\POE@couplernodecount
+ \advance\@tempcnta by -3
+ \ifnum0<\@tempcnta
+ \multido{\i=3+1}{\the\@tempcnta}{%
+ \drawfiber@{FiberOut}[startnode=\i]{}(! [ \coupler@coors \i\space \POE@dict{GetCoordinatePair} \tx@UserCoor)
+ }%
+ \fi
+ \fi\fi
\fi
\end@OptexpObj
}%
\def\wdmcoupler{\pst@object{wdmcoupler}}%
-\def\wdmcoupler@i(#1)(#2){%
- \@ifnextchar(%)
- {\wdmcoupler@ii(#1)(#2)}%
- {\wdmcoupler@ii(#1)(#1)(#2)}%
-}%
-\def\wdmcoupler@ii(#1)(#2)(#3){%
+\def\wdmcoupler@i{%
+ \def\my@aftercoors{%
+ \advance\POE@couplernodecount by -1\relax%
+ \wdmcoupler@ii}%
+ \POE@couplernodecount=0\relax
+ \def\coupler@coors{}%
+ \coupler@@getcoors
+}
+\def\coupler@@getcoors(#1){%
+ \advance\POE@couplernodecount by \@ne\relax%
+ \pst@@getcoor{#1}%
+ \edef\coupler@coors{\pst@coor\coupler@coors}%
+ \@ifnextchar({\coupler@@getcoors}{\my@aftercoors}%
+}
+\def\wdmcoupler@ii{%
\@ifnextchar\bgroup%
- {\wdmcoupler@iii(#1)(#2)(#3)}%
- {\wdmcoupler@iii(#1)(#2)(#3){}}%
-}%
-\def\wdmcoupler@iii(#1)(#2)(#3)#4{%
+ {\wdmcoupler@iii}%
+ {\wdmcoupler@iii{}}%
+ }%
+\def\wdmcoupler@iii#1{%
+ \ifnum\POE@couplernodecount>0\else
+ \PackageError{pst-optexp}%
+ {A wdmcoupler expects at least two nodes, one input and one output node}%
+ \fi
\begin@OptexpObj
\ifPOE@backlayer
- \pnode(#3){\oenodeRefB{}}
+ \pnode(! [ \coupler@coors \the\POE@couplernodecount\space 1 add \POE@dict{GetCoordinatePair} \tx@UserCoor){\oenodeRefB{}}
\ifx\POE@key@coupleralign\POE@str@top
- \pnode(#1){\oenodeRefA{}}
+ \pnode(! [ \coupler@coors \POE@dict{GetFirstInputCoordinatePair} \tx@UserCoor){\oenodeRefA{}}
\else\ifx\POE@key@coupleralign\POE@str@bottom
- \pnode(#2){\oenodeRefA{}}
+ \pnode(! [ \coupler@coors \POE@dict{GetLastInputCoordinatePair} \tx@UserCoor){\oenodeRefA{}}
\else
- \pst@getcoor{#1}\POE@tempa%
- \pst@getcoor{#2}\POE@tempb%
- \pnode(!\POE@tempa \POE@tempb
- \POE@dict{VecAdd 0.5 VecScale}
- \tx@UserCoor){\oenodeRefA{}}
+ \pnode(! [ \coupler@coors
+counttomark -2 roll pop pop
+counttomark 2 idiv dup counttomark 1 add 1 roll
+1 sub { \POE@dict{VecAdd} } repeat
+4 -1 roll 1 exch div \POE@dict{VecScale} 3 -1 roll pop \tx@UserCoor){\oenodeRefA{}}
\fi\fi
\fi
- \POE@drawcomponent{wdmcoupler}{#4}
+ \POE@drawcomponent{wdmcoupler}{#1}
\ifPOE@backlayer
\POE@Verb{%
- (1) (3) (\oenode{}{}) CorrectDipoleIfc
- (2) (3) (\oenode{}{}) CorrectDipoleIfc
+ 1 1 \the\POE@couplernodecount\space
+ {
+ inttostr \the\POE@couplernodecount\space 1 add inttostr (\oenode{}{}) CorrectDipoleIfc
+ } for
}%
\ifPOE@fiberpresetout@
- \drawfiber@{FiberOut}[startnode=N]{}(#3)
+ \drawfiber@{FiberOut}[startnode=N]{}(\oenodeRefB{})
\fi
\ifPOE@fiberpresetin@
\ifPOE@fiberpresetin@top
- \drawfiber@{FiberIn1}[stopnode=1](#1){}
+ \drawfiber@{FiberIn1}[stopnode=1](! [ \coupler@coors 1 \POE@dict{GetCoordinatePair} \tx@UserCoor){}
\fi
\ifPOE@fiberpresetin@bottom
- \drawfiber@{FiberIn2}[stopnode=2](#2){}
+ \drawfiber@{FiberIn2}[stopnode=\the\POE@couplernodecount](! [ \coupler@coors \the\POE@couplernodecount\space \POE@dict{GetCoordinatePair} \tx@UserCoor){}
\fi
+ \ifPOE@fiberpresetin@top\ifPOE@fiberpresetin@bottom
+ \@tempcnta=\POE@couplernodecount
+ \advance\@tempcnta by -2
+ \ifnum0<\@tempcnta
+ \multido{\i=2+1}{\the\@tempcnta}{%
+ \drawfiber@{FiberIn}[stopnode=\i](! [ \coupler@coors \i\space \POE@dict{GetCoordinatePair} \tx@UserCoor){}
+ }%
+ \fi
+ \fi\fi
\fi
\fi
\end@OptexpObj
@@ -3914,12 +3881,6 @@
\newOptexpTripole[ref@angle=45]{beamsplitter}
\newOptexpTripole{optgrating}
\newOptexpTripole[ref@angle=90]{transmissiongrating}
-\def\optgrid{%
- \PackageWarning{pst-optexp}{%
- \string\optgrid\space is deprecated,\MessageBreak
- use \string\optgrating\space instead.}%
- \optgrating%
-}%
\newOptexpTripole[ref@angle=45]{pentaprism}
\newOptexpTripole[ref@angle=45]{rightangleprism}
\newOptexpTripole[ref@angle=45]{optprism}
@@ -4714,7 +4675,7 @@
\psframe(! \@wd neg \@ht neg)(! \@wd \@ht)
\ifPOE@voltage%
\psline(!\@wd 4 div 3 mul neg \@ht)%
- (! \@wd 4 div 3 mul neg \@ht 0.2 add)
+ (! \@wd 4 div 3 mul neg \@ht 0.16 add)
\pscircle[fillstyle=solid, fillcolor=white]%
(! \@wd 4 div 3 mul neg \@ht 0.2 add){0.04}
\psline(! \@wd 4 div 3 mul neg \@ht neg)%
@@ -5769,16 +5730,22 @@
\fi
}%
\def\wdmcoupler@nodes{%
- \edef\@sep{\POE@key@couplersep\space 0.5 mul }%
- \ifx\POE@key@couplertype\POE@str@none
- \ifx\POE@key@coupleralign\POE@str@center
- \edef\@sep{0 }%
- \fi
- \fi
\newOptexpFiberComp{%
- {@@x neg @@y0 \@sep add}
- {@@x neg @@y0 \@sep sub}
- {@@x 0}}%
+ /@@nodecount \the\POE@couplernodecount\space dup 1 le { pop 2 } if def
+ @@y0 \POE@key@couplersep\space 0.5 mul add
+ \POE@key@couplersep\space @@nodecount 1 sub div
+ \ifx\POE@key@couplertype\POE@str@none
+ \ifx\POE@key@coupleralign\POE@str@center
+ pop pop @@y0 0
+ \fi
+ \fi
+ 1 1 @@nodecount
+ {
+ 3 copy 1 sub mul sub exch pop [ @@x neg 3 -1 roll ] cvx 3 1 roll
+ } for
+ pop pop
+ {@@x 0}
+ }%
\pnode(0,0){\oenodeCenter{}}
}%
\def\wdmcoupler@comp{%
@@ -5789,7 +5756,7 @@
(!/N@\oenodeOut{} \POE@dict{@GetCenter}
\tx@UserCoor \POE@key@couplersep\space sub)(\oenode{2}{})
\else
- \psline[style=Fiber](\oenode{2}{})(\oenodeOut{})
+ \psline[style=Fiber](\oenode{\the\POE@couplernodecount}{})(\oenodeOut{})
\ifx\POE@key@coupleralign\POE@str@bottom
\psline[style=Fiber]%
(!/N@\oenodeOut{} \POE@dict{@GetCenter}
@@ -5800,16 +5767,22 @@
\POE@coupler@comp
}%
\def\wdmsplitter@nodes{%
- \edef\@sep{\POE@key@couplersep\space 0.5 mul }%
- \ifx\POE@key@couplertype\POE@str@none
- \ifx\POE@key@coupleralign\POE@str@center
- \edef\@sep{0 }%
- \fi
- \fi
\newOptexpFiberComp{%
{@@x neg 0}
- {@@x @@y0 \@sep add}
- {@@x @@y0 \@sep sub}}
+ /@@nodecount \the\POE@couplernodecount\space dup 2 gt { 1 sub } if def
+ @@y0 \POE@key@couplersep\space 0.5 mul add
+ \POE@key@couplersep\space @@nodecount 1 sub div
+ \ifx\POE@key@couplertype\POE@str@none
+ \ifx\POE@key@coupleralign\POE@str@center
+ pop pop @@y0 0
+ \fi
+ \fi
+ 1 1 @@nodecount
+ {
+ 3 copy 1 sub mul sub exch pop [ @@x 3 -1 roll ] cvx 3 1 roll
+ } for
+ pop pop
+ }%
\pnode(0,0){\oenodeCenter{}}
}%
\def\wdmsplitter@comp{%