From 3ed297e7d00115c2a2be5d8a32058869f33f0567 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Mon, 3 Mar 2014 01:31:32 +0000 Subject: pst-optexp (3Mar) git-svn-id: svn://tug.org/texlive/trunk@33077 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/latex/pst-optexp/Changes | 5 + .../doc/latex/pst-optexp/pst-optexp-DE.pdf | Bin 2860933 -> 2922986 bytes .../doc/latex/pst-optexp/pst-optexp-quickref.pdf | Bin 49600 -> 49942 bytes .../texmf-dist/doc/latex/pst-optexp/pst-optexp.pdf | Bin 2817070 -> 2880968 bytes Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro | 93 ++- Master/texmf-dist/source/latex/pst-optexp/Makefile | 75 +- .../source/latex/pst-optexp/pst-optexp.dtx | 809 +++++++++++++++++++-- .../source/latex/pst-optexp/pst-optexp.ins | 2 +- .../texmf-dist/tex/latex/pst-optexp/pst-optexp.sty | 248 ++++++- 9 files changed, 1107 insertions(+), 125 deletions(-) (limited to 'Master') diff --git a/Master/texmf-dist/doc/latex/pst-optexp/Changes b/Master/texmf-dist/doc/latex/pst-optexp/Changes index 0b568b3af96..77730c13c50 100644 --- a/Master/texmf-dist/doc/latex/pst-optexp/Changes +++ b/Master/texmf-dist/doc/latex/pst-optexp/Changes @@ -1,3 +1,8 @@ +4.8 2014-02-28 + * Added component \optaom. + * Added option beammode. + * Added option showinterfaces. + 4.7 2014-01-12 * Added syntax <\prm{num} for accessing relative component IDs. diff --git a/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-DE.pdf b/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-DE.pdf index ba8c730dda0..b530ffc7740 100644 Binary files a/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-DE.pdf and b/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-DE.pdf differ diff --git a/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-quickref.pdf b/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-quickref.pdf index 7c324af5644..ed8f7323033 100644 Binary files a/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-quickref.pdf and b/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-quickref.pdf differ diff --git a/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp.pdf b/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp.pdf index 3da878c326c..e8da0b4be3f 100644 Binary files a/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp.pdf and b/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp.pdf differ diff --git a/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro b/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro index baf32e37473..94f28126d69 100644 --- a/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro +++ b/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro @@ -9,7 +9,7 @@ %% This is a generated file. %% %% Project: pst-optexp -%% Version: 4.7 (2014/01/12) +%% Version: 4.8 (2014/02/28) %% %% Copyright (C) 2007-2014 by Christoph Bersch %% @@ -268,7 +268,7 @@ tx@OptexpDict begin exec scl ToVec 3 1 roll NodeName @NewNode } bind def /relative 0 def /absolute 1 def /center 2 def -/refl 0 def /trans 1 def /absorb 2 def /refltrans 3 def /undefined -1 def +/refl 0 def /trans 1 def /absorb 2 def /refltrans 3 def /auto 4 def /undefined -1 def /desc 0 def /asc 1 def /amb 2 def /ok 0 def /tir 1 def /missed 2 def /bgRefIndex 0 def @@ -276,11 +276,12 @@ tx@OptexpDict begin (NewOptexpComp) DebugBegin /sc ED dup cvn gsave - 12 dict dup 3 1 roll def begin + 13 dict dup 3 1 roll def begin /name ED /forcebeaminside ED /allowbeaminside ED /ambiguous ED + /grating false def dup type /booleantype eq not { false } if /correct ED tx@Dict begin STV {CP T} stopped pop @@ -376,27 +377,6 @@ tx@OptexpDict begin end DebugEnd } bind def -/GetIfcCenter { - (GetIfcCenter) DebugBegin - dup type /stringtype eq not { - dup xcheck not { - 0 get (C) exch - } { - exec pop pop pop - } ifelse - } if - cvn load begin - IfcName load begin - currentdict /RX known { - X RX sub Y RY sub - } { - X Y - } ifelse - CompMtrx transform CM itransform - end - end - DebugEnd -} bind def /GetIfcCenterCorr { (GetIfcCenterCorr) DebugBegin cvn load begin @@ -513,15 +493,61 @@ tx@OptexpDict begin trans draw ] cvx IfcCntTmp IfcCnt gt { exch } if }{ - [ (C) name - name GetRefIndex - CurrVecTmp (C) name GetPlaneVec NormalVec outToPlane - GetIfcCenter (C) name GetIfcCenter @ABVect DotProd - 0 lt { trans } { refl } ifelse + beamdiffractionorder null eq not name cvn load /grating get and { + beamdiffractionorder dup 0 eq { pop () } if + (C) exch 20 string cvs strcat + dup (P@) exch strcat cvn name cvn load exch known not { + pop beamdiffractionorder dup sign neg 1 { + (C) exch 5 string cvs dup 3 1 roll strcat + dup (P@) exch strcat cvn name cvn load exch known { + 3 -1 roll pop + (Diffraction order ) beamdiffractionorder 5 string cvs strcat + ( is not defined, using ) 4 -1 roll strcat strcat Warning + exit + } { + pop + } ifelse + } for + } if + /@@centerifc ED + mark @@centerifc name name GetRefIndex + beamdiffractionorder 0 eq { + trans + }{ + name @@centerifc GetIfcMode refltrans eq { + refltrans + }{ + refl + } ifelse + } ifelse + }{ + /@@centerifc (C) def + [ @@centerifc name + name GetRefIndex + beammode auto eq { + CurrVecTmp @@centerifc name GetPlaneVec + name @@centerifc GetIfcMode refltrans eq { -90 matrix rotate dtransform } if + NormalVec outToPlane GetIfcCenter @@centerifc name GetIfcCenter @ABVect DotProd + 0 lt { + trans + }{ + name @@centerifc GetIfcMode + refltrans eq { + refltrans + }{ + refl + } ifelse + } ifelse + } { + beammode dup refl eq { + pop name @@centerifc GetIfcMode dup refltrans eq not { pop refl } if + } if + } ifelse + } ifelse dup 6 1 roll IfcCntTmp IfcCnt eq { true }{ draw } ifelse ] cvx - (C) name 4 -1 roll + @@centerifc name 4 -1 roll connectifc { bgRefIndex }{ name GetRefIndex } ifelse CurrTmp CurrVecTmp 10 dict begin HandleInterface end pop @@ -1314,6 +1340,13 @@ tx@OptexpDict begin Xin Yin 2 costheta1 mul dup Xnorm mul exch Ynorm mul VecAdd DebugEnd } bind def +/ReflectGratVec { + (ReflectGratVec) DebugBegin + /Ynorm ED /Xnorm ED NormalizeVec /Yin ED /Xin ED + /costheta1 Xnorm Ynorm Xin neg Yin neg DotProd def + Xin Yin -2 costheta1 mul dup Xnorm mul exch Ynorm mul VecAdd + DebugEnd +} bind def /CurvedInterface { (CurvedInterface) DebugBegin 2 copy /Yr ED /Xr ED diff --git a/Master/texmf-dist/source/latex/pst-optexp/Makefile b/Master/texmf-dist/source/latex/pst-optexp/Makefile index e12b08c835d..aac418da1b4 100644 --- a/Master/texmf-dist/source/latex/pst-optexp/Makefile +++ b/Master/texmf-dist/source/latex/pst-optexp/Makefile @@ -7,53 +7,57 @@ LATEX = latex ARCHNAME = $(PACKAGE)-$(shell date +"%y%m%d") ARCHNAME_TDS = $(PACKAGE).tds -ARCHFILES = $(PACKAGE).dtx $(PACKAGE).ins Makefile \ - README Changes $(PACKAGE)-quickref.pdf \ - $(PACKAGE).pdf $(PACKAGE)-DE.pdf +ARCHFILES = Makefile README Changes \ + $(addprefix $(PACKAGE), -quickref.pdf .dtx .ins .pdf -DE.pdf) PS2PDF = GS_OPTIONS=-dPDFSETTINGS=/prepress ps2pdf -all : doc doc-DE quickref +all : doc-all Changes -doc : $(PACKAGE).pdf - -doc-DE : $(PACKAGE)-DE.pdf +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 : doc doc-DE quickref Changes +dist : $(ARCHFILES) mkdir -p pst-optexp - cp $(ARCHFILES) pst-optexp - tar chvzf $(ARCHNAME).tar.gz pst-optexp - rm -rf pst-optexp - @ echo - @ echo $(ARCHNAME).tar.gz + cp $(ARCHFILES) $(PACKAGE) $(PACKAGE).dvi: L = english $(PACKAGE)-DE.dvi: L = ngerman +$(PACKAGE)-code.dvi: L = english %.dvi: $(PACKAGE).dtx $(PACKAGE).sty $(PACKAGE).ist $(PACKAGE).pro - $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{$(PACKAGE).dtx}' - $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{$(PACKAGE).dtx}' + + 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 pst-optexp.ist -t $(basename $@)-doc.ilg \ + makeindex -s $(PACKAGE).ist -t $(basename $@)-doc.ilg \ -o $(basename $@)-doc.ind $(basename $@)-doc.idx; \ fi - $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{$(PACKAGE).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 pst-optexp.ist -t $(basename $@)-doc.ilg \ + makeindex -s $(PACKAGE).ist -t $(basename $@)-doc.ilg \ -o $(basename $@)-doc.ind $(basename $@)-doc.idx; \ fi - $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{$(PACKAGE).dtx}' + $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{tmp.dtx}' + $(RM) -f tmp.dtx %.ps: %.dvi dvips $< @@ -66,7 +70,7 @@ $(PACKAGE)-quickref.tex: $(PACKAGE)-quickref.py $(PACKAGE).dtx $(PACKAGE)-quickref.pdf: $(PACKAGE)-quickref.tex pdflatex $< -$(PACKAGE).sty $(PACKAGE).pro $(PACKAGE).tex $(PACKAGE).ist: $(PACKAGE).ins $(PACKAGE).dtx +$(PACKAGE).sty $(PACKAGE).pro $(PACKAGE).ist: $(PACKAGE).ins $(PACKAGE).dtx tex $< Changes: Changes.py $(PACKAGE).dtx @@ -75,32 +79,33 @@ Changes: Changes.py $(PACKAGE).dtx arch : Changes zip $(ARCHNAME).zip $(ARCHFILES) -arch-tds : Changes +arch-tds : dist $(RM) $(ARCHNAME_TDS).zip - mkdir -p tds/tex/latex/pst-optexp - mkdir -p tds/doc/latex/pst-optexp - mkdir -p tds/source/latex/pst-optexp - mkdir -p tds/dvips/pst-optexp - cp pst-optexp.sty tds/tex/latex/pst-optexp/ - cp pst-optexp.pro tds/dvips/pst-optexp/ - cp Changes pst-optexp.pdf pst-optexp-DE.pdf \ - README pst-optexp-quickref.pdf \ - tds/doc/latex/pst-optexp/ - cp pst-optexp.dtx pst-optexp.ins Makefile \ - tds/source/latex/pst-optexp/ + mkdir -p tds/tex/latex/$(PACKAGE) + mkdir -p tds/doc/latex/$(PACKAGE) + mkdir -p tds/source/latex/$(PACKAGE) + mkdir -p tds/dvips/$(PACKAGE) + cp $(PACKAGE).sty tds/tex/latex/$(PACKAGE)/ + cp $(PACKAGE).pro tds/dvips/$(PACKAGE)/ + cp Changes $(PACKAGE).pdf $(PACKAGE)-DE.pdf \ + README $(PACKAGE)-quickref.pdf \ + tds/doc/latex/$(PACKAGE)/ + cp $(PACKAGE).dtx $(PACKAGE).ins Makefile \ + tds/source/latex/$(PACKAGE)/ cd tds ; zip -r ../$(ARCHNAME_TDS).zip tex doc source dvips cd .. rm -rf tds ctan : dist arch-tds - tar cf $(PACKAGE).tar $(ARCHNAME_TDS).zip $(ARCHNAME).tar.gz + zip -r $(PACKAGE).zip $(ARCHNAME_TDS).zip $(PACKAGE) + $(RM) -rf $(PACKAGE)/ clean : - $(RM) $(foreach prefix, $(PACKAGE) $(PACKAGE)-DE $(PACKAGE)-quickref, \ + $(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 -quickref.pdf .sty .pro .ist) Changes + $(RM) $(addprefix $(PACKAGE), .pdf -DE.pdf -code.pdf -quickref.pdf .sty .pro .ist) Changes diff --git a/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.dtx b/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.dtx index acc893eae3c..43723b2c978 100644 --- a/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.dtx +++ b/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.dtx @@ -18,7 +18,7 @@ %\NeedsTeXFormat{LaTeX2e}[1999/12/01] %\ProvidesPackage{pst-optexp} %<*stylefile> - [2014/01/12 v4.7 Optical experimental setups with PSTricks] + [2014/02/28 v4.8 Optical experimental setups with PSTricks] % % %<*driver> @@ -110,7 +110,7 @@ oenodeIfc, oeBeamVec, oeBeamVecUp, oeBeamVecLow, oeBeamVecMedian, oeBeamCenter, optplate, optretplate, pinhole, crystal, optdetector, optdiode, doveprism, glanthompson, polarization, mirror, - beamsplitter, optgrating, optprism, rightangleprism, pentaprism, + beamsplitter, optgrating, optprism, rightangleprism, pentaprism, optaom, optdipole, opttripole, optfiber, optamp, optmzm, optfilter, polcontrol, optisolator, optswitch, fiberdelayline, optfiberpolarizer, fibercollimator, optcoupler, wdmcoupler, @@ -4047,7 +4047,8 @@ % \ifENGLISH % The transmission grating supports all options of % \Lcomp{optgrating}. The beam path is calculated such, that the beam is -% reflected at an interface which is perpendicular to the drawn grating. This virtual interface is shown in the following example: +% reflected at an interface which is perpendicular to the drawn +% grating. This virtual interface is shown in the following example: % \fi % % \hspace*{\fill}% @@ -4123,6 +4124,318 @@ % % \fi % +% \ifGERMAN\section{Akustooptischer Modulator}\fi +% \ifENGLISH\section{Acousto-optic modulator}\fi +% +% \begin{ltxsyntax} +% \xLtripole{optaom}\compitem{optaom}[options](in)(trans)(diff){label} +% \end{ltxsyntax} +% \iffalse +%<*ignore> +% \fi +\begin{LTXexample}[linerange={1-3,7-7}] +\begin{pspicture}(3,2) + \pnodes(0,1.5){A}(3,0.5){B}(3,1.5){C} + \optaom[beam](A)(B)(C){AOM} + \psdots(A)(B)(C) + \color{Refline} + \uput[-90](A){A}\uput[-90](B){B}\uput[-90](C){C} +\end{pspicture} +\end{LTXexample} +% \iffalse +% +% \fi +% +% \ifGERMAN +% Dieses Makro stellt einen akustooptischen Modulator dar. Dieser kann, +% ähnlich einem \Lcomp{beamsplitter} entweder transmittierend oder +% reflektierend sein. Beachten Sie, dass die Knoten nicht so angeordnet +% sind, wie bei den üblichen Tripolen wie z. B. dem +% \Lcomp{optgrating}. Der mittlere Knoten gibt die Richtung eines +% transmittierten, und der dritte Knoten die Richtung der ersten +% Beugungsordnung an. +% +% Diese erste Umsetzung des AOM in Version 4.8 ist +% noch etwas experimentell, da ich nicht genügend Testfälle hatte um +% alle Eventualitäten zu prüfen. Es könnten sich also noch Änderungen +% ergeben, die nicht abwärts kompatibel sind. +% \fi +% \ifENGLISH +% This macro draw an acousto-optic modulator, which either be +% transmittive or reflective, like a \Lcomp{beamsplitter}. Please note, +% that the nodes do not correspond to those of a usual tripole like an +% \Lcomp{optgrating}. The second node is in the direction of the +% transmitted beam, the third node gives the direction of the first +% diffraction order. +% +% This first implementation in version 4.8 is still experimental, +% because I didn't have enough test cases to check all possible +% cases. Therefore, future versions may have changes, which are not +% backwards compatible. +% \fi +% +% \begin{optionlist} +% \numitem[1]{aomheight} +% \ifGERMAN Die Höhe des Modulators.\fi +% \ifENGLISH The height of the modulator.\fi +% +% \numitem[1.5]{aomwidth} +% \ifGERMAN Die Breite des Modulators.\fi +% \ifENGLISH The width of the modulator.\fi +% +% \optitem{aomsize}{\prm{width} \prm{height}} +% \ifGERMAN Die Breite und Höhe des Modulators, äquivalent zum Aufruf von +% \Lkeyword{aomwidth} und \Lkeyword{aomheight}. +% \fi +% \ifENGLISH The width and height of the modulator, is equivalent to calling both +% \Lkeyword{aomwidth} and \Lkeyword{aomheight}. +% \fi +% +% \intitem[9]{aomgratingcount} +% \ifGERMAN +% Gibt die Anzahl der Gitterlinien an. Werden weitere Änderungen des +% Gitters oder des Modulators allgemein gewünscht, dann muss der Parameter +% \Lkeyword{aomcomp} verwendet werden. +% \fi +% \ifENGLISH +% Changes the number of grating lines. For other changes of the grating +% you must use the \Lkeyword{aomcomp} parameter to redefine the whole grating. +% \fi +% +% \choitem[symmetric]{aomalign}{symmetric, straight} +% \ifGERMAN +% Die Ausrichtung eines \Lcomp{optaom} bezüglich der drei Referenzknoten +% kann mit diesem Parameter eingestellt werden. Die symmetrische +% (\opt{symmetric}) Ausrichtung ist im folgenden Beispiel zu sehen: +% \fi +% \ifENGLISH +% The alignment of an \Lcomp{optaom} with respect to the three reference +% nodes can be set with this option. The \opt{symmetric} alignment is +% shown in the following example: +% \fi +% +% \iffalse +%<*ignore> +% \fi +\begin{LTXexample}[linerange={1-6,11-11}] +\begin{pspicture}(3,2) + \pnodes(0,1.5){A}(3,0.5){B}(3,1.5){C} + \optaom[aomalign=symmetric](A)(B)(C){symmetric} + \addtopsstyle{Beam}{fillstyle=solid, linestyle=none, beamwidth=0.1} + \drawwidebeam[fillcolor=red!50](A){}(C) + \drawwidebeam[fillcolor=red](A){}(B) + \color{Refline} + \psdot(A)\uput[-90](A){A} + \psdot(B)\uput[-90](B){B} + \psdot(C)\uput[90](C){C} +\end{pspicture} +\end{LTXexample} +% \iffalse +% +% \fi +% +% \ifGERMAN +% In der geraden (\opt{straight}) Ausrichtung sieht der Strahlengang wie +% folgt aus: +% \fi +% \ifENGLISH +% For \opt{straight} alignment the sketch looks like +% \fi +% +% \iffalse +%<*ignore> +% \fi +\begin{LTXexample}[linerange={1-6,11-11}] +\begin{pspicture}(3,2) + \pnodes(0,1){A}(3,1){B}(3,1.5){C} + \optaom[aomalign=straight](A)(B)(C){straight} + \addtopsstyle{Beam}{fillstyle=solid, linestyle=none, beamwidth=0.1} + \drawwidebeam[fillcolor=red!50](A){}(C) + \drawwidebeam[fillcolor=red](A){}(B) + \color{Refline} + \psdot(A)\uput[-90](A){A} + \psdot(B)\uput[-90](B){B} + \psdot(C)\uput[90](C){C} +\end{pspicture} +\end{LTXexample} +% \iffalse +% +% \fi +% +% \choitem[parallel]{aomreflalign}{perp, parallel} +% \ifGERMAN +% Die Ausrichtung der reflektiven Grenzfläche kann entweder +% \opt{parallel} oder senkrecht (\opt{perp}) zur Komponente +% liegen. Diese Option ist lediglich aus technischer Sicht notwendig, +% die Richtung des reflektierten Strahls wird dadurch nicht +% verändert. +% \fi +% \ifENGLISH +% The reflective interface can be oriented either \opt{parallel} or +% \opt{perp}endicular to the component. This option was necessary in +% first place for technical reasons, the direction of the reflected ray +% is not affected by this option. +% \fi +% +% \iffalse +%<*ignore> +% \fi +\begin{LTXexample}[linerange={1-5,10-10}] +\begin{pspicture}(3,2) + \pnodes(0,1.5){A}(3,0.5){B}(3,1.5){C} + \optaom[aomreflalign=parallel](A)(B)(C){parallel} + \addtopsstyle{Beam}{fillstyle=solid, linestyle=none, beamwidth=0.2} + \drawwidebeam[fillcolor=red!50](A){}(C) + \color{Refline} + \psdot(A)\uput[-90](A){A} + \psdot(B)\uput[-90](B){B} + \psdot(C)\uput[90](C){C} +\end{pspicture} +\end{LTXexample} + +\begin{LTXexample}[linerange={1-5,10-10}] +\begin{pspicture}(3,2) + \pnodes(0,1.5){A}(3,0.5){B}(3,1.5){C} + \optaom[aomreflalign=perp](A)(B)(C){perp} + \addtopsstyle{Beam}{fillstyle=solid, linestyle=none, beamwidth=0.2} + \drawwidebeam[fillcolor=red!50](A){}(C) + \color{Refline} + \psdot(A)\uput[-90](A){A} + \psdot(B)\uput[-90](B){B} + \psdot(C)\uput[90](C){C} +\end{pspicture} +\end{LTXexample} +% \iffalse +% +% \fi +% +% \ifGERMAN +% Das folgende Beispiel zeigt einen Fall, der mit +% \Lkeyword{aomreflalign}\opt{=parallel} nicht funktioniert, da der +% Einfallswinkel so flach ist, dass die Schnittpunkte mit der +% reflektierenden Grenzfläche außerhalb der Komponente liegen: +% \fi +% \ifENGLISH +% The following example show a use case, which doesn't work properly +% with \Lkeyword{aomreflalign}\opt{=parallel}, because the incident +% angle is so shallow, that the intersection points with the interface +% lay outside of the component. +% \fi +% \iffalse +%<*ignore> +% \fi +\begin{LTXexample} +\begin{pspicture}(3,1.5) + \pnodes(0,1.1){A}(3,0.8){B}(3,1.1){C} + \optaom[aomreflalign=parallel](A)(B)(C){parallel} + \addtopsstyle{Beam}{fillstyle=solid, linestyle=none, beamwidth=0.2} + \drawwidebeam[fillcolor=red!50](A){}(C) +\end{pspicture} +\end{LTXexample} +% \iffalse +% +% \fi +% +% \choitem[default]{aomcomp}{default, \prm{macro}} +% \ifGERMAN Tauscht die Gitterlinien durch eine beliebige Zeichung aus.\fi +% \ifENGLISH Changes the grating lines to an arbitrary drawing.\fi +% +% \intitem[2]{diffractionorders} +% \ifGERMAN +% Die Anzahl der Beugungsordnungen (positive und negative), die mit +% \Lkeyword{beamdiffractionorder} ausgewählt werden können, also +% $-$\prm{num},$-$\prm{num}$+1$,\ldots ,\prm{num}. +% +% Gleichzeitig werden entsprechende Knoten +% \lstinline!\oenode{DO-1}{}!, \lstinline!\oenode{DO0}{}!, +% \lstinline!\oenode{DO1}{}! usw. definiert. +% \fi +% \ifENGLISH +% The number or diffraction orders (positive and negative) which can be +% selected with \Lkeyword{beamdiffractionorder}, +% i.e. $-$\prm{num},$-$\prm{num}$+1$,\ldots ,\prm{num}. +% +% At the same time the nodes \lstinline!\oenode{DO-1}{}!, +% \lstinline!\oenode{DO0}{}!, \lstinline!\oenode{DO1}{}! +% etc. are defined. +% \fi +% +% \iffalse +%<*ignore> +% \fi +\begin{LTXexample} +\begin{pspicture}(0,0.6)(4.3,3.6) + \pnodes(0,2.5){A}(4,2){B}(4,2.5){C} + \optaom[aomsize=1 2, aomreflalign=perp, diffractionorders=3](A)(B)(C) + \addtopsstyle{Beam}{beamwidth=0.2, linestyle=none, fillstyle=solid} + \drawwidebeam[fillcolor=red!40](A){}(C) + \drawwidebeam[fillcolor=red](A){}(B) + \multido{\i=-3+1}{7}{% + \psdot(\oenode{DO\i}{})\uput[0](\oenode{DO\i}{}){\i}}% +\end{pspicture}% +\end{LTXexample} +% \iffalse +% +% \fi +% +% \intitem[\{\}]{beamdiffractionorder} +% \ifGERMAN +% Die Beugungsordnung, die für einen reflektierten Strahl durch den AOM +% verwendet wird. Wenn der Wert leer ist, \opt{\{\}} dann wird die +% Option ignoriert. +% +% Mit Verwendung dieser Option wird unmittelbar das Verhalten der +% Grenzfläche festgelegt, hängt also nicht von der relativen Position +% von AOM und der folgenden Komponente ab. Für +% \Lkeyword{beamdiffractionorder}$\neq 0$ wird der Strahl reflektiert, +% für den Wert $0$ hingegen transmittiert. Der Parameter +% \Lkeyword{beammode} wird dann ignoriert. +% +% Es können nur die Beugungsordnungen verwendet werden, die für die +% entsprechende Komponente mit \Lkeyword{diffractionorders} definiert +% wurden. Wird eine nicht-definierte Ordnung verwendet, dann wird die +% nächstliegende verwendet und eine Postscript-Warnung (siehe +% \Lkeyword{pswarning}) ausgegeben. +% \fi +% \ifENGLISH +% The diffraction order, which is used for a reflected beam going +% through the aom. The option is ignored if its value is empty +% \opt{\{\}}. +% +% By using this option you automatically select the behaviour of the +% interface, which then doesn't depend on the relative position of AOM +% and the following component. For \Lkeyword{beamdiffractionorder}$\neq +% 0$ a beam gets reflected, for the value $0$ it gets transmitted. The +% parameter \Lkeyword{beammode} is ignored. +% +% You can select only those orders, where have been defined for the +% respective component with \Lkeyword{diffractionorders}. If an +% undefined order is selected, the closest one is choosen instead and a +% Postscript warning is issued (see \Lkeyword{pswarning}). +% \fi +% +% \iffalse +%<*ignore> +% \fi +\begin{LTXexample}[pos=t, linerange={1-7,12-12}] +\begin{pspicture}(0,-0.2)(4.4,3.8) + \pnodes(0,2.5){A}(4,2){B}(4,2.5){C} + \optaom[aomsize=1 2, aomreflalign=perp, diffractionorders=3](A)(B)(C) + \optplane(B) + \addtopsstyle{Beam}{beamwidth=0.2, linestyle=none, fillstyle=solid} + \multido{\i=-3+1,\r=10+15}{7}{% + \drawwidebeam[fillcolor=red!\r, beamdiffractionorder=\i](A){-}} + \color{Refline} + \uput[90](A){A}\psdot(A) + \uput[0](B){B}\psdot(B) + \uput[0](C){C}\psdot(C) +\end{pspicture}% +\end{LTXexample} +% \iffalse +% +% \fi +% \end{optionlist} +% % \ifGERMAN\section{Prisma}\fi % \ifENGLISH\section{Prism}\fi % @@ -8027,6 +8340,11 @@ % \Lkeyword{beaminsidefirst} oder \Lkeyword{startinside} auf \opt{true} % gesetzt sind. % \fi +% \ifENGLISH +% Number of segments, which are used inside the first component. This +% option is in effect only with \Lkeyword{beaminsidefirst} or +% \Lkeyword{startinside} set to \opt{true}. +% \fi % % \numitem[-1]{stopinsidecount} % \ifGERMAN @@ -8035,10 +8353,16 @@ % \Lkeyword{beaminsidelast} oder \Lkeyword{stopinside} auf \opt{true} % gesetzt sind. % \fi +% \ifENGLISH +% Number of segments, which are used inside the last component. This +% option is in effect only with \Lkeyword{beamsinsidelast} or +% \Lkeyword{stopinside} set to \opt{true}. +% \fi +% % \iffalse %<*ignore> % \fi -\begin{LTXexample}[morekeywords = {[21]{stopinsidecount, startinsidecout}}] +\begin{LTXexample}[morekeywords = {[21]{stopinsidecount, startinsidecount}}] \begin{pspicture}(4,2) \pnodes(0,2){A}(2,0.8){B}(4,2){C} \optprism[compname=P, prismtype=reflective, prismangle=90](A)(B)(C) @@ -8052,6 +8376,20 @@ % \iffalse % % \fi +% +% \choitem[auto]{beammode}{refl, trans, reflective, transmittive, auto} +% \ifGERMAN +% Mit dieser Option kann das Strahlverhalten bei Komponenten wie +% z. B. dem \Lcomp{beamsplitter} auf reflektierend oder transmittierend +% festgelegt werden, unabhängig von den verwendeten Knoten und deren +% relative Position bezüglich der Komponente. +% \fi +% \ifENGLISH +% With this option one can force the beam path through e.g. a +% \Lcomp{beamsplitter} to \opt{reflective} or \opt{transmittive} +% independent of the choosen nodes and their position relative to the +% component. +% \fi % \end{optionlist} % % \ifENGLISH\subsection{Connecting with nodes}\fi @@ -10449,7 +10787,7 @@ % \fi % \ifENGLISH % This option defines the drawing of a component, and can be used to -% define a new component based in \Lcomp{optdiple} with +% define a new component based in \Lcomp{optdipole} with % \Lcs*{newpsobject}. % \fi % @@ -10479,7 +10817,7 @@ % \fi % \ifENGLISH % This option defines the drawing of a component, and can be used to -% define a new component based in \Lcomp{opttriple} with +% define a new component based in \Lcomp{opttripole} with % \Lcs*{newpsobject}. % \fi % @@ -10890,6 +11228,37 @@ % \fi % % \ifGERMAN +% \subsection{Beispiele für benutzerdefinierte Komponenten} +% \fi +% \ifENGLISH +% \subsection{Examples of custom components} +% \fi +% +% \iffalse +%<*ignore> +% \fi +\begin{LTXexample} +\begin{pspicture}(6,4) + \newOptexpTripole{raindrop} + \makeatletter + \def\raindrop@nodes{% + \newOptexpComp{% + {0 -2} { 0 2 } -2 2 trans {CurvedIfc} + {0 2} {0 -2} -2 2 refl {CurvedIfc} + {0 -2} { 0 2 } -2 2 trans {CurvedIfc} + \POE@key@n }}% + \def\raindrop@comp{\pscircle(0,0){2}}% + \raindrop(0,4)(4,2)(0,0) + \psset{beamalign=abs, arrows=->, arrowscale=2} + \drawbeam[linecolor=red](0,3){}(0,1) + \drawbeam[n=*n*1.05, linecolor=blue](0,3){}(0,1) +\end{pspicture} +\end{LTXexample} +% \iffalse +% +% \fi +% +% \ifGERMAN % \chapter{Beispiele} % \fi % \ifENGLISH @@ -12041,6 +12410,11 @@ % % \fi % +% \begin{optionlist} +% \boolitem[false]{showinterfaces} +% \styleitem[linestyle=dashed, dash=1pt 1pt, linecolor=red!70!black]{IfcStyle} +% \end{optionlist} +% % \ifENGLISH\section{Overview of special nodes}\fi % \ifGERMAN\section{Übersicht der Spezialknoten}\fi % @@ -12973,7 +13347,12 @@ % \prettyref{sec:bwd-comp}. \fi % % \begin{changelog} -%\patchcmd{\release}{\setlength{\itemsep}{0pt}}{\setlength{\itemsep}{0pt}\setlength{\parsep}{0pt}}{}{} +% \patchcmd{\release}{\setlength{\itemsep}{0pt}}{\setlength{\itemsep}{0pt}\setlength{\parsep}{0pt}}{}{} +% \begin{release}{4.8}{2014-02-28} +% \item Added component \cs{optaom}\see{comp:optaom} +% \item Added option \opt{beammode}\see{prm:beammode} +% \item Added option \opt{showinterfaces}\see{prm:showinterfaces} +% \end{release} % \begin{release}{4.7}{2014-01-12} % \item Added syntax \opt{<}\prm{num} for accessing relative component % IDs\see{sec:namingobj} @@ -13348,6 +13727,7 @@ \newif\ifPOE@component@optional \newif\ifPOE@debug@showoptdots \newif\ifPOE@debug@showifcnodes +\newif\ifPOE@debug@showinterfaces \newif\ifPOE@endbox \newif\ifPOE@startbox \newif\ifPOE@thicklens @@ -13483,6 +13863,7 @@ } \newpsstyle{OptionalStyle}{linestyle=dashed,dash=1.5pt 1pt}% \newpsstyle{IfcNodeStyle}{dotstyle=x, dotscale=1.5, linecolor=blue}% +\newpsstyle{IfcStyle}{linestyle=dashed, dash=1pt 1pt, linecolor=red!70!black}% \newpsstyle{Beam}{linecolor=green!90!black, linejoin=1}% \define@key[psset]{optexp}{newBeam}{% \newpsstyle{Beam}{#1}% @@ -13633,6 +14014,7 @@ \define@boolkey[psset]{optexp}[POE@]{usewirestyle}[true]{} \define@boolkey[psset]{optexp}[POE@debug@]{showoptdots}[true]{} \define@boolkey[psset]{optexp}[POE@debug@]{showifcnodes}[true]{} +\define@boolkey[psset]{optexp}[POE@debug@]{showinterfaces}[true]{} % \end{macrocode} % The positioning parameters. % \begin{macrocode} @@ -14490,6 +14872,63 @@ optdipolecomp=, opttripolecomp=% }% +% \end{macrocode} +% +% acousto-optic modulator +% \begin{macrocode} +\define@key[psset]{optexp}{aomwidth}{% + \pst@checknum{#1}\POE@key@aomwidth +}% +\define@key[psset]{optexp}{aomheight}{% + \pst@checknum{#1}\POE@key@aomheight +}% +\define@key[psset]{optexp}{aomsize}{% + \pst@expandafter\POE@psset@@aomsize{#1} {} {} {}\@nil +}% +\define@key[psset]{optexp}{aomgratingcount}{% + \edef\POE@key@aomgratingcount{#1}% +}% +\define@choicekey+[psset]{optexp}{aomalign}% + [\val\nr]{sym,symmetric,straight}% + {% + \ifcase\nr\relax + \let\POE@key@aomalign\POE@str@symmetric + \else + \def\POE@key@aomalign{#1}% + \fi + }% + {\PackageError{pst-optexp}{Unknown value '\val' for aomalign}}% +\define@choicekey+[psset]{optexp}{aomreflalign}% + [\val\nr]{perp,parallel}% + {\def\POE@key@aomreflalign{#1}}% + {\PackageError{pst-optexp}{Unknown value '\val' for aomreflalign}}% +\def\POE@psset@@aomsize#1 #2 #3\@nil{% + \ifx\\#2\\% + \PackageWarning{pst-optexp}{% + Parameter 'aomsize' requires two numbers.}% + \fi + \psset[optexp]{aomwidth=#1, aomheight=#2}% +}% +\define@key[psset]{optexp}{aomcomp}{% + \def\POE@key@aomcomp{#1}% +}% +\define@key[psset]{optexp}{diffractionorders}{% + \def\POE@key@diffractionorders{#1}% +}% +\define@key[psset]{optexp}{beamdiffractionorder}{% + \def\POE@key@beamdiffractionorder{#1}% +}% +\psset[optexp]{% + aomsize=1.5 1, + aomcomp=default, + aomalign=sym, + aomreflalign=parallel, + aomgratingcount=9, + diffractionorders=2, + beamdiffractionorder= +}% +% \end{macrocode} +% % \subsection{Parameters of fiber-optical components} % \subsubsection{fiber} % \begin{macrocode} @@ -14919,6 +15358,17 @@ \define@key[psset]{optexp}{beamwidth}{% \edef\POE@key@beamwidth{#1}% }% +\define@choicekey+[psset]{optexp}{beammode}% + [\val\nr]{trans,refl,reflective,transmittive,auto}% + {\ifcase\nr\relax + \let\POE@key@beammode\POE@str@transmittive + \or + \let\POE@key@beammode\POE@str@reflective + \else + \def\POE@key@beammode{#1}% + \fi}% + {\PackageError{pst-optexp}{Unknown value '\val' for beammode}} + \define@boolkey[psset]{optexp}[POE@]{startinside}[true]{}% \define@boolkey[psset]{optexp}[POE@]{stopinside}[true]{}% \define@key[psset]{optexp}{startinsidecount}{% @@ -15076,6 +15526,7 @@ ,beamalign=relative ,beamwidth=0 ,beamdiv=0 + ,beammode=auto ,n=1.5 ,beampathskip=0 ,beampathcount=-1 @@ -15796,6 +16247,18 @@ \POE@key@beampathcount\space dup -1 gt { beampathskip add } if /beampathcount ED /useNA \ifPOE@useNA true \else false \fi def /aligntovector \ifx\POE@key@beamnodealign\POE@str@vector true \else false \fi def + /beamdiffractionorder + \ifx\POE@key@beamdiffractionorder\@empty null + \else\POE@key@beamdiffractionorder\space + \fi def + /beammode + \ifx\POE@key@beammode\POE@str@reflective + refl + \else\ifx\POE@key@beammode\POE@str@transmittive + trans + \else + auto + \fi\fi def }% \let\tx@Line\POE@tx@Line }% @@ -17201,6 +17664,39 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\optaom} +% \begin{macrocode} +\def\optaom{\pst@object{optaom}}% +\def\optaom@i(#1)(#2)(#3){% + \@ifnextchar\bgroup + {\optaom@ii(#1)(#2)(#3)}% + {\optaom@ii(#1)(#2)(#3){}}% +}% +\def\optaom@ii(#1)(#2)(#3)#4{% + \addafter@par{ref@angle=180}% + \begin@OptexpTripole + \ifPOE@backlayer + \ifx\POE@key@abspos\@empty + \ifx\POE@key@position\@empty + \psLNode(#1)(#2){0.5}{\oenode{Tmp}{}} + \else + \psLNode(#1)(#2){\POE@key@position}{\oenode{Tmp}{}} + \fi + \else + \psLDNode(#1)(#2){\POE@key@abspos}{\oenode{Tmp}{}} + \fi + \POE@calcNodes{#1}{\oenode{Tmp}{}}{#3}% + \POE@regNodes{#1}{#3} + \fi + \POE@drawcomponent{optaom}{#4} + \ifPOE@backlayer + \POE@InternalConn + \fi + \end@OptexpTripole +\ignorespaces}% +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\optcoupler} % \begin{macrocode} \def\optcoupler{\pst@object{optcoupler}}% @@ -17615,6 +18111,27 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\POE@saveDiffractionNodes} +% \begin{macrocode} +\def\POE@saveDiffractionNodes{% + \POE@Verb{% + gsave + STV CP T + /N@\oenodeRefA{} @GetCenter + /N@\oenode@Origin{} @GetCenter @ABVect exch atan /myangle ED + /N@\oenode@Origin{} @GetCenter + /N@\oenodeRefB{} @GetCenter @ABDist /mydist ED + grestore + }% + \pnode(! \POE@dict{mydist myangle 180 sub} PtoC \tx@UserCoor){\oenode{DO0}{}}% + \multido{\i=1+1}{\POE@key@diffractionorders}{% + \pnode(! \POE@dict{mydist myangle 180 sub 180 OEangle sub \i\space mul } add PtoC \tx@UserCoor){\oenode{DO\i}{}}% + \pnode(! \POE@dict{mydist myangle 180 sub 180 OEangle sub \i\space mul } sub PtoC \tx@UserCoor){\oenode{DO-\i}{}}% + }% +\ignorespaces}% +% \end{macrocode} +% \end{macro} +% % \begin{macro}{\POE@regNodes} % If a macro needs only two points, they are equivalent to % 'tempNode@A' and 'tempNode@B'. But for easier implementation of other @@ -18143,6 +18660,11 @@ dotscale=1.5](\oenodeTrefB{}) \fi \fi + \ifPOE@debug@showinterfaces + \ifPOE@frontlayer + \POE@drawinterfaces[style=IfcStyle] + \fi + \fi \ifPOE@debug@showifcnodes \ifPOE@frontlayer \POE@ifcnodes[style=IfcNodeStyle] @@ -18195,6 +18717,38 @@ % \end{macrocode} % \end{macro} % +% \begin{macro}{\POE@drawinterfaces} +% \begin{macrocode} +\def\POE@drawinterfaces{\pst@object{POE@drawinterfaces}} +\def\POE@drawinterfaces@i{% + \begin@OpenObj% + \addto@pscode{% + \psk@dotsize + \@nameuse{psds@\psk@dotstyle} + \pst@optexpdict + /\oenode{}{} load begin + 1 1 N { + IfcName load begin + X Y + CompMtrx transform CM itransform 2 copy + currentdict /RX known { 0 0 }{ DX DY } ifelse + CompMtrx dtransform CM idtransform 2 copy + NAlow 0 eq NAup 0 eq and { + -0.5 VecScale 4 2 roll 0.5 VecScale + } { + \tx@UserCoor NAlow VecScale 4 2 roll \tx@UserCoor NAup VecScale + } ifelse + end + 8 -2 roll VecAdd moveto VecAdd lineto + } for + end end }% + \pst@stroke + \use@pscode + \end@OpenObj +}% +% \end{macrocode} +% \end{macro} +% % \begin{macro}{POE@extnodes} % \begin{macrocode} \def\POE@extnodes{\pst@object{POE@extnodes}} @@ -19385,6 +19939,119 @@ \ignorespaces}% % \end{macrocode} % \end{macro} +% +% \subsubsection{optaom} +% +% \begin{macro}{\optaom@ref} +% \begin{macrocode} +\def\optaom@ref{% + \POE@setref{/@@x \POE@key@aomwidth\space 0.5 mul def }% + \POE@setref{/@@y \POE@key@aomheight\space 0.5 mul def }% + \POE@calcAngle + \ifx\POE@key@aomalign\POE@str@symmetric\else + \edef\POE@key@angle{\POE@key@angle\space 180 \POE@dict{OEangle} sub 0.5 mul sub }% + \fi + \edef\POE@key@angle{\POE@key@angle\space 180 add }% +}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\optaom@nodes} +% \begin{macrocode} +\def\optaom@nodes{% + \ifodd + \ifx\POE@key@aomalign\POE@str@symmetric + \ifx\POE@key@aomreflalign\POE@str@parallel 1\else 0\fi + \else 0\fi +% \end{macrocode} +% +% A 'parallel' reflection interface is possible only, if the aomalign is +% symmetric, because otherwise it is probable, that the incoming beam is +% parallel to that interface. +% \begin{macrocode} + \newOptexpCompAmb{% + {@@x neg 0} {0 1} @@y neg @@y + trans {PlainIfc} + {0 0} + \ifx\POE@key@aomalign\POE@str@symmetric + {1 0} + \else + {1 0 180 OEangle sub 0.5 mul matrix rotate dtransform} + \fi + 0 0 trans {PlainIfc} + {@@x @@y} {0 1} @@y -2 mul 0 + trans {PlainIfc} + {@@x @@y neg} {0 1} 0 @@y 2 mul + trans {PlainIfc} + 2 1 + }% + \else + \newOptexpCompAmb{% + {@@x neg 0} {0 1} @@y neg @@y trans {PlainIfc} + {0 0} + \ifx\POE@key@aomalign\POE@str@symmetric + {0 1} + \else + {0 1 180 OEangle sub 0.5 mul matrix rotate dtransform} + \fi + 0 0 refltrans {PlainIfc} + {@@x @@y} {0 1} @@y -2 mul 0 + trans {PlainIfc} + {@@x @@y neg} {0 1} 0 @@y 2 mul + trans {PlainIfc} + 2 1 + }% + \fi + \POE@Verb{% + gsave + tx@Dict begin + STV {CP T} stopped pop + end + (C) (\oenode{}{}) GetPlaneVec 2 copy + /N@\oenodeRefA{} @GetCenter + /N@\oenodeCenter{} @GetCenter + @ABVect 90 matrix rotate dtransform + NormalVec ReflectVec ToVec dup + \oenode{}{} begin + {0 0} exch 0 0 refltrans name (C-1) {PlainIfc} {sc} NewCompIfc + (C) (C1) IfcAlias + 2 1 \POE@key@diffractionorders\space {% vec i + 2 copy neg dup 5 string cvs (C) exch strcat % vec i vec -i (C-i) + 3 -1 roll exec 4 -1 roll % vec i (C-i) X Y -i + 1 add 180 OEangle sub 0.5 mul mul + matrix rotate dtransform ToVec % vec i (C-i) {X' Y'} + {0 0} exch 0 0 refltrans name 7 -1 roll {PlainIfc} {sc} NewCompIfc + 2 copy 3 -1 roll 5 string cvs (C) exch strcat % vec i vec i (C-i) + 3 -1 roll exec 4 -1 roll % vec i (Ci) X Y i + 1 add 180 OEangle sub 0.5 mul mul + matrix rotate dtransform ToVec % vec i (Ci) {X' Y'} + {0 0} exch 0 0 refltrans name 7 -1 roll {PlainIfc} {sc} NewCompIfc + } for pop + /grating true def + end + grestore + }% + \POE@saveDiffractionNodes +\ignorespaces}% +% \end{macrocode} +% \end{macro} +% +% \begin{macro}{\optaom@comp} +% \begin{macrocode} +\def\optaom@comp{% + \POE@comp@rectangle + \ifx\POE@key@aomcomp\POE@str@default + \multido{\i=0+1}{\POE@key@aomgratingcount}{% + \psrline(!\POE@dict{@@x -0.7 mul \POE@key@aomgratingcount\space 2 div dup 1.5 add + @@y exch div exch 0.5 sub \i\space sub mul})% + (!\POE@dict{@@x 1.4 mul 0})% + }% + \else + \POE@key@aomcomp + \fi +\ignorespaces}% +% \end{macrocode} +% \end{macro} % % \subsection{Fiber components} % @@ -20974,7 +21641,7 @@ tx@OptexpDict begin % Define some constants. % \begin{macrocode} /relative 0 def /absolute 1 def /center 2 def -/refl 0 def /trans 1 def /absorb 2 def /refltrans 3 def /undefined -1 def +/refl 0 def /trans 1 def /absorb 2 def /refltrans 3 def /auto 4 def /undefined -1 def /desc 0 def /asc 1 def /amb 2 def /ok 0 def /tir 1 def /missed 2 def /bgRefIndex 0 def @@ -21007,8 +21674,7 @@ tx@OptexpDict begin % from \TeX{} to Postscript scaling. In should always be defined as % \PSproc{\textbackslash psxunit, \textbackslash psyunit}. % -% \psargitem{\PSvar{ambiguous}} There is a class of components (at the -% moment only \nxLcs{beamsplitter}), which have a central interface +% \psargitem{\PSvar{ambiguous}} There is a class of components, which have a central interface % \PSvar{P@C} which can be either transmittive or reflective, % depending on the previous and following component positions. The % mode of the \PSvar{P@C} is determined at the time of the beam @@ -21030,11 +21696,12 @@ tx@OptexpDict begin (NewOptexpComp) DebugBegin /sc ED dup cvn gsave - 12 dict dup 3 1 roll def begin + 13 dict dup 3 1 roll def begin /name ED /forcebeaminside ED /allowbeaminside ED /ambiguous ED + /grating false def dup type /booleantype eq not { false } if /correct ED tx@Dict begin STV {CP T} stopped pop @@ -21187,42 +21854,6 @@ tx@OptexpDict begin } bind def % \end{macrocode} % \end{macro} -% \begin{macro}{GetIfcCenter} -% Get the center node of a interface, either by specifying the name of the component and the interface number -% \begin{pssyntax} -% \PSvar{IfcNum} \PSstring{CompName} \PSop{GetIfcCenter} \PSvar{X Y} -% \end{pssyntax} -% or by passing an interface procedure generated by \PSvar{PushAllPlanesOnStack}. -% \begin{pssyntax} -% \PSproc{Ifc} \PSop{GetIfcCenter} \PSvar{X Y} -% \end{pssyntax} -% \begin{macrocode} -/GetIfcCenter { - (GetIfcCenter) DebugBegin - dup type /stringtype eq not { - dup xcheck not { -% \end{macrocode} -% ambiguous -% \begin{macrocode} - 0 get (C) exch - } { - exec pop pop pop - } ifelse - } if - cvn load begin - IfcName load begin - currentdict /RX known { - X RX sub Y RY sub - } { - X Y - } ifelse - CompMtrx transform CM itransform - end - end - DebugEnd -} bind def -% \end{macrocode} -% \end{macro} % % \begin{macro}{GetIfcCenterCorr} % Get the center node of a interface, either by specifying the name of the component and the interface number @@ -21342,7 +21973,7 @@ tx@OptexpDict begin exch dup 3 1 roll % nextifc ambcomp nextifc dup xcheck not { % \end{macrocode} -% the next component is also ambiguos, use its center point as reference. +% the next component is also ambiguous, use its center point as reference. % \begin{macrocode} 0 get (C) exch } { @@ -21445,18 +22076,75 @@ tx@OptexpDict begin % \end{macrocode} % Otherwise put the ambiguous interface on the stack and check its mode. % \begin{macrocode} - [ (C) name - name GetRefIndex - CurrVecTmp (C) name GetPlaneVec NormalVec outToPlane - GetIfcCenter (C) name GetIfcCenter @ABVect DotProd - 0 lt { trans } { refl } ifelse + beamdiffractionorder null eq not name cvn load /grating get and { +% \end{macrocode} +% A grating (AOM) and a beamdiffractionorder was selected. In that case, +% \opt{beammode} has no effect, and for beamdiffractionorder=0 the +% interface is transmittive, otherwise refl or refltrans +% \begin{macrocode} + beamdiffractionorder dup 0 eq { pop () } if + (C) exch 20 string cvs strcat + dup (P@) exch strcat cvn name cvn load exch known not { +% \end{macrocode} +% The choosen beamdiffractionorder is not defined, select the closest one and issue a warning +% \begin{macrocode} + pop beamdiffractionorder dup sign neg 1 { + (C) exch 5 string cvs dup 3 1 roll strcat + dup (P@) exch strcat cvn name cvn load exch known { + 3 -1 roll pop + (Diffraction order ) beamdiffractionorder 5 string cvs strcat + ( is not defined, using ) 4 -1 roll strcat strcat Warning + exit + } { + pop + } ifelse + } for + } if + /@@centerifc ED + mark @@centerifc name name GetRefIndex + beamdiffractionorder 0 eq { + trans + }{ + name @@centerifc GetIfcMode refltrans eq { + refltrans + }{ + refl + } ifelse + } ifelse + }{ + /@@centerifc (C) def + [ @@centerifc name + name GetRefIndex + beammode auto eq { + CurrVecTmp @@centerifc name GetPlaneVec + name @@centerifc GetIfcMode refltrans eq { -90 matrix rotate dtransform } if + NormalVec outToPlane GetIfcCenter @@centerifc name GetIfcCenter @ABVect DotProd + 0 lt { + trans + }{ + name @@centerifc GetIfcMode + refltrans eq { + refltrans + }{ + refl + } ifelse + } ifelse + } { + beammode dup refl eq { +% \end{macrocode} +% in case, the ambiguous interface is refltrans +% \begin{macrocode} + pop name @@centerifc GetIfcMode dup refltrans eq not { pop refl } if + } if + } ifelse + } ifelse dup 6 1 roll % \end{macrocode} % if the ambiguous interface is the first, always draw to it % \begin{macrocode} IfcCntTmp IfcCnt eq { true }{ draw } ifelse ] cvx - (C) name 4 -1 roll + @@centerifc name 4 -1 roll connectifc { bgRefIndex }{ name GetRefIndex } ifelse CurrTmp CurrVecTmp 10 dict begin HandleInterface end pop @@ -22744,7 +23432,7 @@ tx@OptexpDict begin % \end{macro} % % \begin{macro}{ReflectVec} -% Calculate the reflected vector, the normal plane vector must be +% Calculate the reflected vector, the normal plane vector must have been % constructed with \PSvar{NormalVec}. % \begin{pssyntax} % \PSvar{Xin Yin Xnorm Ynorm} \PSop{ReflectVec} \PSvar{Xout Yout} @@ -22757,6 +23445,13 @@ tx@OptexpDict begin Xin Yin 2 costheta1 mul dup Xnorm mul exch Ynorm mul VecAdd DebugEnd } bind def +/ReflectGratVec { + (ReflectGratVec) DebugBegin + /Ynorm ED /Xnorm ED NormalizeVec /Yin ED /Xin ED + /costheta1 Xnorm Ynorm Xin neg Yin neg DotProd def + Xin Yin -2 costheta1 mul dup Xnorm mul exch Ynorm mul VecAdd + DebugEnd +} bind def % \end{macrocode} % \end{macro} % @@ -23255,7 +23950,7 @@ tx@OptexpDict begin } bind def % \end{macrocode} % \end{macro} -% \begin{macro}{} +% \begin{macro}{fadeto@} % The different fadeto modes. % \begin{macrocode} /fadeto@white { @@ -23270,7 +23965,7 @@ tx@OptexpDict begin % \end{macrocode} % \end{macro} % -% \begin{macro}{} +% \begin{macro}{fadefunc@} % The default fade functions, which are selected with the parameter % 'fadefuncname'. The clipping is done afterwards. % \begin{macrocode} diff --git a/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.ins b/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.ins index 0a020009772..d559fceecc9 100644 --- a/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.ins +++ b/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.ins @@ -53,7 +53,7 @@ This is a generated file. Project: pst-optexp -Version: 4.7 (2014/01/12) +Version: 4.8 (2014/02/28) Copyright (C) 2007-2014 by Christoph Bersch 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 905c664bf88..c4936e3a675 100644 --- a/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty +++ b/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty @@ -9,7 +9,7 @@ %% This is a generated file. %% %% Project: pst-optexp -%% Version: 4.7 (2014/01/12) +%% Version: 4.8 (2014/02/28) %% %% Copyright (C) 2007-2014 by Christoph Bersch %% @@ -31,7 +31,7 @@ %% \NeedsTeXFormat{LaTeX2e}[1999/12/01] \ProvidesPackage{pst-optexp} - [2014/01/12 v4.7 Optical experimental setups with PSTricks] + [2014/02/28 v4.8 Optical experimental setups with PSTricks] \RequirePackage{ifthen} \RequirePackage{pstricks} \RequirePackage{pst-xkey} @@ -77,6 +77,7 @@ \newif\ifPOE@component@optional \newif\ifPOE@debug@showoptdots \newif\ifPOE@debug@showifcnodes +\newif\ifPOE@debug@showinterfaces \newif\ifPOE@endbox \newif\ifPOE@startbox \newif\ifPOE@thicklens @@ -185,6 +186,7 @@ } \newpsstyle{OptionalStyle}{linestyle=dashed,dash=1.5pt 1pt}% \newpsstyle{IfcNodeStyle}{dotstyle=x, dotscale=1.5, linecolor=blue}% +\newpsstyle{IfcStyle}{linestyle=dashed, dash=1pt 1pt, linecolor=red!70!black}% \newpsstyle{Beam}{linecolor=green!90!black, linejoin=1}% \define@key[psset]{optexp}{newBeam}{% \newpsstyle{Beam}{#1}% @@ -321,6 +323,7 @@ \define@boolkey[psset]{optexp}[POE@]{usewirestyle}[true]{} \define@boolkey[psset]{optexp}[POE@debug@]{showoptdots}[true]{} \define@boolkey[psset]{optexp}[POE@debug@]{showifcnodes}[true]{} +\define@boolkey[psset]{optexp}[POE@debug@]{showinterfaces}[true]{} \define@boolkey[psset]{optexp}[POE@]{endbox}[true]{} \define@boolkey[psset]{optexp}[POE@]{startbox}[true]{} \define@choicekey*+[psset]{optexp}{position}[\val\nr]{start,end}{% @@ -1064,6 +1067,57 @@ optdipolecomp=, opttripolecomp=% }% +\define@key[psset]{optexp}{aomwidth}{% + \pst@checknum{#1}\POE@key@aomwidth +}% +\define@key[psset]{optexp}{aomheight}{% + \pst@checknum{#1}\POE@key@aomheight +}% +\define@key[psset]{optexp}{aomsize}{% + \pst@expandafter\POE@psset@@aomsize{#1} {} {} {}\@nil +}% +\define@key[psset]{optexp}{aomgratingcount}{% + \edef\POE@key@aomgratingcount{#1}% +}% +\define@choicekey+[psset]{optexp}{aomalign}% + [\val\nr]{sym,symmetric,straight}% + {% + \ifcase\nr\relax + \let\POE@key@aomalign\POE@str@symmetric + \else + \def\POE@key@aomalign{#1}% + \fi + }% + {\PackageError{pst-optexp}{Unknown value '\val' for aomalign}}% +\define@choicekey+[psset]{optexp}{aomreflalign}% + [\val\nr]{perp,parallel}% + {\def\POE@key@aomreflalign{#1}}% + {\PackageError{pst-optexp}{Unknown value '\val' for aomreflalign}}% +\def\POE@psset@@aomsize#1 #2 #3\@nil{% + \ifx\\#2\\% + \PackageWarning{pst-optexp}{% + Parameter 'aomsize' requires two numbers.}% + \fi + \psset[optexp]{aomwidth=#1, aomheight=#2}% +}% +\define@key[psset]{optexp}{aomcomp}{% + \def\POE@key@aomcomp{#1}% +}% +\define@key[psset]{optexp}{diffractionorders}{% + \def\POE@key@diffractionorders{#1}% +}% +\define@key[psset]{optexp}{beamdiffractionorder}{% + \def\POE@key@beamdiffractionorder{#1}% +}% +\psset[optexp]{% + aomsize=1.5 1, + aomcomp=default, + aomalign=sym, + aomreflalign=parallel, + aomgratingcount=9, + diffractionorders=2, + beamdiffractionorder= +}% \define@key[psset]{optexp}{fiberloops}{% \pst@checknum{#1}\POE@key@fiberloops } @@ -1428,6 +1482,17 @@ \define@key[psset]{optexp}{beamwidth}{% \edef\POE@key@beamwidth{#1}% }% +\define@choicekey+[psset]{optexp}{beammode}% + [\val\nr]{trans,refl,reflective,transmittive,auto}% + {\ifcase\nr\relax + \let\POE@key@beammode\POE@str@transmittive + \or + \let\POE@key@beammode\POE@str@reflective + \else + \def\POE@key@beammode{#1}% + \fi}% + {\PackageError{pst-optexp}{Unknown value '\val' for beammode}} + \define@boolkey[psset]{optexp}[POE@]{startinside}[true]{}% \define@boolkey[psset]{optexp}[POE@]{stopinside}[true]{}% \define@key[psset]{optexp}{startinsidecount}{% @@ -1585,6 +1650,7 @@ ,beamalign=relative ,beamwidth=0 ,beamdiv=0 + ,beammode=auto ,n=1.5 ,beampathskip=0 ,beampathcount=-1 @@ -2204,6 +2270,18 @@ \POE@key@beampathcount\space dup -1 gt { beampathskip add } if /beampathcount ED /useNA \ifPOE@useNA true \else false \fi def /aligntovector \ifx\POE@key@beamnodealign\POE@str@vector true \else false \fi def + /beamdiffractionorder + \ifx\POE@key@beamdiffractionorder\@empty null + \else\POE@key@beamdiffractionorder\space + \fi def + /beammode + \ifx\POE@key@beammode\POE@str@reflective + refl + \else\ifx\POE@key@beammode\POE@str@transmittive + trans + \else + auto + \fi\fi def }% \let\tx@Line\POE@tx@Line }% @@ -3140,6 +3218,34 @@ tripole object '#2' already defined}% }% \ignorespaces}% +\def\optaom{\pst@object{optaom}}% +\def\optaom@i(#1)(#2)(#3){% + \@ifnextchar\bgroup + {\optaom@ii(#1)(#2)(#3)}% + {\optaom@ii(#1)(#2)(#3){}}% +}% +\def\optaom@ii(#1)(#2)(#3)#4{% + \addafter@par{ref@angle=180}% + \begin@OptexpTripole + \ifPOE@backlayer + \ifx\POE@key@abspos\@empty + \ifx\POE@key@position\@empty + \psLNode(#1)(#2){0.5}{\oenode{Tmp}{}} + \else + \psLNode(#1)(#2){\POE@key@position}{\oenode{Tmp}{}} + \fi + \else + \psLDNode(#1)(#2){\POE@key@abspos}{\oenode{Tmp}{}} + \fi + \POE@calcNodes{#1}{\oenode{Tmp}{}}{#3}% + \POE@regNodes{#1}{#3} + \fi + \POE@drawcomponent{optaom}{#4} + \ifPOE@backlayer + \POE@InternalConn + \fi + \end@OptexpTripole +\ignorespaces}% \def\optcoupler{\pst@object{optcoupler}}% \def\optcoupler@i(#1)(#2){% \@ifnextchar(%) @@ -3478,6 +3584,22 @@ grestore }% \ignorespaces}% +\def\POE@saveDiffractionNodes{% + \POE@Verb{% + gsave + STV CP T + /N@\oenodeRefA{} @GetCenter + /N@\oenode@Origin{} @GetCenter @ABVect exch atan /myangle ED + /N@\oenode@Origin{} @GetCenter + /N@\oenodeRefB{} @GetCenter @ABDist /mydist ED + grestore + }% + \pnode(! \POE@dict{mydist myangle 180 sub} PtoC \tx@UserCoor){\oenode{DO0}{}}% + \multido{\i=1+1}{\POE@key@diffractionorders}{% + \pnode(! \POE@dict{mydist myangle 180 sub 180 OEangle sub \i\space mul } add PtoC \tx@UserCoor){\oenode{DO\i}{}}% + \pnode(! \POE@dict{mydist myangle 180 sub 180 OEangle sub \i\space mul } sub PtoC \tx@UserCoor){\oenode{DO-\i}{}}% + }% +\ignorespaces}% \def\POE@regNodes#1#2{% \pnode(#1){\oenodeRefA{}} \pnode(#2){\oenodeRefB{}} @@ -3869,6 +3991,11 @@ dotscale=1.5](\oenodeTrefB{}) \fi \fi + \ifPOE@debug@showinterfaces + \ifPOE@frontlayer + \POE@drawinterfaces[style=IfcStyle] + \fi + \fi \ifPOE@debug@showifcnodes \ifPOE@frontlayer \POE@ifcnodes[style=IfcNodeStyle] @@ -3900,6 +4027,33 @@ }% \end@SpecialObj }% +\def\POE@drawinterfaces{\pst@object{POE@drawinterfaces}} +\def\POE@drawinterfaces@i{% + \begin@OpenObj% + \addto@pscode{% + \psk@dotsize + \@nameuse{psds@\psk@dotstyle} + \pst@optexpdict + /\oenode{}{} load begin + 1 1 N { + IfcName load begin + X Y + CompMtrx transform CM itransform 2 copy + currentdict /RX known { 0 0 }{ DX DY } ifelse + CompMtrx dtransform CM idtransform 2 copy + NAlow 0 eq NAup 0 eq and { + -0.5 VecScale 4 2 roll 0.5 VecScale + } { + \tx@UserCoor NAlow VecScale 4 2 roll \tx@UserCoor NAup VecScale + } ifelse + end + 8 -2 roll VecAdd moveto VecAdd lineto + } for + end end }% + \pst@stroke + \use@pscode + \end@OpenObj +}% \def\POE@extnodes{\pst@object{POE@extnodes}} \def\POE@extnodes@i#1{% \begin@SpecialObj @@ -4743,6 +4897,96 @@ (!\POE@dict{0 \@sz 0.5 mul @OEtrafo}) \fi \ignorespaces}% +\def\optaom@ref{% + \POE@setref{/@@x \POE@key@aomwidth\space 0.5 mul def }% + \POE@setref{/@@y \POE@key@aomheight\space 0.5 mul def }% + \POE@calcAngle + \ifx\POE@key@aomalign\POE@str@symmetric\else + \edef\POE@key@angle{\POE@key@angle\space 180 \POE@dict{OEangle} sub 0.5 mul sub }% + \fi + \edef\POE@key@angle{\POE@key@angle\space 180 add }% +}% +\def\optaom@nodes{% + \ifodd + \ifx\POE@key@aomalign\POE@str@symmetric + \ifx\POE@key@aomreflalign\POE@str@parallel 1\else 0\fi + \else 0\fi + \newOptexpCompAmb{% + {@@x neg 0} {0 1} @@y neg @@y + trans {PlainIfc} + {0 0} + \ifx\POE@key@aomalign\POE@str@symmetric + {1 0} + \else + {1 0 180 OEangle sub 0.5 mul matrix rotate dtransform} + \fi + 0 0 trans {PlainIfc} + {@@x @@y} {0 1} @@y -2 mul 0 + trans {PlainIfc} + {@@x @@y neg} {0 1} 0 @@y 2 mul + trans {PlainIfc} + 2 1 + }% + \else + \newOptexpCompAmb{% + {@@x neg 0} {0 1} @@y neg @@y trans {PlainIfc} + {0 0} + \ifx\POE@key@aomalign\POE@str@symmetric + {0 1} + \else + {0 1 180 OEangle sub 0.5 mul matrix rotate dtransform} + \fi + 0 0 refltrans {PlainIfc} + {@@x @@y} {0 1} @@y -2 mul 0 + trans {PlainIfc} + {@@x @@y neg} {0 1} 0 @@y 2 mul + trans {PlainIfc} + 2 1 + }% + \fi + \POE@Verb{% + gsave + tx@Dict begin + STV {CP T} stopped pop + end + (C) (\oenode{}{}) GetPlaneVec 2 copy + /N@\oenodeRefA{} @GetCenter + /N@\oenodeCenter{} @GetCenter + @ABVect 90 matrix rotate dtransform + NormalVec ReflectVec ToVec dup + \oenode{}{} begin + {0 0} exch 0 0 refltrans name (C-1) {PlainIfc} {sc} NewCompIfc + (C) (C1) IfcAlias + 2 1 \POE@key@diffractionorders\space {% vec i + 2 copy neg dup 5 string cvs (C) exch strcat % vec i vec -i (C-i) + 3 -1 roll exec 4 -1 roll % vec i (C-i) X Y -i + 1 add 180 OEangle sub 0.5 mul mul + matrix rotate dtransform ToVec % vec i (C-i) {X' Y'} + {0 0} exch 0 0 refltrans name 7 -1 roll {PlainIfc} {sc} NewCompIfc + 2 copy 3 -1 roll 5 string cvs (C) exch strcat % vec i vec i (C-i) + 3 -1 roll exec 4 -1 roll % vec i (Ci) X Y i + 1 add 180 OEangle sub 0.5 mul mul + matrix rotate dtransform ToVec % vec i (Ci) {X' Y'} + {0 0} exch 0 0 refltrans name 7 -1 roll {PlainIfc} {sc} NewCompIfc + } for pop + /grating true def + end + grestore + }% + \POE@saveDiffractionNodes +\ignorespaces}% +\def\optaom@comp{% + \POE@comp@rectangle + \ifx\POE@key@aomcomp\POE@str@default + \multido{\i=0+1}{\POE@key@aomgratingcount}{% + \psrline(!\POE@dict{@@x -0.7 mul \POE@key@aomgratingcount\space 2 div dup 1.5 add + @@y exch div exch 0.5 sub \i\space sub mul})% + (!\POE@dict{@@x 1.4 mul 0})% + }% + \else + \POE@key@aomcomp + \fi +\ignorespaces}% \def\optfiber@ref{% \POE@setref{% /@@x \POE@key@fiberloopsep\space\POE@key@fiberloops\space -- cgit v1.2.3