texlive[57984] branches/branch2020.0/Master/texmf-dist: pst-optexp
commits+karl at tug.org
commits+karl at tug.org
Sat Feb 27 22:53:57 CET 2021
Revision: 57984
http://tug.org/svn/texlive?view=revision&revision=57984
Author: karl
Date: 2021-02-27 22:53:57 +0100 (Sat, 27 Feb 2021)
Log Message:
-----------
pst-optexp (27feb21) (branch)
Modified Paths:
--------------
branches/branch2020.0/Master/texmf-dist/doc/latex/pst-optexp/Changes
branches/branch2020.0/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-DE.pdf
branches/branch2020.0/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-quickref.pdf
branches/branch2020.0/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp.pdf
branches/branch2020.0/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro
branches/branch2020.0/Master/texmf-dist/makeindex/pst-optexp/pst-optexp.ist
branches/branch2020.0/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.dtx
branches/branch2020.0/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.ins
branches/branch2020.0/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
Added Paths:
-----------
branches/branch2020.0/Master/texmf-dist/source/latex/pst-optexp/Makefile
Removed Paths:
-------------
branches/branch2020.0/Master/texmf-dist/doc/latex/pst-optexp/Makefile
Modified: branches/branch2020.0/Master/texmf-dist/doc/latex/pst-optexp/Changes
===================================================================
--- branches/branch2020.0/Master/texmf-dist/doc/latex/pst-optexp/Changes 2021-02-27 21:53:33 UTC (rev 57983)
+++ branches/branch2020.0/Master/texmf-dist/doc/latex/pst-optexp/Changes 2021-02-27 21:53:57 UTC (rev 57984)
@@ -1,3 +1,20 @@
+6.0 2021-02-26
+ * Modified \wdmcoupler to handle an arbitrary number of input
+ nodes.
+ * Modified \wdmsplitter to handle an arbitrary number of output
+ nodes.
+ * Removed deprecated lampscale, use style CrystalLamp.
+ * Removed deprecated pollinewidth, use style Polarization.
+ * Removed deprecated \optgrid, use \optgrating.
+ * Removed deprecated optgridwidth, use gratingwidth.
+ * Removed deprecated optgridheight, use gratingheight.
+ * Removed deprecated optgriddepth, use gratingdepth.
+ * Removed deprecated optgridcount, use gratingcount.
+ * Removed deprecated optgridtype, use gratingtype.
+ * Removed deprecated optgridlinewidth, use gratinglinewidth.
+ * Removed deprecated align, use coupleralign.
+ * Removed deprecated namingschema.
+
5.2 2014-11-26
* Added component \asphericlens.
* Added component \axicon.
Deleted: branches/branch2020.0/Master/texmf-dist/doc/latex/pst-optexp/Makefile
===================================================================
--- branches/branch2020.0/Master/texmf-dist/doc/latex/pst-optexp/Makefile 2021-02-27 21:53:33 UTC (rev 57983)
+++ branches/branch2020.0/Master/texmf-dist/doc/latex/pst-optexp/Makefile 2021-02-27 21:53:57 UTC (rev 57984)
@@ -1,88 +0,0 @@
-.SUFFIXES : .tex .ltx .dvi .ps .pdf .eps
-
-PACKAGE = pst-optexp
-
-LATEX = latex
-
-ARCHNAME = $(PACKAGE)-$(shell date +"%y%m%d")
-
-ARCHFILES = Makefile README Changes \
- $(addprefix $(PACKAGE), -quickref.pdf .dtx .ins .pdf -DE.pdf)
-
-PS2PDF = GS_OPTIONS=-dPDFSETTINGS=/prepress ps2pdf
-
-all : doc-all Changes
-
-doc-all: doc doc-DE doc-code quickref
-
-doc: $(PACKAGE).pdf
-doc-DE: $(PACKAGE)-DE.pdf
-doc-code: $(PACKAGE)-code.pdf
-quickref: $(PACKAGE)-quickref.pdf
-
-dist: $(ARCHFILES)
- mkdir -p $(PACKAGE)
- cp $(ARCHFILES) $(PACKAGE)
- zip -r $(PACKAGE).zip $(PACKAGE)
- $(RM) -rf $(PACKAGE)/
-
-$(PACKAGE).dvi: L = english
-$(PACKAGE)-DE.dvi: L = ngerman
-$(PACKAGE)-code.dvi: L = english
-%.dvi: $(PACKAGE).dtx $(PACKAGE).sty $(PACKAGE).ist $(PACKAGE).pro
-
- if [ "$@" = "$(PACKAGE)-code.dvi" ]; then \
- sed 's/^\\OnlyDescription//' < $(PACKAGE).dtx > tmp.dtx; \
- else cp $(PACKAGE).dtx tmp.dtx; \
- fi
-
- $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{tmp.dtx}'
- $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{tmp.dtx}'
- splitindex -m "" $(basename $@).idx
- if test -e $(basename $@)-idx.idx; then \
- makeindex -s gind.ist -t $(basename $@)-idx.ilg \
- -o $(basename $@)-idx.ind $(basename $@)-idx.idx; \
- fi
- if test -e $(basename $@)-doc.idx; then \
- makeindex -s $(PACKAGE).ist -t $(basename $@)-doc.ilg \
- -o $(basename $@)-doc.ind $(basename $@)-doc.idx; \
- fi
- $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{tmp.dtx}'
- splitindex -m "" $(basename $@).idx
- if test -e $(basename $@)-idx.idx; then \
- makeindex -s gind.ist -t $(basename $@)-idx.ilg \
- -o $(basename $@)-idx.ind $(basename $@)-idx.idx; \
- fi
- if test -e $(basename $@)-doc.idx; then \
- makeindex -s $(PACKAGE).ist -t $(basename $@)-doc.ilg \
- -o $(basename $@)-doc.ind $(basename $@)-doc.idx; \
- fi
- $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{tmp.dtx}'
- $(RM) -f tmp.dtx
-
-%.ps: %.dvi
- dvips $<
-%.pdf: %.ps
- $(PS2PDF) $< $@
-
-$(PACKAGE)-quickref.tex: $(PACKAGE)-quickref.py $(PACKAGE).dtx
- python $<
-
-$(PACKAGE)-quickref.pdf: $(PACKAGE)-quickref.tex
- pdflatex $<
-
-$(PACKAGE).sty $(PACKAGE).pro $(PACKAGE).ist: $(PACKAGE).ins $(PACKAGE).dtx
- tex $<
-
-Changes: Changes.py $(PACKAGE).dtx
- python $<
-
-clean :
- $(RM) $(foreach prefix, $(PACKAGE) $(PACKAGE)-code $(PACKAGE)-DE $(PACKAGE)-quickref, \
- $(addprefix $(prefix), .dvi .ps .log .aux .bbl .blg .out .tmp \
- .toc .idx .ind .ilg .hd \
- -idx.idx -idx.ilg -idx.ind -doc.idx -doc.ilg -doc.ind .hd)) \
- $(PACKAGE)-quickref.tex
-
-veryclean : clean
- $(RM) $(addprefix $(PACKAGE), .pdf -DE.pdf -code.pdf -quickref.pdf .sty .pro .ist) Changes
Modified: branches/branch2020.0/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-DE.pdf
===================================================================
(Binary files differ)
Modified: branches/branch2020.0/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-quickref.pdf
===================================================================
(Binary files differ)
Modified: branches/branch2020.0/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp.pdf
===================================================================
(Binary files differ)
Modified: branches/branch2020.0/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro
===================================================================
--- branches/branch2020.0/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro 2021-02-27 21:53:33 UTC (rev 57983)
+++ branches/branch2020.0/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro 2021-02-27 21:53:57 UTC (rev 57984)
@@ -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 at bersch.net>
+%% Copyright (C) 2007-2021 by Christoph Bersch <usenet at bersch.net>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
@@ -1745,11 +1745,13 @@
(Center) NodeName @GetCenter 4 2 roll @ABVect
} bind def
/GetIfcOrNodeCoord {
+ (GetIfcOrNodeCoord) DebugBegin
dup xcheck {
exch pop exec
} {
nametostr exch nametostr exch GetIfcCenter
} ifelse
+ DebugEnd
} bind def
/connectInterfaces {
/relAngleTmp ED
@@ -1951,6 +1953,11 @@
end
} bind def
end
+/GetCoordinatePair {%
+ 2 mul -2 roll counttomark 1 add 2 roll cleartomark
+} bind def
+/GetFirstInputCoordinatePair { 1 GetCoordinatePair } bind def
+/GetLastInputCoordinatePair { counttomark 2 idiv 1 sub GetCoordinatePair } bind def
/mymax {
2 copy lt { exch } if pop
} bind def
Modified: branches/branch2020.0/Master/texmf-dist/makeindex/pst-optexp/pst-optexp.ist
===================================================================
--- branches/branch2020.0/Master/texmf-dist/makeindex/pst-optexp/pst-optexp.ist 2021-02-27 21:53:33 UTC (rev 57983)
+++ branches/branch2020.0/Master/texmf-dist/makeindex/pst-optexp/pst-optexp.ist 2021-02-27 21:53:57 UTC (rev 57984)
@@ -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 at bersch.net>
+%% Copyright (C) 2007-2021 by Christoph Bersch <usenet at bersch.net>
%%
%% This work may be distributed and/or modified under the
%% conditions of the LaTeX Project Public License, either version 1.3c
Added: branches/branch2020.0/Master/texmf-dist/source/latex/pst-optexp/Makefile
===================================================================
--- branches/branch2020.0/Master/texmf-dist/source/latex/pst-optexp/Makefile (rev 0)
+++ branches/branch2020.0/Master/texmf-dist/source/latex/pst-optexp/Makefile 2021-02-27 21:53:57 UTC (rev 57984)
@@ -0,0 +1,88 @@
+.SUFFIXES : .tex .ltx .dvi .ps .pdf .eps
+
+PACKAGE = pst-optexp
+
+LATEX = latex
+
+ARCHNAME = $(PACKAGE)-$(shell date +"%y%m%d")
+
+ARCHFILES = Makefile README Changes \
+ $(addprefix $(PACKAGE), -quickref.pdf .dtx .ins .pdf -DE.pdf)
+
+PS2PDF = GS_OPTIONS=-dPDFSETTINGS=/prepress ps2pdf
+
+all : doc-all Changes
+
+doc-all: doc doc-DE doc-code quickref
+
+doc: $(PACKAGE).pdf
+doc-DE: $(PACKAGE)-DE.pdf
+doc-code: $(PACKAGE)-code.pdf
+quickref: $(PACKAGE)-quickref.pdf
+
+dist: $(ARCHFILES)
+ mkdir -p $(PACKAGE)
+ cp $(ARCHFILES) $(PACKAGE)
+ zip -r $(PACKAGE).zip $(PACKAGE)
+ $(RM) -rf $(PACKAGE)/
+
+$(PACKAGE).dvi: L = english
+$(PACKAGE)-DE.dvi: L = ngerman
+$(PACKAGE)-code.dvi: L = english
+%.dvi: $(PACKAGE).dtx $(PACKAGE).sty $(PACKAGE).ist $(PACKAGE).pro
+
+ if [ "$@" = "$(PACKAGE)-code.dvi" ]; then \
+ sed 's/^\\OnlyDescription//' < $(PACKAGE).dtx > tmp.dtx; \
+ else cp $(PACKAGE).dtx tmp.dtx; \
+ fi
+
+ $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{tmp.dtx}'
+ $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{tmp.dtx}'
+ splitindex -m "" $(basename $@).idx
+ if test -e $(basename $@)-idx.idx; then \
+ makeindex -s gind.ist -t $(basename $@)-idx.ilg \
+ -o $(basename $@)-idx.ind $(basename $@)-idx.idx; \
+ fi
+ if test -e $(basename $@)-doc.idx; then \
+ makeindex -s $(PACKAGE).ist -t $(basename $@)-doc.ilg \
+ -o $(basename $@)-doc.ind $(basename $@)-doc.idx; \
+ fi
+ $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{tmp.dtx}'
+ splitindex -m "" $(basename $@).idx
+ if test -e $(basename $@)-idx.idx; then \
+ makeindex -s gind.ist -t $(basename $@)-idx.ilg \
+ -o $(basename $@)-idx.ind $(basename $@)-idx.idx; \
+ fi
+ if test -e $(basename $@)-doc.idx; then \
+ makeindex -s $(PACKAGE).ist -t $(basename $@)-doc.ilg \
+ -o $(basename $@)-doc.ind $(basename $@)-doc.idx; \
+ fi
+ $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{tmp.dtx}'
+ $(RM) -f tmp.dtx
+
+%.ps: %.dvi
+ dvips $<
+%.pdf: %.ps
+ $(PS2PDF) -dALLOWPSTRANSPARENCY $< $@
+
+$(PACKAGE)-quickref.tex: $(PACKAGE)-quickref.py $(PACKAGE).dtx
+ python $<
+
+$(PACKAGE)-quickref.pdf: $(PACKAGE)-quickref.tex
+ pdflatex $<
+
+$(PACKAGE).sty $(PACKAGE).pro $(PACKAGE).ist: $(PACKAGE).ins $(PACKAGE).dtx
+ tex $<
+
+Changes: Changes.py $(PACKAGE).dtx
+ python $<
+
+clean :
+ $(RM) $(foreach prefix, $(PACKAGE) $(PACKAGE)-code $(PACKAGE)-DE $(PACKAGE)-quickref, \
+ $(addprefix $(prefix), .dvi .ps .log .aux .bbl .blg .out .tmp \
+ .toc .idx .ind .ilg .hd \
+ -idx.idx -idx.ilg -idx.ind -doc.idx -doc.ilg -doc.ind .hd)) \
+ $(PACKAGE)-quickref.tex
+
+veryclean : clean
+ $(RM) $(addprefix $(PACKAGE), .pdf -DE.pdf -code.pdf -quickref.pdf .sty .pro .ist) Changes
Property changes on: branches/branch2020.0/Master/texmf-dist/source/latex/pst-optexp/Makefile
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Modified: branches/branch2020.0/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.dtx
===================================================================
--- branches/branch2020.0/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.dtx 2021-02-27 21:53:33 UTC (rev 57983)
+++ branches/branch2020.0/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.dtx 2021-02-27 21:53:57 UTC (rev 57984)
@@ -1,6 +1,6 @@
% \iffalse meta-comment
%
-% Copyright (C) 2007-2014 by Christoph Bersch <usenet at bersch.net>
+% Copyright (C) 2007-2021 by Christoph Bersch <usenet at bersch.net>
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3c
@@ -18,11 +18,18 @@
%<stylefile>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
%<stylefile>\ProvidesPackage{pst-optexp}
%<*stylefile>
- [2014/11/26 v5.2 Optical experimental setups with PSTricks]
+ [2021/02/26 v6.0 Optical experimental setups with PSTricks]
%</stylefile>
%
%<*driver>
-\documentclass[a4paper, DIV=9, oneside, toc=index, parskip=half-]{scrreprt}
+\documentclass[
+paper=a4,
+headinclude=false,
+footinclude=false,
+oneside,
+toc=index,
+headsepline,
+parskip=half-]{scrreprt}
\usepackage{doc}
\setcounter{IndexColumns}{2}
\usepackage[utf8]{inputenc}
@@ -136,21 +143,19 @@
\makeatother
\colorlet{sectioncolor}{DOrange}
\addtokomafont{sectioning}{\color{sectioncolor}}
-\usepackage[automark,nouppercase]{scrpage2}
+\usepackage[automark,markcase=ignorenouppercase]{scrlayer-scrpage}
\pagestyle{scrheadings}
-\clearscrheadings
-\clearscrplain
+\clearmainofpairofpagestyles
+\clearplainofpairofpagestyles
\ohead{\pagemark}
\ihead{\headmark}
\ofoot[\pagemark]{}
\automark[subsection]{section}
-\setheadsepline{.4pt}[\color{DOrange}]
-\setheadwidth[0pt]{text}
-\setfootwidth[0pt]{text}
+\setkomafont{headsepline}{\color{DOrange}}
+\DeclareTOCStyleEntry[level=0, numwidth=2.0em]{default}{chapter}
+\DeclareTOCStyleEntry[level=1, indent=1.5em, numwidth=3.0em]{default}{section}
+\DeclareTOCStyleEntry[level=2, indent=3.8em, numwidth=4.0em]{default}{subsection}
\makeatletter
-\patchcmd{\l at chapter}{1.5em}{2em}{}{}
-\renewcommand*\l at section{\bprot at dottedtocline{1}{1.5em}{3.0em}}
-\renewcommand*\l at subsection{\bprot at dottedtocline{2}{3.8em}{4.0em}}
\newrobustcmd*{\fnurl}[1][]{\hyper at normalise\ltd at fnurl{#1}}
\def\ltd at fnurl#1#2{\footnote{#1\hyper at linkurl{\Hurl{#2}}{#2}}}
\newrobustcmd*{\arxivurl}[1]{\href{http://arxiv.org/abs/#1}{arXiv:#1}}
@@ -709,7 +714,7 @@
% \renewcommand\maketitle{^^A
% \thispagestyle{empty}^^A
% \begin{titlepage}
-% \begin{pspicture}(1.6in,0.685in)(10,21.7)
+% \begin{pspicture}(1.6in,0.685in)(10,20.5)
% \psframe[fillstyle=solid,linecolor=lightgray,fillcolor=lightgray,linestyle=solid](0,-5.75)(21.5,10)
% \psframe[fillstyle=solid,linecolor=Orange!85!Red,fillcolor=Orange!85!Red,linestyle=solid](0,10)(21.5,10.5)
% \psframe[fillstyle=solid,linecolor=Orange!85!Red,fillcolor=Orange!85!Red,linestyle=solid](0,21.1)(21.5,21.2)
@@ -2547,7 +2552,7 @@
\addtopsstyle{OptComp}{linewidth=3\pslinewidth, linecolor=red}
\newpsstyle{OptionalStyle}{linecolor=blue}
\lens(0,1)(2,1)
-% Liniefarbe wird ueberschrieben, die Linienbreite nicht.
+% Linienfarbe wird ueberschrieben, die Linienbreite nicht.
\lens[optional](0,1)(3,1)
\end{pspicture}
\end{LTXexample}
@@ -3430,11 +3435,6 @@
% \iffalse
%</ignore>
% \fi
-%
-% \numitem{lampscale}
-% \ifGERMAN Skalierung der Lampe.\fi
-% \ifENGLISH Scaling of the lamp.\fi
-% \deprecatedmsg{\ifGERMAN den Stil \fi\ifENGLISH style \fi\Lstyle{CrystalLamp}}
% \end{optionlist}
%
% \begin{stylelist}
@@ -3688,11 +3688,6 @@
% \opt{polmisc} is half of this.
% \fi
%
-% \optitem[0.7\nxLcs{pslinewidth}]{pollinewidth}{\prm{num} or \prm{dimen}}
-% \ifGERMAN \linewidthexplanation{des Polarisationszeichens}{Polarisationszeichen}\fi
-% \ifENGLISH \linewidthexplanation{polarisation sign}{polarisation signs}\fi
-% \deprecatedmsg{\ifGERMAN den Stil \fi\ifENGLISH style \fi\Lstyle{Polarization}}
-%
% \choitem[parallel]{poltype}{parallel, perp, misc, lcirc, rcirc}
% \ifGERMAN Dieser Parameter wählt die Polarizationsart aus.\fi
% \ifENGLISH This parameter choses the polarization type.\fi
@@ -4319,14 +4314,6 @@
% \fi
% \end{ltxsyntax}
%
-% \ifENGLISH Before package version 3.0 this component was called
-% \Lcomp*{optgrid}. Since then this command name is deprecated and will be removed
-% in future versions.
-% \fi
-% \ifGERMAN Vor Paketversion 3.0 hieß diese Komponente \Lcomp*{optgrid}. Seitdem
-% ist diese Benennung veraltet und wird in zukünftigen Versionen entfernt
-% werden.
-% \fi
% \begin{optionlist}
% \numitem[1]{gratingwidth}
% \ifGERMAN Die Breite des Gitters.\fi
@@ -4452,27 +4439,6 @@
% \ifENGLISH \linewidthexplanation{grating}{gratings}\fi
% \end{optionlist}
%
-% \begin{stylelist}
-% \item[\smash{%
-% \begin{tabular}[t]{@{}l@{}}
-% \Lkeyword*{optgridwidth}\\
-% \Lkeyword*{optgridheight}\\
-% \Lkeyword*{optgriddepth}\\
-% \Lkeyword*{optgridcount}\\
-% \Lkeyword*{optgridtype}\\
-% \Lkeyword*{optgridlinewidth}
-% \end{tabular}}]^^A
-% \noindent
-% \ifGERMAN Diese Parameter wurden in die entsprechenden \opt{grating*}
-% Parameter umbenannt und sind seit Version 3.0 veraltet.
-% \fi
-% \ifENGLISH These parameters were renamed to the respective \opt{grating*}
-% parameters and are deprecated since version 3.0.
-% \fi
-% \vspace*{2cm}
-% \end{stylelist}
-%
-%
% \ifGERMAN\section{Transmissionsgitter}\fi
% \ifENGLISH\section{Transmission grating}\fi
%
@@ -5681,7 +5647,7 @@
% \fi
%
% \xLfmultipole{wdmcoupler}%
-% \compitem{wdmcoupler}(tl)(bl)(r){label}
+% \compitem{wdmcoupler}(tl)(...)(bl)(r){label}
% \iffalse
%<*ignore>
% \fi
@@ -5695,7 +5661,7 @@
% \fi
%
% \xLfmultipole{wdmsplitter}%
-% \compitem{wdmsplitter}(l)(tr)(br){label}
+% \compitem{wdmsplitter}(l)(tr)(...)(br){label}
% \iffalse
%<*ignore>
% \fi
@@ -5807,13 +5773,6 @@
% \iffalse
%</ignore>
% \fi
-% \choitem[center]{align}{top, bottom, center}
-% \ifGERMAN Dieser Parameter wurde in Version 3.0 in \Lkeyword{coupleralign}
-% umbenannt und ist seitdem veraltet.
-% \fi
-% \ifENGLISH This parameter was renamed in version 3.0 to
-% \Lkeyword{coupleralign} and is deprecated.
-% \fi
%
% \boolitem*[true]{variable}
% \iffalse
@@ -5839,6 +5798,8 @@
% \fi
% \end{stylelist}
%
+% \ifGERMAN\subsection{Variable Knotenanzahl}\fi
+% \ifENGLISH\subsection{Variable node count}\fi
% \ifGERMAN
% Jeder Koppler hat eine Variante, die nur zwei Knoten benötigt, einen Eingangs-
% und einen Ausgangsknoten. \Lcomp{optcoupler} verwendet jeden dieser Knoten
@@ -5872,6 +5833,93 @@
% \iffalse
%</ignore>
% \fi
+%
+% \ifGERMAN Des Weiteren kann ein \Lcomp{wdmcoupler} mehr als zwei Eingangsknoten haben, ein
+% \Lcomp{wdmsplitter} mehr als zwei Ausgangsknoten.\fi
+% \ifENGLISH A \Lcomp{wdmcoupler} can have more than two input nodes, a \Lcomp{wdmsplitter}
+% more than two output nodes.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(4,2)
+ \pnodes(0,2){A}(0,1.2){B}(0,0.8){C}(0,0){D}(4,1){E}
+ \wdmcoupler(A)(B)(C)(D)(E){coupler}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(4,2)
+ \pnodes(0,1){A}(4,2){B}(4,1.2){C}(4,0.8){D}(4,0){E}
+ \wdmsplitter(A)(B)(C)(D)(E){splitter}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN Die Ausrichtung der Komponente wird anhand des Mittelpunkts aller Eingangs-
+% (\Lcomp{wdmcoupler}) bzw. Ausgangsknoten (\Lcomp{wdmsplitter})
+% berechnet, falls nicht \Lkeyword{coupleralign} verwendet wird.\fi
+% \ifENGLISH The component's orientation is calculated from the median of all input nodes
+% (\Lcomp{wdmcoupler}) or all output nodes (\Lcomp{wdmsplitter}), unless \Lkeyword{coupleralign}
+% is used.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(4,2)
+ \pnodes(0,2){A}(0,0.5){B}(0,0){C}(4,1){D}
+ \wdmcoupler(A)(B)(C)(D){coupler}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(4,2)
+ \pnodes(0,2){E}(0,0.5){F}(0,0){G}(4,2){H}
+ \wdmcoupler[coupleralign=t](E)(F)(G)(H){coupler}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(4,2)
+ \pnodes(0,1){A}(4,2){B}(4,0.5){C}(4,0){D}
+ \wdmsplitter(A)(B)(C)(D){splitter}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(4,2)
+ \pnodes(0,0.5){E}(4,2){F}(4,1.5){G}(4,0){H}
+ \wdmsplitter[coupleralign=b](E)(F)(G)(H){splitter}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
% \ifGERMAN\subsection{Eingangs- und Ausgangsknoten}\fi
% \ifENGLISH\subsection{Input and output nodes}\fi
% \label{sec:coupler-nodes}
@@ -5888,14 +5936,16 @@
% \fi
% \begin{center}
% \begin{pspicture}(11,2)
-% \psset{couplersize=0.5, couplertype=rectangle, couplersep=0.2}
-% \wdmsplitter(0, 1.25)(3,2)(3,0.5)
+% \psset{couplersize=0.6, couplertype=rectangle, couplersep=0.25}
+% \wdmsplitter(0,1.25)(3,2)(3,1.25)(3,0.5)
% \psdot(\oenodeIfc{1}{})\uput[120](\oenodeIfc{1}{}){1}
% \psdot(\oenodeIfc{2}{})\uput[90](\oenodeIfc{2}{}){2}
+% \psdot(\oenodeIfc{3}{})\uput[180](\oenodeIfc{3}{}){3}
% \psdot(\oenodeIfc{N}{})\uput[-90](\oenodeIfc{N}{}){N}
-% \wdmcoupler(4, 2)(4,0.5)(7,1.25)
+% \wdmcoupler(4,2)(4,1.25)(4,0.5)(7,1.25)
% \psdot(\oenodeIfc{1}{})\uput[90](\oenodeIfc{1}{}){1}
-% \psdot(\oenodeIfc{2}{})\uput[-90](\oenodeIfc{2}{}){2}
+% \psdot(\oenodeIfc{2}{})\uput[0](\oenodeIfc{2}{}){2}
+% \psdot(\oenodeIfc{3}{})\uput[-90](\oenodeIfc{3}{}){3}
% \psdot(\oenodeIfc{N}{})\uput[60](\oenodeIfc{N}{}){N}
% \optcoupler(8,2)(8,0.5)(11,2)(11,0.5)
% \psdot(\oenodeIfc{1}{})\uput[90](\oenodeIfc{1}{}){1}
@@ -6743,24 +6793,6 @@
% \end{ltxsyntax}
%
% \begin{optionlist}
-% \optitem[new]{namingscheme}{old, new}
-% \ifGERMAN
-% Diese Option ist nur aus Kompatibilitätsgründen vorhanden. In Version 2.1
-% mussten spezielle Komponentenknoten über ihren expliziten Namen angesprochen
-% werden. Sie sollten diese Option nur dann verwenden und auf \opt{old}
-% setzen, wenn Sie in älteren Dokumenten direkt auf die Knoten zugegriffen
-% haben. Seit Version 3.0 werden Makros für den Zugriff auf die
-% Komponentenknoten bereitgestellt, so dass das eigentliche Namensschema
-% unerheblich ist.
-% \fi
-% \ifENGLISH
-% This option is for backward compatibility only. In version 2.1 special
-% component nodes had to be accessed by their explicit name. You should use
-% this option only if you accessed internal nodes directly in old
-% documents. Since version 3.0 explicit macros are provided to access all
-% special component nodes, so that the actual naming scheme does not matter.
-% \fi
-%
% \boolitem[false]{showoptdots}
% \ifGERMAN
% Markiert einige der speziellen Komponentenknoten: die schwarzen Punkte sind
@@ -11866,7 +11898,7 @@
\end{LTXexample}
\bigskip
-\enlargethispage{2cm}
+\enlargethispage{2.5cm}
\begingroup
\captionsetup[lstlisting]{format=poecaption}
\begin{LTXexample}[pos=t, caption={\ifGERMAN Angepasst von \fi\ifENGLISH Adapted from \fi\arxivurl{1112.5270v2}}]
@@ -12251,7 +12283,7 @@
\perppol[abspos=7](A)(B)\parpol(D)(\oenodeBeam{})
\end{pspicture}
\end{LTXexample}
-\enlargethispage{1cm}
+\enlargethispage{1.5cm}
\begin{LTXexample}[pos=t, caption={caption}]
\begin{pspicture}(13.7,2.9)
\newpsstyle{Wire}{arm=0.1, arrows=->}
@@ -12515,6 +12547,31 @@
\end{pspicture}
\end{LTXexample}
+\begin{LTXexample}[pos=t, caption={\ifENGLISH Adapted from \fi\ifGERMAN Angepasst von \fi\href{https://tex.stackexchange.com/q/581952}}, label=ex:multi-input-coupler]
+\begin{pspicture}(10,6)
+ \begin{optexp}
+ \psset[optexp]{usefiberstyle, couplersize=0.25, couplersep=0.07}
+ \newpsstyle{Fiber}{linecolor=orange, linewidth=2\pslinewidth}
+ \pnodes(2,1){PumpDiode}(2,5){UpperPumpDiode}(1,3){SignalIsolatorIn}(4, 3){SignalIsolatorOut}(1,3){SignalIn}(10,3){SignalCombinerOut}
+ \pnodes(7,3){FiberIn}(9,3){FiberOut}(9,3){AmpOut}
+ \optdiode[compname=PumpDiode, position=start](PumpDiode)([Xnodesep=1]PumpDiode){Pump diode}
+ \optdiode[compname=UpperPumpDiode, position=start](UpperPumpDiode)([Xnodesep=1]UpperPumpDiode){Pump diode}
+ \optisolator[compname=SignalIsolator, fiber=none](SignalIsolatorIn)(SignalIsolatorOut)%
+ {\begin{tabular}{@{}c@{}}Signal\\Isolator\end{tabular}}
+ \wdmcoupler[compname=SignalPumpCombiner](UpperPumpDiode)(\oenodeOut{SignalIsolator})(PumpDiode)(FiberIn)%
+ {\begin{tabular}{@{}c@{}}Signal/Pump\\light combiner\end{tabular}}
+ \optfiber[
+ compname=ActiveFiber,
+ position=start,
+ addtoFiberOut={arrows=->}](FiberIn)(FiberOut)%
+ {\begin{tabular}{@{}c@{}}Active\\fiber\end{tabular}}
+ \drawfiber[ArrowInside=->](SignalIn){SignalIsolator}
+ \end{optexp}
+ \nput{75}{AmpOut}{\begin{tabular}{@{}c@{}}Amplifier\\Output\end{tabular}}
+ \nput{-90}{SignalIn}{\begin{tabular}{@{}c@{}}Signal\\Input\end{tabular}}
+\end{pspicture}
+\end{LTXexample}
+
\begin{LTXexample}[pos=t, linerange={1-1}, caption={caption}]
\psset{unit=1.1, usefiberstyle=false}
@@ -13906,6 +13963,21 @@
%
% \begin{changelog}
% \patchcmd{\release}{\setlength{\itemsep}{0pt}}{\setlength{\itemsep}{0pt}\setlength{\parsep}{0pt}}{}{}
+% \begin{release}{6.0}{2021-02-26}
+% \item Modified \cs{wdmcoupler} to handle an arbitrary number of input nodes\see{comp:wdmcoupler}
+% \item Modified \cs{wdmsplitter} to handle an arbitrary number of output nodes\see{comp:wdmsplitter}
+% \item Removed deprecated \opt{lampscale}, use style \opt{CrystalLamp}.
+% \item Removed deprecated \opt{pollinewidth}, use style \opt{Polarization}.
+% \item Removed deprecated \cs{optgrid}, use \cs{optgrating}.
+% \item Removed deprecated \opt{optgridwidth}, use \opt{gratingwidth}.
+% \item Removed deprecated \opt{optgridheight}, use \opt{gratingheight}.
+% \item Removed deprecated \opt{optgriddepth}, use \opt{gratingdepth}.
+% \item Removed deprecated \opt{optgridcount}, use \opt{gratingcount}.
+% \item Removed deprecated \opt{optgridtype}, use \opt{gratingtype}.
+% \item Removed deprecated \opt{optgridlinewidth}, use \opt{gratinglinewidth}.
+% \item Removed deprecated \opt{align}, use \opt{coupleralign}.
+% \item Removed deprecated \opt{namingschema}.
+% \end{release}
% \begin{release}{5.2}{2014-11-26}
% \item Added component \cs{asphericlens}\see{comp:asphericlens}
% \item Added component \cs{axicon}\see{comp:axicon}
@@ -14372,6 +14444,10 @@
% \begin{macrocode}
\newcount\POE at nodecnt
% \end{macrocode}
+% Count the number of input nodes of a wdmcoupler, or output nodes of a wdmsplitter
+% \begin{macrocode}
+\newcount\POE at couplernodecount
+% \end{macrocode}
%
% \subsection{Fixed strings}
% These are all the fixed strings which are used as possible values for
@@ -14845,24 +14921,10 @@
% \end{macrocode}
% Naming parameters.
% \begin{macrocode}
-\define at choicekey*[psset]{optexp}{namingscheme}%
- [\val\nr]{old,new}[new]{%
- \ifcase\nr\relax
-% \end{macrocode}
-% Use the old naming scheme which was used in version 2.x.
-% \begin{macrocode}
- \edef\POE at str@basicname at default{tempNode}%
- \edef\POE at str@basicname at prefix{}%
- \gdef\POE at str@basicname at sep{Intern}%
- \edef\POE at str@extnode at postfix{ExtNode}%
- \or
- \edef\POE at str@basicname at default{@}%
- \edef\POE at str@basicname at prefix{OE@}%
- \gdef\POE at str@basicname at sep{}%
- \edef\POE at str@extnode at postfix{Ext}%
- \fi
-}%
-\psset[optexp]{namingscheme=new}%
+\edef\POE at str@basicname at default{@}%
+\edef\POE at str@basicname at prefix{OE@}%
+\gdef\POE at str@basicname at sep{}%
+\edef\POE at str@extnode at postfix{Ext}%
\define at key[psset]{optexp}{b at sicname}{%
\edef\POE at key@b at sicname{\POE at str@basicname at prefix#1}%
}%
@@ -15068,14 +15130,6 @@
\define at boolkey[psset]{optexp}[POE@]{voltage}[true]{}
\define at boolkey[psset]{optexp}[POE@]{caxisinv}[true]{}
\define at boolkey[psset]{optexp}[POE@]{lamp}[true]{}
-\define at key[psset]{optexp}{lampscale}{%
- \pst at checknum{#1}\POE at key@lampscale
- \pst at divide{\POE at key@lampscale pt}{0.3pt}{\POE at key@lampscale}
- \addtopsstyle{CrystalLamp}{unit=\POE at key@lampscale}
- \PackageWarning{pst-optexp}{%
- Parameter 'lampscale' is deprecated, \MessageBreak
- use style 'CrystalLamp' instead.}%
-}
\psset[optexp]{%
crystalwidth=1.4,
crystalheight=0.6,
@@ -15247,18 +15301,11 @@
\define at key[psset]{optexp}{polsize}{%
\pst at checknum{#1}\POE at key@polsize
}
-\define at key[psset]{optexp}{pollinewidth}{%
- \edef\POE at key@pollinewidth{#1}%
- \PackageWarning{pst-optexp}{%
- Parameter 'pollinewidth' is deprecated, \MessageBreak
- use style 'Polarization'.}%
-}%
% \end{macrocode}
% This is defined manually, to avoid printing the warning inside the key definition above.
% \begin{macrocode}
-\def\POE at key@pollinewidth{0.7\pslinewidth}%
\newpsstyle{Polarization}{%
- linewidth=\POE at key@pollinewidth,
+ linewidth=0.7\pslinewidth,
arrowscale=0.8, dotsize=3\pslinewidth}
\define at choicekey+[psset]{optexp}{poltype}%
[\val\nr]{parallel,misc,perp,rcirc,lcirc}%
@@ -15449,49 +15496,7 @@
}%
% \end{macrocode}
% Grating
-%
-% These are the old \opt{optgrid*} parameters, which have been deprecated.
% \begin{macrocode}
-\define at key[psset]{optexp}{optgridcount}{%
- \pst at checknum{#1}\POE at key@gratingcount
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridcount' is deprecated,\MessageBreak
- use 'gratingcount' instead.}%
-}%
-\define at key[psset]{optexp}{optgridwidth}{%
- \pst at checknum{#1}\POE at key@gratingwidth
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridwidth' is deprecated,\MessageBreak
- use 'gratingwidth' instead.}%
-}%
-\define at key[psset]{optexp}{optgridheight}{%
- \pst at checknum{#1}\POE at key@gratingheight
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridheight' is deprecated,\MessageBreak
- use 'gratingheight' instead.}%
-}%
-\define at choicekey*[psset]{optexp}{optgridtype}%
- [\val\nr]{binary,blazed}{%
- \edef\POE at key@gratingtype{#1}%
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridtype' is deprecated,\MessageBreak
- use 'gratingtype' instead.}%
-}%
-\define at key[psset]{optexp}{optgriddepth}{%
- \pst at checknum{#1}\POE at key@gratingdepth
- \PackageWarning{pst-optexp}{%
- Parameter 'optgriddepth' is deprecated,\MessageBreak
- use 'gratingdepth' instead.}%
-}%
-\define at key[psset]{optexp}{optgridlinewidth}{%
- \edef\POE at key@gratinglinewidth{#1}%
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridlinewidth' is deprecated,\MessageBreak
- use 'gratinglinewidth' instead.}%
-}%
-% \end{macrocode}
-% These are the new grating parameters.
-% \begin{macrocode}
\define at key[psset]{optexp}{gratingcount}{%
\pst at checknum{#1}\POE at key@gratingcount
}
@@ -15885,12 +15890,6 @@
\fi
}%
{\PackageError{pst-optexp}{Unknown value '\val' for couplertype}}
-\define at key[psset]{optexp}{align}{%
- \psset[optexp]{coupleralign=#1}%
- \PackageWarning{pst-optexp}{%
- Parameter 'align' is deprecated,\MessageBreak
- use 'coupleralign' instead.}%
-}
\define at choicekey+[psset]{optexp}{coupleralign}%
[\val\nr]{t,b,c,top,bottom,center}%
{%
@@ -16711,13 +16710,8 @@
% \end{macrocode}
% Which nodes to take for the automatic fiber and wire connections.
% \begin{macrocode}
-\define at choicekey+[psset]{optexp}{startnode}%
- [\val\nr]{auto,1,2,3,4,N}%
- {\edef\POE at key@startnode{\val}}
- {\PackageError{pst-optexp}{Unknown startnode number '\val'}}
-\define at choicekey+[psset]{optexp}{stopnode}[\val\nr]{auto,1,2,3,4,N}%
- {\edef\POE at key@stopnode{\val}}
- {\PackageError{pst-optexp}{Unknown stopnode number '\val'}}
+\define at key[psset]{optexp}{startnode}{\edef\POE at key@startnode{#1}}%
+\define at key[psset]{optexp}{stopnode}{\edef\POE at key@stopnode{#1}}%
\psset[optexp]{%
startnode=auto,
stopnode=auto
@@ -18575,100 +18569,200 @@
% \begin{macro}{\wdmsplitter}
% \begin{macrocode}
\def\wdmsplitter{\pst at object{wdmsplitter}}%
-\def\wdmsplitter at i(#1)(#2){%
- \@ifnextchar(%)
- {\wdmsplitter at ii(#1)(#2)}%
- {\wdmsplitter at ii(#1)(#2)(#2)}%
-}%
-\def\wdmsplitter at ii(#1)(#2)(#3){%
+\def\wdmsplitter at i{%
+ \def\my at aftercoors{\wdmsplitter at ii}%
+ \POE at couplernodecount=0\relax
+ \def\coupler at coors{}%
+ \coupler@@getcoors
+}
+\def\wdmsplitter at ii{%
\@ifnextchar\bgroup%
- {\wdmsplitter at iii(#1)(#2)(#3)}%
- {\wdmsplitter at iii(#1)(#2)(#3){}}%
+ {\wdmsplitter at iii}%
+ {\wdmsplitter at iii{}}%
}%
-\def\wdmsplitter at iii(#1)(#2)(#3)#4{%
+\def\wdmsplitter at iii#1{%
+ \ifnum\POE at couplernodecount>1\else
+ \PackageError{pst-optexp}%
+ {A wdmsplitter expects at least two nodes, one input and one output node}%
+ \fi
\begin at OptexpObj
\ifPOE at backlayer
- \pnode(#1){\oenodeRefA{}}
+% \end{macrocode}
+% Use first coordinate pair as RefA
+% \begin{macrocode}
+ \pnode(! [ \coupler at coors 1 \POE at dict{GetCoordinatePair} \tx at UserCoor){\oenodeRefA{}}
\ifx\POE at key@coupleralign\POE at str@top
- \pnode(#2){\oenodeRefB{}}
+% \end{macrocode}
+% For top alignment, use first output coordinate pair, i.e. second coordinate pair as RefB
+% \begin{macrocode}
+ \pnode(! [ \coupler at coors 2 \POE at dict{GetCoordinatePair} \tx at UserCoor){\oenodeRefB{}}
\else\ifx\POE at key@coupleralign\POE at str@bottom
- \pnode(#3){\oenodeRefB{}}
+% \end{macrocode}
+% For bottom alignment, use last output coordinate pair
+% \begin{macrocode}
+ \pnode(! [ \coupler at coors counttomark 2 idiv \POE at dict{GetCoordinatePair} \tx at UserCoor){\oenodeRefB{}}
\else
- \pst at getcoor{#2}\POE at tempa%
- \pst at getcoor{#3}\POE at tempb%
- \pnode(!\POE at tempa \POE at tempb
- \POE at dict{VecAdd 0.5 VecScale}
- \tx at UserCoor){\oenodeRefB{}}
+% \end{macrocode}
+% Use median of all output coordinate pairs as RefB
+% \begin{macrocode}
+ \pnode(! [ \coupler at coors
+% \end{macrocode}
+% remove input node from stack
+% \begin{macrocode}
+pop pop
+% \end{macrocode}
+% count number of output coordinate pair, keep that number and save it behind the mark
+% \begin{macrocode}
+counttomark 2 idiv dup counttomark 1 add 1 roll
+1 sub { \POE at dict{VecAdd} } repeat
+% \end{macrocode}
+% divide by number of output coordinate pairs and remove mark
+% \begin{macrocode}
+4 -1 roll 1 exch div \POE at dict{VecScale} 3 -1 roll pop \tx at UserCoor){\oenodeRefB{}}
\fi\fi
\fi
- \POE at drawcomponent{wdmsplitter}{#4}
+ \POE at drawcomponent{wdmsplitter}{#1}
\ifPOE at backlayer
\POE at Verb{%
- (1) (2) (\oenode{}{}) CorrectDipoleIfc
- (1) (3) (\oenode{}{}) CorrectDipoleIfc
+ 2 1 \the\POE at couplernodecount\space
+ {
+ inttostr (1) exch (\oenode{}{}) CorrectDipoleIfc
+ } for
}%
\ifPOE at fiberpresetin@
- \drawfiber@{FiberIn}[stopnode=1](#1){}
+ \drawfiber@{FiberIn}[stopnode=1](! [ \coupler at coors 1 \POE at dict{GetCoordinatePair} \tx at UserCoor){}
\fi
\ifPOE at fiberpresetout@
\ifPOE at fiberpresetout@top
- \drawfiber@{FiberOut1}[startnode=2]{}(#2)
+ \drawfiber@{FiberOut1}[startnode=2]{}(! [ \coupler at coors 2 \POE at dict{GetCoordinatePair} \tx at UserCoor)
\fi
\ifPOE at fiberpresetout@bottom
- \drawfiber@{FiberOut2}[startnode=N]{}(#3)
+ \drawfiber@{FiberOut2}[startnode=N]{}(! [ \coupler at coors \the\POE at couplernodecount\space \POE at dict{GetCoordinatePair} \tx at UserCoor)
\fi
\fi
+% \end{macrocode}
+% If top and bottom fibers are drawn, we must also draw all other output fibers
+% \begin{macrocode}
+ \ifPOE at fiberpresetout@top\ifPOE at fiberpresetout@bottom
+ \@tempcnta=\POE at couplernodecount
+ \advance\@tempcnta by -3
+ \ifnum0<\@tempcnta
+ \multido{\i=3+1}{\the\@tempcnta}{%
+ \drawfiber@{FiberOut}[startnode=\i]{}(! [ \coupler at coors \i\space \POE at dict{GetCoordinatePair} \tx at UserCoor)
+ }%
+ \fi
+ \fi\fi
\fi
\end at OptexpObj
}%
% \end{macrocode}
% \end{macro}
-%
+%
% \begin{macro}{\wdmcoupler}
% \begin{macrocode}
\def\wdmcoupler{\pst at object{wdmcoupler}}%
-\def\wdmcoupler at i(#1)(#2){%
- \@ifnextchar(%)
- {\wdmcoupler at ii(#1)(#2)}%
- {\wdmcoupler at ii(#1)(#1)(#2)}%
-}%
-\def\wdmcoupler at ii(#1)(#2)(#3){%
+\def\wdmcoupler at i{%
+ \def\my at aftercoors{%
+% \end{macrocode}
+% Subtract one, because we counted all nodes. However, we can always access the last
+% node by N, so we more often use the second last, i.e the last input node
+% \begin{macrocode}
+ \advance\POE at couplernodecount by -1\relax%
+ \wdmcoupler at ii}%
+ \POE at couplernodecount=0\relax
+ \def\coupler at coors{}%
+ \coupler@@getcoors
+}
+% \end{macrocode}
+% \begin{macro}{\coupler@@getcoors}
+% Read in a variable number of node coordinates. The coordinates are saved in \cs{coupler at coors},
+% their number in \cs{POE at couplernodecount}.
+% \begin{macrocode}
+\def\coupler@@getcoors(#1){%
+ \advance\POE at couplernodecount by \@ne\relax%
+ \pst@@getcoor{#1}%
+ \edef\coupler at coors{\pst at coor\coupler at coors}%
+ \@ifnextchar({\coupler@@getcoors}{\my at aftercoors}%
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\def\wdmcoupler at ii{%
\@ifnextchar\bgroup%
- {\wdmcoupler at iii(#1)(#2)(#3)}%
- {\wdmcoupler at iii(#1)(#2)(#3){}}%
-}%
-\def\wdmcoupler at iii(#1)(#2)(#3)#4{%
+ {\wdmcoupler at iii}%
+ {\wdmcoupler at iii{}}%
+ }%
+\def\wdmcoupler at iii#1{%
+ \ifnum\POE at couplernodecount>0\else
+ \PackageError{pst-optexp}%
+ {A wdmcoupler expects at least two nodes, one input and one output node}%
+ \fi
\begin at OptexpObj
\ifPOE at backlayer
- \pnode(#3){\oenodeRefB{}}
+% \end{macrocode}
+% Use last coordinate pair as RefB
+% \begin{macrocode}
+ \pnode(! [ \coupler at coors \the\POE at couplernodecount\space 1 add \POE at dict{GetCoordinatePair} \tx at UserCoor){\oenodeRefB{}}
\ifx\POE at key@coupleralign\POE at str@top
- \pnode(#1){\oenodeRefA{}}
+% \end{macrocode}
+% For top alignment, use first coordinate pair as RefA
+% \begin{macrocode}
+ \pnode(! [ \coupler at coors \POE at dict{GetFirstInputCoordinatePair} \tx at UserCoor){\oenodeRefA{}}
\else\ifx\POE at key@coupleralign\POE at str@bottom
- \pnode(#2){\oenodeRefA{}}
+% \end{macrocode}
+% For bottom alignment, use second last coordinate pair as RefA
+% \begin{macrocode}
+ \pnode(! [ \coupler at coors \POE at dict{GetLastInputCoordinatePair} \tx at UserCoor){\oenodeRefA{}}
\else
- \pst at getcoor{#1}\POE at tempa%
- \pst at getcoor{#2}\POE at tempb%
- \pnode(!\POE at tempa \POE at tempb
- \POE at dict{VecAdd 0.5 VecScale}
- \tx at UserCoor){\oenodeRefA{}}
+% \end{macrocode}
+% Use median of all input coordinate pairs as RefA
+% \begin{macrocode}
+ \pnode(! [ \coupler at coors
+% \end{macrocode}
+% remove output node from stack
+% \begin{macrocode}
+counttomark -2 roll pop pop
+% \end{macrocode}
+% count number of input coordinate pair, keep that number and save it behind the mark
+% \begin{macrocode}
+counttomark 2 idiv dup counttomark 1 add 1 roll
+1 sub { \POE at dict{VecAdd} } repeat
+% \end{macrocode}
+% divide by number of input coordinate pairs and remove mark
+% \begin{macrocode}
+4 -1 roll 1 exch div \POE at dict{VecScale} 3 -1 roll pop \tx at UserCoor){\oenodeRefA{}}
\fi\fi
\fi
- \POE at drawcomponent{wdmcoupler}{#4}
+ \POE at drawcomponent{wdmcoupler}{#1}
\ifPOE at backlayer
\POE at Verb{%
- (1) (3) (\oenode{}{}) CorrectDipoleIfc
- (2) (3) (\oenode{}{}) CorrectDipoleIfc
+ 1 1 \the\POE at couplernodecount\space
+ {
+ inttostr \the\POE at couplernodecount\space 1 add inttostr (\oenode{}{}) CorrectDipoleIfc
+ } for
}%
\ifPOE at fiberpresetout@
- \drawfiber@{FiberOut}[startnode=N]{}(#3)
+ \drawfiber@{FiberOut}[startnode=N]{}(\oenodeRefB{})
\fi
\ifPOE at fiberpresetin@
\ifPOE at fiberpresetin@top
- \drawfiber@{FiberIn1}[stopnode=1](#1){}
+ \drawfiber@{FiberIn1}[stopnode=1](! [ \coupler at coors 1 \POE at dict{GetCoordinatePair} \tx at UserCoor){}
\fi
\ifPOE at fiberpresetin@bottom
- \drawfiber@{FiberIn2}[stopnode=2](#2){}
+ \drawfiber@{FiberIn2}[stopnode=\the\POE at couplernodecount](! [ \coupler at coors \the\POE at couplernodecount\space \POE at dict{GetCoordinatePair} \tx at UserCoor){}
\fi
+% \end{macrocode}
+% If top and bottom fibers are drawn, we must also draw all other input fibers
+% \begin{macrocode}
+ \ifPOE at fiberpresetin@top\ifPOE at fiberpresetin@bottom
+ \@tempcnta=\POE at couplernodecount
+ \advance\@tempcnta by -2
+ \ifnum0<\@tempcnta
+ \multido{\i=2+1}{\the\@tempcnta}{%
+ \drawfiber@{FiberIn}[stopnode=\i](! [ \coupler at coors \i\space \POE at dict{GetCoordinatePair} \tx at UserCoor){}
+ }%
+ \fi
+ \fi\fi
\fi
\fi
\end at OptexpObj
@@ -18675,6 +18769,7 @@
}%
% \end{macrocode}
% \end{macro}
+%
% \begin{macro}{\optcirculator}
% \begin{macrocode}
\def\optcirculator{\pst at object{optcirculator}}%
@@ -19181,12 +19276,6 @@
\newOptexpTripole[ref at angle=45]{beamsplitter}
\newOptexpTripole{optgrating}
\newOptexpTripole[ref at angle=90]{transmissiongrating}
-\def\optgrid{%
- \PackageWarning{pst-optexp}{%
- \string\optgrid\space is deprecated,\MessageBreak
- use \string\optgrating\space instead.}%
- \optgrating%
-}%
\newOptexpTripole[ref at angle=45]{pentaprism}
\newOptexpTripole[ref at angle=45]{rightangleprism}
\newOptexpTripole[ref at angle=45]{optprism}
@@ -20230,7 +20319,7 @@
\psframe(! \@wd neg \@ht neg)(! \@wd \@ht)
\ifPOE at 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)%
@@ -21744,16 +21833,25 @@
% \begin{macro}{\wdmcoupler at nodes}
% \begin{macrocode}
\def\wdmcoupler at nodes{%
- \edef\@sep{\POE at key@couplersep\space 0.5 mul }%
- \ifx\POE at key@couplertype\POE at str@none
- \ifx\POE at key@coupleralign\POE at str@center
- \edef\@sep{0 }%
+ \newOptexpFiberComp{%
+% \end{macrocode}
+% A coupler may have only a single input node, which must then be duplicated
+% \begin{macrocode}
+ /@@nodecount \the\POE at couplernodecount\space dup 1 le { pop 2 } if def
+ @@y0 \POE at key@couplersep\space 0.5 mul add
+ \POE at key@couplersep\space @@nodecount 1 sub div
+ \ifx\POE at key@couplertype\POE at str@none
+ \ifx\POE at key@coupleralign\POE at str@center
+ pop pop @@y0 0
+ \fi
\fi
- \fi
- \newOptexpFiberComp{%
- {@@x neg @@y0 \@sep add}
- {@@x neg @@y0 \@sep sub}
- {@@x 0}}%
+ 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{}}
}%
% \end{macrocode}
@@ -21769,7 +21867,7 @@
(!/N@\oenodeOut{} \POE at dict{@GetCenter}
\tx at UserCoor \POE at key@couplersep\space sub)(\oenode{2}{})
\else
- \psline[style=Fiber](\oenode{2}{})(\oenodeOut{})
+ \psline[style=Fiber](\oenode{\the\POE at couplernodecount}{})(\oenodeOut{})
\ifx\POE at key@coupleralign\POE at str@bottom
\psline[style=Fiber]%
(!/N@\oenodeOut{} \POE at dict{@GetCenter}
@@ -21786,16 +21884,25 @@
% \begin{macro}{\wdmsplitter at nodes}
% \begin{macrocode}
\def\wdmsplitter at nodes{%
- \edef\@sep{\POE at key@couplersep\space 0.5 mul }%
- \ifx\POE at key@couplertype\POE at str@none
- \ifx\POE at key@coupleralign\POE at str@center
- \edef\@sep{0 }%
- \fi
- \fi
\newOptexpFiberComp{%
{@@x neg 0}
- {@@x @@y0 \@sep add}
- {@@x @@y0 \@sep sub}}
+% \end{macrocode}
+% A coupler may have only a single output node, which must then be duplicated
+% \begin{macrocode}
+ /@@nodecount \the\POE at couplernodecount\space dup 2 gt { 1 sub } if def
+ @@y0 \POE at key@couplersep\space 0.5 mul add
+ \POE at key@couplersep\space @@nodecount 1 sub div
+ \ifx\POE at key@couplertype\POE at str@none
+ \ifx\POE at key@coupleralign\POE at 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{}}
}%
% \end{macrocode}
@@ -25224,11 +25331,13 @@
% \end{pssyntax}
% \begin{macrocode}
/GetIfcOrNodeCoord {
+ (GetIfcOrNodeCoord) DebugBegin
dup xcheck {
exch pop exec
} {
nametostr exch nametostr exch GetIfcCenter
} ifelse
+ DebugEnd
} bind def
% \end{macrocode}
% \end{macro}
@@ -25554,6 +25663,25 @@
end
% \end{macrocode}
%
+% \begin{macro}{GetCoordinatePair}
+% Get the coordinate pair at position \PSvar{n} (n goes from 1 to N) and remove the other coordinates
+% including mark from stack
+% \begin{pssyntax}
+% [ \PSvar{xN} \PSvar{yN} ... \PSvar{x1} \PSvar{y1} \PSvar{n} \PSop{GetCoordinatePair}
+% \end{pssyntax}
+% \begin{macrocode}
+/GetCoordinatePair {%
+ 2 mul -2 roll counttomark 1 add 2 roll cleartomark
+} bind def
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+/GetFirstInputCoordinatePair { 1 GetCoordinatePair } bind def
+% \end{macrocode}
+% If a coupler has only a single input node, this must be used for both nodes
+% \begin{macrocode}
+/GetLastInputCoordinatePair { counttomark 2 idiv 1 sub GetCoordinatePair } bind def
+% \end{macrocode}
% \begin{macro}{mymax}
% For some reason Adobe Distiller crashes if 'max' operator is used
% with two floats which are very close (4e-5 in one case)
Modified: branches/branch2020.0/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.ins
===================================================================
--- branches/branch2020.0/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.ins 2021-02-27 21:53:33 UTC (rev 57983)
+++ branches/branch2020.0/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.ins 2021-02-27 21:53:57 UTC (rev 57984)
@@ -53,9 +53,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 at bersch.net>
+Copyright (C) 2007-2021 by Christoph Bersch <usenet at bersch.net>
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License, either version 1.3c
Modified: branches/branch2020.0/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
===================================================================
--- branches/branch2020.0/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty 2021-02-27 21:53:33 UTC (rev 57983)
+++ branches/branch2020.0/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty 2021-02-27 21:53:57 UTC (rev 57984)
@@ -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 at bersch.net>
+%% Copyright (C) 2007-2021 by Christoph Bersch <usenet at 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 at cnt
\newcount\POE at oldcnt
\newcount\POE at nodecnt
+\newcount\POE at couplernodecount
\def\POE at str@absolute{absolute}
\def\POE at str@auto{auto}
\def\POE at str@bandpass{bandpass}
@@ -542,21 +543,10 @@
\def\POE at getref@rotate at l{\def\POE at key@rotate at xref{-1}}%
\def\POE at getref@rotate at r{\def\POE at key@rotate at xref{1}}%
\psset[optexp]{rotateref=c}%
-\define at choicekey*[psset]{optexp}{namingscheme}%
- [\val\nr]{old,new}[new]{%
- \ifcase\nr\relax
- \edef\POE at str@basicname at default{tempNode}%
- \edef\POE at str@basicname at prefix{}%
- \gdef\POE at str@basicname at sep{Intern}%
- \edef\POE at str@extnode at postfix{ExtNode}%
- \or
- \edef\POE at str@basicname at default{@}%
- \edef\POE at str@basicname at prefix{OE@}%
- \gdef\POE at str@basicname at sep{}%
- \edef\POE at str@extnode at postfix{Ext}%
- \fi
-}%
-\psset[optexp]{namingscheme=new}%
+\edef\POE at str@basicname at default{@}%
+\edef\POE at str@basicname at prefix{OE@}%
+\gdef\POE at str@basicname at sep{}%
+\edef\POE at str@extnode at postfix{Ext}%
\define at key[psset]{optexp}{b at sicname}{%
\edef\POE at key@b at sicname{\POE at str@basicname at prefix#1}%
}%
@@ -738,14 +728,6 @@
\define at boolkey[psset]{optexp}[POE@]{voltage}[true]{}
\define at boolkey[psset]{optexp}[POE@]{caxisinv}[true]{}
\define at boolkey[psset]{optexp}[POE@]{lamp}[true]{}
-\define at key[psset]{optexp}{lampscale}{%
- \pst at checknum{#1}\POE at key@lampscale
- \pst at divide{\POE at key@lampscale pt}{0.3pt}{\POE at key@lampscale}
- \addtopsstyle{CrystalLamp}{unit=\POE at 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 at key[psset]{optexp}{polsize}{%
\pst at checknum{#1}\POE at key@polsize
}
-\define at key[psset]{optexp}{pollinewidth}{%
- \edef\POE at key@pollinewidth{#1}%
- \PackageWarning{pst-optexp}{%
- Parameter 'pollinewidth' is deprecated, \MessageBreak
- use style 'Polarization'.}%
-}%
-\def\POE at key@pollinewidth{0.7\pslinewidth}%
\newpsstyle{Polarization}{%
- linewidth=\POE at key@pollinewidth,
+ linewidth=0.7\pslinewidth,
arrowscale=0.8, dotsize=3\pslinewidth}
\define at choicekey+[psset]{optexp}{poltype}%
[\val\nr]{parallel,misc,perp,rcirc,lcirc}%
@@ -1056,43 +1031,6 @@
wedgeheight=0.8,
wedgewidth=0
}%
-\define at key[psset]{optexp}{optgridcount}{%
- \pst at checknum{#1}\POE at key@gratingcount
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridcount' is deprecated,\MessageBreak
- use 'gratingcount' instead.}%
-}%
-\define at key[psset]{optexp}{optgridwidth}{%
- \pst at checknum{#1}\POE at key@gratingwidth
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridwidth' is deprecated,\MessageBreak
- use 'gratingwidth' instead.}%
-}%
-\define at key[psset]{optexp}{optgridheight}{%
- \pst at checknum{#1}\POE at key@gratingheight
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridheight' is deprecated,\MessageBreak
- use 'gratingheight' instead.}%
-}%
-\define at choicekey*[psset]{optexp}{optgridtype}%
- [\val\nr]{binary,blazed}{%
- \edef\POE at key@gratingtype{#1}%
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridtype' is deprecated,\MessageBreak
- use 'gratingtype' instead.}%
-}%
-\define at key[psset]{optexp}{optgriddepth}{%
- \pst at checknum{#1}\POE at key@gratingdepth
- \PackageWarning{pst-optexp}{%
- Parameter 'optgriddepth' is deprecated,\MessageBreak
- use 'gratingdepth' instead.}%
-}%
-\define at key[psset]{optexp}{optgridlinewidth}{%
- \edef\POE at key@gratinglinewidth{#1}%
- \PackageWarning{pst-optexp}{%
- Parameter 'optgridlinewidth' is deprecated,\MessageBreak
- use 'gratinglinewidth' instead.}%
-}%
\define at key[psset]{optexp}{gratingcount}{%
\pst at checknum{#1}\POE at key@gratingcount
}
@@ -1429,12 +1367,6 @@
\fi
}%
{\PackageError{pst-optexp}{Unknown value '\val' for couplertype}}
-\define at key[psset]{optexp}{align}{%
- \psset[optexp]{coupleralign=#1}%
- \PackageWarning{pst-optexp}{%
- Parameter 'align' is deprecated,\MessageBreak
- use 'coupleralign' instead.}%
-}
\define at choicekey+[psset]{optexp}{coupleralign}%
[\val\nr]{t,b,c,top,bottom,center}%
{%
@@ -2183,13 +2115,8 @@
wirealign=relative,
wirestyle=angle
}%
-\define at choicekey+[psset]{optexp}{startnode}%
- [\val\nr]{auto,1,2,3,4,N}%
- {\edef\POE at key@startnode{\val}}
- {\PackageError{pst-optexp}{Unknown startnode number '\val'}}
-\define at choicekey+[psset]{optexp}{stopnode}[\val\nr]{auto,1,2,3,4,N}%
- {\edef\POE at key@stopnode{\val}}
- {\PackageError{pst-optexp}{Unknown stopnode number '\val'}}
+\define at key[psset]{optexp}{startnode}{\edef\POE at key@startnode{#1}}%
+\define at key[psset]{optexp}{stopnode}{\edef\POE at key@stopnode{#1}}%
\psset[optexp]{%
startnode=auto,
stopnode=auto
@@ -3466,95 +3393,135 @@
\end at OptexpObj
}%
\def\wdmsplitter{\pst at object{wdmsplitter}}%
-\def\wdmsplitter at i(#1)(#2){%
- \@ifnextchar(%)
- {\wdmsplitter at ii(#1)(#2)}%
- {\wdmsplitter at ii(#1)(#2)(#2)}%
-}%
-\def\wdmsplitter at ii(#1)(#2)(#3){%
+\def\wdmsplitter at i{%
+ \def\my at aftercoors{\wdmsplitter at ii}%
+ \POE at couplernodecount=0\relax
+ \def\coupler at coors{}%
+ \coupler@@getcoors
+}
+\def\wdmsplitter at ii{%
\@ifnextchar\bgroup%
- {\wdmsplitter at iii(#1)(#2)(#3)}%
- {\wdmsplitter at iii(#1)(#2)(#3){}}%
+ {\wdmsplitter at iii}%
+ {\wdmsplitter at iii{}}%
}%
-\def\wdmsplitter at iii(#1)(#2)(#3)#4{%
+\def\wdmsplitter at iii#1{%
+ \ifnum\POE at couplernodecount>1\else
+ \PackageError{pst-optexp}%
+ {A wdmsplitter expects at least two nodes, one input and one output node}%
+ \fi
\begin at OptexpObj
\ifPOE at backlayer
- \pnode(#1){\oenodeRefA{}}
+ \pnode(! [ \coupler at coors 1 \POE at dict{GetCoordinatePair} \tx at UserCoor){\oenodeRefA{}}
\ifx\POE at key@coupleralign\POE at str@top
- \pnode(#2){\oenodeRefB{}}
+ \pnode(! [ \coupler at coors 2 \POE at dict{GetCoordinatePair} \tx at UserCoor){\oenodeRefB{}}
\else\ifx\POE at key@coupleralign\POE at str@bottom
- \pnode(#3){\oenodeRefB{}}
+ \pnode(! [ \coupler at coors counttomark 2 idiv \POE at dict{GetCoordinatePair} \tx at UserCoor){\oenodeRefB{}}
\else
- \pst at getcoor{#2}\POE at tempa%
- \pst at getcoor{#3}\POE at tempb%
- \pnode(!\POE at tempa \POE at tempb
- \POE at dict{VecAdd 0.5 VecScale}
- \tx at UserCoor){\oenodeRefB{}}
+ \pnode(! [ \coupler at coors
+pop pop
+counttomark 2 idiv dup counttomark 1 add 1 roll
+1 sub { \POE at dict{VecAdd} } repeat
+4 -1 roll 1 exch div \POE at dict{VecScale} 3 -1 roll pop \tx at UserCoor){\oenodeRefB{}}
\fi\fi
\fi
- \POE at drawcomponent{wdmsplitter}{#4}
+ \POE at drawcomponent{wdmsplitter}{#1}
\ifPOE at backlayer
\POE at Verb{%
- (1) (2) (\oenode{}{}) CorrectDipoleIfc
- (1) (3) (\oenode{}{}) CorrectDipoleIfc
+ 2 1 \the\POE at couplernodecount\space
+ {
+ inttostr (1) exch (\oenode{}{}) CorrectDipoleIfc
+ } for
}%
\ifPOE at fiberpresetin@
- \drawfiber@{FiberIn}[stopnode=1](#1){}
+ \drawfiber@{FiberIn}[stopnode=1](! [ \coupler at coors 1 \POE at dict{GetCoordinatePair} \tx at UserCoor){}
\fi
\ifPOE at fiberpresetout@
\ifPOE at fiberpresetout@top
- \drawfiber@{FiberOut1}[startnode=2]{}(#2)
+ \drawfiber@{FiberOut1}[startnode=2]{}(! [ \coupler at coors 2 \POE at dict{GetCoordinatePair} \tx at UserCoor)
\fi
\ifPOE at fiberpresetout@bottom
- \drawfiber@{FiberOut2}[startnode=N]{}(#3)
+ \drawfiber@{FiberOut2}[startnode=N]{}(! [ \coupler at coors \the\POE at couplernodecount\space \POE at dict{GetCoordinatePair} \tx at UserCoor)
\fi
\fi
+ \ifPOE at fiberpresetout@top\ifPOE at fiberpresetout@bottom
+ \@tempcnta=\POE at couplernodecount
+ \advance\@tempcnta by -3
+ \ifnum0<\@tempcnta
+ \multido{\i=3+1}{\the\@tempcnta}{%
+ \drawfiber@{FiberOut}[startnode=\i]{}(! [ \coupler at coors \i\space \POE at dict{GetCoordinatePair} \tx at UserCoor)
+ }%
+ \fi
+ \fi\fi
\fi
\end at OptexpObj
}%
\def\wdmcoupler{\pst at object{wdmcoupler}}%
-\def\wdmcoupler at i(#1)(#2){%
- \@ifnextchar(%)
- {\wdmcoupler at ii(#1)(#2)}%
- {\wdmcoupler at ii(#1)(#1)(#2)}%
-}%
-\def\wdmcoupler at ii(#1)(#2)(#3){%
+\def\wdmcoupler at i{%
+ \def\my at aftercoors{%
+ \advance\POE at couplernodecount by -1\relax%
+ \wdmcoupler at ii}%
+ \POE at couplernodecount=0\relax
+ \def\coupler at coors{}%
+ \coupler@@getcoors
+}
+\def\coupler@@getcoors(#1){%
+ \advance\POE at couplernodecount by \@ne\relax%
+ \pst@@getcoor{#1}%
+ \edef\coupler at coors{\pst at coor\coupler at coors}%
+ \@ifnextchar({\coupler@@getcoors}{\my at aftercoors}%
+}
+\def\wdmcoupler at ii{%
\@ifnextchar\bgroup%
- {\wdmcoupler at iii(#1)(#2)(#3)}%
- {\wdmcoupler at iii(#1)(#2)(#3){}}%
-}%
-\def\wdmcoupler at iii(#1)(#2)(#3)#4{%
+ {\wdmcoupler at iii}%
+ {\wdmcoupler at iii{}}%
+ }%
+\def\wdmcoupler at iii#1{%
+ \ifnum\POE at couplernodecount>0\else
+ \PackageError{pst-optexp}%
+ {A wdmcoupler expects at least two nodes, one input and one output node}%
+ \fi
\begin at OptexpObj
\ifPOE at backlayer
- \pnode(#3){\oenodeRefB{}}
+ \pnode(! [ \coupler at coors \the\POE at couplernodecount\space 1 add \POE at dict{GetCoordinatePair} \tx at UserCoor){\oenodeRefB{}}
\ifx\POE at key@coupleralign\POE at str@top
- \pnode(#1){\oenodeRefA{}}
+ \pnode(! [ \coupler at coors \POE at dict{GetFirstInputCoordinatePair} \tx at UserCoor){\oenodeRefA{}}
\else\ifx\POE at key@coupleralign\POE at str@bottom
- \pnode(#2){\oenodeRefA{}}
+ \pnode(! [ \coupler at coors \POE at dict{GetLastInputCoordinatePair} \tx at UserCoor){\oenodeRefA{}}
\else
- \pst at getcoor{#1}\POE at tempa%
- \pst at getcoor{#2}\POE at tempb%
- \pnode(!\POE at tempa \POE at tempb
- \POE at dict{VecAdd 0.5 VecScale}
- \tx at UserCoor){\oenodeRefA{}}
+ \pnode(! [ \coupler at coors
+counttomark -2 roll pop pop
+counttomark 2 idiv dup counttomark 1 add 1 roll
+1 sub { \POE at dict{VecAdd} } repeat
+4 -1 roll 1 exch div \POE at dict{VecScale} 3 -1 roll pop \tx at UserCoor){\oenodeRefA{}}
\fi\fi
\fi
- \POE at drawcomponent{wdmcoupler}{#4}
+ \POE at drawcomponent{wdmcoupler}{#1}
\ifPOE at backlayer
\POE at Verb{%
- (1) (3) (\oenode{}{}) CorrectDipoleIfc
- (2) (3) (\oenode{}{}) CorrectDipoleIfc
+ 1 1 \the\POE at couplernodecount\space
+ {
+ inttostr \the\POE at couplernodecount\space 1 add inttostr (\oenode{}{}) CorrectDipoleIfc
+ } for
}%
\ifPOE at fiberpresetout@
- \drawfiber@{FiberOut}[startnode=N]{}(#3)
+ \drawfiber@{FiberOut}[startnode=N]{}(\oenodeRefB{})
\fi
\ifPOE at fiberpresetin@
\ifPOE at fiberpresetin@top
- \drawfiber@{FiberIn1}[stopnode=1](#1){}
+ \drawfiber@{FiberIn1}[stopnode=1](! [ \coupler at coors 1 \POE at dict{GetCoordinatePair} \tx at UserCoor){}
\fi
\ifPOE at fiberpresetin@bottom
- \drawfiber@{FiberIn2}[stopnode=2](#2){}
+ \drawfiber@{FiberIn2}[stopnode=\the\POE at couplernodecount](! [ \coupler at coors \the\POE at couplernodecount\space \POE at dict{GetCoordinatePair} \tx at UserCoor){}
\fi
+ \ifPOE at fiberpresetin@top\ifPOE at fiberpresetin@bottom
+ \@tempcnta=\POE at couplernodecount
+ \advance\@tempcnta by -2
+ \ifnum0<\@tempcnta
+ \multido{\i=2+1}{\the\@tempcnta}{%
+ \drawfiber@{FiberIn}[stopnode=\i](! [ \coupler at coors \i\space \POE at dict{GetCoordinatePair} \tx at UserCoor){}
+ }%
+ \fi
+ \fi\fi
\fi
\fi
\end at OptexpObj
@@ -3914,12 +3881,6 @@
\newOptexpTripole[ref at angle=45]{beamsplitter}
\newOptexpTripole{optgrating}
\newOptexpTripole[ref at angle=90]{transmissiongrating}
-\def\optgrid{%
- \PackageWarning{pst-optexp}{%
- \string\optgrid\space is deprecated,\MessageBreak
- use \string\optgrating\space instead.}%
- \optgrating%
-}%
\newOptexpTripole[ref at angle=45]{pentaprism}
\newOptexpTripole[ref at angle=45]{rightangleprism}
\newOptexpTripole[ref at angle=45]{optprism}
@@ -4714,7 +4675,7 @@
\psframe(! \@wd neg \@ht neg)(! \@wd \@ht)
\ifPOE at 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 at nodes{%
- \edef\@sep{\POE at key@couplersep\space 0.5 mul }%
- \ifx\POE at key@couplertype\POE at str@none
- \ifx\POE at key@coupleralign\POE at str@center
- \edef\@sep{0 }%
+ \newOptexpFiberComp{%
+ /@@nodecount \the\POE at couplernodecount\space dup 1 le { pop 2 } if def
+ @@y0 \POE at key@couplersep\space 0.5 mul add
+ \POE at key@couplersep\space @@nodecount 1 sub div
+ \ifx\POE at key@couplertype\POE at str@none
+ \ifx\POE at key@coupleralign\POE at str@center
+ pop pop @@y0 0
+ \fi
\fi
- \fi
- \newOptexpFiberComp{%
- {@@x neg @@y0 \@sep add}
- {@@x neg @@y0 \@sep sub}
- {@@x 0}}%
+ 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 at comp{%
@@ -5789,7 +5756,7 @@
(!/N@\oenodeOut{} \POE at dict{@GetCenter}
\tx at UserCoor \POE at key@couplersep\space sub)(\oenode{2}{})
\else
- \psline[style=Fiber](\oenode{2}{})(\oenodeOut{})
+ \psline[style=Fiber](\oenode{\the\POE at couplernodecount}{})(\oenodeOut{})
\ifx\POE at key@coupleralign\POE at str@bottom
\psline[style=Fiber]%
(!/N@\oenodeOut{} \POE at dict{@GetCenter}
@@ -5800,16 +5767,22 @@
\POE at coupler@comp
}%
\def\wdmsplitter at nodes{%
- \edef\@sep{\POE at key@couplersep\space 0.5 mul }%
- \ifx\POE at key@couplertype\POE at str@none
- \ifx\POE at key@coupleralign\POE at str@center
- \edef\@sep{0 }%
- \fi
- \fi
\newOptexpFiberComp{%
{@@x neg 0}
- {@@x @@y0 \@sep add}
- {@@x @@y0 \@sep sub}}
+ /@@nodecount \the\POE at couplernodecount\space dup 2 gt { 1 sub } if def
+ @@y0 \POE at key@couplersep\space 0.5 mul add
+ \POE at key@couplersep\space @@nodecount 1 sub div
+ \ifx\POE at key@couplertype\POE at str@none
+ \ifx\POE at key@coupleralign\POE at 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 at comp{%
More information about the tex-live-commits
mailing list.