summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rw-r--r--Master/texmf-dist/doc/generic/pst-optexp/Changes95
-rw-r--r--Master/texmf-dist/doc/generic/pst-optexp/README32
-rw-r--r--Master/texmf-dist/doc/generic/pst-optexp/parque-nacional.eps286
-rw-r--r--Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.pdfbin370537 -> 0 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.tex2057
-rw-r--r--Master/texmf-dist/doc/latex/pst-optexp/Changes119
-rw-r--r--Master/texmf-dist/doc/latex/pst-optexp/README28
-rw-r--r--Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-DE.pdfbin0 -> 1163028 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-quickref.pdfbin0 -> 44681 bytes
-rw-r--r--Master/texmf-dist/doc/latex/pst-optexp/pst-optexp.pdfbin0 -> 1138738 bytes
-rw-r--r--Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro1618
-rw-r--r--Master/texmf-dist/source/latex/pst-optexp/Makefile103
-rw-r--r--Master/texmf-dist/source/latex/pst-optexp/pst-optexp.dtx17412
-rw-r--r--Master/texmf-dist/source/latex/pst-optexp/pst-optexp.ins96
-rw-r--r--Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex2455
-rw-r--r--Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty4114
-rwxr-xr-xMaster/tlpkg/libexec/ctan2tds1
17 files changed, 23301 insertions, 5115 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-optexp/Changes b/Master/texmf-dist/doc/generic/pst-optexp/Changes
deleted file mode 100644
index 45c229ab47e..00000000000
--- a/Master/texmf-dist/doc/generic/pst-optexp/Changes
+++ /dev/null
@@ -1,95 +0,0 @@
-2.1 2009-11-05 * Bugfix: removed the buggy check for an appropriate version of
- pstricks-add.
-
- * Bugfix: 'thicklens' now also works with plain* lenses
-
- * Different minor bugfixes
-
- * Minor enhancements
-
- * New psstyle 'OptComp' which sets general parameters for all optical
- components. Appropriate parameters 'addtoOptComp' and 'newOptComp'
- were also introduced.
-
- * New parameters:
- - 'label' allows a more condensed change of several label parameters
- - 'innerlabel'
- - 'compshift'
- - 'bsstyle'
- - 'connjoin'
- - 'newBeam' and 'addtoBeam' to allow for local changes
- of the internal beam style.
-
- * New component: 'optfiberpolarizer'
-
- * Changed 'fibercollimator' so that it uses two, three or four nodes.
-
- * Changed documentation to use 'pst-doc' class.
-
-
-2.0 2008-07-27 * Added fiber-optical components
-
- * Added support for components with internal refraction (e.g. prisms)
-
- * Added support for arbitrary connection types (fiber and beam mixed).
- Components can be connected directly at definition time or later.
-
- * Added new free-ray objects
- - \optdiode
- - \pentaprism
- - \rightangleprism
- - \doveprism
- - \optprism
-
- * Added support for supplementary nodes for electric connections
- (parameter extnode)
-
- * Bugfix: renamed macro \detector to \optdetector to avoid conflicts
- with pst-circ which also define a macro \detector.
- If pst-circ is loaded before pst-optexp the macro is not overwritten.
-
-1.2 2008-06-17 * Great emprovement of the TeX and Postscript code.
-
- * New macros \newOptexpDipole, \newOptexpDipoleNolabel and
- \newOptexpTripole which allow very convenient definition
- of new components.
-
- * Enhancement of the lens design. Now much more types of lenses
- with two different curvatures and thick lenses are possible.
- The new parameters lensradiusleft, lensradiusright and lens
- are introduced.
- Unfortunately complete backward compatibility for the case
- where the lens is defined using only lenswidth and lensheight
- was not possible. Using the old behaviour is possible only
- by setting lenstype explicitly which in turn does not allow you
- to use the new features.
-
- * Added curved mirrors (new parameter mirrorradius).
-
- * Added binary gratings (new parameter optgridtype).
-
-
-1.1 2007-09-06 * Considerably enhanced labeling of the components.
- Added new parameter 'labelref' which specifies the
- reference coordinate system for the label positioning
- and the rotation of the label. Default is labelref=relgrav,
- the label point is rotated together with the component, but
- the label text itself is not rotated.
-
- * parameter labelrelative is now obsolete, and replaced by
- labelref=relative. It will be removed in future versions.
-
- * parameter polwidth, bswidth, iwidth and owidth are now obsolete,
- and replaced by polsize, bssize, innerheight and outerheight for
- consistency reasons. They will be removed in future versions.
-
- * macro \polarisation was changed to \polarization for consistency.
- The old notation is obsolete and will be removed in future versions.
-
- * fixed bug: filling of all components with 'fillstyle'
- is now possible.
-
- * added some liftpen=1 in the code to fix the look of
- the lenses and the optgrid.
-
-1.0 2007-07-18 first CTAN version
diff --git a/Master/texmf-dist/doc/generic/pst-optexp/README b/Master/texmf-dist/doc/generic/pst-optexp/README
deleted file mode 100644
index 0c6c2f39a25..00000000000
--- a/Master/texmf-dist/doc/generic/pst-optexp/README
+++ /dev/null
@@ -1,32 +0,0 @@
-The package pst-optexp is a collection of optical components
-that facilitate easy sketching of optical experimental
-setups. Mechanisms for proper alignment of different components are
-provided internally. This way the user does not have to care for proper
-orientation of the elements.
-
-This is version 2.1
-For a changelog see file Changes
-
-Save the files
-
-pst-optexp.sty
-pst-optexp.tex
-pst-optexp.pro
-
-in any place, where latex or any other TeX program will find it.
-The pro file should go into $TEXMF$/dvips/pstricks/.
-
-pst-optexp uses the extended version of the keyval package. So
-be sure that you
-- have installed xkeyval with the special pst-xkey
- (CTAN: tex-archive/macros/latex/contrib/xkeyval/)
-- do not load another package after pst-optexp, which loads
- the old keyval.sty or pst-key.tex
-
-
-This material is subject to the LaTeX Project Public License.
-See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
-for the details of that license.
-
---
-Christoph Bersch 2009/11/05
diff --git a/Master/texmf-dist/doc/generic/pst-optexp/parque-nacional.eps b/Master/texmf-dist/doc/generic/pst-optexp/parque-nacional.eps
deleted file mode 100644
index 9576fcfe18a..00000000000
--- a/Master/texmf-dist/doc/generic/pst-optexp/parque-nacional.eps
+++ /dev/null
@@ -1,286 +0,0 @@
-%!PS-Adobe-3.0 EPSF-3.0
-%%Creator: jpeg2ps V1.9 by Thomas Merz
-%%Title: parque-nacional.jpg
-%%CreationDate: Thu Jun 16 20:16:59 2005
-%%BoundingBox: 20 20 173 176
-%%DocumentData: Clean7Bit
-%%LanguageLevel: 2
-%%EndComments
-%%BeginProlog
-%%EndProlog
-%%Page: 1 1
-/languagelevel where {pop languagelevel 2 lt}{true} ifelse {
- (JPEG file 'parque-nacional.jpg' needs PostScript Level 2!\n) dup print flush
- /Helvetica findfont 20 scalefont setfont 100 100 moveto show showpage stop
-} if
-save
-/RawData currentfile /ASCII85Decode filter def
-/Data RawData << >> /DCTDecode filter def
-20 20 translate
-152.64 155.52 scale
-/DeviceRGB setcolorspace
-{ << /ImageType 1
- /Width 212
- /Height 216
- /ImageMatrix [ 212 0 0 -216 0 216 ]
- /DataSource Data
- /BitsPerComponent 8
- /Decode [0 1 0 1 0 1]
- >> image
- Data closefile
- RawData flushfile
- showpage
- restore
-} exec
-s4IA0!"_al8O`[\!<E12!+Z'0s5<qn7<iNY!!#_f!%IsK!!iQ)zs8E!76ZQaHFCe
-u*GA2/4+B3#c+@f!t;#f8M6N@8l"9\i0"U"r2"U,&6#7LkC#6tJE$O[7L&J#Ke&J
-#Hc',DQ(',2?"&J5j'(`FD8+!2R<(Et+K*[D^H+!1I:!(-bj"U,,8#7_"F%NZ;r'
-HS;:*Zc@D*Zc@D*Zc@D*Zc@D*Zc@D*Zc@D*Zc@D*Zc@D*Zc@D*Zc@D*Zc@D*ZcC&
-^]4rP!8%;$!s'SG!YGG8&HVpM!#tt=!!`N*zzz!<NB-"pY59s24n2&-)_4"9\f1"
-9f#8$j-J0!!*-'!!EH;"qi(6#89BI;.4Hq#S]%V'dKEW_)"DU@Zn(e(*k1aEm`h^
--8e.h@s*BtUU'E$PLKQM!#bk<!WrH(zz!!!!"!WW<+":"nE!%ec_!WiE)!<WH*!s
-J]*z!<Ni8+VHL41-nb@'-^j!6@k7D;K9P#nGh2B$j-M1!YGMH!'^J'SXa]ne?gg?
-kYZ,od_eG!>[LbIS[utmW+pLKbgIj#Umkd]=W=Y>Q6Op+D/T;\oX5dX<,'8Uf9U^
-O$OnX=eS$OM,T@1O+HIQ&?S\r.:\IU<A+p8Hacl\#`Z,ApG!^cid[Qh_r?Jjs,Ip
-oCgdhF33Ir[M!.+*YD_BMAZKm<5Ejr'\5UtV\;s=qIG7W;@o,NWF13.e7:^\j3H"
-f1H8sX:X+70p.icV]1DMlZVPjJ=j-=0"ab!Lh\Yi,[gBG:JE46sAu,3J)H"XR2`V
-.EfkPUn0@q>s4SMeVHdCR!c&5'akOl*BmF\&.Lk1CmHJ,FeTPa3>[E$p6eZ/^:R+
-rCR[N(hH@8Q;7U0AfusH-Zu8kj73i$,9ok+SE7!(5X,1!-#i5UArOp$-=phe>deN
-k3>+k.M^qd:I!-GuX8YZ[pdP2_P>2j"@5fe<!:(W[i?g\p6\c%3<g$&TS!Q-1fDM
-JKDQtS`>,ihmJNYcCo@)!t[[07WV$aMmisJFn;MM""J9MbUf0/Y2Y">lrSpAJT8m
-[gf#$+ke\R6?X<2"+'IuJ,"DAVg\aYt)Q%SlU8"XQ]bU-Kr-&A*1*]qPQqg&D&/F
--C;C&"+3aDPq)Z==LtqOHleGgJ#2,OE"a%^4a`j7o:b!fN+;kV=rc6SL:jt[=Wp'
-m@Y6(9i$EkWa"gPkIVo"=siOYDO$]BPUBmhi!n^B<rm*HH,e;f:nF.uV(9_]Q;`d
-<[;;[3:8YgUBSB0"o+]Cl_'q[N\:cE-bEa`[f%aoB;">0/%$;/9`@X4j11l,D1DL
-Ia*,W_KL4bBMP*.[&PC$WSn(o4`NB3b0k.<,u/DC>09AIs@H>?nAY-tgo)OpXT>j
-U*#8gS>@PH&3E/@C&:aTsfVT[kG<S1DPll9r<@K^=Yt8-s<NYB3EcDifq8,aaR%p
--_Oa/[I70dR8]Y3AU6M[O1<2#t[;%f%o*!IP@./+Y:gGR7?/S!WbjW2nX!+>S"i;
-%
-B[Q)9W/[SW;F6jegX"76o]iFH5M43E4Z]2.rK\@cOuB>WM8MOok9_TK[[IUa"27j
-7F?p<`60V6U]i;m7kLO%Oe;kG%D3lW8tf+%V)\#I&qSdhXH\q)HYIQ[T^ds,f*g1
-](A#%2[</@W)!+FMbU99r+8^_h$e8@,YNY8)Pbk[_9M=RUr?YY1d)/IWdOC1ufiH
-"U#NmG(8nT%KDT-FV"YT[T.aZi:g.=@#?7`%@Fi9QAS?8\hW$#[rh,JO$r*Z=>gq
->;g1sI/M[aUX^ne>)AU@u..naV:A.pJEa1G2O3D(Ou+=Ak6i'5bB8I?!6`SXg@?'
-m:a@N4:[Rg(rWA6]'$OpC[eanaM@VW^TftD8dgc7>I*"O#W%=K.&th_bTaf(07AV
-Eg4'_ZPr7^fd]QW!#tc&Up^rUDN81Fm;5RUO7[LaX(XB6ICl2Ja`L*&[Bho]_U?O
-X]iM/G$<<Q?/d*>'Fj(0b"DnVr,UlX7cC%__o0<p`j:-]8]J$2C((1!EH&8=8S<Z
-F*iEhMg18`R+iGl<8q07^0/PBhaZu`*2>se-@Z_FcJ/\q9,b"pfp7_L4R9iWX-&m
-0TR^=/"H8d`]s%fL]U`.X[2>!d38DFhFu=F;DQ;H-,sX*o)u_bQ;mG2JZY>Dg^4<
-bE,TH#*!GX:D['`MB;uDI'!\W,79?\Hi1_JCC\#0WnF&dDk:V-;J0a)cBq)VosUn
-ar<us[s@L)Qk:M0cQE@bEJ+;sA@RU_d/k,I+7-9<3)\>e(ho`0m\Ddh[lu0<l`;L
-mND_;5"#o+NDH)at+IcOqZ9jilD0gWfKN?[LSL$h;E5)ObNU^3cYFq:D7$jcX!#7
-DMJ.Rq@8idI?'REqG@7l]IV,Q$Edj<b5P[QRUBq](5IO+B2Uu!ngB'ME&0F=_C!<
-#Z(`TFV&[a\MHo"%l*q93R0>=WUk&''khr1':R860m4R_E`$MuNcj8$!C>]#Rjs@
-9gj&g99ZG00dk%!'qHfa[f%$Ai_rUOH)r&Rigqso14S+b]?V/-*ZSicd%!Cm(bIb
-U&%![#U!Jf8q;c@?Ql3neE8W8.(An[U+.r%&>Z)p@AueJ"A<:$81(#"k`:j[M:[e
-VI#LRnGj:G9Edo3G%t3R"E`/+c"t!E";ObR#6ms'"EaYTfQriLK&)J!r_O,-LYd"
-Dc..3Feq?ceJV=8S)D%4=6^%?s!Js"c-<`XNHa_A1%R?r#,>>ChC$6@&*$t0!Di>
-eU*bHG?o$"@02AgDG08cTYX5WpsS-Z-lSNRa;YRiS3!8n4'6\f5!dIZWuqVM9bo*
-fh#KR19G=9pFAbb-X2NTDICYL>5tL/?s2C1aH:M\8bu4MFK%_<24re*s(&*V)AVe
-h'^<GoX%L;<:b"!F)'ec3L52YiiT2b$0g^1)0p2kPqu0!8)g%?B/;oAI$[m%Q'Dt
-JkGWOm4njL1g?)D'.[tT]-rESUkG39Jlo'D0nVB2"N"omY>S<60GE.XE2H>K0F;O
-cOn-C:H5lm\PW?;fYIn3JucXcOION.fLdSjp2R)>iHBF@%>N*1>P+F%i2iRSkOEC
-Z8las)5QQ6fBt7,>t=#6b/K:uNmV3_)'-!<Q4C^f%RnPsblfn3k&=&kkR;?B@ZJ"
-GfW4@LtWe$;$8%K*EJ/ku;arNX.Ae$A\eo0VDp9BJ?A5#B4(f[>lD6_LeKnl$0CA
-H-^Vpk)4h`[O8o(<;<S;iCBCWVU5+gaT>`bcOqUoT1_e!`$@17g-%+`lYfnM<g>X
-?d5;0jK?MI[QgG#CfCO^-KD7lq].l)r,qp2[%s%ZO>C]#Si*rf@gZSubC2);L5T*
-,o#ds:q8->jBf8b>E.no9u>Eiiq_oZbn</%T"?Krn):W`eub:lL=9fdrj8I?nIUu
-1cp5*.!EN?P'Q[I(3MBI8aNUi#"b'%BO(YShA#h[<s9?oJn9O^fe;dHrP-rr>kLf
-`(s2AUe`VRj'"p#PAT;rrBp4Ir^pGN?!D3A]q<b)u[I"O''U\#97\G#8'o`<DTID
-RZMeg\tLI9TW!!.<K]jXY8V[ElYe2nG]Q3FehP2Y"_*<`WT:u($2:uBh9(o'F;]Y
-6^!FtUMb.,>9(,616ES\@"X/c:(3unD(Vq]7h8S_s7>M'XF=AEoX>:]NP3+0>$mp
-,'=CtN-/lsNR%$D5>HW]QV]u@gq[>a:$o'BeF/9(anduITn-<d5kc=0\fFgQ3$S*
-W4M*_6m2@`nXIS&a;M`+B]'ULD<HXX^%H[H'=#@DfRk$VFF&I)Q[Wl//]bg.@m19
-$53W;GDkV`"\Lp_:,Q\R7pnAh0EVRBf.50amR?@p[IZ,0.ug:U#t-'La4P[8[qk`
-Je)i>a.7Hl_L*MbQ]5SBNDDE.VID!B,X!Y4Q^5u)apK[tHX+Ie\Jeci29!!\S%lo
-6P(J:kW"=<3Zm;91h>D^6QZ*#&<L-*"^_PPQ:/9b>d4WY[NR[=$RJD:mA2_/p&3<
-0CBUiF9VlGl20SrtKeb*M!e!XHXU8!a6X7JrJ'm4Uj%t#3aPGb(ar\eNm`mlhU;W
-8,#h4UuQ4N&-*lQ1A=p1.l854Ldph+_:?igj[S1IuKXbZ#@QqUYlB&NRaf<JrP[1
-hVQU7srPfOd:o+\QF&[,m?e=,lAkbUmiXdiWJ37!EA-n8D7lN^9@WsZ],X)Pals8
-MM/Xtb;-8%4jn>Yh,%t,WQ"q`ODLQkQaecK?[.`*=6qBjUSq-F220,1_hs_j`=j?
-_prV#t=Jf&t7S8,8#O:0i[Si9^Dtf.D\fnTRLiLrm(#`>6$`b.HX!r'l/M4CFLE6
-gu?co&'r1N<ZONSZUrE(+5=%:UR0>F#*0%&j[-9\9'gMho/-Bo-[@8/pi=uVj^<4
-3`LOJFI""\DbZ2Uk&OY*6*0=6r'XKa#A!p=/E@#2IFQX[U4r&:,EEcPWa'>?i+&!
-U4j"9(e!FIZJ`k'+O_Ar1WYlOqpZPk*a!+48jk]d0XX06$42qU3^Z%EtG*rMC[a%
-N5\(%l[Rs/.f+b\lM>SN6>fPl8fk2[/eOR<5#<IXe"Sn=T$=p[iTgdW80mML@>\$
-I8.+&k8s0J6/84!9p5T>P>SBD!5tmRdp6--M`'+C8_))-drrAeT^N>j2Nr4?jE6G
-JHI!NDJ4tBQVXi(omlAHrgPuUfo:'mTN@D^i^':I?a?qId+!5HqhfZ%470#nfRXN
-=#B^/NkBo\"3_+)G,O6&?n.88#c/.u<]emNfiC6@GV4Ws#s0D65;sYgQ."3I<\-,
-ZkZZ6:LaiA(g^D9>m>I`+HVC.$lZ"8o<7S\'^`Q.7sZ!9!<?=.p*hSrF5`m%p9T1
-%
-H9sLl:[<RroDpCM"=/(XlGMEqF(aRm)amX-rLQ+-gT%,gm)SPLh5]VBm?9cKS?^,
-:of.gHN=c-NR-F:e%1BNhuukr@g'DulHU&E_XhYBk(-OTP1d/l^MuN^IBJ39c6de
-,/&KR`nIA$7M)/"@UJkoE^.ZRdQDHI+hVd9FF[%)d]G#uE\4afpDBG"3RspWZl)q
-DJP<!\%Q5!AaS;Bea,sZ1J1_"7F;M*A6qb1Kk-W#R;WF=I=eCq]9(7+c5&4+Zp(.
-Y?V(8@VgRqXCM7Jf*O=fk[Y<t]8RJk`mGqdNF-n<VcY"\Cau7D]'M>bp*.SC;.ug
-@AI=AVjYM>aJ'o&i(.#!*c%j_Q]M$iJ/57K#(B1<to88U8;Vkb"[NC?sfY:rJn@<
-`b/;)\=\@tNjPb6RSrAb<MXAags)*srrB=AXgLFL_X6p/F<6VD)YZo$hD7rA/3\s
-;$`@X,+hE@B8Y;2o%b"r;+aHjNA"1^LN@?/(86]sXBMq0[[%,69:8'rI*rb17*])
-$L.Di/Y[na+tY#Vj`<BB@*U^mD)MZ,l4OYJN2,0Z=gfpd!(Y\Ulb_0FnHH&8/VSo
-B.1PfhLjqi-Z$DQX\Q`=sfd-KE:F@J+q,HeAHlM5JeeQBGj!TGq/`@$.X9="iYRe
-dJE#Xb,bZA18uAPhC9*LZ^+nQ$eSM?IJi46#ZZ=ca<9oCC8FhBi%=I29$sYU8qET
-;N6`cgIV!gm3$i&DZeThVS[&WM$E6FXq[Za_oslXm^\0-Bo+W+_0XNuO"&'h*[dD
-@IEOi7JE-+j^U'`,=<P,\[83C*M:Xgt,j7JLli%K<<Oi%q!e8`idMd4kOU?&>YYo
-TJh9_(Z,U@snhCYOKk*>;p+RM?fHC^$BfFnnb\sq03HR_9\Y*W)6LthDF#%iLA.C
-;V."S7dMnr1A#UR2'?3Cu-Wh-u-fUpuI,:$iT#,ko>kRSoom')&bIFPCuk7-np*E
-p'Mo@eS6O5;_(aBV=\U()GZ=nI:Kd;RgI]j1&eg?bXSY,037-(/IGd-UpUr8aeUN
-<n=&u=&ucY;;i1PDK?e;_JOX`'tk5Z<Flee0jiFYNh<3K!)R3k)l:CVOSiKV23FA
-*In10;CJbl%a[jeIW/%\)MkoJ<P7VT17eR0L7crl05*7!<g<,!6?ZEKK[S]LTPJ&
-$u^k;R)_uB`+\R4-h-4E9"EL-gT7s-RkpIU3_(W4[!q[$T@lP8,C(6YKQgAWCaR[
-R4+F>,&2ECh`-Z@[`D!0B['hW4N>/.+,X@r\42&77guAP7m4.BIYfVGj@l/!H3]W
-$6N<6NP"ZPRnCD7T!_;HpR!4ntMrq*iAFXp2:-Z&u_aK@gUIjWb!X51u,I/ArT`(
-UEoa4Z3#sH6Ae&e,2G9cCqME"*,][62J!Os>mSndBKDmOF.8[21>&M1OaGs`,5$@
-Mmb>SkZ#QR0CgJN_EMj&PN%e29[.X"U<;.%h8p`a%+nTL_S#0RPgA+=e6g!Y$@k7
-[qGhS+U3LRlI1\.C'.jM#XP\k([,>]/>H]-O9$sK5*-X]Gag(;U\f>Dj&fB@*$]0
-,HY:Pue"P#XNq$#EOnjjk?5RW/ZSKW'Ec'dVpW\>;J_#2)bE6ZrtO39*u'DJb--3
-(@':9YW+c>:L_Z6Y\PXgp&9AJ802U+%SB?:F1&M[bHeQP(bgP\lLkD4/3[pn:)-\
-C;]`4&QarRS9$bbIG5o7gBAuS.ilIA/Su6N)k0FMMJ%pHCMVk[-RfboRM5<0V8pu
-db*aP2RfF?Tacq&rBR4A0<ZT0pNXS%O'oaY`PmT$ZX`US-TERc\&jQIc,s[Vb:10
-leNCBUg__P5;H7Z?PPN$na;ACtQD'cQ$5F@,%5a:-Zl_I(d:R@Q;<4(_u1CPqsC$
-*:ZUZ.K2Ko=J*fdir,cSBK)M'n.#/RV6[8Y:.ZMl89gq@]'PU_Jce;$fipALU%HD
-51"gDB;3D!NS&!=\Zt7>&>`aRPDu.Ms^=%`fWfd;CMoU.9*8RG[JH:AWYJ]4J6"B
-e>^l].0o,/o'OZD9H^e8/rQQ?4+]Pfe>2/p<0shH3d988E79^>#$V4,C"5mHR9G9
-G4c*m-QRMk6@7WXL!C6l:DMC"g-XEG*=XPRF'c&1YR<+PON.kCBb*?Ns!8bjigLC
-fD*#[_*_7Q((;**V"Soq;fq,AQYK(+dB_:7YIfQ'8UEj%Z=(>4,VI^#Xt-L4Mj+X
-5OHOM#^-&h[t*<OR4G3:)C?F=_.!&0fCK%:L1V'TOlkEc?]I([VT!f^0Q[*bGe)?
-oA</Q2&=cfAqJY4R"g#(Ga_?FGLYGTPJ*h`5M$=MC"cV(5N];#/^-#UiH?!m3BC1
-X7:#cTXC_sC-"V1TWH/P:a7gF+b[]ND(W'?7Vc:E80jf+m_<:UQ[.2Q-.`p?D0s3
-/3p%a*!$hC"m$Y29l_)M])@e6UCH^L)rrB#t+8BBUmZS:%`'+DRq%#b<hrqUdPL/
-l!]M'jg\1,2W$Up3MQ$\<6&9igVqEc<Y"uh/G5jJar`$8\482Q7AOtY5t&oXR2#V
-CXNg(TSl<_0SY916fV0"u4m6tATWO@WGMZuo#,F9Xe&2@uN=L.I;o_>r4l(5.(/<
-eCrs((a3O6.ueQrF++i^`X*E!GD^OPs>T1"COM/!$I5Ug(n0M5$ab;<,8;L+70L0
-k+u5d;6?S:5+k^"@[2XXQI,&n^<m?)Otq^GpY$mt!j]upBr\A9Ld7cu.3$9NS[kP
-2GRC]Yh.]2U@T3k8D4jBF.3cQZFFbE::AkpYJPo+(CMHV>9gh-PM^J0Jcu%c,^)8
-@+"KN^tUL]><Ihmg&j<[Ca!2)fZ95D#k)D>dBZe]jArrC-14A!*[/lq,lmZSL>#;
-Mt;]P,;e-D7c@6DIkY>qp-0/JBOT7;RR!b^u)_NJROHfe>RL#G>1'qC5S.b!]^ef
-Knk0:#^P[3G)U09?-GNBbLfW;f_u:L`*c-K]VDN@WmYPrrCLrT;`d`dToFY$;qSF
-P_B9U/i5dPU@8f+;T,(SUfFH/C7D.]WJ!J+P*D4G9K8:#O9`W82X(j%-,qLrHmp:
-BY\JFk9YF2-`?gA:J]pQD9AGTtMT<%VeaV:%:?VGDDL%4f=hmQ,:g^"IglqOqn[F
->"E;A9E[Sk9&St@?T.m[&,7e1UUl7B-?";@Ye1r':e<QB@:pr4,1YgZiPj(3EF]S
-*FgKnYdEhJmY3H=G'7?@dR94<m2N'kPTV_H];c0N;Z;A)*qJc.!_E7AH?jKS:N86
-Vb"MZ#-r&+iG@=5erV+e8)6@1RAaFb^cTu,1jsD!!1T4#E3<*BA,QV<,)`*WD_pD
-XY!RIaBDq9*U=%!!TK3>m=K#Wge$L[+ia2pP;u41:+DT#Q#j=TMcM<LV!*"0(V%'
-&k_j3NRgi4L/N$MmjYgFk?JV.9ZC=#@<p1d@&7OYL?POLrns8Y&=N-YVMa`f2:=K
-?Ee#kO_[)3?PjLSV5ClEn-'K$*Gf6]p]<JIBuP49HW0.?8rn0F]3NNlQOFgC+dQI
-Lgo+S<BP'BK`ac\Q@Se>\s&_Fs"BCC)UT0GID2-%R44,\ih%>)d?]#-&5D]"Mk2>
-`4R70Z%iF"]OTh71rX<.a"V0T4nc;[>IS[Ih&_AKa"8$$47!U&8j':beLKu&eqNn
-S#TLqS5O]48Tb:>7rji*,;4YT*I!M`(R_D`I!\)p]):!RV+W;-U<F06;e&^Y"+(*
->a!`i;Bjbg%,q/cn8ouZ,3b[9O@D:ReTbr9dSi!BS*(PWnUaKcD9.mh43A/LT5aZ
-@>Toh]RAfST=3o<SE[)l#s4!_c*X3#XDL=5B_-Y8u<i/]Q[1mLrV4)H#2]Ek:m9L
-2[Bia)u0[-=AC`DL\lSk3WG,n2`&,33#g+[Y0@i1>_I83K!>I]un2/d()8(p=lfM
-A$FS-0XZ/1@HN"Wab((E1W@&5d;8^#eXr&%AHENg*173'mN=CMV\ES<6T&OS=cU`
-2UbQfC6Wer;O!?OTaE)+<,S0W2EF9epXU(ZD%)#W5On:1pkblape`"+2?`eFS9WQ
-IG8@9(-8!-kM3F\]`4NIKD.7[EAcUs.gU))M-*\@\VGNh67o0Zfkn2$(!_u`@)dH
-NMH,a3YmiemnlNBVBLaL4k`5%"B9j%!lm9e-AEnT!;[aN<Q:bS9lT3F\FEr3p+"J
-I2?E%X9L>[O9sV'T.G+Z;C9X?2YD;oq<.!(M`:rr=.s)GOnb8%c&Job.i$J*<k=g
-nH6&,<:".`AqA$P?qhV^J1K,fb[C(p@s&jPQpc:6`3_Z9LRfD.93-_#9DCY"LsVs
-bt>YsOj(s1[a^T)()_6=g7.C4/tk^S?]ll5O_9D2?^AZF.W5^Sf2F,!(F9]X]:nd
-R!F":R\5'p3Ia9UC>*4c2G_Xt=`\f#I6i`II[rZu"f(!tD()3(RpaW7uAhkajfdU
-XPSAD[(Xfp,;+"P>UKdEeP9A,o?9jKBF04(e]*KlbTH%dEsn)\5HE!YeV6n`D:c,
-#;q8M[bi?_S&3EFO,%iXA\@>enm)N2@eu)9/Z_/g2ZT"JrQGg*p'!USq5fmYh)FZ
-F1mBXNb6u,j!gJPVn"jAYkJ]8XTqPBr7DlOf`$V',YKld\meUm8N+NQO:.,PbuDi
-`CAq`R&NqcpE+'b7bV`DP+YB@'@<'$Fg%G3_/aS)P+Zf/XdhPA)G56%6$g>W0WCD
-/=&gZm3N;PVLSSXP8#0Vnc^9lf5`r!af!dc[Ptm$0QtBSeY`F$>\6!bbFZG\]D=W
-o.dmbj\0+c=cq0JRDh+?P4E[B8[/Kl>":1_.*YSX^iKs.R:(Ucaa,,&5S;qa!Z,b
-d;@=p3)9-b79f%$CEJ_d4(eoZn8^K8Nu,.V<r?H"'S1d_]hY*X%-Hccj:e*YD<12
-\<#8Q+&<D3b5hDpj$_T\t@`^L0P"S7(t/1-6%2o9sog).LA_,MOJeO8KIg2Op%B<
-VnOGMTD&9bdP#*4"+(L;,iYjRQfDumW[sqPQX6.iC::-3<2SN'f0="-Z?=SMj\Lh
-Jm2I7;"XVl7&X.K8\rh*&LI#aRrrDWuGd>'i2>G;-W%EnHFEq+oa,f<K5c&L7_,E
-:u!@VsNdb,k`%&t>d!\JI(I@KN.CVfUE8uP'kQssoSkEC7UcmP-Qgmo43i7N`lDs
-)Ss(trH7RXHeX<"[J:SnFt=p-`bAr6+eiV:JHFFNe/E,USOe,Y]D3g9'4-/L/#tZ
-O8:$^*nn7a]HW"*n(bC-Sd,q@8:ViQX"bG4]&3U7,Jl%3Pp/+WDqSTK^4HgGr28K
-bKIC!4lmnDXno:)_r?OP3,ok3EjX#H#ptpUL<V69T@uhnV\Lq8*LPl@#*4RTNQKR
-%
-q=i!oVUVEEDabfiOABNSc0]?f"RQsn?:O5E0E1tO+EC(!IM?50nGA2eqAe84;mfj
-]QQH66JN'2Vd[pLWEo$pgpH::".4L+o4r,&@MXj:`rR$C1r*>%ipp\.up)U;7C+F
-1EaXOU$nl2tBgoVeVDfgmuiOSjG<T7Q0]("Sib\,"#UeMPqf&\:j>JT8P\@HeV8@
-?Fa8G6&L;`lHqlb7)4pY8X7.C3R_gPoU))?0]Ce@Cn'jT,VXd.=#=MjSKolqiZA`
-HQ?drNaN/+U^GeGo6-+'qGiol&ZCphe[UIo4D$N%!cWE9$`CX<VkIhpj-C\H73pE
-dd6*mY0[7$hBH36b.,-9Yn8EbEmp$_!%^WTh@UeDEcW6[,C%9"?0,\5NnVL5Bh;2
-lALgIT\Ub+kguT=gda01ir_.j4@B"B]EL0$c3k1=*5U,5G^^9>ih]8M]EP`_<>ao
-K/kQc+4dMq.j]#Ghl9WFdUS<]oW(K3;K;@6A<faC.56Bi0\TUaT[pBYb3XWh4P=\
-gm8TQPXX]S;Rg>/G_'>s4m&dpA0fgIk=38lArdmbru:%PYJRM)9K6rr?I>A4f*+>
-KSF#*h.%gL"Ku!b#B$JAWrHsc(m7He<m_$l,U.U%`>eBjW+I8Ka=u;!"dB&WM[%<
-?K0#RAm=("ej7M2k0;)akiUIPnF?fdC.qNZ`(h!)9Q<m'7\Z<].I_kAbt0mZ/_#c
-CTVSP6h$pQ)050[hSekgO$S^Yt*N>Cg>\LFBWM`(Lb9SL3"GEToP_*_@RgYUrqNr
-qI"3-`X?-ua4p(UgKDRLUb-@OUU?2C#@(bGlW!db^,X4o9$oFXRPh[a]fnUjsD!/
-Hb#MW.i5F%cb6-=?j^6!n#_OHc!59-kj,L:[]k?GHg^*RJT+8h$,@P?uU<Xe2<EV
-9%Wh(\M^lTV8-!cI\HCYA_bibQAcE%.HD="6'7[ULZuhR!!euWO8VHQu^rDd3**9
-F)Ie:8[d_$crj;GYd=b%WCc<9MN:5>_]\<l'Y'3&;,Wlggmk]C\KgBD>#&;sSU="
-hhU%X0=GMVg""]`7oe;8^R[a*![]WVsXn$)3]&i@>&M:GV.7e:^;U*]VYu1&[Jm&
-e[;RD-'JeSL#,K:'b99U6o<+5\*YDHR*is^9=8pRVj?^uV3#ReeuA0j2'>*K8Z&?
-Zdfb(GT@J].?GOI>sIEbW[Q=#n:DD62Oo,mkZV@^4jrg`l>O_b;iZ#]g0l$0l@Jf
-D4hY<b.J\AdYeAR>tOf)g&<lJ;])]%80>O0.trsBqtkTZjR#4$NN;>Zm3$r+.'b=
-,)=;'Si:V@$t3re22X)X[+qJTMp/\q.VWdnK&T^J(NXPl-!.iK)CHD</5>U`Vcf9
-^1@rplmPKDjk8ONi=Gq&UU]1<B0SNtl1*q"i:9`I(n=d^_O[hdEXEH[A@lM@d1Dd
-gmo.,D*`4YJD>W".@bKPKj1=LoO.bk=-e@#hRXo"gMTc(h$;5EFmDA"WL\6"A%$*
-b1Y6D/g!ZBDDuR'ao(UbNCe/f(@i,5)UXH<sa=1tXQM@"b<U!;C[B5U07dp*dlsV
-N3qrMK&Bc:!69%>@g_#Ybe6A<*,@0D08r_SYEM?-0ddTmo3P,$Hjj^rDOb<`et5C
-Z\JJ[l[D^r9#@m_SNj,ab'8oom;d2Yf.NW,%!:M$Z#]P;-^:6KF[oXakmSVXY<gh
-_$&-VPQ^gs1pl47D[]ftl%COu@N+1o(fs-I`Kd@KQPn,SN&.<gI,5jSjBG"Mj"f9
-canj4&ObA#+p'W$*qef/]lDrP9"Q;_I`Bali_&=g;$!0dk0CN]+h_blt"2WA=T8c
-f>e6J3&E#5X889uXSs&oNHRi5oB4<(K/J;r\Ti8,T-3p2QTh0OqIT;ADrqE1sKfO
-ggQ[:RKF5*eH7;S&^mU=c(ED`,*Z/iEW/!jNOGL^!]Z/Gbj!f>]l*#8BikJ.br7S
-aF/hBRC<`F'Ka6IGgj1M_jVQU4:ks7SO=lE*D:$,%Km>qlO3t;(9i3pD%&\&m0*h
-96m)U<0!K:c&VQNKKU>mG#sUBN!J7s,5XqtY#H(3[-38o["Eu6-$GbNfE*m]]&r>
-=4XH]X/lBCp3PNn/3e0Z.XfXR^MR.U+bB,d&P;_C&l9;$fRD/C=qRrF$?]\<K`aM
-mYu),<oJ,-(Nk8m8P/B$_U'g`]E'NC-RPVN=H!-sc0F^7B-$#*n?u`o--.7OCo02
-Ic<WkhN5=:LU&u,>Ci;:j'\V/Dq;j"/VYW>:eFh;K]CQVNTpOTlkCt(DkTcHhEEC
-<#!f4D^sJ2V+8%WDEkib1NTm#1Wr*rhG]CK\<Y^FW"Pb&PGkt0VqKnFgdnEOPWn^
-+O?T`Y#[$Z^[bl`QNQYrIaQmEn1TL2X>!1:W"VnON)*EWG^7rPi/&!V1@i8A3V^3
-ssr3H`2CB>9(k(SCNaNEb4[hRNs;A<=nEA&O[;K$?J_d7u-Z?s!*j]U/=;HdIoe=
-oprS-X'Q+,@%q1fU.8&`nr<)jNXKFkLKY;s+lbR=4HKd.9n=f1h+2A<8]-m-AR,\
-Pp#hV-$OP3LemE;KH]b4EOn*]Z655B117m;\$mjAo0h-\MVKT_$9U*Xd_rs\CN4T
-il.auM3=*7=2m"GX7Wgo\Jf_5:\$7oCFVsn\a"Kj)),%,JgMS3OBo7-&o/`SJ>!_
-sG!3[,"b]KWH;^&)_Prcn?a?^Lnqq%)P,Wn189INBOpE;ZmRQf[/Q4<j3M1DZDL$
-Z)dTfRZ<nIN7jEKo!r5?4'?]LaPp1"UiqdIKL6\mec8\"T5mPk#Q`70XSY^lQrAg
-m7#=4T4OJJPN?K%dXpqXf[k[PPqOaN7/qo8L8Cfe^c'Z[RG\-!'9,p\A):.hhA<5
-8n6>4_bBGj2U])ds10ee-)%SSP>YWn0oh]a9ieSg3&<c&GE>jX%\@QX=$,;b#N.S
-T#jO7Na!-4/q"8#FXV92ROEL0l->B#BZFhYd9J`%63Hhc1+OiZ'+J%Q$+7T.0lNr
-Z7fcQhpM<]&f3mmeJ,'*IKY@^sM=H8:8Lg8pGp-(,o$\_>N_??Yh0=*#KPC=:,7+
-onr\.\=6'*4^5sQ7l_@fRuhZe7[N*0GL_j!0=XRh9@)GaolFfV6,S2*gP!U.[SUF
-Ul,/OF0p'TQtE*P7*e(kk]4RWIP-7?T755!\l@nKj$-1DQq6bt;h@]_dCN'Cb`Da
-@0F@iI<(D=L&[UQNl8/$sB2HKP<W-i>to@da9Qk[3T)!+hd9oh),*n+"7P3`97F(
-D&jI2kse=F-J'P)Rs@<6VLi'uieK&t&:o1BZsu\uG%nqc)Ca7$DI\PLMs*P7;HRd
-1UR+^`!,Anah+%.Qr]ap!;U;kn)#jRMYk3`\8L\BG3fq_2Pm&9YJjBXUrG<EVZ`H
--q&>YDQl$U)^FTYR@)W.?.Z8d&`e$AS.k[gE"M?6Eo-nSRE=fW%Y_G8,3q8ERSi7
-U^k8)79Go>jc88QZ8\"+01=p?Hbq_t`[?2+8B^SNA<cq3=UG9dRiO3jRI=!D:/[=
-I\PjBs^Q)0P8ZYA`hiYE8=)X*4f-\V+00R7r%l4?p!?7+,@k62(mXcboFl(>]HPB
-W@5l^!.Z\$/[i]5d\rOK#?0^?Q1m,;DBu((ER(eM2$!%K]6D/*cNrbA*%rY_^1G6
-oi(WGIZ^?t#>r,\RC-0'<dE.[l;i[2BLG\?1Kf5^!(DbIpK6(pm\P,mMEt'EiUpT
-+^;+9rBgB4X<=62.H*L1p(F-9G&XXbNJ[K+U"am437?:0,arrA*dk%RDf<$Ygff%
-/$-@9fJ2iOt!3\ZdOIe=M7F.B'jC9Q^Vfgn/)^Y$q`g<R-pMhS]IPdpEU%RmEO4;
-NQ_jaqPVgd,&6,\A,6%"]<(7;\))=3*,%eKdL*@C_R0).rf!G4CPtr>Ge>,*29S`
-1J#J5AlQNGQ?tBn+/i)![_X=[TT7A%D@!c'-)O;%R[,@0E`@(]b5m_`^&H8IqmML
-$<EcOFQZc\KLLkM*?mKoa)@__e`'q+u;N\lud5Ka\]VCn'o3!4\_m4[2*fqbkD=g
-tk8uTOMm%jX].caJ7PXRIAP&>3`GCLQ8.5[Ka6CB[cm4s-.7VT2N5:lAoE<j<O+H
-N%-r,]`s?78C2R,tH]HZh`1@%p]b>MfA[i>J'$F^X)_h:$`'ThZj]CY%W*r+X4=X
-dOW-GXj9B@l^!Rr5I+^gTH'E!nKoWHutRN9K'>sDn:Lgl3UT8FE!VEc`i*Pq+$MN
-V-+:*Vg,nK]0mH6@rP07mZ+GOd#)h+Zs)Oq<GG($a]b4`8fE9sD]2sl35:Hkj3lB
-nL9BhJC?S;dU_K?`)Wh/7WThtg(KO8BL?'2bE+*PY?D3M.fb2(>Mi/<ge9't:#cB
-jh6Q:2OM-SIl5psV=+j0dRBAVb<7VUP!amcU*$+RHHR[<'"G$3<R5=1I#f<r_)N?
-:k1,8C->%CAPuijN"2Rt(Qrdc:H6eeT/5m2TgN<<8S(I'T)k`$OJ)R4^BT*L"uij
-/%]I8'8sAcI[q<#GG^WTlA^d'3(`+AGal1[]g:BPP/<6P'gcTZOLsj5;t3QHqqdD
-Qch-M&`tFg5*&WF5X<jCHL(*'M\1EL?`YGCU<C[$qp.koXR=6F9%(BV_!7,1*pXZ
-NH#)7\rJu\Z6G:D:*@!2OUX_5#J+F6+70t?\9"3F]@CZ%PeZj6aT0DO:_?o;-h>(
-_+M76Ctl&#XnWDHHVH&5*JDB*Z@'@t_QSss*9Gcp%o8tI,oAYm_rbqu\m/-D./b'
-MtB`&dKk:fJ[VqdfY+H,^]4"cD^LX=Q3Wf=E.>15=3#EEV^OdmN+'7&$[%]1[G=O
-:%5;UG)[s3hN\lbfmE72OJ>Ap=@h"ej"kkGD[BN.Ue4o9g)?rb;.FJ8@QLAnZ^j`
-/Fs/7fW4VHU3="g\%G/*+=&6?:/c4Q"cku'!VPP7"dF^C-kW0M@9bsXH@I4)QifU
-Z/Z"3+,!J`nWJo!M=#[@7(%<g<&h!LFRM_QVE>%Xgjdo/c@#YAj#?tH43Y4/0`9a
-WZST_+^b:P3:&>_/"SA22OX/UQB_lf<<#SD0O\@:sJ>I9=07;bF\M4$C\W0D/6X:
-D`SlU`$+f"Zl=CK"6g6N7$@M_9]W.7e/H-.7P]"gp9,CeaQ33^A66d@RM$L749+G
-"XgS8nTF9Mnl^Sb?KLj+Jg;\#uLr26#.F,>`KarQ+qacPUVj?.`ra:Q^Vs[Yfnb>
-Df'UhJH?1J91(\nfjU(_"@u*1\Je[G4d[Xo-mch)\[K8Beff#J7HRc2MCY]l#[UN
->i%#-;r)n`(#55:3^N9_mYt7R,PBB;+Et`>+WL%A+V<#4n3EEGgXS+)%bQ0W4"1p
-jpBQUm[7AWP0WAN%[S:sT]K&P3k5$'e-!X*[<o1P3>IhcY!j#X3@Q'"2kiIiH7bH
-TRrHJ?jkEWXdI)hDdHJH@n&H;?'RahK#oS/0a+,:F[mCT+_/UdF'tG$:Q!>7CS!'
-:-n'c*+C[qNqg=VELZD&q&)#GNM$a7[_%@RNiJ'UfJDXj,Gg^AR<>:Y;%)B+!Ugi
-:FTTsRHUot_H)Wt9h\=-[k0"5C$4$A:OieS^0;Z0O^aNK90.UUT0`lN.MfaiVo.t
-S!\mm7)E?m5[P42:S7Ybf8sq,);gFm&FbBqen>Pa=&CTiIcT5f4fgTJ`RrEtd=Gr
-*5ocS)Q">"*(DeE'%Znd<2oHd-NTG!nrD*BSLkA0I5TqH:?RZ!Ah:5=Hr/M43u+]
-fp7!YsCmdbF%d:Il$@g<^M?5um,%<@TDe;f_](5XN],ej@J&mbH[m\C_2TY0cTHL
-(r5J\'^S??f)hQk:+D;'(++=8h>>/K3R60TKn0UAt:8>_+V)FR<;AANA3>eM$K9P
-$&='`W2/'rD5+4B@!]c(Un9AYX53T2]T^MF;G]p9:ep(RklM!0[eSL?=rFohNB!^
-LeSn&(]>=[V&BX,mO8ml~>
-%%EOF
diff --git a/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.pdf b/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.pdf
deleted file mode 100644
index 5455f6d9b38..00000000000
--- a/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.pdf
+++ /dev/null
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.tex b/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.tex
deleted file mode 100644
index bbab17d1c81..00000000000
--- a/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.tex
+++ /dev/null
@@ -1,2057 +0,0 @@
-%\documentclass[headinclude,DIV12]{scrartcl}
-\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings,
- headexclude,footexclude,oneside]{pst-doc}
-
-\usepackage[latin1]{inputenc}
-%
-\usepackage{pst-func}
-\usepackage{pst-optexp}
-\let\verPstOptExp\fileversion
-\let\datePstOptExp\filedate
-\usepackage{pst-circ}
-\usepackage{nicefrac}
-\usepackage{longtable}
-\usepackage{multicol}
-\usepackage{multirow}
-\usepackage{float}
-%
-\newfloat{LTXexampleFloat}{H}{expl}
-\floatname{LTXexampleFloat}{Listing}
-%
-% New commands
-%
-\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
-\newcommand{\OptExpPackage}{\textsf{`pst-optexp'}}
-\newcommand{\parameter}[1]{\texttt{#1}}
-\newcommand{\nodename}[1]{\emph{#1}}
-\newcommand{\param}[1]{\normalfont\texttt{#1}}
-\newcommand{\paramvalue}[1]{\texttt{#1}}
-\newcommand{\defaultparam}[1]{\emph{default:} \paramvalue{#1}}
-\newcommand{\paramitem}[3]{\item[\param{#1}:] \paramvalue{#2} (\defaultparam{#3})}
-\newcommand{\styleitem}[2]{\item[\param{#1}:] \paramvalue{#2}}
-\newcommand{\styleshape}[1]{\texttt{#1}}
-\newcolumntype{T}{>{\ttfamily}l}
-\newcolumntype{B}{>{\bfseries}l}
-\newcommand{\refstringexplanation}[0]{%
- A \paramvalue{<ref string>} is any combination of \paramvalue{c}
- (center), \paramvalue{t} (top), \paramvalue{b} (bottom), \paramvalue{l}
- (left), \paramvalue{r} (right)}
-%
-% Settings
-%\setkomafont{sectioning}{\normalfont\normalcolor\bfseries}
-%
-\makeatletter
-\renewenvironment{description}
- {\list{}{\labelwidth\z@ \itemindent-0.5\leftmargin
- \itemsep0pt \parsep0pt
- \let\makelabel\descriptionlabel}}
- {\endlist}
-\makeatother
-%
-%\clearscrheadfoot
-%\setheadsepline{0.4pt}
-%\ihead{\OptExpPackage}\ohead{A PSTricks package to draw optical experimental setups}
-%\ofoot{\pagemark}
-%\pagestyle{scrheadings}
-
-\psset{usefiberstyle=true}
-\addtopsstyle{Fiber}{linecolor=red,linewidth=1.5\pslinewidth}
-\addtopsstyle{Beam}{linewidth=1.5\pslinewidth}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\begin{document}\title{\texttt{pstricks-add}\\additionals Macros for \texttt{pstricks}%
-%\thanks{%
-% This document was written with \texttt{Kile: 1.7 (Qt: 3.1.1; KDE: 3.3;}
-% \url{http://sourceforge.net/projects/kile/}) and the PDF output
-% was build with VTeX/Free (\url{http://www.micropress-inc.com/linux})}
-\\
- \small v.\verPstOptExp}
- \title{\texttt{pst-optexp}\\ A PSTricks package to draw optical experimental setups}
- \author{Christoph Bersch}
- \date{\datePstOptExp}
-\maketitle
-
-\clearpage
-\tableofcontents
-\clearpage
-
-\section{Introduction}
-The package \nxLPack{pst-optexp} is a collection of optical components
-that facilitate easy sketching of optical experimental
-setups. Mechanisms for proper alignment of different components are
-provided internally. This way the user does not have to care for proper
-orientation of the elements. Macros for convenient definition of new
-user-defined components are also provided.
-
-\section{Concept and General Behavior}\label{sec:general}
-
-This section introduces into the basic concepts of the package design and
-explains the parameters and commands which are supported by most optical
-objects.
-
-\subsection{Concept}
-
-The objects provided by \nxLPack{pst-optexp} can be differentiated into
-two different categories: free-ray and fiber-optical objects.
-
-The free-ray units are subdivided in two different kinds: dipoles which
-require two reference points for alignment and do not alter the
-direction of passing light beams (e.g. lenses and retardation plates)
-and tripoles which work in reflection and require three reference points
-(mirrors, gratings, beamsplitters etc.).
-
-For free-ray setups one usually has a few straight light paths in which
-several different objects are to be arranged. In this case it is very
-convenient to define only two nodes for each light path. The objects are
-placed on this light path using the different positioning parameters
-(see Sec.~\ref{sec:positioning}) of the package. After having arranged
-everything, the beams themselves are drawn. If objects with multiple
-internal reflections (e.g. prisms, see Sections \ref{sec:doveprism},
-\ref{sec:prism} -- \ref{sec:ppprism}) or objects without internal beams
-(e.g. optical diodes, see Sec.~\ref{sec:optdiode}) are involved. The
-different possibilities are explained in Sec.~\ref{sec:connecting}.
-
-The fiber-optical objects can be classified as dipoles, tripoles and
-quadrupoles which have a corresponding number of fiber
-connections. Their handling differs in some aspects from the free-ray
-objects. The fiber optics are directly connected to the reference
-nodes. Every input and output fiber can be flexibly customized for each
-object (see Sec.~\ref{sec:styles}). Positioning of the fiber dipoles is
-handled equivalently to the free-ray dipoles. Tripoles and quadrupoles
-can be found only as different coupler types. Their positioning
-mechanisms are a bit more involved and explained in
-Sec.~\ref{sec:coupler}.
-
-Some hybrid dipoles (optbox, detector etc.) can be used both as
-fiber-optical or free-ray elements. The way they are treated regarding
-the connections to the reference points can be controlled by the
-parameters explained in Sec.~\ref{sec:connecting}.
-
-\subsection{General Settings}
-
-\begin{description}
-\paramitem{angle}{<degree>}{0}
-\paramitem{compshift}{<num>}{0}
-\paramitem{optional}{<boolean>}{false}
-\paramitem{showoptdots}{<boolean>}{false}
-
-\end{description}
-
-\parameter{optional} can be used with every object and marks it as
-optional. The style of an optional element can be configured by changing
-the psstyle \styleshape{OptionalStyle}.
-
-\parameter{showoptdots} draws some internal nodes which are used to
-place the object and the label. The black points are used for
-positioning, the red points mark the label references.
-
-\medskip
-
-\begin{LTXexample}[pos=t, vsep=0.8cm]
-\begin{pspicture}[showgrid=true](8,2)
-\psset{beam}
-\lens[optional](0,1)(3,1){L}
-\mirror[showoptdots](4,1)(7,1)(7,0){mirror}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Using PSStyles}\label{sec:styles}
-
-\begin{description}
-\styleitem{OptionalStyle}{<psstyle>}
-\paramitem{addtoOptComp}{<psstyle>}{}
-\paramitem{newOptComp}{<psstyle>}{}
-\styleitem{OptComp}{<psstyle>}
-\end{description}
-
-\styleshape{OptComp} affects only the appearence of the optical
-components. This was introduced, because using only the standard
-graphics parameters changes also the connections that are drawn within
-the component.
-
-\medskip
-
-\begin{LTXexample}[pos=t, vsep=0.8cm]
-\begin{pspicture}[showgrid=true](8,2)
- \psset{beam}
- \addtopsstyle{OptComp}{linestyle=dashed, dash=2pt 2pt}
- % wrong, also beam width is changed
- \mirror[linewidth=3\pslinewidth](0,1)(3,1)(3,0){mirror}
- % correct result
- \mirror[addtoOptComp={linewidth=3\pslinewidth}](5,1)(7,1)(7,0){mirror}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Positioning}\label{sec:positioning}
-
-\begin{description}
-\paramitem{position}{<num>}{\{\}}
-\paramitem{abspos}{<num>}{\{\}}
-\end{description}
-
-\noindent\parameter{position} is equivalent to the \parameter{npos}
-parameter of \cs{ncput} (can be any number from 0 to 1) and controls the
-relative position of object between the two reference points. It is only
-not available for the free-ray tripoles.
-
-The parameter \parameter{abspos} allows absolute positioning between the
-two reference nodes. Its value is given in psunits.
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \lens[beam, position=0.8](0,1.2)(3,1.2){L}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \lens[beam, abspos=1](0,1.2)(3,1.2){L}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Labels}\label{sec:labels}
-
-\begin{description}
-\paramitem{labeloffset}{<num>}{0.8}
-\paramitem{labelangle}{<num>}{0}
-\paramitem{labelstyle}{<macro>}{\cs{small}}
-\paramitem{labelalign}{<ref string>\footnote{\refstringexplanation}}{c}
-\paramitem{labelref}{relative|relgrav|global}{relgrav}
-\paramitem{label}{<offset> <angle> <ref string> <labelref>}{}
-\end{description}
-
-\noindent\parameter{labeloffset} specifies the offset from the label
-reference node of the object which is mostly the center.
-\parameter{labelstyle} defines the textstyle that is used to typeset
-the label and \parameter{labelalign} corresponds to the refpoint of
-\cs{rput}. The parameter \parameter{labelref} sets the reference
-coordinate system for the \parameter{labelangle} and the orientation of
-the label text. The detailed behaviour is best illustrated looking at
-the following three examples.
-
-\medskip
-
-\begin{LTXexample}[width=5cm]
-\begin{pspicture}(-2,-2)(2.5,2)
- \multido{\i=0+45}{8}{%
- \optbox[endbox,
- labelref=relative,
- labeloffset=0,
- optboxwidth=1,
- optboxheight=0.6](0,0)(1;\i){\i}
- }
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=5cm]
-\begin{pspicture}(-2,-2)(2.5,2)
- \multido{\i=0+72}{5}{%
- \optbox[endbox,
- labelref=relgrav,
- optboxwidth=1,
- optboxheight=0.6](0,0)(1;\i){\i}
- }
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=5cm]
-\begin{pspicture}(-2,-2)(2.5,2)
- \multido{\i=0+72}{5}{%
- \optbox[endbox,
- labelref=global,
- optboxwidth=1,
- optboxheight=0.6](0,0)(1;\i){\i}
- }
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\parameter{label} simplifies the simultaneous change of more than one label-related parameter. It takes up to four space-separated arguments. Unchanged arguments may be specified with a dot.
-
-\medskip
-
-\begin{LTXexample}[width=5cm]
- \begin{pspicture}[showgrid=true](0,0)(3,3)
- \psset{endbox, beam}
- \optbox[label=1 -45](1,0)(2,1){label}
- \optbox[label=0 . . relative](0.6,0.6)(0.6,1.6){label}
- \end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Named Objects}\label{sec:namedobj}
-
-\begin{description}
- \paramitem{compname}{<string>}{\{\}}
-\end{description}
-
-\noindent Every \nxLPack{pst-optexp} object of an experimental setup can
-be assigned a name that is unique within one pspicture environment. The
-name is defined with the parameter \parameter{compname} which is
-defineable only directly within a \nxLPack{pst-optexp} object: \medskip
-
-\begin{lstlisting}
-\optbox[compname=MyBox](A)(B){Box} % valid use of 'compname'
-\psset{compname=MyName} % not valid, gives an error
-\end{lstlisting}
-
-\medskip
-
-\noindent With this naming mechanisms one can access some special nodes of the
-component at any time after its definition:
-
-\begin{table}[H]
- \centering
- \addtolength{\extrarowheight}{1.5mm}
- \begin{tabularx}{.8\linewidth}{TX}
- \toprule
- \multicolumn{1}{l}{node name} & description\\
- \midrule
- <compname>ExtNode & Node for external connections (\emph{external node})\\
- <compname>Intern1 & Node which should be connected to the first reference node.
- In the text we refer to this node as \emph{left outer node} \\
- <compname>Intern2 & First internal node. As the nodes with higher numbers it
- is only available for objects with multiple internal beams (e.g. dove prism,
- see Sec.~\ref{sec:doveprism}). They are called \emph{internal nodes}.\\
- \multicolumn{1}{c}{\vdots} & \\
- <compname>InternN & Node which should be connected to the second reference node.
- In the text this node is referred to as \emph{right outer node}\\
- \bottomrule
- \end{tabularx}
- \caption{Naming conventions for special nodes which are created by named objects and can be
- accessed by the user after definition of the object.}
-\end{table}
-
-If \parameter{compname} is empty, the external node has the name
-\nodename{ExtNode} and will be overwritten by any following object. The
-outer nodes are not accessible to the user and will also be overwritten
-by following object. The internal nodes are deleted after the object's
-definition.
-
-These named objects are used to create permanent external nodes (see
-Sec.~\ref{sec:extnode}) and to connect objects after their definition
-(see Sec.~\ref{sec:connecting}).
-
-
-\subsection{Nodes For External Usage}\label{sec:extnode}
-
-\begin{description}
-\paramitem{extnode}{<ref string>\footnote{\refstringexplanation}}{\{\}}
-\end{description}
-
-\noindent Some of the objects can provide a supplementary node for additional
-connections. A laser diode may be connected for example to a frequency synthesizer
-(use package \nxLPack{pst-circ}) or a detector to a computer.
-
-\parameter{extnode} controls the position of the additional node and
-takes a \paramvalue{<ref string>} as its argument. By default this
-parameter is empty (\paramvalue{\{\}}) and no node is created.
-
-The name of the new node depends on the \parameter{compname} parameter
-(see Sec.~\ref{sec:namedobj} for naming conventions). If \parameter{compname} is empty
-the new node is named \nodename{ExtNode} by default and overwritten by
-following objects.
-
-Table.~\ref{tab:nodes} shows all objects which provide an external
-node. Some allow any possible \paramvalue{<ref string>} for \parameter{extnode}, others have
-only one reasonable possibility (e.g. piezo mirror, see
-Sec.~\ref{sec:mirror}) which does not depend on the actual value of \parameter{extnode}.
-
-\bigskip
-
-\begin{LTXexample}[pos=t, vsep=8mm]
-\begin{pspicture}[showgrid=true](11,3)
- \psset{conn=o-o, labelangle=-90, labeloffset=0.3}
- \optbox[extnode=tl](0,2.5)(3,2.5){\texttt{tl}}\psdot(ExtNode)
- \optbox[extnode=l](0,1.5)(3,1.5){\texttt{l}}\psdot(ExtNode)
- \optbox[extnode=bl](0,0.5)(3,0.5){\texttt{bl}}\psdot(ExtNode)
- \optbox[extnode=t](4,2.5)(7,2.5){\texttt{t}}\psdot(ExtNode)
- \optbox[extnode=c](4,1.5)(7,1.5){\texttt{c}}\psdot(ExtNode)
- \optbox[extnode=b](4,0.5)(7,0.5){\texttt{b}}\psdot(ExtNode)
- \optbox[extnode=tr](8,2.5)(11,2.5){\texttt{tr}}\psdot(ExtNode)
- \optbox[extnode=r](8,1.5)(11,1.5){\texttt{r}}\psdot(ExtNode)
- \optbox[extnode=br](8,0.5)(11,0.5){\texttt{br}}\psdot(ExtNode)
-\end{pspicture}
-\end{LTXexample}
-
-\begin{table}[H]
-\centering
- \begin{tabular}{llc}
- \toprule
- Object & possible extnode positions &\\
- \midrule
- %
- \cs{optbox} &
- all (any combination of \paramvalue{t}, \paramvalue{r}, \paramvalue{l} and \paramvalue{b}) &
- \begin{pspicture}[shift=-0.3](0,-0.4)(1,0.4)
- \psframe(0,-0.25)(1,0.25)
- \psdot(0,-0.25)\psdot(0.5,-0.25)\psdot(1,-0.25)
- \psdot(0,0)\psdot(0.5,0)\psdot(1,0)
- \psdot(0,0.25)\psdot(0.5,0.25)\psdot(1,0.25)
- \end{pspicture}\\
- %
- \cs{mirror} &
- one fixed position (only for \parameter{mirrortype=piezo}) &
- \begin{pspicture}[shift=-0.3](1,0.8)
- \mirror[mirrortype=piezo,extnode=t](0,0.4)(0.5,0.4)(0.5,0){}\psdot(ExtNode)
- \end{pspicture}\\
- %
- \cs{optdetector} &
- one (for \parameter{dettype=round}) &
- \begin{pspicture}[shift=-0.3](1,0.8)
- \optdetector[detsize=0.6, extnode=r](0,0.4)(0.5,0.4){}
- \psdot(ExtNode)
- \end{pspicture}\\
- %
- & all (for \parameter{dettype=diode})& see \cs{optbox}\\
- \cs{optmzm} & all& see \cs{optbox}\\
- \cs{optfilter} & all & see \cs{optbox}\\
- \cs{optswitch} & all & see \cs{optbox}\\
- \cs{fiberdelayline} & all & see \cs{optbox}\\
- \bottomrule
- \end{tabular}
- \caption{The objects which may provide an external node when parameter
- \parameter{extnode} is not empty. Some allow different positions of the
- node and for some only a fixed node makes sense.}\label{tab:nodes}
-\end{table}
-
-\subsection{Connecting Objects}\label{sec:connecting}
-
-\begin{description}
-\paramitem{conn}{<conn definition>}{-}
-\item[\param{fiber}:] alias for \parameter{conn=f-f}
-\item[\param{beam}:] alias for \parameter{conn=o-i}
-\paramitem{connjoin}{<int>}{1}
-\end{description}
-
-\noindent Simple experimental setups with a few objects can usually be
-realized by defining some nodes, arranging the object in between and
-drawing the beams at the end. If, however, objects with changed internal
-optical path (all the prisms) or without visible internal beam (optical
-diode) are involved, this simple method is not applicable anymore.
-
-For this case several different possibilities of connecting objects are
-available: \parameter{conn} specifies the kind of connections in front of and
-behind the object. Its syntax is analogous to the PSTricks
-\parameter{arrows} parameter. By default it is set to \paramvalue{-} and no
-connections are drawn. Tab.~\ref{tab:conn} lists all possible values and
-their scope for the \paramvalue{<conn definition>}.
-
-\begin{table}\centering
-\addtolength{\extrarowheight}{1.5mm}
-\begin{tabularx}{0.9\textwidth}{TXl}
- \toprule
- \multicolumn{1}{l}{conn style} & description & scope\\
- \midrule
- i & Draw beam from the first reference node to its assigned outer node
- and then through all internal nodes and end at the other
- outer node. & \multirow{3}{*}{optexp objects}\\
- o & Draw beam from the first reference node to its assigned outer node. & \\
- f & Draw fiber from the first reference node to its assigned outer node. & \\
- \midrule
- a & Left outer node & \multirow{4}{*}{\cs{drawbeam} macro}\\
- A & Connect left outer node to all internal nodes and then to the right outer node & \\
- b & Right outer node & \\
- B & Connect right outer node to all internal nodes and then to the left outer node & \\
- \bottomrule
-\end{tabularx}
-\caption{All possible values for the \paramvalue{<conn definition>}, their detailed description and scope.}\label{tab:conn}
-\end{table}
-
-The first letter (before the dash) in the \paramvalue{<conn definition>}
-refers to which object node the first reference node should be connected
-to, the second letter (after the dash) affects the connection from the
-object to the second reference node. Tab.~\ref{tab:conn} lists all
-possibilities for \parameter{conn} within an object: \paramvalue{f} draws
-a fiber connection and \paramvalue{o} a beam connection to the
-appropriate outer node. \paramvalue{i} draws a beam connection to the
-appropriate outer node and then through all internal nodes and end at
-the other outer node. The boolean parameter \parameter{beam} is an alias
-for \parameter{conn=o-i}. The beam style is controlled by the
-psstyle \styleshape{Beam} which can be changed
-using \cs{newpsstyle} and \cs{addtopsstyle}.
-
-All fiber-optical units define \parameter{conn=f-f} which means that
-input and output connections are \paramvalue{f}ibers. The boolean
-parameter \parameter{fiber} is an alias for \parameter{conn=f-f}. The
-fiber connection style can be changed by adapting the \styleshape{Fiber*}
-styles (see Sec.~\ref{sec:fiberstyles}).
-
-The way how to really use this kind of connections should become more
-clear after looking at the following examples in this section.
-
-\medskip
-
-\begin{LTXexample}[width=4.5cm]
-\begin{pspicture}[showgrid=true](4,5)
- \addtopsstyle{Beam}{arrows=->, arrowscale=1.5}
- \psset{labeloffset=0}
- \doveprism[conn=o-](0,4.5)(4,4.5){\texttt{o-}}
- \doveprism[conn=i-](0,3.5)(4,3.5){\texttt{i-}}
- \doveprism[conn=-o](0,2.5)(4,2.5){\texttt{-o}}
- \doveprism[conn=-i](0,1.5)(4,1.5){\texttt{-i}}
- \optbox[conn=-f](0,0.5)(4,0.5){\texttt{-f}}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-The following example shows how this \parameter{conn} parameter can be used in some kinds
-of experimental setups using objects with changed internal optical path (here a
-penta prism). Instead of drawing the beam at the end with a \cs{psline},
-the beams are created at definition time of the respective object.
-
-\begin{LTXexampleFloat}
-\begin{LTXexample}[width=4.5cm]
-\begin{pspicture}[showgrid=true](4,5)
- \pnode(1,1){A}\pnode(1,4){G}\pnode(3,4){B}
- \optbox[endbox, labelref=relative, labeloffset=0, optboxwidth=1](G)(A){Laser}
- \lens[lens=0.5 0.5 0.5, abspos=0.3](A)(G){}
- \pinhole[abspos=0.5](A)(G){}
- \lens[lens=2, abspos=0.8](A)(G){}
- \lens[abspos=2, labelangle=180](A)(G){L}
- \optplate[abspos=1.5, labeloffset=1](A)(G){SLM}
- \lens[abspos=1](G)(B){L}
- \optbox[endbox, labeloffset=0, optboxwidth=1](G)(B){CCD}
- \pentaprism[beam, labeloffset=1](A)(G)(B){PP}
-\end{pspicture}
-\end{LTXexample}
-\caption{Code example on how to use the \parameter{conn} parameter in experimental setups.}\label{lst:conn}
-\end{LTXexampleFloat}
-
-This method works unless objects without internal beams (e.g. an optical
-diode, Sec.~\ref{sec:optdiode}) or with internal reflections (e.g. a
-Dove prism, Sec.~\ref{sec:doveprism}) are used in the straight light
-paths of the setup. One possibility would be to create additional nodes,
-but this may be not very comfortable. Therefore, \nxLPack{pst-optexp}
-provides a macro \cs{drawbeam} which connects a named object
-(Sec.~\ref{sec:namedobj}) to another named object or a node.
-
-\medskip
-
-\begin{lstlisting}
-\drawbeam[conn=...]{<from>}{<to>}
-\end{lstlisting}
-
-\medskip
-
-\noindent If \paramvalue{<from>} or \paramvalue{<to>} is a node, it must be written
-including the round braces. The call
-
-\medskip
-
-\begin{lstlisting}
-\drawbeam{Obj}{(1;45)}
-\end{lstlisting}
-
-\medskip\noindent connects the named object \nodename{Obj} to the node.
-
-The type of beam connection which \cs{drawbeam} draws is again
-controlled by the parameter \parameter{conn}. Almost every optical
-object does not have distinguished inputs and outputs and can be used in
-either directions. Therefore, it does not make sense to speak about
-`input` and `output` when referring to the object nodes, but rather
-about node A (\nodename{left outer node}) and node B (\nodename{right outer
- node}). Consequently, the two letters of parameter \parameter{conn}
-can take the values \paramvalue{a}, \paramvalue{A}, \paramvalue{b}
-or \paramvalue{B} when used together with \cs{drawbeam}. The detailed
-descriptions of the individual possibilities are listed in
-Tab.~\ref{tab:conn}. The letter before the dash in \parameter{conn}
-refers to the \paramvalue{<from>} object, the other one to
-the \paramvalue{<to>} object. Again, the next examples should clearify
-how to apply the \cs{drawbeam} macro together with the
-different \parameter{conn} settings.
-
-\begin{LTXexampleFloat}
- \begin{LTXexample}[width=4.5cm]
- \begin{pspicture}[showgrid=true](4,6) \psset{labeloffset=0.6}
- \addtopsstyle{Beam}{arrows=->, arrowscale=1.5}
- \doveprism[compname=Dove1](0,0.8)(3,0.8){Dove1}
- \drawbeam[conn=b-]{Dove1}{(3,0.8)}
- \doveprism[compname=Dove2](0,2.3)(3,2.3){Dove2}
- \drawbeam[conn=B-]{Dove2}{(3,2.3)}
- \doveprism[compname=Dove3](0,3.8)(3,3.8){Dove3}
- \drawbeam[conn=-a]{(0,3.8)}{Dove3}
- \doveprism[compname=Dove4](0,5.3)(3,5.3){Dove4}
- \drawbeam[conn=-A]{(0,5.3)}{Dove4}
- \end{pspicture}
- \end{LTXexample}
-\end{LTXexampleFloat}
-
-With the help of the \cs{drawbeam} macro we can adapt
-Listing~\ref{lst:conn} to use an optical diode before the beam clearing
-and connect it to the other components. In order to illustrate the beams
-that are drawn by the different mechanisms, they are colorcoded in the
-resulting Listing~\ref{lst:conn2}: \emph{green} is the direct connecting
-of the optical diode, \emph{red} is the \cs{drawbeam} connection and
-\emph{blue} the direct connecting of the penta prism.
-
-\begin{LTXexampleFloat}
-\begin{LTXexample}[width=4.5cm]
-\begin{pspicture}[showgrid=true](4,6)
- \pnode(1,1){A}\pnode(1,5){G}\pnode(3,5){B}
- \optbox[endbox, labelref=relative, labeloffset=0, optboxwidth=1](G)(A){Laser}
- \lens[lens=0.5 0.5 0.5, abspos=1.5](A)(G){}
- \pinhole[abspos=1.7](A)(G){}
- \lens[lens=2, abspos=2](A)(G){}
- \lens[abspos=3, labelangle=180](A)(G){L}
- \optplate[abspos=2.5, labeloffset=1](A)(G){SLM}
- \lens[abspos=1](G)(B){L}
- \optbox[endbox, labeloffset=0, optboxwidth=1](G)(B){CCD}
- \optdiode[abspos=0.8, conn=o-, compname=OD](A)(G){OD}
- \addtopsstyle{Beam}{linecolor=blue}
- \pentaprism[conn=-i, labeloffset=1, compname=PP](A)(G)(B){PP}
- \addtopsstyle{Beam}{linecolor=red}
- \drawbeam[conn=b-a]{OD}{PP}
-\end{pspicture}
-\end{LTXexample}
-\caption{More soffisticated code example which employs both connecting
- methods. The beam connections are colorcoded: \emph{green} is the
- direct connecting of the optical diode, \emph{red} is the
- \cs{drawbeam} connection and \emph{blue} the direct connecting of the
- penta prism.}\label{lst:conn2}
-\end{LTXexampleFloat}
-
-\newpage
-
-\section{Free-Ray Objects}
-
-The general appearance of all objects can be customized using the
-standard PSTricks parameter like \parameter{linewidth}
-or \parameter{fillstyle}. Some components allow changing a special part
-(e.g. for a piezo mirror) for which they use certain psstyles. For the
-automatic beam connections the \styleshape{Beam} style is used.
-
-\subsection{Lens}\label{sec:lens}
-
-\begin{description}
-\paramitem{lensheight}{<num>}{1}
-\paramitem{lenswidth}{<num>}{0.2}
-\paramitem{lensradius}{<num> [<num>]}{\{\}}
-\paramitem{lensradiusleft}{<num>}{1}
-\paramitem{lensradiusright}{<num>}{1}
-\paramitem{lens}{<num> [<num> [<num> [<num>]]]}{\{\}}
-\paramitem{thicklens}{<boolean>}{false}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=5.5cm]
-\begin{pspicture}[showgrid=true](5,6)
- % concave lenses
- \pnode(0,5){A}\pnode(5,5){B}
- \psline[style=Beam](A)(B)
- \lens[position=0.2](A)(B){L}
- \lens[lensradius=-1,position=0.5](A)(B){L}
- \lens[lens=-1.5 1,position=0.7](A)(B){L}
- % convex lenses
- \pnode(0,3){A}\pnode(5,3){B}
- \psline[style=Beam](A)(B)
- \lens[position=0.2,lens=1 -1](A)(B){L}
- \lens[lens=0 -1](A)(B){L}
- \lens[lens=1 0,position=0.7](A)(B){L}
- % thick lenses
- \pnode(0,1){A}\pnode(5,1){B}
- \psline[style=Beam](A)(B)
- \lens[position=0.3, lens=-1.5 1 1 0.5, thicklens](A)(B){thicklens}
- \lens[lens=0 -1, position=0.7, fillstyle=solid, fillcolor=blue!30!white](A)(B){lens}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-The shape of a lens is defined by its two surface radii. A negative
-radius gives a concave, a positive radius a convex and a radius of
-\texttt{0} a plain surface. The parameters \parameter{lensradiusleft}
-and \parameter{lensradiusright} allow to define independent values for
-both surfaces. \parameter{lensradius} sets both curvatures to the same
-value. Usually only \parameter{lensheight} and the two radii are used to
-construct the lens. The thickness (or width) is determined
-automatically. Manually controlling the thickness of the lens can be
-achived by setting \parameter{thicklens}
-to \paramvalue{true}. Then \parameter{lenswidth} is used as width of the
-lens at its waist. Finally, the parameter \parameter{lens} allows the
-definition of all relevant lens parameters at once. It consists of one
-up to four space-separated numbers. The first one gives the left
-radius. If no further value is set, the right radius will be set to the
-same value and all other parameters are left unchanged. Using two
-numbers defines two different radii. The third optional value defines
-the \parameter{lensheight} and the fourth one the \parameter{lenswidth}
-which is use only if \parameter{thicklens} is set to \parameter{true}.
-
-\textbf{Compatibility:} The whole implementation of the lens was
-changed in version 1.2. It allows a much more flexible definition of different lens
-types. However, I could not get full compatibility with the older way to
-define lens using only \parameter{lensheight} and \parameter{lenswidth}. To use
-this old behaviour, you have to set the \parameter{lenstype} explicitly, but
-then you have no access to the new features! All users are encouraged to
-adapt their code to use the new parameters, as the old code will be
-removed in future versions.
-
-\medskip
-\subsection{Optical Plate}
-
-\begin{description}
-\paramitem{plateheight}{<num>}{1}
-\paramitem{platelinewidth}{<num>}{2\cs{pslinewidth}}
-\paramitem{angle}{<degree>}{0}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optplate[beam](0,1.2)(3,1.2){filter}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optplate[angle=10, beam](0,1.2)(3,1.2){glass plate}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Retardation Plate}
-
-\begin{description}
-\paramitem{plateheight}{<num>}{1}
-\paramitem{platewidth}{<num>}{0.1}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \pnode(0,1.2){A}
- \pnode(3,1.2){B}
- \optretplate[beam](A)(B){$\nicefrac{\lambda}{2}$}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Pinhole}
-
-\begin{description}
-\paramitem{outerheight}{<num>}{1}
-\paramitem{innerheight}{<num>}{0.1}
-\paramitem{phlinewidth}{<num>}{2\cs{pslinewidth}}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \pnode(0,1.2){A}
- \pnode(3,1.2){B}
- \pinhole[beam](A)(B){PH}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Crystal}\label{sec:crystal}
-
-\begin{description}
-\paramitem{crystalwidth}{<num>}{1.4}
-\paramitem{crystalheight}{<num>}{0.6}
-\paramitem{caxislength}{<num>}{0.6}
-\paramitem{caxisinv}{<boolean>}{false}
-\paramitem{voltage}{<boolean>}{false}
-\paramitem{lamp}{<boolean>}{false}
-\paramitem{lampscale}{<num>}{0.3}
-\paramitem{angle}{<degree>}{0}
-\paramitem{rotateref}{<ref string>}{c}
-\end{description}
-
-\noindent For a discussion of the \parameter{angle} and \parameter{rotateref}
-parameters see Sec.~\ref{sec:box} about boxes. \medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \pnode(0,1.2){A}
- \pnode(3,1.2){B}
- \crystal[fillstyle=solid, fillcolor=yellow!90!black, labelangle=-45, labeloffset=1.2, voltage, lamp, beam](A)(B){SBN:Ce}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Box}\label{sec:box}
-
-\begin{description}
-\paramitem{optboxheight}{<num>}{0.8}
-\paramitem{optboxwidth}{<num>}{1.4}
-\paramitem{endbox}{<boolean>}{false}
-\paramitem{angle}{<degree>}{0}
-\paramitem{rotateref}{<ref string>\footnote{\refstringexplanation}}{c}
-\paramitem{refractiveindex}{<num>}{\{\}}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optbox[beam](0,0)(3,2){box}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optbox[beam, endbox](0,0)(1.7,1){box}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \pnode(0,0){A}
- \pnode(1.7,1){B}
- \optbox[beam, endbox, labelref=relative, labeloffset=0](A)(B){box}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\noindent The parameter \parameter{angle} describes the tilt of the box
-relative to the reference line defined by the two reference nodes. The
-reference point for the rotation can be defined
-with \parameter{rotateref} which can take any combination
-of \paramvalue{c}, \paramvalue{t}, \paramvalue{b}, \paramvalue{l}
-and \paramvalue{r} (compare with \parameter{extnode} in
-Sec.~\ref{sec:extnode}). Note, that all connection-related nodes are
-also rotate, while the label is not affected.
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optbox[angle=20, beam, rotateref=l, labeloffset=0.5](0,1)(3,1){box}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\noindent Together with the parameter \parameter{refractiveindex} this
-can be exploited to sketch the refraction through a tilted homogeneous
-medium (e.g. a glass plate). Then, however, the reference nodes for the
-beam connection must be corrected which is rather easy using the outer
-nodes of the object as coordinate references and the \texttt{|} node
-operator.
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \pnode(0,1){A}
- \pnode(3,1){B}
- \optbox[labeloffset=0.7, optboxwidth=0.5, optboxheight=1, angle=20, refractiveindex=2.3, compname=Box](A)(B){glass plate}
- \drawbeam[conn=-a]{(A|BoxIntern1)}{Box}
- \drawbeam[conn=B-]{Box}{(B|BoxInternN)}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Detector}
-
-\begin{description}
-\paramitem{detsize}{<num>}{0.8}
-\paramitem{dettype}{round|diode}{round}
-\end{description}
-
-With \nxLPack{pst-optexp} version 2.0 the name for the detector was
-changed to \cs{optdetector} as the package \nxLPack{pst-circ} also
-provides a \cs{detector} macro. For compatibility reasons the old
-\cs{detector} macro is available when \nxLPack{pst-circ} is not loaded
-before \nxLPack{pst-optexp}.
-
-
- \medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \pnode(0,0){A}
- \pnode(1.7,1){B}
- \optdetector[beam](A)(B){detector}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \pnode(0,0){A}
- \pnode(1.7,1){B}
- \optdetector[beam, dettype=diode](A)(B){detector}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Optical Diode}\label{sec:optdiode}
-
-\begin{description}
-\paramitem{optdiodesize}{<num>}{0.8}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optdiode[conn=o-o](0,1)(3,1){Diode}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Dove Prism}\label{sec:doveprism}
-\begin{description}
- \paramitem{doveprismsize}{<num>}{0.6}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \doveprism[beam](0,1)(3,1){Dove}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Polarization}
-
-\begin{description}
-\paramitem{poltype}{parallel|perp|misc|lcirc|rcirc}{parallel}
-\paramitem{polsize}{<num>}{0.6}
-\paramitem{pollinewidth}{<num>}{0.7\cs{pslinewidth}}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.4cm]
-\begin{pspicture}[showgrid=true](3,5)
- \pnode(0,0.5){A1}\pnode(3,0.5){B1}\pnode(0,1.5){A2}
- \pnode(3,1.5){B2}\pnode(0,2.5){A3}\pnode(3,2.5){B3}
- \pnode(0,3.5){A4}\pnode(3,3.5){B4}\pnode(0,4.5){A5}
- \pnode(3,4.5){B5}\psset{style=Beam}
- \multido{\i=1+1}{5}{\psline(A\i)(B\i)}
- \psset{linecolor=black}
- \polarization[poltype=misc,position=0.2](A5)(B5)
- \polarization[poltype=perp,position=0.35](A4)(B4)
- \polarization[poltype=parallel,position=0.5](A3)(B3)
- \polarization[poltype=rcirc,position=0.65](A2)(B2)
- \polarization[poltype=lcirc,position=0.8](A1)(B1)
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Mirror}\label{sec:mirror}
-
-\begin{description}
-\paramitem{mirrorwidth}{<num>}{1}
-\paramitem{mirrorradius}{<num>}{0}
-\paramitem{mirrorlinewidth}{<num>}{2\cs{pslinewidth}}
-\paramitem{mirrortype}{normal|piezo|extended}{normal}
-\paramitem{mirrordepth}{<num>}{0.1}
-\paramitem{variable}{<num>}{false}
-\styleitem{ExtendedMirror}{<psstyle>}
-\styleitem{PiezoMirror}{<psstyle>}
-\end{description}
-
-\noindent The parameter \parameter{mirrorradius} defines the curvature
-of the mirror. A value of \paramvalue{0} is for a plain mirror, a
-negative radius is for a concave mirror and a positive radius gives you
-a convex mirror. The style of the extended mirror is defined as a
-psstyle \styleshape{ExtendedMirror} and can be changed using
-\cs{newpsstyle} or \cs{addtopsstyle}. The appearence of the piezo mirror
-likewise can be changed by adapting the psstyle
-\styleshape{PiezoMirror}. Note, when using \parameter{extnode} with a
-piezo mirror, the default piece of wire is omitted.
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,0){A}
- \pnode(1.8,2.2){G}
- \pnode(0,3){B}
- \mirror[beam](A)(G)(B){mirror}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,0){A}
- \pnode(1.8,2.2){G}
- \pnode(0,3){B}
- \mirror[beam, variable](A)(G)(B){M$_\mathrm{var}$}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,0){A}
- \pnode(1.8,2.2){G}
- \pnode(0,3){B}
- \mirror[beam, mirrortype=piezo,labelangle=-90](A)(G)(B){piezo}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,0){A}
- \pnode(1.8,2.2){G}
- \pnode(0,3){B}
- \mirror[beam, mirrortype=extended](A)(G)(B){M$_\mathrm{ext}$}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,0){A}\pnode(1,2){G1}
- \pnode(1.8,1){G2}\pnode(2.5,3){B}
- \psset{labeloffset=0.5}
- \psline[style=Beam](A)(G1)(G2)(B)
- \mirror[mirrortype=extended, mirrorradius=1](A)(G1)(G2){M$_{\mathrm{concave}}$}
- \mirror[mirrorradius=-1](G1)(G2)(B){M$_{\mathrm{convex}}$}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Beamsplitter}
-
-\begin{description}
-\paramitem{bssize}{<num>}{0.8}
-\paramitem{bsstyle}{cube|plate}{cube}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,2){A}
- \pnode(2,2){G}
- \pnode(3,0){B}
- \beamsplitter[beam](A)(G)(B){BS}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,2){A}
- \pnode(2,2){G}
- \pnode(3,0){B}
- \beamsplitter[bsstyle=plate, beam](A)(G)(B){BS}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-
-\subsection{Optical Grid}
-
-\begin{description}
-\paramitem{optgridcount}{<integer>}{10}
-\paramitem{optgridwidth}{<num>}{1}
-\paramitem{optgridheight}{<num>}{0.1}
-\paramitem{optgriddepth}{<num>}{0.05}
-\paramitem{optgridtype}{blazed|binary}{blazed}
-\paramitem{optgridlinewidth}{<num>}{0.7\cs{pslinewidth}}
-\paramitem{reverse}{<boolean>}{false}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,3){A}
- \pnode(1.8,2.2){G}
- \pnode(0,0){B}
- \optgrid[beam](A)(G)(B){grid}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,3){A}
- \pnode(1.8,2.2){G}
- \pnode(0,0){B}
- \optgrid[beam, reverse](A)(G)(B){grid}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,3){A}
- \pnode(1.8,2.2){G}
- \pnode(0,0){B}
- \optgrid[beam,%
- optgridcount=6,%
- optgriddepth=0.2,%
- optgridheight=0.3](A)(G)(B){grid}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,3){A}
- \pnode(1.8,2.2){G}
- \pnode(0,0){B}
- \optgrid[beam, optgridtype=binary](A)(G)(B){grid}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Prism}\label{sec:prism}
-\begin{description}
- \paramitem{prismsize}{<num>}{1}
- \paramitem{prismangle}{<num>}{60}
-\end{description}
-
-The prism has always a symmetric refraction independent of the beams and
-the \parameter{prismangle}.
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,2.5){A}
- \pnode(2,2){G}
- \pnode(3,0){B}
- \optprism[beam](A)(G)(B){Prism}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Right-Angle Prism}\label{sec:raprism}
-\begin{description}
- \paramitem{raprismsize}{<num>}{1.5}
-\end{description}
-
-The right-angle prisms is constructed such that the two incoming beams
-are parallel and the middle reference node is vertically centered in the
-prism.
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \pnode(0,1.5){A}
- \pnode(1.8,0.8){G}
- \pnode(0,0.5){B}
- \rightangleprism[beam, showoptdots](A)(G)(B){RA}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Penta Prism}\label{sec:ppprism}
-\begin{description}
- \paramitem{pentaprismsize}{<num>}{0.7}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,2){A}
- \pnode(2,2){G}
- \pnode(2,0){B}
- \pentaprism[beam](A)(G)(B){PP}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Custom Components}\label{sec:custom}
-The macros \cs{optdipole} and \cs{opttripole} allow using everything as
-optical component. If you want to use a certain component several times,
-you should define it as a new component. For details on how to define
-your own components see Sec.~\ref{sec:newobj}.
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,2){A}
- \pnode(3,1){B}
- \optdipole[labeloffset=1, beam](A)(B){%
- \rput(0,0){%
- \includegraphics[scale=0.25]{parque-nacional}
- }
- }{label}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \pnode(0,0){A}
- \pnode(1.5,2){G}
- \pnode(3,1.5){B}
- \opttripole[beam](B)(G)(A){\rput[b](0,0){text}}{label}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\section{Fiber-Optical Objects}
-
-\begin{description}
-\paramitem{usefiberstyle}{<boolean>}{false}
-\end{description}
-
-Fiber-optical objects are automatically connected to the reference
-nodes. The style of all fiber connections can be configured
-independently (see Sec.~\ref{sec:fiberstyles}).
-
-For some components it might me nice to highlight some
-internals. If \parameter{usefiberstyle} is enabled, for examples the
-passing parts of the optical filter are drawn with the \styleshape{Fiber}
-style. In the documentation this parameter is enabled to show the parts
-which would be highlighted.
-
-\subsection{Fiber}
-\begin{description}
-\paramitem{fiberloops}{<integer>}{3}
-\paramitem{fiberloopradius}{<num>}{0.4}
-\paramitem{fiberloopsep}{<num>}{0.3}
-\end{description}
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optfiber[labeloffset=0.4](0,1)(3,1){SSMF}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Amplifier}
-\begin{description}
-\paramitem{optampsize}{<num>}{0.8}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optamp(0,1)(3,1){EDFA}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Mach-Zehnder Modulator}
-\begin{description}
-\paramitem{optmzmsize}{<num>}{0.8}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optmzm(0,1)(3,1){MZM}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Filter}
-\begin{description}
-\paramitem{filtersize}{<num>}{0.8}
-\paramitem{filtertype}{bandpass|bandstop}{bandpass}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optfilter(0,1)(3,1){bandpass}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optfilter[filtertype=bandstop](0,1)(3,1){bandstop}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Polarization Controller}
-\begin{description}
-\paramitem{polcontrolsize}{<num>}{0.15}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \polcontrol(0,1)(3,1){PC}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Isolator}
-\begin{description}
-\paramitem{isolatorsize}{<num>}{0.6}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optisolator(0,1)(3,1){}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Optical Switch}
-\begin{description}
-\paramitem{switchsize}{<num>}{0.8}
-\paramitem{switchstyle}{opened|closed}{opened}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optswitch(0,1)(3,1){Opened switch}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optswitch[switchstyle=closed](0,1)(3,1){Closed switch}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Fiber Delay Line}
-
-\begin{description}
- \paramitem{fdlsize}{<num>}{0.6}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \fiberdelayline(0,1)(3,1){Delay line}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-
-\subsection{Fiber Polarizer}
-
-\begin{description}
- \paramitem{fiberpolsize}{<num>}{0.6}
-\end{description}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optfiberpolarizer(0,1)(3,1){polarizer}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Fiber Collimator}
-
-\begin{description}
-\paramitem{fibercolsize}{<num>}{0.3}
-\end{description}
-
-The connection type for the fiber collimator is fixed
-to \parameter{conn=o-f}. The component can be use with two, three or
-four nodes. With more than two points, the fiber is drawn as a
-\cs{psbezier} curve. In the case of three nodes, the middle one is used
-twice. Positioning parameters can still be used to shift the component
-between the first two nodes.
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \fibercollimator(0.5,1)(2.5,1){FC}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \fibercollimator(0,1)(2,1)(3,2){FC}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \fibercollimator(0.5,1)(2.5,1)(2.5,2){FC}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \fibercollimator[position=0.2](0.5,1)(2.5,1)(2.5,2)(0.5,2){FC}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Coupler}\label{sec:coupler}
-\begin{description}
-\paramitem{couplersize}{<num>}{0.2}
-\paramitem{couplersep}{<num>}{0.1}
-\paramitem{couplertype}{none|elliptic}{elliptic}
-\paramitem{align}{top|bottom|center}{center}
-\end{description}
-
-\subsubsection{\texorpdfstring{$2\times 2$}{2x2} Coupler}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optcoupler(0.5,2)(0,0.5)(3,1.5)(2.5,0){Coupler}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optcoupler[align=top](0.5,2)(0,0.5)(3,1.5)(2.5,0){Coupler}
-\end{pspicture}
-\end{LTXexample}
-
-\bigskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \optcoupler[align=bottom, couplertype=none](0.5,2)(0,0.5)(3,1.5)(2.5,0){Coupler}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsubsection{WDM Coupler}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \wdmcoupler[labeloffset=0.5](0,1.5)(0,0.5)(3,1){WDM}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsubsection{WDM Splitter}
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \newpsstyle{FiberOut2}{style=Fiber, arrows=->}
- \wdmsplitter[align=top, labeloffset=0.5](0,1.5)(3,1.5)(3,0.5){}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\subsection{Fiber Styles}\label{sec:fiberstyles}
-
-\begin{description}
-\styleitem{Fiber}{<psstyle>}%{linecolor=red}
-\styleitem{FiberIn}{<psstyle>}%{style=Fiber}
-\styleitem{FiberIn1}{<psstyle>}%{style=FiberIn}
-\styleitem{FiberIn2}{<psstyle>}%{style=FiberIn}
-\styleitem{FiberOut}{<psstyle>}%{style=Fiber}
-\styleitem{FiberOut1}{<psstyle>}%{style=FiberOut}
-\styleitem{FiberOut2}{<psstyle>}%{style=FiberOut}
-\end{description}
-
-All these psstyles control the appearence of the fiber parts before and
-after each object. The styles can be redefined with \cs{newpsstyle} or
-changed with \cs{addtopsstyle}. For optical systems it is not possible
-to define a unique input and a unique output as most components can be
-used bidirectionally. Therefore, I refer to the input as the connections
-on the left of the object and to the output the ones on the right side.
-
-The basic style is \styleshape{Fiber} which is the parent of all other
-styles. \styleshape{FiberIn} inherits from \styleshape{Fiber} and defines
-the style of the input fiber. Analogously \styleshape{FiberOut} controls
-the style of the output fiber. If you want to change the input and
-output fiber styles you should use \cs{addtopsstyle} as then the
-inheritance from the parent style \styleshape{Fiber} remains.
-
-The other psstyles are used only by the various fiber couplers
-(\cs{optcoupler}, \cs{wdmcoupler} and
-\cs{wdmsplitter}). \styleshape{FiberIn1} affects the upper input fiber,
-\styleshape{FiberIn2} the lower input fiber, \styleshape{FiberOut1} the
-upper output fiber and \styleshape{FiberOut2} the lower output fiber. If
-the object has only one input (e.g. \cs{wdmsplitter}),
-\styleshape{FiberIn} is used. All fiber connections are drawn as
-\cs{pccurve} which means that also the curvature and the input and
-output angles of each connection can be changed as you will see in a
-following code example.
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,3)
- \addtopsstyle{FiberIn}{ArrowInside=->, arrowscale=1.2}
- \addtopsstyle{FiberOut2}{linecolor=blue}
- \optcoupler(0,2.5)(0,0.5)(3,2.5)(3,0.5){50~\%}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-In addition to the psstyles there exist
-corresponding \parameter{newFiber\ldots} and \parameter{addtoFiber\ldots}
-parameter keys for each of them.
-
-\medskip
-
-\begin{lstlisting}
-\psset{addtoFiberIn={arrows=->, arrowscale=1.3}}
-\end{lstlisting}
-
-\medskip
-
-\noindent is equivalent to
-
-\medskip
-
-\begin{lstlisting}
-\addtopsstyle{FiberIn}{arrows=->, arrowscale=1.3}
-\end{lstlisting}
-
-\medskip
-
-\noindent Accordingly \parameter{newFiberIn} corresponds to \cs{newpsstyle\{FiberIn\}\{\ldots\}}.
-
-At first glance these keys make no sense. The reason why I
-introduced them was to be able to define special couplers with
-\cs{newpsobject}. This is only possible if all modifications can be
-expressed as parameter keys. Consider for example a WDM splitter which
-only couples out a certain spectral range of the input and you want to
-mark the output with an arrow:
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \newpsobject{mywdmsplitter}{wdmsplitter}{addtoFiberOut1={arrows=->, arrowscale=1.3, linecolor=blue}, labelangle=180, align=bottom}
- \mywdmsplitter(0,0.5)(3,1.5)(3,0.5){blue band}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-Or if you need a coupler with a particular input angle you can do it be extending the appropriate fiber style:
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\begin{pspicture}[showgrid=true](3,2)
- \newpsobject{mycoupler}{optcoupler}{addtoFiberIn2={angleA=90}, align=top}
- \mycoupler(0.5,1.5)(0.5,0.5)(2.5,1.5)(2.5,0.5){}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\section{Defining New Objects}
-
-\subsection{Customized Versions of Existing Macros}
-
-The easiest way to define your own components is to use the
-\cs{newpsobject} macro. With this you can define a new component using
-predefined objects with a set of options. These options serve only as
-default values and can be overridden when calling the macro. The
-following examples defines a new object \cs{sbn} for the special crystal
-used in Sec.~\ref{sec:crystal}.
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\newpsobject{sbn}{crystal}{voltage, lamp, labelangle=45, labeloffset=1.2, fillstyle=solid, fillcolor=yellow!90!black}
-\begin{pspicture}[showgrid=true](3,2)
- \sbn(0,1)(3,1){SBN:Ce}
- \psline[style=Beam](0,1)(3,1)
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-\begin{LTXexample}[width=3.5cm]
-\newpsobject{pumpcoupler}{wdmcoupler}{align=top, labelangle=180, labeloffset=0.5,addtoFiberIn2={ArrowInside=->, arrowscale=2}}
-\begin{pspicture}[showgrid=true](3,2)
- \pumpcoupler(0,1)(0,0)(3,1){Pumpcoupler}
-\end{pspicture}
-\end{LTXexample}
-
-\medskip
-
-Or if you need more than one type of lenses several times in your setup
-it is very cumbersome to specify all parameters every time.
-
-\medskip
-
-\begin{LTXexample}[width=5.5cm]
-\newpsobject{MOLensIn}{lens}{lens=0.5 0.5 0.5}
-\newpsobject{MOLensOut}{lens}{lens=1.5 1.5 1.5}
-\begin{pspicture}[showgrid=true](5,2)
- \pnode(0,1){A}\pnode(5,1){B}
- \MOLensIn[abspos=0.5](A)(B){}
- \MOLensOut[abspos=1](A)(B){}
- \MOLensOut[abspos=4](A)(B){}
- \MOLensIn[abspos=4.5](A)(B){}
- \psline[style=Beam](A)(B)
-\end{pspicture}
-\end{LTXexample}
-\medskip
-
-\subsection{Defining New Objects}\label{sec:newobj}
-
-Since version 1.2 \nxLPack{pst-optexp} provides some high-level macros to
-allow very convenient definition of completely new components. The macro
-\cs{newOptexpDipole} generates all organizing code for a new free-ray
-component. All you have to do is to define a new `drawing' macro
-\cs{mycomponent@iii} which contains all drawing code. Analogously
-\cs{newOptexpDipoleNolabel} defines a new free-ray object without label
-(like \cs{polarization}) and \cs{newOptexpTripole} defines a new
-reflective component.
-
-New fiber-optical components can be defined using
-\cs{newOptexpFiberDipole}. This macro differs from its free-ray
-analogous only in that it presets \parameter{fiber} and hence directly
-connects the component with its reference nodes. The first node in the
-parameter list gets connected with a node \nodename{tempNode@A@}, the
-second node with a node \nodename{tempNode@B@}. These two internal
-nodes are preset to \paramvalue{(0,0)} and can be overwritten within the
-drawing macro.
-
-The syntax of the macros is
-\begin{lstlisting}
-\newOptexpDipole[fixed options]{name}{default options}
-\newOptexpDipoleNolabel[fixed options]{name}{default options}
-\newOptexpTripole[fixed options]{name}{default options}
-\newOptexpFiberDipole[fixed options]{name}{default options}
-\end{lstlisting}
-The \texttt{default options} are simply a list of PSTricks parameters
-which are taken as defaults for the new component. The optional argument
-allows setting of parameters which cannot be overridden later.
-
-This is illustrate a bit more in the next code snippet, which also shows
-how the coordinate system is handled within the \cs{mycomponent@iii}
-macro.
-
-\medskip
-
-\begin{LTXexample}[width=4.5cm]
-\newOptexpTripole{mygrid}{subgriddiv=5, griddots=0, subgridwidth=\pslinewidth, gridwidth=2\pslinewidth}
-\makeatletter
-\def\mygrid@iii{% put here all PSTricks drawing code
- \psgrid(-1,0)(1,1)
-}%
-\makeatother
-\begin{pspicture}[showgrid=true](4,4)
- \pnode(0,1){A}\pnode(2,2){G}\pnode(3,0){B}
- \mygrid[gridcolor=red,labeloffset=1.5](A)(G)(B){myGrid}
- \psline[style=Beam](A)(G)(B)
-\end{pspicture}
-\end{LTXexample}
-\medskip
-
-The default position of the label reference point is (0,0). If you want
-to change this, you have to define a new pnode named
-\nodename{tempNode@Label} in the \cs{mycomponent@iii} macro.
-
-If you create a new component, please send it to me then I can
-incorporate this in a new released version.
-
-\newpage
-
-\section{Examples}
-\begin{LTXexample}[pos=t,vsep=8mm]
-\begin{pspicture}(10,2)
-\psset{optboxwidth=1}\addtopsstyle{Beam}{linewidth=2\pslinewidth}
-\pnode(1,1){Start}\pnode(9,1){CCD}\optbox[endbox, labeloffset=0](CCD)(Start){Laser}
-\optbox[endbox,labeloffset=0,beam](Start)(CCD){CCD}
-\polarization[poltype=perp,abspos=0.5](Start)(CCD)
-\optretplate[abspos=1](Start)(CCD){$\nicefrac{\lambda}{2}$}
-\lens[lens=0.4 0.4 0.5,abspos=2](Start)(CCD){$L_1$}\lens[abspos=4](Start)(CCD){$L_2$}
-\optplate[abspos=6,platelinewidth=3\pslinewidth](Start)(CCD){SLM}
-\optplate[abspos=6.5,labelangle=180](Start)(CCD){PF}
-\polarization[abspos=6.7](Start)(CCD)\lens[abspos=7](Start)(CCD){$L_3$}
-\end{pspicture}
-\end{LTXexample}
-
-\vspace{\fill}
-
-\begin{LTXexample}[pos=t,vsep=8mm]
-\begin{pspicture}(-4,-1)(3,3)
-\addtopsstyle{Beam}{linewidth=2\pslinewidth, linecolor=red!90!black}
-\psset{labeloffset=0.5}
-\pnode(-2,0){LaserOut}\pnode(0,0){Grat}
-\pnode(4;45){Out}\pnode(2.5;67.5){Mvar}
-\optbox[optboxwidth=2,labeloffset=0, endbox](Grat)(LaserOut){diode laser}
-\mirror[variable,conn=o-](Grid)(Mvar)(Grid){M$_\mathrm{var}$}
-\optgrid[beam](LaserOut)(Grat)(Out){grating}
-\optretplate[position=0.3,labeloffset=0.8]%
- (LaserOut)(Grat){$\nicefrac{\lambda}{4}$}
-\rput[l](-3,2){Littman setup}
-\end{pspicture}
-\end{LTXexample}
-
-\begin{LTXexample}[pos=t, vsep=8mm]
-\begin{pspicture}(8.5,1.6)
- \addtopsstyle{Beam}{linecolor=green!90!black}
- \pnode(1.6,1){Laser}\pnode(7.6,1){Diode}
- \optbox[endbox,labeloffset=0](Diode)(Laser){Laser}%
- \optbox[abspos=4, optboxwidth=1, optboxheight=0.6, labeloffset=1, compname=PC, conn=o-, angle=-10, rotateref=l, refractiveindex=2.3](Laser)(Diode){Photonic Crystal}
- \optdetector[dettype=diode, conn=o-](PCInternN)(Diode|PCInternN){PD}
- \defShiftedNode(PCIntern1)(2;170){Angle1}
- \psline[linestyle=dashed](PCIntern1)(Angle1)
- \psarc{<->}(PCIntern1){1.3}{330}{30}
- \psarc[arcsep=1pt]{<->}(PCIntern1){2}{170}{180}
- \uput{2.1}[175](PCIntern1){\small $\varphi$}
-\end{pspicture}
-\end{LTXexample}
-
-\begin{LTXexample}[pos=t, vsep=8mm]
-\begin{pspicture}(6.4,3.2)
-\addtopsstyle{Fiber}{linecolor=red}
-\pnode(2.3,2.3){Lin}\pnode([Xnodesep=0.5]Lin){Lout}
-\pnode([Xnodesep=1.5]Lout){EAMout}
-\pnode([Xnodesep=1.5]EAMout){Det}
-\optbox[fiber, labeloffset=-0.2, endbox, compname=L, extnode=b](Lout)(Lin){%
- \psGauss[yunit=0.03,sigma=0.03]{-0.5}{0.5}}
-\optbox[fiber, labeloffset=0, optboxwidth=1, compname=EAM, extnode=b](Lout)(EAMout){EAM}
-\optfiber[labeloffset=0.3](EAMout)(Det){fibre}
-\optdetector(EAMout)(Det){OSA}
-\pnode([Xnodesep=-1,offset=-1]LExtNode){Osc}
-\pnode(LExtNode|Osc){PSin}\pnode(EAMExtNode|Osc){PSout}
-\oscillator[output=right](Osc){10\,GHz}{}
-\phaseshifter[labeloffset=-0.7](PSin)(PSout){$\tau$}
-\wire(LExtNode)(PSin)\wire(EAMExtNode)(PSout)
-\end{pspicture}
-\end{LTXexample}
-
-\begin{LTXexample}[pos=t, vsep=8mm]
-\begin{pspicture}(0.9,0.9)(10.4,5.9)
- \psset{arrowscale=1.5, arrowinset=0}
- \addtopsstyle{Fiber}{linewidth=2\pslinewidth}
- \pnode(2,5){PC1in}\pnode(4,5){PC1out}\pnode(6,5){PC2in}
- \pnode(8,5){PC2out}\pnode(2,2){CplSig}\pnode(5,2){CplIn}
- \pnode(2,1){CplOut}\pnode(10,4.5){Pump}\pnode(8,2){PumpSig}
- \optisolator[compshift=0.8, addtoFiberIn={angleA=180}, addtoFiberOut={angleB=180}, labelref=relative, labeloffset=0.6](CplSig)(PC1in){isolator}
- \polcontrol[addtoFiberIn={arrows=|-}](PC1in)(PC1out){}
- \optfiberpolarizer[labeloffset=0.6](PC1out)(PC2in){polarizer}
- \polcontrol[addtoFiberOut={arrows=-|}](PC2in)(PC2out){}
- \wdmsplitter[labeloffset=0.3, align=bottom, addtoFiberIn={arrows=|-}, addtoFiberOut1={arrows=->}, addtoFiberOut2={arrows=-|}](CplIn)(CplOut)(CplSig){95/5}
- \wdmcoupler[addtoFiberIn1={ArrowInside=->}, addtoFiberIn2={angleA=0}, addtoFiberOut={angleB=0,arrows=-|}, ncurv=0.9, align=bottom, compshift=0.8](Pump)(PC2out)(PumpSig){Pump}
- \optbox[endbox,labeloffset=0,labelref=relative]([offset=-0.1]Pump)(Pump){980~nm}
- \optfiber[fiberloops=2, labeloffset=0.4](CplIn)(PumpSig){Er$^+$-doped}
-\end{pspicture}
-\end{LTXexample}
-
-\begin{LTXexample}[pos=t, vsep=8mm]
-\makeatletter
-\def\LCLV@iii{%
- \psframe[fillstyle=solid,fillcolor=black,dimen=outer](-0.12,-0.5)(0,0.5)
- \psframe[fillstyle=solid,fillcolor=gray!50,dimen=outer](0,-0.5)(0.15,0.5)
- \pnode(-0.12,0){\optexp@nodeA}\pnode(0.15,0){\optexp@nodeB}}
-\makeatother
-\begin{pspicture}(9,5)
-\newOptexpDipole{LCLV}{}\psset{lens=1.2 0 1}
-\pnode(2.4,1){BS1}\pnode([offset=3]BS1){M1}\pnode([Xnodesep=5.5]M1){PP}\pnode(PP|BS1){BS2}
-\LCLV[position=0.2, compname=LCLV](BS1)(BS2){LCLV}\beamsplitter[compname=BS](BS2)(BS1)(M1){BS}
-\optretplate(BS1)(M1){P}\mirror[conn=i-](BS1)(M1)(PP){M}\lens[position=0.2](M1)(PP){L}
-\pinhole(M1)(PP){}\lens[position=0.2](PP)(M1){L}\pentaprism[beam](M1)(PP)(BS2){PP}
-\beamsplitter(PP)(BS2)(BS1){BS}\lens(BS2)(BS1){L}
-\doveprism[compname=Dove,conn=i-,position=0.27](BS2)(BS1){D}
-\drawbeam[conn=b-b]{Dove}{LCLV}\drawbeam[conn=b-a]{BS}{LCLV}
-\psline[arrowscale=1.3, style=Beam]{->}(BS2)([offset=-1]BS2)
-\addtopsstyle{Beam}{arrowscale=1.3, ArrowInside=-<}
-\optbox[labeloffset=0, endbox, conn=o-](BS1)([Xnodesep=-1]BS1){Nd:YAG}
-\end{pspicture}
-\end{LTXexample}
-
-\begin{LTXexample}[pos=t,vsep=8mm]
-\begin{pspicture}(0,-0.4)(9,6)
- \addtopsstyle{Beam}{linewidth=2\pslinewidth}
- \pnode(1.5,5){Laser}\pnode(4,5){PBS}\pnode(6.5,5){PBS2}
- \pnode(6.5,5.7){piezo}\pnode(4,2){BSFwd}\pnode(6.5,2){BSBwd}
- \pnode(2,2){BS4f}\pnode(2,0.5){M4f3}\pnode(8,2){M4f1}
- \pnode(8,0.5){M4f2}\pnode(1,2){CCD}
- \psline[style=Beam](Laser)(PBS2)(piezo)(BSBwd)(M4f1)(M4f2)(M4f3)(BS4f)(CCD)
- \psline[style=Beam](PBS)(BSFwd)(BS4f)
- \psset{mirrorwidth=0.6, plateheight=0.7, outerheight=0.7, labeloffset=0.7, labelstyle=\scriptsize, lens=1.2 1.2 0.8, bssize=0.5}
- \optbox[endbox,optboxwidth=1.5, optboxheight=0.7,labeloffset=0]%
- (PBS)(Laser){\parbox{1.5cm}{\centering Nd:YAG\\ 532\,nm}}
- \lens[lensheight=0.5, position=0.2](Laser)(PBS){MO}
- \pinhole[position=0.3,labelangle=180](Laser)(PBS){PH}
- \lens[position=0.5](Laser)(PBS){L}
- \optretplate[position=0.8](Laser)(PBS){$\nicefrac{\lambda}{2}$}
- \beamsplitter(Laser)(PBS)(BSFwd){PBS}
- \optretplate[position=0.4](PBS)(BSFwd){$\nicefrac{\lambda}{2}$}
- \polarization(PBS)(BSFwd)\polarization(PBS2)(BSBwd)
- \lens[position=0.8](PBS)(BSFwd){L}
- \optretplate(PBS)(PBS2){$\nicefrac{\lambda}{2}$}
- \beamsplitter(PBS)(PBS2)(piezo){PBS}
- \optretplate[abspos=0.5](PBS2)(piezo){$\nicefrac{\lambda}{4}$}
- \mirror[mirrortype=piezo,labelangle=90](PBS2)(piezo)(PBS2){PZ}
- \lens[position=0.8,labelangle=180](PBS2)(BSBwd){L}
- \crystal[crystalwidth=1, crystalheight=0.5, voltage, lamp, fillstyle=solid, fillcolor=yellow!90!black, labeloffset=0.8, beam](BSFwd)(BSBwd){SBN:Ce}
- \beamsplitter(PBS)(BSFwd)(BSBwd){BS}
- \beamsplitter[labelangle=-90](PBS2)(BSBwd)(BSFwd){BS}
- \mirror(BSBwd)(M4f1)(M4f2){M}\mirror(M4f1)(M4f2)(M4f3){M}
- \lens[labelangle=180](M4f2)(M4f3){L}\mirror(M4f2)(M4f3)(BS4f){M}
- \beamsplitter(M4f3)(BS4f)(CCD){BS}\optbox[endbox,labeloffset=0, optboxwidth=1](BS4f)(CCD){CCD}
- \lens[abspos=0.7](BS4f)(BSFwd){L}\lens[abspos=0.7](BSBwd)(M4f1){L}
-\end{pspicture}
-\end{LTXexample}
-
-\psset{unit=0.8cm,labelstyle=\footnotesize}
-\begin{LTXexample}[pos=t]
-\begin{pspicture}(0.5,4)(13.2,10.5)
- \addtopsstyle{Fiber}{linecolor=red!90!black}\psset{usefiberstyle, optboxwidth=1}
- \pnode(2,10){LD}\pnode([Xnodesep=5.5]LD){CPLin1}
- \pnode([offset=-2]CPLin1){CPLin2}\pnode([Xnodesep=1.5]CPLin1){CPLout1}
- \pnode([Xnodesep=1.5]CPLin2){CPLout2}
- \optbox[endbox, labeloffset=0, fiber]([Xnodesep=0.1]LD)(LD){LD}
- \optmzm([Xnodesep=0.1]LD)([Xnodesep=1.5]LD){MZM}
- \optamp([Xnodesep=1.5]LD)([Xnodesep=2.5]LD){EDFA}
- \optfilter([Xnodesep=2.5]LD)([Xnodesep=3.5]LD){BPF}
- \optswitch([Xnodesep=3.5]LD)([Xnodesep=4.5]LD){SW}
- \polcontrol([Xnodesep=4.5]LD)(CPLin1){}
- \optcoupler[couplertype=none](CPLin1)(CPLin2)(CPLout1)(CPLout2){}
- \optamp(CPLout1)([Xnodesep=1.5]CPLout1){EDFA}
- \optfilter([Xnodesep=1.5]CPLout1)([Xnodesep=3]CPLout1){BPF}
- \optbox[endbox, labeloffset=0, conn=f-f]([Xnodesep=3]CPLout1)([Xnodesep=3.1]CPLout1){RX}
- \pnode([Xnodesep=2]CPLout2){LoopRU}\pnode([offset=-3.5]LoopRU){LoopRL}
- \pnode([Xnodesep=-5]CPLin2){LoopLU}\pnode([offset=-3.5]LoopLU){LoopLL}
- \optamp(CPLout2)(LoopRU){EDFA}
- \psline[linearc=1,style=Fiber](LoopRU)([Xnodesep=1]LoopRU)([Xnodesep=1,offset=-2]LoopRU)
- \psline[linearc=1,style=Fiber]([Xnodesep=1,offset=1.5]LoopRL)%
- ([Xnodesep=1]LoopRL)(LoopRL)
- \optfiber[labelalign=b, labeloffset=-1, position=0.8]([Xnodesep=-2]LoopRL)(LoopRL){\begin{tabular}{c}conventional\\fibre 89.8~km\end{tabular}}
- \optamp([Xnodesep=-2]LoopRL)([Xnodesep=-3]LoopRL){EDFA}
- \optfilter([Xnodesep=-3]LoopRL)([Xnodesep=-4.5]LoopRL){BPF}
- \optfiber[fiberloops=1, labeloffset=-1, labelalign=b]([Xnodesep=-7]LoopRL)([Xnodesep=-4.5]LoopRL){DCF 16.2~km}
- \optamp([Xnodesep=1.5]LoopLL)(LoopLL){EDFA}
- \psline[style=Fiber,linearc=1](LoopLL)([Xnodesep=-1]LoopLL)%
- ([Xnodesep=-1,offset=3.5]LoopLL)(LoopLU)
- \optfilter(LoopLU)([Xnodesep=1.5]LoopLU){BPF}
- \optswitch([Xnodesep=1.5]LoopLU)([Xnodesep=3.5]LoopLU){SW}
- \polcontrol([Xnodesep=3.5]LoopLU)(CPLin2){}
-\end{pspicture}
-\end{LTXexample}
-
-\section{Complete List of Parameters}
-\begin{longtable}{TTT}
-\toprule \multicolumn{1}{l}{parameter} & \multicolumn{1}{l}{allowed values} & \multicolumn{1}{l}{default}\\\midrule\endhead
-\bottomrule\endfoot
-abspos & <num> & \{\}\\
-addtoBeam & <psstyle> & \\
-addtoFiber* & <psstyle> & \\
-addtoOptComp & <psstyle> & \\
-align & top|bottom|center & center\\
-angle & <degree> & 0\\
-beam & \multicolumn{2}{l}{alias for \parameter{conn=o-i}}\\
-bssize & <num> & 0.8\\
-bsstyle & cube|plate & cube\\
-caxisinv & <boolean> & false\\
-caxislength & <num> & 0.6\\
-compname & <string> & \{\}\\
-compshift & <num> & 0\\
-conn & <conn definition> & -\\
-connjoin & <int> & 1\\
-couplersep & <num> & 0.1\\
-couplersize & <num> & 0.2\\
-couplertype & none|elliptic & elliptic\\
-crystalheight & <num> & 0.6\\
-crystalwidth & <num> & 1.4\\
-detsize & <num> & 0.8\\
-dettype & round|diode & round\\
-doveprismsize & <num> & 0.6\\
-endbox & <boolean> & false\\
-extnode & <ref string> & \{\}\\
-fdlsize & <num> & 0.6\\
-fiber & \multicolumn{2}{l}{alias for \parameter{conn=f-f}}\\
-fibercolsize & <num> & 0.3\\
-fiberloopradius & <num> & 0.4\\
-fiberloops & <integer> & 3\\
-fiberloopsep & <num> & 0.3\\
-fiberpolsize & <num> & 0.6\\
-filtersize & <num> & 0.8\\
-filtertype & bandpass|bandstop & bandpass\\
-innerheight & <num> & 0.1\\
-isolatorsize & <num> & 0.6\\
-label & <offset> <angle> <ref> <labelref> & \\
-labelalign & <ref string> & c\\
-labelangle & <num> & 0\\
-labeloffset & <num> & 0.8\\
-labelref & relative|relgrav|global & relgrav\\
-labelstyle & <macro> & \cs{small}\\
-lamp & <boolean> & false\\
-lampscale & <num> & 0.3\\
-lens & <num> [<num> [<num> [<num>]]] & \{\}\\
-lensheight & <num> & 1\\
-lensradius & <num> [<num>] & \{\}\\
-lensradiusleft & <num> & 1\\
-lensradiusright & <num> & 1\\
-lenswidth & <num> & 0.2\\
-mirrordepth & <num> & 0.1\\
-mirrorlinewidth & <num> & 2\cs{pslinewidth}\\
-mirrorradius & <num> & 0\\
-mirrortype & normal|piezo|extended & normal\\
-mirrorwidth & <num> & 1\\
-newBeam & <psstyle> & \\
-newFiber* & <psstyle> & \\
-newOptComp & <psstyle> & \\
-optampsize & <num> & 0.8\\
-optboxheight & <num> & 0.8\\
-optboxwidth & <num> & 1.4\\
-optdiodesize & <num> & 0.8\\
-optgridcount & <integer> & 10\\
-optgriddepth & <num> & 0.05\\
-optgridheight & <num> & 0.1\\
-optgridlinewidth & <num> & 0.7\cs{pslinewidth}\\
-optgridtype & blazed|binary & blazed\\
-optgridwidth & <num> & 1\\
-optional & <boolean> & false\\
-optmzmsize & <num> & 0.8\\
-outerheight & <num> & 1\\
-pentaprismsize & <num> & 0.7\\
-phlinewidth & <num> & 2\cs{pslinewidth}\\
-plateheight & <num> & 1\\
-platelinewidth & <num> & 2\cs{pslinewidth}\\
-platewidth & <num> & 0.1\\
-polcontrolsize & <num> & 0.15\\
-pollinewidth & <num> & 0.7\cs{pslinewidth}\\
-polsize & <num> & 0.6\\
-poltype & parallel|perp|misc|lcirc|rcirc & parallel\\
-position & <num> & \{\}\\
-prismangle & <num> & 60\\
-prismsize & <num> & 1\\
-raprismsize & <num> & 1.5\\
-refractiveindex & <num> & \{\}\\
-reverse & <boolean> & false\\
-rotateref & <ref string> & c\\
-showoptdots & <boolean> & false\\
-switchsize & <num> & 0.8\\
-switchstyle & opened|closed & opened\\
-thicklens & <boolean> & false\\
-usefiberstyle & <boolean> & false\\
-variable & <num> & false\\
-voltage & <boolean> & false\\
-\end{longtable}
-
-\section{Complete List of Styles}
-
-\begin{table}[H]
-\addtolength{\extrarowheight}{1.5mm}
-\begin{tabularx}{\linewidth}{BX}
-\toprule
-\multicolumn{1}{l}{style} & \multicolumn{1}{l}{description}\\
-\midrule
-Beam & All automatic free-ray connections are drawn using this style\\
-ExtendedMirror & Affects the additional part for \parameter{mirrortype=extended}\\
-Fiber & Parent style for all fiber connections. For a detailed discussion see Sec.~\ref{sec:fiberstyles}\\
-FiberIn & Left fiber style if only one connection to be drawn (inherits from \styleshape{Fiber})\\
-FiberIn1 & Upper left connection (used for couplers only, inherits from \styleshape{FiberIn})\\
-FiberIn2 & Lower left connection (used for couplers only, inherits from \styleshape{FiberIn})\\
-FiberOut & Right fiber style if only one connection to be drawn (inherits from \styleshape{Fiber})\\
-FiberOut1 & Upper right connection (used for couplers only, inherits from \styleshape{FiberOut})\\
-FiberOut2 & Lower right connection (used for couplers only, inherits from \styleshape{FiberOut})\\
-OptComp & Affects only the appearance of optical components without changing connections that may be drawn inside the component \\
-OptionalStyle & Used for objects with parameter \parameter{optional} set to \paramvalue{true}\\
-PiezoMirror & Affects the additional part for \parameter{mirrortype=piezo}\\
-\bottomrule
-\end{tabularx}
-\end{table}
-
-\section{Requirements}
-
-\nxLPack{pst-optexp} version 2.1 requires at least version 2.87 of
-\nxLPack{pstricks-add} and \LaTeX. It does not work with plain \TeX.
-
-\section{Todo}
-
-\begin{itemize}
-\item Automatic sizing of optboxes (like a \cs{psframebox}
-\item Even more soffisticated beam drawing (draw beam before object contours)
-\item Drawing of extended beams with focusing and so on could be integrated to
-some extent in future versions. But as the topic is rather difficult if
-you want to do it properly (components should be placed above the beam,
-but the new nodes are available only when the component is drawn) it
-could take very long until this feature will be implemented.
-\end{itemize}
-\section{Acknowledgements}
-
-I thank all the people of the PSTricks mailinglist for the continuous help, especially Herbert Voß.
-
-\end{document}
diff --git a/Master/texmf-dist/doc/latex/pst-optexp/Changes b/Master/texmf-dist/doc/latex/pst-optexp/Changes
new file mode 100644
index 00000000000..f2258cdc26d
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pst-optexp/Changes
@@ -0,0 +1,119 @@
+3.0 2012-07-09
+ * Modified beam connections with \drawbeam to support raytracing
+ * Added wide beams with \drawwidebeam
+ * Added \drawfiber for fiber connections
+ * Added optexp environment for layering of components and
+ connections
+ * Added german documentation
+ * Modified naming of component nodes
+ * Modified extnode to work with more components
+ * Modified angle and rotateref to affect all components
+ * Modified endbox to affect all components
+ * Extended position by values start and end
+ * Extended abspos by values start and end
+ * Removed deprecated lens code which used lenswidth and lensheight
+ for construction
+ * Added option platesize
+ * Added option phwidth
+ * Modified option caxislength
+ * Deprecated option lampscale
+ * Added style CrystalCaxis
+ * Added style CrystalLamp
+ * Added option optboxsize
+ * Extended option detsize
+ * Added style DetectorStyle
+ * Removed deprecated \detector, use \optdetector
+ * Extended option doveprismsize
+ * Added style Polarization
+ * Deprecated option pollinewidth
+ * Removed option polwidth
+ * Removed option pol
+ * Added style VariableStyle
+ * Added mirror type semitrans
+ * Renamed \optgrid to \optgrating
+ * Renamed optgridwidth to gratingwidth
+ * Renamed optgridheight to gratingheight
+ * Renamed optgriddepth to gratingdepth
+ * Renamed optgridcount to gratingcount
+ * Renamed optgridtype to gratingtype
+ * Renamed optgridlinewidth to gratinglinewidth
+ * Added option prismalign
+ * Modified faulty alignment of \rightangleprism
+ * Extended option optampsize
+ * Extended option optmzmsize
+ * Added option polcontroltype
+ * Extended option isolatorsize
+ * Added style IsolatorArrow
+ * Extended option fdlsize
+ * Added style FdlArrow
+ * Extended option fiberpolsize
+ * Added component \optcirculator
+ * Extended option couplersize
+ * Extended option couplertype
+ * Renamed option align to coupleralign
+ * Added style VariableCoupler
+ * Added style FilterStyle
+ * Extended option fibercolsize
+ * Removed deprecated option labelrelative
+ * Removed deprecated option iwidth
+ * Removed deprecated option owidth
+ * Removed deprecated option bswidth
+ * Deprecated \newOptexpDipoleNolabel, use \newOptexpDipole
+ * Deprecated option refractiveindex
+ * Deprecated option conn
+ * Extended option fiber
+
+2.1 2009-11-05
+ * Added component \optfiberpolarizer
+ * Added option compshift
+ * Added option label
+ * Added option connjoin
+ * Added options addtoBeam and newBeam
+ * Added style OptComp and related options addtoOptComp and
+ newOptComp
+ * Added option bsstyle
+ * Extended \fibercollimator to use up to four reference nodes
+ * Improved thicklens to work also with plain lenses
+ * Use pst-doc class for the documentation
+
+2.0 2008-07-27
+ * Added fiber-optical components
+ * Added component \optdiode
+ * Added component \pentaprism
+ * Added component \rightangleprism
+ * Added component \doveprism
+ * Added component \optprism
+ * Added \drawbeam
+ * Added component connections (options fiber, conn and beam)
+ * Added option compname
+ * Added option extnode
+ * Renamed \detector to \optdetector
+
+1.2 2008-06-17
+ * Modified lens design to use interface curvatures
+ * Added options lensradiusleft and lensradiusright
+ * Added option thicklens
+ * Added option lenstype
+ * Added option mirrorradius (curved mirrors)
+ * Added option optgridtype (binary gratings)
+ * Added \newOptexpDipole
+ * Added \newOptexpDipoleNolabel
+ * Added \newOptexpTripole
+ * Added \newOptexpFiberDipole
+ * General improvements of \TeX{} and Postscript code
+
+1.1 2007-09-06
+ * Improved labeling features
+ * Added parameter labelref
+ * Replaced labelrelative by labelref=relative
+ * Renamed \polarisation to \polarization
+ * Renamed polwidth to polsize
+ * Renamed pol to poltype
+ * Renamed bswidth to bssize
+ * Renamed iwidth to innerheight
+ * Renamed owidth to outerheight
+ * Added support for fillstyle for all components
+
+1.0 2007-07-18
+ * First CTAN version
+
diff --git a/Master/texmf-dist/doc/latex/pst-optexp/README b/Master/texmf-dist/doc/latex/pst-optexp/README
new file mode 100644
index 00000000000..a86c6a5c420
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pst-optexp/README
@@ -0,0 +1,28 @@
+------------------------------------------------------------------------
+The pst-optexp package --- Sketching optical experimental setups
+Maintained by Christoph Bersch
+E-mail: usenet@bersch.net
+Released under the LaTeX Project Public License v1.3c or later
+See http://www.latex-project.org/lppl.txt
+------------------------------------------------------------------------
+
+The package pst-optexp is a collection of optical components that
+facilitate easy sketching of optical experimental setups. A lot of
+different free-ray and fiber components are provided, which alignment,
+positioning and labelling can be achieved in very simple and flexible
+ways. The components can be connected with fibers or beams, realistic
+raytraced beam paths are also possible.
+
+Installation
+------------
+
+The package is supplied in dtx format and as a pre-extracted zip file,
+pst-optexp.tds.zip. The later is most convenient for most users: simply
+unzip this in your local texmf directory and run texhash to update the
+database of file locations. The pst-optexp package is also contained in
+MiKTeX and TeX Live distributions. If you want to unpack the dtx
+yourself you must run "tex pst-optexp.ins", to typeset the documentation
+run "latex pst-optexp.dtx".
+
+The package requires recent version of pst-node, multido, pstricks-add,
+pst-eucl, and environ.
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
new file mode 100644
index 00000000000..1bdfdde3dab
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-DE.pdf
Binary files 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
new file mode 100644
index 00000000000..813d8abbcbc
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp-quickref.pdf
Binary files 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
new file mode 100644
index 00000000000..1f717e802d6
--- /dev/null
+++ b/Master/texmf-dist/doc/latex/pst-optexp/pst-optexp.pdf
Binary files differ
diff --git a/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro b/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro
index 2aff67a4521..991a54f9652 100644
--- a/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro
+++ b/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro
@@ -1,12 +1,79 @@
-%
-% PostScript prologue for pst-optexp.tex.
-% version 0.3 2009-11-05 (cb)
-% For distribution, see pstricks.tex.
-%
-/tx@OptexpDict 20 dict def
+%%
+%% This is file `pst-optexp.pro',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% pst-optexp.dtx (with options: `prolog')
+%%
+%% This is a generated file.
+%%
+%% Project: pst-optexp
+%% Version: 3.0 (2012/07/09)
+%%
+%% Copyright (C) 2007-2012 by Christoph Bersch <usenet@bersch.net>
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008/05/04 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The current maintainer of this work is Christoph Bersch.
+%%
+%% This work consists of the files pst-optexp.dtx and pst-optexp.ins
+%% and the derived files
+%% pst-optexp.sty, pst-optexp.pro.
+%%
+/tx@OptexpDict 200 dict def
tx@OptexpDict begin
-%
-% str1 str2 append str1str2
+/DebugOE false def
+/DebugDepth 0 def
+/DebugBegin {
+ DebugOE {
+ /DebugProcName ED
+ DebugDepth 2 mul string
+ 0 1 DebugDepth 2 mul 1 sub {
+ dup 2 mod 0 eq { (|) }{( )} ifelse
+ 3 -1 roll dup 4 2 roll
+ putinterval
+ } for
+ DebugProcName strcat ==
+ /DebugDepth DebugDepth 1 add def
+ }{
+ pop
+ } ifelse
+} bind def
+/DebugEnd {
+ DebugOE {
+ /DebugDepth DebugDepth 1 sub def
+ DebugDepth 2 mul 2 add string
+ 0 1 DebugDepth 2 mul 1 sub {
+ dup 2 mod 0 eq { (|) }{ ( ) } ifelse
+ 3 -1 roll dup 4 2 roll
+ putinterval
+ } for
+ dup DebugDepth 2 mul (+-) putinterval
+ ( done) strcat ==
+ } if
+} bind def
+/DebugMsg {
+ DebugOE {
+ DebugDepth 1 add 2 mul string
+ 0 1 DebugDepth 2 mul 1 add {
+ dup 2 mod 0 eq { (|) }{( )} ifelse
+ 3 -1 roll dup 4 2 roll
+ putinterval
+ } for
+ exch strcat ==
+ }{
+ pop
+ } ifelse
+} bind def
/strcat {
exch 2 copy
length exch length add
@@ -14,184 +81,1373 @@ tx@OptexpDict begin
copy length exch
putinterval
} bind def
-%
-% expects: XB YB XA YA XG YG
-/calcNodes {% def
- /YG exch def /XG exch def
- /ay YG 3 -1 roll sub def
- /ax XG 3 -1 roll sub def
- /by exch YG sub def
- /bx exch XG sub def
- /a ax ay Pyth def
- /modA a def % for external use
- /b bx by Pyth def
- /cx ax a div bx b div add def
- /cy ay a div by b div add def
- /c@tmp cx cy Pyth def
- /c ax bx add ay by add Pyth def
- /OEangle c dup mul a dup mul sub b dup mul sub -2 a b mul mul div Acos def
- %
- % if c=0, then set the coordinates of the vector manually
- % depending on the dotproduct (and thus, if 'a' and 'b'
- % are parallel or antiparallel
- c 0 eq
- {ax bx mul ay by mul add 0 gt
- % if dotprod > 0 then a and b are parallel
- {/cx ax def
- /cy ay def}
- % else a and b are antiparallel
- {/cx ay def
- /cy ax neg def} ifelse
- /c@tmp a def
- } if
- /X@A XG cx c@tmp div add def
- /Y@A YG cy c@tmp div add def
- /X@B XG cx c@tmp div sub def
- /Y@B YG cy c@tmp div sub def
- %
- % chirality:
- % test the order of the input points as a input angle > 90°
- % doesn't really make sens.
- % So if 'chir' <= 0 exchange the calculated coordinates of
- % A and B and otherwise leave it as is
- /chirality ax by mul ay bx mul sub def
- chirality 0 le
- {Y@A X@A
- /X@A X@B def
- /Y@A Y@B def
- /X@B exch def
- /Y@B exch def}if
-} bind def
-%
-% called with: R1 height
-% leaves on stack: a1
-/segLen {% def
+/nametostr {
+ dup length string cvs
+} bind def
+/PrintWarning {
+ (Warning: ) exch strcat ==
+} bind def
+/inttostr {
+ dup type /integertype eq {
+ dup log 1 add floor cvi string cvs
+ } if
+} bind def
+/IfcCopy {
+ 2 copy IfcName exch IfcName load dup
+ length dict copy def
+ name exch NodeName name 3 -1 roll NodeName
+ tx@NodeDict begin
+ load dup length dict copy def
+ end
+} bind def
+/calcNodes {
+ (calcNode) DebugBegin
+ /YG exch def /XG exch def
+ /ay YG 3 -1 roll sub def
+ /ax XG 3 -1 roll sub def
+ /by exch YG sub def
+ /bx exch XG sub def
+ /a ax ay Pyth def
+ /modA a def
+ /b bx by Pyth def
+ /modB b def
+ /cx ax a div bx b div add def
+ /cy ay a div by b div add def
+ /c@tmp cx cy Pyth def
+ /c ax bx add ay by add Pyth def
+ /OEangle c dup mul a dup mul sub b dup mul sub
+ -2 a b mul mul div Acos def
+ c 0 eq {
+ ax ay bx by DotProd 0 gt {
+ /cx ax def
+ /cy ay def
+ }{
+ /cx ay def
+ /cy ax neg def
+ } ifelse
+ /c@tmp a def
+ } if
+ /X@A XG cx c@tmp div add def
+ /Y@A YG cy c@tmp div add def
+ /X@B XG cx c@tmp div sub def
+ /Y@B YG cy c@tmp div sub def
+ ax by mul ay bx mul sub 0 le {
+ Y@A X@A
+ /X@A X@B def
+ /Y@A Y@B def
+ /X@B exch def
+ /Y@B exch def
+ modA modB /modA exch def /modB exch def
+ } if
+ DebugEnd
+} bind def
+/capHeight {
dup mul neg exch abs dup 3 1 roll dup mul add sqrt sub
} bind def
-%
-% called with: height R1
-% leaves on stack: y |R1| alpha_bottom alpha_top R1
-/leftConvex {% def
- /R1 exch def /h exch def
- /a1 R1 h segLen def
- 0 R1 abs
- R1 a1 sub neg dup
- h exch atan exch
- h neg exch atan
- /ArcL /arc load def
- R1
-} bind def
-%
-% called with: height R1
-% leaves on stack: y |R1| alpha_bottom alpha_top R1
-/leftConcave {% def
- /R1 exch def /h exch def
- /a1 R1 h segLen def
- 0 R1 abs
- R1 neg a1 sub dup
- h exch atan exch
- h neg exch atan
- /ArcL /arcn load def
- /a1 0.5 a1 mul def
- R1
-} bind def
-%
-% called with: height R2
-% leaves on stack: y |R2| alpha_bottom alpha_top R2
-/rightConvex {%def
- /R2 exch def /h exch def
- /a2 R2 h segLen def
- 0 R2 abs
- R2 a2 sub dup
- h neg exch atan exch
- h exch atan
- R2
- /ArcR /arc load def
-} bind def
-%
-% called with: height R2
-% leaves on stack: y |R2| alpha_bottom alpha_top R2
-/rightConcave {%def
- /R2 exch def /h exch def
- /a2 R2 h segLen def
- 0 R2 abs
- R2 a2 add dup
- h neg exch atan exch
- h exch atan
- /ArcR /arcn load def
- /a2 0.5 a2 mul def
- R2
-} bind def
-%
-/mwNode {%def
- exch 3 1 roll add 2 div 3 1 roll add 2 div exch
-} bind def
-%
-/FiberAngleB {%
- N@tempNode@A GetCenter N@tempNode@B GetCenter exch 3 1 roll sub 3 1 roll sub atan
-} bind def
-%
-/FiberAngleA {%
- FiberAngleB 180 add
-} bind def
-%
-/ExtNode {%
- @@x0 @xref @@x mul add
- @@y0 @yref @@y mul add
-} bind def
-% basicnodename reverse GetInternalNodeNames
-/GetInternalNodeNames {% def
- /reverse exch def
- (N@) exch strcat
- 1 % counter
- {% counter and name on stack
- 2 copy dup 3 string cvs 3 -1 roll exch strcat dup
- tx@NodeDict exch known {%
- reverse { 4 1 roll pop } { exch 2 add 1 roll } ifelse
- } {
- reverse { pop pop pop (N) strcat } { pop pop exch (N) strcat exch 1 roll } ifelse
- exit
- } ifelse
- 1 add
- } loop
-} bind def
-%
-% basicnodename reverse GetInternalBeamNodes x_n y_n ... x_1 y_1 (if reverse = false)
-/GetInternalBeamNodes {% def
- [ 3 1 roll GetInternalNodeNames ]
- { cvn tx@NodeDict begin load GetCenter end } forall
-} bind def
-%
-%
+/leftCurvedIfc {
+ /R1 exch def /h exch def
+ 0 R1 abs dup R1 h capHeight exch sub R1 sign mul dup
+ h exch atan exch
+ h neg exch atan
+ R1 0 lt {
+ /ArcL /arcn load def
+ } {
+ /ArcL /arc load def
+ } ifelse
+ R1
+} bind def
+/rightCurvedIfc {
+ /R2 exch def /h exch def
+ 0 R2 abs dup R2 h capHeight sub R2 sign mul dup
+ h neg exch atan exch
+ h exch atan
+ R2 0 lt {
+ /ArcR /arcn load def
+ } {
+ /ArcR /arc load def
+ } ifelse
+ R2
+} bind def
+/SlopeAngle {
+ (SlopeAngle) DebugBegin
+ @GetCenter 3 -1 roll @GetCenter @ABVect exch atan
+ DebugEnd
+} bind def
+/DefineExtNode {%
+ (DefineExtNode) DebugBegin
+ @@y mul RefFac mul @@y0 add
+ exch @@x mul RefFac mul @@x0 add exch
+ DebugEnd
+} bind def
+/GetInternalNodeNames {
+ (GetInternalNodeNames) DebugBegin
+ /reverse ED
+ dup cvn load /N get dup
+ reverse { -1 1 } { 1 1 3 -1 roll } ifelse
+ { 2 copy eq { pop (N) } { inttostr } ifelse
+ 3 -1 roll dup 4 1 roll exch NodeName 3 1 roll
+ } for
+ pop pop
+ DebugEnd
+} bind def
+/GetInternalBeamNodes {
+ (GetInternalBeamNodes) DebugBegin
+ [ 3 1 roll GetInternalNodeNames ]
+ { @GetCenter } forall
+ DebugEnd
+} bind def
+/GetInternalBeamNodesCompat {
+ exch dup 3 1 roll (C) NodeName dup tx@NodeDict exch known {
+ @GetCenter ToVec
+ 3 1 roll pop pop
+ } {
+ pop GetInternalBeamNodes
+ } ifelse
+} bind def
+/GetInternalBeamNodeCompat {
+ exch dup 3 1 roll (C) NodeName dup tx@NodeDict exch known {
+ @GetCenter ToVec
+ 3 1 roll pop pop
+ } {
+ pop NodeName @GetCenter ToVec
+ } ifelse
+} bind def
/InitOptexpComp {%
- tx@Dict begin
- /@@x 0 def
- /@@y 0 def
- /@@x0 0 def
- /@@y0 0 def
- /@xref 0 def
- /@yref 0 def
+ /@@x 0 def
+ /@@y 0 def
+ /@@x0 0 def
+ /@@y0 0 def
+ /@xref 0 def
+ /@yref 0 def
+ /RefFac 1 def
+} bind def
+/NewTempNodeComp {
+ (NewTempNodeComp) DebugBegin
+ /sc ED
+ dup cvn
+ 6 dict dup 3 1 roll def begin
+ /ambiguous false def
+ /allowbeaminside false def
+ /name ED
+ /correct false def
+ {0 0} exch 3 -1 roll exec
+ gsave
+ translate
+ /CompMtrx CM def
+ grestore
+ /N 1 def
+ /n bgRefIndex def
+ 5 dict dup dup /P@1 ED /P@N ED
+ begin
+ /mode trans def
+ {} 0 0 PlainIfc
+ end
+ /adjustRel true def
+ end
+ DebugEnd
+} bind def
+/CurvedIfc {
+ 5 2 roll
+ 2 copy 5 3 roll exec 3 -1 roll exec VecAdd
+ 5 -1 roll exec /Y ED /X ED
+ exch exec 3 -1 roll 3 copy exec /RY ED /RX ED
+ 3 1 roll NormalizeVec 3 -1 roll exec
+ tx@Dict begin Pyth end dup
+ 3 1 roll mul 1.00001 mul /NAup ED
+ mul 1.00001 mul /NAlow ED
+} bind def
+/PlainIfc {
+ 5 2 roll
+ dup 3 -1 roll exec NormalizeVec 3 -1 roll exec 2 copy /DY ED /DX ED
+ tx@Dict begin Pyth end dup 4 2 roll
+ exch exec 3 -1 roll exec /Y ED /X ED
+ 3 1 roll mul 1.00001 mul /NAup ED
+ mul 1.00001 mul /NAlow ED
+} bind def
+/NewCompIfc {
+ /scl ED
+ /next ED
+ dup (P@) exch strcat cvn
+ 6 dict dup
+ 3 1 roll def
+ begin
+ 3 -1 roll
+ /mode ED
+ 6 -1 roll dup 7 -1 roll
+ {scl} 8 -2 roll next
+ end
+ 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
+/desc 0 def /asc 1 def /amb 2 def
+/ok 0 def /tir 1 def /missed 2 def
+/bgRefIndex 0 def
+/NewOptexpComp {
+ (NewOptexpComp) DebugBegin
+ /sc ED dup cvn
+ gsave
+ 12 dict dup 3 1 roll def begin
+ /name ED
+ /allowbeaminside ED
+ /ambiguous ED
+ dup type /booleantype eq not { false } if /correct ED
+ tx@Dict begin
+ STV {CP T} stopped pop
+ end
+ /CompMtrx CM def
+ grestore
+ counttomark dup 6 idiv dup /N ED 6 mul eq { 1 } if
+ cvx 1 EvalRefIndex /n ED
+ ambiguous {
+ /ambIfc ED
+ }{
+ /ambIfc 0 def
+ } ifelse
+ 1 N eq {
+ name (1) 3 -1 roll {sc} NewCompIfc
+ (1) (N) IfcCopy
+ }{
+ N -1 1 { %
+ dup N eq { pop (N) }{inttostr} ifelse
+ exch name 3 1 roll {sc} NewCompIfc
+ } for
+ } ifelse
+ ambiguous ambIfc 0 gt and {
+ ambIfc N eq { (N) }{ ambIfc inttostr } ifelse (C) IfcCopy
+ } if
+ end
+ pop
+ DebugEnd
+} bind def
+/NewOptexpFiberComp {
+ (NewOptexpFiberComp) DebugBegin
+ /sc ED dup cvn
+ gsave
+ 12 dict dup 3 1 roll def begin
+ /name ED
+ tx@Dict begin
+ STV {CP T} stopped pop
+ end
+ /CompMtrx CM def
+ grestore
+ counttomark /N ED
+ 1 N eq {
+ {0 1} 0 0 trans name (1) {PlainIfc} {sc} NewCompIfc
+ (1) (N) IfcCopy
+ }{
+ N -1 1 {
+ dup N eq { pop (N) }{inttostr} ifelse
+ {0 1} 0 0 absorb name 6 -1 roll {PlainIfc} {sc} NewCompIfc
+ } for
+ } ifelse
+ end
+ pop
+ DebugEnd
+} bind def
+/IfcAlias {
+ 2 copy IfcName exch IfcName load def
+ tx@NodeDict begin
+ name exch NodeName name 3 -1 roll NodeName load def
+ end
+} bind def
+/GetPlaneVec {
+ (GetPlaneVec) DebugBegin
+ cvn load begin
+ IfcName load begin
+ currentdict /RX known {
+ RX RY CompMtrx dtransform CM idtransform
+ neg exch
+ } {
+ DX DY CompMtrx dtransform CM idtransform
+ } ifelse
+ end
+ 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
+/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
+ IfcName load begin
+ currentdict /XCorr known {
+ XCorr YCorr
+ }{
+ X Y
+ } ifelse
+ currentdict /RX known {
+ RX neg RY neg VecAdd
+ } if
+ CompMtrx transform CM itransform
+ end
+ end
+ DebugEnd
+} bind def
+/TransformInVec {
+ (TransformInVec) DebugBegin
+ 3 1 roll
+ GetIfcCenter 4 2 roll
+ GetIfcCenter 5 -2 roll
+ @ABVect
+ 3 -1 roll exec 2 copy 6 2 roll
+ 0 eq exch 0 eq and not {
+ exch atan matrix rotate dtransform
+ } {
+ 4 2 roll pop pop
+ } ifelse
+ ToVec
+ DebugEnd
+} bind def
+/TransformStartPos {
+ (TransformStartPos) DebugBegin
+ exec 2 copy 6 2 roll 0 eq exch 0 eq and not
+ 3 1 roll GetIfcCenter 4 2 roll
+ GetIfcCenter 5 2 roll {
+ 2 copy 8 2 roll
+ @ABVect exch atan matrix rotate dtransform
+ VecAdd
+ } {
+ 6 2 roll pop pop pop pop
+ } ifelse
+ ToVec
+ DebugEnd
+} bind def
+/GetNearestPlane {
+ (GetNearestPlane) DebugBegin
+ 3 copy 1 exch GetIfcCenter @ABDist /dist ED /nearestPlane 1 def
+ dup cvn load /N get 2 1 3 -1 roll {
+ 4 copy exch GetIfcCenter @ABDist dup dist lt {
+ /dist ED /nearestPlane ED
+ } {
+ pop pop
+ } ifelse
+ } for
+ pop pop pop nearestPlane
+ DebugEnd
+} bind def
+/PushAmbCompPlanesOnStack {
+ (PushAmbCompPlanesOnStack) DebugBegin
+ currentdict /outToPlane undef
+ PN IfcCnt eq not {
+ exch dup 3 1 roll % nextifc ambcomp nextifc
+ dup xcheck not {
+ 0 get (C) exch
+ } {
+ exec pop pop pop
+ } ifelse
+ [ 3 1 roll ] cvx /outToPlane ED
+ } if
+ /IfcCntTmp IfcCnt def
+ aload pop /draw ED /name ED
+ name cvn load /N get /N ED
+ currentdict /Curr known {
+ /CurrTmp /Curr load def
+ /CurrVecTmp /CurrVec load def
+ } {
+ /CurrTmp /CurrLow load def
+ /CurrVecTmp /CurrVecLow load def
+ } ifelse
+ PN 1 eq {
+ [ (C) name name GetRefIndex trans draw] cvx
+ name /outToPlane load GetNextPlane
+ dup 0 eq not {
+ [ exch name bgRefIndex trans draw ] cvx exch
+ /IfcCntTmp IfcCntTmp 1 add def
+ } {
+ pop
+ } ifelse
+ }{
+ CurrTmp name GetNearestPlane dup /firstPlane ED
+ name isAmbiguousIfc not {
+ CurrVecTmp firstPlane name GetPlaneVec NormalVec
+ (C) name GetIfcCenter firstPlane name GetIfcCenter
+ @ABVect 2 copy 6 2 roll DotProd
+ 0 lt { trans }{ refl } ifelse
+ 3 1 roll ToVec /CurrVecTmp ED
+ [ firstPlane name
+ connectifc {
+ bgRefIndex
+ }{
+ name GetRefIndex
+ } ifelse
+ 5 -1 roll true ] cvx
+ /IfcCntTmp IfcCntTmp 1 add def
+ } if
+ PN IfcCnt eq {
+ [ (C) name
+ name GetRefIndex
+ 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 % mode
+ draw ] cvx
+ name /outToPlane load GetNextPlane
+ dup dup name isAmbiguousIfc exch 0 eq or not {
+ [ exch name bgRefIndex trans draw ] cvx exch
+ firstPlane name isAmbiguousIfc not { 3 -1 roll } if
+ /IfcCntTmp IfcCntTmp 1 add def
+ } {
+ pop
+ exec 3 -1 roll pop bgRefIndex 3 1 roll [ 6 1 roll ] cvx
+ firstPlane name isAmbiguousIfc not { exch } if
+ } ifelse
+ } ifelse
+ } ifelse
+ /IfcCnt IfcCntTmp def
+ DebugEnd
+} bind def
+/GetNextPlane {
+ (GetNextPlane) DebugBegin
+ 2 copy (C) 3 -1 roll
+ GetIfcCenter 3 -1 roll exec GetIfcCenter
+ 4 2 roll 4 copy @ABVect /VecY ED /VecX ED
+ @ABDist /centerDist ED
+ /sprod 1 def
+ /nextPlane 0 def
+ exch dup 3 1 roll
+ cvn load dup /ambIfc get /ambIfc ED /N get 1 1 3 -1 roll {
+ dup ambIfc eq not {
+ 3 copy 3 -1 roll 2 copy
+ GetPlaneVec VecX VecY 4 2 roll NormalVec
+ VecX VecY DotProd dup sprod lt 5 2 roll
+ GetIfcCenter 3 -1 roll exec GetIfcCenter @ABDist
+ centerDist lt and
+ { /sprod ED /nextPlane ED } { pop pop } ifelse
+ } {
+ pop
+ } ifelse
+ } for
+ pop pop nextPlane
+ DebugEnd
+} bind def
+/TraceBeam {
+ (Tracebeam) DebugBegin
+ AngToVec /InVec ED /StartPoint ED
+ /oldbeaminsidelast currentdict /beaminsidelast known {
+ beaminsidelast
+ } {
+ false
+ } ifelse def
+ exec
+ connectifc {
+ /nbeam bgRefIndex def
+ } if
+ /startinside startinside beaminsidefirst or def
+ /stopinside stopinside beaminsidelast or def
+ /PrevCorrect false def
+ PrearrangePlanes
+ PushAllPlanesOnStack
+ currentdict /lastVecTmp known {
+ lastVecTmp beamangle matrix rotate dtransform ToVec
+ } {
+ beamalign relative eq counttomark 2 ge and {
+ 2 copy /InVec load TransformInVec
+ } {
+ /InVec load
+ } ifelse
+ } ifelse
+ /CurrVec ED
+ currentdict /lastBeamPointTmp known {
+ /lastBeamPointTmp load /Curr ED
+ }{
+ counttomark 2 ge {
+ 2 copy /StartPoint load TransformStartPos
+ } {
+ /StartPoint load
+ } ifelse
+ /Curr ED
+ } ifelse
+ counttomark /IfcCnt ED
+ /n1 bgRefIndex def
+ /PN 1 def
+ (start looping) DebugMsg
+ {
+ PN IfcCnt gt {
+ exit
+ } if
+ (checked) DebugMsg
+ dup xcheck not {
+ PushAmbCompPlanesOnStack
+ } if
+ exec
+ /draw ED /Mode ED /n2 ED 2 copy /CompName ED /IfcNum ED
+ GetIfcCenter ToVec /CurrCenter ED
+ Curr CurrVec
+ connectifc PrevCorrect PN 2 gt and PN 2 eq or and {
+ CurrVec CurrCenter PrevCenter PrevMode
+ currentdict /relAngle known
+ { relAngle } { 0 } ifelse connectInterfaces
+ /relAngle ED
+ } if
+ IfcNum CompName Mode n2 8 4 roll HandleInterface
+ missed eq {
+ counttomark PN 1 sub 3 mul sub {pop} repeat
+ (The beam missed an interface) Warning exit
+ exit
+ } if
+ PN 1 eq {
+ pop pop
+ /draw beaminsidefirst oldbeaminsidelast xor def
+ } {
+ ToVec /CurrVec ED
+ } ifelse
+ 2 copy
+ ToVec /Curr ED
+ draw PN skipconn 1 add gt and
+ counttomark 3 roll
+ /PrevCenter /CurrCenter load def
+ /lastBeamPointTmp /Curr load def
+ /lastVecTmp /CurrVec load def
+ /PrevMode Mode def
+ CompName cvn load /correct get /PrevCorrect ED
+ PN IfcCnt eq {
+ exit
+ } {
+ CurrVec 0 eq exch 0 eq and {
+ IfcCnt PN sub {pop} repeat
+ (Total internal reflection occured, this is not supported)
+ Warning
+ exit
+ } if
+ /PN PN 1 add def
+ } ifelse
+ } loop
+ DebugEnd
+} bind def
+/sign {
+ 0 ge { 1 } { -1 } ifelse
+} bind def
+/TraceAndFillWideBeam {
+ (TraceAndFillWideBeam) DebugBegin
+ AngToVec /InvecLow ED /StartLow ED
+ AngToVec /InvecUp ED /StartUp ED
+ exec
+ connectifc {
+ /nbeam bgRefIndex def
+ } if
+ /startinside startinside beaminsidefirst or def
+ /stopinside stopinside beaminsidelast or def
+ /DrawnSegm 0 def
+ /PrevCorrect false def
+ PrearrangePlanes
+ PushAllPlanesOnStack
+ currentdict /lastVecTmpUp known
+ currentdict /lastVecTmpLow known and {
+ /CurrVecLow lastVecTmpLow beamangle matrix rotate dtransform ToVec def
+ /CurrVecUp lastVecTmpUp beamangle matrix rotate dtransform ToVec def
+ }{
+ beamalign relative eq counttomark 2 ge and {
+ 2 copy /InvecLow load TransformInVec /CurrVecLow ED
+ 2 copy /InvecUp load TransformInVec /CurrVecUp ED
+ } {
+ /CurrVecLow /InvecLow load def
+ /CurrVecUp /InvecUp load def
+ } ifelse
+ } ifelse
+ currentdict /lastBeamPointTmpLow known
+ currentdict /lastBeamPointTmpUp known and {
+ /lastBeamPointTmpLow load /CurrLow ED
+ /lastBeamPointTmpUp load /CurrUp ED
+ } {
+ counttomark 2 ge {
+ 2 copy /StartLow load TransformStartPos /CurrLow ED
+ 2 copy /StartUp load TransformStartPos /CurrUp ED
+ } {
+ /StartLow load /CurrLow ED
+ /StartUp load /CurrUp ED
+ } ifelse
+ } ifelse
+ counttomark /IfcCnt ED
+ /n1 bgRefIndex def
+ /CurrR false def
+ /ret missed def
+ /PN 1 def
+ {
+ PN IfcCnt gt {
+ exit
+ } if
+ dup xcheck not {
+ PushAmbCompPlanesOnStack
+ } if
+ exec
+ PN skipconn 1 add gt and /draw ED
+ /Mode ED /n2 ED 2 copy /CompName ED /IfcNum ED
+ GetIfcCenter ToVec /CurrPCenter ED
+ /oldn1 n1 def
+ CurrUp CurrVecUp
+ connectifc PrevCorrect PN 2 gt and PN 2 eq or and {
+ CurrVecUp CurrPCenter PrevPCenter PrevMode
+ currentdict /relAngleUp known { relAngleUp } { 0 } ifelse
+ connectInterfaces /relAngleUp ED
+ } if
+ /CurrVecUp load /PrevVecUp ED
+ /CurrUp load /PrevUp ED
+ IfcNum CompName Mode n2 8 4 roll HandleInterface
+ dup /ret ED
+ missed eq {
+ counttomark {pop} repeat
+ (The upper beam missed an interface) Warning exit
+ } if
+ ToVec /CurrVecUp ED
+ ToVec /CurrUp ED
+ /n1 oldn1 def
+ /CurrVecLow load /PrevVecLow ED
+ /CurrLow load /PrevLow ED
+ CurrLow CurrVecLow
+ connectifc PrevCorrect PN 2 gt and PN 2 eq or and {
+ CurrVecLow CurrPCenter PrevPCenter PrevMode
+ currentdict /relAngleLow known { relAngleLow } { 0 } ifelse
+ connectInterfaces /relAngleLow ED
+ } if
+ IfcNum CompName Mode n2 8 4 roll HandleInterface
+ dup missed eq {
+ /ret ED
+ (The lower beam missed an interface) Warning
+ counttomark {pop} repeat exit
+ } if
+ tir eq ret tir eq or {
+ /ret tir def
+ } {
+ /ret ok def
+ } ifelse
+ ToVec /CurrVecLow ED
+ ToVec /CurrLow ED
+ /PrevR CurrR def
+ PrevR type /realtype eq {
+ /CurrCenter load /PrevCenter ED
+ } if
+ IfcNum CompName isCurved {
+ IfcNum CompName LoadIfc
+ tx@Dict begin Pyth end /CurrR ED
+ ToVec /CurrCenter ED
+ } {
+ /CurrR false def
+ /CurrCenter false def
+ } ifelse
+ PN 1 gt currentdict /fillBeam known and {
+ draw {
+ /DrawnSegm DrawnSegm 1 add def
+ PrevUp moveto CurrUp lineto
+ IfcNum CompName isCurved {
+ CurrCenter CurrUp CurrLow
+ 4 copy 3 -1 roll eq 3 1 roll eq and {
+ 6 {pop} repeat
+ } {
+ TangentCrosspoint
+ CurrLow CurrR arct
+ } ifelse
+ } {
+ CurrLow lineto
+ } ifelse
+ PrevLow lineto
+ PrevR type /booleantype eq not {
+ PrevCenter PrevLow PrevUp
+ 4 copy 3 -1 roll eq 3 1 roll eq and {
+ 6 {pop} repeat
+ } {
+ TangentCrosspoint
+ PrevUp PrevR arct
+ } ifelse
+ } {
+ PrevUp lineto
+ } ifelse
+ } if
+ Mode refl eq draw and
+ draw not DrawnSegm 0 gt and or {
+ fillBeam newpath
+ /DrawnSegm 0 def
+ } if
+ } if
+ PN 1 eq {
+ /CurrVecUp /PrevVecUp load def
+ /CurrVecLow /PrevVecLow load def
+ } if
+ strokeBeam {
+ CurrUp draw CurrLow draw counttomark 1 add 6 roll
+ } if
+ PN IfcCnt eq ret tir eq or {
+ DrawnSegm 0 gt currentdict /fillBeam known and {
+ fillBeam newpath
+ /DrawnSegm 0 def
+ } if
+ ret tir eq {
+ IfcCnt PN sub {pop} repeat
+ (Total internal reflection occured, this is not supported)
+ Warning
+ } if
+ exit
+ } if
+ /PN PN 1 add def
+ /PrevPCenter /CurrPCenter load def
+ /PrevMode Mode def
+ CompName cvn load /correct get /PrevCorrect ED
+ } loop
+ DrawnSegm 0 gt currentdict /fillBeam known and {
+ fillBeam newpath
+ /DrawnSegm 0 def
+ } if
+ ret missed eq not {
+ CurrUp CurrLow @ABVect
+ CurrVecUp CurrVecLow 3 -1 roll add 3 1 roll add exch
+ 4 -1 roll mul 3 1 roll mul sub 0 gt {
+ /lastBeamPointTmpUp /CurrLow load def
+ /lastBeamPointTmpLow /CurrUp load def
+ /lastVecTmpUp /CurrVecLow load def
+ /lastVecTmpLow /CurrVecUp load def
+ } {
+ /lastBeamPointTmpLow /CurrLow load def
+ /lastBeamPointTmpUp /CurrUp load def
+ /lastVecTmpUp /CurrVecUp load def
+ /lastVecTmpLow /CurrVecLow load def
+ } ifelse
+ } if
+ DebugEnd
+} bind def
+/isAmbiguous {
+ cvn load dup /ambiguous known {
+ /ambiguous get
+ } {
+ pop false
+ } ifelse
+} bind def
+/isAmbiguousIfc {
+ cvn load dup /ambiguous known {
+ /ambIfc get eq
+ } {
+ pop pop false
+ } ifelse
+} bind def
+/isCurved {
+ cvn load begin
+ IfcName load /RX known
+ end
+} bind def
+/HandleInterface {
+ (HandleInterface) DebugBegin
+ /Yin ED /Xin ED /Y0 ED /X0 ED /n2 ED /mode ED
+ 2 copy 2 copy LoadIfc
+ 6 -2 roll isCurved { CurvedInterface }{ PlainInterface } ifelse
+ dup missed eq not useNA connectifc not and and {
+ 7 3 roll 2 copy 9 2 roll
+ 4 2 roll 2 copy
+ %% X0' Y0' Xout Yout status X0' Y0' IfcNum CompName IfcNum CompName
+ cvn load begin IfcName load dup /NAlow get exch /NAup get end
+ 2 copy lt {
+ 4 2 roll 2 copy LoadIfc NormalizeVec
+ 6 -2 roll isCurved {
+ neg exch
+ } if
+ %% ... X0' Y0' NAlow NAup X Y dXp dYp
+ 8 -2 roll 6 -2 roll
+ %% ... NAlow NAup dXp dYp X0' Y0' X Y
+ @ABVect DotProd
+ dup 4 -1 roll ge 3 1 roll ge and not
+ {
+ pop missed
+ } if
+ }{
+ 6 {pop} repeat
+ } ifelse
+ } {
+ 7 -2 roll pop pop
+ } ifelse
+ DebugEnd
+} bind def
+/LoadIfc {
+ (LoadIfc) DebugBegin
+ cvn load begin
+ IfcName load begin
+ X Y
+ CompMtrx transform CM itransform
+ currentdict /RX known { RX RY }{ DX DY } ifelse
+ CompMtrx dtransform CM idtransform
+ end
+ end
+ DebugEnd
+} bind def
+/isFreeray {
+ cvn load /n known
+ dup not {
+ (Encountered fiber component in beam path) Warning
+ } if
+} bind def
+/PrearrangePlanes {
+ (PrearrangePlanes) DebugBegin
+ counttomark /N ED
+ /CompA ED dup /CompB ED
+ CompA isFreeray {
+ CompA isAmbiguous {
+ amb dup CompA
+ } {
+ CompB isAmbiguous {
+ 1 CompA GetIfcCenter (C) CompB GetIfcCenter @ABDist
+ (N) CompA GetIfcCenter (C) CompB GetIfcCenter @ABDist
+ } {
+ 1 CompA GetIfcCenter
+ 1 CompB GetIfcCenter
+ (N) CompB GetIfcCenter
+ true OrderNodes exch pop
+ (N) CompA GetIfcCenter
+ 1 CompB GetIfcCenter
+ (N) CompB GetIfcCenter
+ true OrderNodes exch pop
+ } ifelse
+ le { desc } { asc } ifelse dup CompA
+ } ifelse
+ counttomark 2 roll
+ } {
+ counttomark 1 sub { pop } repeat
+ /N 0 def
+ } ifelse
+ 2 1 N {
+ /i ED exch /CompB ED
+ CompB isFreeray not {
+ counttomark i 1 sub 2 mul 1 add sub { pop } repeat
+ exit
+ } if
+ CompB isAmbiguous not {
+ dup desc eq { 1 } { dup amb eq { (C) }{ (N) } ifelse } ifelse
+ CompA GetIfcCenter
+ 1 CompB GetIfcCenter
+ (N) CompB GetIfcCenter false OrderNodes dup dup
+ 4 -1 roll CompA exch 5 -1 roll CompB exch
+ i 2 eq {
+ 4 copy 4 2 roll AdjustRelRot
+ } if
+ AdjustRelRot
+ } {
+ pop amb dup
+ } ifelse
+ CompB /CompA CompB def
+ counttomark 2 roll
+ } for pop
+ DebugEnd
+} bind def
+/AdjustRelRot {
+ (AdjustRelRot) DebugBegin
+ exch dup cvn load /adjustRel known {
+ dup dup 4 2 roll isAmbiguous {
+ exch pop (C)
+ }{
+ desc eq { (N) }{ 1 } ifelse
+ } ifelse
+ exch GetIfcCenter 5 3 roll
+ exch dup 3 1 roll isAmbiguous {
+ pop (C)
+ }{
+ desc eq { 1 }{ (N) } ifelse
+ } ifelse
+ exch GetIfcCenter
+ @ABVect exch atan exch
+ cvn load begin
+ adjustRel {
+ matrix rotate CompMtrx matrix concatmatrix /CompMtrx ED
+ /adjustRel false def
+ } {
+ pop
+ } ifelse
+ end
+ } {
+ pop pop pop pop
+ } ifelse
+ DebugEnd
+} bind def
+/PushAllPlanesOnStack {
+ (PushAllPlanesOnStack) DebugBegin
+ counttomark 2 div cvi /@N ED
+ 1 1 @N {
+ /last false def
+ /first false def
+ dup 1 eq {
+ /first true def pop beaminsidefirst
+ } {
+ @N eq {
+ beaminsidelast
+ /last true def
+ } {
+ beaminside
+ } ifelse
+ } ifelse
+ exch load dup dup /allowbeaminside get 4 -1 roll and
+ /drawinside ED
+ /ambiguous get {
+ /name get drawinside [ 3 1 roll ]
+ counttomark 1 roll pop
+ } {
+ begin
+ desc eq {
+ N N -1 1 1
+ } {
+ 1 1 1 N N
+ } ifelse
+ first startinside not and {
+ 5 -2 roll
+ pop pop
+ 2 copy 5 2 roll
+ } if
+ 5 1 roll
+ {
+ 3 1 roll 2 copy 5 -1 roll
+ dup 3 1 roll
+ eq first not and {
+ true
+ } {
+ drawinside
+ } ifelse
+ exch dup 4 -1 roll eq {
+ bgRefIndex
+ }{
+ name GetRefIndex
+ } ifelse
+ exch dup N eq {
+ pop (N)
+ } {
+ inttostr
+ } ifelse exch
+ 3 1 roll name
+ 4 1 roll
+ dup IfcName load /mode get
+ 3 1 roll 5 1 roll
+ [ 6 1 roll ] cvx counttomark 1 roll
+ last {
+ savebeampoints 1 ge stopinside not and
+ savebeampoints 1 lt beaminsidelast not and or {
+ exit
+ } if
+ } if
+ } for pop pop
+ end
+ } ifelse
+ } for
+ DebugEnd
+} bind def
+/IfcName {
+ dup dup 1 eq not exch N eq and {
+ pop (N)
+ } {
+ inttostr
+ } ifelse
+ (P@) exch strcat cvn
+} bind def
+/NodeName {
+ dup /stringtype eq not { inttostr } if
+ strcat (N@) exch strcat cvn
+} bind def
+/OrderNodes {
+ 7 1 roll 6 -2 roll 2 copy 8 2 roll
+ @ABDist 5 1 roll @ABDist 2 copy gt {
+ pop asc exch
+ } {
+ exch pop desc exch
+ } ifelse
+ 3 -1 roll not {
+ pop
+ } if
+} bind def
+/NormalVec {
+ neg exch 2 copy 6 2 roll DotProd 0 gt {
+ -1 mul exch -1 mul exch
+ } if
+ NormalizeVec
+} bind def
+/DotProd {
+ 3 -1 roll mul 3 1 roll mul add
+} bind def
+/VecAngle {
+ 4 copy 4 copy DotProd 5 1 roll
+ tx@Dict begin
+ Pyth 3 1 roll Pyth
+ end mul
+ div Acos
+ 5 2 roll mul 4 1 roll 3 -1 roll mul 3 -1 roll sub
+ 0 le { -1 }{ 1 } ifelse mul
+} bind def
+/VecAdd {
+ 3 -1 roll add 3 1 roll add exch
+} bind def
+/VecScale {
+ dup 4 -1 roll mul 3 1 roll mul
+} bind def
+/ToVec {
+ [ 3 1 roll ] cvx
+} bind def
+/AngToVec {
+ dup cos exch sin ToVec
+} bind def
+/NormalizeVec {
+ 2 copy
+ tx@Dict begin
+ Pyth
+ end
+ dup 3 1 roll div 3 1 roll div exch
+} bind def
+/@ABVect {
+ tx@EcldDict begin ABVect end
+} bind def
+/@ABDist {
+ tx@EcldDict begin ABDist end
+} bind def
+/@InterLines {
+ tx@EcldDict begin
+ EqDr /D1c exch def /D1b exch def /D1a exch def
+ EqDr /D2c exch def /D2b exch def /D2a exch def
+ D1a D2b mul D1b D2a mul sub dup
+ ZeroEq { % parallel lines
+ pop 0 0 missed
+ }{
+ /Det exch def
+ D1b D2c mul D1c D2b mul sub Det div
+ D1a D2c mul D2a D1c mul sub Det div
+ ok
+ } ifelse
+ end
+} bind def
+/@GetCenter {
+ tx@NodeDict begin load GetCenter end
+} bind def
+/@NewNode {
+ tx@NodeDict begin
+ false exch 10 {InitPnode } NewNode
+ end
+} bind def
+/RefractVec {
+ (RefractVec) DebugBegin
+ TransformRefIndex exch TransformRefIndex exch div /n ED
+ /Ynorm ED /Xnorm ED
+ NormalizeVec /Yin ED /Xin ED
+ n abs 1 eq {
+ Xin Yin
+ }{
+ /costheta1 Xnorm Ynorm Xin neg Yin neg DotProd def
+ 1 n dup mul 1 costheta1 dup mul sub mul sub
+ dup 0 lt {
+ pop 0 0
+ } {
+ sqrt /costheta2 ED
+ n Xin mul n Yin mul
+ n costheta1 mul costheta2 sub dup
+ Xnorm mul exch Ynorm mul VecAdd
+ } ifelse
+ } ifelse
+ DebugEnd
+} bind def
+/ReflectVec {
+ (ReflectVec) 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
+ tx@Dict begin Pyth end /radius ED /Yp ED /Xp ED
+ /X0n X0 Xp sub def /Y0n Y0 Yp sub def
+ tx@EcldDict begin
+ X0n Y0n 2 copy 2 copy Xin 3 -1 roll add Yin 3 -1 roll add
+ 2 copy 6 2 roll EqDr radius InterLineCircle
+ end
+ 4 copy
+ 0 eq 3 {exch 0 eq and} repeat {
+ missed
+ } {
+ 4 copy
+ Xr neg Yr neg 2 copy
+ 8 -2 roll @ABDist
+ 5 1 roll @ABDist
+ gt {
+ 4 2 roll
+ } if pop pop
+ Xp Yp VecAdd
+ 2 copy Xp Yp 4 2 roll @ABVect exch neg Xin Yin 4 2 roll NormalVec
+ Xin Yin 4 2 roll
+ mode trans eq {
+ n1 n2 RefractVec
+ 2 copy 0 eq exch 0 eq and { tir } { ok } ifelse
+ } {
+ ReflectVec ok
+ } ifelse /n1 n2 def
+ 5 -2 roll 2 copy 7 2 roll X0 Y0 @ABVect Xin Yin DotProd 0 lt
+ PN 1 gt and {
+ pop missed
+ } if
+ } ifelse
+ DebugEnd
+} bind def
+/PlainInterface {%
+ (PlainInterface) DebugBegin
+ /dYp ED /dXp ED /Yp ED /Xp ED
+ Xp Yp Xp dXp add Yp dYp add X0 Y0 X0 Xin add Y0 Yin add
+ @InterLines missed eq {
+ 0 0 missed
+ } {
+ Xin Yin Xin Yin dXp dYp NormalVec
+ mode trans eq {
+ n1 n2 RefractVec
+ 2 copy 0 eq exch 0 eq and { tir } { ok } ifelse
+ } {
+ ReflectVec ok
+ } ifelse /n1 n2 def
+ 5 -2 roll 2 copy 7 2 roll X0 Y0 @ABVect Xin Yin DotProd 0 lt
+ PN 1 gt and {
+ pop missed
+ } if
+ } ifelse
+ DebugEnd
+} bind def
+/TransformRefIndex {
+ dup bgRefIndex eq { pop 1 } if
+} bind def
+/GetRefIndex {
+ cvn load /n get /nbeam load exch
+ EvalRefIndex
+} bind def
+/EvalRefIndex {
+ dup bgRefIndex eq not {
+ 1 dict begin
+ /n ED
+ exec
end
+ } if
+} bind def
+/Sellmaier {
+ dup mul
+ dup dup 1.03961212 mul exch 6000.69867 sub div
+ exch dup dup 0.231792344 mul exch 20017.9144 sub div
+ exch dup 1.01046945 mul exch 103.560653e6 sub div
+ add add 1 add sqrt
+} bind def
+/TangentCrosspoint {
+ 4 copy 4 copy 14 -2 roll 2 copy
+ 6 2 roll @ABVect neg exch
+ 6 2 roll @ABVect neg exch
+ 8 -2 roll VecAdd 10 2 roll VecAdd
+ @InterLines pop
+} bind def
+/NearestNodeTmp {
+ exch /NodeB ED
+ /dist -1 def
+ dup cvn load /N get dup 1 eq {
+ [ exch (N) ]
+ } {
+ [ exch 1 1 3 -1 roll { } for ]
+ } ifelse
+ {
+ 2 copy pop
+ GetIfcCenterCorr 2 copy
+ NodeB @ABDist
+ dist 0 lt {
+ /dist ED
+ ToVec /node ED
+ } {
+ dup dist lt {
+ /dist ED
+ ToVec /node ED
+ } {
+ pop pop pop
+ } ifelse
+ } ifelse
+ } forall
+ pop dist /node load
+} bind def
+/NearestNode {
+ (NearestNode) DebugBegin
+ dup xcheck not { nametostr } if /CompB ED
+ dup xcheck not {
+ nametostr /CompA ED
+ /CompB load dup xcheck not {
+ /mindist -1 def
+ [ exch false GetInternalNodeNames ]
+ { @GetCenter ToVec
+ CompA NearestNodeTmp
+ exch dup mindist ge mindist 0 ge and {
+ pop pop
+ }{
+ /mindist ED /minnodeA ED
+ } ifelse
+ } forall
+ minnodeA
+ } {
+ CompA NearestNodeTmp exch pop exec
+ } ifelse
+ } {
+ exec
+ } ifelse
+ DebugEnd
} bind def
-%
-% defaultbasicnodename basicnodename CloseOptexpComp
-/CloseOptexpComp {% def
- 2 copy eq {
- exch pop [ exch false GetInternalNodeNames ] { tx@NodeDict exch undef } forall
- } { pop pop } ifelse
-} bind def
-%
-% xa ya xb yb ExchCoor true|false
-/ExchCoor {% def
- exch 4 -1 roll% ya yb xb xa
- 2 copy % ya yb xb xa
- gt
- { pop pop pop pop false } % xB > xA
- { eq % xA == xB
- 3 1 roll gt % yA < yB
- and
- { false }
- { true } ifelse
+/RelFiberAngle {
+ (RelFiberAngle) DebugBegin
+ /fiberalign ED
+ dup xcheck not { nametostr } if /CompB ED
+ dup xcheck not { nametostr } if /CompA ED
+ /CompA load xcheck {
+ /CompB load xcheck {
+ @ABVect exch atan
+ } {
+ 4 copy @ABVect 6 2 roll pop pop 2 copy
+ CompB (Center) NodeName @GetCenter
+ 4 2 roll @ABVect 4 2 roll
+ CompB
+ fiberalign center eq {
+ RelFiberAngle@center
+ }{
+ RelFiberAngle@ref
+ } ifelse
+ 2 copy exch atan
+ 7 3 roll 2 copy 9 -2 roll
+ DotProd 0 gt 5 1 roll DotProd 0 gt xor { 180 add } if
} ifelse
+ } {
+ 4 2 roll pop pop 2 copy
+ CompA (Center) NodeName @GetCenter
+ 4 2 roll @ABVect 4 2 roll
+ CompA fiberalign center eq {
+ RelFiberAngle@center
+ }{
+ RelFiberAngle@tref
+ } ifelse
+ 2 copy exch atan
+ 5 1 roll DotProd 0 gt { 180 add } if
+ } ifelse
+ DebugEnd
+} bind def
+/RelFiberAngle@ref {
+ 3 1 roll pop pop
+ dup (A) NodeName exch (B) NodeName
+ @GetCenter 3 -1 roll @GetCenter @ABVect
+} bind def
+/RelFiberAngle@tref {
+ 3 1 roll pop pop
+ dup (TrefA) NodeName exch (TrefB) NodeName
+ @GetCenter 3 -1 roll @GetCenter @ABVect
+} bind def
+/RelFiberAngle@center {
+ (Center) NodeName @GetCenter 4 2 roll @ABVect
+} bind def
+/getsubnode {
+ dup xcheck {
+ exch pop exec
+ } {
+ nametostr exch nametostr exch GetIfcCenter
+ } ifelse
+} bind def
+/connectInterfaces {
+ /relAngleTmp ED
+ PN 2 eq {
+ pop @ABVect NormalizeVec 4 2 roll VecAngle /relAngleTmp ED
+ } if
+ PN 3 ge {
+ trans eq {
+ @ABVect NormalizeVec 4 2 roll pop pop % remove Vec from stack
+ relAngleTmp matrix rotate dtransform
+ 4 2 roll pop pop
+ } {
+ @ABVect NormalizeVec 4 2 roll VecAngle /relAngleTmp ED
+ } ifelse
+ } if
+ relAngleTmp
+} bind def
+/GetCompRange {
+ 2 copy gt { 1 }{ -1 } ifelse 3 -1 roll
+ { exch dup 3 -1 roll inttostr strcat exch} for
+ pop
+} bind def
+/CorrectDipoleIfc {
+ (CorrectDipoleIfc) DebugBegin
+ dup dup 3 copy
+ 8 -1 roll dup 9 1 roll NodeName exch 7 -1 roll dup 7 1 roll NodeName
+ gsave
+ tx@Dict begin
+ STV CP T
+ exch @GetCenter 3 -1 roll @GetCenter
+ end
+ grestore
+ 4 copy @ABDist 1e-7 lt {
+ 6 -1 roll
+ gsave
+ tx@Dict begin
+ STV CP T
+ (TrefA) NodeName @GetCenter 7 -1 roll
+ (TrefB) NodeName @GetCenter
+ end
+ grestore
+ @ABVect NormalizeVec 2 copy
+ 8 -2 roll abs exch abs max -1e-6 mul VecScale
+ 8 -2 roll cvn load begin
+ IfcName load begin
+ X Y VecAdd /YCorr exch def /XCorr exch def
+ end
+ end
+ 4 2 roll abs exch abs max 1e-6 mul VecScale
+ 4 2 roll cvn load begin
+ IfcName load begin
+ X Y VecAdd /YCorr exch def /XCorr exch def
+ end
+ end
+ } {
+ 10 { pop } repeat
+ } ifelse
+ DebugEnd
+} bind def
+/debug {
+ /@N ED count dup @N gt @N 0 ge and { pop @N } if
+ copy @N { == } repeat
+} bind def
+/debugComp {
+ dup (debug comp ") exch strcat ("===============) strcat ==
+ cvn load {
+ dup type /dicttype eq {
+ (plane----------------) ==
+ { == == } forall
+ (-----------done) ==
+ } { == } ifelse
+ ==
+ } forall
+ (================== done) ==
} bind def
end % tx@OptexpDict
diff --git a/Master/texmf-dist/source/latex/pst-optexp/Makefile b/Master/texmf-dist/source/latex/pst-optexp/Makefile
new file mode 100644
index 00000000000..b14ceed4ba1
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pst-optexp/Makefile
@@ -0,0 +1,103 @@
+.SUFFIXES : .tex .ltx .dvi .ps .pdf .eps
+
+PACKAGE = pst-optexp
+
+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
+
+PS2PDF = GS_OPTIONS=-dPDFSETTINGS=/prepress ps2pdf
+
+all : doc doc-DE quickref
+
+doc : $(PACKAGE).pdf
+
+doc-DE : $(PACKAGE)-DE.pdf
+
+quickref: $(PACKAGE)-quickref.pdf
+
+dist : doc doc-DE quickref Changes
+ tar chvzf $(ARCHNAME).tar.gz $(ARCHFILES)
+ @ echo
+ @ echo $(ARCHNAME).tar.gz
+
+$(PACKAGE).dvi: L = english
+$(PACKAGE)-DE.dvi: L = ngerman
+%.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}'
+ 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 \
+ -o $(basename $@)-doc.ind $(basename $@)-doc.idx; \
+ fi
+ $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{$(PACKAGE).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 \
+ -o $(basename $@)-doc.ind $(basename $@)-doc.idx; \
+ fi
+ $(LATEX) -jobname=$(basename $@) '\newcommand*{\mainlang}{$(L)}\input{$(PACKAGE).dtx}'
+
+%.ps: %.dvi
+ dvips $<
+%.pdf: %.ps
+ $(PS2PDF) $< $@
+
+$(PACKAGE)-quickref.tex: $(PACKAGE)-quickref.py
+ python $<
+
+$(PACKAGE)-quickref.pdf: $(PACKAGE)-quickref.tex
+ pdflatex $<
+
+$(PACKAGE).sty $(PACKAGE).pro $(PACKAGE).tex $(PACKAGE).ist: $(PACKAGE).ins $(PACKAGE).dtx
+ tex $<
+
+Changes: Changes.py $(PACKAGE).dtx
+ python $<
+
+arch : Changes
+ zip $(ARCHNAME).zip $(ARCHFILES)
+
+arch-tds : Changes
+ $(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/
+ 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
+
+clean :
+ $(RM) $(foreach prefix, $(PACKAGE) $(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
diff --git a/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.dtx b/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.dtx
new file mode 100644
index 00000000000..2ed32458777
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.dtx
@@ -0,0 +1,17412 @@
+% \iffalse meta-comment
+%
+% Copyright (C) 2007-2012 by Christoph Bersch <usenet@bersch.net>
+%
+% This work may be distributed and/or modified under the
+% conditions of the LaTeX Project Public License, either version 1.3c
+% of this license or (at your option) any later version.
+% The latest version of this license is in
+% http://www.latex-project.org/lppl.txt
+% and version 1.3c or later is part of all distributions of LaTeX
+% version 2008/05/04 or later.
+% \fi
+%
+% \iffalse
+%<*driver>
+\ProvidesFile{pst-optexp.dtx}
+%</driver>
+%<stylefile>\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+%<stylefile>\ProvidesPackage{pst-optexp}
+%<*stylefile>
+ [2012/07/09 v3.0 Optical experimental setups with PSTricks]
+%</stylefile>
+%
+%<*driver>
+\documentclass[a4paper, DIV=9, oneside, toc=index, parskip=half-]{scrreprt}
+\usepackage{doc}
+\setcounter{IndexColumns}{2}
+\usepackage[utf8]{inputenc}
+\usepackage[T1]{fontenc}
+\usepackage{lmodern}
+\usepackage{amsmath, marvosym}
+\usepackage{bera}
+\providecommand*\mainlang{}
+\usepackage[ngerman, english,\mainlang]{babel}
+\usepackage{prettyref}
+\usepackage[dvipsnames,x11names,svgnames]{xcolor}
+\usepackage{array,booktabs,paralist,tabularx}
+\usepackage{ragged2e, calc}
+\newlength{\POEcaptionmargin}
+\newlength{\POEcaptionheight}
+\usepackage[labelfont={color=DOrange},
+ singlelinecheck=false,
+ justification=raggedright]{caption}
+\DeclareCaptionFormat{poe}{%
+ \setlength{\POEcaptionmargin}{\widthof{#1}+7pt}%
+ \setlength{\POEcaptionheight}{\heightof{#1}+3pt}%
+ \hspace*{-\POEcaptionmargin}#1\par\vspace*{-\POEcaptionheight}%
+}
+\captionsetup[lstlisting]{format=poe, skip=0pt}
+\usepackage{nicefrac}
+\usepackage{pst-func}
+\usepackage{pst-optexp}
+\usepackage{pst-circ}
+\usepackage[makeindex]{splitidx}
+\usepackage{hypdoc}
+\hypersetup{%
+ colorlinks=true,
+ urlcolor=black,
+ linkcolor=pdflinkcolor,
+ breaklinks,
+ linktocpage=true}
+\usepackage{breakurl}
+\definecolor{DOrange}{rgb}{1,.4,.2}%
+\definecolor{DDOrange}{rgb}{0.7, 0.23, 0.07}%
+\colorlet{pdflinkcolor}{DOrange}
+\colorlet{DGreen}{green!90!black}
+\usepackage{pst-tree}
+\usepackage{showexpl}
+\makeatletter\renewcommand*\SX@Info{}\makeatother
+\usepackage{etoolbox}
+\undef{\cs}\undef{\cmd}
+\usepackage{ltxdockit}
+\newcommand{\poeTR}[1]{\TR{\ttfamily\color{DOrange}#1}}
+\definecolor{colKeys}{rgb}{0,0,0}
+\definecolor{colIdentifier}{rgb}{0,0,0}
+\colorlet{colComments}{green!60!black}
+\definecolor{colString}{rgb}{0,0.5,0}
+\newlength{\codeoverhang}
+\setlength{\codeoverhang}{0.5\marginparwidth+\marginparsep}
+\lstset{%
+ language=[LaTeX]TeX, identifierstyle=\color{colIdentifier}, %
+ keywordstyle=\color{colKeys}, %
+ keywordstyle = [21]\color{DOrange}, %
+ keywordstyle = [22]\color{DOrange}, %
+ stringstyle=\color{colString}, %
+ commentstyle=\color{colComments}, %
+ float=hbp,%
+ basicstyle=\ttfamily\small, %
+ columns=flexible, %
+ tabsize=4, %
+ showspaces=false, %
+ showstringspaces=false, %
+ breaklines=true, %
+ breakautoindent=true, %
+ breakatwhitespace=true, %
+ captionpos=t, %
+ belowcaptionskip=0pt,%
+ abovecaptionskip=0pt,%
+ xleftmargin=1em, %
+ prebreak = {\raisebox{-1ex}[\ht\strutbox]{\kern0.5ex \large\Righttorque}},
+ rulecolor=\color{black!20}, %
+ texcsstyle = [20]\color{DDOrange},%!60!black},%{red!60!black}, %
+ moretexcs = [20]{lens, optbox, oenode, oenodeIn, oenodeExt, oenodeOut,
+ oenodeRefA, oenodeRefB, oenodeTrefA, oenodeTrefB, oenodeLabel, oenodeRotref,
+ oenodeBeam, oenodeBeamUp, oenodeBeamLow, oenodeCenter, oenodeIfc, optplate,
+ optretplate, pinhole, crystal,optdetector, optdiode, doveprism,
+ polarization, mirror, beamsplitter, optgrating, optprism, rightangleprism,
+ pentaprism, optdipole, optripole, optfiber, optamp, optmzm, optfilter,
+ polcontrol, optisolator, optswitch, fiberdelayline, optfiberpolarizer,
+ fibercollimator, optcoupler, wdmcoupler, wdmsplitter, optcirculator,
+ drawbeam, drawwidebeam, drawfiber, frontlayer, backlayer, newOptexpDipole,
+ newOptexpTripole, newOptexpFiberDipole,optplane}, %
+ morekeywords = [22] {optexp},
+ explpreset={%
+ pos=l, width=-99pt, hsep=5mm, overhang=\codeoverhang, varwidth,
+ vsep=\bigskipamount, rframe={}},
+ extendedchars=true,
+}
+\lstdefinestyle{example}{explpreset={%
+ escapechar=*, pos=l, width=-99pt, hsep=5mm, overhang=\codeoverhang,
+ varwidth, vsep=\bigskipamount, rframe={}}}
+\makeatletter
+\providecommand\ON{%
+ \gdef\lst@alloverstyle##1{\textcolor{black!50}{\strut##1}%
+}}
+\providecommand\OFF{\xdef\lst@alloverstyle##1{##1}}
+\makeatother
+\colorlet{sectioncolor}{DOrange}
+\addtokomafont{sectioning}{\color{sectioncolor}}
+\usepackage[automark,nouppercase]{scrpage2}
+\pagestyle{scrheadings}
+\clearscrheadings
+\clearscrplain
+\ohead{\pagemark}
+\ihead{\headmark}
+\ofoot[\pagemark]{}
+\automark[subsection]{section}
+\setheadsepline{.4pt}[\color{DOrange}]
+\setheadwidth[0pt]{text}
+\setfootwidth[0pt]{text}
+\makeatletter
+\patchcmd{\l@chapter}{1.5em}{2em}{}{}
+\renewcommand*\l@section{\bprot@dottedtocline{1}{1.5em}{3.0em}}
+\renewcommand*\l@subsection{\bprot@dottedtocline{2}{3.8em}{4.0em}}
+\newrobustcmd*{\fnurl}[1][]{\hyper@normalise\ltd@fnurl{#1}}
+\def\ltd@fnurl#1#2{\footnote{#1\hyper@linkurl{\Hurl{#2}}{#2}}}
+\makeatother
+\usepackage{csquotes}
+\MakeAutoQuote{«}{»}
+%^^A spot is used in ltxdockit.sty
+\colorlet{spot}{sectioncolor}
+\newpsstyle{Refline}{linecolor=gray!70}
+\newpsstyle{CenterNode}{linecolor=blue, dotstyle=x, dotscale=1.5}
+\colorlet{Refline}{gray!70}
+%^^A Fonts definitions used in ltxdockit.sty
+\renewcommand*{\verbatimfont}{\ttfamily}
+\renewcommand*{\displayverbfont}{\ttfamily}
+\renewcommand*{\marglistfont}{\spotcolor\sffamily\small}
+\renewcommand*{\margnotefont}{\sffamily\small}
+\renewcommand*{\optionlistfont}{\spotcolor\sffamily\displayverbfont}
+\renewcommand*{\ltxsyntaxfont}{\ttfamily}
+\renewcommand*{\ltxsyntaxlabelfont}{\spotcolor\displayverbfont}
+\renewcommand*{\changelogfont}{\normalfont}
+\renewcommand*{\changeloglabelfont}{\spotcolor\sffamily\bfseries}
+
+\makeatletter
+%^^A an idea from GL to provide links inside the listings to the pst-optexp commands:
+%^^A <https://groups.google.com/groups/search?as_umsgid=4d89ee49%240%2418590%24426a74cc%40news.free.fr>
+\providerobustcmd*\ifrefundefined [1]{%
+ \begingroup%
+ \csname @safe@activestrue\endcsname%
+ \expandafter\endgroup\csname @\ifcsname r@#1\endcsname second\else first\fi oftwo\endcsname
+}% \ifrefundefined
+\def\lsthk@OutputBox@H@@k{%
+ \begingroup%
+ \let\lst@UM\@empty%
+ \edef\@tempc{cmd:\detokenize\expandafter{\the\lst@token }}%\edef
+ \ifrefundefined{\@tempc}%
+ \endgroup%
+ \sethyperlistings%
+}% \lsthk@OutputBox@H@@k
+\def\sethyperlistings {\global\let \hyperlistingsreference =\@tempc
+ \endgroup \aftergroup \dohyperlistings }% after \hbox
+\def\dohyperlistings {\def\lst@alloverstyle ##1{\hyperlistings ##1}}
+\def\hyperlistings{%
+ \setbox\@tempboxa\hbox%
+ \bgroup%
+ \rlap{\hypersetup {linkcolor=.}\relax\fboxrule\z@%
+ \hyperref[\hyperlistingsreference]{\boxframe{\wd\@tempboxa}{\ht\@tempboxa}{\dp\@tempboxa}}}%
+ \unhbox\@tempboxa%
+ \egroup%
+}% \hyperlistings
+\let\lsthk@OutputBox\lsthk@OutputBox@H@@k
+
+\newenvironment*{stylelist}
+ {\list{}{%
+ \setlength{\labelwidth}{\marglistwidth}%
+ \setlength{\labelsep}{0.5\marglistsep}%
+ \setlength{\leftmargin}{0pt}%
+ \renewcommand*{\makelabel}[1]{\hss\optionlistfont##1}}%
+ \let\styleitem\POE@styleitem}%
+ {\endlist}
+
+\def\ltd@optionlist{%
+ \let\optitem\POE@optitem
+ \let\valitem\POE@valitem
+ \let\choitem\POE@choitem
+ \let\boolitem\POE@boolitem
+ \let\intitem\POE@intitem
+ \let\numitem\POE@numitem
+ \let\psnumitem\POE@psnumitem
+ \let\poeitem\ltd@item
+ \let\styleitem\POE@styleitem}
+
+\def\POE@styleitem{%
+ \@ifnextchar[%]
+ {\POE@styleitem@i}
+ {\POE@styleitem@i[]}
+}
+\def\POE@styleitem@i[#1]#2{%
+ \item[{#2}]%
+ \label{prm:#2}%
+ \begingroup\raggedright
+ \prm{psstyle}%
+ \settowidth\@tempdimb{\prm{psstyle}}%
+ \settowidth\@tempdimc{#2}%
+ \@tempdimc=\dimexpr\@tempdimc+\labelsep-\labelwidth\relax
+ \ifdim\@tempdimc>0pt%
+ \@tempdima=\dimexpr\linewidth-\@tempdimb-\@tempdimc\relax
+ \else
+ \@tempdima=\dimexpr\linewidth-\@tempdimb\relax
+ \fi
+ \ifblank{#1}
+ {}
+ {\parbox[t]{\@tempdima}{\raggedleft default:~\ltd@textverb{#1}}}%
+ \par\endgroup}
+
+\def\POE@optitem{%
+ \@ifstar
+ {\boolfalse{@tempswa}\POE@optitem@i}
+ {\booltrue{@tempswa}\POE@optitem@i}}
+\newcommand*{\POE@optitem@i}[3][]{%
+ \ifbool{@tempswa}{\label{prm:#2}}{}%
+ \xLkeyword{#2}%
+ \ifblank{#1}
+ {\ltd@option{#2}{#2}{#3}{}}
+ {\ltd@option{#2}{#2}{#3}{\ltd@textverb{#1}}}}%
+
+\def\POE@valitem{%
+ \@ifstar
+ {\boolfalse{@tempswa}\POE@valitem@i}
+ {\booltrue{@tempswa}\POE@valitem@i}}
+\newcommand*{\POE@valitem@i}[3][]{%
+ \ifbool{@tempswa}{\label{prm:#2}}{}%
+ \xLkeyword{#2}%
+ \ifblank{#1}
+ {\ltd@option{#2}{#2}{\prm{#3}}{}}
+ {\ltd@option{#2}{#2}{\prm{#3}}{\ltd@textverb{#1}}}}%
+
+\def\POE@choitem{%
+ \@ifstar
+ {\boolfalse{@tempswa}\POE@choitem@i}
+ {\booltrue{@tempswa}\POE@choitem@i}}
+\newcommand*{\POE@choitem@i}[3][]{%
+ \ifbool{@tempswa}{\label{prm:#2}}{}%
+ \xLkeyword{#2}%
+ \ifblank{#1}
+ {\ltd@option{#2}{#2}{\ltd@verblist{#3}}{}}
+ {\ltd@option{#2}{#2}{\ltd@verblist{#3}}{\ltd@textverb{#1}}}}%
+
+\def\POE@boolitem{%
+ \@ifstar
+ {\boolfalse{@tempswa}\POE@boolitem@i}
+ {\booltrue{@tempswa}\POE@boolitem@i}}
+\newcommand*{\POE@boolitem@i}[2][]{%
+ \ifbool{@tempswa}{\label{prm:#2}}{}%
+ \xLkeyword{#2}%
+ \ifblank{#1}
+ {\ltd@option{#2}{#2}{\ltd@verblist{true,false}}{}}
+ {\ltd@option{#2}{#2}{\ltd@verblist{true,false}}{\ltd@textverb{#1}}}}%
+
+\def\POE@intitem{%
+ \@ifstar
+ {\boolfalse{@tempswa}\POE@intitem@i}
+ {\booltrue{@tempswa}\POE@intitem@i}}
+\newcommand*{\POE@intitem@i}[2][]{%
+ \ifbool{@tempswa}{\label{prm:#2}}{}%
+ \xLkeyword{#2}%
+ \ifblank{#1}
+ {\ltd@option{#2}{#2}{\prm{int}}{}}
+ {\ltd@option{#2}{#2}{\prm{int}}{\ltd@textverb{#1}}}}%
+
+\def\POE@numitem{%
+ \@ifstar
+ {\boolfalse{@tempswa}\POE@numitem@i}
+ {\booltrue{@tempswa}\POE@numitem@i}}
+\newcommand*{\POE@numitem@i}[2][]{%
+ \ifbool{@tempswa}{\label{prm:#2}}{}%
+ \xLkeyword{#2}%
+ \ifblank{#1}
+ {\ltd@option{#2}{#2}{\prm{num}}{}}
+ {\ltd@option{#2}{#2}{\prm{num}}{\ltd@textverb{#1}}}}%
+
+\def\POE@psnumitem{%
+ \@ifstar
+ {\boolfalse{@tempswa}\POE@psnumitem@i}
+ {\booltrue{@tempswa}\POE@psnumitem@i}}
+\newcommand*{\POE@psnumitem@i}[2][]{%
+ \ifbool{@tempswa}{\label{prm:#2}}{}%
+ \xLkeyword{#2}%
+ \ifblank{#1}
+ {\ltd@option{#2}{#2}{\prm{psnum}}{}}
+ {\ltd@option{#2}{#2}{\prm{psnum}}{\ltd@textverb{#1}}}}%
+
+\def\ltd@cmditem@ii#1#2{%
+ \ltd@itemsave
+ \ifhmode
+ \itemsep-\topsep
+ \else
+ \ltd@itembreak
+ \fi
+ \item[#1]%
+ \ltd@itemrest
+ \ifblank{#2}{}{\label{cmd:#2}}%
+ \begingroup
+ \ltd@syntaxsetup
+ \ltxsyntaxfont
+ \let\@tempa\@empty
+ \ltd@parseargs}
+
+
+\let\plainllap\llap
+\newrobustcmd\macro@llap[1]{{\global\let\llap\plainllap
+ \setbox0=\hbox\bgroup \macro@font\small\saved@macroname\egroup
+ \ifdim\wd0>30mm
+ \hbox to\z@ \bgroup\hss \hbox to30mm{\unhcopy0\hss}\egroup
+ \edef\@tempa{\hskip\dimexpr\the\wd0-30mm}\global\everypar\expandafter{\the\expandafter\everypar
+ \@tempa \global\everypar{}}%
+ \else \llap{\unhbox0}\fi}}
+ \AtBeginEnvironment{macro}{\let\llap\macro@llap}
+\makeatother
+
+\newcommand*{\PSstring}[1]{{\normalfont\small\ttfamily(#1)}}
+\newcommand*{\PSarray}[1]{{\normalfont\small\ttfamily[#1]}}
+\newcommand*{\PSname}[1]{{\normalfont\small\ttfamily/#1}}
+\newcommand*{\PSproc}[1]{{\normalfont\small\ttfamily\textbraceleft #1\textbraceright}}
+\newcommand*{\PSvar}[1]{{\normalfont\small\ttfamily #1}}
+\newcommand*{\PSop}[1]{{\normalfont\small\ttfamily\color{DOrange}\hskip 3pt #1\hskip 3pt}}
+
+\newcommand*{\nodename}[1]{\emph{#1}}
+\newcommand*{\param}[1]{\normalfont\texttt{#1}}
+\newcommand*{\paramvalue}[1]{\texttt{#1}}
+\newcommand*{\styleshape}[1]{\texttt{#1}}
+\newcommand{\docindex}[1]{\sindex[doc]{#1|hyperpage}}
+\makeatletter
+\def\Lcs{\@ifstar{\Lcs@nobm}{\Lcs@bm}}
+\def\Lcs@nobm#1{\nxLcs{#1}\xLcs{#1}}
+\def\Lcs@bm#1{\hyperref[cmd:#1]{\Lcs@nobm{#1}}}
+\def\xLcs#1{\docindex{#1=\nxLcs{#1}}\docindex{\POEindexMacro!#1=\nxLcs{#1}}}
+\def\nxLcs#1{\texttt{\textbackslash#1}}
+
+\def\LPack#1{\texttt{#1}\docindex{#1=\texttt{#1}}\docindex{\POEindexPackage!#1=\texttt{#1}}}
+\def\nxLPack#1{\texttt{#1}}
+
+\def\Lenv{\@ifstar{\Lenv@nobm}{\Lenv@bm}}
+\def\Lenv@nobm#1{\nxLenv{#1}\xLenv{#1}}
+\def\Lenv@bm#1{\hyperref[env:#1]{\Lenv@nobm{#1}}}
+\def\xLenv#1{\docindex{#1=\texttt{#1}}\docindex{\POEindexEnv!#1=\texttt{#1}}}
+\def\nxLenv#1{\texttt{#1}}
+\let\orig@ltd@envitem\ltd@envitem
+\def\ltd@envitem#1{\orig@ltd@envitem{#1}\label{env:#1}\xLenv{#1}}
+
+\def\Lkeyword{\@ifstar{\Lkeyword@nobm}{\Lkeyword@bm}}
+\def\Lkeyword@nobm#1{\texttt{#1}\xLkeyword{#1}}
+\def\Lkeyword@bm#1{\hyperref[prm:#1]{\Lkeyword@nobm{#1}}}
+\def\xLkeyword#1{\docindex{#1=\texttt{#1}}\docindex{\POEindexKeyword!#1=\texttt{#1}}}
+\def\nxLkeyword#1{\texttt{#1}}
+
+\def\xLoption#1{\docindex{#1=\texttt{#1}}\docindex{\POEindexOption!#1=\texttt{#1}}}
+\def\Loption#1{\texttt{#1}\xLoption{#1}}
+\def\nxLoption#1{\texttt{#1}}
+
+\def\Lstyle{\@ifstar{\Lstyle@nobm}{\Lstyle@bm}}
+\def\Lstyle@nobm#1{\texttt{#1}\xLstyle{#1}}
+\def\Lstyle@bm#1{\hyperref[prm:#1]{\Lstyle@nobm{#1}}}
+\def\xLstyle#1{\docindex{#1=\texttt{#1}}\docindex{\POEindexStyle!#1=\texttt{#1}}}
+\def\nxLstyle#1{\texttt{#1}}
+
+\def\Ldipole#1{\nxLcs{#1}\xLdipole{#1}}
+\def\xLdipole#1{\docindex{#1=\nxLcs{#1}}\docindex{\POEindexDipoles!#1=\nxLcs{#1}}}
+
+\def\Ltripole#1{\nxLcs{#1}\xLtripole{#1}}
+\def\xLtripole#1{\docindex{#1=\nxLcs{#1}}\docindex{\POEindexTripoles!#1=\nxLcs{#1}}}
+
+\def\Lfdipole#1{\nxLcs{#1}\xLfdipole{#1}}
+\def\xLfdipole#1{\docindex{#1=\nxLcs{#1}}\docindex{\POEindexFiberDipoles!#1=\nxLcs{#1}}}
+
+\def\Lfmultipole#1{\nxLcs{#1}\xLfmultipole{#1}}
+\def\xLfmultipole#1{\docindex{#1=\nxLcs{#1}}\docindex{\POEindexFiberMultipoles!#1=\nxLcs{#1}}}
+\makeatother
+
+\newcommand{\dipoledesc}[1]{%
+ \xLdipole{#1}%
+ \cmditem{#1}[options](in)(out){label}%
+}
+\newcommand{\tripoledesc}[1]{%
+ \xLtripole{#1}%
+ \cmditem{#1}[options](in)(center)(out){label}%
+}
+
+\newcommand{\fiberdipoledesc}[1]{%
+ \xLfdipole{#1}%
+ \cmditem{#1}[options](in)(out){label}%
+}
+
+\newenvironment*{pssyntax}
+ {\list{}{\small
+ \setlength{\labelsep}{0pt}%
+ \setlength{\leftmargin}{10pt}%
+ \item[]}}
+ {\endlist}
+
+\newcommand{\psarglistfont}{\small}
+\newenvironment*{psarglist}
+ {\list{}{%
+ \setlength{\labelwidth}{10pt}%
+ \setlength{\labelsep}{0pt}%
+ \setlength{\leftmargin}{0pt}%
+ \setlength{\itemsep}{\parsep}%
+ \setlength{\parsep}{0pt}%
+ \renewcommand*{\makelabel}[1]{\hss\psarglistfont##1}}}
+ {\endlist}
+
+\makeatletter
+\renewenvironment{theglossary}{\GlossaryParms \let\item\@idxitem \ignorespaces}{}
+\makeatother
+\def\psargitem#1{\item[#1]\hfill\par\nobreak}
+
+\addtopsstyle{Fiber}{linecolor=DOrange,linewidth=1.5\pslinewidth}
+\addtopsstyle{Beam}{linewidth=1.5\pslinewidth}
+\EnableCrossrefs
+\CodelineIndex
+\OnlyDescription
+\begin{document}
+ \DocInput{pst-optexp.dtx}
+ \begin{otherlanguage}{english}
+ \printindex[idx]
+ \end{otherlanguage}
+\end{document}
+%</driver>
+% \fi
+%
+% \CheckSum{0}
+%
+% \CharacterTable
+% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
+% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
+% Digits \0\1\2\3\4\5\6\7\8\9
+% Exclamation \! Double quote \" Hash (number) \#
+% Dollar \$ Percent \% Ampersand \&
+% Acute accent \' Left paren \( Right paren \)
+% Asterisk \* Plus \+ Comma \,
+% Minus \- Point \. Solidus \/
+% Colon \: Semicolon \; Less than \<
+% Equals \= Greater than \> Question mark \?
+% Commercial at \@ Left bracket \[ Backslash \\
+% Right bracket \] Circumflex \^ Underscore \_
+% Grave accent \` Left brace \{ Vertical bar \|
+% Right brace \} Tilde \~}
+%
+% \GetFileInfo{pst-optexp.dtx}
+%
+% \DoNotIndex{\@,\g@addto@macro,\newif,\gdef,\xdef,\newcounter,\or,\ifcase,\\}
+% \DoNotIndex{\newcommand,\newenvironment,\def,\edef,\let,\if,\ifx,\else,\fi,\@ifnextchar}
+% \DoNotIndex{\space,\relax,\nr,\val,\ignorespaces,\ifdim,\ifcat,\@nil,\@none,\@empty}
+% \DoNotIndex{\PackageError,\PackageWarning,\advance,\csname,\endcsname,\bgroup,\egroup}
+% \DoNotIndex{\expandafter,\@@comp,\@postcode}
+% \DoNotIndex{\psset}
+% \DoNotIndex{\@wd,\@sz,\@ht,\@yshift,\@step,\@xl,\@sep,\@r,\@dp,\@altan,\@extpostcode}
+% \DoNotIndex{\@f@cnt,\@f@r,\@f@sep,\@hshift,\@bs@wd,\@c@caxisL,\@cnt,\@pstfalse,\@psttrue}
+% \DoNotIndex{\@th,\@rL,\@rR,\i,\long,\optexp@nodeA,\optexp@nodeB}
+% \DoNotIndex{\POE@temp,\POE@tempa,\POE@tempb,\POE@tempc,\POE@tempd}
+% \DoNotIndex{\POE@getref@b,\POE@getref@c,\POE@getref@l,\POE@getref@r,\POE@getref@t}
+% \DoNotIndex{\the,\toks@}
+%
+% \newif\ifGERMAN \GERMANfalse
+% \newif\ifENGLISH \ENGLISHfalse
+% \iflanguage{ngerman}{\GERMANtrue}{%
+% \iflanguage{german}{\GERMANtrue}{\GERMANfalse}}
+% \iflanguage{english}{\ENGLISHtrue}{\ENGLISHfalse}
+%
+% \ifGERMAN
+% \newrefformat{chap}{Kap.~\ref{#1}}
+% \newrefformat{sec}{Kap.~\ref{#1}}
+% \newrefformat{l}{Zeile~\ref{#1}}
+% \newrefformat{ex}{Bsp.~\ref{#1}}
+% \newrefformat{tab}{Tab.~\ref{#1}}
+% \newrefformat{fig}{Abb.~\ref{#1}}
+% \newindex[Quelltextindex]{idx}
+% \newindex[Dokumentationsindex]{doc}
+% \newcommand{\POEindexPackage}{Paket}
+% \newcommand{\POEindexMacro}{Makro}
+% \newcommand{\POEindexKeyword}{Schlüsselwort}
+% \newcommand{\POEindexEnv}{Umgebung}
+% \newcommand{\POEindexOption}{Option}
+% \newcommand{\POEindexStyle}{Stil}
+% \newcommand{\POEindexDipoles}{Zweipol}
+% \newcommand{\POEindexTripoles}{Dreipol}
+% \newcommand{\POEindexFiberDipoles}{Faserzweipol}
+% \newcommand{\POEindexFiberMultipoles}{Fasermultipol}
+% \renewcommand*\lstlistingname{Bsp.}
+% \fi
+% \ifENGLISH
+% \newrefformat{chap}{Sec.~\ref{#1}}
+% \newrefformat{sec}{Sec.~\ref{#1}}
+% \newrefformat{l}{Line~\ref{#1}}
+% \newrefformat{ex}{Ex.~\ref{#1}}
+% \newrefformat{tab}{Tab.~\ref{#1}}
+% \newrefformat{fig}{Fig.~\ref{#1}}
+% \newindex[Code index]{idx}
+% \newindex[Documentation index]{doc}
+% \newcommand{\POEindexPackage}{Package}
+% \newcommand{\POEindexMacro}{Macro}
+% \newcommand{\POEindexKeyword}{Keyword}
+% \newcommand{\POEindexEnv}{Environment}
+% \newcommand{\POEindexOption}{Option}
+% \newcommand{\POEindexStyle}{Style}
+% \newcommand{\POEindexDipoles}{Dipoles}
+% \newcommand{\POEindexTripoles}{Tripoles}
+% \newcommand{\POEindexFiberDipoles}{Fiber dipoles}
+% \newcommand{\POEindexFiberMultipoles}{Fiber multipoles}
+% \renewcommand*\lstlistingname{Ex.}
+% \fi
+%
+% \newcommand{\refpointexplanation}{%
+% \ifGERMAN
+% Analog zum Referenzpunkt von \nxLcs{rput}, kann jede Kombination von
+% \opt{c} (mittig), \opt{t} (oben), \opt{b} (unten), \opt{l} (links) und
+% \opt{r} (rechts) sein.
+% \fi
+% \ifENGLISH
+% Like the reference point of \nxLcs{rput}, can be any comination of
+% \opt{c} (center), \opt{t} (top), \opt{b} (bottom), \opt{l} (left), and
+% \opt{r} (right).
+% \fi}
+%
+% \newcommand*{\linewidthexplanation}[2]{%
+% \ifGERMAN
+% Die Linienbreite #1. Diese könnte ebenfalls über den
+% \opt{linewidth} Parameter gesetzt werden. Mit diesem Parameter kann
+% aber die Linienbreite aller #2 global eingestellt werden.
+% \fi
+% \ifENGLISH
+% The linewidth of the #1. This could be defined also with the
+% generic \opt{linewidth} option. But this parameter allows setting
+% globally the linewidth of all #2.
+% \fi
+% }
+%
+% \newcommand*{\deprecatedmsg}[2][3.0]{%
+% \ifGERMAN Dieser Parameter ist seit Version #1 veraltet, verwenden Sie stattdessen #2. \fi
+% \ifENGLISH This parameter is deprecated since version #1, use #2 instead.\fi
+% }
+%
+% \newcommand*{\addtostylemsg}[1]{%
+% \ifGERMAN Der vorhandene \Lstyle{#1}-Stil wird lokal um die Parameter in
+% \prm{list} erweitert, \prm{list} muss mit geschweiften Klammern gekapselt
+% werden.
+% \fi
+% \ifENGLISH
+% The \Lstyle{#1} style is extended by locally adding the
+% parameters contained in \prm{list}. The \prm{list} must be surrounded
+% by curly braces.
+% \fi
+% }
+% \newcommand*{\newstylemsg}[1]{%
+% \ifGERMAN Ähnlich wie \Lkeyword{addto#1}, nur wird der
+% \Lstyle{#1}-Stil mit den neuen Parametern überschrieben.
+% \fi
+% \ifENGLISH Similar to \Lkeyword{addto#1}, but an existing
+% \Lstyle{#1} style is overwritten with the new parameter set.
+% \fi
+% }
+%
+% \makeatletter
+% \renewcommand\maketitle{^^A
+% \thispagestyle{empty}^^A
+% \begin{titlepage}
+% \begin{pspicture}(1.6in,0.685in)(10,21.7)
+% \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)
+% \rput[lb](3,22){\Huge\sffamily\color{Orange!65!Red}\psscalebox{2}{\textbf{PSTricks}}}
+% \rput[lb](3,14.1){\parbox{15cm}{\sffamily\RaggedRight\bfseries\huge\@title}}
+% \rput[lb](3,7.6){\parbox{13cm}{\sffamily\@date}}
+% \rput[lb](3,-2.6){\parbox[b]{17cm}{\sffamily\RaggedRight
+% ~\hfill\makebox[7cm][l]{\ifGERMAN Paketautor:\fi\ifENGLISH Package author:\fi}\\
+% ~\hfill\makebox[7cm][l]{^^A
+% \bfseries\tabular[t]{@{}l@{}}\@author\endtabular}}}
+% \rput[C](11,4){\bgImage}
+% \end{pspicture}^^A
+% \end{titlepage}}
+% \makeatother
+%
+% \ifGERMAN
+% \title{\texttt{pst-optexp}\\ Optische Versuchsaufbauten\\[0.5ex] \small \fileversion}
+% \hypersetup{pdftitle={Optische Versuchsaufbauten}}
+% \fi
+% \ifENGLISH
+% \title{\texttt{pst-optexp}\\ Drawing optical experimental setups\\[0.5ex] \small \fileversion}
+% \hypersetup{pdftitle={Optical experimental setups}}
+% \fi
+% \author{Christoph Bersch}
+% \date{\filedate}
+% \def\bgImage{\psset{unit=1.3}
+% \begin{pspicture}(-0.2,0.1)(8.2,5.3)
+% \pnode(0,3){M1}
+% \pnode(8,3){M2}
+% \pnode(8,0.5){In}
+% \pnode(6.5,0.5){Min}
+% \pnode(6.5,3){Pin}
+% \pnode(4.5,3){Min2}
+% \pnode(1.3, 0.5){Mout}
+% \pnode(1.3,3){Pout}
+% \pnode(3.5,3){Mout2}
+% \pnode(0,0.5){Out}
+% \definecolor[ps]{bl}{rgb}{tx@addDict begin Red Green Blue end}
+% \addtopsstyle{Beam}{linecolor=bl, linejoin=1}
+% \psset{mirrortype=extended, mirrordepth=0.15}
+% \newpsstyle{ExtendedMirror}{linestyle=none, hatchwidth=0.5\pslinewidth, hatchsep=1.2\pslinewidth,
+% fillstyle=hlines}
+% \begin{optexp}
+% \mirror[mirrorwidth=4, mirrorradius=11.](M2)(M1)(M2)
+% \mirror[mirrorwidth=4, mirrorradius=10.4](M1)(M2)(M1)
+% \mirror(In)(Min)(Pin)
+% \optprism[n=1.85, addtoOptComp={linewidth=1.5\pslinewidth}](Min)(Pin)(Min2)
+% \mirror[compshift=-0.4](Pin)(Min2)(Pin)
+% \mirror[compshift=0.4](Pout)(Mout2)(Pout)
+% \optprism[n=1.85, linewidth=1.5\pslinewidth](Mout2)(Pout)(Mout)
+% \mirror(Pout)(Mout)(Out)
+% \multido{\i=0+1}{40}{^^A
+% \pstVerb{^^A
+% \i\space 650 400 sub 39 div mul 400 add
+% tx@addDict begin wavelengthToRGB end }^^A
+% \drawbeam[n={-0.002 \i\space mul n add}]{(In)}{3-5}{2}{1}{6-7}
+% }^^A
+% \newpsstyle{Beam}{linecolor=red}
+% \backlayer{\psline[style=Beam,ArrowInside=->, linewidth=2\pslinewidth, arrowinset=0](In)(\oenodeIn{3})(\oenodeOut{4})}
+% \drawbeam[linewidth=2\pslinewidth, arrows=->, arrowinset=0, loadbeampoints, beaminsidefirst, n=1.9325]{7-8}{(Out)}
+% \end{optexp}
+% \rput(4,4.5){^^A
+% \psframe[fillstyle=solid,fillcolor=gray!70](-0.1, -0.6)(0.1, 0.7)
+% \multido{\r=-0.5+0.1}{12}{^^A
+% \psline[linewidth=0.5\pslinewidth](-0.1,\r)(0.1,\r)
+% }^^A
+% }
+% \end{pspicture}}
+%
+% \maketitle
+%
+% \clearpage
+% \tableofcontents
+% \clearpage
+%
+% \ifGERMAN
+% \chapter{Einführung}
+% \fi
+% \ifENGLISH
+% \chapter{Introduction}
+% \fi
+%
+% \ifGERMAN
+% \section{Ãœber das Paket}
+%
+% \LPack{pst-optexp} ist ein PSTricks-Paket zum Skizzieren optischer
+% Versuchsaufbauten. Dafür werden viele unterschiedliche Freistrahl- und
+% Faserkomponenten bereitgestellt, deren Ausrichtung, Positionierung und
+% Beschriftung einfach und flexibel eingestellt werden kann. Die Komponenten
+% können dann mit Fasern oder Lichtstrahlen verbunden werden, wobei auch
+% realistische Strahlengänge mit Raytracing möglich sind.
+% \fi
+% \ifENGLISH
+% \section{About the package}
+% The package \LPack{pst-optexp} is a collection of optical components that
+% facilitate easy sketching of optical experimental setups. A lot of different
+% free-ray and fiber components are provided, which alignment, positioning and
+% labelling can be achieved in very simple and flexible ways. The components
+% can be connected with fibers or beams, realistic raytraced beam paths are
+% also possible.
+% \fi
+%
+% \ifGERMAN
+% \section{Anforderungen}
+% \LPack{pst-optexp} Version 3.0 benötigt \LaTeX{} und aktuelle Versionen der
+% Pakete \LPack{pst-node}, \LPack{pstricks-add}, \LPack{multido},
+% \LPack{pst-eucl} und \LPack{environ}.
+%
+% Alle PSTricks-Pakete machen regen Gebrauch von der Postscript-Sprache, so
+% dass der typische Arbeitsfluss \opt{latex}, \opt{dvips} und
+% ggf. \opt{ps2pdf} umfasst. Es gibt viele alternative Methoden um die
+% Dokumente zu
+% kompilieren.\fnurl{http://tug.org/PSTricks/main.cgi?file=pdf/pdfoutput}
+% \fi
+% \ifENGLISH
+% \section{Requirements}
+% \LPack{pst-optexp} version 3.0 requires \LaTeX{} and recent versions of
+% \LPack{pst-node}, \LPack{multido}, \LPack{pstricks-add},
+% \LPack{pst-eucl}, and \LPack{environ}.
+%
+% All PSTricks package rely heavily on the Postscript language so that the
+% typical workflow involves \opt{latex}, \opt{dvips}, and \opt{ps2pdf}. Of
+% course there are several alternative ways to compile your
+% documents.\fnurl{http://tug.org/PSTricks/main.cgi?file=pdf/pdfoutput}
+% \fi
+%
+% \ifGERMAN
+% \section{Verbreitung und Installation}
+% Dieses Paket ist auf
+% CTAN\fnurl{http://mirror.ctan.org/help/Catalogue/entries/pst-optexp.html}
+% erhältlich und in \TeX Live and MiK\TeX{} enthalten.
+%
+% Das \LPack{pst-optexp}-Paket umfasst die zwei Hauptdateien
+% \texttt{pst-optexp.ins} und \texttt{pst-optexp.dtx}. Durch Aufrufen
+% von \texttt{tex pst-optexp.ins} werden die beiden folgenden
+% Dateien erzeugt:
+% \begin{itemize}
+% \item \texttt{pst-optexp.pro}: die Postscript Prologdatei
+% \item \texttt{pst-optexp.sty}: die \LaTeX{} Stildatei
+% \end{itemize}
+% Speichern Sie diese Dateien in einem Verzeichnis der Teil Ihres
+% lokalen \TeX-Baums ist.
+%
+% Vergessen Sie nicht \texttt{texhash} aufzurufen um den Baum zu
+% aktualisieren. MiK\TeX{}-Benutzer müssen die Dateinamen-Datenbank
+% (FNDB) aktualisieren.
+%
+% Detailliertere Information finden Sie in der Dokumentation Ihrer
+% \LaTeX-Distribution über die Installation in den lokalen
+% \TeX{}-Baum.
+% \fi
+% \ifENGLISH
+% \section{Distribution and installation}
+% This package is available on
+% CTAN\fnurl{http://mirror.ctan.org/help/Catalogue/entries/pst-optexp.html} and
+% is included in \TeX Live and MiK\TeX.
+%
+% The \LPack{pst-optexp} package consists of the two main files
+% \texttt{pst-optexp.ins} and \texttt{pst-optexp.dtx}. By running \texttt{tex
+% pst-optexp.ins} the following derived files are generated:
+% \begin{itemize}
+% \item \texttt{pst-optexp.pro}: the Postscript prolog file
+% \item \texttt{pst-optexp.sty}: the \LaTeX{} style file
+% \end{itemize}
+% Save the files in a directory which is part of your local \TeX{} tree.
+%
+% Do not forget to run \texttt{texhash} to update this tree. For MiK\TeX{}
+% users, do not forget to update the file name database (FNDB).
+%
+% For more detailed information see the documentation of your personal
+% \LaTeX{} distribution on installing packages to your local \TeX{}
+% system.
+% \fi
+%
+% \ifGERMAN\section{Lizenz}\fi
+% \ifENGLISH\section{License}\fi
+% \ifGERMAN
+% Es wird die Erlaubnis gewährt, dieses Dokument zu kopieren, zu verteilen
+% und\slash oder zu modifizieren, unter den Bestimmungen der \LaTeX{} Project
+% Public License, Version
+% 1.3c.\fnurl{http://www.latex-project.org/lppl.txt}. Dieses
+% Paket wird vom Autor betreut (author-maintained).
+% \fi
+% \ifENGLISH
+% Permission is granted
+% to copy, distribute and\slash or modify this software under the terms of the
+% \LaTeX{} Project Public License, version
+% 1.3c.\fnurl{http://www.latex-project.org/lppl.txt} This
+% package is author-maintained.
+% \fi
+%
+% \ifGERMAN
+% \section{Abwärtskompatibilität}
+% \fi
+% \ifENGLISH
+% \section{Backward compatibility}
+% \fi
+% \ifGERMAN In Version 3.0 wurde dem Paket erheblich fortgeschrittenere
+% Funktionalität hinzugefügt, die es zu schwierig machte zur
+% Vorgängerversion 2.1 vollständig abwärtskompatibel zu
+% bleiben. Insbesondere war die Funktionsweise des \Lcs{drawbeam}
+% Makros grundlegend falsch konzipiert, so dass ein Wechsel zur neuen
+% Funktionalität so schnell wie möglich erfolgen sollte.
+%
+% Eine genauere Zusammenstellung der nicht-kompatiblen Änderungen und Hinweise
+% zur Migration von älteren Dokumenten finden Sie in \prettyref{sec:bwd-comp}.
+% \fi
+% \ifENGLISH
+% Version 3.0 introduced a lot of advanced features which made it too difficult
+% to maintain full backward compatibility with version 2.1. Especially the
+% \Lcs{drawbeam} macro was broken by design, so that it was best to drop the old
+% flaw as early as possible.
+%
+% You find a more detailled list of changes and information for migration of old
+% documents in \prettyref{sec:bwd-comp}.
+% \fi
+%
+% \section{Notation}\label{sec:notation}
+% \ifGERMAN
+% Die meisten Parametertypen, die im Laufe des Dokuments verwendet werden, sind
+% selbsterklärend, andere bedürfen einer genaueren Erläuterung (z.B. der
+% Unterschied zwischen \prm{num} und \prm{psnum}). \prettyref{tab:paramref}
+% erklärt die geläufigsten Typen.
+% \fi
+% \ifENGLISH
+% Often the parameter types are self-explanatory, but in some cases a clear
+% distinction is needed, e.g. between \prm{num} and
+% \prm{psnum}. \prettyref{tab:paramref} explains some commonly used types.
+% \fi
+%
+% \begin{table}\centering
+% \begin{tabularx}{0.9\linewidth}{>{\itshape}lX} \toprule
+% Name & \ifENGLISH description\fi\ifGERMAN Beschreibung\fi\\ \midrule
+% num & \ifENGLISH float number\fi\ifGERMAN Gleitkommazahl\fi \\
+% psnum & \ifENGLISH Postscript code which evaluates to a number\fi
+% \ifGERMAN Postscript-Kode der zu einer Zahl auswertet\fi\\
+% int & \ifENGLISH integer number\fi\ifGERMAN Ganzzahl\fi\\
+% dimen & \ifENGLISH dimension\fi\ifGERMAN Länge\fi\\
+% psstyle & \ifENGLISH custom graphics parameter configuration defined with \Lcs*{newpsstyle}\fi
+% \ifGERMAN Benutzerdefinierte Parameterkonfiguration definiert mit \Lcs*{newpsstyle}\fi\\
+% refpoint & \refpointexplanation\\ \bottomrule
+% \end{tabularx}
+% \ifGERMAN
+% \caption{Parametertypen die in den Parameterdefinitionen verwendet werden.}
+% \fi
+% \ifENGLISH
+% \caption{Parameter types used in the parameter reference.}
+% \fi
+% \label{tab:paramref}
+% \end{table}
+%
+% \ifGERMAN
+% \section{Danksagung}
+% \fi
+% \ifENGLISH
+% \section{Acknowledgements}
+% \fi
+% \ifGERMAN
+% Ich danke allen Aktiven auf der PSTricks-Mailingliste für ihre Hilfe,
+% insbesondere Herbert Voß. Mein Dank gilt ebenfalls unterschiedlichen
+% Paketautoren, von denen ich Code kopiert und viel gelernt habe: Florent
+% Chervet, Rolf Niepraschk und Heiko Oberdiek. Christine Römer hat mich mit
+% ihrem Artikel in der DTK\footnote{Pakete in Deutsch dokumentieren. in Die
+% TeXnische Komödie. Heft 2/2011, S. 28-35.} überzeugt, ebenfalls eine deutsche
+% Dokumentation bereitzustellen. Der Dokumentationsstil ist eine Mischung aus
+% der \opt{pst-doc} Klasse (Herbert Voß) und dem \opt{ltxdockit} Paket für die
+% \opt{biblatex} Dokumentation (Philipp Lehmann).
+% \fi
+% \ifENGLISH
+% I thank all the people of the PSTricks mailinglist for the continuous help,
+% especially Herbert Voß. Thanks also to various package authors from which I
+% learned and adopted code for this package, Florent Chervet, Rolf Niepraschk
+% and Heiko Oberdiek. Christine Römer convinced my with her article in the
+% german DTK\footnote{Pakete in Deutsch dokumentieren. in Die TeXnische
+% Komödie. Heft 2/2011, S. 28-35.} to provide a german translation of the
+% documentation. The documentation style is a mixture of the \opt{pst-doc} class
+% (Herbert Voß) and the \opt{ltxdockit} package for the \opt{biblatex}
+% documentation (Philipp Lehman).
+% \fi
+%
+% \ifGERMAN
+% \chapter{Grundlegende Ideen}
+% \fi
+% \ifENGLISH
+% \chapter{Basic ideas}
+% \fi\label{chap:basics}
+%
+% \ifGERMAN Dieses Kapitel zeigt die grundlegenden Ideen und Konzepte, die in
+% diesem Paket stecken. Anhand von elementaren Beispielen werden die
+% Grundfunktionen wie Ausrichtung, Positionierung (\ref{sec:intro-comp}) und
+% Beschriftung (\ref{sec:intro-label}) von Komponenten beschrieben. Anschließen
+% wird deren Verbindung mit Strahlen (\ref{sec:intro-beam}) oder Fasern
+% (\ref{sec:intro-fiber}) vorgestellt.
+%
+% In \prettyref{sec:step-by-step} wird Schritt für Schritt die angedachte
+% Vorgehensweise für das Erstellen von umfassenden Experimentskizzen
+% erläutert. Eine vollständige Referenz aller Makros und deren Parameter finden
+% Sie in \prettyref{chap:generalparam}--\ref{chap:custom}.
+%
+% Ein Versuchsaufbau besteht aus Komponenten, die anhand ihrer Referenzknoten
+% positioniert, verschoben und gedreht werden können und optional eine
+% Beschriftung erhalten. Anschließen werden die Komponenten mit Lichtstrahlen
+% oder Fasern verbunden.
+% \fi
+% \ifENGLISH
+% This chapter shows the basic ideas and concepts of this package. Starting with
+% simple examples, basic functionality such as alignment, positioning
+% (\ref{sec:intro-comp}) and labelling (\ref{sec:intro-label}) of components is
+% presented. Following, the connection of components with beam rays
+% (\ref{sec:intro-beam}) or fiber (\ref{sec:intro-fiber}) is demonstrated.
+%
+% In \prettyref{sec:step-by-step} several propositions for preparing large
+% experimental sketches are illustrated step by step. For a complete reference
+% of all macros and their parameters, see
+% \prettyref{chap:generalparam}--\ref{chap:custom}.
+%
+% A drawing consists of components, which can be positioned, shifted and rotated
+% based on their reference nodes, and may have an optional label. Then, the
+% components are connected with beam rays or fibers.
+% \fi
+%
+% \ifGERMAN\section{Die Komponenten}\fi
+% \ifENGLISH\section{The components}\fi
+% \label{sec:intro-comp}
+%
+% \ifGERMAN Eine Komponente wird anhand der Knoten, die bei ihrere Definition
+% angegeben werden -- den Referenzknoten -- platziert. Im folgenden Beispiel
+% wird eine Linse mittig auf die Verbindungslinie zwischen den Knoten
+% \prm{A} und \prm{B} gesetzt:
+% \fi
+% \ifENGLISH
+% A component is positioned according to the nodes which are used for its
+% definition---the reference nodes. In the following examples, the lens is
+% placed centered between nodes \prm{A} and \prm{B}:
+% \fi
+%\iffalse
+%<*ignore>
+%\fi
+\begin{LTXexample}[linerange={1-3,6-6}]
+\begin{pspicture}[showgrid=true](0,-0.3)(3,2.3)
+ \pnode(0,1){A}\pnode(3,1){B}
+ \lens(A)(B)
+ \psset{style=Refline}\color{Refline}
+ \psdot(A)\uput[90](A){A}\psdot(B)\uput[90](B){B}
+\end{pspicture}
+\end{LTXexample}
+%\iffalse
+%</ignore>
+%\fi
+%
+% \ifGERMAN
+% Diese Positionierung kann anhand von unterschiedlichen Parametern, wie
+% z.B. \Lkeyword{abspos} beinflusst werden (siehe dazu
+% \prettyref{sec:positioning} und \prettyref{sec:rotshift}). Die Linse wird nun
+% \opt{0.5} Einheiten entfernt vom Knoten \prm{A} platziert, die Box sitzt am
+% Ende der Referenzlinie $\overline{AB}$.
+% \fi
+% \ifENGLISH
+% This position can be changed with a number of parameters, such as
+% \Lkeyword{abspos} (see \prettyref{sec:positioning} and
+% \prettyref{sec:rotshift}). The lens is positioned \opt{0.5} units apart from
+% node \prm{A}, the box is placed at the end of the reference line
+% $\overline{AB}$.
+% \fi
+%\iffalse
+%<*ignore>
+%\fi
+\begin{LTXexample}[morekeywords={[21]{abspos, position}}, linerange={1-4,7-7}]
+\begin{pspicture}[showgrid=true](0,-0.3)(3,2.3)
+ \pnode(0,1){A}\pnode(1.5,1){B}
+ \lens[abspos=0.5](A)(B)
+ \optbox[position=end](A)(B)
+ \psset{style=Refline}\color{Refline}
+ \psdot(A)\uput[90](A){A}\psdot(B)\uput[135](B){B}
+\end{pspicture}
+\end{LTXexample}
+%\iffalse
+%</ignore>
+%\fi
+%
+% \ifGERMAN Die Komponenten lassen sich allgemein in zwei Kategorien
+% unterteilen: Freistrahl- und Faserkomponenten. Diese unterscheiden sich in
+% erster Linie bezüglich ihrer Verbindungsmöglichkeiten: Freistrahlkomponenten
+% können sowohl mit Lichtstrahlen als auch mit Fasern verbunden werden,
+% wohingegen Faserkomponenten nur Faserverbindungen erlauben.
+% \fi
+% \ifENGLISH
+% The components can be divided in two categories: free-ray and fiber
+% components. These differ only in their connection possibilities: Free-ray
+% components can have fiber or free-ray connections, whereas fiber components
+% support fiber connections only.
+% \fi
+%
+% \ifGERMAN\section{Beschriftungen}\fi
+% \ifENGLISH\section{Labels}\fi
+% \label{sec:intro-label}
+%
+% \ifGERMAN Jede Komponente kann optional eine Beschriftung erhalten, die
+% relativ zur Komponente platziert wird.
+% \fi
+% \ifENGLISH Every component can have an optional label, which is positioned
+% relative to the component.
+% \fi
+%\iffalse
+%<*ignore>
+%\fi
+\begin{LTXexample}[morekeywords={[21]{labelangle, labelref, labeloffset}}, linerange={1-5,8-8}]
+\begin{pspicture}[showgrid=true](0,-0.3)(3,3.3)
+ \pnode(0,2.5){A}\pnode(2,2.5){B}\pnode(2,1.5){C}
+ \mirror[labelangle=-45](A)(B)(C){M}
+ \optbox[position=start, labeloffset=0, labelref=relative](C)(B){box}
+ \drawbeam{(A)}{1}{2}
+ \psset{style=Refline}\color{Refline}
+ \psdot(A)\uput[90](A){A}\psdot(B)\uput[-135](B){B}\psdot(C)\uput[45](C){C}
+\end{pspicture}
+\end{LTXexample}
+%\iffalse
+%</ignore>
+%\fi
+%
+% \ifGERMAN\section{Freistrahl-Verbindungen}\fi
+% \ifENGLISH\section{Free-ray connections}\fi
+% \label{sec:intro-beam}
+%
+% \ifGERMAN
+% Freistrahlkomponenten können mit Lichtstrahlen verbunden werden, deren Weg mit
+% Raytracing berechnet werden kann. Da es sich um ein Paket zum
+% \emph{Skizzieren} experimenteller Aufbauten handelt, werde hier trotz der
+% realistischen Berechnungen viele Möglichkeiten offen gehalten den Strahlengang
+% zu manipulieren.
+%
+% Im einfachsten Fall wird eine einzelne Linie gezeichnet, deren optischer Weg
+% über den Brechungsindex \Lkeyword{n} und das Snelliussche Brechungsgesetz
+% bestimmt wird.
+%
+% Das Beispiel zeigt zwei Strahlen, die mit unterschiedlichen Anfangsbedingungen
+% auf die Linse treffen, der rote Strahl startet mit einem Abstand von \opt{0.2}
+% von der optischen Achse (\Lkeyword{beampos}) und wird entsprechend von der
+% Linse abgelenkt.
+% \fi
+% \ifENGLISH
+% Free-ray components can be connected with beam rays, which path can be
+% calculated by raytracing. Besides the realistic tracing possibilities, there
+% are many ways to manipulate the beam paths because you are dealing with a
+% package for \emph{sketching} experimental setups.
+%
+% In the simplest case a single line is drawn, which optical path is determined
+% by the refractive index \Lkeyword{n} and Snell's law.
+%
+% The example shows two beams which hit the lens with different initial
+% conditions. The red beam starts at a distance of \opt{0.2} from the optical
+% axis (\Lkeyword{beampos}) and is deflected by the lens accordingly.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}[showgrid](0,-0.3)(3,2.3)
+ \pnode(1.5,1){A}\pnode(3,1){B}
+ \optbox[position=start](A)(B)
+ \lens[n=2](A)(B)
+ \drawbeam{1}{2}{(B)}
+ \drawbeam[beampos=0.2, linecolor=red]{1}{2}{(B)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN Die Strahlen können mit beliebigen Strichlierungen und Pfeilen
+% dekoriert werden.
+% \fi
+% \ifENGLISH The beams can be decorated with arbitrary dashs and arrows.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}[showgrid](0,-0.3)(3,2.3)
+ \pnode(1.5,1){A}\pnode(3,1){B}
+ \optbox[position=start](A)(B)
+ \lens[n=2](A)(B)
+ \drawbeam[beamangle=10, ArrowInside=->, arrows=-|, beaminside=false]{1}{2}{(B)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN Ebenfalls können ausgedehnte Strahlen gezeichnet werden deren
+% Randstrahlen mit \Lkeyword*{linestyle} etc. und deren Füllung über
+% \Lkeyword*{fillstyle} geändert werden können.
+% \fi
+% \ifENGLISH You can also draw wide beams. The marginal rays can be changed with
+% \Lkeyword*{linestyle} etc. and the filling with \Lkeyword*{fillstyle} etc.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}[showgrid](0,-0.3)(3,2.3)
+ \pnode(1.5,1){A}\pnode(3,1){B}
+ \optbox[position=start](A)(B)
+ \lens[n=2](A)(B)
+ \drawwidebeam[beamwidth=0.2, fillstyle=solid, fillcolor=green!40]{1}{2}{(B)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN Die Strahlen können auch hinter die Komponenten gelegt werden. Dafür
+% müssen alle beteiligten Komponenten und Strahlen in eine
+% \Lenv{optexp}-Umgebung gepackt werden (vergleiche das folgende Beispiel mit
+% dem vorangegangenen).
+% \fi
+% \ifENGLISH The beams can also lay behind the components. For this you must
+% enclose all respective components and rays in a \Lenv{optexp} environment
+% (compare the previous example with the following one).
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}[showgrid](0,-0.3)(3,2.3)
+ \pnode(1.5,1){A}\pnode(3,1){B}
+ \begin{optexp}
+ \optbox[position=start](A)(B)
+ \lens[n=2](A)(B)
+ \drawwidebeam[beamwidth=0.2, fillstyle=solid, fillcolor=green!40]{1}{2}{(B)}
+ \end{optexp}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN\section{Faserverbindungen}\fi
+% \ifENGLISH\section{Fiber connections}\fi
+% \label{sec:intro-fiber}
+%
+% \ifGERMAN
+% Eine andere Möglichkeit, Komponenten zu verbinden, sind Fasern
+% (\Lcs{drawfiber}). Hiermit bestehen weitreichende Möglichkeiten die Fasern
+% automatisch an die Komponentenausrichtung anzupassen.
+% \fi
+% \ifENGLISH
+% Fibers (\Lcs{drawfiber}) are another possibility of connecting
+% components. Here, you have several way of automatically adapting the fiber
+% connection to the component alignment.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}[showgrid](0,-0.3)(3,3.3)
+ \pnode(1,2.5){A}\pnode(2.5,1){B}
+ \psset{optboxsize=1 0.6}
+ \optbox[position=start](A)(B|A)
+ \optbox[position=end](B|A)(B)
+ \drawfiber{1}{2}
+ \drawfiber[linecolor=blue, ncurv=1.2]{1}{2}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN Ãœblicherweise werden Fasern mit einer \Lcs*{nccurve}-Verbindung
+% gezeichnet, jede andere Knotenverbindung ist aber ebenfalls möglich
+% (\Lkeyword{fiberstyle}).
+% \fi
+% \ifENGLISH Usually, the fibers are drawn as \Lcs*{nccurve} connections, other
+% node connections are possible as well (\Lkeyword{fiberstyle}).
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}[showgrid](0,-0.3)(3,3.3)
+ \pnode(1,2.5){A}\pnode(2.5,1){B}
+ \psset{optboxsize=1 0.6}
+ \optbox[position=start](A)(B|A)
+ \optbox[position=end](B|A)(B)
+ \drawfiber[fiberstyle=angle, linearc=0.5]{1}{2}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \newpage
+% \ifGERMAN\section{Schritt-für-Schritt-Beispiele}\fi
+% \ifENGLISH\section{Step-by-step examples}\fi
+% \label{sec:step-by-step}
+%
+% \ifGERMAN
+% \subsection{Freistrahlaufbau}
+% In diesem ersten Beispiel werden alle Komponenten auf eine Verbindungslinie
+% verteilt und mit einem Strahl verbunden.
+%
+% Zuerst werden Anfangsknoten \prm{A} und Endknoten \prm{B} definiert. Die erste
+% \Lcs{optbox} wird an den Anfang platziert, die Wellenplatte und der
+% Polarisator werden innerhalb der Verbindungslinie positioniert. Der Parameter
+% \Lkeyword{position} erwartet Werte zwischen \opt{0} und \opt{1}, die relativ
+% zur Länge der Verbindungslinie sind, oder \opt{start}/\opt{end}. Der Detektor
+% wird immer an das Ende der Linie gesetzt.
+%
+% Zuletzt werden alle Komponenten mit einem einfachen Lichtstrahl verbunden.
+% \fi
+% \ifENGLISH
+% In this first example, all components are distributed on a single line and
+% connected with a beam.
+%
+% First we define the start node \prm{A} and the stop node \prm{B}. The first
+% \Lcs{optbox} is positioned at the start, the wave plate and the polarizer are
+% positioned between the nodes. The parameter \Lkeyword{position} expects a
+% value between \opt{0} and \opt{1} which is relative to the length of the
+% reference line, or \opt{start}/\opt{end}. The detector is always positioned at
+% the end of its reference line.
+%
+% Finally, all components are connected with a simple beam ray.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begingroup
+\catcode`\*=13
+\def*{}%
+\begin{LTXexample}[style=example, linerange={1-7,10-10}]
+\begin{pspicture}[showgrid](4,2)
+ \pnode(1,1){A}\pnode(3,1){B}
+ \optbox[position=start, optboxwidth=1.2, labeloffset=0](A)(B){Laser}
+ \optretplate[position=0.3](A)(B){$\nicefrac{\lambda}{2}$}
+ \optplate[position=0.7](A)(B){pol}
+ \optdetector[dettype=diode](A)(B){PD}
+ \drawbeam{1}{2}{3}{4}
+ \psset{style=Refline, dotscale=1.5}\psdot(A)\psdot(B)
+ \uput[45](A){\color{Refline}A}\uput[135](B){\color{Refline}B}
+\end{pspicture}
+\end{LTXexample}
+\endgroup
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN\subsection{Galilei-Fernrohr}\fi
+% \ifENGLISH\subsection{Galilean telescope}\fi
+% \label{ex:galileo}
+%
+% \ifGERMAN
+% Im Folgenden wird ein sehr einfacher Aufbau mit einer konkaven und
+% einer konvexen Linse schrittweise erläutert.
+%
+% Zuerst werden die Referenzknoten \prm{A} und \prm{B} definiert, die für die
+% Ausrichtung der Komponenten verwendet werden. Zur besseren Ãœbersicht werden
+% beide Knoten gekennzeichnet, desweiteren dient ein Koordinatengitter der
+% Orientierung.
+%
+% Die erste Linse soll konkav gekrümmte Grenzflächen haben. Mit
+% \Lkeyword{lensradius} werden die Radien der linken und rechten Fläche auf
+% negative Werte gesetzt, was eine konkave Krümmung ergibt. Die Linse wird mit
+% \Lkeyword{abspos} eine Einheit vom \prm{A}-Knoten entfernt positioniert.
+% \fi
+% \ifENGLISH
+% This example describes a simple setup with a concave and a convex lens and the
+% raytracing through them.
+%
+% First, we define the reference nodes \prm{A} and \prm{B} which are used for
+% alignment of the components. For better overview, these nodes are highlighted
+% and a grid is drawn.
+%
+% The first lens should have concave interfaces. With \Lkeyword{lensradius} the
+% interface radii are set to negative values, which correspond to concave
+% curvatures. With \Lkeyword{abspos} the lens is positioned one unit from
+% \prm{A} node.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begingroup
+\catcode`\*=13
+\def*{}%
+\begin{LTXexample}[style=example, linerange={1-4,6-6}]
+*\ON*\begin{pspicture}[showgrid](0,-0.3)(5,2.3)
+ \pnode(0,1){A}\pnode(3.5,1){B}*\OFF*
+ \lens[lensradius=-0.7,
+ abspos=1](A)(B){concave}*\ON*
+ \psset{style=Refline}\psdot(A)\psdot(B)
+\end{pspicture}*\OFF*
+\end{LTXexample}
+\endgroup
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% Die zweite Linse bekommt eine konvexe Krümmung (\Lkeyword{lensradius}
+% ist positiv) und wird \opt{2.6} Einheiten von \prm{A}
+% positioniert. Die Linsenhöhe wird mit \Lkeyword{lensheight}
+% eingestellt.
+% \fi
+% \ifENGLISH
+% The second lens has a convex curvature (\Lkeyword{lensradius} is positive) and
+% is positioned \opt{2.6} units apart from \prm{A}. Parameter
+% \Lkeyword{lensheight} sets the total height of the lens.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begingroup
+\catcode`\*=13
+\def*{}%
+\begin{LTXexample}[style=example, linerange={1-6,9-9}]
+*\ON*\begin{pspicture}[showgrid](0,-0.3)(5,2.3)
+ \pnode(0,1){A}\pnode(3.5,1){B}
+ \lens[lensradius=-0.7,
+ abspos=1](A)(B){concave}*\OFF*
+ \lens[lensradius=2.3, lensheight=1.3,
+ abspos=2.6](A)(B){convex}*\ON*
+ \psset{style=Refline}\psdot(A)\psdot(B)
+ \uput[45](A){\color{Refline}A}\uput[135](B){\color{Refline}B}
+\end{pspicture}*\OFF*
+\end{LTXexample}
+\endgroup
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% Die Lichtstrahlen sollen auf einer CCD-Kamera enden, die mit einer
+% \Lcs{optbox} gezeichnet wird. Mit \Lkeyword{position}\opt{=end} wird die Box
+% ans Ende der Referenzlinie von \prm{A} nach \prm{B} gesetzt, die
+% Beschriftung wird mit \Lkeyword{labeloffset} in die Mitte der Komponente
+% gelegt.
+% \fi
+% \ifENGLISH
+% The beam rays are supposed to end at the CCD camera which is drawn as a
+% \Lcs{optbox}. With \Lkeyword{position}\opt{=end} the box is positioned at
+% the end of the reference line from \prm{A} to \prm{B}. The label is put at
+% the center of the component with \Lkeyword{labeloffset}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begingroup
+\catcode`\*=13
+\def*{}%
+\begin{LTXexample}[style=example, linerange={1-7,10-10}]
+*\ON*\begin{pspicture}[showgrid](0,-0.3)(5,2.3)
+ \pnode(0,1){A}\pnode(3.5,1){B}
+ \lens[lensradius=-0.7,
+ abspos=1](A)(B){concave}
+ \lens[lensradius=2.3, lensheight=1.3,
+ abspos=2.6](A)(B){convex}*\OFF*
+ \optbox[position=end, labeloffset=0](A)(B){CCD}*\ON*
+ \psset{style=Refline}\psdot(A)\psdot(B)
+ \uput[45](A){\color{Refline}A}\uput[135](B){\color{Refline}B}
+\end{pspicture}*\OFF*
+\end{LTXexample}
+\endgroup
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% Zum Schluß wird ein aufgeweiteter Strahl mit einer Strahlbreite von \opt{0.2}
+% und ohne anfängliche Divergenz durch die Komponenten geschickt. Der
+% Strahlengang wird mittels Raytracing berechnet. Die Linsenparameter in diesem
+% Beispiel wurden so gewählt das bei kollimiertem Eingangsstrahl der
+% Ausgangsstrahl ebenfalls kollimiert ist.
+% \fi
+% \ifENGLISH
+% Finally, a wide beam with an initial beam width of \opt{0.2} without
+% divergence is sent through the components. The beam path is calculated by
+% raytracing. The lens parameters in this example were set such, that for a
+% collimated input beam also the output beam is collimated.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begingroup
+\catcode`\*=13
+\def*{}%
+\begin{LTXexample}[style=example]
+*\ON*\begin{pspicture}(5,2)
+ \pnode(0,1){A}\pnode(3.5,1){B}
+ \lens[lensradius=-0.7,
+ abspos=1](A)(B){concave}
+ \lens[lensradius=2.3, lensheight=1.3,
+ abspos=2.6](A)(B){convex}
+ \optbox[position=end, labeloffset=0](A)(B){CCD}*\OFF*
+ \drawwidebeam[beamwidth=0.2]{(A)}{1}{2}{3}*\ON*
+\end{pspicture}*\OFF*
+\end{LTXexample}
+\endgroup
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% Das Aussehen des Lichtstrahls wird über den \Lstyle{Beam}-Stil
+% eingestellt, und kann z.B. mit einer halbtransparenten Füllung
+% versehen werden.
+% \fi
+% \ifENGLISH
+% The appearance of the beam can be changed via the \Lstyle{Beam} style, and may
+% have a e.g. semitransparent fill pattern.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begingroup
+\catcode`\*=13
+\def*{}%
+\begin{LTXexample}[style=example]
+*\ON*\begin{pspicture}(5,2)
+ \pnode(0,1){A}\pnode(3.5,1){B}
+ \lens[lensradius=-0.7,
+ abspos=1](A)(B){concave}
+ \lens[lensradius=2.3, lensheight=1.3,
+ abspos=2.6](A)(B){convex}
+ \optbox[position=end, labeloffset=0](A)(B){CCD}*\OFF*
+ \addtopsstyle{Beam}{fillstyle=solid,
+ fillcolor=green, opacity=0.2}
+ *\ON*\drawwidebeam[beamwidth=0.2]{(A)}{1}{2}{3}
+\end{pspicture}*\OFF*
+\end{LTXexample}
+\endgroup
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN\subsection{Faseraufbau}\fi
+% \ifENGLISH\subsection{Fiber setup}\fi
+% \label{ex:fiber-setup}
+%
+% \ifGERMAN
+% Dieses Beispiel zeigt, wie ein faseroptischer Aufbau mit automatisch
+% gezeichneten Faserverbindungen konstruiert werden kann.
+%
+% Auch hier werden die Referenzknoten zur besseren Orientierung
+% eingezeichnet. Im Gegensatz zum vorhergehenden Beispiel benötigen wir
+% mehr Referenzknoten, da die Faserkomponenten direkt mit diesen
+% verbunden werden.
+%
+% Der Laser wird wieder an den Anfang gesetzt. Der Abstand
+% der Beschriftung wird mit dem Parameter \Lkeyword{label} eingestellt,
+% mit dem alle Beschriftungsparameter gesammelt eingestellt werden
+% können. Da eine \Lcs{optbox} sowohl als Freistrahl- als auch als
+% Faserkomponente verwendet werden kann, wird in der Standardeinstellung
+% keine Faser gezeichnet, was mit \Lkeyword{fiber} geändert werden
+% kann. Die Breite dieser und aller folgenden \Lcs{optbox} wird auf
+% \opt{0.7} geändert.
+% \fi
+% \ifENGLISH
+% This example shows how to setup a fiber drawing with automatic fiber
+% connections.
+%
+% Again, the reference nodes are shown for better orientation. In contrast to
+% the previous example, here, we need more reference nodes because the
+% components are connected directly with them.
+%
+% The laser is set at the start. The label offset is set with the
+% \Lkeyword{label} parameter, which would allow setting all label parameters at
+% once. A \Lcs{optbox} is originally a free-ray component, so that for it the
+% fiber connection must be enabled with \Lkeyword{fiber}. The width of all
+% \Lcs{optbox} is changed to \opt{0.7}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+% \begingroup
+% \catcode`\*=13
+% \def*{}%
+\begin{LTXexample}[style=example, linerange={1-5,7-7}]
+*\ON*\begin{pspicture}[showgrid=true](4.7,2)
+ \pnode(0.7,1){A}\pnode(1,1){B}\pnode(2.8,1){C}
+ \pnode(4,1.5){D}\pnode(4,0.5){E}*\OFF*
+ \psset{optboxwidth=0.7, labelstyle=\scriptsize}
+ \optbox[position=start, label=0, fiber](A)(B){LD}*\ON*
+ \psset{style=Refline}\psdot(A)\psdot(B)\psdot(C)\psdot(D)\psdot(E)
+\end{pspicture}*\OFF*
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% Als nächstes wird ein Mach-Zehnder-Modulator ohne Beschriftung gezeichnet, der
+% automatisch mit Fasern mit seinen Referenzknoten verbunden wird.
+% \fi
+% \ifENGLISH The Mach--Zehner modulator is drawn without label and connected
+% automatically with fibers to its reference nodes.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[style=example, linerange={1-6,8-8}]
+*\ON*\begin{pspicture}[showgrid=true](4.7,2)
+ \pnode(0.7,1){A}\pnode(1,1){B}\pnode(2.8,1){C}
+ \pnode(4,1.5){D}\pnode(4,0.5){E}
+ \psset{optboxwidth=0.7, labelstyle=\scriptsize}
+ \optbox[position=start, label=0, fiber](A)(B){LD}*\OFF*
+ \optmzm(B)(C)*\ON*
+ \psset{style=Refline}\psdot(A)\psdot(B)\psdot(C)\psdot(D)\psdot(E)
+\end{pspicture}*\OFF*
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% Danach wird ein Faserkoppler mit einem Eingang und zwei Ausgängen
+% gezeichnet. Der Koppler wird zwischen dem Eingangsknoten und dem
+% Mittelpunkt der beiden Ausgangsknoten ausgerichtet.
+% \fi
+% \ifENGLISH Then, we draw a fiber coupler with one input and two output
+% fibers. The coupler is positioned between the input node and the center of the
+% two output nodes.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[style=example, linerange={1-7,9-9}]
+*\ON*\begin{pspicture}[showgrid=true](4.7,2)
+ \pnode(0.7,1){A}\pnode(1,1){B}\pnode(2.8,1){C}
+ \pnode(4,1.5){D}\pnode(4,0.5){E}
+ \psset{optboxwidth=0.7, labelstyle=\scriptsize}
+ \optbox[position=start, label=0, fiber](A)(B){LD}
+ \optmzm(B)(C)*\OFF*
+ \wdmsplitter(C)(D)(E){50\%}*\ON*
+ \psset{style=Refline}\psdot(A)\psdot(B)\psdot(C)\psdot(D)\psdot(E)
+\end{pspicture}*\OFF*
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% An die Enden des Kopplers wird ein optischer Spektrumanalysator (OSA) und eine
+% Leistungsmessgerät (PD) gesetzt. Der \Lcs{optdetector} wird immer ans Ende der
+% Referenzlinie gesetzt (\Lkeyword{position}\opt{=end}). Diese beiden
+% Komponenten werden ohne weitere Einstellungen ohne Faserverbindungen
+% gezeichnet. Das passt, da ihre jeweiligen Endpunkte mit den Ausgängen des
+% Kopplers zusammenfallen.
+%
+% Die Schreibweise \opt{(A|E)} nimmt die $x$-Koordinate von \prm{A} und die
+% $y$-Koordinate von \prm{E}.
+% \fi
+% \ifENGLISH
+% At the ends of the coupler we put an optical spectrum analyzer (OSA) and a
+% power meter (PD). The \Lcs{optdetector} is always set at the end of the
+% reference line, it has \Lkeyword{position} fixed to \opt{end}. These two
+% components are drawn without fibers, because their end nodes coincide with the
+% two outputs of the coupler.
+%
+% The notation \opt{(A|E)} uses the $x$-coordinate of \prm{A} and the
+% $y$-coordinate of \prm{E}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[style=example, caption={caption}, linerange={1-9,11-11}]
+*\ON*\begin{pspicture}[showgrid](4.7,2)
+ \pnode(0.7,1){A}\pnode(1,1){B}\pnode(2.8,1){C}
+ \pnode(4,1.5){D}\pnode(4,0.5){E}
+ \psset{optboxwidth=0.7, labelstyle=\scriptsize}
+ \optbox[position=start, label=0, fiber](A)(B){LD}
+ \optmzm(B)(C)
+ \wdmsplitter[abspos=0.3, label=0.4](C)(D)(E){50\%}*\OFF*
+ \optbox[position=end, label=0](A|D)(D){OSA}
+ \optdetector(A|E)(E){PD}*\ON*
+ \psset{style=Refline}\psdot(A)\psdot(B)\psdot(C)\psdot(D)\psdot(E)
+\end{pspicture}*\OFF*
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN\subsection{Faseraufbau (Alternative)}\fi
+% \ifENGLISH\subsection{Fiber setup (alternative)}\fi
+% \label{ex:fiber-setup-alt}
+%
+% \ifGERMAN
+% Dieses Beispiel ist vom Ergebnis her identisch mit dem vorangegangenen
+% (\prettyref{ex:fiber-setup}), wird aber anders angegangen.
+%
+% Hier verwenden wir nicht die automatischen Faserverbindungen sondern zeichnen,
+% wie bei Freistrahlaufbauten, zuerst die Komponenten und verbinden diese zum
+% Schluß explizit mit Fasern (\Lcs{drawfiber}). Daher benötigen wir weniger
+% Referenzknoten, die Faserverbindungen werden mit \Lkeyword{fiber}\opt{=none}
+% global unterdrückt.
+%
+% Welche Herangehensweise verwendet wird ist meistens Geschmackssache, bei
+% Ringstrukturen wie z.B. Faserlasern kann das nachträgliche Verbinden mit
+% \Lcs{drawfiber} von Vorteil sein.
+% \fi
+%
+% \ifENGLISH
+% This example has the same result as the previous one
+% (\prettyref{ex:fiber-setup}), but is constructed differently.
+%
+% This time we do not use the automatic fiber connections, but draw all
+% components first and connect them afterwards with fibers
+% (\Lcs{drawfiber}). This requires less reference nodes, the fiber connections
+% are suppressed globally with \Lkeyword{fiber}\opt{=none}.
+%
+% The choice of the procedure depends on personal preferences, for loop setups,
+% like for fiber lasers, it looks better if the fibers are drawn after the
+% components with \Lcs{drawfiber}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[style=example, caption={caption}, linerange={1-10,13-13}]
+\begin{pspicture}[showgrid](4.9,2)
+ \pnode(0.7,1){A}\pnode(4,1){B}
+ \psset{optboxwidth=0.7, labelstyle=\scriptsize, fiber=none}
+ \optbox[position=start, labeloffset=0](A)(B){LD}
+ \optmzm[abspos=1.1](A)(B)
+ \wdmsplitter[abspos=2.25, label=0.4](A)(B)(B){50\%}
+ \optbox[position=end,label=0, compshift=0.5](A)(B){OSA}
+ \optdetector[compshift=-0.5](A)(B){PD}
+ \drawfiber{1}{2}{3}{4}
+ \drawfiber{3}{5}
+ \psset{style=Refline}\psdot(A)\psdot(B)
+ \color{Refline}\uput[45](A){A}\uput[135](B){B}
+\end{pspicture}
+\end{LTXexample}
+% \endgroup
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% \newpage
+% \subsection{Michelson-Interferometer}
+% \fi
+% \ifENGLISH
+% \subsection{Michelson-Interferometer}
+% \fi
+% \label{ex:michelson}
+%
+% \ifGERMAN
+% In diesem Beispiel werden neben Linsen auch reflektierende Elemente
+% (Spiegel) eingesetzt sowie Elemente, die sowohl transmittieren als
+% auch reflektieren (Strahlteiler).
+% \fi
+% \ifENGLISH
+% In this example we use lenses, reflective elements (mirrors) and components
+% which can be either transmittive or reflective (beamsplitter).
+% \fi
+%
+% \begingroup
+% \catcode`\*=13
+% \def*{}%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[style=example, hsep=8mm, numbers=left, numberstyle=\footnotesize, caption={caption}]
+\begin{pspicture}(3.2,5)
+ \pnode(0,3){A}\pnode(1,3){BS}\pnode(3,3){M1}*\label{l:ex2-nodes1}*
+ \pnode(1,5){M2}\pnode(1,1){PD}*\label{l:ex2-nodes2}*
+ \psset{mirrortype=extended, mirrordepth=0.2}*\label{l:ex2-set}*
+ \begin{optexp}*\label{l:ex2-begin}*
+ \beamsplitter[bsstyle=plate, compname=BS](A)(BS)(PD)*\label{l:ex2-bs}*
+ \mirror[compname=M1](BS)(M1)(BS)*\label{l:ex2-m1}*
+ \mirror[compname=M2, variable](BS)(M2)(BS)*\label{l:ex2-m2}*
+ \lens[compname=L](BS)(PD)*\label{l:ex2-l}*
+ \optdetector[compname=Det, dettype=diode](BS)(PD)*\label{l:ex2-det}*
+ \addtopsstyle{Beam}{beamwidth=0.2, fillstyle=solid, fillcolor=green!20!white}*\label{l:ex2-style}*
+ \drawwidebeam{(A)}{BS}{M1}{BS}{M2}{BS}{L}{Det}*\label{l:ex2-beam}*
+ \end{optexp}
+\end{pspicture}
+\end{LTXexample}
+% \endgroup
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% Wir beginnen wieder, indem wir die Referenzknoten definieren
+% (\prettyref{l:ex2-nodes1}--\ref{l:ex2-nodes2}) und ein paar
+% grundlegende Einstellungen setzen (\prettyref{l:ex2-set}).
+%
+% Dann werden der Reihe nach alle Komponenten platziert
+% (\prettyref{l:ex2-bs}--\ref{l:ex2-det}). Die reflektierenden benötigen
+% drei Referenzknoten: den Eingangsknoten, den Knoten an dem die
+% reflektierende Grenzfläche ist und den Ausgangsknoten. Anschließend
+% wird noch das Aussehen des Lichtstrahls festgelegt
+% (\prettyref{l:ex2-style}) und der Strahl gezeichnet
+% (\prettyref{l:ex2-beam}).
+%
+% Diese Mal haben wir den Komponenten Namen gegeben (\Lkeyword{compname}) die
+% beim Raytracing anstelle der IDs -- der automatisch vergebenen Nummern --
+% verwendet werden können. Dies kann die Nachverfolgung des Strahlengangs
+% erleichtern.
+%
+% Alle Komponenten und Strahlen wurden zusätzlich in eine
+% \Lenv{optexp}-Umgebung gekapselt. Innerhalb dieser werden alle
+% Lichtstrahlen hinter die Komponenten gelegt, sodass diese nicht
+% verdeckt werden.
+% \fi
+% \ifENGLISH
+% We start with definition of the reference nodes
+% (\prettyref{l:ex2-nodes1}--\ref{l:ex2-nodes2}) and setting some basic
+% parameters (\prettyref{l:ex2-set}).
+%
+% Following, all components are positioned
+% (\prettyref{l:ex2-bs}--\ref{l:ex2-det}). The reflective ones need three
+% reference nodes, the input node, the node where the reflective interface is
+% situated, and the output node. Then, the appearance of the beam is set
+% (\prettyref{l:ex2-style}), and the beam is drawn (\prettyref{l:ex2-beam}).
+%
+% In this example, all components have a name (\Lkeyword{compname}), which can
+% be used instead of the numerical IDs---automatically assigned, unique
+% numbers---for the raytracing. This can simplify follwing the beam path.
+%
+% All components and beams are enclosed in a \Lenv{optexp} environment. Inside
+% of this, all beams are drawn behind the components.
+% \fi
+%
+%
+% \ifGERMAN\chapter{Allgemeine Komponentenparameter}\fi
+% \ifENGLISH\chapter{General component parameters}\fi
+% \label{chap:generalparam}
+%
+% \ifGERMAN Dieses Kapitel enthält alle Informationen zu allgemeinen Parametern
+% und Konzepten. Das beinhaltet das Setzen von Beschriftungen
+% (\ref{sec:labels}), Positionierung (\ref{sec:positioning}), Drehen und
+% Verschieben von Komponenten (\ref{sec:rotshift}) und Anpassen der Aussehens
+% (\ref{sec:styles} und \ref{sec:appearance}).
+% \fi
+% \ifENGLISH This chapter introduces generic parameters and concepts such as
+% labels (\ref{sec:labels}), positioning (\ref{sec:positioning}), rotating and
+% shifting of components (\ref{sec:rotshift}) and changing the appearance of
+% components (\ref{sec:styles} and \ref{sec:appearance}).
+% \fi
+%
+% \ifGERMAN\section{Beschriftungen}\fi
+% \ifENGLISH\section{Labels}\fi
+% \label{sec:labels}
+%
+% \ifGERMAN Alle Komponenten können mit einer Beschriftung versehen werden,
+% deren Position und Ausrichtung genau angepasst werden kann. Die Beschriftung
+% ist für jede Komponente optional. Sollten die vielfältigen Parameter nicht
+% ausreichend sein, können Sie den Beschriftungsknoten -- in einigen Beispielen
+% mit einem roten Punkt gekennzeichnet -- auch direkt verwenden (siehe auch
+% \prettyref{sec:labelnode}).
+% \fi
+% \ifENGLISH All components may have a label which position and alignment can be
+% adjusted at will. The label is optional for every component. If the various
+% parameters are not sufficient, you can access the label node---marked as red
+% dot in some examples---directly (see also \prettyref{sec:labelnode}).
+% \fi
+%
+% \begin{optionlist}
+% \numitem[0.8]{labeloffset}
+% \ifGERMAN Der Abstand des Referenzknotens für die Beschriftung (roter Punkt) zur Komponentenmitte (blaues Kreuz).\fi
+% \ifENGLISH The offset of the label reference node (red dot) from the component
+% center (blue cross).\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-2,6-6}, morekeywords={[21]{labeloffset}}]
+\begin{pspicture}(3,1.8)
+ \optbox[beam, labeloffset=1](0,1.5)(3,0.8){label}
+ \psdot[style=CenterNode](\oenodeCenter{})
+ \psdot[linecolor=red](\oenodeLabel{})
+ \ncline[arrows=<->, style=Refline, arrowinset=0, arrowscale=1.5]{\oenodeCenter{}}{\oenodeLabel{}}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \valitem{labelstyle}{macros}
+% \ifGERMAN Der Schriftstil der Beschriftungen.\fi
+% \ifENGLISH The text style that is used to typeset the label.\fi
+%
+% \valitem[c]{labelalign}{refpoint}
+% \ifGERMAN Definiert die Ausrichtung der Beschriftung bezüglich des
+% Beschriftungsknotens.
+% \fi
+% \ifENGLISH Defines the alignment of the label relative to the label node.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-3,6-6}, morekeywords={[21]{labeloffset, labelalign}}]
+\begin{pspicture}(3,1.8)
+ \psset{beam, labeloffset=1}
+ \optbox[labelalign=bl](0,1.5)(3,0.8){label}
+ \psdot[style=CenterNode](\oenodeCenter{})
+ \psdot[linecolor=red](\oenodeLabel{})
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \numitem[0]{labelangle}
+% \ifGERMAN
+% Der Rotationswinkel des Beschriftungsknotens um die Mitte. Der Nullpunkt hängt
+% sowohl von der jeweiligen Komponenten und dem gewählten Referenzsystem ab
+% (siehe \Lkeyword{labelref}).
+% \fi
+% \ifENGLISH
+% The rotation angle of the label node around the component center. The origin
+% depends both on the component and the choosen reference system (see
+% \Lkeyword{labelref}).
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-2,4-6,27-27}, morekeywords={[21]{labelangle}}]
+\begin{pspicture}(-0.3,0)(2,3.7)
+ \psset{labeloffset=1, optboxwidth=1, arrowscale=1.5, arrowinset=0}
+ \begin{optexp}
+ \optbox[position=end, labelangle=90](1,1)(1,2){Box}
+ \beamsplitter[labelangle=-90](1,2)(1,1)(2,1){BS}
+ \drawbeam[arrows=->]{1}{2}{(2,1)}
+ \frontlayer{%
+ \psdot[style=CenterNode](\oenodeCenter{1})
+ \psdot[style=CenterNode](\oenodeCenter{2})
+ \psdot[linecolor=red](\oenodeLabel{1})
+ \psdot[linecolor=red](\oenodeLabel{2})
+ }
+ \backlayer{%
+ \bgroup
+ \psset{style=Refline}
+ \psline(\oenodeCenter{2})([offset=-1]\oenodeCenter{2})
+ \psline(\oenodeCenter{2})([Xnodesep=-1]\oenodeCenter{2})
+ \psarc[arrows=<-](\oenodeCenter{2}){0.7}{180}{270}
+ \uput{0.9}[-135](\oenodeCenter{2}){\small $-90$\textdegree}
+ \psline(\oenodeCenter{1})([Xnodesep=1]\oenodeCenter{1})
+ \psline(\oenodeCenter{1})([offset=1]\oenodeCenter{1})
+ \psarc[arrows=->](\oenodeCenter{1}){0.7}{0}{90}
+ \uput{0.9}[45](\oenodeCenter{1}){\small $90$\textdegree}
+ \egroup
+ }
+ \end{optexp}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \choitem[relgrav]{labelref}{relative, relgrav, global}
+% \ifGERMAN
+% Wählt das Bezugssystem für \Lkeyword{labelangle} und die Orientierung der
+% Beschriftung.
+% \fi
+% \ifENGLISH
+% Set the reference coordinate system for the \Lkeyword{labelangle} and the
+% orientation of the label text.
+% \fi
+%
+% \begin{valuelist}
+% \item[relative]
+% \ifGERMAN Die Beschriftung ist parallel zu der Referenzlinie der
+% Komponente und der Winkel wird immer auf den Bereich zwischen $-90$° und
+% $+90$° zurückgerechnet.
+% \fi
+% \ifENGLISH The label is parallel to the component reference line and the
+% actual angle is always projected to the range between $-90$° and $+90$°.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{labelref}}]
+\begin{pspicture}(0,-2.2)(2,2.2)
+ \psset{position=end, optboxsize=1 0.6, labeloffset=0, labelref=relative}
+ \multido{\i=0+45}{8}{%
+ \optbox(0,0)(1;\i){\i}
+ }
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item[relgrav]
+% \ifGERMAN Die Beschriftung ist immer horizontal, lediglich der
+% Beschriftungsknoten wird zusammen mit der Komponente gedreht.
+% \fi
+% \ifENGLISH The label itself is always horizontal, only the label node is
+% rotated together with the component.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{labelref}}]
+\begin{pspicture}(0,-2.2)(2,2.2)
+ \psset{position=end, optboxsize=1 0.6, labelref=relgrav}
+ \multido{\i=0+72}{5}{%
+ \optbox(0,0)(1;\i){\i}
+ }
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item[global]
+% \ifGERMAN Die Beschriftung ist unabhängig von der Komponentenausrichtung.\fi
+% \ifENGLISH The label is independent of the component alignment.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{labelref}}]
+\begin{pspicture}(0,-2.2)(2,2.2)
+ \psset{position=end, optboxsize=1 0.6, labelref=global}
+ \multido{\i=0+72}{5}{%
+ \optbox(0,0)(1;\i){\i}
+ }
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{valuelist}
+%
+% \optitem{label}{\prm{offset}[ \prm{angle}[ \prm{refpoint}[ \prm{labelref}]]]}
+% \ifGERMAN
+% Diese Option erlaubt die kompakte Definition mehrerer
+% Beschriftungsparameter. Es können bis zu vier Leerzeichen-getrennte
+% Argumente übergeben werden (\Lkeyword{labeloffset},
+% \Lkeyword{labelangle}, \Lkeyword{labelalign} und
+% \Lkeyword{labelref}). Mit einem Punkt kann eine Option übersprungen
+% werden.
+% \fi
+% \ifENGLISH
+% Allows compact definition of several label parameters. It takes up to
+% four space-separated arguments (\Lkeyword{labeloffset},
+% \Lkeyword{labelangle}, \Lkeyword{labelalign}, and
+% \Lkeyword{labelref}). Unchanged intermediate arguments can be
+% skipped with a dot.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{label}}]
+\begin{pspicture}(0,0)(4,3)
+ \psset{endbox, beam}
+ \optbox[label=0.7](1.5,2.5)(2.5,2.5){box}
+ \optbox[label=1 -45](1.5,1)(2.5,1){$-45$}
+ \optbox[label=0 . . relative]%
+ (0.6,0.6)(0.6,1.6){relative}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \choitem{innerlabel}{true}
+% \ifGERMAN Das ist ein Alias für \opt{label=0 .\ .\ relative}\fi
+% \ifENGLISH This is an alias for \opt{label=0 .\ .\ relative}\fi
+% \end{optionlist}
+%
+%
+%
+% \ifGERMAN\section{Positionierung}\fi
+% \ifENGLISH\section{Positioning}\fi
+% \label{sec:positioning}
+%
+% \ifGERMAN
+% Alle Komponenten außer den Freistrahl-Dreipolen können zwischen ihren
+% beiden Referenzknoten \Lcs{oenodeRefA} und \Lcs{oenodeRefB}
+% positioniert werden.
+% \fi
+% \ifENGLISH
+% All components except for the free-ray tripoles can be positioned between
+% their two reference nodes \Lcs{oenodeRefA} and \Lcs{oenodeRefB}.
+% \fi
+% \begin{optionlist}
+% \choitem{position}{\prm{num},start,end}
+% \ifGERMAN
+% Ist der Wert eine Zahl, so wird damit die relative Position der Mitte eines
+% Objektes (blaues Kreuz) bezüglich seiner beiden Referenzknoten (schwarze
+% Punkte) gesetzt. Das ist äquivalent zum \Lkeyword*{npos} Parameter von
+% \Lcs*{ncput}, d.h. eine Zahl im Intervall $[0,1]$ (siehe \LPack{pst-node}
+% Dokumentation\fnurl{http://mirror.ctan.org/help/Catalogue/entries/pst-node.html}).
+% \fi
+% \ifENGLISH Controls the relative position of an object center (blue cross)
+% between its two reference points (black dots), if the value is a number. In
+% this case it is equivalent to the \Lkeyword*{npos} parameter of
+% \Lcs*{ncput}, i.e. a number in the range $[0,1]$ (see \LPack{pst-node}
+% documentation\fnurl{http://mirror.ctan.org/help/Catalogue/entries/pst-node.html}).
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{position}}, linerange={1-2,5-5}]
+\begin{pspicture}(3,1.5)
+ \lens[beam, position=0.8](0,1)(3,1){L}
+ \psdot(\oenodeRefA{})\psdot(\oenodeRefB{})
+ \psdot[style=CenterNode](\oenodeCenter{})
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% Der Wert \opt{start} setzt ein Objekt an den Anfang, \opt{end} ans Ende der
+% Referenzlinie, so dass die entsprechende Grenzfläche auf dem Referenzknoten
+% (schwarzer Punkt) liegt, und nicht die Mitte des Objektes (blaues Kreuz), wie
+% es mit \opt{position=1} bzw. \opt{position=0} der Fall wäre. Unter Verwendung
+% von Zahlen wäre dieses Verhalten deutlich schwieriger und weniger flexibel zu
+% erreichen, da die Größe und Form des Objektes berücksichtigt werden muss.
+% \fi
+% \ifENGLISH
+% The values \opt{start} and \opt{end} place an object at the start or end of
+% the reference line, respectively. The respective object interface is placed on
+% the respective reference node (black dot) instead of the object center (blue
+% cross) which would be the case for \opt{position=0} or
+% \opt{position=1}. Achieving this with numerical values would me more difficult
+% and unflexible, because the object size and shape must be taken into account.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{position}}, linerange={1-4,8-8}]
+\begin{pspicture}(3,2)
+ \pnode(0.5,1){A}\pnode(2.5,1){B}\psdot(A)\psdot(B)
+ \optbox[optboxsize=0.5 0.5, position=start](A)(B)
+ \lens[position=end](A)(B)
+ \psline[style=Refline](A)(B)
+ \psdot[style=CenterNode](\oenodeCenter{1})
+ \psdot[style=CenterNode](\oenodeCenter{2})
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN Hier ist im Vergleich dazu die Positionierung mit
+% \opt{position=0}/\opt{1}.
+% \fi
+% \ifENGLISH Here is for comparison the positioning with
+% \opt{position=0}/\opt{1}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{position}}, linerange={1-4,8-8}]
+\begin{pspicture}(3,2)
+ \pnode(0.5,1){A}\pnode(2.5,1){B}\psdot(A)\psdot(B)
+ \optbox[optboxsize=0.5 0.5, position=0](A)(B)
+ \lens[position=1](A)(B)
+ \psline[style=Refline](A)(B)
+ \psdot[style=CenterNode](\oenodeCenter{1})
+ \psdot[style=CenterNode](\oenodeCenter{2})
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \choitem{abspos}{\prm{num},start,end}
+% \ifGERMAN
+% Eine Zahl setzt die absolute Position eines Objektes auf der
+% Referenzlinie. Die Werte \opt{start} und \opt{end} werden identisch wie bei
+% \Lkeyword{position} behandelt.
+% \fi
+% \ifENGLISH
+% Controls the absolute position of an object on the reference line. The values
+% \opt{start} and \opt{end} are handled identically to \Lkeyword{position}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{abspos}}, linerange={1-2,5-5}]
+\begin{pspicture}(3,1.5)
+ \lens[beam, abspos=1](0,1)(3,1){L}
+ \psdot(\oenodeRefA{})\psdot(\oenodeRefB{})
+ \psdot[style=CenterNode](\oenodeCenter{})
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+%
+%
+% \ifGERMAN\section{Drehen und Verschieben}\fi
+% \ifENGLISH\section{Rotating and shifting}\fi
+% \label{sec:rotshift}
+%
+% \ifGERMAN
+% Alle Komponenten können versetzt und um verschiedene Bezugspunkte
+% gedreht werden.
+%
+% Beachten Sie, dass mit den Komponenten auch die Grenzflächenknoten
+% (\prettyref{sec:ifcnode}, in den folgenden Beispielen mit blauen Kreuzen
+% markiert) transformiert werden, wodurch Verbindungen beinflußt werden. Die
+% transformierten Referenzknoten sind als eigene Knoten verfügbar
+% (\prettyref{sec:refnode}).
+% \fi
+% \ifENGLISH
+% All components can be shifted and rotated around different reference nodes.
+%
+% Please note, that together with the components also their interface nodes
+% (\prettyref{sec:ifcnode}, marked as blue crosses in the following examples)
+% are transformed, which may impact the connections. The transformed reference
+% nodes are accessible as new nodes (\prettyref{sec:refnode}).
+% \fi
+%
+% \begin{optionlist}
+% \numitem[0]{angle}
+% \ifGERMAN Dreht eine Komponente um den Winkel \prm{num} (in Grad). Die
+% Ausgangsposition ist grau gestrichelt eingezeichnet.
+% \fi
+% \ifENGLISH Rotate a component by an angle \prm{num} (in degree). The original
+% position is drawn gray dashed.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-2,4-4,10-10}, morekeywords={[21]{angle}}]
+\begin{pspicture}(3,2)
+ \pnode(0,1){A}\pnode(2.7,1){B}
+ \optbox[addtoOptComp={style=Refline, linestyle=dashed}](A)(B)
+ \optbox[angle=20, innerlabel](A)(B){box}
+ \psline[style=Refline](\oenodeRefA{})(\oenodeRefB{})
+ \psdot(\oenodeRefA{})\uput[-90](\oenodeRefA{}){RefA}
+ \psdot(\oenodeRefB{})\uput[-90](\oenodeRefB{}){RefB}
+ \psdot[style=CenterNode](\oenodeIn{})
+ \psdot[style=CenterNode](\oenodeOut{})
+\end{pspicture}
+\end{LTXexample}
+%\iffalse
+%</ignore>
+%\fi
+%
+% \valitem[c]{rotateref}{refpoint}
+% \ifGERMAN
+% Setzt den Bezugspunkt für die Drehung der Komponente. Bitte lesen Sie
+% \prettyref{sec:rotrefnode} für eine genauere Beschreibung und entnehmen Sie
+% \prettyref{sec:overview-extnode} die möglichen Bezugspunkte für alle
+% Komponenten. Die Ausgangsposition ist grau gestrichelt eingezeichnet.
+% \fi
+% \ifENGLISH
+% Set the reference point for the rotation of the component. Please see
+% \prettyref{sec:rotrefnode} for a detailed explanation and
+% \prettyref{sec:overview-extnode} for a list of the possible reference nodes of
+% all components. The original position is drawn gray dashed.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-2,4-4,10-10}, morekeywords={[21]{angle,rotateref}}]
+\begin{pspicture}(3,2)
+ \pnode(0,1){A}\pnode(2.7,1){B}
+ \optbox[addtoOptComp={style=Refline, linestyle=dashed}](A)(B)
+ \optbox[angle=20, rotateref=bl, innerlabel](A)(B){box}
+ \psline[style=Refline](\oenodeRefA{})(\oenodeRefB{})
+ \psdot(\oenodeRefA{})\uput[-90](\oenodeRefA{}){RefA}
+ \psdot(\oenodeRefB{})\uput[-90](\oenodeRefB{}){RefB}
+ \psdot[style=CenterNode](\oenodeIn{})
+ \psdot[style=CenterNode](\oenodeOut{})
+\end{pspicture}
+\end{LTXexample}
+%\iffalse
+%</ignore>
+%\fi
+%
+% \numitem[0]{compshift}
+% \ifGERMAN Verschiebt eine Komponente vertikal bezüglich ihrer Referenzlinie
+% (siehe \prettyref{sec:refnode}). Reflektive Komponenten werden entlang der
+% reflektiven Grenzfläche verschoben.
+% \fi
+% \ifENGLISH
+% Shift a component perpendicular to its reference line (see
+% \prettyref{sec:refnode}). For reflective components it is shifted along the
+% reflective interface.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-3,9-9}, morekeywords={[21]{compshift}}]
+\begin{pspicture}(3,2)
+ \pnode(0,1){A}\pnode(2.7,1){B}
+ \lens[compshift=0.3](A)(B){L}
+ \psline[style=Refline](\oenodeRefA{})(\oenodeRefB{})
+ \psdot(\oenodeRefA{})\uput[-90](\oenodeRefA{}){RefA}
+ \psdot(\oenodeRefB{})\uput[-90](\oenodeRefB{}){RefB}
+ \psdot[style=CenterNode](\oenodeIn{})
+ \psdot[style=CenterNode](\oenodeOut{})
+\end{pspicture}
+\end{LTXexample}
+\begin{LTXexample}[linerange={1-3,9-9}, morekeywords={[21]{compshift}}]
+\begin{pspicture}(3,2)
+ \pnode(0,1){A}\pnode(2,0){B}
+ \mirror[compshift=0.3](A)(2,1)(B){mirror}
+ \psline[style=Refline](\oenodeRefA{})(\oenodeRefB{}|\oenodeRefA{})(\oenodeRefB{})
+ \psdot(\oenodeRefA{})\uput[-90](\oenodeRefA{}){RefA}
+ \psdot(\oenodeRefB{})\uput[180](\oenodeRefB{}){RefB}
+ \psdot[style=CenterNode](\oenodeIn{})
+ \psdot[style=CenterNode](\oenodeOut{})
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+%
+% \ifGERMAN\section{Verwendung von Stilen}\fi
+% \ifENGLISH\section{Using psstyles}\fi\label{sec:styles}
+%
+% \ifGERMAN
+% Stile sind benutzerdefinierte Grafik-Konfigurationen für
+% PSTricks-Objekte. Das \LPack{pst-optexp}-Paket macht umfangreichen
+% Gebrauch von Stilen um einzelne, logische Bereiche von Komponenten
+% flexibel gestalten zu können, was über das optionale Argument meistens
+% nicht möglich ist.
+%
+% Vorhandene Stile können mit \Lcs*{addtopsstyle} erweitert und mit
+% \Lcs*{newpsstyle} überschrieben werden.
+%
+% Als Beispiel nehmen wir einen \opt{extended} Spiegel und möchten nur
+% den «extended»-Teil verändern. Hierfür wird der Stil
+% \Lstyle{ExtendedMirror} bereitgestellt:
+% \fi
+% \ifENGLISH
+% Psstyles are custom graphics parameter configurations for PSTricks
+% objects. The \LPack{pst-optexp} package makes extensive use of styles
+% to facilitate flexible design of single, logical parts of
+% components. This is in general not possible with the optional
+% argument.
+%
+% Existing styles can be extended with \Lcs*{addtopsstyle} and
+% overwritten with \Lcs*{newpsstyle}.
+%
+% As example we consider an \opt{extended} mirror and want to change
+% only the «extended» part which is controlable with the
+% \Lstyle{ExtendedMirror} style:
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \addtopsstyle{ExtendedMirror}{hatchcolor=red}
+ \mirror[mirrortype=extended, beam](0,0)(2,1.5)(0,2)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \ifGERMAN
+% Die veränderbaren Unterbereiche einer Komponente sind in der
+% jeweiligen Referenz zu finden.
+% \fi
+% \ifENGLISH
+% The changeable parts of each component are listed in the respective
+% reference.
+% \fi
+%
+%
+%
+% \ifGERMAN\section{Aussehen der Komponenten}\fi
+% \ifENGLISH\section{Component appearance}\fi
+% \label{sec:appearance}
+%
+% \begin{stylelist}
+% \styleitem{OptComp}
+% \ifGERMAN
+% Bestimmt das grundlegende Aussehen aller optischen Komponenten. Die
+% üblichen Parameter, wie z.B. \opt{linestyle}, würden auch die
+% Verbindungen beeinflussen, die mit der Komponente zusammen gezeichnet
+% werden (\Lkeyword{beam}, \Lkeyword{fiber} usw.). Mit
+% \Lkeyword{newOptComp} und \Lkeyword{addtoOptComp} kann der Stil für
+% einzelne Komponenten oder zusammen mit \Lcs*{newpsobject} im optionalen
+% Argument verwendet werden.
+% \fi
+% \ifENGLISH
+% Affects the basic appearence of all optical components. Using standard
+% graphics parameters like e.g.\ \opt{linestyle} would change also the
+% connections that are drawn together with the component
+% (\Lkeyword{beam}, \Lkeyword{fiber} etc.). Use the key
+% \Lkeyword{newOptComp} and \Lkeyword{addtoOptComp} to change the style
+% for single components or for use with \Lcs*{newpsobject} via the
+% optional argument.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\ifGERMAN
+\begin{LTXexample}[morekeywords={[21]{addtoOptComp}}]
+\begin{pspicture}(2.5,4)
+ \psset{beam}
+ % falsch, die Strahlbreite wird auch geaendert
+ \mirror[linewidth=3\pslinewidth](0,3)(2,3)(2,2)
+ % korrektes Ergebnis
+ \addtopsstyle{OptComp}{linewidth=3\pslinewidth}
+ \mirror(0,1)(2,1)(2,0)
+\end{pspicture}
+\end{LTXexample}
+\fi\ifENGLISH
+\begin{LTXexample}[morekeywords={[21]{addtoOptComp}}]
+\begin{pspicture}(2.5,4)
+ \psset{beam}
+ % wrong, also beam width is changed
+ \mirror[linewidth=3\pslinewidth](0,3)(2,3)(2,2)
+ % correct result
+ \addtopsstyle{OptComp}{linewidth=3\pslinewidth}
+ \mirror(0,1)(2,1)(2,0)
+\end{pspicture}
+\end{LTXexample}
+\fi
+% \iffalse
+%</ignore>
+% \fi
+%
+% \styleitem[linestyle=dashed,dash=1.5pt 1pt]{OptionalStyle}
+% \ifGERMAN
+% Der Stil wird zusätzlich zu \Lkeyword{OptComp} auf Komponenten angewendet,
+% die als \Lkeyword{optional} markiert sind.
+% \fi
+% \ifENGLISH
+% This style is applied to components marked as \Lkeyword{optional} in addition
+% to \Lkeyword{OptComp}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{optional}}]
+\begin{pspicture}(3,1.5)
+\lens[optional, beam](0,1)(3,1)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% \Lstyle{OptionalStyle} wird nach \Lstyle{OptComp} angewendet, so dass
+% einzelne Einstellungen überschrieben werden können.
+% \fi
+% \ifENGLISH
+% \Lstyle{OptionalStyle} is applied after \Lstyle{OptComp} so that it
+% can overwrite the general settings.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\ifGERMAN
+\begin{LTXexample}[morekeywords={[21]{OptComp, OptionalStyle, optional}}]
+\begin{pspicture}(3,1.5)
+\addtopsstyle{OptComp}{linewidth=3\pslinewidth, linecolor=red}
+\newpsstyle{OptionalStyle}{linecolor=blue}
+\lens(0,1)(2,1)
+% Liniefarbe wird ueberschrieben, die Linienbreite nicht.
+\lens[optional](0,1)(3,1)
+\end{pspicture}
+\end{LTXexample}
+\fi\ifENGLISH
+\begin{LTXexample}[morekeywords={[21]{OptComp, OptionalStyle, optional}}]
+\begin{pspicture}(3,1.5)
+\addtopsstyle{OptComp}{linewidth=3\pslinewidth, linecolor=red}
+\newpsstyle{OptionalStyle}{linecolor=blue}
+\lens(0,1)(2,1)
+% linecolor overwritten, linewidth kept
+\lens[optional](0,1)(3,1)
+\end{pspicture}
+\end{LTXexample}
+\fi
+% \iffalse
+%</ignore>
+% \fi
+%
+% \styleitem[linewidth=0.8\cs{pslinewidth}, arrowinset=0, arrowscale=0.8, arrows=<->]{VariableStyle}
+% \ifGERMAN Der Stil der Pfeile für verstellbare Komponenten (\Lcs{mirror} und
+% \Lcs{optgrating}).
+% \fi
+% \ifENGLISH The style of the arrows of variable components (\Lcs{mirror} and
+% \Lcs{optgrating}).
+% \fi
+% \end{stylelist}
+%
+% \begin{optionlist}
+% \valitem{addtoOptComp}{list}
+% \addtostylemsg{OptComp}
+%
+% \valitem{newOptComp}{list}
+% \newstylemsg{OptComp}
+%
+% \iffalse
+%<*ignore>
+% \fi
+\ifGERMAN
+\begin{LTXexample}[morekeywords={[21]{addtoOptComp,newOptComp}}]
+\begin{pspicture}(3,1.5)
+ \psset{beam}
+ \newpsstyle{OptComp}{linewidth=3\pslinewidth}
+ \mirror[addtoOptComp={linestyle=dotted}](0.5,0)(0.5,1)(1.5,1)
+ % Ueberschreibt linewidth-Einstellungen
+ \mirror[newOptComp={linestyle=dotted}](1.5,1)(2.5,1)(2.5,0)
+\end{pspicture}
+\end{LTXexample}
+\fi
+\ifENGLISH
+\begin{LTXexample}[morekeywords={[21]{addtoOptComp,newOptComp}}]
+\begin{pspicture}(3,1.5)
+ \psset{beam}
+ \newpsstyle{OptComp}{linewidth=3\pslinewidth}
+ \mirror[addtoOptComp={linestyle=dotted}](0.5,0)(0.5,1)(1.5,1)
+ % overwrites the linewidth settings
+ \mirror[newOptComp={linestyle=dotted}](1.5,1)(2.5,1)(2.5,0)
+\end{pspicture}
+\end{LTXexample}
+\fi
+% \iffalse
+%</ignore>
+% \fi
+%
+% \boolitem[false]{optional}
+% \ifGERMAN
+% Markiert eine Komponente als optional indem der Stil
+% \Lstyle{OptionalStyle} angewendet wird.
+% \fi
+% \ifENGLISH
+% Mark an object as optional by applying the \Lstyle{OptionalStyle} style.
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\chapter{Freistrahlkomponenten}\fi
+% \ifENGLISH\chapter{Free-ray components}\fi
+% \label{chap:freeraycomp}
+%
+% \ifGERMAN In diesem Kapitel werden alle Freistrahlkomponenten und deren
+% Parameter beschrieben. Freistrahlkomponenten können, im Gegensatz zu
+% Faserkomponenten, transmittive und reflektive Grenzflächen haben, die für
+% Raytracing von Lichtstrahlen verwendet werden können. Es gibt zwei
+% unterschiedliche Komponententypen: manche benötigen nur zwei Knoten um
+% positioniert zu werden (\ref{cmd:lens}--\ref{cmd:polarization}), wohingegen
+% z.B. Spiegel drei Knoten benötigen um korrekt ausgerichtet zu werden
+% (\ref{cmd:mirror}--\ref{cmd:pentaprism}).
+% \fi
+% \ifENGLISH This chapter describes all free-ray components and their
+% options. Free-ray components differ from fiber components in that they provide
+% transmittive or reflective interfaces which can be used to raytrace
+% beams. They are divided in two types: some components like lenses need only
+% two nodes for positioning (\ref{cmd:lens}--\ref{cmd:polarization}), whereas
+% e.g. mirrors require three nodes to determine the orientation
+% (\ref{cmd:mirror}--\ref{cmd:pentaprism}).
+% \fi
+%
+% \ifGERMAN\section{Linse}\fi
+% \ifENGLISH\section{Lens}\fi
+% \label{sec:lens}
+%
+% \begin{ltxsyntax}
+% \dipoledesc{lens}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \lens[beam](0,1)(3,1){L}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \ifENGLISH A lens is defined by its height and the radii of the input and
+% output interfaces.
+% \fi
+% \ifGERMAN Eine Linse wird durch ihre Höhe und die beiden Radien der Eingangs-
+% und Ausgangsflächen definiert.
+% \fi
+%
+% \begin{optionlist}
+% \numitem[1]{lensheight}
+% \ifGERMAN Setzt die Höhe der Linse.\fi
+% \ifENGLISH Set the height of the lens.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{lensheight}}]
+\begin{pspicture}(3,1.5)
+ \lens[beam](0,1)(3,1){L1}
+ \lens[lensheight=0.5](2,1)(3,1){L2}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \numitem[1]{lensradiusleft}
+% \ifGERMAN
+% Setzt den Radius der linken Linsengrenzfläche. Ein positiver Wert \prm{num}
+% ist für eine konvexe, ein negativer für eine konkave Krümmung. Null ergibt
+% eine ebene Fläche.
+% \fi
+% \ifENGLISH
+% Set the left radius of the lens. A positive \prm{num} is for convex, a
+% negative one for concave curvatures. Use zero for a plain surface.
+% \fi
+%
+% \numitem[1]{lensradiusright}
+% \ifGERMAN
+% Das Gleiche wie \Lkeyword{lensradiusleft}, nur für die rechte Grenzfläche.
+% \fi
+% \ifENGLISH
+% Same as \Lkeyword{lensradiusleft} but for the right surface.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{lensradiusleft, lensradiusright}}]
+\begin{pspicture}(3,1.5)
+ \psset{lensradiusright=0, beam}
+ \lens[lensradiusleft=1](0,1)(1.5,1){$R > 0$}
+ \lens[lensradiusleft=-1](1.5,1)(3,1){$R < 0$}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \optitem{lensradius}{\prm{left}[ \prm{right}]}
+% \ifGERMAN
+% Setzt die linke und rechte Linsenkrümmung. Wird nur ein Wert angegeben, so
+% wird dieser für beide Krümmungen verwendet.
+% \fi
+% \ifENGLISH
+% Set the left and right lens curvatures. If only a single value is given, it is
+% used for both curvatures.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{lensradius}}]
+\begin{pspicture}(3,1.5)
+ \lens[lensradius=-2, beam](0,1)(3,1)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \numitem[0]{lenswidth}
+% \ifGERMAN
+% Üblicherweise werden nur die Höhe und die beiden Radien für die
+% Konstruktion der Linse verwendet, die Mittenbreite wird automatisch
+% berechnet. Wenn \Lkeyword{lenswidth} auf einen Wert größer Null gesetzt wird,
+% wird diese Breite verwendet. Das ist nur sinnvoll, wenn dicke Linsen
+% gezeichnet werden sollen, da es andernfalls für zu kleine Werte zu unschönen
+% Ergebnissen führt.
+% \fi
+% \ifENGLISH
+% Usually only the height and the two radii are used to construct the lens,
+% the width is calculated automatically. For \Lkeyword{lenswidth} greater
+% than zero, this width is used instead. This is only useful if you want to draw
+% thick lenses and it can give ugly results if the value is choosen too
+% small.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{lenswidth}}]
+\begin{pspicture}(3,2)
+ \lens[lenswidth=0.5, beam](0,1)(2,1){thicklens}
+ \lens[lenswidth=0.1, beam](2,1)(3,1)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \optitem{lens}{\prm{radiusleft}[ \prm{radiusright}[ \prm{height}[ \prm{width}]]]}
+% \ifGERMAN
+% Eine Option zum gleichzeitigen Setzen mehrerer Linsenparameter. Werte
+% mittendrin können mit einem Punkt übersprungen und Werte am Ende können
+% weggelassen werden (z.B. \opt{lens=. 1 1}).
+% \fi
+% \ifENGLISH
+% A convenience option to specify all lens parameters with a single
+% option. Intermediate values can be skipped with a dot, values at the end can
+% be omitted (e.g. \opt{lens=.\ 1 1}).
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \lens[lens=1](0,1)(1,1){L1}
+ \lens[lensradius=-2 1, beam](0,1)(3,1){L2}
+ \lens[lens=2 -0.7 1.2](2,1)(3,1){L3}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \boolitem[false]{thicklens}
+% \ifENGLISH
+% This option was necessary until version 2.1 in order to draw a thick lens of
+% width \Lkeyword{lenswidth} instead of using the calculated lens width. This
+% option is superfluous since version 3.0 because setting \Lkeyword{lenswidth}
+% to a positive value automatically draws a thick lens.
+% \fi
+% \ifGERMAN
+% Diese Option was bis Version 2.1 notwendig um dicke Linsen der Breite
+% \Lkeyword{lenswidth} zu zeichnen, anstatt die berechnete Breite zu
+% verwenden. Seit Version 3.0 ist diese Option überflüssig, da dicke Linsen
+% gezeichnet werden, sobald \Lkeyword{lenswidth} auf einen positiven Wert
+% gesetzt wird.
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Optisches Plättchen}\fi
+% \ifENGLISH\section{Optical plate}\fi
+%
+% \begin{ltxsyntax}
+% \dipoledesc{optplate}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \optplate[beam](0,1)(3,1){filter}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+% \begin{optionlist}
+% \numitem[1]{plateheight}
+% \ifGERMAN Die Höhe des Plättchens.\fi
+% \ifENGLISH The height of the plate.\fi
+%
+% \optitem[2\nxLcs{pslinewidth}]{platelinewidth}{\prm{num} or \prm{dimen}}
+% \ifGERMAN \linewidthexplanation{des Plättchens}{Plättchen}\fi
+% \ifENGLISH \linewidthexplanation{plate}{plates}\fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Verzögerungsplättchen}\fi
+% \ifENGLISH\section{Retardation plate}\fi
+%
+% \begin{ltxsyntax}
+% \dipoledesc{optretplate}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \optretplate[beam](0,1)(3,1){$\nicefrac{\lambda}{2}$}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \numitem*[1]{plateheight}
+% \ifGERMAN Die Höhe des Plättchens.\fi
+% \ifENGLISH The height of the plate.\fi
+%
+% \numitem[0.1]{platewidth}
+% \ifGERMAN Die Breite des Plättchens.\fi
+% \ifENGLISH The width of the plate.\fi
+%
+% \optitem{platesize}{\prm{width} \prm{height}}
+% \ifGERMAN Die Breite und Höhe des Plättchens, äquivalent zum Aufruf von
+% \Lkeyword{platewidth} und \Lkeyword{plateheight}.
+% \fi
+% \ifENGLISH The width and height of the plate, is equivalent to calling both
+% \Lkeyword{platewidth} and \Lkeyword{plateheight}.
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Lochblende}\fi
+% \ifENGLISH\section{Pinhole}\fi
+%
+% \begin{ltxsyntax}
+% \dipoledesc{pinhole}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \pinhole[beam](0,1)(3,1){PH}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \numitem[1]{outerheight}
+% \ifGERMAN Die Gesamthöhe der Lochblende.\fi
+% \ifENGLISH The total height of the pinhole.\fi
+%
+% \numitem[0.1]{innerheight}
+% \ifGERMAN Die Höhe des Lochs.\fi
+% \ifENGLISH The height of the hole.\fi
+%
+% \optitem[2\nxLcs{pslinewidth}]{phlinewidth}{\prm{num} or \prm{dimen}}
+% \ifGERMAN \linewidthexplanation{der Lochblende}{Lochblenden}\fi
+% \ifENGLISH \linewidthexplanation{pinhole}{pinholes}\fi
+%
+% \numitem[0]{phwidth}
+% \ifGERMAN
+% Die Lochblende wird plastischer gezeichnet, falls \Lkeyword{phwidth}
+% ungleich Null ist. In diesem Fall wird \Lkeyword{phlinewidth} ignoriert. Bei
+% einem negativen Wert wird die Form gespiegelt.
+% \fi
+% \ifENGLISH
+% The pinhole is drawn in a more plastic style if \Lkeyword{phwidth} is
+% not zero, in this case the \Lkeyword{phlinewidth} is ignored. For negative
+% values the shape is mirrored.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{phwidth}}]
+\begin{pspicture}(3,1.5)
+ \pinhole[beam, phwidth=-0.1](0,1)(1.5,1){neg}
+ \pinhole[beam, phwidth=0.2](1.5,1)(3,1){pos}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+%
+% \ifGERMAN\section{Box}\fi
+% \ifENGLISH\section{Box}\fi
+%
+% \begin{ltxsyntax}
+% \dipoledesc{optbox}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \optbox[beam](0,0)(3,2){box}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \numitem[1.4]{optboxwidth}
+% \ifGERMAN Die Breite der Box.\fi
+% \ifENGLISH The width of the box.\fi
+%
+% \numitem[0.8]{optboxheight}
+% \ifGERMAN Die Höhe der Box.\fi
+% \ifENGLISH The height of the box.\fi
+%
+% \optitem{optboxsize}{\prm{width} \prm{height}}
+% \ifGERMAN Die Breite und Höhe der Box, äquivalent zum Aufruf von
+% \Lkeyword{optboxwidth} und \Lkeyword{optboxheight}.
+% \fi
+% \ifENGLISH The width and height of the box, is equivalent to calling both
+% \Lkeyword{optboxwidth} and \Lkeyword{optboxheight}.
+% \fi
+% \end{optionlist}
+%
+%
+% \ifGERMAN\section{Kristall}\fi
+% \ifENGLISH\section{Crystal}\fi
+%
+% \begin{ltxsyntax}
+% \dipoledesc{crystal}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.3)
+ \crystal[beam](0,1)(3,1){Crystal}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \numitem[1.4]{crystalwidth}
+% \ifGERMAN Die Breite des Kristalls.\fi
+% \ifENGLISH The width of the crystal.\fi
+%
+% \numitem[0.6]{crystalheight}
+% \ifGERMAN Die Höhe des Kristalls.\fi
+% \ifENGLISH The height of the crystal.\fi
+%
+% \optitem{crystalsize}{\prm{width} \prm{height}}
+% \ifGERMAN Die Breite und Höhe des Kristalls, äquivalent zum Aufruf von
+% \Lkeyword{crystalwidth} und \Lkeyword{crystalheight}.
+% \fi
+% \ifENGLISH The width and height of the crystal, is equivalent to calling both
+% \Lkeyword{crystalwidth} and \Lkeyword{crystalheight}.
+% \fi
+%
+% \numitem[0.3]{caxislength}
+% \ifGERMAN Die zusätzliche Länge des Pfeils für die $c$-Achse, wird weggelassen
+% falls die Länge \opt{0} ist und gespiegelt falls der Wert negativ ist. Die
+% Gesamtlänge ist \Lkeyword{caxislength} plus \Lkeyword{crystalheight}.
+% \fi
+% \ifENGLISH The additional length of the $c$-axis, is dropped when set to
+% \opt{0} and is mirrored if the values is negative. The total length is
+% \Lkeyword{caxislength} plus \Lkeyword{crystalheight}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{caxislength}}]
+\begin{pspicture}(0,0.4)(3,1.5)
+ \psset{crystalsize=0.5 0.8, label=-45 . l}
+ \crystal[position=0.2, caxislength=0.5](0,1)(3,1){pos}
+ \crystal[beam, caxislength=0](0,1)(3,1){0}
+ \crystal[position=0.8, caxislength=-0.5](0,1)(3,1){neg}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \boolitem[false]{caxisinv}
+% \ifGERMAN
+% Invertiert die Richtung der $c$-Achse, ist äquivalent zu einem
+% Vorzeichenwechsel von \Lkeyword{caxislength}.
+% \fi
+% \ifENGLISH
+% Invert the direction of the $c$-axis, this is equivalent to changing the sign
+% of \Lkeyword{caxislength}.
+% \fi
+%
+% \boolitem[false]{voltage}
+% \ifGERMAN Zeichnet einen Spannungsanschluss und ein Erdungszeichen.\fi
+% \ifENGLISH Draw a voltage connection and a ground symbol.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{voltage}}]
+\begin{pspicture}(0,0.4)(3,1.5)
+ \crystal[voltage, beam](0,1)(3,1)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \boolitem[false]{lamp}
+% \ifGERMAN Zeichnet eine Lampe neben den Kristall.\fi
+% \ifENGLISH Draw a lamp near the crystal.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{lamp}}]
+\begin{pspicture}(0,0.4)(3,1.7)
+ \crystal[lamp, beam](0,1)(3,1)
+\end{pspicture}
+\end{LTXexample}
+% \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}
+% \styleitem[linewidth=0.7\cs{pslinewidth}, linestyle=dashed, dash=2pt 2pt, arrowinset=0, arrows=->]{CrystalCaxis}
+% \ifGERMAN Der Stil für die $c$-Achse inklusive der Pfeilart.\fi
+% \ifENGLISH The style of the $c$-axis including the arrow type.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{CrysalCaxis}}]
+\begin{pspicture}(0,0.5)(3,1.6)
+ \newpsstyle{CrystalCaxis}{linecolor=red, arrows=->>}
+ \crystal[beam](0,1)(3,1)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \styleitem[linewidth=0.6\cs{pslinewidth}]{CrystalLamp}
+% \ifGERMAN Der Stil für die Hintergrundlampe.\fi
+% \ifENGLISH The style of the crystal background lamp.\fi
+% \end{stylelist}
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{voltage, lamp}}]
+\begin{pspicture}(3,1.7)
+ \crystal[fillstyle=solid, fillcolor=yellow!90!black,
+ label=1.2 -45, voltage,
+ lamp, beam](0,1)(3,1){SBN:Ce}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN\section{Detektor}\fi
+% \ifENGLISH\section{Detector}\fi
+%
+% \begin{ltxsyntax}
+% \dipoledesc{optdetector}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.2)
+ \optdetector[beam](0,0)(1.5,1){detector}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \ifENGLISH The detector is always placed at the end of the reference line
+% (\Lkeyword{position}\opt{=end}). This setting cannot be changed.
+% \fi
+% \ifGERMAN Der Detektor wird immer ans Ende der Referenzlinie platziert
+% (\Lkeyword{position}\opt{=end}). Diese Einstellung kann nicht verändert
+% werden.
+% \fi
+%
+% \begin{optionlist}
+% \optitem[0.8]{detsize}{\prm{num} or \prm{width} \prm{height}}
+% \ifGERMAN
+% Wenn eine einzelne Zahl angegeben ist, dann ist das die Seitenlänge
+% (\opt{diode}) bzw. der Durchmesser (\opt{round}) des Detektors. Werden zwei
+% Zahlen angegeben, so sind das Breite und Höhe des Detektors. Beachten Sie,
+% dass \opt{detsize=1} und \opt{detsize=1 1} für \opt{dettype=round} nicht dasselbe ist.
+% \fi
+% \ifENGLISH
+% If a single number is given it is the side length (\opt{diode}) or the
+% diameter (\opt{round}) of the detector. Two numbers define the width and
+% height of the detector. Note, that \opt{detsize=1} and \opt{detsize=1 1} are
+% not equivalent for \opt{dettype=round}.
+% \fi
+%
+% \choitem[round]{dettype}{round, diode}
+% \ifGERMAN
+% Dieser Parameter bestimmt den Typ und damit das Aussehen des Detektors.
+% \fi
+% \ifENGLISH
+% This parameter selects between different types of detectors.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{dettype}}]
+\begin{pspicture}(3,1.5)
+ \optdetector[beam, dettype=diode](0,0)(1.5,1){detector}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \begin{stylelist}
+% \styleitem{DetectorStyle}
+% \ifGERMAN
+% Der Stil der Diode für \Lkeyword{dettype}\opt{=diode}.
+% \fi
+% \ifENGLISH
+% The style of the diode for \Lkeyword{dettype}\opt{=diode}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \newpsstyle{OptComp}{linewidth=2\pslinewidth}
+ \newpsstyle{DetectorStyle}{linewidth=0.5\pslinewidth}
+ \optdetector[dettype=diode](0,1)(2,1)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{stylelist}
+%
+% \ifGERMAN\section{Optische Diode}\fi
+% \ifENGLISH\section{Optical diode}\fi
+%
+% \begin{ltxsyntax}
+% \dipoledesc{optdiode}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{optdiode}}]
+\begin{pspicture}(3,2)
+ \optdiode[beam](0,1)(3,1){Diode}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \ifENGLISH The optical diode has a default setting of
+% \Lkeyword{allowbeaminside}\opt{=false}.
+% \fi
+% \ifGERMAN Die optische Diode hat die Voreinstellung
+% \Lkeyword{allowbeaminside}\opt{=false}.
+% \fi
+%
+% \begin{optionlist}
+% \numitem[0.8]{optdiodesize}
+% \ifGERMAN
+% Die Seitenlänge der optischen Diode.
+% \fi
+% \ifENGLISH
+% The side length of the optical diode.
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Doveprisma}\fi
+% \ifENGLISH\section{Dove prism}\fi
+%
+% \begin{ltxsyntax}
+% \dipoledesc{doveprism}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{doveprism}}]
+\begin{pspicture}(3,1.5)
+ \doveprism[beam](0,1)(3,1){Dove}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \optitem[0.6]{doveprismsize}{\prm{num} or \prm{width} \prm{height}}
+% \ifGERMAN
+% Wenn eine Zahl angegeben ist, dann ist das die Höhe des Prismas, die
+% Gesamtbreite beträgt das dreifache. Zwei Zahlen geben Breite und Höhe des
+% Doveprisma an. Die Winkel an der Eingangs- und Ausgangsfläche betragen immer
+% 45\textdegree.
+% \fi
+% \ifENGLISH
+% A single number defines the height of the prism, the total width is set to
+% three times the height. Two number define the width and height of the dove
+% prism. The angles at the input and output faces are always 45\textdegree.
+% \fi
+% \end{optionlist}
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{doveprism}}]
+\begin{pspicture}(4,1.5)
+ \optplane(0,1)
+ \doveprism[doveprismsize=1.2](0,1)(4,1)
+ \optplane(4,1)
+ \drawbeam[raytrace=false, linecolor=black]{-}
+ \drawbeam[n=1.5, linecolor=red]{-}
+ \drawbeam[n=*sqrt(5), linecolor=green, linestyle=dashed]{-}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN\section{Polarisation}\fi
+% \ifENGLISH\section{Polarization}\fi
+%
+% \begin{ltxsyntax}
+% \dipoledesc{polarization}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{polarization}}]
+\begin{pspicture}(3,1)
+ \polarization[beam](0,0.5)(3,0.5)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+% \begin{optionlist}
+% \numitem[0.6]{polsize}
+% \ifGERMAN Die Größe des Polarisationszeichens, der Kreis für \opt{perp} und
+% \opt{polmisc} ist halb so groß.
+% \fi
+% \ifENGLISH The size of the polarization symbol, the circle for \opt{perp} and
+% \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
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{poltype}}]
+\begin{pspicture}(0,-0.3)(3,4.3)
+ \psset[optexp]{beam}
+ \begin{optexp}
+ \polarization[poltype=parallel, abspos=0.5](0,4)(3,4)
+ \polarization[poltype=perp, abspos=1](0,3)(3,3)
+ \polarization[poltype=misc, abspos=1.5](0,2)(3,2)
+ \polarization[poltype=lcirc, abspos=2](0,1)(3,1)
+ \polarization[poltype=rcirc, abspos=2.5](0,0)(3,0)
+ \end{optexp}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \begin{stylelist}
+% \styleitem[arrowscale=0.8, linewidth=\cs{pslinewidth}, dotsize=3\cs{pslinewidth}]{Polarization}
+% \ifGERMAN Bestimmt das Aussehen der Polarisationssymbole.\fi
+% \ifENGLISH Affects the style of the polarisation symbols.\fi
+% \end{stylelist}
+%
+% \ifGERMAN\section{Spiegel}\fi
+% \ifENGLISH\section{Mirror}\fi
+%
+% \begin{ltxsyntax}
+% \tripoledesc{mirror}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \mirror[beam](0,0)(1.8,1.5)(0,2){M}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \numitem[1]{mirrorwidth}
+% \ifGERMAN Die Breite des Spiegels.\fi
+% \ifENGLISH The width of the mirror.\fi
+%
+% \optitem[2\nxLcs{pslinewidth}]{mirrorlinewidth}{\prm{num} or \prm{dimen}}
+% \ifGERMAN \linewidthexplanation{des Spiegels}{Spiegel}\fi
+% \ifENGLISH \linewidthexplanation{mirror}{mirrors}\fi
+%
+% \numitem[0]{mirrorradius}
+% \ifGERMAN
+% Diese Parameter setzt die Krümmung des Spiegels. Null ergibt einen
+% ebenen, ein negativer Radius einen konvexen und ein positiver Radius
+% einen konkaven Spiegel.
+% \fi
+% \ifENGLISH
+% This parameter defines the curvature of the mirror. A value of \opt{0}
+% is for a plain mirror, a negative radius for a convex mirror and a
+% positive radius gives you a concave mirror.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{mirrorradius}}]
+\begin{pspicture}(3,3)
+ \psset{labeloffset=0.5}
+ \mirror[mirrorradius=1](0,0)(1,2)(1.8,1){convex}
+ \mirror[mirrorradius=-1](1,2)(1.8,1)(2.5,3){concave}
+ \drawbeam{(0,0)}{1}{2}{(2.5,3)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \choitem[plain]{mirrortype}{plain, piezo, extended, semitrans}
+% \ifGERMAN
+% Diese Parameter wählt die Spiegelart aus. Das Aussehen wird mit
+% \Lstyle{PiezoMirror}, \Lstyle{ExtendedMirror} und \Lstyle{SemitransMirror}
+% gesteuert.
+% \fi
+% \ifENGLISH
+% The \nxLkeyword{mirrortype} selects between different types of mirrors. The
+% style is controlled with \Lstyle{PiezoMirror}, \Lstyle{ExtendedMirror}, and
+% \Lstyle{SemitransMirror}.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{mirrortype}}]
+\begin{pspicture}(3,2)
+ \mirror[mirrortype=extended,
+ beam](0,0)(1.8,1.5)(0,2){ext}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN Beachten Sie, dass der Anschlussdraht für den Piezospiegel nicht
+% gezeichnet wird, falls \Lkeyword{extnode} verwendet wird.
+% \fi
+% \ifENGLISH Note, that the default piece of wire is omitted when using
+% \Lkeyword{extnode} with a piezo mirror.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{mirrortype}}]
+\begin{pspicture}(3,2)
+\mirror[mirrortype=piezo,
+ beam](0,0)(1.8,1.5)(0,2){piezo}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN Ein halbdurchlässiger Spiegel (\opt{semitrans}) hat, im Gegensatz zu
+% den anderen Spiegeltypen, zwei Grenzflächen, deren Abstand und Position vom
+% Wert und Vorzeichen von \Lkeyword{mirrordepth} abhängt. Beachten Sie, dass
+% keine gekrümmten Spiegel dieses Typs möglich sind.
+% \fi
+% \ifENGLISH A semi-transparent mirror (\opt{semitrans}) has two interfaces, in
+% contrast to the other mirror types. Their distance and position depends on the
+% value and sign of \Lkeyword{mirrordepth}. Note, that this type does not
+% support curved mirrors.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{mirrortype, mirrordepth}}]
+\psset{unit=1.5}
+\begin{pspicture}(2,2)
+ \mirror[mirrortype=semitrans](0,1)(1,1)(1,0)
+ \drawbeam{(0,1)}{}{(1,0)}
+ \drawbeam[linecolor=red]{(2,1)}{}{(1,2)}
+ \drawbeam[beampos=0.05, linecolor=blue]{(0,1)}{}{(2,1)}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[morekeywords={[21]{mirrortype, mirrordepth}}]
+\psset{unit=1.5}
+\begin{pspicture}(2,2)
+ \mirror[mirrortype=semitrans, mirrordepth=-0.15](0,1)(1,1)(1,0)
+ \drawbeam{(0,1)}{}{(1,0)}
+ \drawbeam[linecolor=red]{(2,1)}{}{(1,2)}
+ \drawbeam[beampos=0.05, linecolor=blue]{(0,1)}{}{(2,1)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \boolitem[false]{variable}
+% \ifGERMAN
+% Zeichnet einen verstellbaren Spiegel, der mit zwei zusätzlichen gekrümmten
+% Pfeilen an beiden Seiten angedeutet wird. Das Aussehen, inklusive der Pfeile,
+% wird von \Lstyle{VariableStyle} vorgegeben.
+% \fi
+% \ifENGLISH
+% Draw an adjustable mirror which has two additional curved arrows on both
+% sides. The appearance including the arrow types is determined by
+% \Lstyle{VariableStyle}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{variable}}]
+\begin{pspicture}(3,2)
+ \mirror[beam, variable](0,0)(1.8,1.5)(0,2){var}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \numitem[0.1]{mirrordepth}
+% \ifGERMAN Die Gesamttiefe eines breiten Spiegels.\fi
+% \ifENGLISH The total depth of an extended mirror.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{mirrortype, mirrordepth}}]
+\begin{pspicture}(3,2)
+ \mirror[mirrortype=extended, mirrordepth=0.2,
+ beam](0,0)(1.8,1.5)(0,2)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \begin{stylelist}
+% \styleitem[linestyle=none, hatchwidth=0.5\cs{pslinewidth}, hatchsep=1.4\cs{pslinewidth}, fillstyle=hlines]{ExtendedMirror}
+% \ifGERMAN Der Stil für den \opt{extended} Spiegel.\fi
+% \ifENGLISH The style for the \opt{extended} mirror.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{mirrortype, ExtendedMirror}}]
+\begin{pspicture}(3,2)
+ \newpsstyle{ExtendedMirror}{fillstyle=solid,
+ fillcolor=Gold,
+ linestyle=none}
+ \mirror[mirrortype=extended,
+ beam](0,0)(1.8,1.5)(0,2){ext}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \styleitem[fillstyle=solid, fillcolor=black!30]{PiezoMirror}
+% \ifGERMAN
+% Der Stil für den \opt{piezo} Spiegel. Dieser kann auch dazu verwendet
+% werden, die Größe des Piezos zu verändern, wie in dem folgenden Beispiel zu sehen ist.
+% \fi
+% \ifENGLISH
+% This style defines the appearance of the \opt{piezo} mirror. This can also
+% be used to change the size of piezo part, as the example shows.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{mirrortype, PiezoMirror}}]
+\begin{pspicture}(3,2)
+ \addtopsstyle{PiezoMirror}{xunit=2}
+ \mirror[mirrortype=piezo,
+ beam](0,0)(1.8,1.5)(0,2){piezo}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \styleitem[linestyle=none, fillstyle=solid, fillcolor=black!30]{SemitransMirror}
+% \ifGERMAN
+% Der Stil für den \opt{semitrans} Spiegel.
+% \fi
+% \ifENGLISH
+% This style defines the appearance of the \opt{semitrans} mirror.
+% \fi
+% \end{stylelist}
+%
+% \ifGERMAN\section{Strahlteiler}\fi
+% \ifENGLISH\section{Beamsplitter}\fi
+%
+% \begin{ltxsyntax}
+% \tripoledesc{beamsplitter}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \beamsplitter[beam](0,1)(2,1)(2,0){BS}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \numitem[0.8]{bssize}
+% \ifGERMAN Die Größe des Strahlteilers.\fi
+% \ifENGLISH The beamsplitter size.\fi
+%
+% \choitem[cube]{bsstyle}{cube, plate}
+% \ifGERMAN
+% Wählt zwischen zwei Strahlteilertypen: einem Strahlteilerwürfel (\opt{cube})
+% und einem halbdurchlässigen Spiegel (\opt{plate}). Dieser halbdurchlässige
+% Spiegel ist äquivalent zu \Lcs{mirror} mit
+% \Lkeyword{mirrortype}\opt{=semitrans} für \Lkeyword{mirrordepth}\opt{=0}.
+% \fi
+% \ifENGLISH
+% Selects between two types of beamsplitters: the beamsplitter cube (\opt{cube})
+% and the semitransparent mirror (\opt{plate}). This semitransparent mirror ist
+% equivalent to \Lcs{mirror} with \Lkeyword{mirrortype}\opt{=semitrans} and
+% \Lkeyword{mirrordepth}\opt{=0}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{bsstyle}}]
+\begin{pspicture}(3,2)
+ \beamsplitter[bsstyle=plate, beam](0,1)(2,1)(2,0){BS}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Optisches Gitter}\fi
+% \ifENGLISH\section{Optical grating}\fi
+%
+% \begin{ltxsyntax}
+% \tripoledesc{optgrating}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \optgrating[beam](0,2)(1.8,1.5)(0,0){grating}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \ifENGLISH Before package version 3.0 this component was called
+% \Lcs*{optgrid}. Since then this command name is deprecated and will be removed
+% in future versions.
+% \fi
+% \ifGERMAN Vor Paketversion 3.0 hieß diese Komponente \Lcs*{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
+% \ifENGLISH The width of the grating.\fi
+%
+% \numitem[0.15]{gratingheight}
+% \ifGERMAN Die Gesamthöhe des Gitters.\fi
+% \ifENGLISH The total height of the grating.\fi
+%
+% \numitem[0.075]{gratingdepth}
+% \ifGERMAN
+% Die absolute Modulationstiefe der Gitterstruktur. Die Gesamthöhe wird
+% an diesen Wert angepasst falls sie kleiner als die Modulationtiefe ist,
+% andernfalls wird sie nicht beinflusst.
+% \fi
+% \ifENGLISH
+% The modulation depth of the grating structure. The total height is
+% adapted to this value if it is smaller than the modulation
+% depth. Otherwise the total height is not affected.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{gratingdepth}}]
+\begin{pspicture}(3,2)
+ \optgrating[gratingdepth=0.05,
+ beam](0,2)(1.8,1.5)(0,0){grating}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \intitem[10]{gratingcount}
+% \ifGERMAN Die Anzahl der Gitterlinien.\fi
+% \ifENGLISH The number of grating grooves.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{gratingcount}}]
+\begin{pspicture}(3,2)
+ \optgrating[gratingcount=3,
+ beam](0,2)(1.8,1.5)(0,0){grating}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \choitem[blazed]{gratingtype}{blazed, binary}
+% \ifGERMAN
+% Wählt zwischen einem binären Gitter (\opt{binary}) und einem Blazegitter
+% (\opt{blazed}).
+% \fi
+% \ifENGLISH
+% Select between a \opt{binary} and a \opt{blazed} grating.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{gratingtype}}]
+\begin{pspicture}(3,2)
+ \optgrating[gratingtype=binary,
+ beam](0,2)(1.8,1.5)(0,0){grating}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \boolitem[false]{reverse}
+% \ifGERMAN
+% Invertiert die Steigung des Blazegitters.
+% \fi
+% \ifENGLISH
+% Reverse the slope of the grooves of the \opt{blazed} grating.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{reverse}}]
+\begin{pspicture}(3,2)
+ \optgrating[reverse, beam](0,2)(1.8,1.5)(0,0){grating}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \optitem[0.7\nxLcs{pslinewidth}]{gratinglinewidth}{\prm{num} or \prm{dimen}}
+% \ifGERMAN \linewidthexplanation{des Gitters}{Gitter}\fi
+% \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{Prisma}\fi
+% \ifENGLISH\section{Prism}\fi
+%
+% \begin{ltxsyntax}
+% \tripoledesc{optprism}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \optprism[beam](0,1)(2,1)(3,0){Prism}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+% \ifGERMAN
+% Das Prisma wird immer symmetrisch bezüglich der \prm{in} und \prm{out}
+% Knoten ausgerichtet. Für asymmetrischen Strahlengang siehe
+% \prettyref{chap:connecting}.
+% \fi
+% \ifENGLISH
+% The prism is always placed symmetric between \prm{in} and \prm{out}
+% nodes. For asymmetric beam traces see \prettyref{chap:connecting}.
+% \fi
+%
+% \begin{optionlist}
+% \numitem[1]{prismsize}
+% \ifGERMAN Die Höhe des Prismas.\fi
+% \ifENGLISH The height of the prism.\fi
+%
+% \numitem[60]{prismangle}
+% \ifGERMAN Der obere Winkel des Prismas.\fi
+% \ifENGLISH The upper angle of the prism.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]prismangle}]
+\begin{pspicture}(3,2)
+ \optprism[prismangle=30, beam](0,1)(2,1)(3,0){Prism}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \choitem[auto]{prismalign}{auto,center}
+% \ifENGLISH Sets the vertical alignment of the prism with respect to the
+% «reflection» node \prm{center}. For \opt{auto}, the prism is shifted such,
+% that the interface nodes lay on the connection between the respective
+% reference node and the «reflection» node. If the value is \opt{center}, the
+% «reflection» node coincides with the component center. See the following
+% examples for further explanation.
+% \fi
+% \ifGERMAN Wählt die vertikale Ausrichtung des Prisma bezüglich des
+% «Reflektionsknoten» \prm{center}. Ist der Wert \opt{auto}, so wird das Prisma
+% so verschoben, dass die Grenzflächenknoten auf der Verbindungslinie zwischen
+% dem entsprechenden Referenzknoten und dem «Reflektionsknoten» liegen. Für
+% \opt{center} fällt der «Reflektionsknoten» mit der Komponentenmitte
+% zusammen. Siehe die folgende Beispiele zur weiteren Erklärung.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{pspicture}(13,3)
+ \footnotesize
+ \pnode(0,0){A}\pnode(3,1.8){B}\pnode(6,0){C}
+ \psdot(A)\uput[90](A){\prm{in}}
+ \psdot(B)\uput[90](B){\prm{center}}
+ \psdot(C)\uput[90](C){\prm{out}}
+ \optprism[prismsize=2](A)(B)(C)
+ \psline[style=Refline, linestyle=dashed](A)(B)(C)
+ \newpsstyle{IfcDot}{dotstyle=+, linecolor=red, dotscale=1.5}
+ \psdot[style=CenterNode](\oenodeCenter{})
+ \psdot[style=IfcDot](\oenodeIn{})
+ \psdot[style=IfcDot](\oenodeOut{})
+ \rput[b](\oenodeCenter{}|0,0){\opt{prismalign=auto}}
+ \pnode(7,0){A}\pnode(10,1.8){B}\pnode(13,0){C}
+ \psdot(A)\uput[90](A){\prm{in}}
+ \psdot(B)\uput[90](B){\prm{center}}
+ \psdot(C)\uput[90](C){\prm{out}}
+ \optprism[prismsize=2, prismalign=center](A)(B)(C)
+ \psline[style=Refline, linestyle=dashed](A)(B)(C)
+ \psdot[style=CenterNode](\oenodeCenter{})
+ \psdot[style=IfcDot](\oenodeIn{})
+ \psdot[style=IfcDot](\oenodeOut{})
+ \rput[b](\oenodeCenter{}|0,0){\opt{prismalign=center}}
+\end{pspicture}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Umkehrprisma}\fi
+% \ifENGLISH\section{Right-angle prism}\fi
+%
+% \begin{ltxsyntax}
+% \tripoledesc{rightangleprism}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \psdot(1.8,1)
+ \rightangleprism[beam](0,1.5)(1.8,1)(0,0.5){RA}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+% \ifGERMAN
+% Das Umkehrprisma wird so ausgerichtet, dass der einfallende und der
+% reflektierte Strahl parallel sind und der \prm{center} Knoten vertikal
+% zentriert in dem Prisma liegt.
+% \fi
+% \ifENGLISH
+% The right-angle prisms is align such that the incoming and reflected
+% beam are parallel and the \prm{center} node is vertically centered in
+% the prism.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3.5,2)
+ \pnode(0,2){A}\pnode(2.5,0.5){G}\pnode(0,1.5){B}
+ \begin{optexp}
+ \rightangleprism[beam, showifcnodes, showoptdots](A)(G)(B){RA}
+ \end{optexp}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \begin{optionlist}
+% \numitem[1.5]{raprismsize}
+% \ifGERMAN Die Länge der Eingangsfläche.\fi
+% \ifENGLISH The length of the input plane.\fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Pentaprisma}\fi
+% \ifENGLISH\section{Penta prism}\fi
+%
+% \begin{ltxsyntax}
+% \tripoledesc{pentaprism}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \pentaprism[beam](0,1)(2,1)(2,0){PP}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \numitem[0.7]{pentaprismsize}
+% \ifGERMAN Die Länge der Eingangs- und Ausgangsfläche.\fi
+% \ifENGLISH The length of the input and output plane.\fi
+% \end{optionlist}
+%
+%
+% \ifGERMAN\chapter{Faserkomponenten}\fi
+% \ifENGLISH\chapter{Fiber components}\fi
+% \label{chap:fibercomp}
+%
+% \ifENGLISH This chapter describes all fiber components and their
+% options. They differ from free-ray components in that they are connected by
+% default with fibers to their reference nodes, and that they cannot be used for
+% raytracing. Most components require only two reference nodes and are handled
+% like the free-ray dipoles. Some special components like couplers
+% (\prettyref{sec:coupler}) and circulators (\prettyref{sec:optcirculator}) are
+% treated differently.
+% \fi
+% \ifGERMAN In diesem Kapitel werden alle Faserkomponenten und deren Parameter
+% beschrieben. Diese werden automatisch über Fasern mit ihren Referenzknoten
+% verbunden und unterstützen kein Raytracing. Die meisten
+% Komponenten benötigen nur zwei Referenzknoten und werden wie die
+% Freistrahlzweipole behandelt. Manche spezielle Komponenten wie Koppler
+% (\ref{sec:coupler}) und Zirkulatoren (\ref{cmd:optcirculator})
+% werden anders ausgerichtet.
+% \fi
+%
+% \psset{usefiberstyle}
+% \begin{optionlist}
+% \boolitem{usefiberstyle}
+% \ifGERMAN
+% Bei manchen Komponenten (z.B. \Lcs{optfilter} oder \Lcs{optmzm}) kann es
+% vorteilhaft sein interne Faserteile hervorzuheben. Mit diesem Parameter
+% werden z.B. die durchlässigen Teile eines Filter angezeigt und mit dem
+% \Lstyle{Fiber}-Stil gezeichnet. In der Dokumentation ist dieses Verhalten
+% angeschaltet um die betroffenen Bereiche hervorzuheben.
+% \fi
+% \ifENGLISH
+% For some components (e.g. \Lcs{optfilter} or \Lcs{optmzm}) it can be nice
+% to highlight some internals. For example, if this option is enabled the
+% passing parts of the optical filter are drawn with the \Lstyle{Fiber}
+% style. In the documentation this parameter is enabled to show the parts
+% which are affected.
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Optische Faser}\fi
+% \ifENGLISH\section{Optical fiber}\fi
+%
+% \begin{ltxsyntax}
+% \fiberdipoledesc{optfiber}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \optfiber[label=0.3](0,0.5)(3,0.5){SSMF}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+% \begin{optionlist}
+% \intitem[3]{fiberloops}
+% \ifGERMAN Anzahl der Faserschleifen.\fi
+% \ifENGLISH Number of the fiber loops.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]fiberloops}]
+\begin{pspicture}(3,1.5)
+ \optfiber[fiberloops=2, label=0.3](0,0.5)(3,0.5){SSMF}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \numitem[0.4]{fiberloopradius}
+% \ifGERMAN Radius der Faserschleifen.\fi
+% \ifENGLISH Radius of the fiber loops.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]fiberloopradius}]
+\begin{pspicture}(3,1.5)
+ \optfiber[fiberloopradius=0.2, label=0.3](0,0.5)(3,0.5){SSMF}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \numitem[0.3]{fiberloopsep}
+% \ifGERMAN Abstand zwischen zwei aufeinanderfolgenden Faserschleifen.\fi
+% \ifENGLISH Separation between two successive fiber loops.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]fiberloopsep}]
+\begin{pspicture}(3,1.5)
+ \optfiber[fiberloopsep=0.6, label=0.3](0,0.5)(3,0.5){SSMF}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Optischer Verstärker}\fi
+% \ifENGLISH\section{Optical amplifier}\fi
+%
+% \begin{ltxsyntax}
+% \fiberdipoledesc{optamp}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \optamp(0,1)(3,1){EDFA}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \optitem[0.8]{optampsize}{\prm{num} or \prm{width} \prm{height}}
+% \ifGERMAN
+% Eine einzelne Zahl gibt die Seitenlänge des Verstärkers an, zwei Zahlen die
+% Breite und Höhe. Beachten Sie, dass \opt{optampsize=1} und \opt{optampsize=1
+% 1} nicht dasselbe Ergebnis liefern. Alternativ kann das Verhältnis zwischen
+% Höhe und Breite mit \opt{xunit} und \opt{yunit} geändert werden.
+% \fi
+% \ifENGLISH
+% A single number gives the side length of the amplifier, two numbers the width
+% and height. Note, that \opt{optampsize=1} and \opt{optampsize=1 1} do not give
+% the same result. You may also change the relation of width and height with
+% \opt{xunit} and \opt{yunit}.
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Mach-Zehnder-Modulator}\fi
+% \ifENGLISH\section{Mach--Zehnder modulator}\fi
+%
+% \begin{ltxsyntax}
+% \fiberdipoledesc{optmzm}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \optmzm(0,1)(3,1){MZM}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \optitem[0.8]{optmzmsize}{\prm{num} or \prm{width} \prm{height}}
+% \ifGERMAN
+% Eine einzelne Zahl gibt die Höhe des Modulators an, die Breite ist \opt{1.6} mal die
+% Höhe. Zwei Zahlen geben Breite und Höhe des Modulators direkt an.
+% \fi
+% \ifENGLISH
+% A single number gives the modulator height, the width is \opt{1.6} times the
+% height. Two numbers define width and height directly.
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Polarisationssteller}\fi
+% \ifENGLISH\section{Polarization controller}\fi
+%
+% \begin{ltxsyntax}
+% \fiberdipoledesc{polcontrol}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \polcontrol(0,1)(3,1){PC}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \numitem[0.15]{polcontrolsize}
+% \ifGERMAN Der Radius der Polarisationssteller-Kreise.\fi
+% \ifENGLISH The radius of the polarization controller circles.\fi
+%
+% \choitem[linear]{polcontroltype}{linear, triangle}
+% \ifGERMAN Der Typ des Polarisationsstellers.\fi
+% \ifENGLISH The type of polarization controller.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]polcontroltype}]
+\begin{pspicture}(3,1.5)
+ \polcontrol[polcontroltype=triangle](0,1)(3,1){PC}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Isolator}\fi
+% \ifENGLISH\section{Isolator}\fi
+%
+% \begin{ltxsyntax}
+% \fiberdipoledesc{optisolator}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \optisolator(0,1)(3,1){isolator}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \optitem[0.6]{isolatorsize}{\prm{num} or \prm{width} \prm{height}}
+% \ifGERMAN
+% Eine einzelne Zahl gibt die Höhe des Isolators an, die Breite ist \opt{1.6} mal die
+% Höhe. Zwei Zahlen geben Breite und Höhe des Isolators direkt an.
+% \fi
+% \ifENGLISH
+% A single number gives the isolator height, the width is \opt{1.6} times the
+% height. Two numbers define width and height directly.
+% \fi
+% \end{optionlist}
+%
+% \begin{stylelist}
+% \styleitem[linewidth=2\cs{pslinewidth}, arrowinset=0]{IsolatorArrow}
+% \ifGERMAN
+% Der Stil für den Isolatorpfeil. Das kann insbesondere nützlich sein um
+% die Länge des Pfeils zu verändern.
+% \fi
+% \ifENGLISH
+% The style of the isolator arrow. This can be especially useful to
+% adapt the length of the arrow.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]IsolatorArrow}]
+\begin{pspicture}(3,1.5)
+ \addtopsstyle{IsolatorArrow}{xunit=1.2}
+ \optisolator(0,1)(3,1){isolator}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{stylelist}
+%
+% \ifGERMAN\section{Optischer Schalter}\fi
+% \ifENGLISH\section{Optical switch}\fi
+%
+% \begin{ltxsyntax}
+% \fiberdipoledesc{optswitch}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \optswitch(0,1)(3,1){opened switch}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \numitem[0.8]{switchsize}
+% \ifGERMAN Die Seitenlänge des Schalters.\fi
+% \ifENGLISH The side length of the switch.\fi
+%
+% \choitem[opened]{switchstyle}{opened, closed}
+% \ifGERMAN Der Zustand des Schalters kann geschlossen (\opt{closed}) oder
+% geöffnet (\opt{opened}) sein.
+% \fi
+% \ifENGLISH Indicate the switch as \opt{opened} or \opt{closed}.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]switchstyle}]
+\begin{pspicture}(3,1.5)
+ \optswitch[switchstyle=closed](0,1)(3,1){closed switch}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Faserverzögerungstrecke}\fi
+% \ifENGLISH\section{Fiber delay line}\fi
+%
+% \begin{ltxsyntax}
+% \fiberdipoledesc{fiberdelayline}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \fiberdelayline(0,1)(3,1){delay line}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \optitem[0.6]{fdlsize}{\prm{num} or \prm{width} \prm{height}}
+% \ifGERMAN
+% Eine einzelne Zahl gibt die Höhe der Komponente an, die Breite ist \opt{1.6}
+% mal die Höhe. Zwei Zahlen geben Breite und Höhe der Komponente direkt an.
+% \fi
+% \ifENGLISH
+% A single number gives the component height, the width is \opt{1.6} times the
+% height. Two numbers define width and height directly.
+% \fi
+% \end{optionlist}
+%
+% \begin{stylelist}
+% \styleitem[arrowinset=0, arrows=->]{FdlArrow}
+% \ifGERMAN
+% Der Stil für den Pfeil. Das kann insbesonders nützlich sein um die
+% Länge des Pfeils zu verändern, die bei geänderter Größe nicht mehr
+% passend sein kann, oder um den Pfeil zu spiegeln.
+% \fi
+% \ifENGLISH
+% The style of the arrow. This can be especially useful to
+% adapt the length of the arrow which may not be appropriate depending
+% on the \opt{fdlsize}, or to mirror the arrow.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]FdlArrow}]
+\begin{pspicture}(3,1.5)
+ \addtopsstyle{FdlArrow}{xunit=-1}
+ \fiberdelayline(0,1)(3,1){delay line}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{stylelist}
+%
+% \ifGERMAN\section{Polarisator}\fi
+% \ifENGLISH\section{Polarizer}\fi
+%
+% \begin{ltxsyntax}
+% \fiberdipoledesc{optfiberpolarizer}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \optfiberpolarizer(0,1)(3,1){polarizer}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \optitem[0.6]{fiberpolsize}{\prm{num} or \prm{width} \prm{height}}
+% \ifGERMAN
+% Eine einzelne Zahl gibt die Höhe der Komponente an, die Breite ist \opt{1.6}
+% mal die Höhe. Zwei Zahlen geben Breite und Höhe der Komponente direkt an.
+% \fi
+% \ifENGLISH
+% A single number gives the component height, the width is \opt{1.6} times the
+% height. Two numbers define width and height directly.
+% \fi
+% \end{optionlist}
+%
+%
+% \ifGERMAN\section{Optischer Zirkulator}\fi
+% \ifENGLISH\section{Optical circulator}\fi
+% \label{sec:optcirculator}
+% \begin{ltxsyntax}
+% \xLfmultipole{optcirculator}%
+% \cmditem{optcirculator}(left)(right)(bottom){label}%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \addtopsstyle{Fiber}{arrows=->}
+ \addtopsstyle{FiberOut1}{linecolor=blue}
+ \addtopsstyle{FiberOut2}{linecolor=green!80!black}
+ \optcirculator(0,1)(3,1)(1.5,0){Circulator}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+% \begin{optionlist}
+% \numitem[0.8]{optcircsize}
+% \ifGERMAN Der Durchmesser des Zirkulators.\fi
+% \ifENGLISH The diameter of the circulator.\fi
+%
+% \numitem[-160]{optcircangleA}
+% \ifGERMAN Der Startwinkel des internen Pfeils.\fi
+% \ifENGLISH The starting angle of the internal arrow.\fi
+%
+% \numitem[-20]{optcircangleB}
+% \ifGERMAN Der Endwinkel des internen Pfeils.\fi
+% \ifENGLISH The ending angle of the internal arrow.\fi
+%
+% \optitem{optcircangle}{\prm{num} \prm{num}}
+% \ifGERMAN Kurzschreibweise um beide Winkel gleichzeitig zu setzen.\fi
+% \ifENGLISH Short notation to specifying both angles.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]optcircangle}]
+\begin{pspicture}(3,1.5)
+ \optcirculator[optcircangle=0 -90](0,1)(3,1)(1.5,0)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \begin{stylelist}
+% \styleitem[unit=0.7, arrows=->, arrowinset=0]{OptCircArrow}
+% \ifGERMAN
+% Der Stil für den internen Pfeil. Damit wird sowohl die Richtung des Pfeils als
+% auch die Größe des Bogens bestimmt.
+% \fi
+% \ifENGLISH The style of the internal arrow. It specifies the direction of the
+% arrow and the size of the arc.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{optcircangle, OptCircArrow}}]
+\begin{pspicture}(3,1.5)
+ \newpsstyle{OptCircArrow}{unit=0.5, arrows=<-, arrowinset=0}
+ \optcirculator[optcircangle=0 -90](0,1)(3,1)(1.5,0)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{stylelist}
+%
+% \ifENGLISH
+% The circulator is positioned by default such that the input and output fibers
+% are orthogonal to each other, like shown in the example:
+% \fi
+% \ifGERMAN
+% Der Zirkulator wird so positioniert, dass Eingangs- und Ausgangsverbindung
+% senkrecht zueinander stehen, wie das folgende Beispiel verdeutlicht:
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \addtopsstyle{Fiber}{arrowscale=1.3, arrows=->, arrowinset=0}
+ \optcirculator(0,0.5)(3,2)(1.5,0)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifENGLISH The positioning parameters (\prettyref{sec:positioning}) refer to
+% the reference nodes \prm{left} and \prm{right} as usual and are not related
+% to the automatic position. This implies, that the default position is not
+% equivalent to \Lkeyword{position}\opt{=0.5}.
+% \fi
+% \ifGERMAN Die Positionierungsparameter (\prettyref{sec:positioning}) beziehen
+% sich wie üblich auf die Referenzknoten \prm{left} und \prm{right}, und nicht
+% auf die automatisch bestimmte Position. Das bedeutet auch, dass die
+% automatische Position i.a. nicht mit \Lkeyword{position}\opt{=0.5}
+% übereinstimmt.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \addtopsstyle{Fiber}{arrowscale=1.3, arrows=->, arrowinset=0, ncurv=1.5}
+ \optcirculator[position=0.5](0,0.5)(3,2)(1.5,0)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN\section{Faserkoppler}\fi
+% \ifENGLISH\section{Fiber coupler}\fi
+% \label{sec:coupler}
+%
+% \ifGERMAN Es stehen drei Faserkoppler zur Verfügung, die alle die gleichen
+% Formen und Parameter verwenden.
+% \fi
+% \ifENGLISH The package provides three fiber couplers which all share the same
+% shapes and parameters.
+% \fi
+% \begin{ltxsyntax}
+% \xLfmultipole{optcoupler}%
+% \cmditem{optcoupler}(tl)(bl)(tr)(br){label}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(0,-0.4)(3,1)
+ \optcoupler(0,1)(0,0)(3,1)(3,0){optcoupler}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \xLfmultipole{wdmcoupler}%
+% \cmditem{wdmcoupler}(tl)(bl)(r){label}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(0,-0.4)(3,1)
+ \wdmcoupler(0,1)(0,0)(3,0.5){wdmcoupler}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \xLfmultipole{wdmsplitter}%
+% \cmditem{wdmsplitter}(l)(tr)(br){label}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(0,-0.4)(3,1)
+ \wdmsplitter(0,0.5)(3,1)(3,0){wdmsplitter}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+% \begin{optionlist}
+% \optitem[0.2]{couplersize}{\prm{num} or \prm{width} \prm{height}}
+% \ifGERMAN
+% Wird eine Zahl angegeben, so ist die Breite des Kopplers doppelt so groß, die
+% Höhe entspricht \opt{0.8} mal dem Wert. Mit zwei Zahlen werden Breite und Höhe
+% direkt angegeben.
+% \fi
+% \ifENGLISH
+% For a single number the width is twice this value, the height \opt{0.8} times
+% this value. Two numbers define width and height directly.
+% \fi
+%
+% \numitem[0.1]{couplersep}
+% \ifGERMAN Der vertikale Abstand zwischen zwei Faserports.\fi
+% \ifENGLISH The vertical distance between two fiber ports.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{couplersep}}]
+\begin{pspicture}(0,-0.5)(3,1)
+ \optcoupler[couplersep=0](0,1)(0,0)(3,1)(3,0){coupler}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \choitem[ellipse]{couplertype}{none, ellipse, rectangle, cross}
+% \ifGERMAN Wählt zwischen unterschiedlichen Kopplertypen.\fi
+% \ifENGLISH Select between different coupler types.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{couplertype}}]
+\begin{pspicture}(3,4.5)
+ \psset{labeloffset=0.5}
+ \optcoupler[couplertype=none]%
+ (0,4.5)(0,3.5)(3,4.5)(3,3.5){none}
+ \optcoupler[couplertype=rectangle]%
+ (0,3)(0,2)(3,3)(3,2){rectangle}
+ \optcoupler[couplertype=cross]%
+ (0,1.5)(0,0.5)(3,1.5)(3,0.5){cross}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \choitem[center]{coupleralign}{t, top, b, bottom, c, center}
+% \ifGERMAN Die Ausrichtung des Kopplers bezüglich der Referenzknoten.\fi
+% \ifENGLISH The alignment of the coupler with respect to the reference nodes.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{coupleralign}}]
+\begin{pspicture}(3,3)
+ \psset{labeloffset=0.4}
+ \optcoupler[coupleralign=top]%
+ (0,3)(0,2)(3,3)(3,2){top}
+ \optcoupler[coupleralign=bottom]%
+ (0,1.5)(0,0.5)(3,1.5)(3,0.5){bottom}
+\end{pspicture}
+\end{LTXexample}
+% \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
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{variable}}]
+\begin{pspicture}(3,1)
+ \optcoupler[variable](0,1)(0,0)(3,1)(3,0)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \begin{stylelist}
+% \styleitem[arrowinset=0, arrows=->]{VariableCoupler}
+% \ifGERMAN
+% Der Stil des Pfeiles des verstellbaren Kopplers.
+% \fi
+% \ifENGLISH
+% The style of the arrow of the variable coupler.
+% \fi
+% \end{stylelist}
+%
+% \ifGERMAN\subsection{Eingangs- und Ausgangsknoten}\fi
+% \ifENGLISH\subsection{Input and output nodes}\fi
+% \label{sec:coupler-nodes}
+%
+% \ifGERMAN
+% Die Definition der Eingangs- und Ausgangsknoten aus \prettyref{sec:ifcnode}
+% ist für Koppler nicht anwendbar. Hier werden die Knoten einfach von \opt{1}
+% (links oben) bis \opt{N} (rechts unten) durchnummeriert.
+% \fi
+% \ifENGLISH
+% The definition of input and output nodes from \prettyref{sec:ifcnode} cannot
+% be applied to couplers. Here, the nodes are simply numbered from \opt{1} (left
+% top) to \opt{N} (right bottom).
+% \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)
+% \psdot(\oenodeIfc{1}{})\uput[120](\oenodeIfc{1}{}){1}
+% \psdot(\oenodeIfc{2}{})\uput[90](\oenodeIfc{2}{}){2}
+% \psdot(\oenodeIfc{N}{})\uput[-90](\oenodeIfc{N}{}){N}
+% \wdmcoupler(4, 2)(4,0.5)(7,1.25)
+% \psdot(\oenodeIfc{1}{})\uput[90](\oenodeIfc{1}{}){1}
+% \psdot(\oenodeIfc{2}{})\uput[-90](\oenodeIfc{2}{}){2}
+% \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}
+% \psdot(\oenodeIfc{2}{})\uput[-90](\oenodeIfc{2}{}){2}
+% \psdot(\oenodeIfc{3}{})\uput[90](\oenodeIfc{3}{}){3}
+% \psdot(\oenodeIfc{N}{})\uput[-90](\oenodeIfc{N}{}){N}
+% \rput[b](1.5,0){\nxLcs{wdmsplitter}}
+% \rput[b](5.5,0){\nxLcs{wdmcoupler}}
+% \rput[b](9.5,0){\nxLcs{optcoupler}}
+% \end{pspicture}
+% \end{center}
+%
+%
+% \ifGERMAN\subsection{Referenzknoten}\fi
+% \ifENGLISH\subsection{Reference nodes}\fi
+% \label{sec:coupler-refnodes}
+%
+% \ifGERMAN
+% Die Definition der Referenzknoten aus \prettyref{sec:refnode} ist für Koppler
+% nicht anwendbar und hängt von \Lkeyword{coupleralign} ab.
+% \fi
+% \ifENGLISH
+% The definition of reference nodes from \prettyref{sec:refnode} cannot be
+% applied to couplers and depends on \Lkeyword{coupleralign}.
+% \fi
+% \begin{center}
+% \begin{pspicture}(12,2)
+% \psset{couplersize=0.5, couplertype=rectangle, couplersep=0.2}
+% \optcoupler(0, 2)(0,0.7)(3,2)(3,0.7)
+% \psdot(\oenodeRefA{})\uput[90](\oenodeRefA{}){RefA}
+% \psdot(\oenodeRefB{})\uput[90](\oenodeRefB{}){RefB}
+% \optcoupler[coupleralign=top](4.5, 2)(4.5,0.7)(7.5,2)(7.5,0.7)
+% \psdot(\oenodeRefA{})\uput[-90](\oenodeRefA{}){RefA}
+% \psdot(\oenodeRefB{})\uput[-90](\oenodeRefB{}){RefB}
+% \optcoupler[coupleralign=bottom](9, 2)(9,0.7)(12,2)(12,0.7)
+% \psdot(\oenodeRefA{})\uput[90](\oenodeRefA{}){RefA}
+% \psdot(\oenodeRefB{})\uput[90](\oenodeRefB{}){RefB}
+% \rput[b](1.5,0){\opt{coupleralign=none}}
+% \rput[b](6,0){\opt{coupleralign=top}}
+% \rput[b](10.5,0){\opt{coupleralign=bottom}}
+% \end{pspicture}
+% \end{center}
+% \psset{usefiberstyle=false}
+%
+% \ifGERMAN\chapter{Hybridkomponenten}\fi
+% \ifENGLISH\chapter{Hybrid components}\fi
+% \label{sec:hybridcomp}
+%
+% \ifENGLISH This chapter describes the components which can be used both for
+% free-ray and fiber optics but which differ from these two categories.
+%
+% The optical filter (\Lcs{optfilter}) is connected by default with automatic
+% fiber connections, but can likewise be used with free-ray beams, in contrast
+% to the fiber components (\prettyref{chap:fibercomp}). The fiber collimator
+% (\Lcs{fibercollimator}) has one interface only, the other connection is a
+% fiber.
+% \fi
+% \ifGERMAN Dieses Kapitel beschreibt die Komponenten, die sowohl für
+% Freistrahl- als auch Faseroptik zu verwenden sind, sich von diesen aber etwas
+% abgrenzen.
+%
+% Der optische Filter (\Lcs{optfilter}) wird mit den Voreinstellungen aber als
+% Faserkomponente gehandhabt, kann jedoch im Gegensatz zu den reinen
+% Faserkomponenten (\prettyref{chap:fibercomp}) auch als Freistrahlkomponente
+% verwendet werden. Der Faserkollimator (\Lcs{fibercollimator}) hat nur eine
+% Faser, die andere Verbindung ist Freistrahl.
+% \fi
+%
+% \ifGERMAN\section{Optischer Filter}\fi
+% \ifENGLISH\section{Optical filter}\fi
+% \psset{usefiberstyle}
+% \begin{ltxsyntax}
+% \fiberdipoledesc{optfilter}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \optfilter(0,1)(3,1){bandpass}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \numitem[0.8]{filtersize}
+% \ifGERMAN Die Größe des Filters.\fi
+% \ifENGLISH The size of the filter.\fi
+%
+% \choitem[bandpass]{filtertype}{bandpass, bandstop, lowpass, highpass}
+% \ifGERMAN Wähle zwischen unterschiedlichen Filtertypen.\fi
+% \ifENGLISH Select between different filter types.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{filtertype}}]
+\begin{pspicture}(3,1.5)
+ \optfilter[filtertype=bandstop](0,1)(3,1){bandstop}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{filtertype}}]
+\begin{pspicture}(3,1.5)
+ \optfilter[filtertype=lowpass](0,1)(3,1){lowpass}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[morekeywords={[21]{filtertype}}]
+\begin{pspicture}(3,1.5)
+ \optfilter[filtertype=highpass](0,1)(3,1){highpass}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \begin{stylelist}
+% \styleitem{FilterStyle}
+% \ifGERMAN Beinflusst das Aussehen der internen Filterlinien.\fi
+% \ifENGLISH Change the style of the internal filter lines.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]FilterStyle}]
+\begin{pspicture}(3,1.5)
+ \newpsstyle{OptComp}{linewidth=2\pslinewidth}
+ \optfilter(0,1)(1.5,1)
+ \newpsstyle{FilterStyle}{linewidth=0.5\pslinewidth}
+ \optfilter(1.5,1)(3,1)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{stylelist}
+%
+% \ifGERMAN Verwendung als Freistrahlkomponenten, \Lkeyword{allowbeaminside} ist
+% auf \opt{false} voreingestellt:
+% \fi
+% \ifENGLISH Usage as free-ray component, \Lkeyword{allowbeaminside} is set to
+% \opt{false} by default:
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \optfilter[fiber=none](0,1)(3,1)
+ \addtopsstyle{Beam}{beamwidth=0.3,
+ fillstyle=solid, fillcolor=green, opacity=0.2}
+ \drawwidebeam{(0,1)}{}{(3,1)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+%
+% \ifGERMAN\section{Faserkollimator}\fi
+% \ifENGLISH\section{Fiber collimator}\fi
+%
+% \begin{ltxsyntax}
+% \xLdipole{fibercollimator}\cmditem{fibercollimator}(in)(A)(B)(out){label}%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \fibercollimator[beam](0,1)(3,1){FC}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \ifGERMAN
+% Der Faserkollimator kann mit zwei, drei oder vier Punkten verwendet
+% werden. Bei zwei Punkten wird der Kollimator wie jeder andere Zweipol zwischen
+% \prm{in} und \prm{out} Knoten platziert. Bei drei Punkten wird eine
+% \Lcs*{psbezier} Kurve gezeichnet, wobei der mittlere Punkt doppelt verwendet
+% wird. Die Positionierungsparameter (siehe \prettyref{sec:positioning}) können
+% verwendet werden um den Kollimator zwischen dem \prm{in} und \prm{A} Knoten
+% auszurichten.
+% \fi
+% \ifENGLISH
+% The fiber collimator can be used with two, three or four points. With two
+% points, the collimator is placed like any other dipole component between
+% \prm{in} and \prm{out} node. For three nodes, the fiber is drawn as
+% \Lcs*{psbezier} curve for which the central node \prm{A} is used
+% twice. Positioning parameters (see \prettyref{sec:positioning}) can be used to
+% shift the object between \prm{in} and \prm{A} nodes.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \fibercollimator[beam](0,1)(2,1)(3,2){FC}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \medskip
+%
+% \ifGERMAN
+% Bei vier Knoten wird eine \Lcs*{psbezier} Kurve mit allen vier Knoten
+% gezeichnet. Die Positionierungsparameter (siehe \prettyref{sec:positioning})
+% können verwendet werden um den Kollimator zwischen den ersten beiden Knoten
+% (\prm{in} und \prm{A}) zu verschieben.
+% \fi
+% \ifENGLISH
+% For four nodes, the fiber is drawn as \Lcs*{psbezier} curve with the specified
+% nodes. Positioning parameters (siehe \prettyref{sec:positioning}) can be used
+% to shift the object between the first two nodes (\prm{in} and \prm{A}).
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \fibercollimator[beam](0,1)(2,1)(3,1)(3,2){FC}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \begin{optionlist}
+% \optitem[0.3]{fibercolsize}{\prm{num} or \prm{width} \prm{height}}
+% \ifGERMAN
+% Eine einzelne Zahl gibt die Seitenlänge des Kollimators an, zwei Zahlen die Breite und
+% Höhe. Beachten Sie, dass \opt{fibercolsize=1} und \opt{fibercolsize=1 1} nicht
+% dasselbe Ergebnis liefern. Alternativ kann das Verhältnis zwischen Höhe und
+% Breite mit \opt{xunit} und \opt{yunit} geändert werden.
+% \fi
+% \ifENGLISH
+% A single number gives the side length of the collimator, two numbers the width
+% and height. Note, that \opt{fibercolsize=1} and \opt{fibercolsize=1 1} do not give
+% the same result. You may also change the relation of width and height with
+% \opt{xunit} and \opt{yunit}.
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\chapter{Spezielle Knoten}\fi
+% \ifENGLISH\chapter{Special nodes}\fi
+% \label{sec:objnodes}
+%
+% \ifGERMAN
+% Jedes \nxLPack{pst-optexp}-Objekt stellt mehrere spezielle Knoten zur
+% Verfügung, die mit dessen Geometrie und Positionierung zusammenhängen. Diese
+% Knoten stehen für weitere Verwendung zur Verfügung.
+%
+% Sie sollten immer die dafür vorgesehenen Makros verwenden um auf die
+% Knotennamen zuzugreifen.
+% \fi
+% \ifENGLISH
+% Every \nxLPack{pst-optexp} object of an experimental setup provides
+% several special nodes which are related to its geometry and
+% positioning. They can be accessed and used for related positioning and
+% drawing.
+%
+% You should always use the dedicated macros to access these node names.
+% \fi
+% \begin{ltxsyntax}
+% \cmditem{oenode}{node}{comp}
+%
+% \ifGERMAN
+% Das ist das grundlegende Makro mit dem auf die Knotennamen einer Komponente
+% zugegriffen werden kann. Das erste Argument \prm{node} ist der Bezeichner des
+% angeforderten Knotens. Das zweite Argument \prm{comp} ist der Name der
+% Komponente (gemäß \prettyref{sec:namingobj}). Ist dieses leer so wird das
+% zuletzt definierte Objekt verwendet.
+%
+% Für viele der Knoten wird ein eigenes Makro bereitgestellt, das Sie dann auch
+% verwenden sollten, da sich die Namenskonventionen ändern könnten. Die Makros
+% stellen sicher, dass Sie immer die passenden Knotennamen erhalten. Daher sind
+% die verfügbaren Bezeichner auch nicht aufgelistet.
+% \fi
+% \ifENGLISH
+% This is the basic command to access any node associated with a certain
+% component. The first argument \prm{node} is the identifier of the requested
+% node. The second argument \prm{comp} is the name of the target component
+% (according to \prettyref{sec:namingobj}). If left empty, it uses the last
+% component defined.
+%
+% For most special nodes an appropriate macro is provided, which you are
+% strongly advised to use, because the naming conventions may change. Using the
+% macros makes sure, that you always get the correct node names. Therefore, the
+% available identifiers are not listed explicitely.
+% \fi
+% \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
+% die normalen und die schwarzen Kreuze die transformierten Referenzknoten
+% (\prettyref{sec:refnode}), der rote Punkt ist der Mittelpunktknoten
+% (\prettyref{sec:centernode}) und das rote Kreuz der Beschriftungsknoten
+% (\prettyref{sec:labelnode}).
+% \fi
+% \ifENGLISH
+% Draw some special component nodes for debugging: The black points are the
+% normal and the black crosses are the transformed reference nodes
+% (\prettyref{sec:refnode}), the red point is the center node
+% (\prettyref{sec:centernode}), and the red cross is the label node
+% (\prettyref{sec:labelnode}).
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+\mirror[showoptdots, angle=10, beam](0,1)(1.9,1)(1.9,0)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Komponenten-Bezeichner}\fi
+% \ifENGLISH\section{Component identifiers}\fi
+% \label{sec:namingobj}
+%
+% \ifGERMAN
+% Alle Komponenten einer Aufbauskizze werden in Reihenfolge ihrer Definition im
+% Code aufsteigend nummeriert, angefangen bei \opt{1}. Die Komponenten und deren
+% Spezialknoten können immer über diese Nummer (ID) referenziert werden.
+% \fi
+% \ifENGLISH
+% All components of a setup drawing are numbered automatically in increasing
+% order according to their definition in the code, starting with \opt{1}. The
+% components as well as their special nodes can always be accessed by this
+% number (ID).
+% \fi
+%
+% \begin{optionlist}
+% \valitem{compname}{string}
+% \ifGERMAN
+% Weist einer Komponente einen Bezeichner zu. Die Komponente kann nun sowohl
+% über diesen Bezeichner als auch über die ID referenziert werden. Dieser
+% Parameter kann nur im optionalen Argument einer \nxLPack{pst-optexp}
+% Komponente verwendet werden. Der Bezeichner sollte innerhalb einer
+% \Lenv*{pspicture}-Umgebung eindeutig sein.
+% \fi
+% \ifENGLISH
+% Assigns a name identifier to a component, which can then be referenced both
+% by this name and by its ID. The parameter can be assigned only in the
+% optional Argument of a \nxLPack{pst-optexp} component and should be unique
+% within one \Lenv*{pspicture} environment.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\ifGERMAN
+\begin{LTXexample}
+\begin{pspicture}(2,2)
+ \optbox[compname=MyBox](0,1)(2,2)
+ \psdot[linecolor=red](\oenodeIn{MyBox}) % Verwende den Namen
+ \psdot[linecolor=blue](\oenodeOut{1}) % Verwende die ID
+ \psdot[linecolor=green](\oenodeCenter{})% Nimm die letzte Komponente
+\end{pspicture}
+\end{LTXexample}
+\fi\ifENGLISH
+\begin{LTXexample}
+\begin{pspicture}(2,2)
+ \optbox[compname=MyBox](0,1)(2,2)
+ \psdot[linecolor=red](\oenodeIn{MyBox})% use the compname
+ \psdot[linecolor=blue](\oenodeOut{1}) % use the ID
+ \psdot[linecolor=green](\oenodeCenter{}) % the last component
+\end{pspicture}
+\end{LTXexample}
+\fi
+% \end{optionlist}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN\section{Referenzknoten}\fi
+% \ifENGLISH\section{Reference nodes}\fi
+% \label{sec:refnode}
+%
+% \begin{ltxsyntax}
+% \cmditem{oenodeRefA}{comp}
+% \cmditem{oenodeRefB}{comp}
+%
+% \ifGERMAN
+% Die Eingangs- und Ausgangs-Referenzknoten.
+%
+% Das sind die ursprünglichen Knoten, die für die Positionierung der Komponente
+% benutzt wurden, \nxLcs{oenodeRefA} ist der erste und \nxLcs{oenodeRefB} der
+% letzte Knoten. Diese Zuordnung ist nicht gültig für Faserkoppler
+% (\ref{sec:coupler-refnodes}) und Zirkulatoren (\ref{cmd:optcirculator}).
+% \fi
+% \ifENGLISH
+% The input and output reference nodes.
+%
+% These are the original nodes which were used for the component positioning,
+% \nxLcs{oenodeRefA} is the first and \nxLcs{oenodeRefB} the last node. This
+% definition is not valid couplers (\ref{sec:coupler-refnodes}) and circulators
+% (\ref{cmd:optcirculator}).
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[pos=t, linerange={1-3, 4-7}]
+\begin{pspicture}(5,1)
+ \pnode(0.5,0.5){A}\pnode(4.5,0.5){B}
+ \optbox(A)(B)
+ \psline[style=Refline](\oenodeRefA{})(\oenodeRefB{})
+ \psdot(\oenodeRefA{})\uput[-90](\oenodeRefA{}){RefA}
+ \psdot(\oenodeRefB{})\uput[-90](\oenodeRefB{}){RefB}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \cmditem{oenodeTrefA}{comp}
+% \cmditem{oenodeTrefB}{comp}
+%
+% \ifGERMAN
+% Die transformierten Eingangs- und Ausgangs-Referenzknoten.
+%
+% Das sind die Referenzknoten nachdem sie zusammen mit der Komponente gemäß
+% der \Lkeyword{compshift} und \Lkeyword{angle} Parameter transformiert wurden.
+% \fi
+% \ifENGLISH
+% The transformed input and output reference nodes.
+%
+% These are the input and output reference nodes which are transformed
+% together with the component according to the \Lkeyword{compshift} and
+% \Lkeyword{angle} parameters.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[pos=t, linerange={1-3,5-9}]
+\begin{pspicture}(5,1.8)
+ \pnode(0.5,0.5){A}\pnode(4.5,0.5){B}
+ \optbox[compshift=0.5, angle=10](A)(B)
+ \psline[style=Refline](\oenodeTrefA{})(\oenodeTrefB{})
+ \psdot(\oenodeRefA{})\uput[-90](\oenodeRefA{}){RefA}
+ \psdot(\oenodeRefB{})\uput[-90](\oenodeRefB{}){RefB}
+ \psdot(\oenodeTrefA{})\uput[90](\oenodeTrefA{}){TrefA}
+ \psdot(\oenodeTrefB{})\uput[90](\oenodeTrefB{}){TrefB}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \ifGERMAN\section{Mittelpunktknoten}\fi
+% \ifENGLISH\section{Center node}\fi
+% \label{sec:centernode}
+%
+% \begin{ltxsyntax}
+% \cmditem{oenodeCenter}{comp}
+%
+% \ifGERMAN
+% Dieser Knoten liegt, bis auf wenige Ausnahmen (z.B. \Lcs{optdetector}), im
+% Mittelpunkt der Komponente.
+% \fi
+% \ifENGLISH
+% This node lays, except for a few components (e.g. \Lcs{optcirculator}), in the
+% center of the component.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-2, 5-5, 8-8}]
+\begin{pspicture}(3,2)
+ \optbox(0,0.5)(3,0.5)
+ \psline[style=Refline](\oenodeRefA{})(\oenodeRefB{})
+ \psdot(\oenodeCenter{})
+ \optdetector(0,1.5)(2.5,1.5)
+ \psline[style=Refline](\oenodeRefA{})(\oenodeRefB{})
+ \psdot(\oenodeCenter{})
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \ifGERMAN\section{Beschriftungsknoten}\fi
+% \ifENGLISH\section{Label node}\fi
+% \label{sec:labelnode}
+%
+% \begin{ltxsyntax}
+% \cmditem{oenodeLabel}{comp}
+%
+% \ifGERMAN
+% Auf diesen Knoten wird die Beschriftung platziert. Der Knoten ist auch
+% verfügbar wenn keine Beschriftung angegeben wurde. Für
+% \Lkeyword{labeloffset}\opt{=0} ist dieser Knoten
+% identisch mit dem Mittelpunktsknoten (\prettyref{sec:centernode}).
+% \fi
+% \ifENGLISH
+% The component label is placed at this node. It is also available
+% if no label was specified. The label node is identical with the center
+% node for \Lkeyword{labeloffset}\opt{=0}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-2,5-5}]
+\begin{pspicture}(3,1.5)
+ \optbox(0,1)(3,1)
+ \psline[style=Refline](\oenodeTrefA{})(\oenodeTrefB{})
+ \psdot(\oenodeLabel{})
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \ifGERMAN\section{Externe Knoten}\fi
+% \ifENGLISH\section{External nodes}\fi
+% \label{sec:extnode}
+%
+% \begin{ltxsyntax}
+% \cmditem{oenodeExt}{comp}
+%
+% \ifGERMAN
+% Ein externer Knoten kann an unterschiedliche Positionen entlang des
+% Komponentenrandes gesetzt werden. Dieser wird nur für den externen Zugriff
+% definiert, und beeinflusst in keiner Weise die Komponente.
+% \fi
+% \ifENGLISH
+% An external node can be placed at different positions along the component
+% boundary. It gets defined only for external usage and does not affect the
+% component in any way.
+% \fi
+% \end{ltxsyntax}
+% \begin{optionlist}
+% \valitem{extnode}{refpoint}
+% \ifGERMAN
+% Bestimmt die Position des externen Knotens. \refpointexplanation Nicht
+% jede Komponente unterstützt alle möglichen Kombinationen, die möglichen
+% Positionen jeder Komponente sind in \prettyref{sec:overview-extnode}
+% zusammengefasst.
+% \fi
+% \ifENGLISH
+% Set the position of the external node. \refpointexplanation Not all
+% components support any possible combination. The allowed positions of each
+% component are listed in \prettyref{sec:overview-extnode}.
+% \fi
+%
+% \begin{pspicture}(6,2.5)
+% \addtopsstyle{Beam}{beaminside=false, arrows=->, arrowinset=0, arrowscale=1.5}
+% \psset{optboxsize=2.5 1.5}\ttfamily
+% \pnode(0,1.25){A}\pnode(6,1.25){B}
+% \optbox[beam, extnode=tl](A)(B)
+% \psdot(\oenodeExt{})\uput[135](\oenodeExt{}){tl}
+% \backlayer{%
+% \optbox[extnode=t](A)(B)\psdot(\oenodeExt{})\uput[90](\oenodeExt{}){t}
+% \optbox[extnode=tr](A)(B)\psdot(\oenodeExt{})\uput[90](\oenodeExt{}){tr}
+% \optbox[extnode=r](A)(B)\psdot(\oenodeExt{})\uput[45](\oenodeExt{}){r}
+% \optbox[extnode=br](A)(B)\psdot(\oenodeExt{})\uput[-90](\oenodeExt{}){br}
+% \optbox[extnode=b](A)(B)\psdot(\oenodeExt{})\uput[-90](\oenodeExt{}){b}
+% \optbox[extnode=bl](A)(B)\psdot(\oenodeExt{})\uput[-90](\oenodeExt{}){bl}
+% \optbox[extnode=l](A)(B)\psdot(\oenodeExt{})\uput[135](\oenodeExt{}){l}
+% \optbox[extnode=c](A)(B)\psdot(\oenodeExt{})\uput[180](\oenodeExt{}){c}
+% }
+% \end{pspicture}
+%
+% \choitem[abs]{extnodealign}{rel,relative,abs,absolute}
+% \ifGERMAN
+% Die Bezeichnung von «oben» (\opt{t}) und den anderen Positionierungsparametern
+% von \Lkeyword{extnode} können absolut oder relativ zur Komponente betrachtet
+% werden.
+%
+% In dem folgenden Beispiel ist der externe Knoten immer «oben rechts»
+% (\opt{tr}) platziert, unabhängig von der Reihenfolge der Referenzknoten
+% (\opt{extnodealign=abs}). Das Verhalten ist identisch zu
+% \Lkeyword{labelref}\opt{=relative} für die Ausrichtung der Beschriftung.
+% \fi
+% \ifENGLISH
+% The definition of «top» (\opt{t}) and the other \Lkeyword{extnode} refpoint
+% parameters can be absolute or relative to the component.
+%
+% In the following example the external node is always placed «top right»
+% independent of the actual order of the reference nodes
+% (\opt{extnodealign=abs}). The behaviour is identical to the label rotation for
+% \Lkeyword{labelref}\opt{=relative}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]extnodealign}]
+\begin{pspicture}(-2,-2)(2,2)
+ \psset{endbox, optboxsize=1 0.6, dotscale=1.5}
+ \psset{extnodealign=abs, extnode=tr}
+ \multido{\i=0+45}{8}{%
+ \optbox[innerlabel](0,0)(1;\i){\i}
+ \psdot(\oenodeExt{})
+ }
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% In dem darauffolgenden Beispiel bezieht sich die Positionierung relativ zur
+% Verbindung zwischen Eingangs- und Ausgangsreferenzknoten
+% (\opt{extnodealign=rel}).
+% \fi
+% \ifENGLISH
+% In the next example the position is relative to the order of input and output
+% reference node (\opt{extnodealign=rel}).
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]extnodealign}]
+\begin{pspicture}(-2,-2)(2,2)
+ \psset{endbox, optboxsize=1 0.6, dotscale=1.5}
+ \psset{extnodealign=rel, extnode=tr}
+ \multido{\i=0+45}{8}{%
+ \optbox[innerlabel](0,0)(1;\i){\i}
+ \psdot(\oenodeExt{})
+ }%
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Grenzflächenknoten}\fi
+% \ifENGLISH\section{Interface nodes}\fi
+% \label{sec:ifcnode}
+%
+% \begin{ltxsyntax}
+% \cmditem{oenodeIfc}{num}{comp}
+%
+% \ifGERMAN
+% Der Grenzflächenknoten \prm{num}, wobei \prm{num} eine positive Ganzzahl
+% oder \opt{N} ist. Der letzte Knoten ist immer \opt{N}.
+% \fi
+% \ifENGLISH
+% The interface node \prm{num}, where the number is a positive integer or
+% \opt{N}. The last node is always defined as \opt{N}.
+% \fi
+%
+% \cmditem{oenodeIn}{comp}
+%
+% \ifGERMAN
+% Der Knoten \prm{1} ist der Eingangsknoten und sollte immer über
+% \nxLcs{oenodeIn} angesprochen werden.
+% \fi
+% \ifENGLISH
+% The interface node \prm{1} is the input node and should always be accessed
+% via \nxLcs{oenodeIn}.
+% \fi
+%
+% \cmditem{oenodeOut}{comp}
+%
+% \ifGERMAN
+% Der Knoten \opt{N} ist der Ausgangsknoten und sollte
+% immer über \nxLcs{oenodeOut} angesprochen werden.
+% \fi
+% \ifENGLISH
+% The interface node \prm{N} is the output node and should always be accessed
+% via \nxLcs{oenodeOut}.
+% \fi
+%
+% \ifGERMAN
+% «Eingang» und «Ausgang» können nur anhand einer relativen Orientierung
+% definiert werden. Per Definition ist der Eingangsknoten derjenige zu dem ein
+% Lichtstrahl ausgehend vom Referenzknoten \Lcs{oenodeRefA} verläuft. Analog
+% dazu ist die Definition ds Ausgangsknotens. Diese Bezeichnung kann nur für
+% Faserkoppler (siehe \prettyref{sec:coupler-nodes}) und Strahlteiler
+% (\ref{cmd:beamsplitter}) nicht angewendet werden.
+%
+% \nxLcs{oenodeIn} ist äquivalent zu \nxLcs{oenodeIfc\{1\}} und
+% \nxLcs{oenodeOut} ist äquivalent zu \nxLcs{oenodeIfc\{N\}}. Die Eingangs-
+% und Ausgangsknoten sollten über die explizit bereitgestellten Makros
+% angesprochen werden, \nxLcs{oenodeIfc} sollte nur für die weiteren
+% Grenzflächenknoten, sofern vorhanden, verwendet werden.
+% \fi
+% \ifENGLISH
+% «Input» and «output» can define only relative orientations. The input node
+% is by definition the node to which a beam coming from the reference node
+% \Lcs{oenodeRefA} is connected to. Correspondingly is the definition of the
+% output node. This definition breaks down only for fiber couplers (see
+% \prettyref{sec:coupler-nodes}) and beamsplitter (\ref{cmd:beamsplitter}).
+%
+% \nxLcs{oenodeIn} is equivalent to \nxLcs{oenodeIfc\{1\}} and
+% \nxLcs{oenodeOut} is equivalent to \nxLcs{oenodeIfc\{N\}}. You should use
+% the \nxLcs{oenodeIfc} macro only to access the nodes which are not the input
+% and output nodes as for those explicit macros are provided.
+% \fi
+% \end{ltxsyntax}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(2.8,3)
+ \pentaprism[pentaprismsize=1.3](0,1.5)(1.5,1.5)(1.5,0)
+ \drawbeam[arrows=->, arrowinset=0, arrowscale=1.5]{(0,1.5)}{}{(1.5,0)}
+ \psdot(\oenodeIn{})\uput[135](\oenodeIn{}){1}
+ \psdot(\oenodeIfc{2}{})\uput[0](\oenodeIfc{2}{}){2}
+ \psdot(\oenodeIfc{3}{})\uput[90](\oenodeIfc{3}{}){3}
+ \psdot(\oenodeOut{})\uput[-45](\oenodeOut{}){N}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% In \prettyref{sec:overview-ifcnode} finden Sie eine vollständige Liste aller
+% Komponenten mit ihren Grenzflächenknoten.
+% \fi
+% \ifENGLISH
+% See \prettyref{sec:overview-ifcnode} for a complete list of all
+% components with their interface nodes.
+% \fi
+%
+% \ifGERMAN\section{Referenzknoten für die Rotation}\fi
+% \ifENGLISH\section{Rotation reference node}\fi
+% \label{sec:rotrefnode}
+%
+% \begin{ltxsyntax}
+% \cmditem{oenodeRotref}{comp}
+%
+% \ifGERMAN
+% Der Referenzknoten um den eine Komponente mit \Lkeyword{angle} gedreht
+% wird. Die Position des Knotens wird mit dem \Lkeyword{rotateref} Parameter
+% definiert und kann dieselben Werte annehmen wie \Lkeyword{extnode}. Eine
+% vollständige Liste der möglichen Positionen finden Sie in
+% \prettyref{sec:overview-extnode}.
+% \fi
+% \ifENGLISH
+% The node around which a component is rotated by \Lkeyword{angle}. The
+% position is defined with the \Lkeyword{rotateref} parameter and can take the
+% same values as \Lkeyword{extnode}. See \prettyref{sec:overview-extnode} for
+% possible rotation reference nodes of all components.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[pos=t, linerange={1-2, 6-7, 11-12}]
+\begin{pspicture}(0,0.1)(12,1.8)
+ \optbox[angle=20](0.5,1)(4.5,1)
+ \psdot(\oenodeRefA{})\uput[-90](\oenodeRefA{}){RefA}
+ \psdot(\oenodeRefB{})\uput[-90](\oenodeRefB{}){RefB}
+ \psline[style=Refline](\oenodeRefA{})(\oenodeRefB{})
+ \psdot(\oenodeRotref{})\uput[-90](\oenodeRotref{}){Rotref}
+ \optbox[angle=20, rotateref=bl](7.5,1)(11.5,1)
+ \psdot(\oenodeRefA{})\uput[-90](\oenodeRefA{}){RefA}
+ \psdot(\oenodeRefB{})\uput[-90](\oenodeRefB{}){RefB}
+ \psline[style=Refline](\oenodeRefA{})(\oenodeRefB{})
+ \psdot(\oenodeRotref{})\uput[-90](\oenodeRotref{}){Rotref}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \ifGERMAN\section{Strahlknoten}\fi
+% \ifENGLISH\section{Beam nodes}\fi
+% \label{sec:beamnode}
+%
+% \ifGERMAN
+% Die Endknoten eines \Lcs{drawbeam} oder \Lcs{drawwidebeam} Kommandos
+% können wieder verwendet werden, wenn \Lkeyword{savebeampoints} gesetzt ist.
+% \fi
+% \ifENGLISH
+% The end points of a recent \Lcs{drawbeam} or \Lcs{drawwidebeam} command can
+% be reused if \Lkeyword{savebeampoints} is set.
+% \fi
+% \begin{ltxsyntax}
+% \cmditem{oenodeBeam}{num}
+%
+% \ifGERMAN
+% Damit wird der Endknoten eines vorangegangenen \Lcs{drawbeam} Kommandos
+% angesprochen. Wird \prm{num} leer gelassen so wird \opt{1} genommen, was in
+% der Regel dem letzten Strahlengang entspricht. Auf welchen Strahl genau
+% Bezug genommen wird, hängt i.a. von den gewählten Einstellungen von
+% \Lkeyword{savebeampoints} und entsprechender Wahl von \prm{num} ab.
+% \fi
+% \ifENGLISH
+% Access the end point of a preceeding \Lcs{drawbeam} command. If \prm{num} is
+% left empty it defaults to \opt{1} which usually refers to the last beam
+% ray. However, generally it depends on the settings of
+% \Lkeyword{savebeampoints} and the choice of \prm{num} which beam you refer
+% to.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(0,0)(3,2)
+ \pnode(0,1){A}\pnode(1.6,1){B}
+ \optbox[position=end](A)(B)
+ \drawbeam[beaminsidelast=false]{(A)}{1}
+ \psdot(\oenodeBeam{})
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \cmditem{oenodeBeamUp}{num}
+% \cmditem{oenodeBeamLow}{num}
+%
+% \ifGERMAN
+% Damit wird der obere («upper») oder untere («lower») Endknoten eines
+% vorangegangenen \Lcs{drawwidebeam} Kommandos angesprochen. Wird \prm{num}
+% leer gelassen so wird \opt{1} genommen, womit man sich in der Regel auf den
+% letzten Strahlengang bezieht. Auf welchen Strahl genau Bezug genommen wird,
+% hängt i.a. von den gewählten Einstellungen von \Lkeyword{savebeampoints} und
+% entsprechender Wahl von \prm{num} ab.
+% \fi
+% \ifENGLISH
+% Access the upper or lower end point of a preceeding \Lcs{drawwidebeam}
+% command. If \prm{num} is left empty it defaults to \opt{1}, which usually
+% refers to the last beam ray. However, generally it depends on the settings
+% of \Lkeyword{savebeampoints} and the choice of \prm{num} which beam you
+% refer to.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-6,10-10}]
+\begin{pspicture}(0,0)(3,2)
+ \pnode(0,1){A}\pnode(3,1){B}
+ \lens[abspos=1, lensradius=-2](A)(B)
+ \addtopsstyle{Beam}{%
+ fillstyle=solid, fillcolor=green, opacity=0.3}
+ \drawwidebeam[beamwidth=0.5]{(A)}{}{(B)}
+ \psdot(\oenodeBeamUp{})\psdot(\oenodeBeamLow{})
+ \uput[90](\oenodeBeamUp{}){\rput[rb](0,0){BeamUp}}
+ \uput[-90](\oenodeBeamLow{}){\rput[rt](0,0){BeamLow}}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% Beachten Sie, dass «oben» («upper») und «unten» («lower») bezüglich der
+% Ausbreitungsrichtung des Strahls definiert ist. Ein Randstrahl der als «upper»
+% startet can zu «lower» werden, wenn er den anderen Randstrahl kreuzt. Das wird
+% in dem folgenden Beispiel erläutert:
+% \fi
+% \ifENGLISH
+% Note, that «upper» and «lower» is defined with respect to the propagation
+% direction of the beam. A marginal beam which started as «upper» can change to «lower»
+% if it crosses the other marginal beam. This is shown in the following example,
+% where the marginal rays exchange their roles:
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-6,10-10,14-14}]
+\begin{pspicture}(0,0)(3,2)
+ \pnode(0,1){A}\pnode(3,1){B}
+ \lens[abspos=1, n=2](A)(B)
+ \addtopsstyle{Beam}{%
+ fillstyle=solid, fillcolor=green, opacity=0.3}
+ \drawwidebeam[beamwidth=0.5]{(A)}{}
+ \psdot(\oenodeBeamUp{})\psdot(\oenodeBeamLow{})
+ \uput[90](\oenodeBeamUp{}){\rput[rb](0,0){BeamUp}}
+ \uput[-90](\oenodeBeamLow{}){\rput[rt](0,0){BeamLow}}
+ \drawwidebeam[loadbeam, beaminsidefirst]{}{(B)}
+ \psdot(\oenodeBeamUp{})\psdot(\oenodeBeamLow{})
+ \uput[90](\oenodeBeamUp{}){\rput[rb](0,0){BeamUp}}
+ \uput[-90](\oenodeBeamLow{}){\rput[rt](0,0){BeamLow}}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \ifGERMAN
+% Die Strahlknoten können nur innerhalb der \Lenv*{pspicture}-Umgebung verwendet
+% werden, in der sie definiert wurden. Um auf bestimmte Strahlknoten von
+% außerhalb zugreifen zu können müssen diese vorher explizit umdefiniert werden:
+% \fi
+% \ifENGLISH
+% The beam nodes can be accessed only within the \Lenv*{pspicture} environment
+% they were defined in. If you want to use one of these nodes from outside, you
+% must explicitely redefine them beforehand:
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{lstlisting}
+\pnode(\oenodeBeam{}){MyBeamNode}
+\end{lstlisting}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% Desweiteren werden die Endknoten durch \Lkeyword{stopinside}
+% beeinflusst. Siehe \prettyref{sec:custombeam} für weitere Details.
+% \fi
+% \ifENGLISH
+% The end points are also affected by \Lkeyword{stopinside}. See
+% \prettyref{sec:custombeam} for further details.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(0,0)(3,2)
+ \pnode(0,1){A}\pnode(1.6,1){B}
+ \optbox[position=end](A)(B)
+ \psset{beaminsidelast=false}
+ \drawbeam[linecolor=red, beampos=0.3]{(A)}{1}
+ \psdot(\oenodeBeam{})
+ \drawbeam[stopinside]{(A)}{1}
+ \psdot(\oenodeBeam{})
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN\section{Knotenübersicht}\fi
+% \ifENGLISH\section{Node overview}\fi
+%
+% \ifENGLISH This is an overview of all available component nodes.\fi
+% \ifGERMAN Dies ist eine Übersicht über alle verfügbaren Komponentenknoten.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[pos=t, linerange={2-4,16-16}]
+\psset{unit=2}
+\begin{pspicture}(0.3,0.1)(4.8,1.6)
+ \pnode(0.5,0.5){A}\pnode(4.5,0.5){B}
+ \optbox[compshift=0.5, angle=10, rotateref=tr, extnode={-0.5,1}](A)(B)
+ \psline[style=Refline](\oenodeTrefA{})(\oenodeTrefB{})
+ \psdot(\oenodeRefA{})\uput[-90](\oenodeRefA{}){RefA}
+ \psdot(\oenodeRefB{})\uput[-90](\oenodeRefB{}){RefB}
+ \psdot(\oenodeTrefA{})\uput[90](\oenodeTrefA{}){TrefA}
+ \psdot(\oenodeTrefB{})\uput[90](\oenodeTrefB{}){TrefB}
+ \psdot(\oenodeOut{})\uput[80](\oenodeOut{}){\rput[l](0,0.1){Out}}
+ \psdot(\oenodeIn{})\uput[100](\oenodeIn{}){\rput[r](0,0){In}}
+ \psdot(\oenodeCenter{})\uput[90](\oenodeCenter{}){Center}
+ \psdot(\oenodeRotref{})\uput[90](\oenodeRotref{}){Rotref}
+ \psdot(\oenodeExt{})\uput[90](\oenodeExt{}){Ext}
+ \psdot(\oenodeLabel{})\uput[90](\oenodeLabel{}){Label}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN\chapter{Verbinden von Komponenten}\fi
+% \ifENGLISH\chapter{Connecting components}\fi
+% \label{chap:connecting}
+%
+% \ifGERMAN
+% Das \nxLPack{pst-optexp}-Paket stellt unterschiedlichen Methoden bereit,
+% Komponenten vollautomatisch oder manuell, mit Fasern oder mit Lichtstrahlen zu
+% verbinden.
+% \begin{compactitem}
+% \item In \prettyref{sec:accessobj} wird beschrieben wie Komponenten und Knoten für Verbindungen angesprochen werden.
+% \item Strahlverbindungen im Allgemeinen und das Verhalten von Einzelstrahlen wir in \prettyref{sec:drawbeam} beschrieben.
+% \item \prettyref{sec:drawwidebeam} erweitert diese Beschreibung von Strahlverbindungen auf ausgedehnte Strahlen.
+% \item In \prettyref{sec:error-handling} wird gezeigt, wie fehlerhafte Strahlverbindungen (verfehlen von Grenzflächen) gehandhabt wird).
+% \item \prettyref{sec:custombeam} erläutert, wie stückweise definierte Strahlengänge einfach realisiert werden können.
+% \item Manuelle und automatische Faserverbindungen werden in \prettyref{sec:drawfiber} behandelt.
+% \item \prettyref{sec:layers} erklärt das Konzept der «front» und «back»-Ebene.
+% \end{compactitem}
+% \fi
+% \ifENGLISH
+% The \LPack{pst-optexp} package provides several methods for automatic and
+% manual beam and fiber drawing.
+%
+% \begin{compactitem}
+% \item \prettyref{sec:accessobj} describes how to access objects and nodes for use with connections.
+% \item Beam drawing in general and the behavior of single beams is explained in \prettyref{sec:drawbeam}.
+% \item \prettyref{sec:drawwidebeam} extends this description of beam drawing to wide beams.
+% \item \prettyref{sec:error-handling} shows how errors in beam connections (missed interfaces etc.) are handled.
+% \item \prettyref{sec:custombeam} explains how customized, piecewise defined beam paths are constructed.
+% \item Manual and automatic fiber connections are described in \prettyref{sec:drawfiber}.
+% \item \prettyref{sec:layers} introduces the concept of front and back layer for the drawings.
+% \end{compactitem}
+% \fi
+% \ifGERMAN\section{Zugriff auf Komponenten}\fi
+% \ifENGLISH\section{Accessing components}\fi\label{sec:accessobj}
+%
+% \ifENGLISH
+% All macros for connections can take either an ID, a \Lkeyword{compname}
+% identifier (see \prettyref{sec:namingobj}) or PSTricks nodes as arguments,
+% which are denoted with \prm{obj$_1$}, \prm{obj$_2$}, \ldots. To
+% distinguish between nodes and components, the nodes must be enclosed in
+% parenthesis within the brackets.
+% \fi
+% \ifGERMAN
+% Alle Makros für Verbindungen akzeptieren entweder eine ID, ein \Lkeyword{compname} Bezeichner (siehe
+% \prettyref{sec:namingobj}) oder einen PSTricks-Knoten als Argument, die als
+% \prm{obj$_1$}, \prm{obj$_2$}, \ldots{} bezeichnet werden. Um
+% zwischen Knoten und Komponenten unterscheiden zu können, müssen Knoten in
+% runde Klammern innerhalb der geschweiften Klammern eingeschlossen werden.
+% \fi
+%
+% \begin{enumerate}
+% \item
+% \ifGERMAN Auf alle Komponenten kann immer unter Verwendung der ID
+% zugegriffen werden.
+% \fi
+% \ifENGLISH All components can always be accessed via their ID.\fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \pnode(0,1){A}\pnode(1.5,1){B}
+ \optbox[position=end, labeloffset=0](A)(B){1}
+ \drawbeam{(A)}{1}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifGERMAN Wenn eine Komponente mit \Lkeyword{compname} einen zusätzlichen
+% Namen erhalten hat, so kann dieser anstelle der ID verwendet werden.
+% \fi
+% \ifENGLISH A component which has been assigned a name with
+% \Lkeyword{compname} can also be accessed via this instead of its ID.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{compname}}]
+\begin{pspicture}(3,2)
+ \psset{position=end, labeloffset=0}
+ \optbox[compname=obj](0,1)(1.5,1){obj}
+ \drawbeam{(0,1)}{obj}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifGERMAN Wird das Argument leer gelassen, dann greift man auf die zuletzt
+% definierte Komponente zu.
+% \fi
+% \ifENGLISH If the argument is left empty, use the last component defined.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \psset{position=end, labeloffset=0}
+ \optbox(0,0.5)(1.5,0.5){1}
+ \optbox(0,1.5)(1.5,1.5){2}
+ \drawbeam{(0,1)}{}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifGERMAN
+% Bei \Lcs{drawbeam} und \Lcs{drawwidebeam} können auch Zahlintervalle verwendet
+% werden. Gültige Intervallangaben sind
+% \begin{description}
+% \item[\parbox{2em}{\texttt{x-y}}] Von \opt{x} bis \opt{y}, ist \opt{x} größer
+% als \opt{y}, so wird heruntergezählt.
+% \item[\parbox{2em}{\texttt{x-}}] Von \opt{x} bis zur letzten Komponente.
+% \item[\parbox{2em}{\texttt{\hphantom{x}-y}}] Von der ersten Komponente bis \opt{y}.
+% \item[\parbox{2em}{\texttt{\hphantom{x}-}}] Verbinde alle Komponenten.
+% \end{description}
+% \fi
+% \ifENGLISH For \Lcs{drawbeam} and \Lcs{drawwidebeam} you can also specify a
+% number range. Valid range specifications are
+% \begin{description}
+% \item[\parbox{2em}{\texttt{x-y}}] From \opt{x} to \opt{y}, if \opt{x} is
+% greater than \opt{y}, the numbers are decremented.
+% \item[\parbox{2em}{\texttt{x-}}] From \opt{x} to the last component.
+% \item[\parbox{2em}{\texttt{\hphantom{x}-y}}] From the first component to \opt{y}.
+% \item[\parbox{2em}{\texttt{\hphantom{x}-}}] Connect all components.
+% \end{description}
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,3)
+ \psset{position=end, optboxsize=0.5 0.5, bssize=0.5}
+ \optbox[compname=obj](0.5,0.5)(0.5,2.5){obj, 1}
+ \beamsplitter(0.5,2.5)(0.5,1)(2.5,1){2}
+ \optbox(0.5,1)(2.5,1){3}
+ \drawbeam{1-3}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{enumerate}
+%
+% \ifENGLISH\section{Drawing beams}\fi
+% \ifGERMAN\section{Strahlen zeichnen}\fi
+% \label{sec:drawbeam}
+% \ifENGLISH
+% The package provides several ways to connect components and nodes with beams,
+% which can be either single rays or wide beams. Most parameters have the same
+% effect on both single and wide beams so most examples will be shown for
+% single beams only. For options specific to wide beams please see
+% \prettyref{sec:drawwidebeam}.
+% \fi
+% \ifGERMAN Es gibt mehrere Möglichkeiten Komponenten und Knoten mit Strahlen zu
+% verbinden: einfache Linien oder ausgedehnte Strahlen. Die meisten Parameter
+% haben für beide Typen dieselbe Bedeutung, daher beschränken sich die
+% entsprechenden Beispiele auf die einfachen Strahlen. Die Parameter die nur
+% ausgedehnte Strahlen betreffen, werden in \prettyref{sec:drawwidebeam}
+% beschrieben.
+% \fi
+%
+% \begin{ltxsyntax}
+% \xLcs{drawbeam}\cmditem{drawbeam}[options]{obj$_1$}{obj$_2$}\ldots
+% \xLcs{drawwidebeam}\cmditem*{drawwidebeam}[options]{obj$_1$}{obj$_2$}\ldots
+%
+% \ifENGLISH
+% These are the two macros for beam connections; they can take a variable
+% number of arguments (minimum of two) which can be either an ID, a
+% \Lkeyword{compname}, or a PSTricks nodes. To distinguish between nodes and
+% components, the nodes must be enclosed in parenthesis within the
+% brackets.
+% \fi
+% \ifGERMAN Diese beiden Makros sind für die Strahlverbindungen zuständig, sie
+% akzeptieren eine variable Anzahl an Argumenten (mindestens zwei), die
+% entweder eine ID, ein \Lkeyword{compname}, oder ein PSTricks-Knoten sein
+% können. Um zwischen Knoten und Komponenten unterscheiden zu können, müssen
+% Knoten in runde Klammern innerhalb der geschweiften Klammern eingeschlossen
+% werden.
+% \fi
+% \end{ltxsyntax}
+%
+% \subsection{Raytracing}\label{sec:raytracing}
+% \ifENGLISH
+% The beam connection macros support two modes of tracing the beam across the
+% optical components: one is to use refractive indices and Snell's law to
+% determine the beam path. The other mode is to connect the components only,
+% regardless of their optical properties.
+%
+% You must always keep in mind, that this is a package for \emph{sketching}
+% experimental setups. Therefore, we do not provide a comprehensive raytracing
+% framwork, because deviations from the actual physical path are often desired
+% for sketches: beam angles and divergences should be in many cases more extreme
+% than in the real setup in order to highlight certain aspects. You should also
+% consider the refractive index (see \prettyref{sec:n}) only as a tool to
+% optimize the visual effects of the beam path, and not stick with its
+% physically correct values.
+% \fi
+% \ifGERMAN
+% Der Strahlengang durch die Komponenten kann mit zwei unterschiedlichen
+% Methoden ermittelt werden: über den Brechungsindex und das Snelliussche
+% Brechungsgesetz, oder indem die Komponenten unabhängig von ihren optischen
+% Eigenschaften einfach verbunden werden.
+%
+% Behalten Sie immer im Hinterkopf, dass dieses Paket für \emph{Skizzen}
+% optischer Aufbauten gedacht ist und daher keine vollständige Umgebung zur
+% Strahlverfolgung bereitstellt. Abweichungen vom physikalisch richtigen Weg
+% können in vielen Fällen erwünscht sein: Winkel und Divergenzen werden häufig
+% extremer dargestellt um bestimmte Effekte hervorzuheben. Daher sollten Sie den
+% Brechungsindex (siehe \prettyref{sec:n}) lediglich as Mittel zur Optimierung
+% des gewünschten Lichtweges sehen und nicht zu sehr an den physikalisch
+% richtigen Werten festhalten.
+% \fi
+%
+% \begin{optionlist}
+% \boolitem[true]{raytrace}
+% \ifENGLISH
+% Chooses the mode of tracing the beam path,
+% \opt{true} uses the refractive index («raytracing»), \opt{false} selects
+% component connection («connect» mode).
+%
+% In most cases, the «connect» mode is equivalent to «raytracing» with
+% \Lkeyword{n}\opt{=1}, except for \Lcs{optprism} and \Lcs{doveprism}, where
+% the interface nodes (\prettyref{sec:ifcnode}) are simply connected.
+% See the following two example for the differences between the tracing modes
+% using these two components. The interface nodes are highlighted for clarity.
+%
+% The raytraced beam with \Lkeyword{n}\opt{=1} (blue) passes the component
+% without changing its direction, the refraction for \Lkeyword{n}\opt{=1.5} is
+% calculated (red), and the «connect» beam (green) just passes through the two
+% interface nodes.
+% \fi
+% \ifGERMAN
+% Wählt die Methode der Strahlverfolgung, mit \opt{true} wird der
+% Brechungsindex («raytracing») verwendet, \opt{false} verbindet die
+% Komponente lediglich («connect» Variante).
+%
+% In vielen Fällen ist «connect» identisch mit «raytracing» für
+% \Lkeyword{n}\opt{=1}, außer für \Lcs{optprism} oder \Lcs{doveprism} bei
+% denen die Grenzflächenknoten (\prettyref{sec:ifcnode}) dann einfach nur
+% verbunden werden. Die folgenden beiden Beispiele zeigen die Unterschiede
+% der beiden Methoden für diese Komponenten. Die Grenzflächenknoten sind zum
+% besseren Verständnis hervorgehoben.
+%
+% Der «raytracing» Strahl mit \Lkeyword{n}\opt{=1} (blau) wird durch die
+% Komponente transmittiert ohne die Richtung zu verändern, für
+% \Lkeyword{n}\opt{=1.5} (rot) wird die Brechung an den Grenzflächen berechnet,
+% und der «connect» Strahl (grün) durchläuft genau die Grenzflächenknoten.
+% \fi
+%
+%\iffalse
+%<*ignore>
+%\fi
+\begin{LTXexample}[linerange={1-7,9-9}]
+\begin{pspicture}(3,2.2)
+ \pnode(0,1.5){A}\pnode(1,1.5){B}\pnode(3,1){C}
+ \optprism[prismsize=1.2](A)(B)(C)
+ \optplane(C)
+ \drawbeam[n=1, linecolor=blue]{(A)}{1}{2}
+ \drawbeam[n=1.5, linecolor=red]{(A)}{1}{2}
+ \drawbeam[raytrace=false, linecolor=DGreen]{(A)}{1}{2}
+ \psdot(\oenodeIn{1})\psdot(\oenodeOut{1})
+\end{pspicture}
+\end{LTXexample}
+%\iffalse
+%</ignore>
+%\fi
+%
+% \ifENGLISH
+% For the \Lcs{doveprism} the same applies as for the \Lcs{optprism}, but the
+% raytraced beam with \Lkeyword{n}\opt{=1} (blue) misses the second interface
+% because it is not refracted and stops therefore at the first interface (see
+% \prettyref{sec:error-handling}). Again, the green «connect» ray passes through
+% all interface nodes.
+% \fi
+% \ifGERMAN
+% Das \Lcs{doveprism} wird im Prinzip genauso behandelt wie das \Lcs{optprism},
+% der «raytracing» Strahl mit \Lkeyword{n}\opt{=1} (blau) trifft wegen fehlender
+% Brechung die zweite Grenzfläche gar nicht, und endet daher schon an der ersten
+% Grenzflächen (siehe \prettyref{sec:error-handling}). Der grüne «connect»
+% Strahl verläuft wieder durch die Grenzflächenknoten.
+% \fi
+%
+%\iffalse
+%<*ignore>
+%\fi
+\begin{LTXexample}[linerange={1-6,8-8}]
+\begin{pspicture}(4,2)
+ \pnode(0,1){A}\pnode(4,1){B}
+ \doveprism[doveprismsize=1](A)(B)
+ \drawbeam[n=1, linecolor=blue, beampos=0.1]{(A)}{1}{(B)}
+ \drawbeam[n=1.5, linecolor=red]{(A)}{1}{(B)}
+ \drawbeam[raytrace=false, linecolor=DGreen]{(A)}{1}{(B)}
+ \psdot(\oenodeIn{1})\psdot(\oenodeIfc{2}{1})\psdot(\oenodeOut{1})
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% Für «connect» können auch unterschiedliche Anfangsbedingungen
+% (\ref{prm:beampos}) verwendet werden.
+% \fi
+% \ifENGLISH
+% The «connect» mode also supports changing the initial conditions
+% (\ref{prm:beampos}).
+% \fi
+%\iffalse
+%<*ignore>
+%\fi
+\begin{LTXexample}[linerange={1-7,9-9}, morekeywords={[21]beampos,beamangle}]
+\begin{pspicture}(3.7,2)
+ \pnode(0,1){A}\pnode(4,1){B}
+ \doveprism[doveprismsize=1](A)(B)
+ \psset[optexp]{raytrace=false}
+ \drawbeam[linecolor=blue, beampos=0.2, beamangle=-10]{(A)}{1}{(B)}
+ \drawbeam[raytrace=false, linecolor=DGreen]{(A)}{1}{(B)}
+ \drawbeam[linecolor=red, beampos=-0.2, beamangle=10]{(A)}{1}{(B)}
+ \psdot(\oenodeIn{1})\psdot(\oenodeIfc{2}{1})\psdot(\oenodeOut{1})
+\end{pspicture}
+\end{LTXexample}
+\begin{LTXexample}[linerange={1-7,9-9}, morekeywords={[21]beampos,beamangle}]
+\begin{pspicture}(3.7,2)
+ \pnode(0,1){A}\pnode(4,1){B}
+ \doveprism[doveprismsize=1](A)(B)
+ \psset[optexp]{raytrace=false}
+ \drawbeam[linecolor=blue, beampos=0.2]{(A)}{1}{(B)}
+ \drawbeam[linecolor=DGreen]{(A)}{1}{(B)}
+ \drawbeam[linecolor=red, beampos=-0.2]{(A)}{1}{(B)}
+ \psdot(\oenodeIn{1})\psdot(\oenodeIfc{2}{1})\psdot(\oenodeOut{1})
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \boolitem[true]{useNA}
+% \ifGERMAN Ein Strahlengang wird abgebrochen, falls eine Komponente nicht
+% getroffen wird. Für manche Zwecke, z.B. zum Ermitteln des richtigen
+% Brechungsindex, kann es sinnvoll sein, wenn die numerische Apertur eine
+% Komponente nicht berücksichtigt wird. In dem folgenden Beispiel wird der
+% rote Strahl gezeichnet, obwohl er außerhalb der gezeichneten Spiegelfläche
+% liegt.
+% \fi
+% \ifENGLISH The beam path is interrupted if an interface is missed. In some
+% cases, e.g. to estimate the correct refractive index for a ray trace, it can
+% be useful if the numerical aperture of the components is not considered. The
+% red beam in the following example is drawn, although it hits the mirror
+% outside the drawn mirror surface.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \pnode(0,0.5){A}\pnode(2.5,0.5){B}\pnode(2.5,2){C}
+ \mirror(A)(B)(C)
+ \psset{useNA=false}
+ \drawbeam{(A)}{}{(C)}
+ \drawbeam[linecolor=red, beamangle=10]{(A)}{}{(C)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \end{optionlist}
+%
+% \ifENGLISH\subsection{Refractive index}\fi
+% \ifGERMAN\subsection{Brechungsindex}\fi
+% \label{sec:n}
+%
+% \ifENGLISH
+% The raytracing depends on the refractive index, which may be set for each
+% component separately. The refractive index is always relative to the
+% background which has a constant value for the whole sketch.
+% \fi
+% \ifGERMAN
+% Das Raytracing wird durch den Brechungsindex bestimmt, der für jede Komponente
+% einzeln gesetzt werden kann. Der Wert ist relativ zum Hintergrund, für den ein
+% konstanter Wert für die gesamte Skizze angenommen wird.
+% \fi
+%
+% \begin{optionlist}
+% \valitem[1.5]{n}{code}
+% \ifGERMAN
+% Setzt den Brechungsindex relativ zum Hintergrund. Diese Option hat zwei
+% Anwendungsbereiche: zum einen kann der Index einer Komponente gesetzt werden,
+% zum anderen der Brechungsindex für einen Strahlengang:
+% \fi
+% \ifENGLISH Sets the relative refractive index respect to the background. This
+% parameter has two scopes, you can either set the refractive index of each
+% component or of each beam ray:
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN
+% \begin{enumerate}
+% \item Wird \Lkeyword{n} als globaler Parameter oder als Komponentenparameter
+% verwendet, so wird der Index für alle betroffenen Komponenten gesetzt. Ohne
+% weitere Änderungen wird jeder Lichtstrahl diese Werte verwenden.
+% \item Als Parameter zu \Lcs{drawbeam} oder \Lcs{drawwidebeam} kann der
+% Brechungsindex der Komponenten für einzelne Strahlengänge überschrieben oder
+% geändert werden. Das kann sehr nützlich sein, um z.B. chromatische
+% Dispersion zu illustrieren. Soll die Änderung global für alle oder mehrere
+% Lichtstrahlen wirksam sein, so muss der gewünschte Wert dem
+% \Lstyle{Beam}-Stil hinzugefügt werden, da globale Definitionen von
+% \Lkeyword{n} nur die Komponenten betreffen.
+% \end{enumerate}
+% \fi
+% \ifENGLISH
+% \begin{enumerate}
+% \item Using \Lkeyword{n} as global parameter or component argument
+% sets a fixed refractive index for each affected component. Without further
+% actions, all beam paths experience this refractive index.
+% \item As parameter for \Lcs{drawbeam} or \Lcs{drawwidebeam} you can overwrite
+% or even change the refractive index of the components for specific beam
+% paths. This can be very useful e.g. to simulate chromatic dispersion. To set
+% this globally for all beams you must add the respective parameter
+% definition to the \Lstyle{Beam} style because global definitions of
+% \Lkeyword{n} affect only the components and not the beams.
+% \end{enumerate}
+% \fi
+%
+% \ifENGLISH
+% The \prm{code} can in general be any Postscript code which evaluates to a
+% number, e.g. \opt{1.5}, or \opt{5 sqrt}. If the \prm{code} starts with a
+% \opt{*}, it will be interpreted as an algebraic
+% expression\fnurl{http://mirror.ctan.org/graphics/pstricks/base/doc/pst-news08.pdf},
+% e.g. \opt{*sqrt(5)} is equivalent to \opt{5 sqrt}. Inside the \prm{code} you
+% can access the predefined refractive index of the component via \opt{n} which
+% allows you to change the index relative to its original value. Use
+% e.g. \opt{n=n 1.01 mul} to change \opt{n} by one percent.
+%
+% In the following you find several examples about the different aspects of
+% using \Lkeyword{n}.
+% \fi
+% \ifGERMAN
+% Der \prm{code} kann jeglicher Postscript-Kode sein, der zu einer Zahl
+% ausgewertet werden kann, also z.B. \opt{1.5} oder \opt{5 sqrt}. Beginnt
+% \prm{code} mit einem \opt{*}, so wird der Code als algebraischer
+% Ausdruck\fnurl{http://mirror.ctan.org/graphics/pstricks/base/doc/pst-news08.pdf}
+% ausgewertet, d.h. \opt{*sqrt(5)} ist äquivalent zu \opt{5 sqrt}. Innerhalb von
+% \prm{code} kann mit \opt{n} auf den vordefinierten Brechungsindex der
+% Komponenten zugegriffen werden, es kann also eine Änderung relativ zum
+% ursprünglichen Wert erzielt werden. Mit \opt{n=n 1.01 mul} kann \opt{n}
+% z.B. um ein Prozent geändert werden.
+%
+% In den folgenden Beispielen werden diese unterschiedlichen Möglichkeiten von
+% \Lkeyword{n} gezeigt.
+% \fi
+%
+% \begin{enumerate}
+% \item
+% \ifENGLISH Set a fixed refractive index for the component. Interestingly,
+% for the default shape of the \Lcs{doveprism} a refractive index of
+% $\sqrt{5}$ gives the ideal output direction which is the same as the input
+% direction.
+% \fi
+% \ifGERMAN
+% Setze den Brechungsindex einer Komponente. Interessanterweise ist für die
+% Standardform des \Lcs{doveprism} ein Brechungsindex von $\sqrt{5}$ der
+% ideale Wert so dass der Ausgangsstrahl parallel zum Eingangsstrahl verläuft.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1.5)
+ \pnode(0,1){A}\pnode(3,1){B}
+ \doveprism[n=*sqrt(5)](A)(B)
+ \drawbeam{(A)}{}{(B)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifENGLISH In this example one beam uses the default refractive index of the
+% components (green), the other one overwrites it with a value of \opt{2}
+% (red).
+% \fi
+% \ifGERMAN
+% Ein Strahl (grün) verwendet die voreingestellten Werte der Komponenten, der
+% rote überschreibt diese mit \opt{2}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{n}}]
+\begin{pspicture}(3,3)
+ \pnode(0,1){A}\pnode(3,1){B}
+ \optplane(A)
+ \psset{lens=3 3 2, n=1.5}
+ \lens[abspos=0.5](A)(B)
+ \lens[abspos=2](A)(B)
+ \optplane(B)
+ \addtopsstyle{Beam}{beampos=0.5}
+ \drawbeam{-}
+ \drawbeam[linecolor=red, n=2]{-}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifENGLISH
+% Now, the red beam uses the default refractive index of the component, the
+% yellow beam adds \opt{0.5} to the default index.
+% \fi
+% \ifGERMAN
+% Der rote Strahl verwendet die voreingestellten Werte, der grüne ändert diese
+% um \opt{0.5}.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{n}}]
+\begin{pspicture}(3,3)
+ \pnode(0,1.5){A}\pnode(3,1.5){B}
+ \lens[lens=4 4 3, n=2, abspos=0.3](A)(B)
+ \optplane[compname=Plane](B)
+ \psset{beampos=0.6}
+ \drawbeam[linecolor=red]{(A)}{1}{Plane}
+ \drawbeam[linecolor=yellow, n=*(n+0.5)]{(A)}{1}{Plane}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifENGLISH
+% Dynamically changing the refractive index is very useful to emulate
+% chromatic dispersion. Here, we sketch the dispersion of a prism by
+% calculating the refractive index with Sellmaier's
+% equation\fnurl{http://en.wikipedia.org/wiki/Sellmeier_equation} for
+% different wavelengths.
+% \fi
+% \ifGERMAN
+% Mit dynamischer Anpassung von \Lkeyword{n} kann chromatische Dispersion sehr
+% gut emuliert werden. Hier wird die Dispersion eines Prisma gezeigt, der
+% Brechungsindex wird mit der Sellmaier
+% Gleichung\fnurl{http://en.wikipedia.org/wiki/Sellmeier_equation} für die
+% unterschiedlichen Wellenlängen berechnet.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{n}}]
+\begin{pspicture}(3,3)
+ \pnode(-1,0){A}\pnode(1,2.2){B}\pnode(3,0){C}
+ \optplane(0,2.15)
+ \optprism[prismalign=center, prismangle=59](A)(B)(C)
+ \optplane(C)
+ \definecolor[ps]{bl}{rgb}{%
+ tx@addDict begin Red Green Blue end}%
+ \addtopsstyle{Beam}{linecolor=bl, linewidth=0.4\pslinewidth, beamalign=abs}
+ \multido{\i=0+1}{60}{%
+ \pstVerb{%
+ \i\space 650 400 sub 59 div mul 400 add
+ tx@addDict begin wavelengthToRGB end }%
+ \drawbeam[n=\i\space 650 400 sub 59 div mul 400 add Sellmaier]{-}%
+ }%
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifENGLISH Using the numerical aperture of a pinhole as spectral filter.\fi
+% \ifGERMAN Die numerische Apertur einer Lochblende als spektraler Filter.\fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{n}}]
+\begin{pspicture}(0.3,0)(3.3,5.2)
+ \pnode(0.3,1){A}\pnode(2,1){B}\pnode(3,2){C}\pnode(2.5,5){D}
+ \optplane(A)
+ \optgrating[reverse](A)(B)(C)
+ \pinhole[phwidth=-0.1, innerheight=0.03, abspos=0.5](D)(B)
+ \optplate[position=end, plateheight=1.5](B)(D)
+ \definecolor[ps]{bl}{rgb}{%
+ tx@addDict begin Red Green Blue end}%
+ \drawbeam[linecolor=red]{1-2}
+ \addtopsstyle{Beam}{linecolor=bl, linewidth=0.4\pslinewidth}
+ \multido{\i=0+1}{60}{%
+ \pstVerb{%
+ \i\space 650 400 sub 59 div mul 400 add
+ tx@addDict begin wavelengthToRGB end }%
+ \drawbeam[beamangle=\i\space 0.1 mul 3 sub]{2-}%
+ }%
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{enumerate}
+%
+% \begin{optionlist}
+% \valitem{refractiveindex}{code}
+% \deprecatedmsg{\Lkeyword{n}}
+% \end{optionlist}
+%
+% \ifENGLISH\subsection{Initial conditions}\fi
+% \ifGERMAN\subsection{Anfangsbedingungen}\fi
+%
+% \begin{optionlist}
+% \optitem[0]{beampos}{[\prm{x} ]\prm{y}}
+% \ifENGLISH
+% This is the start position (\prm{x}, \prm{y}) of the beam at the first
+% interface. Both values are of \prm{psnum} type. If a single number is given,
+% the $x$-coordinate is set to \opt{0}.
+% \fi
+% \ifGERMAN
+% Die Startposition (\prm{x}, \prm{y}) des Strahls an der ersten
+% Grenzfläche. Beide Zahlen sind vom Typ \prm{psnum}. Wird eine einzelne Zahl
+% angegeben, wird die $x$-Koordinate auf \opt{0} gesetzt.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{beampos}}]
+\begin{pspicture}(4,3.8)
+ \pnode(1.5,0.5){A}\pnode(3.5,0.5){B}\pnode(3.5,3.5){C}
+ \optbox[position=end](B)(A)
+ \mirror[mirrortype=extended, mirrorradius=3](A)(B)(C)
+ \optplate[position=end](B)(C)
+ \drawbeam[linecolor=red, beampos=-0.2]{1-3}
+ \drawbeam[linecolor=blue, beampos=0]{1-3}
+ \drawbeam[linecolor=green, beampos=0.2]{1-3}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifENGLISH The start position is relative to the respective interface node, as
+% it is illustrated in the following example. The beam start position is fixed,
+% but depending on e.g. the \Lkeyword{beamangle}, the actual intersection with
+% the curved interface is at a different position.
+% \fi
+% \ifGERMAN
+% Die Startposition ist relativ zum entsprechenden Grenzflächenknoten, wie im
+% folgenden Beispiel gezeigt wird. Die Startposition ist fest, abhängig z.B. von
+% \Lkeyword{beamangle} kann der eigentliche Schnittpunkt mit der ersten
+% Grenzfläche jedoch anders sein.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-7,9-9}, morekeywords = {[21]{beampos}}, explpreset={escapeinside={}}]
+\begin{pspicture*}(0,2)(3.05,6)
+ \lens[lens=8 8 8, abspos=0.6](0.5,2)(3,2)
+ \optplate[position=1, plateheight=6](0.5,2)(3,2)
+ \psset{beampos=2.1}
+ \drawbeam[beamangle=-60]{1}{2}
+ \drawbeam[beamangle=-40]{1}{2}
+ \drawbeam[beamangle=-20]{1}{2}
+ \psline[style=Refline, linewidth=3\pslinewidth, arrows=->, arrowinset=0, arrowscale=1.3](\oenodeOut{1})([offset=2.1]\oenodeOut{1})
+\end{pspicture*}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifENGLISH
+% Which interface the beam starts at is determined by the options
+% \Lkeyword{beaminsidefirst} and \Lkeyword{startinside}.
+% \fi
+% \ifGERMAN
+% An welcher Grenzfläche der ersten Komponente gestartet wird hängt von
+% \Lkeyword{beaminsidefirst} und \Lkeyword{startinside} ab.
+% \fi
+%
+% \psnumitem[0]{beamangle}
+% \ifGERMAN
+% Der Anfangswinkel des Strahls. Dieser ist in der Regel relativ zu der
+% Verbindung von der ersten zur zweiten Komponente, mit \Lkeyword{beamalign}
+% kann dieses Verhalten verändert werden.
+% \fi
+% \ifENGLISH
+% This is the start angle of the beam. Usually, it is relative to the connection
+% between the first two components, use \Lkeyword{beamalign} to change this.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{beamangle}}]
+\begin{pspicture}(4,4)
+ \pnode(1.5,0.5){A}\pnode(3.5,0.5){B}\pnode(3.5,3.5){C}
+ \optbox[position=end](B)(A)
+ \mirror[mirrortype=extended](A)(B)(C)
+ \optplate[position=end](B)(C)
+ \drawbeam[linecolor=red, beamangle=3]{-3}
+ \drawbeam[linecolor=blue, beamangle=0]{1-}
+ \drawbeam[linecolor=green, beamangle=-3]{-}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \choitem[relative]{beamalign}{rel, relative, abs, absolute}
+% \ifGERMAN
+% Gibt vor, ob der Winkel \Lkeyword{beamangle} relativ zu der Verbindung
+% zwischen den ersten beiden Komponenten ist, oder ob es sich um einen absoluten
+% Winkel handelt.
+%
+% Ein absoluter Winkel kann sehr hilfreich sein, falls eine der beiden ersten
+% Komponenten gedreht oder verschoben wurde. Dabei werden die
+% Grenzflächenknoten, auf die sich ein relativer Winkel bezieht, ebenfalls
+% transformiert (siehe \prettyref{sec:rotshift}). In dem folgenden Beispiel
+% verläuft daher der grüne Strahl mit der relativen Ausrichtung nicht
+% horizontal.
+% \fi
+% \ifENGLISH
+% Select whether the \Lkeyword{beamangle} is relative to the connection between
+% the first two components, or if it is an absolute angle.
+%
+% A typical situation where an absolute angle is helpful is with rotated or
+% shifted components. By rotating or shifting a component also its interface
+% nodes are rotated (see \prettyref{sec:rotshift}) which are then used to
+% determine the input angle for relative alignment. Accordingly, in the
+% following example, the green beam with the relative alignment is not
+% horizontal.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{beamalign, angle}}]
+\begin{pspicture}(3,1.5)
+ \pnode(0,0.75){A}\pnode(3,0.75){B}
+ \optbox[angle=10, showifcnodes](A)(B)
+ \drawbeam{(A)}{}{(B)}
+ \drawbeam[linecolor=red, beamalign=abs]{(A)}{}{(B)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN\subsection{Interner Strahlengang}\fi
+% \ifENGLISH\subsection{Internal beam path}\fi
+%
+% \ifENGLISH
+% A beam path is composed of rays between components and rays inside the
+% components. Depending on some options these internal beams can be drawn or
+% not. Generally, the first, the last, and all other components are treated
+% separately.
+% \fi
+% \ifGERMAN
+% Ein Strahlengang setzt sich aus Strahlen zwischen den Komponenten und
+% innerhalb der Komponenten zusammen. Ob diese internen Strahlen gezeichnet
+% werden, kann mit mehreren Parametern festgelegt werden. Die erste, letzte und
+% die übrigen Komponenten werden separat gehandhabt.
+% \fi
+%
+% \boolitem[true]{beaminside}
+% \ifGERMAN
+% Zeichnet den Strahlengang innerhalb aller Komponenten mit Ausnahme der
+% ersten und letzten, die von dieser Option nicht beeinflusst.
+% \fi
+% \ifENGLISH
+% Draw the internal beams in all intermediate components, the first and last
+% components are not affected.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{beaminside}}]
+\begin{pspicture}(0.3,0.3)(3,4)
+ \psset{optboxwidth=1}
+ \optbox[position=end](1,1)(1,3)
+ \optretplate(1,1)(1,3)
+ \pentaprism(1,3)(1,1)(2,1)
+ \optbox[position=end](1,1)(2,1)
+ \drawbeam[beampos=-0.05, linecolor=red]{-}
+ \drawbeam[beampos=0.05, beaminside=false]{-}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \boolitem[false]{beaminsidefirst}
+% \ifGERMAN
+% Zeichne den Strahlengang innerhalb der ersten Komponenten.
+% \fi
+% \ifENGLISH
+% Draw the internal beams of the first component.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{beaminsidefirst}}]
+\begin{pspicture}(0.3,0.3)(3,4)
+ \psset{optboxwidth=1}
+ \optbox[position=end](1,1)(1,3)
+ \optretplate(1,1)(1,3)
+ \pentaprism(1,3)(1,1)(2,1)
+ \optbox[position=end](1,1)(2,1)
+ \drawbeam[beampos=-0.05, linecolor=red]{-}
+ \drawbeam[beampos=0.05, beaminsidefirst]{-}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \boolitem[false]{beaminsidelast}
+% \ifGERMAN
+% Zeichne den Strahlengang innerhalb der letzten Komponenten.
+% \fi
+% \ifENGLISH
+% Draw the internal beams of the last component.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{beaminsidelast}}]
+\begin{pspicture}(0.3,0.3)(3,4)
+ \psset{optboxwidth=1}
+ \optbox[position=end](1,1)(1,3)
+ \optretplate(1,1)(1,3)
+ \pentaprism(1,3)(1,1)(2,1)
+ \optbox[position=end](1,1)(2,1)
+ \drawbeam[beampos=-0.05, linecolor=red]{-}
+ \drawbeam[beampos=0.05, beaminsidelast]{-}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \boolitem[true]{allowbeaminside}
+% \ifGERMAN
+% Damit kann bestimmt werden, ob der Strahlengang innerhalb einer Komponente
+% gezeichnet werden darf. Dieser Parameter wirkt nur auf Komponenten und
+% überschreibt, falls auf \opt{false} gesetzt, jegliche Strahleinstellungen mit
+% \Lkeyword{beaminside}, \Lkeyword{beaminsidefirst} und
+% \Lkeyword{beaminsidelast}. Damit kann der Strahlengang in einzelnen
+% Komponenten unterdrückt werden, für die es keinen Sinn macht
+% (z.B. \Lcs{optfilter} und \Lcs{optdiode}, was sonst nicht möglich ist.
+% \fi
+% \ifENGLISH
+% Define whether a beam is drawn inside a component. The option affects
+% components only and overwrites all settings of \Lkeyword{beaminside},
+% \Lkeyword{beaminsidefirst}, and \Lkeyword{beaminsidelast} if set to
+% \opt{false}. With this you can forbid any internal beams for components where
+% it does not make any sense (e.g. \Lcs{optfilter} and \Lcs{optdiode}).
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{allowbeaminside}}]
+\begin{pspicture}(3,2)
+ \psset{optboxwidth=0.5}
+ \pnode(0,1){A}\pnode(3,1){B}
+ \optbox[position=0.2](A)(B)
+ \optbox[position=0.4, allowbeaminside=false](A)(B)
+ \optbox[position=0.6](A)(B)
+ \optbox[position=0.8](A)(B)
+ \drawbeam{(A)}{-}{(B)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \ifENGLISH\subsection{Connecting with nodes}\fi
+% \ifGERMAN\subsection{Verbinden mit Knoten}\fi
+%
+% \ifENGLISH
+% As mentioned earlier in this chapter, beams can connect components also with
+% nodes. For raytracing you need in general a plane, which imposes some problems
+% when connecting with nodes. This is handled such, that a temporary plane is
+% constructed, which goes through the specified node and is perpendicular to the
+% connection between the node and the preceeding component. If a beam starts
+% with a node, the orientation is determined by the node and the following
+% component.
+% \fi
+% \ifGERMAN
+% Wie vorher schon einmal erwähnt können Komponenten auch mit Knoten verbunden
+% werden. Für Raytracing wird in der Regel eine Ebene benötigt, was ein Problem
+% hinsichtlich der Knoten darstellt. Das wird so gehandhabt, das eine temporäre
+% Ebene definiert wird, die durch den Knoten verläuft und vertikal zur
+% Verbindung zwischen dem Knoten und der vorangegangenen Komponente steht. Fängt
+% ein Strahlengang mit einem Knoten an, so wird die Ausrichtung durch den Knoten
+% und die folgende Komponente bestimmt.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \pnode(0,1){A}\pnode(2.5,1){B}
+ \lens[lens=3 3 2, n=2.5, abspos=0.5](A)(B)
+ \multido{\r=-0.3+0.3}{3}{%
+ \drawbeam[beampos=\r]{(A)}{}{(B)}}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifENGLISH
+% This is very handy in many cases, but does not allow to rotate the node planes
+% and can give again problems with shifted and rotated components (see
+% \prettyref{sec:rotshift}).
+% For more flexibility, the package provides an «invisible» plane which can be
+% used for this purpose.
+% \fi
+% \ifGERMAN
+% Das ist in vielen Fällen sehr praktisch, kann aber wiederum unerwünschte
+% Ergebnisse bei gedrehten und verschobenen Komponenten ergeben und die
+% Ebenenausrichtung kann nicht beliebig gesetzt werden. Das kann mit einer
+% unsichtbaren Ebene erreicht werden, die mit \Lcs{optplane} definiert wird.
+% \fi
+%
+% \begin{ltxsyntax}
+% \xLcs{optplane}\cmditem{optplane}(center)
+%
+% \ifENGLISH
+% The plane is defined by a single node only, the rotation around this node
+% is defined with \Lkeyword{angle}. The angle is with respect to the default
+% alignment, which is vertical.
+% \fi
+% \ifGERMAN Die Ebene wird durch lediglich einen Knoten definiert, die Drehung
+% darum kann mit \Lkeyword{angle} angegeben werden. Der Winkel ist relativ zur
+% ursprünglichen, vertikalen Ausrichtung.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \pnode(0,1){A}\pnode(2.5,1){B}
+ \lens[lens=3 3 2, n=2.5, abspos=0.5](A)(B)
+ \optplane[angle=-30](B)
+ \multido{\r=-0.3+0.3}{3}{%
+ \drawbeam[beampos=\r]{(A)}{-}}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \ifENGLISH\subsection{Automatic connection}\fi
+% \ifGERMAN\subsection{Automatische Verbindungen}\fi
+%
+% \ifENGLISH
+% Beam can also be drawn at definition time of a component, which can be handy,
+% but allows only very elemental beams.
+% \fi
+% \ifGERMAN Lichtstrahlen können auch zusammen mit der Komponentendefinition
+% gezeichnet werden. Das kann für einfache Strahlengänge sehr praktisch sein,
+% ist aber sehr unflexibel.
+% \fi
+%
+% \begin{optionlist}
+% \boolitem[false]{beam}
+% \ifGERMAN Kann als Option für jede Komponente verwendet werden, ist äquivalent
+% zu
+% \fi
+% \ifENGLISH Can be used as option for every component, is equivalent to the
+% statement
+% \fi
+% \begin{lstlisting}[gobble=2]
+% \drawbeam[raytrace=false]{(\oenodeRefA{})}{}{(\oenodeRefB{})}
+% \end{lstlisting}
+% \ifENGLISH which draws a beam from one reference node via the component to the
+% other reference node.
+% \fi
+% \ifGERMAN womit ein Strahl vom ersten Referenzknoten über die Komponente zum
+% zweiten Referenzknoten gezeichnet wird.
+% \fi
+%
+% \valitem{conn}{string}
+% \ifGERMAN Diese Option wird nur aus Kompatibilitätsgründen bereitgestellt
+% und wird aus zukünftigen Versionen entfernt. Siehe
+% \prettyref{sec:bwd-comp-3.0} für weitere Informationen.
+% \fi
+% \ifENGLISH This option is maintained for backward compatibility only and will
+% be removed in future versions. See \prettyref{sec:bwd-comp-3.0} for further
+% information.
+%\fi
+% \end{optionlist}
+%
+% \ifENGLISH\subsection{Beam appearance}\fi
+% \ifGERMAN\subsection{Strahlaussehen}\fi
+% \label{sec:beamappearance-single}
+%
+% \begin{stylelist}
+% \styleitem[linecolor=green!90!black, linejoin=1]{Beam}
+% \ifENGLISH
+% The appearance of beams is controlled with this style. The optional argument
+% of \Lcs*{draw*beam} can also be used, these options can overwrite settings from
+% the \Lstyle{Beam} style.
+% \fi
+% \ifGERMAN
+% Das Aussehen der Lichtstrahlen kann mit diesem Stil gesteuert werden. Das
+% optionale Argument von \Lcs*{draw*beam} kann ebenfalls dafür verwendet
+% werden und kann die Einstellungen des \Lstyle{Beam}-Stils überschreiben.
+% \fi
+% \end{stylelist}
+%
+% \begin{optionlist}
+% \valitem{addtoBeam}{list}
+% \addtostylemsg{Beam}
+% \valitem{newBeam}{list}
+% \newstylemsg{Beam}
+%
+% \psnumitem[0.2]{ArrowInsideMinLength}
+% \ifGERMAN
+% \Lcs*{draw*beam} verwendet auch die Option \Lkeyword*{ArrowInside} aus
+% \LPack{pstricks-add}. In dem Fall wird für alle Strahlsegmente ein Pfeil
+% gezeichnet, was häufig für die internen, kurzen Strahlengänge unerwünscht
+% ist. Mit \Lkeyword{ArrowInsideMinLength} kann angegeben werden ab welcher
+% Mindestlänge eines Strahlsegmentes die Pfeil gezeichnet werden. In dem
+% folgenden Beispiel ist der Wert so gewählt, dass nur der untere interne
+% Strahl einen Pfeil hat (siehe auch \prettyref{ex:czerny-turner}).
+% \fi
+% \ifENGLISH
+% \Lcs*{draw*beam} uses also the option \Lkeyword*{ArrowInside} from
+% \LPack{pstricks-add}. In this case the arrows would be drawn for every beam
+% segment, which is often undesired for the internal, short beam
+% paths. \Lkeyword{ArrowInsideMinLength} sets a minimum segment length, below
+% which no internal arrows are drawn. In the following example the value is
+% selected such that only the lower internal beam has an arrow (see also
+% \prettyref{ex:czerny-turner}).
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{ArrowInsideMinLength}}]
+\begin{pspicture}(3,2)
+ \optprism(0,1)(2,1)(3,0.5)
+ \drawwidebeam[beamwidth=0.4, ArrowInside=->, ArrowInsideMinLength=0.5, arrowscale=1.5, raytrace=false]{(0,1)}{}{(3,0.5)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \psnumitem[-1]{ArrowInsideMaxLength}
+% \ifGERMAN Gibt analog zu \Lkeyword{ArrowInsideMinLength} die maximale Länge
+% eines Segments an, für das Pfeile gezeichnet werden. Ist der Wert negativ,
+% dann gibt es keine obere Grenze.
+% \fi
+% \ifENGLISH Like \Lkeyword{ArrowInsideMaxLength}, but sets the maximum length
+% of a segment for which the arrows are drawn. If the value is negative, no
+% upper limit is defined.
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Aufgeweitete Strahlen}\fi
+% \ifENGLISH\section{Drawing wide beams}\fi
+% \label{sec:drawwidebeam}
+%
+% \ifENGLISH
+% All information about single beams (see \prettyref{sec:drawbeam}) apply to
+% wide beams as well. Here, you find all additional information which apply to
+% wide beams only.
+% \fi
+% \ifGERMAN
+% Alle Informationen über einfache Strahlen (siehe \prettyref{sec:drawbeam})
+% betreffen auch aufgeweitete Strahlen. Hier werden nur zusätzliche
+% Einstellmöglichkeiten aufgeweiteter Strahlen behandelt.
+% \fi
+%
+% \begin{ltxsyntax}
+% \xLcs{drawwidebeam}\cmditem{drawwidebeam}[options]{obj$_1$}{obj$_2$}\ldots
+% \end{ltxsyntax}
+%
+% \begin{optionlist}
+% \psnumitem[0]{beamwidth}
+% \ifENGLISH The initial beam width, measured at the initial position (defined
+% with \Lkeyword{beampos}) perpendicular to the beam direction.
+% \fi
+% \ifGERMAN Die Anfangsstrahlbreite an der mit \Lkeyword{beampos} angegebenen
+% Position, gemessen vertikal zur Verbindungslinie zur nächsten Komponente.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{beamwidth}}]
+\begin{pspicture}(4,4)
+ \pnode(1.5,0.5){A}\pnode(3.5,0.5){B}\pnode(3.5,3.5){C}
+ \optbox[position=end](B)(A)
+ \mirror[mirrortype=extended](A)(B)(C)
+ \optplate[position=end](B)(C)
+ \drawwidebeam[beamwidth=0.3]{-}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \psnumitem[0]{beamdiv}
+% \ifENGLISH The total beam divergence at the starting position, given in
+% degree. Positive values give an expanding beam, negative values a contracting
+% beam.
+% \fi
+% \ifGERMAN Die Strahldivergenz an der Startposition, angegeben in
+% Grad. Positive Werte ergebenen einen expandierenden Strahl, negative einen
+% kontrahierenden.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{beamdiv}}, linerange={1-8,11-11}]
+\begin{pspicture}(3,2)
+ \pnode(0,1){A}\pnode(3,1){B}
+ \psset{plateheight=2}
+ \optplate[position=start](A)(B)
+ \optplate[position=end](A)(B)
+ \addtopsstyle{Beam}{beamwidth=0.2}
+ \drawwidebeam[beampos=0.4, beamdiv=5]{-}
+ \drawwidebeam[beampos=-0.4, beamdiv=-5, linecolor=red]{-}
+ \rput[b](1.5,0){\footnotesize\ttfamily beamdiv < 0}
+ \rput[t](1.5,2){\footnotesize\ttfamily beamdiv > 0}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+% \ifENGLISH\subsection{Beam appearance}\fi
+% \ifGERMAN\subsection{Strahlaussehen}\fi
+%
+% \ifENGLISH
+% The appearance of wide beams can be controlled like that of single beams with
+% the optional argument or the \Lstyle{Beam} style (see
+% \prettyref{sec:beamappearance-single}).
+%
+% Wide beams have two marginal rays, which are drawn according to the line
+% settings, and may be filled.
+% \fi
+% \ifGERMAN Das Aussehen aufgeweiteter Strahlen kann genauso wie bei einfachen
+% Strahlen über \Lstyle{Beam} oder das optionale Argument vorgegeben werden
+% (siehe \prettyref{sec:beamappearance-single}).
+%
+% Breite Strahlen bestehen aus zwei Randstrahlen, die gemäß der
+% Linieneinstellungen gezeichnet werden, und können zusätzlich gefüllt werden.
+% \fi
+%
+% \begin{enumerate}
+% \item
+% \ifENGLISH Only marginal rays.\fi
+% \ifGERMAN Nur die Randstrahlen.\fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \pnode(0,0.5){A}\pnode(1,0.5){B}\pnode(2.8,2){C}
+ \mirror[mirrorwidth=1.5](A)(B)(C)
+ \drawwidebeam[beamwidth=0.4]{(A)}{}{(C)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifENGLISH Marginal rays, and with fill style.\fi
+% \ifGERMAN Randstrahlen, und Füllstil.\fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]fillstyle, linestyle}]
+\begin{pspicture}(3,2)
+ \pnode(0,0.5){A}\pnode(1,0.5){B}\pnode(2.8,2){C}
+ \mirror[mirrorwidth=1.5](A)(B)(C)
+ \addtopsstyle{Beam}{fillstyle=solid, fillcolor=red!50!white, linecolor=red}
+ \drawwidebeam[beamwidth=0.4]{(A)}{}{(C)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifENGLISH Only with fill style.\fi
+% \ifGERMAN Nur Füllstil.\fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]fillstyle, linestyle}]
+\begin{pspicture}(3,2)
+ \pnode(0,0.5){A}\pnode(1,0.5){B}\pnode(2.8,2){C}
+ \mirror[mirrorwidth=1.5](A)(B)(C)
+ \addtopsstyle{Beam}{fillstyle=solid, fillcolor=red, opacity=0.3, linestyle=none}
+ \drawwidebeam[beamwidth=0.4]{(A)}{}{(C)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{enumerate}
+%
+% \ifGERMAN\section{Fehlerbehandlung}\fi
+% \ifENGLISH\section{Error handling}\fi
+% \label{sec:error-handling}
+%
+% \ifGERMAN
+% Da alle Strahlen direkt mit Postscript berechnet und gezeichnet werden, ist
+% eine umfassende Fehlerbehandlung zur Zeit der Kompilation nicht möglich. Um
+% jedoch trotzdem fehlerfreie Bilder zu bekommen, wird der Strahlengang
+% abgebrochen, sobald eine Situation eintritt, die nicht unterstützt wird. Das kann
+% eintreten, falls der Strahl eine Grenzfläche nicht trifft, oder
+% Totalreflektion auftritt.
+% \fi
+% \ifENGLISH All beam are calculated and drawn directly in Postscript, so that a
+% comprehensive error handling at compilation time is not possible. If a
+% situation arises which is not supported by the drawing algorithm, the beam
+% path is truncated at this point. This happens in the following cases:
+% \fi
+% \begin{enumerate}
+% \item
+% \ifENGLISH A beam misses an interface. The red beam in the following example
+% misses the last plane and is truncated at the last valid interface.
+% \fi
+% \ifGERMAN Ein Strahl trifft eine Grenzfläche nicht. Der rote Strahl in dem
+% folgenden Beispiel verpasst die letzte Grenzfläche und endet daher an der
+% vorhergehenden.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2.7)
+ \pnode(0,1){A}\pnode(3,1){B}
+ \optplate[position=start](A)(B)
+ \lens[lens=4 4 2, abspos=0.5, n=2.5](A)(B)
+ \optplate[position=end, plateheight=0.5](A)(B)
+ \drawbeam{-}
+ \drawbeam[beampos=0.2]{-}
+ \drawbeam[beampos=0.4, linecolor=red]{-}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifENGLISH When total internal reflection occurs at an interface which is
+% not set up for this. The red beam in the following example would be
+% reflected, but this is not supported and the beam is truncated at the
+% interface where the total internal reflection occurs.
+% \fi
+% \ifGERMAN Totale interne Reflektion tritt an einer Grenzfläche auf, die
+% nicht dafür vorgesehen ist. Der rote Strahl im folgenden Beispiel würde
+% reflektiert werden, aber das wird für diese Komponente nicht unterstützt und
+% der Strahl endet an der total reflektierenden Grenzfläche.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2.5)
+ \pnode(0,2){A}\pnode(3,0){B}
+ \optplane(A)
+ \optprism[n=1.8](A)([Xnodesep=1.5]A)(B)
+ \optplane(B)
+ \drawbeam[beamangle=5]{-}
+ \drawbeam[beamangle=-5, linecolor=red]{-}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{enumerate}
+%
+% \ifGERMAN Dasselbe gilt ebenfalls für aufgeweitete Strahlen (siehe
+% \prettyref{sec:drawwidebeam}). Bei diesen wird der Strahlengang abgebrochen,
+% falls einer der beiden Randstrahlen einen Fehler aufweist.
+% \fi
+% \ifENGLISH These conditions apply to wide beams (see \prettyref{sec:drawwidebeam}) as
+% well, the beam path is interrupted as soon as one of the marginal rays has an
+% error.
+% \fi
+%
+% \begin{optionlist}
+% \boolitem[false]{pswarning}
+% \ifENGLISH To simplify debugging, you can print a message to
+% standard output if a beam misses an interface or if total internal
+% reflection occured at some point.
+% \fi
+% \ifGERMAN Um eine Fehlersuche zu vereinfachen kann ein Hinweis ausgegeben
+% werden sobald ein Strahlengang vorzeitig beendet wird weil entweder eine
+% Grenzfläche verpasst wird, oder totale interne Reflektion auftritt.
+%\fi
+% \end{optionlist}
+%
+% \ifGERMAN\section{Angepasste Strahlen}\fi
+% \ifENGLISH\section{Custom beams}\fi
+% \label{sec:custombeam}
+%
+% \ifGERMAN
+% Im Prinzip können alle Strahlengänge mit passender Wahl des Brechungsindex und
+% der Komponentenparameter (z.B. der Linsenkrümmung) realisiert werden, was
+% jedoch sehr aufwendig werden kann. Um das zu vereinfachen, besteht die
+% Möglichkeit die Endpunkte eines Strahls als Anfangspunkte für folgende
+% Strahlen zu nutzen, so dass man abschnittsweise die Divergenz und die
+% Ausbreitungsrichtung definieren kann.
+% \fi
+% \ifENGLISH
+% With an appropriate choice of refractive index and component parameters
+% (e.g. lens curvature) all kind of beam paths could be realised although it
+% might be very cumbersome. To simplify this we provide the possibility to use
+% the end points of one beam path as starting points for the next beam which
+% allows piecewise definition of the beam divergence, angle, and direction.
+% \fi
+%
+% \begin{optionlist}
+% \choitem[true]{savebeampoints}{true,false,\prm{int}}
+% \ifGERMAN Speichert die Endpunkte eines \nxLcs{draw*beam} Makros,
+% vorangegangene Punkte werden überschrieben. \Lcs{drawbeam} und
+% \Lcs{drawwidebeam} werden getrennt behandelt. Wird hier eine Zahl \prm{int}
+% $> 0$ angegeben, so können beliebig viele Endpunkte separat gespeichert
+% werden. In der Regel reicht an- und abschalten vollkommen aus.
+% \fi
+% \ifENGLISH Saves the end points of a \nxLcs{draw*beam} macro, previous
+% points are overwritten. \Lcs{drawbeam} and \Lcs{drawwidebeam} are treated
+% separately. If a number \prm{int} $> 0$ is given, you can save as many end
+% points as you like, but in most use cases enabling and disabling this option
+% is sufficient.
+% \fi
+%
+% \choitem[false]{loadbeampoints}{true,false,\prm{int}}
+% \ifGERMAN Verwende die Endpunkte eines vorangegangenen Strahls als
+% Startpunkte. Wird keine Zahl \prm{int} angegeben, dann wird \opt{1}
+% verwendet.
+% \fi
+% \ifENGLISH Use the end points of a previous beam as starting points for the
+% next beam. If no number \prm{int} is specified, \opt{1} is used.
+% \fi
+% \end{optionlist}
+%
+% \ifGERMAN Als Beispiel nehmen wir ein Teleskop, die Strahldivergenz am Eingang
+% und am Ausgang ist Null. Anstatt die Linsenparameter und den Brechungsindex
+% genau einzustellen, so dass die Ausgangsdivergenz Null ist, zeichnen wir
+% einfach die drei Strahlenteile mit den gewünschten Divergenzen, und verwenden
+% die Endpunkte des jeweils vorangegangenen Strahls als neue Ausgangspunkte.
+% \fi
+% \ifENGLISH As example we consider a telescope which has zero divergence at the
+% input and output. Usually we would need to tweak the refractive index and the
+% lens parameters to get an output beam with no divergence. Instead, we draw the
+% three beam parts separately using the end points of the previous beams as new
+% starting points and specifying the divergence for each beam part
+% explicitely.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{savebeampoints, loadbeampoints}}]
+\begin{pspicture}(4,2)
+ \pnode(0,1){A}\pnode(4,1){B}
+ \begin{optexp}
+ \lens[lens=0.5 0.5 0.5, abspos=0.5](A)(B)
+ \lens[lens=4 4 2, abspos=2](A)(B)
+ \addtopsstyle{Beam}{%
+ fillstyle=solid, fillcolor=green, opacity=0.3}
+ \psset{loadbeampoints}
+ \drawwidebeam[beamwidth=0.2, stopinside]{(A)}{1}
+ \drawwidebeam[beamdiv=-60]{1}{2}
+ \drawwidebeam{2}{(B)}
+ \end{optexp}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN Als weiteres Beispiel betrachten wir die Beugung an einem Gittern in
+% die nullte und erste Beugungsordnung. Zuerst wird der Strahl von dem Eingang
+% bis zum Gitter gezeichnet, die Endpunkte dieses Strahls werden nun für die
+% Strahlen in beide Beugungsordnungen verwendet.
+% \fi
+% \ifENGLISH The next example shows diffraction from a grating in the zeroth and
+% first diffraction order. First we draw the beam to the grating, its end points
+% are used for the beams into both diffraction orders.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{savebeampoints, loadbeampoints}},
+ linerange={1-12,16-16}, caption={caption}, label={ex:loadbeampoints}]
+\begin{pspicture}(3.5,3.5)
+ \pnode(0,0.5){A}\pnode(2,0.5){B}\pnode(2,3){C}
+ \nodexn{(C)-(1,0)}{C'}
+ \nodexn{(C)(1,0)}{C''}
+ \optgrating(A)(B)(C)
+ \addtopsstyle{Beam}{%
+ fillstyle=solid, fillcolor=green, opacity=0.3}
+ \drawwidebeam[beamwidth=0.3]{(A)}{1}
+ \psset{savebeampoints=false, loadbeampoints}
+ \drawwidebeam{1}{(C)}
+ \drawwidebeam{1}{(C')}
+ \drawwidebeam{1}{(C'')}
+ \rput[b]([offset=0.2]C){0th}
+ \rput[b]([offset=0.2]C'){1st}
+ \rput[b]([offset=0.2]C''){-1st}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \begin{optionlist}
+% \boolitem[true]{savebeam}
+% \ifGERMAN Speichert die Endzustände, d.h. Endpunkte und Ausgangsvektoren,
+% eines \nxLcs{draw*beam} Makros, vorangegangene Werte werden
+% überschrieben. \Lcs{drawbeam} und \Lcs{drawwidebeam} werden getrennt
+% behandelt. Wird hier eine Zahl \prm{int} $> 0$ angegeben, so können beliebig
+% viele Strahlen separat gespeichert werden. In der Regel reicht an- und
+% abschalten vollkommen aus.
+% \fi
+% \ifENGLISH Saves the end conditions, i.e. end points and output vectors, of
+% each \nxLcs{draw*beam} macro, previous values are
+% overwritten. \Lcs{drawbeam} and \Lcs{drawwidebeam} are treated
+% separately. If a number \prm{int} $> 0$ is given, you can save as many end
+% points as you like, but in most use cases enabling and disabling this option
+% is sufficient.
+% \fi
+%
+% \boolitem[false]{loadbeam}
+% \ifGERMAN Verwende den Endzustand (Punkte und Richtung) eines
+% vorangegangenen Strahls als Anfangszustand. Der Parameter
+% \Lkeyword{beamangle} kann verwendet werden um die Richtung relativ zu der
+% geladenen zu verändern (siehe folgendes Beispiel).
+% \fi
+% \ifENGLISH Use the end condition (points and vectors) of a previous beam as
+% starting conditions for the next beam. The parameter \Lkeyword{beamangle}
+% can be used to change the direction relative to the loaded one (see
+% following example).
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{savebeam, loadbeam}},
+ linerange={1-10,14-14}, caption={caption}, label={ex:loadbeam}]
+\begin{pspicture}(3.5,3.5)
+ \pnode(0,0.5){A}\pnode(2,0.5){B}\pnode(2,3){C}
+ \optgrating(A)(B)(C)
+ \addtopsstyle{Beam}{%
+ fillstyle=solid, fillcolor=green, opacity=0.3}
+ \drawwidebeam[savebeam, beamwidth=0.3]{(A)}{1}
+ \psset{savebeam=false, loadbeam}
+ \drawwidebeam[beamangle=-20]{1}{(C)}
+ \drawwidebeam{1}{(C)}
+ \drawwidebeam[beamangle=20]{1}{(C)}
+ \rput[b]([offset=0.2]C){0th}
+ \rput[b]([Xnodesep=-0.9, offset=0.2]C){1st}
+ \rput[b]([Xnodesep=0.9,offset=0.2]C){-1st}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+%
+%
+% \begin{optionlist}
+% \boolitem[false]{startinside}
+% \ifENGLISH
+% The parameter \Lkeyword{beaminsidefirst} controls if the internal beams are
+% drawn inside the first component. However, for custom beams it can also be
+% necessary to trace the internal beam of the first component without drawing
+% it, e.g. if the previous beam ended at the first interface.
+%
+% In the following example the red beam is the wrong continuation of the
+% incoming green beam because it assumes that the loaded beam conditions refer
+% to the output interface. But the previous beam stopped at the input
+% interface, so one needs to set \Lkeyword{startinside} in order to continue
+% the beam properly (see blue beam). The dashed line helps to understand the
+% correct beam path through the lens.
+% \fi
+% \ifGERMAN Mit dem Parameter \Lkeyword{beaminsidefirst} kann eingestellt
+% werden, ob der interne Strahlengang in der erste Komponente gezeichnet
+% wird. Für angepasste Strahlengänge kann es aber notwendig sein dem internen
+% Strahlengang in der ersten Komponente zu folgen ohne diesen zu zeichnen,
+% z.B. wenn der vorangegangene Strahl an der ersten Grenzfläche schon endet.
+%
+% Im folgenden Beispiel wird der einfallende grüne Strahl falsch durch den
+% roten Strahl fortgesetzt, da der grüne an der linken Grenzfläche endet, der
+% rote aber fälschlicherweise annimmt, dass der Endzustand sich auf die rechte
+% Grenzfläche bezieht. Dem blauen Strahl wird nun mit \Lkeyword{startinside}
+% mitgeteilt, dass der Endzustand sich auf die linke Grenzfläche bezieht.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{startinside}}]
+\begin{pspicture*}(0,2)(3.05,6)
+ \optplane(0,2)
+ \lens[lens=8 8 8, abspos=0.6, n=1.8](0.5,2)(3,2)
+ \optplate[position=1, plateheight=6](0.5,2)(3,2)
+ \psset{savebeam=false}
+ \drawbeam[beampos=3, linestyle=dashed]{-}
+ \drawbeam[beampos=3, savebeam]{1-2}
+ \drawbeam[loadbeam, linecolor=red]{2-3}
+ \drawbeam[loadbeam, startinside, linecolor=blue]{2-3}
+\end{pspicture*}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \boolitem[false]{stopinside}
+% \ifENGLISH This option is equivalent to \Lkeyword{startinside} but refers
+% to the last component.
+% \fi
+% \ifGERMAN Äquivalent zu \Lkeyword{startinside}, bezieht sich aber auf die
+% letzte Komponenten.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords = {[21]{stopinside}}]
+\begin{pspicture*}(0,2)(3.05,6)
+ \optplane(0,2)
+ \lens[lens=8 8 8, abspos=0.6, n=1.8](0.5,2)(3,2)
+ \optplate[position=1, plateheight=6](0.5,2)(3,2)
+ \psset{savebeam=false}
+ \drawbeam[beampos=3, linestyle=dashed]{-}
+ \drawbeam[beampos=3, savebeam, stopinside]{1-2}
+ \drawbeam[loadbeam, linecolor=blue]{2-3}
+\end{pspicture*}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+%
+% \ifGERMAN\section{Faserverbindungen}\fi
+% \ifENGLISH\section{Drawing fibers}\fi
+% \label{sec:drawfiber}
+%
+% \ifENGLISH
+% All available components can be connected with fiber connections, the
+% fiber components are connected automatically.
+% \fi
+% \ifGERMAN
+% Alle Komponenten können mit Fasern verbunden werden, die Faserkomponenten
+% werden automatisch verbunden.
+% \fi
+%
+% \begin{ltxsyntax}
+% \xLcs{drawfiber}\cmditem{drawfiber}[options]{obj$_1$}{obj$_2$}\ldots
+% \end{ltxsyntax}
+%
+% \ifENGLISH
+% The \Lcs{drawfiber} command takes ID, \Lkeyword{compname}, or nodes as
+% \prm{obj$_N$} arguments (see \prettyref{sec:accessobj}), but ID ranges like
+% with \Lcs{drawbeam} are not possible. If you specify more than two arguments,
+% you get connections $1\rightarrow 2$, $2\rightarrow 3$, and so on.
+%
+% The automatic fiber connections are drawn internally with \Lcs{drawfiber}
+% commands from each reference node to the component.
+% \fi
+% \ifGERMAN
+% Das \Lcs{drawfiber} Makro kann ID, \Lkeyword{compname} oder Knoten als
+% \prm{obj$_N$} Argumente verarbeiten (siehe \prettyref{sec:accessobj}), aber
+% ID-Intervalle wie bei \Lcs*{draw*beam} sind nicht möglich. Werden mehr als
+% zwei Argumente mitgegeben, werden die Verbindungen $1\rightarrow 2$,
+% $2\rightarrow 3$, usw. gezeichnet.
+%
+% Die automatischen Faserverbindungen werden intern als \Lcs{drawfiber} von den
+% Referenzknoten zur Komponente gezeichnet.
+% \fi
+%
+% \ifENGLISH\subsection{Fiber angles}\fi
+% \ifGERMAN\subsection{Faserwinkel}\fi
+% \label{sec:drawfiber-angles}
+%
+% \ifENGLISH
+% The fibers are usually drawn as \Lcs*{nccurve} connections, the angles at both
+% curve ends are automatically determined by the component orientation and
+% depend on whether you connect a component with a component, or a component
+% with a node.
+% \fi
+% \ifGERMAN
+% Ãœblicherweise werden Fasern als \Lcs*{nccurve}-Verbindungen gezeichnet, die
+% Winkel an beiden Kurvenenden werden automatisch anhand der
+% Komponentenausrichtung bestimmt und hängen davon ab, ob eine Komponente mit
+% einer anderen Komponente oder einem Knoten verbunden wird.
+% \fi
+%
+% \ifENGLISH\minisec{Component with node}\fi
+% \ifGERMAN\minisec{Komponente mit Knoten}\fi
+%
+% \ifENGLISH
+% A connection of a component with a node is what is used for automatic
+% connections (see \prettyref{sec:drawfiber-auto}). Consider the following
+% example for clarification of the curve alignment:
+% \fi
+% \ifGERMAN
+% Eine Verbindung zwischen einer Komponente und einem Knoten ist das, was bei
+% automatischen Verbindungen verwendet wird (siehe
+% \prettyref{sec:drawfiber-auto}). Folgendes Beispiel erläutert die Ausrichtung
+% der Kurve:
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-3,10-11}]
+\begin{pspicture}(-1,-0.7)(7,2.7)
+ \pnode(0,1){A}\pnode(6,1){B}
+ \optbox[angle=30](A)(B)
+ \psdot(\oenodeRefA{})\uput[180](\oenodeRefA{}){RefA}%
+ \psdot(\oenodeRefB{})\uput[0](\oenodeRefB{}){RefB}%
+ \psdot(\oenodeTrefA{})\uput[180](\oenodeTrefA{}){TrefA}%
+ \psdot(\oenodeTrefB{})\uput[0](\oenodeTrefB{}){TrefB}%
+ \psline[style=Refline, linestyle=dashed](\oenodeTrefA{})(\oenodeTrefB{})
+ \psline[style=Refline, linestyle=dashed](\oenodeRefA{})(\oenodeRefB{})
+ \drawfiber{(A)}{}{(B)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifENGLISH
+% The angle at the component itself agrees with the transformed reference line.
+% The angle at the node corresponds to the angle of the original reference line
+% of the component which it gets connected to. The fiber is always directed to
+% the component node.
+%
+% Considering the following example, this means that the start angles of the red
+% fibers are rotated by 180° with respect to the green fibers. The angles at the
+% component do not change.
+% \fi
+% \ifGERMAN
+% Der Winkel an der Komponente entspricht dem der transformierten
+% Referenzlinie. Der Winkel an dem Knoten entspricht dem der ursprünglichen
+% Referenzlinie der Komponente zu der die Verbindung geht. Die Faser ist in
+% Richtung des entsprechenden Komponentenknotens orientiert.
+%
+% Das führt dazu, dass im folgenden Beispiel die Anfangswinkel der roten Fasern
+% um 180° gegenüber den grünen Fasern gedreht sind, die Winkel an der Komponente
+% bleiben unverändert.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-1,4-4,7-14}]
+\begin{pspicture}(-2,-1.6)(2,2)
+ \psset[optexp]{optboxsize=1.6 0.8}
+ \addtopsstyle{Fiber}{ArrowInside=->, arrowscale=1.5}
+ \optbox[position=end](0,1)(0,0)
+ \psarc[fillstyle=solid,fillcolor=gray!20, linestyle=none](0,0){2}{0}{180}
+ \psline[linestyle=dashed]([Xnodesep=-2]\oenodeIn{})([Xnodesep=2]\oenodeIn{})
+ \addtopsstyle{Fiber}{linecolor=green!90!black}
+ \multido{\i=10+40}{5}{%
+ \drawfiber{(2;\i)}{}
+ }
+ \addtopsstyle{Fiber}{linecolor=red!90!black}
+ \drawfiber{(2;-20)}{}
+ \drawfiber{(2;200)}{}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifENGLISH\minisec{Component with component}\fi
+% \ifGERMAN\minisec{Komponente mit Komponente}\fi
+%
+% \ifENGLISH
+% This variant is very helpful to achieve smoother connections between
+% components which are not aligned on the same reference line but are arranged
+% maybe in a loop or similar, see \prettyref{ex:nalm} and
+% \prettyref{ex:recirc-loop}.
+%
+% In this case, the curve angles are determined by the component which the
+% respective curve end is connected to. The fibers are always directed away from
+% the component center.
+% \fi
+% \ifGERMAN
+% Diese Variante ist sehr nützlich um glattere Verbindungen zwischen Komponenten
+% zu erreichen, die nicht auf derselben Referenzlinie positioniert sind, sondern
+% z.B. in einer Schleife angeordnet werden, siehe \prettyref{ex:nalm} und
+% \prettyref{ex:recirc-loop}.
+%
+% In diesem Fall werden die Kurvenwinkel von der Komponente bestimmt, mit der
+% das jeweilige Ende verbunden ist. Die Fasern zeigen immer von der
+% Komponentenmitte weg.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-5,10-11}]
+\begin{pspicture}(0,-0.8)(7,0.8)
+ \pnode(0,0){A}\pnode(3,0){B}
+ \pnode(4,0){C}\pnode(7,0){D}
+ \optbox[angle=30](A)(B)
+ \optbox[angle=-30](C)(D)
+ \psline[style=Refline, linestyle=dashed](\oenodeTrefA{1})(\oenodeTrefB{1})
+ \psline[style=Refline, linestyle=dashed](\oenodeTrefA{2})(\oenodeTrefB{2})
+ \psline[style=Refline, linestyle=dashed](\oenodeRefA{1})(\oenodeRefB{2})
+ \psdot(\oenodeRefA{1})\psdot(\oenodeRefB{2})
+ \drawfiber{(A)}{1}{2}{(D)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifENGLISH These automatically calculated start and stop angles can be changed
+% in a variety of ways, the available parameters are listed in the following.
+% \fi
+% \ifGERMAN
+% Diese automatisch berechneten Winkel können vielfältig manipuliert werden, die
+% möglichen Parameter sind im Folgenden aufgelistet.
+% \fi
+%
+% \begin{optionlist}
+% \choitem[relative]{fiberalign}{rel,relative,center,abs,absolute}
+% \ifENGLISH Set the reference for the fiber angles.
+% \fi
+% \ifGERMAN
+% Wählt die Referenz für die Faserwinkel.
+% \fi
+% \begin{valuelist}
+% \item[relative]
+% \ifENGLISH The fiber angles are relative to the component. When
+% connecting a node to a component, the angle at the node is that of the
+% component reference line. The angle at the component agrees with that of
+% its transformed reference line.
+% \fi
+% \ifGERMAN
+% Die Faserwinkel sind relativ zur Komponente. Wird ein Knoten mit der
+% Komponente verbunden, so entspricht der Winkel am Knoten dem der
+% Referenzlinie der Komponente. Der Winkel an der Komponente entspricht dem
+% der transformierten Referenzlinie.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-5,10-11}]
+\begin{pspicture}(1,-1.7)(7,1.7)
+ \pnode(0,0){A}\pnode(3,0){B}
+ \pnode(4,0){C}\pnode(7,0){D}
+ \optbox[angle=30](A)(B)
+ \optbox[angle=-30](C)(D)
+ \psline[style=Refline, linestyle=dashed](\oenodeTrefA{1})(\oenodeTrefB{1})
+ \psline[style=Refline, linestyle=dashed](\oenodeTrefA{2})(\oenodeTrefB{2})
+ \psline[style=Refline, linestyle=dashed](\oenodeRefA{1})(\oenodeRefB{2})
+ \psdot(\oenodeRefA{1})\psdot(\oenodeRefB{2})
+ \drawfiber{(A)}{1}{2}{(D)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item[center]
+% \ifENGLISH The fiber angles both at the node and the component are relative
+% to the connection between the involved interface node and the center node of
+% the component. In most cases this is equivalent to \opt{relative}, but
+% necessary e.g. for \Lcs{optcirculator}. In the example, the green fiber
+% shows the correct alignment, while the red one is with \opt{relative}
+% alignment.
+% \fi
+% \ifGERMAN
+% Die Winkel sowohl am Knoten als auch an der Komponente sind relativ zu der
+% Verbindung zwischen dem betroffenen Komponentenknoten und der
+% Komponentenmitte. Meistens ist das äquivalent zu \opt{relative}, wird aber
+% z.B. für \Lcs{optcirculator} benötigt. In dem Beispiel hat die grüne Faser
+% die korrekte Ausrichtung, während die rote \opt{relative} ausgerichtet wird.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]fiberalign}]
+\begin{pspicture}(1,0)(3,2)
+ \addtopsstyle{Fiber}{arrowscale=1.3, arrows=->, arrowinset=0}
+ \optcirculator[fiber=t](0,0.5)(3,2)(1.5,0)
+ \drawfiber[linecolor=red]{}{(1.5,0)}
+ \drawfiber[fiberalign=center, linecolor=green]{}{(1.5,0)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item[absolute]
+% \ifENGLISH The fiber angles are absolute, no automatic values are added.
+% \fi
+% \ifGERMAN
+% Die Faserwinkel werden als absolute Werte angegeben, die automatischen
+% Winkel werden nicht berücksichtigt.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]fiberalign}, linerange={1-3,7-8}]
+\begin{pspicture}(1,-1)(4.5,1)
+ \pnode(0,0){A}\pnode(4,0){B}
+ \optbox[angle=30](A)(B)
+ \psline[style=Refline, linestyle=dashed](\oenodeTrefA{})(\oenodeTrefB{})
+ \psline[style=Refline, linestyle=dashed](\oenodeRefA{})(\oenodeRefB{})
+ \psdot(\oenodeRefA{})\psdot(\oenodeRefB{})
+ \drawfiber[fiberalign=abs, ncurv=1.5]{(A)}{}{(B)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{valuelist}
+%
+% \numitem[0]{fiberangleA}
+% \ifENGLISH An additive value for the starting angle, the total angle depends
+% on \Lkeyword{fiberalign}. If this parameter is set to \opt{absolute}, then
+% \Lkeyword{fiberangleA} is the total angle, otherwise its value is added to
+% the calculated angle.
+% \fi
+% \ifGERMAN
+% Ein additiver Wert für den Anfangswinkel, der gesamte Winkel hängt von
+% \Lkeyword{fiberalign} ab. Ist dieser auf \opt{absolute} eingestellt, so ist
+% \Lkeyword{fiberangleA} der absolute Winkel, andernfalls wird der Wert zu dem
+% automatisch berechneten Winkel hinzuaddiert.
+% \fi
+%
+% \numitem[0]{fiberangleB}
+% \ifENGLISH Like \Lkeyword{fiberangleA}, but for the end angle.\fi
+% \ifGERMAN Wie \Lkeyword{fiberangleB}, aber für den Endwinkel.\fi
+%
+% \choitem[auto]{startnode}{auto, N, 1, 2, \ldots}
+% \ifGERMAN Für die Verbindungen mit \Lcs{drawfiber} werden die Knoten
+% genommen, die sich am nächsten sind. Das passt häufig, aber nicht
+% immer. Hiermit kann der Startknoten explizit gewählt werden.
+% \fi
+% \ifENGLISH The connections with \Lcs{drawfiber} are drawn between the
+% two nodes which are nearest to each other. This fits most of the time, but not
+% always. With this option you can choose the start node explicitely.
+% \fi
+%
+% \choitem[auto]{stopnode}{auto, N, 1, 2, \ldots}
+% \ifGERMAN Genau wie \Lkeyword{startnode}, aber für den Stopknoten.\fi
+% \ifENGLISH Like \Lkeyword{startnode}, but for the stop node.\fi
+% \end{optionlist}
+%
+% \ifENGLISH
+% The following examples show some use cases for \Lkeyword{startnode} and
+% \Lkeyword{stopnode}.
+% \fi
+% \ifGERMAN
+% Die folgenden Beispiele zeigen Anwendungsmöglichkeiten für
+% \Lkeyword{startnode} und \Lkeyword{stopnode}.
+% \fi
+%
+% \begin{enumerate}
+% \item
+% \ifENGLISH This example shows a situation, where choosing the nearest nodes
+% is correct.
+% \fi
+% \ifGERMAN In diesem Fall ist der nächstgelegene Knoten auch der richtige.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \pnode(-0.5,1){A}\pnode(1.5,1){B}\pnode(3.5,1){C}
+ \psset{label=0, optboxwidth=1}
+ \optbox(A)(B){Box1}\optbox(B)(C){Box2}
+ \drawfiber{1}{2}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifENGLISH In this case, the nearest connection is not well defined because
+% two connections have the same length.
+% \fi
+% \ifGERMAN
+% Hier ist der kürzeste Abstand nicht eindeutig definiert, da es zwei
+% Verbindungen mit der gleichen Länge gibt.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,2)
+ \pnode(0,0.5){A}\pnode(3,0.5){B}
+ \pnode([offset=1]B){C}\pnode(A|C){D}
+ \psset{label=0}
+ \optbox(A)(B){Box1}\optbox(C)(D){Box2}
+ \drawfiber{1}{2}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifENGLISH To select the desired connection it is often enough to set either
+% \Lkeyword{startnode} or \Lkeyword{stopnode}. With this you fix one node, the
+% other is the one nearest to it. In rare cases it might be necessary to fix
+% both nodes.
+% \fi
+% \ifGERMAN
+% Um die gewünschte Verbindung zu wählen ist es meistens ausreichend entweder
+% \Lkeyword{startnode} oder \Lkeyword{stopnode} zu setzen. Ist ein Knoten fest
+% vorgegeben, wird der anderen wieder als der mit dem kürzesten Abstand
+% gewählt. Nur in Ausnahmefällen sollte es notwendig sein beide Knoten
+% explizit anzugegeben.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]startnode}]
+\begin{pspicture}(2,2)
+ \pnode(0,0.5){A}\pnode(2,0.5){B}
+ \pnode([offset=1]B){C}\pnode(A|C){D}
+ \psset{label=0}
+ \optbox(A)(B){Box1}\optbox(C)(D){Box2}
+ \drawfiber[startnode=1]{1}{2}
+ \drawfiber[startnode=N, linecolor=black]{1}{2}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifENGLISH Another example where you need to specify the
+% \Lkeyword{startnode}.
+% \fi
+% \ifGERMAN Ein weiteres Beispiel, bei dem \Lkeyword{startnode} vorgegeben
+% werden muss.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]startnode}, caption={caption}, label={ex:nalm}]
+\begin{pspicture}(2.1,3)
+ \pnode(0,0){A}\pnode(2,0){B}
+ \pnode(0.3,3){C}\pnode(1.7,3){D}
+ \psset{fiber=none}
+ \optcoupler[fiber=l,
+ addtoFiberIn1={angleA=0, ArrowInside=->},
+ addtoFiberIn2={angleA=180, arrows=<-},
+ abspos=0.5, compname=Cpl](A)(B)(C)(D)
+ \optfiber[compname=Hnlf, abspos=1](C)(C|A)
+ \optamp[abspos=2, compname=Amp](D|B)(D)
+ \drawfiber{Cpl}{Hnlf}
+ \drawfiber[startnode=1, ncurv=1.2]{Hnlf}{Amp}
+ \drawfiber{Cpl}{Amp}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{enumerate}
+%
+% \ifENGLISH\subsection{Fiber appearance}\fi
+% \ifGERMAN\subsection{Faseraussehen}\fi
+% \label{sec:fiberappearance}
+%
+% \begin{optionlist}
+% \styleitem{Fiber}
+% \ifENGLISH
+% The appearance of fibers is controlled with this style. The optional
+% argument of \Lcs{drawfiber} can be used as well, these options can overwrite
+% settings from the \Lstyle{Fiber} style.
+% \fi
+% \ifGERMAN
+% Das Aussehen der Fasern wird durch diesen Stil vorgegeben. Das optionale
+% Argument von \Lcs{drawfiber} kann ebenfalls verwendet werden, die
+% entsprechenden Parameter können die Einstellungen von \Lstyle{Fiber}
+% überschreiben.
+% \fi
+%
+% \valitem{addtoFiber}{list}
+% \addtostylemsg{Fiber}
+%
+% \valitem{newFiber}{list}
+% \newstylemsg{Fiber}
+%
+% \valitem[curve]{fiberstyle}{string}
+% \ifGERMAN
+% Die Fasern werden in der Regel als \Lcs*{nccurve} gezeichnet, aber eine
+% beliebige andere Knotenverbindung \nxLcs{nc}\prm{string} des
+% \LPack{pst-node} Paketes kann ausgewählt werden, lesen Sie die entsprechende
+% Dokumentation\fnurl{http://mirror.ctan.org/help/Catalogue/entries/pst-node.html}
+% für mögliche Werte. In den folgenden Beispielen werden
+% Anwendungsmöglichkeiten gezeigt, eine weitere ist in
+% \prettyref{ex:transmission-loop} zu sehen.
+% \fi
+% \ifENGLISH
+% The fibers are usually drawn as \Lcs*{nccurve}, but any type of node
+% connection \nxLcs{nc}\prm{string} from \LPack{pst-node} can be selected with
+% this parameter, see the \LPack{pst-node}
+% documentation\fnurl{http://mirror.ctan.org/help/Catalogue/entries/pst-node.html}
+% for possible values. The following examples show possible use cases,
+% \prettyref{ex:transmission-loop} contains another typical use case.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]fiberstyle}]
+\begin{pspicture}(3,3)
+ \pnode(1, 0.5){A}\pnode(2.5,0.5){B}\pnode(2.5,2){C}
+ \psset{optboxsize=1 0.6, innerlabel}
+ \optbox[position=start](A)(B){start}
+ \optbox[position=end](B)(C){stop}
+ \drawfiber[fiberstyle=diag, linearc=0.5]{1}{2}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[morekeywords={[21]fiberstyle}, label={ex:recirc-loop}, caption={caption}]
+\begin{pspicture}(4,2.5)
+ \pnode(1,2.5){In}\pnode(3,2.5){Out}
+ \pnode(0,2){A}\pnode(4,2){B}\pnode(4,0){C}\pnode(0,0){D}
+ \optcoupler[fiber=t, addtoFiber={ArrowInside=->}, coupleralign=b](In)(A)(Out)(B)
+ \psset{fiber=none}
+ \optamp[position=0.35](C)(D)
+ \optfiber[position=0.35](D)(C)
+ \drawfiber{2}{3}
+ \addtopsstyle{Fiber}{fiberstyle=bar, linearc=0.5, armA=1.5}
+ \drawfiber[stopnode=1]{1}{2}
+ \drawfiber[stopnode=1]{1}{3}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{optionlist}
+%
+%
+% \ifENGLISH\subsection{Automatic fiber connections}\fi
+% \ifGERMAN\subsection{Automatische Faserverbindungen}\fi
+% \label{sec:drawfiber-auto}
+%
+% \ifENGLISH
+% All fiber components described in \prettyref{chap:fibercomp} are connected
+% automatically to their reference nodes with \Lcs{drawfiber}, their behaviour
+% is descibed in \prettyref{sec:drawfiber-angles}. The fiber connections can be
+% controlled in a number of ways, without need to explicitely use
+% \Lcs{drawfiber}. The style of each fiber connection can be configure
+% independently, see \prettyref{sec:drawfiber-auto-styles}.
+% \fi
+% \ifGERMAN
+% Alle Faserkomponenten, die in \prettyref{chap:fibercomp} beschrieben werden,
+% werden automatisch mit \Lcs{drawfiber} mit ihren Referenzknoten verbunden, das
+% Verhalten ist in \prettyref{sec:drawfiber-angles} beschrieben. Die
+% automatischen Faserverbindungen können umfangreich kontrolliert werden, ohne
+% explizit \Lcs{drawfiber} zu benutzen. Das Aussehen jeder Verbindung kann
+% ebenfalls separat konfiguriert werden, siehe
+% \prettyref{sec:drawfiber-auto-styles}.
+% \fi
+%
+% \begin{optionlist}
+% \choitem[all]{fiber}{[*+]none,all,i,o,\prm{refpoint}}
+% \ifENGLISH This parameter selects which fiber connections are drawn. The
+% value of this parameter can affect either only the fiber components
+% (if the value is prefixed with \opt{*}), only free-ray components (prefixed
+% with \opt{+}), or all components otherwise. Typical free-ray components
+% which are often used with fibers as well are \Lcs{optbox} and \Lcs{optdetector}.
+%
+% You can select to connect \opt{all} nodes, \opt{none}, or select distinct
+% connections to draw. Value \opt{i} (\opt{l} is equivalent) draws all input
+% fibers, \opt{o} (\opt{r} is equivalent) draws all output fibers. These
+% values are exclusive, that means \opt{io} does not select all fibers, but
+% none.
+%
+% Components which have more than one input or output fiber
+% (\hyperref[sec:coupler]{couplers} and \Lcs{optcirculator}) allow also
+% values \opt{t} and \opt{b}, possibly in combination with \opt{i}, \opt{o},
+% \opt{r}, or \opt{l}.
+%
+% See the following examples for some variants.
+% \fi
+% \ifGERMAN
+% Dieser Parameter gibt an, welche Faserverbindungen gezeichnet werden. Der
+% Parameter kann nur die Faserkomponenten betreffen (falls ein \opt{*}
+% vorangestellt ist), nur die Freistrahlkomponenten (\opt{+} wird
+% vorangestellt), oder alle Komponenten. Typische Freistrahlkomponenten, die
+% häufig als Faserkomponenten verwendet werden, sind \Lcs{optbox} und
+% \Lcs{optdetector}.
+%
+% Es können alle Verbindungen gezeichnet werden (\opt{all}), keine
+% (\opt{none}), oder es können bestimmte ausgewählt werden. Die Werte \opt{i}
+% (\opt{l} ist äquivalent) zeichnet nur die Eingangsfasern, \opt{o}
+% (bzw. \opt{r}) alle ausgehenden Fasern. Diese Angaben sind ausschließend,
+% d.h. mit \opt{io} werden gar keine Verbindungen gezeichnet.
+%
+% Komponenten, die über mehr als einen Eingang oder Ausgang verfügen
+% (\hyperref[sec:coupler]{Koppler} und \Lcs{optcirculator}) erlauben
+% weitergehende Auswahl mit \opt{t} und \opt{b}, möglicherweise in Verbindung
+% mit \opt{i}, \opt{o}, \opt{l} und \opt{r}.
+%
+% Die folgenden Beispiele zeigen einige Möglichkeiten.
+% \fi
+% \end{optionlist}
+%
+% \begin{enumerate}
+% \item
+% \ifENGLISH Enable all fiber connections for all components.\fi
+% \ifGERMAN Zeichne alle Fasern für alle Komponenten.\fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{fiber}}]
+\begin{pspicture}(3,2)
+ \psset{fiber}
+ \optbox(0,1.5)(3,1.5)
+ \optmzm(0,0.5)(3,0.5)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifENGLISH Draw only the input fiber of a fiber component (\Lcs{optmzm}),
+% the free-ray component (\Lcs{optbox}) is not affected.
+% \fi
+% \ifGERMAN Nur die Eingangsverbindung einer Faserkomponente (\Lcs{optmzm})
+% wird gezeichnet, die Freistrahlkomponente (\Lcs{optbox}) bleibt
+% unbeeinflusst.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{fiber}}]
+\begin{pspicture}(3,2)
+ \psset{fiber=*i}
+ \optbox(0,1.5)(3,1.5)
+ \optmzm(0,0.5)(3,0.5)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifENGLISH Draw only the output fiber of a free-ray component
+% (\Lcs{optbox}), but all connections of the fiber component (\Lcs{optmzm}).
+% \fi
+% \ifGERMAN Von der Freistahlkomponente wird nur die Ausgangsverbindung
+% gezeichnet, die Faserkomponente erhält jedoch alle Verbindungen.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{fiber}}]
+\begin{pspicture}(3,2)
+ \psset{fiber=+o}
+ \optbox(0,1.5)(3,1.5)
+ \optmzm(0,0.5)(3,0.5)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \item
+% \ifENGLISH The values \opt{t} and \opt{b} affect only components which have
+% more than two fibers, i.e \Lcs{optcirculator} and the couplers
+% (\prettyref{sec:coupler}).
+% \fi
+% \ifGERMAN
+% Die Werte \opt{t} und \opt{b} betreffen nur die Komponenten mit mehr als
+% zwei Verbindungen, also \Lcs{optcirculator} und die Koppler
+% (\prettyref{sec:coupler}).
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{fiber}}]
+\begin{pspicture}(3,1)
+ \optcoupler[fiber=t](0,1)(0,0)(3,1)(3,0)
+\end{pspicture}
+\end{LTXexample}
+\begin{LTXexample}[morekeywords={[21]{fiber}}]
+\begin{pspicture}(3,1)
+ \wdmsplitter[fiber=br](0,0.5)(3,1)(3,0)
+\end{pspicture}
+\end{LTXexample}
+\begin{LTXexample}[morekeywords={[21]{fiber}}]
+\begin{pspicture}(3,1)
+ \optcirculator[fiber=b](0,0.5)(3,1)(1,0)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{enumerate}
+%
+%
+% \ifENGLISH\subsection{Appearance of automatic fiber connections}\fi
+% \ifGERMAN\subsection{Aussehen der automatischen Faserverbindungen}\fi
+% \label{sec:drawfiber-auto-styles}
+%
+% \begin{figure}\centering
+% \begin{pspicture}(0,-0.2)(12,4.4)
+% \rput[lt](0,4.4){%
+% \pstree[levelsep=1.5cm, treesep=0.6,
+% nodesep=4pt, arrows=<-,
+% arrowinset=0, arrowscale=1.5]{\poeTR{Fiber}}{%
+% \pstree{\poeTR{FiberIn}}{%
+% \poeTR{FiberIn1} \poeTR{FiberIn2}%
+% }%
+% \pstree{\poeTR{FiberOut}}{%
+% \poeTR{FiberOut1} \poeTR{FiberOut2}%
+% }%
+% }%
+% \rput[l](-1,0|T-0){\ifGERMAN Grundstil\fi\ifENGLISH parent style\fi}
+% \rput[l](-1,0|T-0-0){%
+% \ifGERMAN
+% \parbox{\widthof{ausgehende Fasern}}{%
+% \RaggedRight eingehende und ausgehende Fasern}%
+% \fi
+% \ifENGLISH
+% \parbox{\widthof{outgoing fibers}}{%
+% \RaggedRight incoming and outgoing fibers}%
+% \fi
+% }
+% \rput[t](! \psGetNodeCenter{T-0-0-0} \psGetNodeCenter{T-0-0-1}
+% T-0-0-0.x T-0-0-1.x add 2 div T-0-0-0.y 0.4 sub){%
+% \ifGERMAN
+% \parbox{\widthof{Obere(1) oder untere(2)}}{%
+% \RaggedRight Obere(1) oder untere(2) eingehende Faser.}%
+% \fi
+% \ifENGLISH
+% \parbox{\widthof{Upper(1) or lower(2)}}{%
+% \RaggedRight Upper(1) or lower(2) incoming fiber.}%
+% \fi
+% }
+% \rput[t](! \psGetNodeCenter{T-0-1-0} \psGetNodeCenter{T-0-1-1}
+% T-0-1-0.x T-0-1-1.x add 2 div T-0-1-0.y 0.4 sub){%
+% \ifGERMAN
+% \parbox{\widthof{Obere(1) oder untere(2)}}{%
+% \RaggedRight Obere(1) oder untere(2) ausgehende Faser.}%
+% \fi
+% \ifENGLISH
+% \parbox{\widthof{Upper(1) or lower(2)}}{%
+% \RaggedRight Upper(1) or lower(2) outgoing fiber.}%
+% \fi
+% }
+% }%
+% \end{pspicture}
+% \ifGERMAN
+% \caption{Vererbungsdiagramm der PS-Stile für die automatischen
+% Faserverbindungen. Sie sollten diese Stile mit \protect\Lcs*{addtopsstyle}
+% oder den entsprechenden \opt{addto}\prm{style} Parametern ändern um die
+% Vererbungslinie beizubehalten.}%
+% \fi
+% \ifENGLISH
+% \caption{Inheritance diagram for the psstyles used for the automatic fiber
+% connections. These styles should be changed with \protect\Lcs*{addtopsstyle}
+% or the respective \opt{addto}\prm{style} options to preserve the
+% inheritance.}%
+% \fi
+% \label{fig:fiberstyles}
+% \end{figure}
+%
+% \ifENGLISH
+% The styles of all automatic fiber connections can be configured independently,
+% they are all derived from the basic \Lstyle{Fiber} style which is described in
+% \prettyref{sec:fiberappearance}.
+% \fi
+% \ifGERMAN
+% Die Stile aller automatischen Faserverbindungen können separat konfiguriert
+% werden, der zugrundeliegende Stil ist immer \Lstyle{Fiber}, der in
+% \prettyref{sec:fiberappearance} beschrieben ist.
+% \fi
+%
+% \begin{stylelist}
+% \item[\smash{%
+% \begin{tabular}[t]{@{}r@{}}%
+% \opt{FiberIn}\\
+% \opt{FiberIn1}\\
+% \opt{FiberIn2}\\
+% \opt{FiberOut}\\
+% \opt{FiberOut1}\\
+% \opt{FiberOut2}
+% \end{tabular}}%
+% ]%
+% \xLstyle{FiberIn}\label{prm:FiberIn}%
+% \xLstyle{FiberIn1}\label{prm:FiberIn1}%
+% \xLstyle{FiberIn2}\label{prm:FiberIn2}%
+% \xLstyle{FiberOut}\label{prm:FiberOut}%
+% \xLstyle{FiberOut1}\label{prm:FiberOut1}%
+% \xLstyle{FiberOut2}\label{prm:FiberOut2}%
+% \ifENGLISH
+% Style \Lstyle{FiberIn} applies to all input fibers, it inherits from
+% \Lstyle{Fiber}. If the component has more than one input fiber they have the
+% styles \Lstyle{FiberIn1} and \Lstyle{FiberIn2} which inherit from
+% \Lstyle{FiberIn}. All output fibers have the style \Lstyle{FiberOut}, two
+% output fibers have the styles \Lstyle{FiberOut1} and \Lstyle{FiberOut2} which
+% inherit from \Lstyle{FiberOut}. See \prettyref{fig:fiberstyles} for an
+% inheritance diagram of the styles. You must have in mind, that this
+% inheritance is effective only if you use \Lcs*{addtopsstyle} to change the
+% styles (see also below).
+% \fi
+% \ifGERMAN
+% Der Stil \Lstyle{FiberIn} bezieht sich auf alle Eingangsfasern und erbt alle
+% Eigenschaften von \Lstyle{Fiber}. Hat eine Komponente zwei davon, so können
+% diese mit \Lstyle{FiberIn1} und \Lstyle{FiberIn2} angesprochen werden, die
+% alles von \Lstyle{FiberIn} übernehmen. Entsprechend bezieht sich
+% \Lstyle{FiberOut} auf alle Ausgangsfasern, falls es davon zwei gibt dann
+% können diese mit \Lstyle{FiberOut1} und \Lstyle{FiberOut2} geändert
+% werden. Siehe \prettyref{fig:fiberstyles} für ein Vererbungsdiagramm der
+% Faserstile. Beachten Sie, dass diese Vererbung nur erhalten bleibt, falls die
+% Stile nur mit \Lcs*{addtopsstyle} oder den entsprechenden
+% \opt{addto}\prm{style} Parametern verändert werden.
+% \fi
+%
+% \item[\smash{\begin{tabular}[t]{@{}r@{}}%
+% \opt{new}\prm{style}\\
+% \opt{addto}\prm{style}
+% \end{tabular}}]
+% \xLkeyword{newFiberIn}\xLkeyword{addtoFiberIn}
+% \xLkeyword{newFiberIn1}\xLkeyword{addtoFiberIn1}
+% \xLkeyword{newFiberIn2}\xLkeyword{addtoFiberIn2}
+% \xLkeyword{newFiberOut}\xLkeyword{addtoFiberOut}
+% \xLkeyword{newFiberOut1}\xLkeyword{addtoFiberOut1}
+% \xLkeyword{newFiberOut2}\xLkeyword{addtoFiberOut2}
+% \ifENGLISH For every style two appropriate keys \opt{new}\prm{style} and
+% \opt{addto}\prm{style} are provided which can be used to change the styles
+% for single objects. This can be used to define own components
+% (\prettyref{sec:customcomp}) with respectively changed fiber connections or
+% to avoid explicit grouping.
+% \fi
+% \ifGERMAN Für jeden Faserstil werden zwei Parameter \opt{new}\prm{style} und
+% \opt{addto}\prm{style} bereitgestellt, mit denen die Stile für einzelne
+% Komponenten verändert werden können. Damit können neuen Komponenten mit
+% anderen voreingestellten Faserverbindungen definiert werden
+% (\prettyref{sec:customcomp}), oder explizite Gruppierung kann vermieden
+% werden.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{addtoFiberOut1}}]
+\begin{pspicture}(3,2)
+ \newpsobject{tapcoupler}{wdmsplitter}{%
+ coupleralign=b,
+ addtoFiberOut1={arrows=->, arrowscale=1.2, arrowinset=0}}
+ \tapcoupler(0,0.5)(3,1.5)(3,0.5){99/1}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{stylelist}
+%
+%
+% \ifGERMAN\section{Zeichenebenen}\fi
+% \ifENGLISH\section{Layers}\fi
+% \label{sec:layers}
+%
+% \ifENGLISH
+% The necessary order of constructing a drawing is to define the components
+% first before you can connect them. This implies that all connections are drawn
+% on top of the components, which might be unwanted.
+%
+% To circumvent this, we provide the \Lenv{optexp} environment, inside which all
+% connections are drawn behind the components.
+% \fi
+% \ifGERMAN
+% Die Reihenfolge der Konstruktion einer Skizze ist die, dass zuerst die
+% Komponenten definiert werden müssen, bevor diese verbunden werden können. Das
+% beinhaltet aber, dass alle Verbindungen über die Komponenten gezeichnet
+% werden, was nicht erwünscht sein muss.
+%
+% Um das zu vermeiden, wird die \Lenv{optexp}-Umgebung bereitgestellt, innerhalb
+% derer alle Verbindungen hinter die Komponenten gelegt werden.
+% \fi
+%
+% \begin{ltxsyntax}
+% \envitem{optexp}
+% \end{ltxsyntax}
+%
+% \iffalse
+%<*ignore>
+% \fi
+\ifENGLISH
+\begin{LTXexample}
+\begin{pspicture}(3,4)
+ \psset{beam, fillstyle=solid, fillcolor=black}
+ \optbox(0,3.5)(3,3.5){no layers}
+ \begin{optexp}
+ \optbox(0,1.5)(3,1.5){with layers}
+ \end{optexp}
+\end{pspicture}
+\end{LTXexample}
+\fi
+\ifGERMAN
+\begin{LTXexample}
+\begin{pspicture}(3,4)
+ \psset{beam, fillstyle=solid, fillcolor=black}
+ \optbox(0,3.5)(3,3.5){ohne Ebenen}
+ \begin{optexp}
+ \optbox(0,1.5)(3,1.5){mit Ebenen}
+ \end{optexp}
+\end{pspicture}
+\end{LTXexample}
+\fi
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifENGLISH
+% Beware, that this is achieved by executing twice all code included in the
+% environment. This works fine for all \LPack{pst-optexp} commands which take
+% care of not drawing stuff twice but only in a changed order. All other text
+% and graphics are drawn twice which leads to ugly results because of altered
+% anti-aliasing in the viewer.
+%
+% To avoid this, you can either move all other code outside the environment, or
+% use the following two commands to define code parts which are executed only
+% once.
+% \fi
+% \ifGERMAN
+% Beachten Sie, dass das erreicht wird, indem der gesamte Code innerhalb der
+% Umgebung doppelt ausgeführt wird. Das funktioniert mit allen
+% \LPack{pst-optexp}-Makros, da diese sich intern darum kümmern nichts doppelt
+% sondern nur in geänderter Reihenfolge zu zeichnen. Alle anderen Zeichnungen
+% und Texte werden zweimal gezeichnet, was zu unschönen Ergebnissen aufgrund
+% von geändertem Antialiasing in dem Betrachter führen kann.
+%
+% Um zu verhindern, dass anderer Code doppelt ausgeführt wird, muss dieser
+% entweder außerhalb der \Lenv{optexp}-Umgebung definiert werden, oder durch
+% eins der beiden folgenden Makros auf eine Ebene beschränkt werden.
+% \fi
+%
+% \begin{ltxsyntax}
+% \cmditem{backlayer}{code}
+%
+% \ifENGLISH Execute \prm{code} only once in the first pass.\fi
+% \ifGERMAN Führe \prm{code} nur beim ersten Durchgang aus.\fi
+%
+% \cmditem{frontlayer}{code}
+%
+% \ifENGLISH Execute \prm{code} only once in the second pass.\fi
+% \ifGERMAN Führe \prm{code} nur beim zweiten Durchgang aus.\fi
+% \end{ltxsyntax}
+%
+% \ifENGLISH
+% In this example, the text is put on top of the frame although the text is
+% defined first:
+% \fi
+% \ifGERMAN In diesem Beispiel wird der Text über dem Rechteck angezeigt, obwohl
+% der Text zuerst definiert wird:
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,1)
+\begin{optexp}
+ \frontlayer{\rput(1.5,0.5){front}}
+ \backlayer{\psframe*[linecolor=DOrange!50](1,0)(2,1)}
+\end{optexp}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+%
+% \ifGERMAN\chapter{Benutzerdefinierte Komponenten}\fi
+% \ifENGLISH\chapter{Custom components}\fi
+% \label{chap:custom}
+%
+% \ifGERMAN
+% Das \LPack{pst-optexp}-Paket stellt zwei Makros zur Verfügung um
+% eigene Komponenten zu zeichnen. Diese können z.B. aus Bildern oder
+% eigenen Zeichnungen bestehen.
+% \fi
+% \ifENGLISH
+% The \nxLPack{pst-optexp} package provides two commands which can use
+% anything as optical components. This includes e.g. external images or
+% your own drawings.
+% \fi
+%
+% \begin{ltxsyntax}
+% \dipoledesc{optdipole}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,3)
+ \optdipole[labeloffset=1, beam](0,2)(3,1){%
+ \rput(0,0){\rule{0.5cm}{1cm}}%
+ }{label}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \tripoledesc{opttripole}
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(3,3)
+ \opttripole[beam](3,1.5)(1.5,2)(0,0){%
+ \rput[b](0,0){text}%
+ }{label}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+% \end{ltxsyntax}
+%
+% \ifENGLISH
+% These components can also be connected with beams and fibers, but do not
+% provide full access to all options. They define only a single interface which,
+% of course, cannot respect the geometry of the individual drawings.
+% \fi
+% \ifGERMAN
+% Diese Komponenten können sowohl mit Fasern als auch mit Strahlen verbunden
+% werden, können aber nicht deren volles Potential ausschöpfen. Sie haben nur
+% eine einzelne Grenzfläche, die die Geometrie der benutzerdefinierten Zeichnung
+% natürlich nicht berücksichtigen kann.
+% \fi
+%
+% \ifGERMAN
+% \section{Benutzerdefinierte Version existierender Komponenten}
+% \fi
+% \ifENGLISH
+% \section{Customized versions of existing components}
+% \fi
+% \label{sec:customcomp}
+%
+% \ifENGLISH
+% You can define a customized version of an existing component using the
+% \Lcs*{newpsobject} macro. With this you can define a new component using
+% predefined objects with a set of options. These options serve only as default
+% values and can be overridden when calling the macro.
+% \fi
+% \ifGERMAN
+% Sie können eine benutzerdefinierte Version einer existierenden Komponente mit
+% \Lcs*{newpsobject} definieren, die z.B. andere Voreinstellungen oder und ein
+% anderes Aussehen hat.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{newpsobject}}]
+\begin{pspicture}(3,1.7)
+\newpsobject{sbn}{crystal}{%
+ voltage, lamp, %
+ fillstyle=solid, fillcolor=yellow!90!black}
+\sbn[label=1.2 45, beam](0,1)(3,1){SBN:Ce}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[morekeywords={[21]{newpsobject}}]
+\begin{pspicture}(3,1.7)
+\newpsobject{pumpcoupler}{wdmcoupler}{%
+ coupleralign=top, addtoFiberIn2={ArrowInside=->, arrowscale=2}}
+\pumpcoupler[label=0.5 180](0,1)(0,0)(3,1){Pumpcoupler}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[pos=t, morekeywords={[21]{newpsobject}}, caption={caption}]
+\begin{pspicture}(10,2)
+ \newpsobject{MOLensIn}{lens}{lens=0.5 0.5 0.5}
+ \newpsobject{MOLensOut}{lens}{lens=1.5 1.5 1.5}
+ \pnode(0,1){A}\pnode(10,1){B}
+ \MOLensIn[abspos=1](A)(B)\MOLensOut[abspos=2](A)(B)
+ \optplate[plateheight=1.5](A)(B)
+ \MOLensOut[abspos=8](A)(B)\MOLensIn[abspos=9](A)(B)
+ \addtopsstyle{Beam}{n=1, fillstyle=solid, fillcolor=green, opacity=0.3}
+ \psset{loadbeampoints}
+ \drawwidebeam[beamwidth=0.2, stopinside]{(A)}{1}
+ \drawwidebeam[beamdiv=-70]{1}{2}
+ \drawwidebeam[stopinside]{2-4}
+ \drawwidebeam[beamdiv=-70]{4}{5}
+ \drawwidebeam{5}{(B)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifENGLISH\section{Defining new objects}\fi
+% \ifGERMAN\section{Neue Objekte definieren}\fi
+% \label{sec:newobj}
+%
+% \ifENGLISH
+% \nxLPack{pst-optexp} provides some high-level macros to allow very convenient
+% definition of your own custom components.
+%
+% Note, that this part of the documentation is not complete. It roughly
+% describes the steps to define own components as of version 3.0. Some parts may
+% be subject to change which are not backward compatible.
+%
+% The old syntax of defining \Lcs*{mycomp@iii} is supported for backward
+% compatibility, but will be dropped soon. Please adapt your macros to the new
+% syntax.
+% \fi
+% \ifGERMAN
+% \nxLPack{pst-optexp} stellt einige Benutzermakros zur Verfügung, mit denen
+% sehr bequem neue, eigene Komponenten definiert werden können.
+%
+% Beachten Sie, dass dieser Teil der Dokumentation nicht vollständig ist. Die
+% notwendigen Schritte zur Definition neuer Komponenten in Version 3.0 werden
+% grob beschrieben, können sich aber noch ändern und sind nicht zwangsläufig
+% abwärtskompatibel.
+%
+% The alte Syntax mit \Lcs*{mycomp@iii} wird noch unterstützt, gilt aber als
+% veraltet und wird in zukünftigen Versionen entfernt werden. Bitte passen Sie
+% ihre vorhandenen Makros entsprechen an.
+% \fi
+%
+% \begin{ltxsyntax}
+% \xLcs{newOptexpDipole}\cmditem{newOptexpDipole}[fixopt]{name}{dftopt}
+% \xLcs{newOptexpTripole}\cmditem{newOptexpTripole}[fixopt]{name}{dftopt}
+% \xLcs{newOptexpFiberDipole}\cmditem{newOptexpFiberDipole}[fixopt]{name}{dftopt}
+% \end{ltxsyntax}
+%
+% \ifENGLISH
+% These macros generate all organizing code for the components which handle the
+% positioning, label placement, rotation and shifting, and the layering. In the
+% simplest case you only have to define the actual drawing of the component
+% outline.
+%
+% The macro \Lcs*{newOptexpDipoleNolabel} is superfluous because since version
+% 3.0 the label is optional for all components.
+%
+% The actual process of creating a new component is split up in different parts,
+% depending on the component complexity and user requirements:
+% \begin{enumerate}
+% \item The component drawing (see \prettyref{sec:newobj-comp}), this is the
+% only required part.
+% \item Support for raytracing and layers (optional)
+% \item Optional support for \Lkeyword{rotateref}, \Lkeyword{extnode} and
+% \Lkeyword{position}\opt{=start|end}.
+% \end{enumerate}
+% \fi
+% \ifGERMAN
+% Diese Makros erzeugen den Code für die Positionierung, Drehung, Beschriftung
+% und die Ebenenverwaltung. Im einfachsten Fall müssen Sie lediglich die
+% eigentliche Zeichnung der Komponente erstellen.
+%
+% Seit Version 3.0 ist das Makro \Lcs*{newOptexpDipoleNolabel} überflüssig, da
+% seitdem die Beschriftung für alle Komponenten optional ist.
+%
+% Die Definition der neuen Komponenten kann in unterschiedliche Schritte
+% eingeteilt werden, je nach Komplexität und Anforderung des Benutzers:
+%
+% \begin{enumerate}
+% \item Die Zeichnung (siehe \prettyref{sec:newobj-comp}), das ist der einzige
+% erforderliche Schritt.
+% \item Unterstützung von Raytracing und Ebenen (optional).
+% \item Unterstützung für \Lkeyword{rotateref}, \Lkeyword{extnode} und
+% \Lkeyword{position}\opt{=start|end}.
+% \end{enumerate}
+% \fi
+%
+% \ifENGLISH\subsection{The component drawing}\fi
+% \ifGERMAN\subsection{Die Zeichnung der Komponente}\fi
+% \label{sec:newobj-comp}
+%
+% \ifENGLISH
+% You must define a macro which is called e.g. \cs{\ldots @comp}, which
+% contains the component drawings. See the following two examples for dipole and
+% tripole which show the orientation and position of the component coordinate
+% system.
+% \fi
+% \ifGERMAN Sie müssen ein Makro \cs{\ldots @comp} definieren, welches
+% die Zeichnung enthält. In den folgenden Beispielen sehen Sie die Ausrichtung
+% und Position des Koordinatensystems für einen Zweipol und einen Dreipol.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]{newOptexpDipole}}]
+\begin{pspicture}(3.5,2.6)
+\newOptexpDipole{mydipole}{}
+\makeatletter
+\def\mydipole@comp{%
+ \psaxes[arrows=->](0,0)(0,-1.1)(1.3,1.3)[$x$,90][$y$,0]
+}%
+\makeatother
+\mydipole(0,1)(3.5,1){\color{spot}label}
+\drawbeam{(0,1)}{}{(3.5,1)}
+\end{pspicture}
+\end{LTXexample}
+\begin{LTXexample}[morekeywords={[21]{newOptexpTripole}}]
+\begin{pspicture}(3.5,3.7)
+\newOptexpTripole{mytripole}{labelangle=-60}
+\makeatletter
+\def\mytripole@comp{%
+ \psaxes[arrows=->](0,0)(-1.1,0)(1.3,1.3)[$x$,90][$y$,0]
+}%
+\makeatother
+\mytripole(0,1)(2,1.7)(3,0){\color{spot}label}
+\drawbeam{(0,1)}{}{(3,0)}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifGERMAN
+% \chapter{Beispiele}
+% \fi
+% \ifENGLISH
+% \chapter{Examples}
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\enlargethispage{1.5cm}
+\begin{LTXexample}[pos=t, caption={caption}]
+\begin{pspicture}(0.1,0.4)(10,4.5)
+ \psset[optexp]{lens=1 1 0.7, loadbeampoints}
+ \pnode(2,4){L}\pnode([Xnodesep=4]L){M}
+ \pnode([Xnodesep=1.5]M){IRSpec}\pnode([offset=-2.5]M){OSA}
+ \begin{optexp}
+ \optbox[position=start, innerlabel, optboxwidth=1.8](L)(M){fs laser}
+ \lens[abspos=1](L)(M)
+ \optbox[abspos=1.85, optboxsize=0.7 0.15, fillstyle=solid, fillcolor=black](L)(M){sample}
+ \lens[abspos=2.7](L)(M)
+ \mirror[labelangle=45](L)(M)(OSA){flip mirror}
+ \optbox[position=end, optboxsize=3.2 1, innerlabel, compshift=-0.2](M)(IRSpec){IR spectrometer}
+ \lens[abspos=1](M)(OSA)
+ \optplane([offset=-1.5]M)
+ \optfiber[fiberloopradius=0.2, fiberloopsep=0.2, label=1, newFiber={linewidth=1.5\pslinewidth}]([offset=-1.5]M)(OSA){MM fiber}
+ \optbox[position=end, innerlabel, optboxwidth=1.1](M)(OSA){OSA}
+ \newpsstyle{Beam}{linestyle=none, fillcolor=red, fillstyle=solid, raytrace=false}
+ \drawwidebeam[beamwidth=0.2, stopinside]{1-2}
+ \drawwidebeam[beamdiv=-25]{2-3}
+ \drawwidebeam[loadbeampoints=false, beamdiv=25]{3-4}
+ \drawwidebeam[startinside]{4-5}
+ \drawwidebeam[savebeampoints=false, beamalign=abs]{5-6}
+ \drawwidebeam[stopinside]{5}{7}
+ \drawwidebeam[beamdiv=-25]{7-8}
+\end{optexp}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[pos=t, caption={caption}]
+\begin{pspicture}(-4.2,-1)(3,3)
+\pnode(-2,0){LOut}\pnode(0,0){Grat}\pnode(4;45){Out}\pnode(2.5;70){Mvar}
+\newpsstyle{Beam}{linewidth=2\pslinewidth, linecolor=red!90!black}
+\begin{optexp}
+ \optbox[optboxwidth=2.2, labeloffset=0, position=start](LOut)(Grat){diode laser}
+ \mirror[variable, label=0.5](Grat)(Mvar)(Grat){M$_\mathrm{var}$}
+ \optretplate[position=0.3](LOut)(Grat){$\nicefrac{\lambda}{4}$}
+ \optgrating(LOut)(Grat)(Out){grating}
+ \drawbeam[arrows=->]{1}{3}{4}{(Out)}
+ \drawbeam{2}{4}
+\end{optexp}
+\rput[l](-3,2){Littman setup}
+\end{pspicture}
+\end{LTXexample}
+\bigskip
+
+\begin{LTXexample}[pos=t, caption={caption}]
+\begin{pspicture}(8.5,1.9)
+\pnode(1.4,1.3){Laser}\pnode(7.6,1.3){Diode}
+\optbox[position=start, labeloffset=0](Laser)(Diode){Laser}%
+\optbox[abspos=4, optboxsize=1 0.6, labeloffset=1, n=3,
+ compname=PC, angle=-10, rotateref=l](Laser)(Diode){Photonic Crystal}
+\optdetector[dettype=diode](\oenodeOut{PC})(Diode|\oenodeOut{PC}){PD}
+\nodexn{(\oenodeIn{PC}) + (2;170)}{Angle1}
+\psline[linestyle=dashed](\oenodeIn{PC})(Angle1)
+\psarc{<->}(\oenodeIn{PC}){1.3}{330}{30}
+\psarc[arcsep=1pt]{<->}(\oenodeIn{PC}){2}{170}{180}
+\uput{2.1}[175](\oenodeIn{PC}){\small $\varphi$}
+\drawbeam{-}
+\end{pspicture}
+\end{LTXexample}
+\bigskip
+
+\enlargethispage{2cm}
+\begin{LTXexample}[pos=t, caption={caption}]
+\begin{pspicture}(10.4,1.7)
+\pnode(1.2,1){Start}\pnode(9.2,1){CCD}
+\begin{optexp}
+\optbox[position=end, label=0, optboxwidth=1.2](CCD)(Start){Laser}
+\optbox[position=end, label=0, optboxwidth=1.2](Start)(CCD){CCD}
+\polarization[poltype=perp,abspos=0.5](Start)(CCD)
+\optretplate[abspos=1](Start)(CCD){$\nicefrac{\lambda}{2}$}
+\lens[lens=0.4 0.4 0.5,abspos=2](Start)(CCD){$L_1$}
+\lens[abspos=4](Start)(CCD){$L_2$}
+\optplate[abspos=6, platelinewidth=3\pslinewidth](Start)(CCD){SLM}
+\optplate[abspos=6.5, labelangle=180](Start)(CCD){PF}
+\polarization[abspos=6.7](Start)(CCD)
+\lens[abspos=7](Start)(CCD){$L_3$}
+\drawbeam[linewidth=2\pslinewidth]{1}{2}
+\end{optexp}
+\end{pspicture}
+\end{LTXexample}
+\medskip
+
+\begin{LTXexample}[pos=t, caption={caption}]
+\begin{pspicture}(10.4,1.7)
+\pnode(1.2,1){Start}\pnode(9.2,1){CCD}
+\begin{optexp}
+\optbox[position=start, label=0, optboxwidth=1.2](Start)(CCD){Laser}
+\polarization[poltype=perp,abspos=0.5](Start)(CCD)
+\optretplate[abspos=1](Start)(CCD){$\nicefrac{\lambda}{2}$}
+\lens[lens=0.4 0.4 0.5,abspos=2](Start)(CCD){$L_1$}
+\pinhole[phwidth=0.05, abspos=2.35, labelangle=180](Start)(CCD){iris}
+\lens[abspos=4](Start)(CCD){$L_2$}
+\optplate[abspos=6,platelinewidth=3\pslinewidth](Start)(CCD){SLM}
+\optplate[abspos=6.5,labelangle=180](Start)(CCD){PF}
+\lens[abspos=7](Start)(CCD){$L_3$}
+\optbox[position=end, label=0, optboxwidth=1.2](Start)(CCD){CCD}
+\polarization[abspos=6.7, polsize=0.8](Start)(CCD)
+\addtopsstyle{Beam}{fillstyle=solid, fillcolor=green!40!white, loadbeampoints}
+\drawwidebeam[beamwidth=0.1, stopinside]{1}{4}
+\drawwidebeam[beamdiv=-20]{4}{6}
+\drawwidebeam[stopinside]{6-9}
+\drawwidebeam[beamdiv=-30]{9-10}
+\end{optexp}
+\end{pspicture}
+\end{LTXexample}
+\bigskip
+
+%^^A An idea from <http://arxiv.org/abs/1112.5270>
+\enlargethispage{3cm}
+\begin{LTXexample}[pos=t, caption={caption}]
+\begin{pspicture}(0.3,0.6)(5.5,7.8)
+\newOptexpTripole{reflslm}{}
+\makeatletter
+\def\reflslm@comp{%
+ \psframe[fillstyle=solid,fillcolor=gray!50](-0.3,0)(0.3,0.2)
+ \psline(-0.3,0.1)(-0.5,0.1)(-0.5,0.5)(0.5,0.5)(0.5,0.1)(0.3,0.1)}%
+\makeatother
+\pnode(2,7){L}\pnode(2,5.8){Pbs}\pnode([Xnodesep=1]Pbs){Blk1}\pnode(2,2.3){Bs}
+\pnode([Xnodesep=-1]Bs){Blk2}\pnode([Xnodesep=3.5]Bs){Out}\pnode(2,1.3){Slm}
+\begin{optexp}
+ \optbox[position=end, innerlabel, optboxsize=1.2 0.6](Pbs)(L){Laser}
+ \psset{labelalign=r, mirrortype=extended}
+ \newpsstyle{ExtendedMirror}{fillstyle=solid, fillcolor=black}
+ \optretplate[position=0.4](L)(Pbs){HWP}
+ \beamsplitter[labelangle=-90](L)(Pbs)(Blk1){PBS}
+ \mirror[label=. -90 c](Pbs)(Blk1)(Pbs){B}
+ \lens[abspos=0.8, lens=0.7 0.7 0.7, n=2](Pbs)(Bs){MO}
+ \pinhole[phwidth=0.15, abspos=1.2](Pbs)(Bs){PH}
+ \lens[abspos=2.6, lensradius=1.4](Pbs)(Bs){L}
+ \psset{labelalign=c}
+ \beamsplitter[labelangle=-135](Pbs)(Bs)(Blk2){BS}
+ \mirror[labeloffset=0.4](Bs)(Blk2)(Bs){B}
+ \lens[abspos=1, lensradius=1.4](Bs)(Out){L}
+ \lens[abspos=2.8, lens=0.7 0.7 0.7, n=2](Bs)(Out){L}
+ \reflslm(Bs)(Slm)(Bs){SLM}
+ \addtopsstyle{Beam}{linestyle=none, fillstyle=solid, fillcolor=green!70!black}
+ \drawwidebeam[beamwidth=0.1]{1-4}
+ \drawwidebeam[beamwidth=0.1, beaminsidefirst, beaminsidelast]{3}{5-8}
+ \psset{savebeampoints=false, loadbeampoints}
+ \drawwidebeam{8-11}{(Out)}\drawwidebeam[beaminsidefirst]{8}{12}
+\end{optexp}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[pos=t, caption={caption}]
+\begin{pspicture}(6.4,3.2)
+\addtopsstyle{Fiber}{linecolor=red}\psset{fiber=none}
+\pnode(2.3,2.3){Lin}\pnode([Xnodesep=4.5]Lin){Det}
+\optbox[label=0.2, position=start, compname=L, extnode=b](Lin)(Det){%
+ \psGauss[yunit=0.03,sigma=0.03]{-0.5}{0.5}}
+\optbox[label=0, compname=EAM, extnode=b, abspos=1.5](Lin)(Det){EAM}
+\optfiber[labeloffset=0.3, abspos=3.2](Lin)(Det){fibre}
+\optdetector(Lin)(Det){OSA}
+\pnode([Xnodesep=-1,offset=-1]\oenodeExt{L}){Osc}
+\pnode(\oenodeExt{L}|Osc){PSin}\pnode(\oenodeExt{EAM}|Osc){PSout}
+\oscillator[output=right](Osc){10\,GHz}{}
+\phaseshifter[arrowscale=1.5, inputarrow, labeloffset=-0.7](PSin)(PSout){$\tau$}
+\drawfiber{1}{2}{3}{4}
+\psset{arrows=->, arrowinset=0, arrowscale=1.5}
+\wire(PSin)(\oenodeExt{L})\wire(PSout)(\oenodeExt{EAM})
+\end{pspicture}
+\end{LTXexample}
+
+\enlargethispage{1cm}
+\begin{LTXexample}[pos=t, caption={caption}]
+\begin{pspicture}(0.4,0.6)(8.2,3.5)
+\pnode(2,3){Laser}\pnode(2,1){PwMeter}\pnode(6,3){CplTop}\pnode(6,1){CplBot}
+\psset{arrowscale=1.5, arrowinset=0}
+\optbox[position=start, optboxsize=1.6 1, labeloffset=0](Laser)([Xnodesep=0.1]Laser){%
+ \begin{tabular}{@{}c@{}}Nd:YAG\\[-0.4ex]cw laser\end{tabular}}
+\optcoupler[addtoFiberIn1={ArrowInside=->}, addtoFiberIn2={ArrowInside=-<},
+ labeloffset=0.4](Laser)(PwMeter)(CplTop)(CplBot){WDM}
+\optfiber[addtoFiberOut={ncurv=1, angleB=0}, addtoFiberIn={ncurv=1, angleA=0},
+ compshift=-1, label=0.2 . l](CplBot)(CplTop){fiber}
+\optdetector[dettype=diode]([Xnodesep=0.1]PwMeter)(PwMeter){power meter}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[pos=t, caption={caption}]
+\begin{pspicture}(0.9,0.9)(10.4,5.9)
+\psset{arrowscale=1.5, arrowinset=0}
+\pnode(2,5){PC1in}\pnode(4,5){PC1out}\pnode(6,5){PC2in}
+\pnode(8,5){PC2out}\pnode(2,2){CplSig}\pnode(5,2){CplIn}
+\pnode(2,1){CplOut}\pnode(10,4.5){Pump}\pnode(8,2){PumpSig}
+\optisolator[compshift=0.8, addtoFiberIn={angleA=180},
+ addtoFiberOut={angleB=180}, label=0.5 . l]%
+ (CplSig)(PC1in){isolator}
+\polcontrol[addtoFiberIn={arrows=|-}](PC1in)(PC1out)
+\optfiberpolarizer[labeloffset=0.6](PC1out)(PC2in){polarizer}
+\polcontrol[addtoFiberOut={arrows=-|}](PC2in)(PC2out)
+\wdmsplitter[labeloffset=0.3, coupleralign=bottom, addtoFiberIn={arrows=|-},
+ addtoFiberOut1={arrows=->}, addtoFiberOut2={arrows=-|}]%
+ (CplIn)(CplOut)(CplSig){95/5}
+\wdmcoupler[addtoFiberIn1={ArrowInside=->}, addtoFiberIn2={angleA=0},
+ addtoFiberOut={angleB=0,arrows=-|}, ncurv=0.9,
+ coupleralign=bottom, compshift=0.8](Pump)(PC2out)(PumpSig){pump}
+\optbox[position=start, innerlabel](Pump)([offset=-0.1]Pump){980~nm}
+\optfiber[fiberloops=2, labeloffset=0.4](CplIn)(PumpSig){Er$^+$-doped}
+\end{pspicture}
+\end{LTXexample}
+\bigskip
+
+\begin{LTXexample}[pos=t, caption={caption}]
+\begin{pspicture}(1,1.2)(6.2,5)
+\pnode(1,4){SigIn}\pnode(3,4){BS}\pnode(3,5){LO}
+\pnode(5,4){Det1}\pnode(3,2){Det2}
+\begin{optexp}
+ \optplane[compname=LO, angle=90](LO)
+ \beamsplitter[compname=BS](SigIn)(BS)(Det2)
+ \lens[abspos=0.5, compname=L2, n=2.1](Det2)(BS){$L_2$}
+ \lens[abspos=0.5, compname=L1, n=2.1](Det1)(BS){$L_1$}
+ \psset[optexp]{extnodealign=rel, extnode=r}
+ \optdetector[compname=Det1](BS)(Det1){PD1}
+ \optdetector[compname=Det2](BS)(Det2){PD2}
+ \addtopsstyle{Beam}{beamwidth=0.2, fillstyle=solid,
+ fillcolor=green, opacity=0.2}
+ \drawwidebeam{(SigIn)}{BS}{L2}{Det2}
+ \drawwidebeam[beaminsidefirst]{BS}{L1}{Det1}
+ \newpsstyle{Beam}{linecolor=red, linestyle=dashed, linewidth=1.5\pslinewidth}
+ \drawbeam{LO}{BS}{L1}{Det1}
+ \drawbeam[beaminsidefirst]{BS}{L2}{Det2}
+\end{optexp}
+\cnodeput[framesep=5pt]([Xnodesep=0.5, offset=-0.5]\oenodeExt{Det1}|\oenodeExt{Det2}){M}{\rule{2.5mm}{1pt}}
+\psset{arrows=<-, arrowscale=1.5, arrowinset=0}
+\nccurve[angleA=90]{M}{\oenodeExt{Det1}}
+\nccurve[angleA=180, angleB=-90]{M}{\oenodeExt{Det2}}
+\end{pspicture}
+\end{LTXexample}
+\bigskip
+
+\begin{LTXexample}[pos=t, caption={caption}]
+\begin{pspicture}(-0.2,0)(9,5)
+\makeatletter
+\newOptexpDipole{LCLV}{}
+\def\LCLV@nodes{%
+ \newOptexpComp{ {-0.12 0} {0 1} -0.5 0.5 trans {PlainIfc}
+ {0.15 0} {0 1} -0.5 0.5 trans {PlainIfc} \POE@key@n}%
+}%
+\def\LCLV@comp{%
+ \psframe[fillstyle=solid,fillcolor=black,dimen=outer](-0.12,-0.5)(0,0.5)
+ \psframe[fillstyle=solid,fillcolor=gray!50,dimen=outer](0,-0.5)(0.15,0.5)
+}%
+\makeatother
+\psset[optexp]{lens=1.2 0 1.2, n=1.72}
+\addtopsstyle{Beam}{fillstyle=solid, fillcolor=green, opacity=0.3}
+\pnode(2.4,1){BS1}\pnode([offset=3]BS1){M1}
+\pnode([Xnodesep=5.5]M1){PP}\pnode(PP|BS1){BS2}
+\begin{optexp}
+ \optbox[label=0, position=start, optboxwidth=1.6]([Xnodesep=-1]BS1)(BS1){Nd:YAG}
+ \beamsplitter[compname=BS](BS2)(BS1)(M1){BS}
+ \LCLV[position=0.2, compname=LCLV](BS1)(BS2){LCLV}
+ \optretplate(BS1)(M1){P}
+ \mirror(BS1)(M1)(PP){M}
+ \lens[position=0.2](M1)(PP){L}
+ \pinhole(M1)(PP)
+ \lens[position=0.2](PP)(M1){L}
+ \pentaprism(M1)(PP)(BS2){PP}
+ \beamsplitter(PP)(BS2)(BS1){BS}
+ \doveprism[compname=Dove, position=0.27, n=2.3](BS2)(BS1){Dove}
+ \lens[n=2.5](BS2)(BS1){L}
+ \drawwidebeam[beamwidth=0.3]{1-3}
+ \drawwidebeam[loadbeampoints]{3}{2}{4-}{3}
+\end{optexp}
+\end{pspicture}
+\end{LTXexample}
+
+\enlargethispage{1cm}
+\begin{LTXexample}[pos=t, caption={caption}]
+\begin{pspicture}(0,-0.2)(8.6,5.6)
+\pnode(1.5,5){Laser}\pnode(4,5){PBS}\pnode(6.5,5){PBS2}\pnode(6.5,5.7){piezo}
+\pnode(4,2){BSFwd}\pnode(6.5,2){BSBwd}\pnode(2,2){BS4f}\pnode(2,0.5){M4f3}
+\pnode(8,2){M4f1}\pnode(8,0.5){M4f2}\pnode(1,2){CCD}
+\psset{mirrorwidth=0.6, plateheight=0.7, outerheight=0.7, labeloffset=0.7, labelstyle=\scriptsize, lens=1.2 1.2 0.8, bssize=0.5}
+\optbox[position=start, optboxsize=1.5 0.7, innerlabel]%
+ (Laser)(PBS){\parbox{1.5cm}{\centering Nd:YAG\\ 532\,nm}}
+\lens[lensheight=0.5, position=0.2](Laser)(PBS){MO}
+\pinhole[position=0.3,labelangle=180](Laser)(PBS){PH}
+\lens[position=0.5](Laser)(PBS){L}
+\optretplate[position=0.8](Laser)(PBS){$\nicefrac{\lambda}{2}$}
+\beamsplitter(Laser)(PBS)(BSFwd){PBS}
+\optretplate[position=0.4](PBS)(BSFwd){$\nicefrac{\lambda}{2}$}
+\polarization(PBS)(BSFwd)\polarization(PBS2)(BSBwd)
+\lens[position=0.8](PBS)(BSFwd){L}
+\optretplate(PBS)(PBS2){$\nicefrac{\lambda}{2}$}
+\beamsplitter(PBS)(PBS2)(piezo){PBS}
+\optretplate[abspos=0.5](PBS2)(piezo){$\nicefrac{\lambda}{4}$}
+\mirror[mirrortype=piezo,labelangle=90](PBS2)(piezo)(PBS2){PZ}
+\lens[position=0.8,labelangle=180](PBS2)(BSBwd){L}
+\crystal[crystalsize=1 0.5, voltage, lamp, fillstyle=solid, fillcolor=yellow!90!black, labeloffset=0.8](BSFwd)(BSBwd){SBN:Ce}
+\beamsplitter(PBS)(BSFwd)(BSBwd){BS}
+\beamsplitter[labelangle=-90](PBS2)(BSBwd)(BSFwd){BS}
+\mirror(BSBwd)(M4f1)(M4f2){M}\mirror(M4f1)(M4f2)(M4f3){M}
+\lens[labelangle=180](M4f2)(M4f3){L}\mirror(M4f2)(M4f3)(BS4f){M}
+\beamsplitter(M4f3)(BS4f)(CCD){BS}
+\optbox[position=end, label=0, optboxwidth=1](BS4f)(CCD){CCD}
+\lens[abspos=0.7](BS4f)(BSFwd){L}\lens[abspos=0.7](BSBwd)(M4f1){L}
+\addtopsstyle{Beam}{linewidth=2\pslinewidth}
+\drawbeam{1-6}{11-14}{13}{12}{15}{18}{16}{17}{25}{23}{24}
+\drawbeam[beaminsidefirst]{6}{7}{10}{17}{16}{18}{26}{19-24}
+\end{pspicture}
+\end{LTXexample}
+
+\bgroup
+\psset{unit=0.9}
+\begin{LTXexample}[pos=t, caption={caption}, label=ex:transmission-loop]
+\begin{pspicture}(13,5.5)
+\psset{usefiberstyle, optboxwidth=1, labelstyle=\footnotesize, fiber=none}
+\pnode(1,5){LD}\pnode([Xnodesep=5.5]LD){CPLin1}
+\pnode([offset=-2]CPLin1){CPLin2}\pnode([Xnodesep=2.5]CPLin1){CPLout1}
+\pnode([Xnodesep=2.5]CPLin2){CPLout2}\pnode([Xnodesep=3]CPLout1){RX}
+\optbox[position=start, label=0](LD)(CPLin1){LD}
+\optmzm[abspos=0.8](LD)(CPLin1){MZM}
+\optamp[abspos=2](LD)(CPLin1){EDFA}
+\optfilter[abspos=3](LD)(CPLin1){BPF}
+\optswitch[abspos=4](LD)(CPLin1){SW}
+\polcontrol[abspos=5, fiber=out](LD)(CPLin1)
+\drawfiber{1}{2}{3}{4}{5}{6}
+\optcoupler[couplertype=none, fiber](CPLin1)(CPLin2)(CPLout1)(CPLout2)
+\optamp[abspos=0.8, fiber=in](CPLout1)(RX){EDFA}
+\optfilter[abspos=2](CPLout1)(RX){BPF}
+\optbox[position=end](CPLout1)(RX){RX}
+\drawfiber{8}{9}{10}
+\pnode([Xnodesep=-0.5]LD|CPLin2){TL}\pnode(RX|TL){TR}
+\pnode([offset=-2.5]TR){BR}\pnode(TL|BR){BL}
+\optamp[fiber=i](CPLout2)(TR){EDFA}
+\optfiber[label=0.3 . t, position=0.85](BL)(BR){SSMF 89.8~km}
+\drawfiber[fiberstyle=angle, arm=1.2, linearc=0.5, startnode=N]{11}{12}
+\optamp[position=0.3](BR)(BL){EDFA}
+\optfilter[position=0.55, labelangle=180](BL)(BR){BPF}
+\optfiber[fiberloops=1, label=0.3 . t, position=0.35](BL)(BR){DCF 16.2~km}
+\optamp[position=0.85](BR)(BL){EDFA}
+\optfilter[position=0.2](TL)(CPLin2){BPF}
+\optswitch(TL)(CPLin2){SW}
+\polcontrol[position=0.8, fiber=out](TL)(CPLin2)
+\drawfiber{12}{13}{14}{15}{16}\drawfiber{17}{18}{19}
+\drawfiber[fiberstyle=angle, arm=0.5, linearc=0.5, stopnode=1]{16}{17}
+\end{pspicture}
+\end{LTXexample}
+\egroup
+
+\enlargethispage{1cm}
+\begin{LTXexample}[pos=t, caption={caption}]
+\begin{pspicture}(12, 4)
+ \psset{labeloffset=0.3, fiber=none}
+ \pnode(1.6,2){In}\pnode(12, 2){Ref}
+ \optplate[linestyle=dashed, plateheight=3, position=1, compname=RefPlane](In)(Ref)
+ \addtopsstyle{Beam}{linestyle=none, beamdiv=20, beaminside=false, fillstyle=solid, fillcolor=red, opacity=0.3}
+ \multido{\i=1+1, \ii=165+10}{4}{%
+ \rput(Ref){\pnode(6;\ii){A\i}}
+ \optbox[optboxsize=0.5 0.3, position=end, compname=Box\i, extnode=l](Ref)(A\i)
+ \lens[lens=0 -0.6 0.6, abspos=0.5, compname=L\i](A\i)(Ref)
+ \lens[lens=1.2 1.2 0.8, abspos=1.1, n=1.65, compname=LC\i](A\i)(Ref)
+ \drawwidebeam{Box\i}{L\i}{LC\i}{RefPlane}
+ }%
+ \optcoupler[abspos=1](In)(In)(Ref)(Ref)
+ \wdmsplitter[abspos=2.5, compshift=1](In)(Ref)(Ref)
+ \wdmsplitter[abspos=2.5, compshift=-1](In)(Ref)(Ref)
+ \optbox[compshift=-1, position=start, label=0](In)(Ref){Laser1}
+ \optbox[compshift=1, position=start, label=0](In)(Ref){Laser2}
+ \drawfiber{17}{14}{15}{Box1}\drawfiber{15}{Box2}
+ \drawfiber{18}{14}{16}{Box3}\drawfiber{16}{Box4}
+\end{pspicture}
+\end{LTXexample}
+\medskip
+
+\begin{LTXexample}[caption={caption}]
+\begin{pspicture}(0.5,0)(2.2,4)
+ \pnode(0,1){A}\pnode(1,1){BS}\pnode(2,1){G}\pnode(1,4){B}
+ \beamsplitter(G)(BS)(B)
+ \optgrating(BS)(G)(BS)
+ \lens[lens=2 2 1.5, compshift=0.1, n=2.25](BS)(B)
+ \pinhole[phwidth=0.05, innerheight=0.05, position=0.8, compshift=0.18](BS)(B)
+ \optplane[angle=90](B)
+ \addtopsstyle{Beam}{linestyle=none, beamwidth=0.2, fillstyle=solid}
+ \drawwidebeam[fillcolor=red!25!white]{(A)}{1-2}{1}{3-5}
+ \drawwidebeam[fillcolor=red!50!white, beamangle=-5]{2}{1}{3-5}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[pos=t, caption={caption}, label={ex:czerny-turner}, linerange={1-19,24-24}]
+\begin{pspicture}(0,-1.5)(8,4)
+\psframe[fillstyle=solid,fillcolor=gray!90,linestyle=none](0,-1)(8.5,4)
+\addtopsstyle{OptComp}{linecolor=white}
+\newpsstyle{Beam}{ArrowInside=->, linejoin=2, arrowscale=1.3, arrowinset=0}
+\addtopsstyle{ExtendedMirror}{hatchcolor=white, hatchsep=0.5\pslinewidth}
+\pnode(0,3){A}\pnode(8,3){B}\pnode(3,1.5){C}\pnode(8,0){D}\pnode(0,0){E}%
+\psset{linewidth=1.5\pslinewidth, mirrorradius=13, mirrorwidth=1.5, gratingwidth=1.3, mirrortype=extended, phwidth=0.1, outerheight=1.5}%
+\begin{optexp}
+ \pinhole[position=0.2](A)(B)%
+ \mirror(A)(B)(C)
+ \optgrating[reverse, angle=15, variable](B)(C)(D)
+ \mirror(C)(D)(E)
+ \pinhole[position=0.8](D)(E)
+ \drawwidebeam[ArrowInsidePos=0.3, beamwidth=0.2, linecolor=white, beamdiv=-7.15]{(A)}{1-3}
+ \psset{loadbeampoints, savebeampoints=false}%
+ \drawwidebeam[ArrowInsidePos=0.6, beamangle=3, linecolor=blue!60!white]{3-6}
+ \drawwidebeam[ArrowInsidePos=0.7, linecolor=green!60!white, arrows=->, ArrowInsideMinLength=2]{3-5}{(E)}
+ \drawwidebeam[ArrowInsidePos=0.8, beamangle=-3, linecolor=red!60!white]{3-6}
+\end{optexp}
+\rput[lb](0,-1.5){\footnotesize
+ \ifGERMAN Angepasst von \fi
+ \ifENGLISH Adapted from \fi
+ \url{http://de.wikipedia.org/w/index.php?title=Datei:Czerny-turner.png}}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[pos=t, caption={caption}]
+\begin{pspicture}(0,0.7)(9.4,3.3)
+ \psset[optexp]{couplertype=rectangle, fiber=none, detsize=0.5 0.6}
+ \multido{\i=1+1}{3}{%
+ \optbox[optboxsize=1.5 0.6, innerlabel,position=start](1.5,\i)(7,\i){Laser \i}
+ \wdmsplitter[position=0.2](1.5,\i)(7,\i)(7,\i)
+ \wdmcoupler[position=0.8](1.5,\i)(1.5,\i)(7,\i)
+ \optdetector[label=0.4 90 l](1.5,\i)(7,\i){Detector \i}
+ }%
+ \drawfiber[linecolor=blue, startnode=N]{1}{2}{7}
+ \drawfiber[linecolor=blue]{2}{11}
+ \drawfiber[linecolor=green, stopnode=1]{5}{6}{11}
+ \drawfiber[linecolor=green, stopnode=2]{6}{3}
+ \drawfiber[linecolor=red]{9}{10}{3}
+ \drawfiber[linecolor=red, startnode=2]{10}{7}
+ \drawfiber[linecolor=cyan]{11}{12}
+ \drawfiber[linecolor=magenta]{7}{8}
+ \drawfiber[linecolor=yellow]{3}{4}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[caption={caption}]
+\begin{pspicture}(0,1)(3.2,4.2)
+ \pnode(0,2){In}\pnode(1,2){G}\pnode(1,4){M1}
+ \pnode(3,2){M2}\pnode(1,1){S}
+ \mirror[mirrortype=semitrans](In)(G)(M1)
+ \optbox[optboxwidth=0.15, angle=45, style=SemitransMirror](G)(M1)
+ \mirror[mirrortype=extended](G)(M1)(G)
+ \mirror[mirrortype=extended](G)(M2)(G)
+ \optplate[position=end](G)(S)
+ \newpsstyle{Beam}{linecolor=red, ArrowInside=->, ArrowInsidePos=0.4, arrowscale=1.3}
+ \drawbeam{(In)}{1}{4}{1}{5}
+ \drawbeam{(In)}{1-3}{2}{1}{5}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+%
+% \ifGERMAN\chapter{Zusatzinformationen}\fi
+% \ifENGLISH\chapter{Additional information}\fi
+%
+% \ifENGLISH\section{Internal component structure}\fi
+% \ifGERMAN\section{Interne Struktur der Komponenten}\fi
+%
+% \begin{optionlist}
+% \boolitem[false]{showifcnodes}
+% \styleitem[dotstyle=x, dotscale=1.5, linecolor=blue]{IfcNodeStyle}
+% \end{optionlist}
+%
+% \ifENGLISH
+% Every component consists internally of interfaces which are defined by a node
+% on the optical axis, a plane vector or a curvature radius, and by its optical
+% characteristics (reflective or transmittive, or both e.g. for
+% \Lcs{beamsplitter}). The interface nodes can be visualized for each component
+% with the \Lkeyword{showifcnodes} parameter.
+% \fi
+% \ifGERMAN
+% Jede Komponente besteht aus Grenzflächen, die über einen Knoten auf der
+% optischen Achse, einen Ebenevektor bzw. einen Krümmungsradius, und ihre
+% optische Eigenschaft (reflektiv oder transmittiv, oder beides für
+% z.B. \Lcs{beamsplitter}) definiert ist. Die Grenzflächenknoten können mit
+% \Lkeyword{showifcnodes} angezeigt werden.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(4,3)
+ \psset{showifcnodes}
+ \optbox(0,2.5)(4,2.5)
+ \doveprism(0,1.5)(4,1.5)
+ \lens(0,0.5)(4,0.5)
+ \mirror(0,0.5)(3.5,0.5)(3.5,3)
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \medskip
+%
+% \ifENGLISH
+% \nxLcs{draw*beam}\xLcs{drawbeam}\xLcs{drawwidebeam} calculates the distance
+% between the interface nodes of two components and connects the two nearest
+% to each other.
+% \fi
+% \ifGERMAN
+% \nxLcs{draw*beam}\xLcs{drawbeam}\xLcs{drawwidebeam} berechnet den Abstand
+% zwischen den Grenzflächenknoten zweier Komponenten und verbindet die beiden
+% nächstgelegenen.
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}
+\begin{pspicture}(-3,-3)(3,3)
+ \psset{optboxsize=0.6 0.5, labeloffset=0}
+ \multido{\i=0+60,\ii=1+1}{6}{%
+ \pnode(2.5;\i){A}
+ \optbox([Xnodesep=-1]A)([Xnodesep=1]A){\ii}
+ }
+ \optbox[compname=ref](-1,0)(1,0){ref}
+ \addtopsstyle{Beam}{arrows=->}
+ \multido{\i=1+1}{6}{\drawbeam{ref}{\i}}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifENGLISH\section{Overview of special nodes}\fi
+% \ifGERMAN\section{Ãœbersicht der Spezialknoten}\fi
+%
+% \ifENGLISH In this section you find overviews of all special nodes which
+% each component provides. The possible positions for external and rotation
+% reference nodes, and the interface nodes.
+% \fi
+% \ifGERMAN
+% In diesem Abschnitt finden sie Übersichten für alle Spezialknoten, die von
+% allen Komponenten bereitgestellt werden: die möglichen Positionen für externe
+% und Rotationsknoten, und die Grenzflächenknoten.
+% \fi
+%
+% \ifENGLISH\subsection{External and rotation reference nodes}\fi
+% \ifGERMAN\subsection{Externe und Rotationsreferenzknoten}\fi
+% \label{sec:overview-extnode}
+%
+% \ifENGLISH
+% Here, you find all possible external (\prettyref{sec:extnode}) and rotation
+% reference nodes (\prettyref{sec:rotrefnode}) for all components. Displayed are
+% all possible combinations of \opt{t}, \opt{c}, or \opt{b} with \opt{l},
+% \opt{c}, or \opt{r}. Not all components support all combinations, e.g. a plain
+% \Lcs{mirror} ignores \opt{t} and \opt{b} and an \Lcs{optplate} ignores \opt{l}
+% and \opt{r}.
+%
+% Instead of these values also fractional parts can be used: \opt{t} corresponds
+% to $+1\cdot\Delta y$, \opt{b} corresponds to $-1\cdot\Delta y$, \opt{l}
+% corresponds to $-1\cdot\Delta x$, and \opt{r} corresponds to $+1\cdot\Delta
+% x$. In the following example the point $(0.5\Delta x, 1.2\Delta y)$ is
+% provided as external node.
+% \fi
+% \ifGERMAN
+% Hier finden Sie eine Übersicht über alle möglichen externen Knoten
+% (\prettyref{sec:extnode}) und Rotationsknoten (\prettyref{sec:rotrefnode})
+% aller Komponenten. Angezeigt werden die Positionen für alle möglichen
+% Kombinationen von \opt{t}, \opt{c} oder \opt{b} mit \opt{l}, \opt{c} oder
+% \opt{r}. Es sind nicht immer alle Möglichkeiten vorhanden, so können \opt{t}
+% und \opt{b} ignoriert werden (z.B. bei \Lcs{mirror}), oder auch \opt{r} und
+% \opt{l} (z.B. bei \Lcs{optplate}).
+%
+% Anstelle dieser Werte können auch Bruchteile davon verwendet werden: \opt{t}
+% entspricht $+1\cdot\Delta y$, \opt{b} entspricht $-1\cdot\Delta y$, \opt{l}
+% entspricht $-1\cdot\Delta x$ und \opt{r} entspricht $+1\cdot\Delta x$. Im
+% folgenden Beispiel wird der Punkt $(0.5\Delta x, 1.2\Delta y)$ als externer
+% Knoten bereitgestellt.
+% \fi
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[morekeywords={[21]extnode}]
+\begin{pspicture}(3,1)
+ \optbox[extnode={0.5,1.2}, beam](0,0.5)(3,0.5)
+ \psdot(\oenodeExt{})
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \newpsstyle{ExtNodeStyle}{dotstyle=B+, dotangle=45, linewidth=2\pslinewidth, linecolor=DOrange}
+% \makeatletter
+% \newcommand{\testextnodes}[3][]{%
+% \begin{pspicture}(3,2)
+% \@nameuse{#2}[#1]#3
+% \rput[t](1.5,0.9){\ttfamily\small
+% \ifx\\#1\\\relax
+% \begin{tabular}{@{}c@{}}\textbackslash #2\end{tabular}
+% \else\begin{tabular}{@{}c@{}}\textbackslash #2\\ #1\end{tabular}\fi}
+% \POE@extnodes[style=ExtNodeStyle,#1]{#2}
+% \end{pspicture}
+% }%
+% \makeatother
+%
+% \ifENGLISH\subsubsection*{Free-ray components}\fi
+% \ifGERMAN\subsubsection*{Freistrahlkomponenten}\fi
+%
+% \testextnodes{lens}{(0,1.5)(3,1.5)}
+% \testextnodes[lensradius=-1]{lens}{(0,1.5)(3,1.5)}
+% \testextnodes{optplate}{(0,1.5)(3,1.5)}
+% \testextnodes{optretplate}{(0,1.5)(3,1.5)}
+% \testextnodes[phwidth=0.2]{pinhole}{(0,1.5)(3,1.5)}
+% \testextnodes{optbox}{(0,1.5)(3,1.5)}
+% \testextnodes{crystal}{(0,1.5)(3,1.5)}
+% \testextnodes{optdetector}{(0,1.5)(2,1.5)}
+% \testextnodes[dettype=diode]{optdetector}{(0,1.5)(2,1.5)}
+% \testextnodes{optdiode}{(0,1.5)(3,1.5)}
+% \testextnodes{doveprism}{(0,1.5)(3,1.5)}
+% \bgroup
+% \addtopsstyle{PiezoMirror}{unit=1.5}
+% \testextnodes[mirrortype=piezo]{mirror}{(0,1.5)(2,1.5)(2,0)}
+% \egroup
+% \bgroup\psset{mirrordepth=0.25}
+% \testextnodes[mirrortype=extended]{mirror}{(0,1.5)(2,1.5)(2,0)}
+% \testextnodes{mirror}{(0,1.5)(2,1.5)(2,0)}
+% \testextnodes[mirrortype=semitrans]{mirror}{(0,1.5)(2,1.5)(2,0)}
+% \egroup
+% \testextnodes{optprism}{(0,1.5)(1.5,1.5)(3,1)}
+% \testextnodes{optgrating}{(0,1.5)(2,1.5)(2,0)}
+% \testextnodes{beamsplitter}{(0,1.5)(2,1.5)(2,0)}
+% \testextnodes[bsstyle=plate]{beamsplitter}{(0,1.5)(2,1.5)(2,0)}
+% \testextnodes{rightangleprism}{(0,1.5)(2.5,1)(0,0.5)}
+% \testextnodes{pentaprism}{(0,1.3)(2,1.3)(2,0)}
+%
+% \ifENGLISH\subsubsection*{Fiber components}\fi
+% \ifGERMAN\subsubsection*{Faserkomponenten}\fi
+%
+% \testextnodes{optfiber}{(0,1)(3,1)}
+% \testextnodes{optamp}{(0,1.5)(3,1.5)}
+% \testextnodes{optmzm}{(0,1.5)(3,1.5)}
+% \testextnodes{optfilter}{(0,1.5)(3,1.5)}
+% \testextnodes{polcontrol}{(0,1.5)(3,1.5)}
+% \testextnodes{optisolator}{(0,1.5)(3,1.5)}
+% \testextnodes{optswitch}{(0,1.5)(3,1.5)}
+% \testextnodes{fiberdelayline}{(0,1.5)(3,1.5)}
+% \testextnodes{optfiberpolarizer}{(0,1.5)(3,1.5)}
+% \testextnodes{fibercollimator}{(0,1.5)(3,1.5)}
+% \testextnodes{optcirculator}{(0,1.6)(3,1.6)(1.5,0.9)}
+% \testextnodes[couplersize=0.5 0.3]{optcoupler}{(0,2)(0,1)(3,2)(3,1)}
+%
+%
+% \ifENGLISH\subsection{Interface nodes}\fi
+% \ifGERMAN\subsection{Grenzflächenknoten}\fi
+% \label{sec:overview-ifcnode}
+%
+% \ifENGLISH
+% Here, all available components and their interface nodes are listed. If
+% a node is labeled as «1, N», it means that both nodes are equal.
+% \fi
+% \ifGERMAN Hier sind alle Komponenten und deren Grenzflächenknoten
+% aufgelistet. Ist ein Knoten mit «1, N» beschriftet, dann fallen beide
+% Knoten zusammen.
+% \fi
+%
+% \ifENGLISH\subsubsection*{Free-ray components}\fi
+% \ifGERMAN\subsubsection*{Freistrahlkomponenten}\fi
+%
+% \addtopsstyle{Beam}{arrows=->, arrowinset=0, arrowscale=1.5}
+% \newcommand{\showdipoleifc}[1]{%
+% \begin{pspicture}(0,-0.5)(3,1)
+% \pnode(0,0.5){A}\pnode(3,0.5){B}
+% \csname #1\endcsname(A)(B)
+% \drawbeam{(A)}{}{(B)}
+% \psdot(\oenodeIn{})\uput[-135](\oenodeIn{}){1}
+% \psdot(\oenodeOut{})\uput[-45](\oenodeOut{}){N}
+% \rput[bl](0,-0.4){\ttfamily\textbackslash #1}
+% \end{pspicture}
+% }%
+% \newcommand{\showdipoleoneifc}[1]{%
+% \begin{pspicture}(0,-0.5)(3,1)
+% \pnode(0,0.5){A}\pnode(3,0.5){B}
+% \csname #1\endcsname(A)(B)
+% \drawbeam{(A)}{}{(B)}
+% \psdot(\oenodeIn{})\uput[-135](\oenodeIn{}){1, N}
+% \rput[bl](0,-0.4){\ttfamily\textbackslash #1}
+% \end{pspicture}
+% }%
+% \showdipoleifc{lens}\hspace{\fill}%
+% \showdipoleoneifc{optplate}\hspace{\fill}%
+% \showdipoleifc{optretplate}%
+% \bigskip
+%
+% \noindent\showdipoleoneifc{pinhole}\hspace{\fill}%
+% \showdipoleifc{optbox}\hspace{\fill}%
+% \showdipoleifc{crystal}
+% \bigskip
+%
+% \noindent
+% \begin{pspicture}(0, -0.5)(3,1)
+% \pnode(0,0.5){A}\pnode(2.5,0.5){B}
+% \optdetector(A)(B)
+% \drawbeam{(A)}{}
+% \psdot(\oenodeIn{})\uput[-135](\oenodeIn{}){1, N}
+% \rput[bl](0,-0.4){\ttfamily\textbackslash optdetector}
+% \end{pspicture}%
+% \hspace{\fill}%
+% \bgroup
+% \addtopsstyle{Beam}{beaminside=false}%
+% \showdipoleifc{optdiode}\egroup%
+% \hspace{\fill}%
+% \begin{pspicture}(0,-0.5)(3,1)
+% \pnode(0,0.5){A}\pnode(3,0.5){B}
+% \doveprism(A)(B)
+% \drawbeam[raytrace=false]{(A)}{}{(B)}
+% \psdot(\oenodeIn{})\uput[135](\oenodeIn{}){1}
+% \psdot(\oenodeIfc{2}{})\uput[90](\oenodeIfc{2}{}){2}
+% \psdot(\oenodeOut{})\uput[45](\oenodeOut{}){N}
+% \rput[bl](0,-0.4){\ttfamily\textbackslash doveprism}
+% \end{pspicture}%
+%
+% \begin{pspicture}(3,1.5)
+% \pnode(0,1){A}\pnode(2.5,1){B}\pnode(2.5,0){C}
+% \mirror(A)(B)(C)
+% \drawbeam{(A)}{}{(C)}
+% \psdot(\oenodeIn{})\uput[-135](\oenodeIn{}){1, N}
+% \rput[bl](0,0){\ttfamily\textbackslash mirror}
+% \end{pspicture}%
+% \hspace{\fill}%
+% \begin{pspicture}(3,1.5)
+% \pnode(0,1){A}\pnode(1.5,1){B}\pnode(3,0){C}
+% \optprism(A)(B)(C)
+% \drawbeam[raytrace=false]{(A)}{}{(C)}
+% \psdot(\oenodeIn{})\uput[135](\oenodeIn{}){1}
+% \psdot(\oenodeOut{})\uput[45](\oenodeOut{}){N}
+% \rput[bl](0,0){\ttfamily\textbackslash optprism}
+% \end{pspicture}%
+% \hspace{\fill}%
+% \begin{pspicture}(3,1.5)
+% \pnode(0,1){A}\pnode(2.5,1){B}\pnode(2.5,0){C}
+% \optgrating(A)(B)(C)
+% \drawbeam{(A)}{}{(C)}
+% \psdot(\oenodeIn{})\uput[-135](\oenodeIn{}){1, N}
+% \rput[bl](0,0){\ttfamily\textbackslash optgrating}
+% \end{pspicture}%
+% \bigskip
+%
+% \noindent
+% \begin{pspicture}(3,2.5)
+% \pnode(0,1.5){A}\pnode(2.5,1.5){B}\pnode(2.5,0.4){C}
+% \beamsplitter[bssize=1.2](A)(B)(C)
+% \drawbeam{(A)}{}{(C)}
+% \psdot(\oenodeIfc{1}{})\uput[135](\oenodeIfc{1}{}){1}
+% \psdot(\oenodeIfc{2}{})\uput[-45](\oenodeIfc{2}{}){2}
+% \psdot(\oenodeIfc{3}{})\uput[60](\oenodeIfc{3}{}){3,C}
+% \psdot(\oenodeIfc{4}{})\uput[0](\oenodeIfc{4}{}){4}
+% \psdot(\oenodeIfc{N}{})\uput[90](\oenodeIfc{N}{}){N}
+% \rput[bl](0,0){\ttfamily\textbackslash beamsplitter}
+% \end{pspicture}%
+% \hspace{\fill}%
+% \begin{pspicture}(3,2.5)
+% \pnode(0,2){A}\pnode(2.5,1.5){B}\pnode(0,1){C}
+% \rightangleprism[raprismsize=2](A)(B)(C)
+% \drawbeam[arrows=->, arrowinset=0, arrowscale=1.5]{(A)}{}{(C)}
+% \psdot(\oenodeIn{})\uput[135](\oenodeIn{}){1}
+% \psdot(\oenodeIfc{2}{})\uput[45](\oenodeIfc{2}{}){2}
+% \psdot(\oenodeIfc{3}{})\uput[-45](\oenodeIfc{3}{}){3}
+% \psdot(\oenodeOut{})\uput[-135](\oenodeOut{}){N}
+% \rput[bl](0,0){\ttfamily\textbackslash rightangleprism}
+% \end{pspicture}%
+% \hspace{\fill}%
+% \begin{pspicture}(3,2.5)
+% \pnode(0,1.5){A}\pnode(2.1,1.5){B}\pnode(2.1,0.4){C}
+% \pentaprism[pentaprismsize=1](A)(B)(C)
+% \drawbeam[arrows=->, arrowinset=0, arrowscale=1.5]{(A)}{}{(C)}
+% \psdot(\oenodeIn{})\uput[135](\oenodeIn{}){1}
+% \psdot(\oenodeIfc{2}{})\uput[0](\oenodeIfc{2}{}){2}
+% \psdot(\oenodeIfc{3}{})\uput[90](\oenodeIfc{3}{}){3}
+% \psdot(\oenodeOut{})\uput[-45](\oenodeOut{}){N}
+% \rput[bl](0,0){\ttfamily\textbackslash pentaprism}
+% \end{pspicture}%
+%
+% \ifENGLISH\subsubsection*{Fiber components}\fi
+% \ifGERMAN\subsubsection*{Faserkomponenten}\fi
+%
+% \newcommand{\showfdipoleifc}[1]{%
+% \begin{pspicture}(0,-0.5)(3,1)
+% \pnode(0,0.5){A}\pnode(3,0.5){B}
+% \csname #1\endcsname(A)(B)
+% \psdot(\oenodeIn{})\uput[-135](\oenodeIn{}){1}
+% \psdot(\oenodeOut{})\uput[-45](\oenodeOut{}){N}
+% \rput[bl](0,-0.4){\ttfamily\textbackslash #1}
+% \end{pspicture}%
+% }%
+% \addtopsstyle{Fiber}{ArrowInside=->, ArrowInsidePos=0.6, arrowscale=1.5, arrowinset=0}
+% \vspace*{5mm}%
+% \showfdipoleifc{optfiber}\hspace{\fill}%
+% \showfdipoleifc{optamp}\hspace{\fill}%
+% \showfdipoleifc{optmzm}%
+% \bigskip
+%
+% \noindent\showfdipoleifc{optfilter}\hspace{\fill}%
+% \showfdipoleifc{polcontrol}\hspace{\fill}%
+% \showfdipoleifc{optisolator}%
+% \bigskip
+%
+% \noindent\showfdipoleifc{optswitch}\hspace{\fill}%
+% \showfdipoleifc{fiberdelayline}\hspace{\fill}%
+% \showfdipoleifc{optfiberpolarizer}%
+% \bigskip
+%
+% \bgroup\psset{beam}
+% \noindent\showfdipoleifc{fibercollimator}\egroup
+% \hspace{\fill}%
+% \begin{pspicture}(0,-0.5)(3,1.4)
+% \pnode(0,1){A}\pnode(3,1){B}\pnode(1.2,-0.1){C}
+% \optcirculator(A)(B)(C)
+% \psdot(\oenodeIn{})\uput[-135](\oenodeIn{}){1}
+% \psdot(\oenodeIfc{2}{})\uput[-45](\oenodeIfc{2}{}){2}
+% \psdot(\oenodeOut{})\uput[-45](\oenodeOut{}){N}
+% \rput[bl](0,-0.4){\ttfamily\textbackslash optcirculator}
+% \end{pspicture}\hspace{\fill}%
+% \begin{pspicture}(3,1)
+% \end{pspicture}%
+% \bigskip
+%
+% \noindent
+% \begin{pspicture}(0,-0.5)(3,1.5)
+% \pnode(0,0.75){A}\pnode(3,1.5){B}\pnode(3,0){C}
+% \wdmsplitter[couplersize=0.5, couplersep=0.2](A)(B)(C)
+% \psdot(\oenodeIn{})\uput[135](\oenodeIn{}){1}
+% \psdot(\oenodeIfc{2}{})\uput[90](\oenodeIfc{2}{}){2}
+% \psdot(\oenodeOut{})\uput[-90](\oenodeOut{}){N}
+% \rput[bl](0,-0.4){\ttfamily\textbackslash wdmsplitter}
+% \end{pspicture}%
+% \hspace{\fill}%
+% \begin{pspicture}(0,-0.5)(3,1.5)
+% \pnode(0,1.5){A}\pnode(0,0){B}\pnode(3,0.75){C}
+% \wdmcoupler[couplersize=0.5, couplersep=0.2](A)(B)(C)
+% \psdot(\oenodeIn{})\uput[90](\oenodeIn{}){1}
+% \psdot(\oenodeIfc{2}{})\uput[-90](\oenodeIfc{2}{}){2}
+% \psdot(\oenodeOut{})\uput[45](\oenodeOut{}){N}
+% \rput[bl](0,-0.4){\ttfamily\textbackslash wdmcoupler}
+% \end{pspicture}%
+% \hspace{\fill}%
+% \begin{pspicture}(0,-0.5)(3,1.5)
+% \pnode(0,1.5){A}\pnode(0,0){B}\pnode(3,1.5){C}\pnode(3,0){D}
+% \optcoupler[couplersize=0.5, couplersep=0.2](A)(B)(C)(D)
+% \psdot(\oenodeIn{})\uput[90](\oenodeIn{}){1}
+% \psdot(\oenodeIfc{2}{})\uput[-90](\oenodeIfc{2}{}){2}
+% \psdot(\oenodeIfc{3}{})\uput[90](\oenodeIfc{3}{}){3}
+% \psdot(\oenodeOut{})\uput[-90](\oenodeOut{}){N}
+% \rput[bl](0,-0.4){\ttfamily\textbackslash optcoupler}
+% \end{pspicture}%
+%
+%
+% \ifGERMAN
+% \section{Abwärtskompatibilität}
+% \fi
+% \ifENGLISH
+% \section{Backward compatibility}
+% \fi\label{sec:bwd-comp}
+%
+% \ifENGLISH In this section you find a comprehensive listing of the behaviour
+% which changed in a version compared to the previous one and which is not
+% backward compatible. Here you find also information on what you must note when
+% upgrading and how you must change old documents to work correctly with the
+% newer version.
+% \fi
+% \ifGERMAN
+% In diesem Abschnitt finden Sie eine umfangreiche Auflistung aller Änderungen
+% in einer Version bezüglich der Vorgängerversion, die nicht abwärts kompatibel
+% sind. Sie finden ebenfalls Informationen was Sie bei einem Wechsel zur neuen
+% Version beachten müssen, und was sie bei älteren Dokumenten gegebenenfalls
+% ändern müssen um mit der neuen Version korrekt zu funktionieren. \fi
+%
+%
+% \subsection{Version 3.0}\label{sec:bwd-comp-3.0}
+%
+% \ifENGLISH The changes in version 3.0 compared to version 2.1 which are not
+% backward compatible.
+% \fi
+% \ifGERMAN Die Änderungen in Version 3.0 gegenüber Version 2.1, die nicht
+% abwärtskompatibel sind.
+% \fi
+%
+% \ifENGLISH\subsubsection{General parameters}\fi
+% \ifGERMAN\subsubsection{Allgemeine Parameter}\fi
+%
+% \begin{optionlist}
+% \optitem*[new]{namingscheme}{old, new}
+% \ifGERMAN
+% In Version 2.1 mussten spezielle Komponentenknoten über ihren expliziten
+% Namen angesprochen werden. Wenn Sie das alte Namensschema benötigen, da Sie
+% direkt auf die Knoten zugegriffen haben, so müssen Sie
+% \nxLkeyword{namingscheme=old} verwenden. Seit Version 3.0 werden Makros für
+% den Zugriff auf die Komponentenknoten bereitgestellt, so dass das
+% eigentlichen Namensschema unerheblich ist, siehe \prettyref{sec:objnodes}
+% \fi
+% \ifENGLISH
+% In version 2.1 special component nodes had to be accessed by their explicit
+% name. If you need the old naming scheme, because you accessed internal nodes
+% directly, then you must set \nxLkeyword{namingscheme=old}. Since version 3.0
+% explicit macros are provided to access all special component nodes, so that
+% the actual naming scheme does not matter, see \prettyref{sec:objnodes}.
+% \fi
+%
+% \poeitem{\smash{\begin{tabular}[t]{@{}r@{}}endbox\\angle\\rotateref\end{tabular}}}
+% \ifENGLISH These options now affect all components.\fi
+% \ifGERMAN Diese Parameter wirken sich jetzt auf alle Komponenten aus.\fi
+% \vspace*{1cm}
+%
+% \poeitem{extnode}
+% \ifENGLISH
+% Some components now provide more possible positions for
+% \Lkeyword{extnode}. \Lcs{optdetector} had only one possible external node,
+% which was accessible for any value of \Lkeyword{extnode}, now this node can
+% be accessed only with \Lkeyword{extnode}\opt{=r}. All other values give
+% different node positions.
+% \fi
+% \ifGERMAN
+% Einigen Komponenten stellen nun mehr mögliche Positionen für
+% \Lkeyword{extnode} zur Verfügung. So muss war z.B. für \Lcs{optdetector} nur
+% ein Knoten möglich, der für jeden Wert von \Lkeyword{extnode} zugänglich
+% war, jetzt aber nur mit \Lkeyword{extnode}\opt{=r}. Alle anderen Werte
+% setzen den Knoten an andere Stellen.
+% \fi
+% \end{optionlist}
+%
+% \ifENGLISH\subsubsection{Beam connections}\fi
+% \ifGERMAN\subsubsection{Strahlverbindungen}\fi
+%
+% \ifENGLISH
+% In version 2.1, beam connections could be internal, that is the connections
+% were specified together with the compent (\Lkeyword{beam} or
+% \Lkeyword{conn}), or external with an additional call of \Lcs{drawbeam}. The
+% main reason for internal connections was the aesthetic aspect of drawing the
+% beam behind the component, but also convenience played a role. Drawing the
+% beam behind the component is possible with layering (\prettyref{sec:layers})
+% since 3.0.
+%
+% Some of the variants of internal beam connections can be used also in 3.0:
+% \fi
+% \ifGERMAN
+% In Version 2.1 konnten Strahlverbindungen intern sein, d.h. die Verbindung
+% wurde zusammen mit der Komponenten definiert (z.B. mit \Lkeyword{beam}, oder
+% \Lkeyword{conn}) oder extern über einen separaten Aufruf von \Lcs{drawbeam}.
+% Der Hauptgrund für die internen Verbindungen war der ästhetische Aspekt,
+% zuerst die Verbindung und dann die Komponente darüber zu zeichnen, aber
+% Bequemlichkeit spielte auch eine Rolle. Seit Version 3.0 kann die Reihenfolge
+% von Verbindungen und Komponenten über Ebenen geregelt werden
+% (\prettyref{sec:layers}).
+%
+% Manche Varianten für interne Strahlverbindungen können auch in 3.0 verwendet
+% werden:
+% \fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-3,5-5}]
+\begin{pspicture}(3,2)
+ \pnode(0,1){A}\pnode(3,1){B}
+ \optbox[beam](A)(B)
+ \rput[b]([offset=-0.9]\oenodeCenter{}){\ttfamily conn=o-i, conn=i-o}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[linerange={1-3,5-5}]
+\begin{pspicture}(3,2)
+ \pnode(0,1){A}\pnode(3,1){B}
+ \optbox[beam, beaminside=false](A)(B)
+ \rput[b]([offset=-0.9]\oenodeCenter{}){\ttfamily conn=o-o}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+% \ifENGLISH
+% Other internal connections need an additional \Lcs{drawbeam} call, and if you
+% want to move the beam behind the component, the code must be wrapped in a
+% \Lenv{optexp} environment. Except for this, external connection are equivalent:
+% \fi
+% \ifGERMAN
+% Andere Verbindungen können nur über einen zusätzlichen \Lcs{drawbeam} Aufruf
+% erreicht werden, falls die Verbindung dann hinter der Komponente sein soll,
+% musst der beteiligte Code in eine \Lenv{optexp}-Umgebung geschachtelt
+% werden. Außer diesem Aspekt sind die separaten Verbindungen äquivalent:
+%\fi
+%
+% \iffalse
+%<*ignore>
+% \fi
+\begin{LTXexample}[linerange={1-4,6-6}]
+\begin{pspicture}(3,2)
+ \pnode(0,1){A}\pnode(3,1){B}
+ \optbox(A)(B)
+ \drawbeam{(A)}{}
+ \rput[b]([offset=-0.9]\oenodeCenter{}){\ttfamily conn=o-, conn=a-}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[linerange={1-3,5-6}]
+\begin{pspicture}(3,2)
+ \pnode(0,1){A}\pnode(3,1){B}
+ \optbox(A)(B)
+ \rput[b]([offset=-0.9]\oenodeCenter{}){\ttfamily conn=-o, conn=-b}
+ \drawbeam{}{(B)}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[linerange={1-4,6-8}]
+\begin{pspicture}(3,2)
+ \pnode(0,1){A}\pnode(3,1){B}
+ \begin{optexp}
+ \optbox(A)(B)
+ \rput[b]([offset=-0.9]\oenodeCenter{}){\ttfamily conn=i-, A-}
+ \drawbeam[beaminsidelast]{(A)}{}
+ \end{optexp}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[linerange={1-4,6-8}]
+\begin{pspicture}(3,2)
+ \pnode(0,1){A}\pnode(3,1){B}
+ \begin{optexp}
+ \optbox(A)(B)
+ \rput[b]([offset=-0.9]\oenodeCenter{}){\ttfamily conn=-i, conn=-B}
+ \drawbeam[beaminsidefirst]{}{(B)}
+ \end{optexp}
+\end{pspicture}
+\end{LTXexample}
+% \iffalse
+%</ignore>
+% \fi
+%
+%
+% \makeatletter
+% \bgroup
+% \newcommand*{\index@preamble}{}
+% \let\index@preamble=\relax
+% \renewcommand{\setindexpreamble}[1]{\def\index@preamble{#1}}
+% \renewcommand*{\idx@heading}{%
+% \twocolumn[\idx@@heading{\indexname}]%
+% \@mkboth{\indexname}{\indexname}%
+% }
+% \renewenvironment{theindex}{%
+% \if@twocolumn
+% \@restonecolfalse
+% \else
+% \@restonecoltrue
+% \fi
+% \columnseprule \z@
+% \columnsep 35\p@
+% \idx@heading%
+% \index@preamble\par\nobreak
+% \thispagestyle{\indexpagestyle}\parindent\z@
+% \setlength{\parskip}{\z@ \@plus .3\p@}%
+% \setlength{\parfillskip}{\z@ \@plus 1fil}%
+% \let\item\@idxitem
+% }{%
+% \if@restonecol\onecolumn\else\clearpage\fi
+% }
+% \renewcommand*\@idxitem{\par\hangindent 40\p@}
+% \renewcommand*\subitem{\@idxitem \hspace*{20\p@}}
+% \renewcommand*\subsubitem{\@idxitem \hspace*{30\p@}}
+% \renewcommand*\indexspace{%
+% \par \vskip 10\p@ \@plus5\p@ \@minus3\p@\relax
+% }
+% \renewcommand*\indexname{Index}
+% \printindex[doc]
+% \egroup
+% \makeatother
+%
+% \appendix
+%
+% \ifGERMAN
+% \chapter{Versionsgeschichte}
+%
+% Diese Versionsgeschichte ist eine Liste von Änderungen, die für den Nutzer des
+% Pakets von Bedeutung sind. Änderungen, die eher technischer Natur sind und für
+% den Nutzer des Pakets nicht relevant sind und das Verhalten des Pakets nicht
+% ändern, werden nicht aufgeführt. Wenn ein Eintrag der Versionsgeschichte ein
+% Feature als \emph{improved} oder \emph{extended} bekannt gibt, so bedeutet
+% dies, dass eine Modifikation die Syntax und das Verhalten des Pakets nicht
+% beeinflusst, oder das es für ältere Versionen kompatibel ist. Einträge, die
+% als \emph{deprecated}, \emph{modified}, \emph{renamed}, oder \emph{removed}
+% deklariert sind, verlangen besondere Aufmerksamkeit. Diese bedeuten, dass eine
+% Modifikation Änderungen in existierenden Dokumenten mit sich ziehen kann. Die
+% Zahlen an der rechten Seite stehen für die relevante Stelle dieser
+% Dokumentation, zusätzliche Informationen zur Migration von älteren Dokumenten
+% sind in \prettyref{sec:bwd-comp} zu finden.
+% \fi
+% \ifENGLISH
+% \chapter{Revision history}
+%
+% This revision history is a list of changes relevant to users of this
+% package. Changes of a more technical nature which do not affect the user
+% interface or the behavior of the package are not included in the list. If an
+% entry in the revision history states that a feature has been \emph{improved}
+% or \emph{extended}, this indicates a modification which either does not affect
+% the syntax and behavior of the package or is syntactically backwards
+% compatible (such as the addition of an optional argument to an existing
+% command). Entries stating that a feature has been \emph{deprecated},
+% \emph{modified}, \emph{renamed}, or \emph{removed} demand attention. They
+% indicate a modification which may require changes to existing documents. The
+% numbers on the right indicate the relevant section of this manual, more
+% information regarding backward compatibility can be found in
+% \prettyref{sec:bwd-comp}.
+% \fi
+%
+% \begin{changelog}
+%\patchcmd{\release}{\setlength{\itemsep}{0pt}}{\setlength{\itemsep}{0pt}\setlength{\parsep}{0pt}}{}{}
+% \begin{release}{3.0}{2012-07-09}
+% \item Modified beam connections with \cs{drawbeam} to support raytracing\see{cmd:drawbeam}
+% \item Added wide beams with \cs{drawwidebeam}\see{cmd:drawwidebeam}
+% \item Added \cs{drawfiber} for fiber connections\see{cmd:drawfiber}
+% \item Added \opt{optexp} environment for layering of components and connections\see{sec:layers}
+% \item Added german documentation
+% \item Modified naming of component nodes\see{sec:objnodes}
+% \item Modified \opt{extnode} to work with more components\see{prm:extnode}
+% \item Modified \opt{angle} and \opt{rotateref} to affect all components\see{sec:rotshift}
+% \item Modified \opt{endbox} to affect all components\see{sec:positioning}
+% \item Extended \opt{position} by values \opt{start} and \opt{end}\see{sec:positioning}
+% \item Extended \opt{abspos} by values \opt{start} and \opt{end}\see{sec:positioning}
+% \item Removed deprecated lens code which used \opt{lenswidth} and \opt{lensheight} for construction\see{cmd:lens}
+% \item Added option \opt{platesize}\see{prm:platesize}
+% \item Added option \opt{phwidth}\see{cmd:pinhole}
+% \item Modified option \opt{caxislength}\see{cmd:crystal}
+% \item Deprecated option \opt{lampscale}\see{cmd:crystal}
+% \item Added style \opt{CrystalCaxis}\see{cmd:crystal}
+% \item Added style \opt{CrystalLamp}\see{cmd:crystal}
+% \item Added option \opt{optboxsize}\see{cmd:optbox}
+% \item Extended option \opt{detsize}\see{cmd:optdetector}
+% \item Added style \opt{DetectorStyle}\see{cmd:optdetector}
+% \item Removed deprecated \cs{detector}, use \cs{optdetector}\see{cmd:optdetector}
+% \item Extended option \opt{doveprismsize}\see{cmd:doveprism}
+% \item Added style \opt{Polarization}\see{cmd:polarization}
+% \item Deprecated option \opt{pollinewidth}\see{cmd:polarization}
+% \item Removed option \opt{polwidth}\see{cmd:polarization}
+% \item Removed option \opt{pol}\see{cmd:polarization}
+% \item Added style \opt{VariableStyle}\see{cmd:mirror}
+% \item Added mirror type \opt{semitrans}\see{prm:mirrortype}
+% \item Renamed \cs{optgrid} to \cs{optgrating}\see{cmd:optgrating}
+% \item Renamed \opt{optgridwidth} to \opt{gratingwidth}\see{cmd:optgrating}
+% \item Renamed \opt{optgridheight} to \opt{gratingheight}\see{cmd:optgrating}
+% \item Renamed \opt{optgriddepth} to \opt{gratingdepth}\see{cmd:optgrating}
+% \item Renamed \opt{optgridcount} to \opt{gratingcount}\see{cmd:optgrating}
+% \item Renamed \opt{optgridtype} to \opt{gratingtype}\see{cmd:optgrating}
+% \item Renamed \opt{optgridlinewidth} to \opt{gratinglinewidth}\see{cmd:optgrating}
+% \item Added option \opt{prismalign}\see{cmd:optprism}
+% \item Modified faulty alignment of \cs{rightangleprism}\see{cmd:rightangleprism}
+% \item Extended option \opt{optampsize}\see{cmd:optamp}
+% \item Extended option \opt{optmzmsize}\see{cmd:optmzm}
+% \item Added option \opt{polcontroltype}\see{cmd:polcontrol}
+% \item Extended option \opt{isolatorsize}\see{cmd:optisolator}
+% \item Added style \opt{IsolatorArrow}\see{cmd:optisolator}
+% \item Extended option \opt{fdlsize}\see{cmd:fiberdelayline}
+% \item Added style \opt{FdlArrow}\see{cmd:fiberdelayline}
+% \item Extended option \opt{fiberpolsize}\see{cmd:optfiberpolarizer}
+% \item Added component \cs{optcirculator}\see{cmd:optcirculator}
+% \item Extended option \opt{couplersize}\see{cmd:optcoupler}
+% \item Extended option \opt{couplertype}\see{cmd:optcoupler}
+% \item Renamed option \opt{align} to \opt{coupleralign}\see{cmd:optcoupler}
+% \item Added style \opt{VariableCoupler}\see{cmd:optcoupler}
+% \item Added style \opt{FilterStyle}\see{cmd:optfilter}
+% \item Extended option \opt{fibercolsize}\see{cmd:fibercollimator}
+% \item Removed deprecated option \opt{labelrelative}\see{sec:labels}
+% \item Removed deprecated option \opt{iwidth}\see{cmd:pinhole}
+% \item Removed deprecated option \opt{owidth}\see{cmd:pinhole}
+% \item Removed deprecated option \opt{bswidth}\see{cmd:beamsplitter}
+% \item Deprecated \cs{newOptexpDipoleNolabel}, use \cs{newOptexpDipole}\see{sec:newobj}
+% \item Deprecated option \opt{refractiveindex}\see{prm:refractiveindex}
+% \item Deprecated option \opt{conn}\see{sec:drawbeam}
+% \item Extended option \opt{fiber}\see{prm:fiber}
+% \end{release}
+% \begin{release}{2.1}{2009-11-05}
+% \item Added component \cs{optfiberpolarizer}\see{cmd:optfiberpolarizer}
+% \item Added option \opt{compshift}\see{prm:compshift}
+% \item Added option \opt{label}\see{prm:label}
+% \item Added option \opt{connjoin}
+% \item Added options \opt{addtoBeam} and \opt{newBeam}\see{sec:drawbeam}
+% \item Added style \opt{OptComp} and related options \opt{addtoOptComp} and \opt{newOptComp}\see{sec:appearance}
+% \item Added option \opt{bsstyle}\see{cmd:beamsplitter}
+% \item Extended \cs{fibercollimator} to use up to four reference nodes\see{cmd:fibercollimator}
+% \item Improved \opt{thicklens} to work also with plain lenses\see{prm:thicklens}
+% \item Use pst-doc class for the documentation
+% \end{release}
+%
+% \begin{release}{2.0}{2008-07-27}
+% \item Added fiber-optical components\see{chap:fibercomp}
+% \item Added component \cs{optdiode}\see{cmd:optdiode}
+% \item Added component \cs{pentaprism}\see{cmd:pentaprism}
+% \item Added component \cs{rightangleprism}\see{cmd:rightangleprism}
+% \item Added component \cs{doveprism}\see{cmd:doveprism}
+% \item Added component \cs{optprism}\see{cmd:optprism}
+% \item Added \cs{drawbeam}\see{sec:drawbeam}
+% \item Added component connections (options \opt{fiber}, \opt{conn} and \opt{beam})\see{chap:connecting}
+% \item Added option \opt{compname}\see{prm:compname}
+% \item Added option \opt{extnode}\see{prm:extnode}
+% \item Renamed \cs{detector} to \cs{optdetector}\see{cmd:optdetector}
+% \end{release}
+% \begin{release}{1.2}{2008-06-17}
+% \item Modified lens design to use interface curvatures\see{cmd:lens}
+% \item Added options \opt{lensradiusleft} and \opt{lensradiusright}\see{cmd:lens}
+% \item Added option \opt{thicklens}\see{cmd:lens}
+% \item Added option \opt{lenstype}\see{cmd:lens}
+% \item Added option \opt{mirrorradius} (curved mirrors)\see{cmd:mirror}
+% \item Added option \opt{optgridtype} (binary gratings)\see{cmd:optgrating}
+% \item Added \cs{newOptexpDipole}\see{sec:newobj}
+% \item Added \cs{newOptexpDipoleNolabel}\see{sec:newobj}
+% \item Added \cs{newOptexpTripole}\see{sec:newobj}
+% \item Added \cs{newOptexpFiberDipole}\see{sec:newobj}
+% \item General improvements of \TeX{} and Postscript code
+% \end{release}
+% \begin{release}{1.1}{2007-09-06}
+% \item Improved labeling features\see{sec:labels}
+% \item Added parameter \opt{labelref}\see{sec:labels}
+% \item Replaced \opt{labelrelative} by \opt{labelref=relative}\see{sec:labels}
+% \item Renamed \cs{polarisation} to \cs{polarization}\see{cmd:polarization}
+% \item Renamed \opt{polwidth} to \opt{polsize}\see{cmd:polarization}
+% \item Renamed \opt{pol} to \opt{poltype}\see{cmd:polarization}
+% \item Renamed \opt{bswidth} to \opt{bssize}\see{cmd:beamsplitter}
+% \item Renamed \opt{iwidth} to \opt{innerheight}\see{cmd:pinhole}
+% \item Renamed \opt{owidth} to \opt{outerheight}\see{cmd:pinhole}
+% \item Added support for fillstyle for all components
+% \end{release}
+%
+% \begin{release}{1.0}{2007-07-18}
+% \item First CTAN version
+% \end{release}
+% \end{changelog}
+%
+% \StopEventually{}
+%
+%
+% \chapter{The \LaTeX/\TeX\ implementation}
+%<*stylefile>
+% \section{Requirements}
+% \begin{macrocode}
+\RequirePackage{pstricks}
+\RequirePackage{pst-xkey}
+\RequirePackage{pst-node}
+\RequirePackage{pst-plot}
+\RequirePackage{multido}
+\RequirePackage{pst-eucl}
+\RequirePackage{pstricks-add}
+\RequirePackage{environ}
+% \end{macrocode}
+% Add the Postscript header file.
+% \begin{macrocode}
+\@addtofilelist{pst-optexp.pro}{}%
+\pst@addfams{optexp}
+\pstheader{pst-optexp.pro}
+% \end{macrocode}
+% This holds a comma-separated list of all component names which are defined in
+% a \nxLenv{pspicture} environment. This list is cleared when leaving the
+% \nxLenv{pspicture}.
+% \begin{macrocode}
+\gdef\POE@complist{}%
+\gdef\POE@beamlist{1}%
+\g@addto@macro{\endpspicture}{%
+% \end{macrocode}
+%
+% Undefine all beam nodes at the end of the \nxLenv{pspicture}.
+% \begin{macrocode}
+ \expandafter\XKV@for@n\expandafter{\POE@beamlist}\POE@temp{%
+ \POE@Verb{%
+ /lastBeamPointUp\POE@temp\space
+ /lastBeamPointLow\POE@temp\space
+ /lastBeamPoint\POE@temp\space
+ 3 { currentdict exch undef } repeat
+ /N@\oenodeBeam{\POE@temp}
+ /N@\oenodeBeamUp{\POE@temp}
+ /N@\oenodeBeamLow{\POE@temp}
+ 3 { tx@NodeDict exch undef } repeat
+ }%
+ }%
+% \end{macrocode}
+%
+% Reset the component list.
+%
+% \begin{macrocode}
+ \gdef\POE@complist{}\gdef\POE@beamlist{1}\global\POE@cnt=0\relax
+}%
+% \end{macrocode}
+% Some convenience definitions.
+% \begin{macrocode}
+\def\pst@optexpdict{tx@OptexpDict begin }
+\def\POE@dict#1{\pst@optexpdict #1 end}
+\SpecialCoor
+% \end{macrocode}
+% \section{Basic definitions}
+%
+% \subsection{Switches for the boolean keys}
+% See respective key definitions for explanation.
+% \begin{macrocode}
+\newif\ifPOE@connjoin
+\newif\ifPOE@backlayer
+\newif\ifPOE@frontlayer
+\newif\ifPOE@optexpenv
+\newif\ifPOE@variable
+\newif\ifPOE@voltage
+\newif\ifPOE@caxisinv
+\newif\ifPOE@reverse
+\newif\ifPOE@lamp
+\newif\ifPOE@component@optional
+\newif\ifPOE@debug@showoptdots
+\newif\ifPOE@debug@showifcnodes
+\newif\ifPOE@endbox
+\newif\ifPOE@startbox
+\newif\ifPOE@thicklens
+\newif\ifPOE@usefiberstyle
+\newif\ifPOE@fiber@
+\newif\ifPOE@nofiber@
+\newif\ifPOE@fiberin@
+\newif\ifPOE@fiberin@top
+\newif\ifPOE@fiberin@bottom
+\newif\ifPOE@fiberout@
+\newif\ifPOE@fiberout@top
+\newif\ifPOE@fiberout@bottom
+\newif\ifPOE@fiberpreset@
+\newif\ifPOE@nofiberpreset@
+\newif\ifPOE@fiberpresetin@
+\newif\ifPOE@fiberpresetin@top
+\newif\ifPOE@fiberpresetin@bottom
+\newif\ifPOE@fiberpresetout@
+\newif\ifPOE@fiberpresetout@top
+\newif\ifPOE@fiberpresetout@bottom
+\newif\ifPOE@beam
+\newif\ifPOE@startinside
+\newif\ifPOE@stopinside
+\newif\ifPOE@beaminsidefirst
+\newif\ifPOE@beaminsidelast
+\newif\ifPOE@savebeam
+\newif\ifPOE@loadbeam
+\newif\ifPOE@beaminside
+\newif\ifPOE@raytrace
+\newif\ifPOE@pswarning
+\newif\ifPOE@useNA
+% \end{macrocode}
+% This is to check if \nxLkeyword{compname} is set inside or outside of a component. For this no boolean key is provided.
+% \begin{macrocode}
+\newif\ifPOE@insideobj\POE@insideobjfalse
+% \end{macrocode}
+% \subsection{Counters}
+% Count the components in one \nxLenv{pspicture} environment.
+% \begin{macrocode}
+\newcount\POE@cnt
+\newcount\POE@oldcnt
+% \end{macrocode}
+% Count the temporal planes which are created for connections to nodes.
+% \begin{macrocode}
+\newcount\POE@nodecnt
+% \end{macrocode}
+% \begin{macrocode}
+\newdimen\POE@dim
+% \end{macrocode}
+% \subsection{Fixed strings}
+% These are all the fixed strings which are used as possible values for
+% choicekeys.
+% \begin{macrocode}
+\def\POE@str@pol@polperp{perp}
+\def\POE@str@pol@polparallel{parallel}
+\def\POE@str@pol@polmisc{misc}
+\def\POE@str@pol@polrcirc{rcirc}
+\def\POE@str@pol@pollcirc{lcirc}
+\def\POE@str@mirrortype@piezo{piezo}
+\def\POE@str@mirrortype@plain{plain}
+\def\POE@str@mirrortype@extended{extended}
+\def\POE@str@mirrortype@semitrans{semitrans}
+\def\POE@str@gratingtype@blazed{blazed}
+\def\POE@str@gratingtype@binary{binary}
+\def\POE@str@relative{relative}
+\def\POE@str@absolute{absolute}
+\def\POE@str@labelref@relgrav{relgrav}
+\def\POE@str@labelref@global{global}
+\def\POE@str@filtertype@bandpass{bandpass}
+\def\POE@str@filtertype@bandstop{bandstop}
+\def\POE@str@filtertype@lowpass{lowpass}
+\def\POE@str@filtertype@highpass{highpass}
+\def\POE@str@couplertype@none{none}
+\def\POE@str@couplertype@ellipse{ellipse}
+\def\POE@str@couplertype@elliptic{elliptic}
+\def\POE@str@couplertype@rectangle{rectangle}
+\def\POE@str@couplertype@cross{cross}
+\def\POE@str@polcontroltype@linear{linear}
+\def\POE@str@polcontroltype@triangle{triangle}
+\def\POE@str@top{top}
+\def\POE@str@bottom{bottom}
+\def\POE@str@center{center}
+\def\POE@str@closed{closed}
+\def\POE@str@opened{opened}
+\def\POE@str@dettype@round{round}
+\def\POE@str@dettype@diode{diode}
+\def\POE@str@bsstyle@cube{cube}
+\def\POE@str@bsstyle@plate{plate}
+\def\POE@str@auto{auto}
+\def\POE@str@center{center}
+\def\POE@str@verbose{verbose}
+\def\POE@str@quiet{quiet}
+\def\POE@Verb#1{\pst@Verb{\pst@optexpdict #1 end }}%
+% \end{macrocode}
+%
+% \section{Parameter and style definitions}
+% The parameters and styles are commented quiet well in the user documentation,
+% here you will find only additional comments about technical peculiarities.
+% \begin{macrocode}
+\newpsstyle{OptComp}{}%
+\define@key[psset]{optexp}{newOptComp}{%
+ \newpsstyle{OptComp}{#1}%
+}
+\define@key[psset]{optexp}{addtoOptComp}{%
+ \addtopsstyle{OptComp}{#1}%
+}
+\newpsstyle{OptionalStyle}{linestyle=dashed,dash=1.5pt 1pt}%
+\newpsstyle{IfcNodeStyle}{dotstyle=x, dotscale=1.5, linecolor=blue}%
+\newpsstyle{Beam}{linecolor=green!90!black, linejoin=1}%
+\define@key[psset]{optexp}{newBeam}{%
+ \newpsstyle{Beam}{#1}%
+}
+\define@key[psset]{optexp}{addtoBeam}{%
+ \addtopsstyle{Beam}{#1}%
+}
+% \end{macrocode}
+% Styles for the automatic fiber connections.
+% \begin{macrocode}
+\newpsstyle{Fiber}{}%
+\define@key[psset]{optexp}{newFiber}{%
+ \newpsstyle{Fiber}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiber}{%
+ \addtopsstyle{Fiber}{#1}%
+}
+\newpsstyle{FiberIn}{style=Fiber}%
+\define@key[psset]{optexp}{newFiberIn}{%
+ \newpsstyle{FiberIn}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberIn}{%
+ \addtopsstyle{FiberIn}{#1}%
+}
+\newpsstyle{FiberOut}{style=Fiber}%
+\define@key[psset]{optexp}{newFiberOut}{%
+ \newpsstyle{FiberOut}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberOut}{%
+ \addtopsstyle{FiberOut}{#1}%
+}
+\newpsstyle{FiberIn1}{style=FiberIn}%
+\define@key[psset]{optexp}{newFiberIn1}{%
+ \newpsstyle{FiberIn1}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberIn1}{%
+ \addtopsstyle{FiberIn1}{#1}%
+}
+\newpsstyle{FiberIn2}{style=FiberIn}%
+\define@key[psset]{optexp}{newFiberIn2}{%
+ \newpsstyle{FiberIn2}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberIn2}{%
+ \addtopsstyle{FiberIn2}{#1}%
+}
+\newpsstyle{FiberOut1}{style=FiberOut}%
+\define@key[psset]{optexp}{newFiberOut1}{%
+ \newpsstyle{FiberOut1}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberOut1}{%
+ \addtopsstyle{FiberOut1}{#1}%
+}
+\newpsstyle{FiberOut2}{style=FiberOut}%
+\define@key[psset]{optexp}{newFiberOut2}{%
+ \newpsstyle{FiberOut2}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberOut2}{%
+ \addtopsstyle{FiberOut2}{#1}%
+}
+% \end{macrocode}
+% Special styles to change only a part of some devices.
+% \begin{macrocode}
+\newpsstyle{ExtendedMirror}{%
+ linestyle=none, hatchwidth=0.5\pslinewidth,
+ hatchsep=1.4\pslinewidth, fillstyle=hlines
+}%
+\newpsstyle{VariableStyle}{%
+ linewidth=0.8\pslinewidth, arrowinset=0, arrowscale=0.8, arrows=<->
+}
+\newpsstyle{SemitransMirror}{linestyle=none, fillstyle=solid,fillcolor=black!30}%
+\newpsstyle{PiezoMirror}{fillstyle=solid,fillcolor=black!30}%
+\newpsstyle{IsolatorArrow}{linewidth=2\pslinewidth, arrowinset=0}
+\newpsstyle{CrystalCaxis}{%
+ linestyle=dashed, dash=2pt 2pt, linewidth=0.7\pslinewidth,
+ arrowinset=0, arrows=->
+}
+\newpsstyle{CrystalLamp}{linewidth=0.6\pslinewidth}
+\newpsstyle{FdlArrow}{arrowinset=0, arrows=->}
+\newpsstyle{VariableCoupler}{arrowinset=0, arrows=->}
+% \end{macrocode}
+%
+% \subsection{General parameters}
+% \begin{macrocode}
+\define@boolkey[psset]{optexp}[POE@component@]{optional}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{usefiberstyle}[true]{}
+\define@boolkey[psset]{optexp}[POE@debug@]{showoptdots}[true]{}
+\define@boolkey[psset]{optexp}[POE@debug@]{showifcnodes}[true]{}
+% \end{macrocode}
+% The positioning parameters.
+% \begin{macrocode}
+\define@choicekey*+[psset]{optexp}{position}[\val\nr]{start,end}{%
+ \ifcase\nr\relax
+ \psset[optexp]{startbox, endbox=false}%
+ \or
+ \psset[optexp]{startbox=false, endbox=true}%
+ \fi
+}{\edef\POE@key@position{#1}}%
+\define@choicekey*+[psset]{optexp}{abspos}[\val\nr]{start,end}{%
+ \ifcase\nr\relax
+ \psset[optexp]{startbox, endbox=false}%
+ \or
+ \psset[optexp]{startbox=false, endbox=true}%
+ \fi
+}{\edef\POE@key@abspos{#1}}%
+\define@key[psset]{optexp}{compshift}{%
+ \pst@checknum{#1}\POE@key@compshift
+}
+\define@key[psset]{optexp}{angle}{%
+ \pst@checknum{#1}\POE@key@angle
+}
+\psset[optexp]{%
+ position={},
+ abspos={},
+ compshift=0,
+ angle=0
+}%
+% \end{macrocode}
+% Layering
+% \begin{macrocode}
+\define@boolkey[psset]{optexp}[POE@]{backlayer}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{frontlayer}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{optexpenv}[true]{}
+\psset[optexp]{backlayer, frontlayer}%
+% \end{macrocode}
+% Labels
+% \begin{macrocode}
+\define@key[psset]{optexp}{labelangle}{%
+ \pst@checknum{#1}\POE@key@labelangle
+}
+\define@key[psset]{optexp}{labeloffset}{%
+ \pst@checknum{#1}\POE@key@labeloffset
+}
+\define@key[psset]{optexp}{labelstyle}{%
+ \def\POE@key@labelstyle{#1}%
+}
+\define@key[psset]{optexp}{labelalign}{%
+ \def\POE@key@labelalign{#1}%
+}
+\define@key[psset]{optexp}{labelref}{%
+ \edef\POE@key@labelref{#1}%
+}
+\define@choicekey*+[psset]{optexp}{innerlabel}%
+ [\val\nr]{true}[true]%
+ {\ifcase\nr\relax
+ \psset[optexp]{labeloffset=0, labelref=relative}%
+ \fi}
+ {\PackageError{pst-optexp}{Unknown value '\val' for innerlabel}}%
+\define@key[psset]{optexp}{label}{%
+ \pst@expandafter\POE@psset@@label{#1} {} {} {} {} {}\@nil
+}%
+\def\POE@psset@@label#1 #2 #3 #4 #5\@nil{%
+ \edef\POE@temp{#4}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{labelref=#4}%
+ \fi
+ \fi
+ \edef\POE@temp{#3}
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{labelalign=#3}%
+ \fi
+ \fi
+ \edef\POE@temp{#2}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{labelangle=#2}%
+ \fi
+ \fi
+ \edef\POE@temp{#1}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{labeloffset=#1}%
+ \fi
+ \fi
+}%
+% \end{macrocode}
+% This is for internal use only, it sets the reference angle for the \opt{labelangle} parameter and can be different for some components.
+% \begin{macrocode}
+\define@key[psset]{optexp}{ref@angle}{%
+ \pst@checknum{#1}\POE@key@labelrefangle
+}%
+\psset[optexp]{%
+ labeloffset=0.8,
+ labelangle=0,
+ labelstyle=,
+ labelalign=c,
+ labelref=relgrav,
+ ref@angle=0
+}%
+% \end{macrocode}
+% External node
+% \begin{macrocode}
+\define@choicekey+[psset]{optexp}{extnodealign}%
+ [\val\nr]{rel,abs,relative,absolute}%
+ {%
+ \ifcase\nr\relax
+ \let\POE@key@extnodealign\POE@str@relative
+ \or
+ \let\POE@key@extnodealign\POE@str@absolute
+ \else
+ \def\POE@key@extnodealign{#1}%
+ \fi
+ }%
+ {\PackageError{pst-optexp}{Unknown value '\val' for extnodealign.}}
+% \end{macrocode}
+% This part was copied and adapted from \cs{psset@@ref} from pstricks.tex
+% \begin{macrocode}
+\define@key[psset]{optexp}{extnode}{%
+ \edef\POE@key@extnode{#1}%
+ \ifx\@empty\POE@key@extnode\else
+ \pst@expandafter\POE@psset@@extnode{#1}\@empty,,\@nil
+ \fi
+}%
+\def\POE@key@extnode@xref{0}%
+\def\POE@key@extnode@yref{0}%
+\def\POE@psset@@extnode#1#2,#3,#4\@nil{%
+ \def\POE@key@extnode@xref{0}%
+ \def\POE@key@extnode@yref{0}%
+ \ifx\@empty#3\@empty
+ \@nameuse{POE@getref@#1}%
+ \@nameuse{POE@getref@#2}%
+ \else
+ \pst@checknum{#1#2}\POE@key@extnode@xref%
+ \pst@checknum{#3}\POE@key@extnode@yref%
+ \fi
+}%
+\def\POE@getref@c{}%
+\def\POE@getref@t{\def\POE@key@extnode@yref{1}}%
+\def\POE@getref@b{\def\POE@key@extnode@yref{-1}}%
+\def\POE@getref@l{\def\POE@key@extnode@xref{-1}}%
+\def\POE@getref@r{\def\POE@key@extnode@xref{1}}%
+\psset[optexp]{%
+ extnode=\@empty,
+ extnodealign=abs
+}%
+% \end{macrocode}
+% Set the rotation reference point. For this to work properly, the components
+% must define a proper \cs{component@ref} macro which sets the origin and
+% sizes. See below for detailed information.
+% \begin{macrocode}
+\define@key[psset]{optexp}{rotateref}{%
+ \def\POE@temp{#1}%
+ \ifx\@empty\POE@temp\else
+ \pst@expandafter\POE@psset@@rotateref{#1}\@empty,,\@nil
+ \fi
+}%
+\def\POE@key@rotate@xref{0}%
+\def\POE@key@rotate@yref{0}%
+\def\POE@psset@@rotateref#1#2,#3,#4\@nil{%
+ \def\POE@key@rotate@xref{0}%
+ \def\POE@key@rotate@yref{0}%
+ \ifx\@empty#3\@empty
+ \@nameuse{POE@getref@rotate@#1}%
+ \@nameuse{POE@getref@rotate@#2}%
+ \else
+ \pst@checknum{#1#2}\POE@key@rotate@xref%
+ \pst@checknum{#3}\POE@key@rotate@yref%
+ \fi}%
+\def\POE@getref@rotate@c{}%
+\def\POE@getref@rotate@t{\def\POE@key@rotate@yref{1}}%
+\def\POE@getref@rotate@b{\def\POE@key@rotate@yref{-1}}%
+\def\POE@getref@rotate@l{\def\POE@key@rotate@xref{-1}}%
+\def\POE@getref@rotate@r{\def\POE@key@rotate@xref{1}}%
+\psset[optexp]{rotateref=c}%
+% \end{macrocode}
+% Naming parameters.
+% \begin{macrocode}
+\define@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@str@basicname@default{tempNode}
+ \edef\POE@str@basicname@prefix{}
+ \gdef\POE@str@basicname@sep{Intern}
+ \edef\POE@str@extnode@postfix{ExtNode}
+ \or
+ \edef\POE@str@basicname@default{@}
+ \edef\POE@str@basicname@prefix{OE@}
+ \gdef\POE@str@basicname@sep{}
+ \edef\POE@str@extnode@postfix{Ext}
+ \fi
+}%
+\psset[optexp]{namingscheme=new}%
+\define@key[psset]{optexp}{b@sicname}{%
+ \edef\POE@key@b@sicname{\POE@str@basicname@prefix#1}%
+}%
+\define@key[psset]{optexp}{compname}{%
+ \ifPOE@insideobj\else
+ \PackageError{pst-optexp}{compname allowed only inside an object}
+ \fi
+ \edef\POE@temp{#1}%
+ \ifx\POE@temp\@empty
+ \edef\POE@key@compname{\the\POE@cnt}%
+ \else
+ \edef\POE@key@compname{#1}%
+ \fi
+% \end{macrocode}
+% check if compname was already defined.
+% \begin{macrocode}
+ \@expandtwoargs\in@{,\POE@key@compname,}{,\POE@complist,}%
+ \ifin@
+ \PackageWarning{pst-optexp}{%
+ ^^Jcompname '\POE@key@compname' already used,\MessageBreak
+ previous nodes will be overwritten!^^J
+ }%
+ \else
+% \end{macrocode}
+%
+% Use definition of \cs{XKV@addtolist@x} with an \cs{xdef} instead of \cs{edef} in order to keep the bookkeeping global.
+% \begin{macrocode}
+ \xdef\POE@complist{%
+ \POE@key@compname\ifx\POE@complist\@empty\else,\fi\POE@complist
+ }%
+ \fi
+}%
+\POE@insideobjtrue
+\psset[optexp]{compname=\@empty}
+\POE@insideobjfalse
+% \end{macrocode}
+% Error handling.
+% \begin{macrocode}
+\define@boolkey[psset]{optexp}[POE@]{pswarning}[true]{}
+\psset[optexp]{pswarning=false}%
+% \end{macrocode}
+%
+% \subsection{Free-ray component parameters}
+% Lens
+% \begin{macrocode}
+\define@key[psset]{optexp}{lensheight}{%
+ \pst@checknum{#1}\POE@key@lensheight
+}
+\define@key[psset]{optexp}{lenswidth}{%
+ \pst@checknum{#1}\POE@key@lenswidth
+ \ifdim\POE@key@lenswidth pt > 0pt
+ \psset[optexp]{thicklens=true}
+ \fi
+}
+\define@key[psset]{optexp}{lensradiusleft}{%
+ \pst@checknum{#1}\POE@key@lensradiusleft
+}
+\define@key[psset]{optexp}{lensradiusright}{%
+ \pst@checknum{#1}\POE@key@lensradiusright
+}
+\define@boolkey[psset]{optexp}[POE@]{thicklens}[true]{}
+\define@key[psset]{optexp}{lensradius}{%
+ \pst@expandafter\POE@psset@@lensradius{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@lensradius#1 #2 #3\@nil{%
+ \edef\POE@temp{#1}%
+ \ifx\POE@temp\@empty\else
+ \psset[optexp]{lensradiusleft=#1}%
+ \fi
+ \edef\POE@temp{#2}%
+ \ifx\POE@temp\@empty
+ \psset[optexp]{lensradiusright=#1}%
+ \else
+ \psset[optexp]{lensradiusright=#2}%
+ \fi
+}%
+\define@key[psset]{optexp}{lens}{%
+ \pst@expandafter\POE@psset@@lens{#1} {} {} {} {} {}\@nil
+}%
+\def\POE@psset@@lens#1 #2 #3 #4 #5\@nil{%
+ \edef\POE@temp{#4}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{lenswidth=#4}%
+ \fi
+ \fi
+ \edef\POE@temp{#3}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{lensheight=#3}
+ \fi
+ \fi
+ \edef\POE@temp{#2}%
+ \ifx\POE@temp\@empty
+ \psset[optexp]{lensradiusright=#1}%
+ \else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{lensradiusright=#2}%
+ \fi
+ \fi
+ \edef\POE@temp{#1}%
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{lensradiusleft=#1}%
+ \fi
+}%
+\psset[optexp]{%
+ lenswidth=0,
+ lensheight=1,
+ lensradiusleft=1,
+ lensradiusright=1
+}%
+% \end{macrocode}
+% Pinhole
+% \begin{macrocode}
+\define@key[psset]{optexp}{innerheight}{%
+ \pst@checknum{#1}\POE@key@innerheight
+}
+\define@key[psset]{optexp}{outerheight}{%
+ \pst@checknum{#1}\POE@key@outerheight
+}
+\define@key[psset]{optexp}{phlinewidth}{%
+ \edef\POE@key@phlinewidth{#1}%
+}
+\define@key[psset]{optexp}{phwidth}{%
+ \edef\POE@key@phwidth{#1}%
+}
+\psset[optexp]{%
+ phlinewidth=2\pslinewidth,
+ phwidth=0,
+ outerheight=1,
+ innerheight=0.1
+}%
+% \end{macrocode}
+% Crystal
+% \begin{macrocode}
+\define@key[psset]{optexp}{crystalwidth}{%
+ \pst@checknum{#1}\POE@key@crystalwidth
+}
+\define@key[psset]{optexp}{crystalheight}{%
+ \pst@checknum{#1}\POE@key@crystalheight
+}
+\define@key[psset]{optexp}{crystalsize}{%
+ \pst@expandafter\POE@psset@@crystalsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@crystalsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \PackageWarning{pst-optexp}{%
+ Parameter 'crystalsize' requires two numbers}%
+ \fi
+ \psset[optexp]{crystalwidth=#1}%
+ \psset[optexp]{crystalheight=#2}%
+}%
+\define@key[psset]{optexp}{caxislength}{%
+ \pst@checknum{#1}\POE@key@caxislength
+}
+\define@boolkey[psset]{optexp}[POE@]{voltage}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{caxisinv}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{lamp}[true]{}
+\define@key[psset]{optexp}{lampscale}{%
+ \pst@checknum{#1}\POE@key@lampscale
+ \pst@divide{\POE@key@lampscale pt}{0.3pt}{\POE@key@lampscale}
+ \addtopsstyle{CrystalLamp}{unit=\POE@key@lampscale}
+ \PackageWarning{pst-optexp}{%
+ Parameter 'lampscale' is deprecated, \MessageBreak
+ use style 'CrystalLamp' instead.}%
+}
+\psset[optexp]{%
+ crystalwidth=1.4,
+ crystalheight=0.6,
+ caxislength=0.3
+}%
+% \end{macrocode}
+% Box
+% \begin{macrocode}
+\define@key[psset]{optexp}{optboxwidth}{%
+ \pst@checknum{#1}\POE@key@optboxwidth
+}
+\define@key[psset]{optexp}{optboxheight}{%
+ \pst@checknum{#1}\POE@key@optboxheight
+}
+\define@key[psset]{optexp}{optboxsize}{%
+ \pst@expandafter\POE@psset@@optboxsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@optboxsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optboxsize' requires two numbers}%
+ \fi
+ \psset[optexp]{optboxwidth=#1, optboxheight=#2}%
+}%
+\define@boolkey[psset]{optexp}[POE@]{endbox}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{startbox}[true]{}
+\psset[optexp]{%
+ optboxwidth=1.4,
+ optboxheight=0.8
+}%
+% \end{macrocode}
+% Plate
+% \begin{macrocode}
+\define@key[psset]{optexp}{platelinewidth}{%
+ \edef\POE@key@platelinewidth{#1}%
+}
+\define@key[psset]{optexp}{plateheight}{%
+ \pst@checknum{#1}\POE@key@plateheight
+}
+\psset[optexp]{%
+ plateheight=1,
+ platelinewidth=2\pslinewidth
+}%
+% \end{macrocode}
+% Optical retardation plate, the height is the same as for \cs{optplate}.
+% \begin{macrocode}
+\define@key[psset]{optexp}{platewidth}{%
+ \pst@checknum{#1}\POE@key@platewidth
+}
+\define@key[psset]{optexp}{platesize}{%
+ \pst@expandafter\POE@psset@@platesize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@platesize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \PackageWarning{pst-optexp}{%
+ Parameter 'platesize' requires two numbers}%
+ \fi
+ \psset[optexp]{platewidth=#1, plateheight=#2}%
+}%
+\psset[optexp]{platewidth=0.1}%
+% \end{macrocode}
+% Detector
+% \begin{macrocode}
+\define@key[psset]{optexp}{detsize}{%
+ \pst@expandafter\POE@psset@@detsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@detsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@detsize
+ \else
+ \let\POE@key@detsize\@empty
+ \pst@checknum{#1}\POE@key@detwidth
+ \pst@checknum{#2}\POE@key@detheight
+ \fi
+}%
+\define@choicekey*+[psset]{optexp}{dettype}[\val\nr]{round,diode}%
+ {\edef\POE@key@dettype{\val}}
+ {\PackageError{pst-optexp}{Unknown value '\val' for dettype.}}
+\newpsstyle{DetectorStyle}{}
+\psset[optexp]{%
+ detsize=0.8,
+ dettype=round
+}%
+% \end{macrocode}
+% Polarization
+% \begin{macrocode}
+\define@key[psset]{optexp}{polsize}{%
+ \pst@checknum{#1}\POE@key@polsize
+}
+\define@key[psset]{optexp}{pollinewidth}{%
+ \edef\POE@key@pollinewidth{#1}%
+ \PackageWarning{pst-optexp}{%
+ Parameter 'pollinewidth' is deprecated, \MessageBreak
+ use style 'Polarization'.}%
+}%
+% \end{macrocode}
+% This is defined manually, to avoid printing the warning inside the key definition above.
+% \begin{macrocode}
+\def\POE@key@pollinewidth{0.7\pslinewidth}%
+\newpsstyle{Polarization}{%
+ linewidth=\POE@key@pollinewidth,
+ arrowscale=0.8, dotsize=3\pslinewidth}
+\define@choicekey+[psset]{optexp}{poltype}%
+ [\val\nr]{parallel,misc,perp,rcirc,lcirc}%
+ {\edef\POE@key@poltype{#1}}
+ {\PackageError{pst-optexp}{Unknown value '\val' for poltype.}%
+}
+\psset[optexp]{%
+ poltype=parallel,
+ polsize=0.6
+}%
+% \end{macrocode}
+% Optical diode
+% \begin{macrocode}
+\define@key[psset]{optexp}{optdiodesize}{%
+ \pst@checknum{#1}\POE@key@optdiodesize
+}
+\psset[optexp]{optdiodesize=0.8}%
+% \end{macrocode}
+% Dove prism
+% \begin{macrocode}
+\define@key[psset]{optexp}{doveprismsize}{%
+ \pst@expandafter\POE@psset@@doveprismsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@doveprismsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@doveprismheight
+ \pstFPmul\POE@key@doveprismwidth{3}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@doveprismwidth
+ \pst@checknum{#2}\POE@key@doveprismheight
+ \fi
+}%
+\psset[optexp]{doveprismsize=0.6}%
+% \end{macrocode}
+% Beamsplitter
+% \begin{macrocode}
+\define@key[psset]{optexp}{bssize}{%
+ \pst@checknum{#1}\POE@key@bssize
+}
+\define@key[psset]{optexp}{bsstyle}{%
+ \edef\POE@key@bsstyle{#1}%
+}
+\psset[optexp]{%
+ bssize=0.8,
+ bsstyle=cube
+}%
+% \end{macrocode}
+% Mirror
+% \begin{macrocode}
+\define@key[psset]{optexp}{mirrorwidth}{%
+ \pst@checknum{#1}\POE@key@mirrorwidth
+}
+\define@key[psset]{optexp}{mirrorlinewidth}{%
+ \edef\POE@key@mirrorlinewidth{#1}%
+}
+\define@choicekey*[psset]{optexp}{mirrortype}%
+ [\val\nr]{piezo,extended,plain,semitrans}{%
+ \edef\POE@key@mirrortype{#1}%
+}
+\define@key[psset]{optexp}{mirrordepth}{%
+ \pst@checknum{#1}\POE@key@mirrordepth
+}
+\define@key[psset]{optexp}{mirrorradius}{%
+ \pst@checknum{#1}\POE@key@mirrorradius
+}
+\define@boolkey[psset]{optexp}[POE@]{variable}[true]{}
+\psset[optexp]{%
+ mirrorwidth=1,
+ mirrordepth=0.15,
+ mirrorradius=0,
+ mirrortype=plain,
+ mirrorlinewidth=2\pslinewidth
+}%
+% \end{macrocode}
+% Grating
+%
+% These are the old \opt{optgrid*} parameters, which have been deprecated.
+% \begin{macrocode}
+\define@key[psset]{optexp}{optgridcount}{%
+ \pst@checknum{#1}\POE@key@gratingcount
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridcount' is deprecated,\MessageBreak
+ use 'gratingcount' instead.}%
+}%
+\define@key[psset]{optexp}{optgridwidth}{%
+ \pst@checknum{#1}\POE@key@gratingwidth
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridwidth' is deprecated,\MessageBreak
+ use 'gratingwidth' instead.}%
+}%
+\define@key[psset]{optexp}{optgridheight}{%
+ \pst@checknum{#1}\POE@key@gratingheight
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridheight' is deprecated,\MessageBreak
+ use 'gratingheight' instead.}%
+}%
+\define@choicekey*[psset]{optexp}{optgridtype}%
+ [\val\nr]{binary,blazed}{%
+ \edef\POE@key@gratingtype{#1}%
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridtype' is deprecated,\MessageBreak
+ use 'gratingtype' instead.}%
+}%
+\define@key[psset]{optexp}{optgriddepth}{%
+ \pst@checknum{#1}\POE@key@gratingdepth
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgriddepth' is deprecated,\MessageBreak
+ use 'gratingdepth' instead.}%
+}%
+\define@key[psset]{optexp}{optgridlinewidth}{%
+ \edef\POE@key@gratinglinewidth{#1}%
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridlinewidth' is deprecated,\MessageBreak
+ use 'gratinglinewidth' instead.}%
+}%
+% \end{macrocode}
+% These are the new grating parameters.
+% \begin{macrocode}
+\define@key[psset]{optexp}{gratingcount}{%
+ \pst@checknum{#1}\POE@key@gratingcount
+}
+\define@key[psset]{optexp}{gratingwidth}{%
+ \pst@checknum{#1}\POE@key@gratingwidth
+}
+\define@key[psset]{optexp}{gratingheight}{%
+ \pst@checknum{#1}\POE@key@gratingheight
+}
+\define@choicekey*[psset]{optexp}{gratingtype}%
+ [\val\nr]{binary,blazed}{%
+ \edef\POE@key@gratingtype{#1}%
+}
+\define@key[psset]{optexp}{gratingdepth}{%
+ \pst@checknum{#1}\POE@key@gratingdepth
+}
+\define@key[psset]{optexp}{gratinglinewidth}{%
+ \edef\POE@key@gratinglinewidth{#1}%
+}
+\define@boolkey[psset]{optexp}[POE@]{reverse}[true]{}
+\psset[optexp]{%
+ gratingcount=10,
+ gratingwidth=1,
+ gratingheight=0.15,
+ gratingdepth=0.075,
+ gratingtype=blazed,
+ gratinglinewidth=0.7\pslinewidth,
+}%
+% \end{macrocode}
+% Penta prism
+% \begin{macrocode}
+\define@key[psset]{optexp}{pentaprismsize}{%
+ \pst@checknum{#1}\POE@key@pentaprismsize
+}
+\psset[optexp]{pentaprismsize=0.7}
+% \end{macrocode}
+% Right-angle prism
+% \begin{macrocode}
+\define@key[psset]{optexp}{raprismsize}{%
+ \pst@checknum{#1}\POE@key@raprismsize
+}
+\psset[optexp]{raprismsize=1.5}
+% \end{macrocode}
+% Prism
+% \begin{macrocode}
+\define@key[psset]{optexp}{prismsize}{%
+ \pst@checknum{#1}\POE@key@prismsize
+}
+\define@key[psset]{optexp}{prismangle}{%
+ \pst@checknum{#1}\POE@key@prismangle
+}
+\define@choicekey+[psset]{optexp}{prismalign}[\val\nr]%
+ {auto,center}%
+ {\def\POE@key@prismalign{#1}}%
+ {\PackageError{pst-optexp}{Unknown value '\val' for prismalign.}}%
+\psset[optexp]{%
+ prismsize=1,
+ prismangle=60,
+ prismalign=auto
+}%
+% \end{macrocode}
+% \subsection{Parameters of fiber-optical components}
+% \subsubsection{fiber}
+% \begin{macrocode}
+\define@key[psset]{optexp}{fiberloops}{%
+ \pst@checknum{#1}\POE@key@fiberloops
+}
+\define@key[psset]{optexp}{fiberloopradius}{%
+ \pst@checknum{#1}\POE@key@fiberloopradius
+}
+\define@key[psset]{optexp}{fiberloopsep}{%
+ \pst@checknum{#1}\POE@key@fiberloopsep
+}
+\psset[optexp]{%
+ fiberloops=3,
+ fiberloopradius=0.4,
+ fiberloopsep=0.3
+}%
+% \end{macrocode}
+% \subsubsection{optfilter}
+% \begin{macrocode}
+\define@key[psset]{optexp}{filtersize}{%
+ \pst@checknum{#1}\POE@key@filtersize
+}
+\define@choicekey+[psset]{optexp}{filtertype}[\val\nr]%
+ {bandstop,bandpass,lowpass,highpass}%
+ {\def\POE@key@filtertype{#1}}%
+ {\PackageError{pst-optexp}{Unknown value '\val' for filtertype}}
+\newpsstyle{FilterStyle}{}
+\psset[optexp]{%
+ filtersize=0.8,
+ filtertype=bandpass
+}%
+% \end{macrocode}
+% Polarization controller
+% \begin{macrocode}
+\define@key[psset]{optexp}{polcontrolsize}{%
+ \pst@checknum{#1}\POE@key@polcontrolsize
+}
+\define@choicekey+[psset]{optexp}{polcontroltype}[\val\nr]%
+ {linear,triangle}%
+ {\def\POE@key@polcontroltype{#1}}%
+ {\PackageError{pst-optexp}{Unknown polcontroltype '\val'}}
+\psset[optexp]{%
+ polcontrolsize=0.15,
+ polcontroltype=linear
+}%
+% \end{macrocode}
+%
+% \subsubsection{optamp}
+% \begin{macrocode}
+\define@key[psset]{optexp}{optampsize}{%
+ \pst@expandafter\POE@psset@@optampsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@optampsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@optampheight
+ \pstFPmul\POE@key@optampwidth{0.866}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@optampwidth
+ \pst@checknum{#2}\POE@key@optampheight
+ \fi
+}%
+\psset[optexp]{optampsize=0.8}
+% \end{macrocode}
+% Mach-Zehnder modulator
+% \begin{macrocode}
+\define@key[psset]{optexp}{optmzmsize}{%
+ \pst@expandafter\POE@psset@@optmzmsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@optmzmsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@optmzmheight
+ \pstFPmul\POE@key@optmzmwidth{1.6}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@optmzmwidth
+ \pst@checknum{#2}\POE@key@optmzmheight
+ \fi
+}%
+\psset[optexp]{optmzmsize=0.8}
+% \end{macrocode}
+% \subsubsection{Isolator}
+% \begin{macrocode}
+\define@key[psset]{optexp}{isolatorsize}{%
+ \pst@expandafter\POE@psset@@isolatorsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@isolatorsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@isolatorheight
+ \pstFPmul\POE@key@isolatorwidth{1.6}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@isolatorwidth
+ \pst@checknum{#2}\POE@key@isolatorheight
+ \fi
+}%
+\psset[optexp]{isolatorsize=0.6}%
+% \end{macrocode}
+% Fiber polarizer
+% \begin{macrocode}
+\define@key[psset]{optexp}{fiberpolsize}{%
+ \pst@expandafter\POE@psset@@fiberpolsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@fiberpolsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@fiberpolheight
+ \pstFPmul\POE@key@fiberpolwidth{1.6}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@fiberpolwidth
+ \pst@checknum{#2}\POE@key@fiberpolheight
+ \fi
+}%
+\psset[optexp]{fiberpolsize=0.6}%
+% \end{macrocode}
+% Optical switch
+% \begin{macrocode}
+\define@key[psset]{optexp}{switchsize}{%
+ \pst@checknum{#1}\POE@key@switchsize
+}
+\define@choicekey+[psset]{optexp}{switchstyle}%
+ [\val\nr]{opened,closed}%
+ {\edef\POE@key@switchstyle{#1}}%
+ {\PackageError{pst-optexp}{Unknown value '\val' for switchstyle.}}
+\psset[optexp]{%
+ switchsize=0.8,
+ switchstyle=opened
+}%
+% \end{macrocode}
+% \subsubsection{Fiber delay line}
+% \begin{macrocode}
+\define@key[psset]{optexp}{fdlsize}{%
+ \pst@expandafter\POE@psset@@fdlsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@fdlsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@fdlheight
+ \pstFPmul\POE@key@fdlwidth{1.6}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@fdlwidth
+ \pst@checknum{#2}\POE@key@fdlheight
+ \fi
+}%
+\psset[optexp]{fdlsize=0.6}%
+% \end{macrocode}
+% Fiber collimator
+% \begin{macrocode}
+\define@key[psset]{optexp}{fibercolsize}{%
+ \pst@expandafter\POE@psset@@fibercolsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@fibercolsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@fibercolheight
+ \pstFPmul\POE@key@fibercolwidth{0.866}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@fibercolwidth
+ \pst@checknum{#2}\POE@key@fibercolheight
+ \fi
+}%
+\psset[optexp]{fibercolsize=0.3}%
+% \end{macrocode}
+% Optical Circulator
+% \begin{macrocode}
+\define@key[psset]{optexp}{optcircsize}{%
+ \pst@checknum{#1}\POE@key@optcircsize
+}%
+\define@key[psset]{optexp}{optcircangleA}{%
+ \pst@checknum{#1}\POE@key@optcircangleA
+}%
+\define@key[psset]{optexp}{optcircangleB}{%
+ \pst@checknum{#1}\POE@key@optcircangleB
+}%
+\define@key[psset]{optexp}{optcircangle}{%
+ \pst@expandafter\POE@psset@@optcircangle{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@optcircangle#1 #2 #3\@nil{%
+ \edef\POE@tempA{#1}%
+ \edef\POE@tempB{#2}%
+ \ifx\\#2\\
+ \PackageError{pst-optexp}{optcircangle requires two numbers}%
+ \else\ifx\\#1\\
+ \PackageError{pst-optexp}{optcircangle requires two numbers}%
+ \else
+ \psset[optexp]{optcircangleA=#1, optcircangleB=#2}%
+ \fi\fi
+}%
+\psset[optexp]{%
+ optcircsize=0.8,
+ optcircangle=-160 -20
+}%
+\newpsstyle{OptCircArrow}{unit=0.7, arrows=->, arrowinset=0}
+% \end{macrocode}
+%
+% \subsubsection{Coupler}
+% \begin{macrocode}
+\define@key[psset]{optexp}{couplersize}{%
+ \pst@expandafter\POE@psset@@couplersize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@couplersize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pstFPmul\POE@key@couplerheight{0.8}{#1}
+ \pstFPmul\POE@key@couplerwidth{2}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@couplerwidth
+ \pst@checknum{#2}\POE@key@couplerheight
+ \fi
+}%
+\define@key[psset]{optexp}{couplersep}{%
+ \pst@checknum{#1}\POE@key@couplersep
+}
+\define@choicekey+[psset]{optexp}{couplertype}%
+ [\val\nr]{none,elliptic,ellipse,cross,rectangle}%
+ {%
+ \edef\POE@key@couplertype{#1}
+ \ifx\POE@key@couplertype\POE@str@couplertype@elliptic
+ \let\POE@key@couplertype\POE@str@couplertype@ellipse
+ \fi
+ }%
+ {\PackageError{pst-optexp}{Unknown value '\val' for couplertype.}}
+\define@key[psset]{optexp}{align}{%
+ \psset[optexp]{coupleralign=#1}%
+ \PackageWarning{pst-optexp}{%
+ Parameter 'align' is deprecated,\MessageBreak
+ use 'coupleralign' instead.}%
+}
+\define@choicekey+[psset]{optexp}{coupleralign}%
+ [\val\nr]{t,b,c,top,bottom,center}%
+ {%
+ \ifcase\nr\relax
+ \let\POE@key@coupleralign\POE@str@top
+ \or
+ \let\POE@key@coupleralign\POE@str@bottom
+ \or
+ \let\POE@key@coupleralign\POE@str@center
+ \else
+ \def\POE@key@coupleralign{#1}%
+ \fi}%
+ {\PackageError{pst-optexp}{Unknown value '\val' for coupleralign.}}
+\psset[optexp]{%
+ couplersize=0.2,
+ couplersep=0.05,
+ coupleralign=center,
+ couplertype=elliptic
+}%
+% \end{macrocode}
+% \subsection{Beam-connection parameters}
+% The keys related to the \cs{draw*} macros.
+%
+% Connect a component directly with its reference nodes using \cs{drawbeam}.
+% \begin{macrocode}
+\define@boolkey[psset]{optexp}[POE@]{beam}[true]{}
+% \end{macrocode}
+% \begin{macrocode}
+\define@key[psset]{optexp}{refractiveindex}{%
+ \psset[optexp]{n=#1}%
+ \PackageWarning{pst-optexp}{%
+ Option 'refractiveindex' is deprecated,\MessageBreak
+ use 'n' instead}%
+}%
+\define@key[psset]{optexp}{n}{%
+ \POE@parsealg{n}#1\@nil
+}
+\def\POE@parsealg#1#2#3\@nil{%
+ \ifx#2*\relax
+ \POE@@parsealg#3\@nil
+ \expandafter\let\csname POE@key@#1\endcsname\POE@tempA
+ \else
+ \@namedef{POE@key@#1}{[#2#3] }%
+ \fi
+}
+\def\POE@@parsealg#1#2\@nil{%
+ \edef\POE@tempA{tx@Dict begin (#1#2) AlgParser end }%
+}
+\define@key[psset]{optexp}{beamangle}{%
+ \edef\POE@key@beamangle{#1}%
+}%
+\define@key[psset]{optexp}{beampos}{%
+ \edef\POE@key@beampos{#1}%
+}%
+\define@key[psset]{optexp}{beamdiv}{%
+ \edef\POE@key@beamdiv{#1}%
+}%
+\define@key[psset]{optexp}{beamwidth}{%
+ \edef\POE@key@beamwidth{#1}%
+}%
+\define@boolkey[psset]{optexp}[POE@]{startinside}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{stopinside}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{beaminsidefirst}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{beaminsidelast}[true]{}%
+\define@choicekey+[psset]{optexp}{savebeampoints}%
+ [\val\nr]{true,false}[true]{%
+ \ifcase\nr\relax
+ \def\POE@key@savebeampoints{1}
+ \or
+ \def\POE@key@savebeampoints{0}
+ \fi
+ }{%
+ \ifnum9<1#1
+ \def\POE@key@savebeampoints{#1}
+ \else
+ \PackageError{pst-optexp}%
+ {savebeampoints must be a positive integer or 0.}%
+ \fi
+ \@expandtwoargs\in@{,\POE@key@savebeampoints,}{,\POE@beamlist,}%
+ \ifin@\else
+ \xdef\POE@beamlist{%
+ \POE@key@savebeampoints
+ \ifx\POE@beamlist\@empty\else,\fi\POE@beamlist
+ }%
+ \fi
+}%
+\define@choicekey+[psset]{optexp}{loadbeampoints}%
+ [\val\nr]{true,false}[true]{%
+ \ifcase\nr\relax
+ \def\POE@key@loadbeampoints{1}
+ \or
+ \def\POE@key@loadbeampoints{0}
+ \fi
+ }{%
+ \ifnum9<1#1
+ \def\POE@key@loadbeampoints{#1}%
+ \else
+ \PackageError{pst-optexp}%
+ {loadbeampoints must be a positive integer or 0.}%
+ \fi
+ \@expandtwoargs\in@{,\POE@key@loadbeampoints,}{,\POE@beamlist,}%
+ \ifin@\else
+ \xdef\POE@beamlist{%
+ \POE@key@loadbeampoints
+ \ifx\POE@beamlist\@empty\else,\fi\POE@beamlist
+ }%
+ \fi
+}%
+\define@key[psset]{optexp}{loadbeam}[true]{%
+ \setkeys+[psset]{optexp}{loadbeampoints=#1}%
+ \ifdim\POE@key@loadbeampoints pt>0pt
+ \POE@loadbeamtrue
+ \else
+ \POE@loadbeamfalse
+ \fi
+}%
+\define@key[psset]{optexp}{savebeam}[true]{%
+ \setkeys+[psset]{optexp}{savebeampoints=#1}%
+ \ifdim\POE@key@savebeampoints pt>0pt
+ \POE@savebeamtrue
+ \else
+ \POE@savebeamfalse
+ \fi
+}%
+\define@boolkey[psset]{optexp}[POE@]{beaminside}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{allowbeaminside}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{raytrace}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{useNA}[true]{}%
+\define@key[psset]{optexp}{skipconn}{%
+ \pst@checknum{#1}\POE@key@skipconn
+}%
+\define@choicekey+[psset]{optexp}{beamalign}%
+ [\val\nr]{rel,abs,relative,absolute}%
+ {%
+ \ifcase\nr\relax
+ \let\POE@key@beamalign\POE@str@relative
+ \or
+ \let\POE@key@beamalign\POE@str@absolute
+ \else
+ \def\POE@key@beamalign{#1}%
+ \fi
+ }%
+ {\PackageError{pst-optexp}{Unknown value '\val' for beamalign.}}
+\define@key[psset]{optexp}{ArrowInsideMinLength}{%
+ \def\POE@key@ArrowInsideMinLength{#1}%
+}%
+\define@key[psset]{optexp}{ArrowInsideMaxLength}{%
+ \def\POE@key@ArrowInsideMaxLength{#1}%
+}%
+\psset[optexp]{%
+ raytrace=true
+ ,useNA=true
+ ,startinside=false
+ ,stopinside=false
+ ,allowbeaminside=true
+ ,beaminside=true
+ ,beaminsidefirst=false
+ ,beaminsidelast=false
+ ,loadbeam=false
+ ,savebeam=false
+ ,loadbeampoints=false
+ ,savebeampoints=true
+ ,beamangle=0
+ ,beampos=\@empty
+ ,beamalign=relative
+ ,beamwidth=0
+ ,beamdiv=0
+ ,n=1.5
+ ,skipconn=0
+ ,ArrowInsideMinLength=0.2
+ ,ArrowInsideMaxLength=-1
+}%
+% \end{macrocode}
+%
+% \subsection{Fiber-connection parameters}
+% Select which fibers are drawn automatically. The parameters \opt{fiber},
+% \opt{fiberin} and \opt{fiberout} do not only select which fibers are drawn,
+% but do also enable fiber connecting for the free-ray components. So you should
+% use these switches only locally, or they must be followed by a
+% \opt{fiber@=false}. (Need to rethink this part\ldots).
+% \begin{macrocode}
+\define@key[psset]{optexp}{fiber}[all]{%
+ \POE@psset@fibercheck#1\@nil
+}
+\def\POE@psset@fibercheck#1#2\@nil{%
+ \ifx#1*\relax
+ \ifx\\#2\\
+ \psset[optexp]{fiber@preset=all}%
+ \else
+ \psset[optexp]{fiber@preset=#2}%
+ \fi
+ \else\ifx#1+\relax
+ \ifx\\#2\\
+ \psset[optexp]{fiber@all=all}%
+ \else
+ \psset[optexp]{fiber@all=#2}%
+ \fi
+ \else
+ \psset[optexp]{fiber@all=#1#2}%
+ \psset[optexp]{fiber@preset=#1#2}%
+ \fi\fi
+}%
+\define@choicekey*+[psset]{optexp}{fiber@preset}%
+ [\val\nr]{false,none,true,all}[all]{%
+ \ifcase\nr\relax
+ \POE@getfiberpreset@none
+ \or
+ \POE@getfiberpreset@none
+ \or
+ \POE@getfiberpreset@all
+ \or
+ \POE@getfiberpreset@all
+ \fi
+}{%
+ \ifx\@empty\val
+ \POE@getfiberpreset@none
+ \else
+ \pst@expandafter\POE@psset@@fiberpreset{#1}\@empty,,\@nil
+ \fi
+}%
+\def\POE@psset@@fiberpreset#1#2,#3,#4\@nil{%
+ \POE@getfiberpreset@all
+ \ifx\\#3\\
+ \@nameuse{POE@getfiberpreset@#1}%
+ \@nameuse{POE@getfiberpreset@#2}%
+ \fi
+}%
+\def\POE@getfiberpreset@none{%
+ \psset[optexp]{fiberpreset@=false}%
+}%
+\def\POE@getfiberpreset@all{%
+ \psset[optexp]{%
+ fiberpreset@, fiberpresetin@, fiberpresetout@,
+ fiberpresetin@top, fiberpresetin@bottom,
+ fiberpresetout@top, fiberpresetout@bottom}%
+}%
+\def\POE@getfiberpreset@t{%
+ \psset[optexp]{fiberpresetin@bottom=false, fiberpresetout@bottom=false}}%
+\def\POE@getfiberpreset@b{%
+ \psset[optexp]{fiberpresetin@top=false, fiberpresetout@top=false}}%
+\def\POE@getfiberpreset@l{\psset[optexp]{fiberpresetout@=false}}%
+\def\POE@getfiberpreset@r{\psset[optexp]{fiberpresetin@=false}}%
+\let\POE@getfiberpreset@i\POE@getfiberpreset@l
+\let\POE@getfiberpreset@o\POE@getfiberpreset@r
+% \end{macrocode}
+%
+% This code is for all components, fiber-optical and free-ray.
+% \begin{macrocode}
+\define@choicekey*+[psset]{optexp}{fiber@all}%
+ [\val\nr]{false,none,true,all}[all]{%
+ \ifcase\nr\relax
+ \POE@getfiber@none
+ \or
+ \POE@getfiber@none
+ \or
+ \POE@getfiber@all
+ \or
+ \POE@getfiber@all
+ \fi
+}{%
+ \ifx\@empty\val
+ \POE@getfiber@none
+ \else
+ \pst@expandafter\POE@psset@@fiber{#1}\@empty,,\@nil
+ \fi
+}%
+\def\POE@psset@@fiber#1#2,#3,#4\@nil{%
+ \POE@getfiber@all
+ \ifx\@empty#3\@empty
+ \@nameuse{POE@getfiber@#1}%
+ \@nameuse{POE@getfiber@#2}%
+ \fi
+}%
+\def\POE@getfiber@none{%
+ \psset[optexp]{fiber@=false}%
+}%
+\def\POE@getfiber@all{%
+ \psset[optexp]{%
+ fiber@, fiberin@, fiberout@,
+ fiberin@top, fiberin@bottom,
+ fiberout@top, fiberout@bottom}%
+}%
+\def\POE@getfiber@t{%
+ \psset[optexp]{fiberin@bottom=false, fiberout@bottom=false}}%
+\def\POE@getfiber@b{%
+ \psset[optexp]{fiberin@top=false, fiberout@top=false}}%
+\def\POE@getfiber@l{\psset[optexp]{fiberout@=false}}%
+\def\POE@getfiber@r{\psset[optexp]{fiberin@=false}}%
+\let\POE@getfiber@i\POE@getfiber@l
+\let\POE@getfiber@o\POE@getfiber@r
+% \end{macrocode}
+% These are the internal boolkeys for the fiber choices done with \opt{fiberin},
+% \opt{fiberout} and \opt{fiber}. Do not use them directly.
+% \begin{macrocode}
+\define@boolkey[psset]{optexp}[POE@]{fiber@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{nofiber@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberin@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberin@top}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberin@bottom}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberout@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberout@top}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberout@bottom}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpreset@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{nofiberpreset@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetin@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetin@top}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetin@bottom}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetout@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetout@top}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetout@bottom}[true]{}
+\psset[optexp]{fiber=*all}%
+\define@key[psset]{optexp}{fiberangleA}{%
+ \pst@checknum{#1}\POE@key@fiberangleA
+}%
+\define@key[psset]{optexp}{fiberangleB}{%
+ \pst@checknum{#1}\POE@key@fiberangleB
+}%
+\define@choicekey+[psset]{optexp}{fiberalign}%
+ [\val\nr]{rel,abs,relative,center,absolute}%
+ {%
+ \ifcase\nr\relax
+ \let\POE@key@fiberalign\POE@str@relative
+ \or
+ \let\POE@key@fiberalign\POE@str@absolute
+ \else
+ \def\POE@key@fiberalign{#1}%
+ \fi
+ }%
+ {\PackageError{pst-optexp}{Unknown value '\val' for fiberalign.}}%
+\define@key[psset]{optexp}{fiberstyle}{%
+ \@ifundefined{nc#1}%
+ {\PackageError{pst-optexp}{Unknown value '#1' for fiberstyle.}}%
+ {\def\POE@key@fiberstyle{#1}}}
+\psset[optexp]{%
+ fiberangleA=0,
+ fiberangleB=0,
+ fiberalign=relative,
+ fiberstyle=curve
+}%
+% \end{macrocode}
+% Which nodes to take for the automatic fiber connections.
+% \begin{macrocode}
+\define@choicekey+[psset]{optexp}{startnode}%
+ [\val\nr]{auto,1,2,3,4,N}%
+ {\edef\POE@key@startnode{\val}}
+ {\PackageError{pst-optexp}{Unknown startnode number '\val'}}
+\define@choicekey+[psset]{optexp}{stopnode}[\val\nr]{auto,1,2,3,4,N}%
+ {\edef\POE@key@stopnode{\val}}
+ {\PackageError{pst-optexp}{Unknown stopnode number '\val'}}
+\psset[optexp]{%
+ startnode=auto,
+ stopnode=auto
+}%
+% \end{macrocode}
+%
+% \section{Layering}
+% \begin{macrocode}
+\newenvironment{optexp}{\Collect@Body\POE@collect}{}
+\long\def\POE@collect#1{%
+ \psset[optexp]{optexpenv}
+ \global\POE@oldcnt=\POE@cnt
+ \bgroup
+ \psset[optexp]{backlayer=true, frontlayer=false}#1%
+ \egroup
+ \gdef\POE@complist{}\global\POE@cnt=\POE@oldcnt\relax
+ \psset[optexp]{backlayer=false, frontlayer=true}%
+ #1}%
+% \end{macrocode}
+% \begin{macro}{\backlayer}
+% \begin{macrocode}
+\def\backlayer#1{\ifPOE@backlayer #1\fi\ignorespaces}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\frontlayer}
+% \begin{macrocode}
+\def\frontlayer#1{\ifPOE@frontlayer #1\fi\ignorespaces}
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Connection code}
+% \subsection{drawfiber}
+% \begin{macro}{\POE@getnode}
+% \begin{macrocode}
+\def\POE@getnode#1#2\@nil{%
+ \ifx(#1\relax%)
+ \POE@getcoor#1#2
+ \edef\POE@temp{{\pst@coor}}%
+ \else
+ \edef\POE@temp{/\oenode{}{#1#2}\space}%
+ \fi%
+}%
+% \end{macrocode}
+% \begin{macro}{\POE@getcoor}
+% \begin{macrocode}
+\def\POE@getcoor(#1){\pst@@getcoor{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \end{macro}
+%
+% \begin{macro}{\drawfiber}
+% \begin{macrocode}
+\def\drawfiber{\drawfiber@{Fiber}}%
+\def\drawfiber@#1{%
+ \ifPst@custom\else
+ \def\pst@par{style=#1}%
+ \fi
+ \@ifnextchar[%]
+ {\drawfiber@i}{\drawfiber@i[]}%
+}%
+\def\drawfiber@i[#1]#2{%
+ \addafter@par{#1}%
+ \def\POE@tempe{#2}%
+ \@ifnextchar\bgroup{\drawfiber@ii}{}%
+}%
+\def\drawfiber@ii#1{%
+ \expandafter\drawfiber@iii\expandafter{\POE@tempe}{#1}%
+ \def\POE@tempe{#1}%
+ \@ifnextchar\bgroup{\drawfiber@ii}{}%
+}%
+\def\drawfiber@iii#1#2{%
+ \begingroup
+ \let\psk@angleA\relax
+ \let\psk@angleB\relax
+ \use@par
+ \def\POE@tempa{#1}
+ \ifx\POE@tempa\@empty
+ \edef\POE@comps{/\oenode{}{}\space}
+ \else
+ \expandafter\POE@getnode#1\@nil
+ \edef\POE@comps{\POE@temp}
+ \fi
+ \def\POE@tempb{#2}
+ \ifx\POE@tempb\@empty
+ \edef\POE@comps{/\oenode{}{}\space \POE@comps}
+ \else
+ \expandafter\POE@getnode#2\@nil
+ \edef\POE@comps{\POE@temp\space \POE@comps}
+ \fi
+ \ifPOE@backlayer
+ \ifx\POE@key@startnode\POE@str@auto\else
+ \POE@pnode{/\POE@key@startnode\space \POE@comps exch pop
+ \POE@dict{getsubnode} \tx@UserCoor}{@@A}
+ \fi
+ \ifx\POE@key@stopnode\POE@str@auto\else
+ \POE@pnode{/\POE@key@stopnode\space \POE@comps pop
+ \POE@dict{getsubnode} \tx@UserCoor}{@@B}
+ \fi
+ \ifx\POE@key@startnode\POE@str@auto
+ \ifx\POE@key@stopnode\POE@str@auto
+ \POE@pnode{\POE@comps exch \POE@dict{NearestNode}
+ \tx@UserCoor}{@@A}
+ \POE@pnode{\POE@comps pop
+ \POE@dict{/N@@@A @GetCenter ToVec NearestNode}
+ \tx@UserCoor}{@@B}
+ \else
+ \POE@pnode{\POE@comps exch pop /N@@@B
+ \POE@dict{@GetCenter ToVec NearestNode}
+ \tx@UserCoor}{@@A}
+ \fi
+ \else\ifx\POE@key@stopnode\POE@str@auto
+ \POE@pnode{\POE@comps pop /N@@@A
+ \POE@dict{@GetCenter ToVec NearestNode}
+ \tx@UserCoor}{@@B}
+ \fi\fi
+ \pst@getcoor{@@A}\POE@tempa
+ \pst@getcoor{@@B}\POE@tempb
+ \ifx\psk@angleA\relax
+ \ifx\POE@key@fiberalign\POE@str@absolute
+ \psset{angleA=\POE@key@fiberangleA}%
+ \else
+ \psset{angleA=! \POE@dict{%
+ \POE@tempb \POE@tempa \POE@comps exch
+ \POE@key@fiberalign\space RelFiberAngle
+ \POE@key@fiberangleA\space add }
+ }%
+ \fi
+ \fi
+ \ifx\psk@angleB\relax
+ \ifx\POE@key@fiberalign\POE@str@absolute
+ \psset{angleB=\POE@key@fiberangleB}%
+ \else
+ \psset{angleB=! \POE@dict{%
+ \POE@tempa \POE@tempb \POE@comps
+ \POE@key@fiberalign\space RelFiberAngle
+ \POE@key@fiberangleB\space add}
+ }%
+ \fi
+ \fi
+ \@nameuse{nc\POE@key@fiberstyle}{@@A}{@@B}
+ \fi
+ \endgroup
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{POE@pnode}
+% Do some trickery to define \cs{pnode} inside \cs{pscustom}, which is
+% required if one wants to use \cs{drawfiber} inside \cs{pscustom}.
+% \begin{macrocode}
+\def\POE@pnode#1#2{%
+ \ifPst@custom
+ \code{%
+ gsave
+ /currentpoint load stopped { 0 0 moveto } if
+ 1 8.3021995 div dup neg scale
+ tx@NodeDict begin
+ {#1 \tx@ScreenCoor } false /N@#2 10 {InitPnode}
+ /NodeScale {} def NewNode
+ end
+ grestore
+ }%
+ \else
+ \pnode(!#1){#2}
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{drawbeam}
+%
+% \begin{macro}{\begin@BeamObj}
+% \begin{macrocode}
+\def\begin@BeamObj{%
+ \addbefore@par{n=n}%
+ \begin@SpecialObj%
+ \addto@pscode{%
+ \pst@optexpdict
+ /loadbeampoints \POE@key@loadbeampoints\space def
+ /loadbeam \ifPOE@loadbeam true \else false \fi def
+ /beamangle \POE@key@beamangle\space def
+ /savebeampoints \POE@key@savebeampoints\space def
+ /savebeam \ifPOE@savebeam true \else false \fi def
+ /beaminsidefirst \ifPOE@beaminsidefirst true \else false \fi def
+ /beaminsidelast \ifPOE@beaminsidelast true \else false \fi def
+ /beaminside \ifPOE@beaminside true \else false \fi def
+ /startinside \ifPOE@startinside true \else false \fi def
+ /stopinside \ifPOE@stopinside true \else false \fi def
+ /connectifc \ifPOE@raytrace false \else true \fi def
+ /beamalign
+ \ifx\POE@key@beamalign\POE@str@absolute\space
+ absolute
+ \else
+ relative
+ \fi def
+ /skipconn \POE@key@skipconn\space def
+ /useNA \ifPOE@useNA true \else false \fi def
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\begin@WideBeamObj}
+% \begin{macrocode}
+\def\begin@WideBeamObj{%
+ \addbefore@par{style=Beam}%
+ \begin@BeamObj
+ \let\pst@linetype\pst@arrowtype
+ \pst@addarrowdef%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\begin@SingleBeamObj}
+% \begin{macrocode}
+\let\begin@SingleBeamObj\begin@WideBeamObj
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\drawbeam}
+% \begin{macrocode}
+\def\drawbeam{\pst@object{drawbeam}}%
+\def\drawbeam@i{%
+ \def\POE@conntable{,a-a,b-b,A-A,B-B}%
+ \begin@SingleBeamObj
+ \POE@getcomps[\drawbeam@ii%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\drawwidebeam}
+% \begin{macrocode}
+\def\drawwidebeam{\pst@object{drawwidebeam}}%
+\def\drawwidebeam@i{%
+ \begin@WideBeamObj
+ \POE@getcomps[\drawwidebeam@ii%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@beam@use@pscode}
+%
+% This is a hack which allows us to leave the names and coordinates of the
+% beam end points on the stack after the \opt{@endspecial} call. This replaces
+% \nxLcs{use@pscode} in \nxLcs{end@BeamObj}. These values on the stack must be
+% consumed directly after closing the beam object.
+% \begin{macrocode}
+\def\POE@beam@use@pscode{%
+ \pstverb{%
+ \pst@dict
+ \tx@STP
+ \pst@newpath
+ \psk@origin
+ \psk@swapaxes
+ \pst@code
+ end
+ count /ocount exch def
+ }%
+ \gdef\pst@code{}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\end@BeamObj}
+% \begin{macrocode}
+\def\end@BeamObj{%
+ \addto@pscode{ end }%
+ \let\psk@fillstyle\relax
+ \ifPOE@optexpenv
+ \ifPOE@frontlayer
+% \end{macrocode}
+% Erase all beam-drawing code and leave only \opt{false} on the stack to
+% indicate that no beampoints should be stored.
+% \begin{macrocode}
+ \def\pst@code{ false false }%
+ \fi
+ \fi
+ \let\use@pscode\POE@beam@use@pscode
+ \end@SpecialObj%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\drawbeam@ii}
+% \begin{macrocode}
+\def\drawbeam@ii{%
+ \ifx\POE@key@conn\@empty
+ \drawbeam@iii
+ \else
+ \drawbeam@compat
+ \fi
+}
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\drawbeam@iii}
+% \begin{macrocode}
+\def\drawbeam@iii{%
+ \ifx\pslinestyle\@none
+ \addto@pscode{ false false }%
+ \else
+ \addto@pscode{%
+% \end{macrocode}
+% I need to pack it this way in order to avoid replacing the \opt{n} inside the
+% code here. This must be done later, when it refers to the correct refractive
+% indices.
+% \begin{macrocode}
+ {/nbeam {\POE@key@n cvx exec} bind def
+ \ifPOE@pswarning
+ /Warning /PrintWarning load def
+ \else
+ /Warning /pop load def
+ \fi}%
+ [ \POE@key@beampos\space counttomark dup
+ 0 eq {
+ pop 0 0
+ } {
+ 1 eq {
+ 0 exch
+ } if
+ } ifelse \tx@ScreenCoor] cvx
+ \POE@key@beamangle\space
+ currentdict /lastBeamPointTmp undef
+ currentdict /lastVecTmp undef
+ loadbeampoints 1 ge
+ tx@NodeDict /N@\oenodeBeam{\POE@key@loadbeampoints} known and {
+ /N@\oenodeBeam{\POE@key@loadbeampoints} @GetCenter ToVec
+ /lastBeamPointTmp ED
+ } if
+ currentdict /lastVec\POE@key@loadbeampoints\space known
+ loadbeam and {
+ /lastVecTmp /lastVec\POE@key@loadbeampoints\space load def
+ } if
+ TraceBeam
+ \POE@strokesinglebeam
+ savebeampoints 1 ge
+ currentdict /lastBeamPointTmp known and dup {
+ lastBeamPointTmp
+ /N@\oenodeBeam{\POE@key@savebeampoints}\space 4 -1 roll
+ } if
+ savebeam currentdict /lastVecTmp known and dup {
+ /lastVec\POE@key@savebeampoints\space lastVecTmp 4 -1 roll
+ } if
+ }%
+ \fi
+ \end@BeamObj
+ \POE@Verb{%
+ { tx@OptexpDict begin ToVec def end } if
+ { \tx@NodeScale @NewNode } if
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% This fix is necessary for pst-node since version 1.21.
+% \begin{macrocode}
+\def\tx@NodeScale{%
+ \pst@nodedict
+ /NodeScale {\ifx\pstnodescale\@undefined\else\pstnodescale\fi} def
+ end }
+% \end{macrocode}
+%
+% \begin{macro}{\POE@strokesinglebeam}
+% \begin{macrocode}
+\def\POE@strokesinglebeam{%
+ gsave
+ /Lineto /lineto load def
+ \tx@Drawbeam
+ \tx@setlinejoin
+ \pst@number\pslinewidth SLW
+ \pst@usecolor\pslinecolor
+ \tx@setStrokeTransparency
+ \@nameuse{psls@\pslinestyle}
+ grestore
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\drawwidebeam@ii}
+% \begin{macrocode}
+\def\drawwidebeam@ii{%
+ \def\pst@fill##1{ gsave ##1 grestore }%
+ \addto@pscode{%
+ {/nbeam {\POE@key@n cvx exec} bind def
+ \ifPOE@pswarning
+ /Warning /PrintWarning load def
+ \else
+ /Warning /pop load def
+ \fi}%
+ }%
+% \end{macrocode}
+% arrange and create the input vectors
+% \begin{macrocode}
+ \addto@pscode{%
+ \POE@key@beamangle\space dup
+ \POE@key@beamdiv\space 0.5 mul dup 4 -1 roll add 3 1 roll sub
+ }%
+% \end{macrocode}
+% the start positions
+% \begin{macrocode}
+ \addto@pscode{%
+ [ \POE@key@beampos\space counttomark dup
+ 0 eq {
+ pop 0 0
+ } {
+ 1 eq {
+ 0 exch
+ } if
+ } ifelse
+ mark \POE@key@beamwidth\space counttomark 0 eq {
+ 0
+ } {
+ 0.5 mul
+ } ifelse
+ exch pop
+ 3 copy add \tx@ScreenCoor\space ToVec
+ 5 1 roll sub \tx@ScreenCoor
+ ] cvx
+ }%
+% \end{macrocode}
+% rearrange options
+% \begin{macrocode}
+ \addto@pscode{ exch 4 -1 roll 4 2 roll exch }%
+% \end{macrocode}
+% stroke and/or fill
+% \begin{macrocode}
+ \addto@pscode{%
+ counttomark mark exch 2 add 1 roll
+ gsave
+ \ifx\psk@fillstyle\relax
+ currentdict /fillBeam undef
+ \else
+ /fillBeam {\psk@fillstyle} def
+ \fi
+ /strokeBeam \ifx\pslinestyle\@none false \else true \fi def
+ [/lastBeamPointTmpLow /lastBeamPointTmpUp
+ /lastVecTmpLow /lastVecTmpUp]
+ {currentdict exch undef} forall
+ tx@NodeDict /N@\oenodeBeamLow{\POE@key@loadbeampoints} known
+ tx@NodeDict /N@\oenodeBeamUp{\POE@key@loadbeampoints} known
+ loadbeampoints 1 ge and and {
+ /N@\oenodeBeamLow{\POE@key@loadbeampoints} @GetCenter ToVec
+ /lastBeamPointTmpLow ED
+ /N@\oenodeBeamUp{\POE@key@loadbeampoints} @GetCenter ToVec
+ /lastBeamPointTmpUp ED
+ } if
+ loadbeam
+ currentdict /lastVecLow\POE@key@loadbeampoints\space known and
+ currentdict /lastVecUp\POE@key@loadbeampoints\space known and {
+ /lastVecTmpLow /lastVecLow\POE@key@loadbeampoints\space load def
+ /lastVecTmpUp /lastVecUp\POE@key@loadbeampoints\space load def
+ } if
+ TraceAndFillWideBeam
+ grestore pop % pop off the mark
+% \end{macrocode}
+% Rearrange the points so that we can use two Drawbeam calls.
+%
+% \begin{macrocode}
+ counttomark 0 gt strokeBeam and {
+ counttomark dup /cnta ED /cntb ED
+ cnta 6 idiv {
+ cnta 3 roll /cnta cnta 3 sub def
+ /cntb cntb 3 sub def
+ cntb 3 roll /cntb cntb 3 sub def
+ } repeat
+ counttomark 2 idiv 1 add mark exch 1 roll
+ \POE@strokesinglebeam
+ \POE@strokesinglebeam
+ } {
+ pop % pop off the mark
+ } ifelse
+ currentdict /fillBeam known strokeBeam or
+ savebeampoints 1 ge and
+ currentdict /lastBeamPointTmpLow known and
+ currentdict /lastBeamPointTmpUp known and dup {
+ lastBeamPointTmpLow /N@\oenodeBeamLow{\POE@key@savebeampoints}
+ lastBeamPointTmpUp /N@\oenodeBeamUp{\POE@key@savebeampoints}
+ 7 -1 roll
+ } if
+ currentdict /fillBeam known strokeBeam or
+ savebeam and
+ currentdict /lastVecTmpLow known and
+ currentdict /lastVecTmpUp known and dup {
+ /lastVecLow\POE@key@savebeampoints\space lastVecTmpLow
+ /lastVecUp\POE@key@savebeampoints\space lastVecTmpUp
+ 7 -1 roll
+ } if
+ }%
+ \end@BeamObj
+ \POE@Verb{%
+ { tx@OptexpDict begin ToVec def ToVec def end } if
+ { \tx@NodeScale @NewNode @NewNode } if
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\pst@def{Drawbeam}<
+% \end{macrocode}
+% Remove trailing empty line parts.
+% \begin{macrocode}
+ { counttomark 6 le {
+ exit
+ } if
+ 3 index not {
+ pop pop pop
+ }{
+ exit
+ } ifelse
+ } loop
+% \end{macrocode}
+% Remove heading empty line parts. Note, that the first point must not have
+% 'draw = true', because it is the starting point which we have to move to.
+% \begin{macrocode}
+ { counttomark 3 le {
+ exit
+ } if
+ counttomark 3 sub index not {
+ counttomark -3 roll pop pop pop
+ }{
+ exit
+ } ifelse
+ } loop
+% \end{macrocode}
+% \begin{macrocode}
+ counttomark 3 le {
+% \end{macrocode}
+% first ray misses the next interface or is even parallel to the input interface.
+% \begin{macrocode}
+ cleartomark
+ }{
+% \end{macrocode}
+% This is the /Line definition from \opt{pstricks-add}, adapted to the beam path
+% structure which includes the boolean values to indicate if a line is drawn, or
+% if we use moveto. There was no way to patch the original definition to account
+% for the moveto parts and avoid duplicating the code.
+% \begin{macrocode}
+ counttomark 3 div cvi /N ED
+ (\psk@ArrowInside) length 0 gt {
+ \ifx\psk@arrowA\arrowType@H % do we have a Hook arrow at the beginning?
+ \pst@number\pshooklength % yes
+ \else
+ \psk@arrowsize\space CLW mul add dup \psk@arrowlength\space mul exch \psk@arrowinset mul neg add
+ \fi
+ /arrowlength exch def
+ 6 copy pop % copy all four values for the arrow line
+ /y1 ED /x1 ED pop /y2 ED /x2 ED % save them
+ /Alpha y2 y1 sub x2 x1 sub Atan def % the gradient of the line
+ pop 3 -1 roll 5 1 roll
+ ArrowA
+ x1 Alpha cos arrowlength mul add % dx add
+ y1 Alpha sin arrowlength mul add % dy add, to get the current point at the end of the arrow tip
+ 5 -1 roll 3 1 roll true
+ /N N 1 sub def
+ N {
+ 6 copy pop
+ /y1 ED /x1 ED pop /y2 ED /x2 ED /draw ED
+% \end{macrocode}
+% Check for line segment length and draw the arrow only, if the segment is long
+% enough. This is in first place to avoid drawing an inside arrow for the
+% pinhole which has three interfaces instead of one so that it can be used as
+% real spatial filter.
+% \begin{macrocode}
+ x1 y1 x2 y2 @ABDist dup
+ \POE@key@ArrowInsideMinLength\space\pst@number\psunit mul ge
+ exch \POE@key@ArrowInsideMaxLength\space\pst@number\psunit mul dup 0 lt
+ 3 1 roll le or and {
+ x1 y1
+ \psk@ArrowInsidePos\space 1 gt {
+ /Alpha y2 y1 sub x2 x1 sub Atan def
+ /ArrowPos \psk@ArrowInsideOffset\space def
+ /dArrowPos \psk@ArrowInsidePos\space abs def
+ \psk@ArrowInsideNo\space cvi {
+ /ArrowPos ArrowPos dArrowPos add def
+ x1 Alpha cos ArrowPos mul add
+ y1 Alpha sin ArrowPos mul add
+ 6 index { ArrowInside } if
+ pop pop
+ } repeat
+ }{
+ /ArrowPos \psk@ArrowInsideOffset\space def
+ /dArrowPos \psk@ArrowInsideNo 1 gt {%
+ 1.0 \psk@ArrowInsideNo 1.0 add div
+ }{\psk@ArrowInsidePos } ifelse def
+ \psk@ArrowInsideNo\space cvi {
+ /ArrowPos ArrowPos dArrowPos add def
+ x2 x1 sub ArrowPos mul x1 add
+ y2 y1 sub ArrowPos mul y1 add
+ 6 index { ArrowInside } if
+ pop pop
+ } repeat
+ } ifelse
+ pop pop
+ } if
+ draw {Lineto}{moveto} ifelse
+ } repeat
+ }{
+ pop 5 copy 3 -1 roll pop
+ ArrowA pop pop pop pop
+ counttomark 3 idiv -1 2 {
+ pop {
+ lineto
+ }{
+ moveto
+ } ifelse
+ } for
+ } ifelse
+ {CP 4 2 roll ArrowB lineto pop pop } {moveto} ifelse
+% \end{macrocode}
+% remove the mark
+% \begin{macrocode}
+ pop
+ } ifelse
+>
+% \end{macrocode}
+%
+% \begin{macrocode}
+\def\POE@getcomprange#1-#2\@nil{%
+ \ifx\\#2\\%
+ \ifx\\#1\\%
+ % empty option
+ \edef\POE@firstcomp{\the\POE@cnt}%
+ \edef\POE@lastcomp{\the\POE@cnt}%
+ \else
+ \edef\POE@firstcomp{#1}%
+ \edef\POE@lastcomp{#1}%
+ \fi
+ \else
+ \ifx\\#1\\%
+ \edef\POE@firstcomp{1}%
+ \else
+ \edef\POE@firstcomp{#1}%
+ \fi
+ \POE@getlastcomp#2%
+ \fi
+ \ifnum\POE@firstcomp<1
+ \def\POE@firstcomp{1}%
+ \else\ifnum\POE@firstcomp>\the\POE@cnt
+ \edef\POE@firstcomp{\the\POE@cnt}%
+ \fi\fi
+ \ifnum\POE@lastcomp>\the\POE@cnt
+ \edef\POE@lastcomp{\the\POE@cnt}%
+ \else\ifnum\POE@lastcomp<1
+ \def\POE@lastcomp{1}%
+ \fi\fi
+}
+\def\POE@getlastcomp#1-{%
+ \ifx.#1.%
+ \edef\POE@lastcomp{\the\POE@cnt}%
+ \else
+ \ifx\@empty#1\relax
+ \edef\POE@lastcomp{\the\POE@cnt}%
+ \else
+ \edef\POE@lastcomp{#1}%
+ \fi
+ \fi
+}
+% \end{macrocode}
+%
+% \begin{macro}{\POE@getcomps}
+% \begin{macrocode}
+\def\POE@getcomps#1#2{%
+ \ifx\POE@key@conn\@empty
+ \def\POE@aftercomps{\addto@pscode{#1 \POE@comps }#2}%
+ \else
+ \def\POE@aftercomps{#2}%
+ \fi
+ \def\POE@comps{}%
+ \POE@@getcomps%
+}%
+\def\POE@@getcomps{%
+ \@ifnextchar\bgroup{\POE@@@getcomps}{\POE@aftercomps}%
+}%
+\def\POE@@@getcomps#1{%
+ \def\POE@temp{#1\@empty}%
+ \expandafter\POE@@@@getcomps\POE@temp\@nil
+}%
+\def\POE@@@@getcomps#1#2\@nil{%
+ \edef\POE@temp{#1}%
+ \ifx\POE@temp\@empty
+ \POE@getcomp{(\oenode{}{})}%
+ \else\ifx(#1\relax%)
+ \POE@getplanenode#1#2%
+ \else\ifnum9<1#1\relax
+ \POE@getcomprange#1#2-\@nil
+ \POE@getcomp{%
+ (\POE@str@basicname@prefix\POE@str@basicname@default)
+ \POE@firstcomp\space\POE@lastcomp\space GetCompRange %
+ }%
+ \else\ifx-#1\relax
+ \POE@getcomprange#1#2-\@nil
+ \POE@getcomp{%
+ (\POE@str@basicname@prefix\POE@str@basicname@default)
+ \POE@firstcomp\space\POE@lastcomp\space GetCompRange %
+ }%
+ \else
+ \POE@getcomp{(\oenode{}{#1#2})}%
+ \fi\fi\fi\fi%
+ \POE@@getcomps%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@getplanenode}
+% \begin{macrocode}
+\def\POE@getplanenode(#1){%
+ \pst@@getcoor{#1}%
+ \ifx\POE@key@conn\@empty
+ \advance\POE@nodecnt by 1
+ \POE@getcomp{%
+ {\pst@coor} {0 1}
+ (\POE@str@basicname@default N@\the\POE@nodecnt)
+ {\tx@UserCoor} NewTempNodeComp
+ (\POE@str@basicname@default N@\the\POE@nodecnt)
+ }%
+ \else
+ \POE@getcomp{{\pst@coor} }%
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@getcomp}
+% \begin{macrocode}
+\def\POE@getcomp#1{%
+ \ifx\POE@comps\@empty
+ \edef\POE@tempc{#1}%
+ \else
+ \edef\POE@tempd{#1}%
+ \fi
+ \edef\POE@comps{#1 \POE@comps}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Automatic connections}
+%
+% \begin{macro}{\POE@drawInternalConnections}
+% \begin{macrocode}
+\def\POE@drawInternalConnections{%
+ \ifx\POE@key@conn\@empty
+ \POE@drawInternalConnectionsNew
+ \else
+ \POE@drawInternalConnectionsOld
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\POE@drawPresetFibers}
+% \begin{macrocode}
+\def\POE@drawPresetFibers{%
+ \ifPOE@endbox
+ \ifPOE@fiberpresetin@
+ \drawfiber@{FiberIn}{(\oenodeRefA{})}{}
+ \fi
+ \else\ifPOE@startbox
+ \ifPOE@fiberpresetout@
+ \drawfiber@{FiberOut}{}{(\oenodeRefB{})}
+ \fi
+ \else
+ \ifPOE@fiberpresetin@
+ \drawfiber@{FiberIn}{(\oenodeRefA{})}{}
+ \fi
+ \ifPOE@fiberpresetout@
+ \drawfiber@{FiberOut}{}{(\oenodeRefB{})}
+ \fi
+ \fi\fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\POE@drawInternalConnectionsNew}
+% \begin{macrocode}
+\def\POE@drawInternalConnectionsNew{%
+ \ifPOE@beam
+ \ifPOE@endbox
+ \drawbeam[raytrace=false]{(\oenodeRefA{})}{}
+ \else\ifPOE@startbox
+ \drawbeam[raytrace=false]{}{(\oenodeRefB{})}
+ \else
+ \drawbeam[raytrace=false]{(\oenodeRefA{})}{}{(\oenodeRefB{})}
+ \fi\fi
+ \else\ifPOE@fiber@
+% \end{macrocode}
+% This is equivalent to the code in \cs{POE@drawPresetFibers}.
+% \begin{macrocode}
+ \ifPOE@endbox
+ \ifPOE@fiberin@
+ \drawfiber@{FiberIn}{(\oenodeRefA{})}{}
+ \fi
+ \else\ifPOE@startbox
+ \ifPOE@fiberout@
+ \drawfiber@{FiberOut}{}{(\oenodeRefB{})}
+ \fi
+ \else
+ \ifPOE@fiberin@
+ \drawfiber@{FiberIn}{(\oenodeRefA{})}{}
+ \fi
+ \ifPOE@fiberout@
+ \drawfiber@{FiberOut}{}{(\oenodeRefB{})}
+ \fi
+ \fi\fi
+ \fi\fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\POE@drawInternalConnectionsOld}
+% \begin{macrocode}
+\def\POE@drawInternalConnectionsOld{%
+ \ifPOE@endbox
+ \@nameuse{\POE@connIn}
+ \else
+ \ifPOE@fiber@
+ \ifPOE@fiberin@
+ \@nameuse{\POE@connIn}
+ \fi
+ \ifPOE@fiberout@
+ \@nameuse{\POE@connOut}
+ \fi
+ \else
+ \ifPOE@connjoin
+ \def\POE@tempa{POE@conn@in@i}%
+ \ifx\POE@tempa\POE@connIn
+ \def\POE@tempb{POE@conn@out@o}
+ \ifx\POE@tempb\POE@connOut
+ \pscustom[style=Beam, linejoin=\POE@key@connjoin]{%
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}}%
+ \else\ifx\@empty\POE@connOut
+ \pscustom[style=Beam, linejoin=\POE@key@connjoin]{%
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}}%
+ \else
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}%
+ \fi\fi
+ \else
+ \def\POE@tempa{POE@conn@in@o}%
+ \ifx\POE@tempa\POE@connIn
+ \def\POE@tempb{POE@conn@out@o}
+ \ifx\POE@tempb\POE@connOut
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}%
+ \else\ifx\@empty\POE@connOut
+ \pscustom[style=Beam, linejoin=\POE@key@connjoin]{%
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}}%
+ \else
+ \pscustom[style=Beam, linejoin=\POE@key@connjoin]{%
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}}%
+ \fi\fi
+ \else
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}%
+ \fi
+ \fi
+ \else
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}%
+ \fi
+ \fi
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Old connection code}
+%
+% The old connection code for backward compatibility to version 2.x. As this is
+% obsolete and was broken by design, there is no need to comment on this.
+% \begin{macrocode}
+\def\optexp@nodeA{\oenodeIn{}}%
+\def\optexp@nodeB{\oenodeOut{}}%
+\define@key[psset]{optexp}{connjoin}{%
+ \edef\POE@temp{#1}%
+ \ifnum\POE@temp<0
+ \POE@connjoinfalse
+ \else\ifnum\POE@temp>2
+ \POE@connjoinfalse
+ \else
+ \POE@connjointrue
+ \edef\POE@key@connjoin{\POE@temp}
+ \fi\fi
+}%
+\def\POE@key@conn{}%
+\define@key[psset]{optexp}{conn}{%
+ \edef\POE@key@conn{#1}%
+ \expandafter\POE@psset@@conn\POE@key@conn\@empty-\@empty\@nil
+ \if@pst\else
+ \PackageError{pst-optexp}{Bad connection specification: #1}%
+ \fi
+}%
+\def\POE@psset@@conn#1-#2\@empty#3\@nil{%
+ \@psttrue
+ \def\POE@next##1,#1-##2,##3\@nil{\def\POE@temp{##2}}%
+ \expandafter\POE@next\POE@conntable,#1-#1,\@nil
+ \@ifundefined{POE@conn@in@\POE@temp}%
+ {\@pstfalse\def\POE@connIn{}}%
+ {\edef\POE@connIn{POE@conn@in@\POE@temp}}%
+ \@ifundefined{POE@conn@out@#2}%
+ {\@pstfalse\def\POE@connOut{}}%
+ {\def\POE@connOut{POE@conn@out@#2}}%
+}%
+\def\POE@connIn{}%
+\def\POE@connOut{}%
+\def\POE@conntable{,o-o,i-i,f-f}%
+\def\POE@conn@out@{\ifPOE@insideobj\else\POE@conn@out@a\fi}%
+\def\POE@conn@in@{\ifPOE@insideobj\else\POE@conn@in@a\fi}%
+\def\POE@conn@in@o{%
+ \psline[style=Beam](\oenodeRefA{})(\optexp@nodeA)%
+}%
+\def\POE@conn@out@o{%
+ \psline[style=Beam](\optexp@nodeB)(\oenodeRefB{})%
+}%
+\def\POE@conn@in@f{%
+ \pccurve[%
+ angleA=!\POE@dict{/N@\oenodeRefA{} /N@\oenodeRefB{} SlopeAngle},
+ angleB=!\POE@dict{/N@\oenodeRefB{} /N@\oenodeRefA{} SlopeAngle},
+ style=FiberIn](\oenodeRefA{})(\optexp@nodeA)%
+}%
+\def\POE@conn@out@f{%
+ \pccurve[%
+ angleA=!\POE@dict{/N@\oenodeRefA{} /N@\oenodeRefB{} SlopeAngle},
+ angleB=!\POE@dict{/N@\oenodeRefB{} /N@\oenodeRefA{} SlopeAngle},
+ style=FiberOut](\optexp@nodeB)(\oenodeRefB{})%
+}%
+\def\POE@conn@in@i{%
+ \def\pst@par{style=Beam}
+ \begin@OpenObj
+ \addto@pscode{%
+ [%]
+ \pst@optexpdict
+ (\oenode{}{}) true GetInternalBeamNodesCompat
+ /N@\oenodeRefA{} @GetCenter
+ end
+ }%
+ \psline@ii
+}%
+\def\POE@conn@out@i{%
+ \def\pst@par{style=Beam}
+ \begin@OpenObj
+ \addto@pscode{%
+ [%]
+ \pst@optexpdict
+ /N@\oenodeRefB{} @GetCenter
+ (\oenode{}{}) true GetInternalBeamNodesCompat
+ end
+ }%
+ \psline@ii
+}%
+\def\POE@conn@in@a{%
+ dup xcheck not {
+ \POE@dict{1 GetInternalBeamNodeCompat}
+ } if
+ exec
+}%
+\def\POE@conn@in@A{%
+ dup xcheck not {
+ false \POE@dict{GetInternalBeamNodesCompat} %
+ } if
+ exec
+}%
+\def\POE@conn@in@b{%
+ dup xcheck not {
+ \POE@dict{(N) GetInternalBeamNodeCompat}
+ } if
+ exec
+}%
+\def\POE@conn@in@B{%
+ dup xcheck not {
+ true \POE@dict{GetInternalBeamNodesCompat} %
+ } if
+ exec
+}%
+\let\POE@conn@out@a\POE@conn@in@a
+\let\POE@conn@out@A\POE@conn@in@B
+\let\POE@conn@out@b\POE@conn@in@b
+\let\POE@conn@out@B\POE@conn@in@A
+\def\drawbeam@compat{%
+ \ifPOE@connjoin
+ \setkeys+[psset]{optexp}{linejoin=\POE@key@connjoin}%
+ \fi
+ \addto@pscode{[% ]
+ \POE@tempd\space
+ \@nameuse{\POE@connOut}
+ \POE@tempc\space
+ \@nameuse{\POE@connIn}}%
+ \psline@ii
+\ignorespaces}%
+%
+% \end{macrocode}
+%
+% \section{General purpose macros}
+%
+% \begin{macro}{\defShiftedNode}
+% This is provided only for backward compatibility, and should be replaced by
+% \cs{nodexn}.
+% \begin{macrocode}
+\def\defShiftedNode(#1)(#2)#3{%
+ \PackageWarning{pst-optexp}{%
+ \string\defShiftedNode\space is deprecated,\MessageBreak
+ use \string\nodexn\space(pst-node) instead.}%
+ \pst@getcoor{#1}\pst@tempa%
+ \pst@getcoor{#2}\pst@tempb%
+ \pnode(! \pst@tempb \pst@tempa \POE@dict{VecAdd} \tx@UserCoor){#3}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Accessing component nodes}
+% \begin{macro}{\POE@checkcompname}
+% \begin{macrocode}
+\def\POE@checkcompname#1{%
+ \@expandtwoargs\in@{,#1,}{,\POE@complist,}%
+ \ifin@\else
+ \PackageError{pst-optexp}{^^Jcompname '#1' undefined!^^J}
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@getlastcompname}
+% \begin{macrocode}
+\def\POE@getlastcompname{%
+ \expandafter\POE@getlastcompname@i \POE@complist,\relax,\@nil
+}%
+\def\POE@getlastcompname@i#1,#2,#3\@nil{#1}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\oenode}
+% \begin{macrocode}
+\def\oenode#1#2{%
+ \POE@str@basicname@prefix%
+ \ifx\\#2\\%
+ \ifnum9<1\POE@getlastcompname%
+ \POE@str@basicname@default%
+ \POE@getlastcompname%
+ \else%
+ \POE@getlastcompname%
+ \POE@str@basicname@sep%
+ \fi%
+ \else%
+ \ifnum9<1#2%
+ \POE@str@basicname@default%
+ #2%
+ \else%
+ #2\POE@str@basicname@sep%
+ \fi%
+ \fi%
+ #1%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\oenodeExt}
+% The external node which is set with \opt{extnode}.
+% \begin{macrocode}
+\def\oenodeExt#1{\oenode{\POE@str@extnode@postfix}{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenodeIn}
+% The first (input) node of the component.
+% \begin{macrocode}
+\def\oenodeIn#1{\oenode{1}{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenodeOut}
+% \begin{macrocode}
+\def\oenodeOut#1{\oenode{N}{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenodeCenter}
+% \begin{macrocode}
+\def\oenodeCenter#1{\oenode{Center}{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenodeLabel}
+% \begin{macrocode}
+\def\oenodeLabel#1{\oenode{Label}{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenodeRefA}
+% \begin{macrocode}
+\def\oenodeRefA#1{\oenode{A}{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenodeRefB}
+% \begin{macrocode}
+\def\oenodeRefB#1{\oenode{B}{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenodeRotref}
+% \begin{macrocode}
+\def\oenodeRotref#1{\oenode{Rotref}{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenodeTrefA}
+% \begin{macrocode}
+\def\oenodeTrefA#1{\oenode{TrefA}{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenodeTrefB}
+% \begin{macrocode}
+\def\oenodeTrefB#1{\oenode{TrefB}{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenode@RefA}
+% \begin{macrocode}
+\def\oenode@RefA#1{\oenode{@A}{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenode@RefB}
+% \begin{macrocode}
+\def\oenode@RefB#1{\oenode{@B}{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenode@TrefA}
+% \begin{macrocode}
+\def\oenode@TrefA#1{\oenode{@TrefA}{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenode@TrefB}
+% \begin{macrocode}
+\def\oenode@TrefB#1{\oenode{@TrefB}{#1}}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenodeIfc}
+% \begin{macrocode}
+\def\oenodeIfc#1#2{%
+ \ifnum9<1#1 %
+ \oenode{#1}{#2}%
+ \else\ifx#1N %
+ \oenode{#1}{#2}%
+ \else\ifx#1C %
+ \oenode{#1}{#2}%
+ \else
+ \PackageWarning{pst-optexp}{%
+ \string\oenodeIfc\space node argument must be\MessageBreak
+ integer, 'N', or 'C'}
+ \fi\fi\fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenodeBeam}
+% \begin{macrocode}
+\def\oenodeBeam#1{%
+ \POE@str@basicname@prefix\POE@str@basicname@default Beam%
+ \ifx\\#1\\1\else#1\fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenodeBeamUp}
+% \begin{macrocode}
+\def\oenodeBeamUp#1{%
+ \POE@str@basicname@prefix\POE@str@basicname@default BeamUp%
+ \ifx\\#1\\1\else#1\fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\oenodeBeamLow}
+% \begin{macrocode}
+\def\oenodeBeamLow#1{%
+ \POE@str@basicname@prefix\POE@str@basicname@default BeamLow%
+ \ifx\\#1\\1\else#1\fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \section{Components}
+%
+% \begin{macro}{\newOptexpComp@}
+% \begin{macrocode}
+\def\newOptexpComp@#1#2{%
+ \POE@Verb{%
+ \tx@NodeScale
+ [ #1 #2 \ifPOE@allowbeaminside true \else false \fi
+ (\oenode{}{}) {\tx@ScreenCoor}
+ NewOptexpComp
+ }%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newOptexpComp}
+% \begin{macrocode}
+\def\newOptexpComp#1{%
+ \newOptexpComp@{#1}{false}%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newOptexpCompAmb}
+% \begin{macrocode}
+\def\newOptexpCompAmb#1{%
+ \newOptexpComp@{#1}{true}%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\newOptexpComp@}
+% \begin{macrocode}
+\def\newOptexpFiberComp#1{%
+ \POE@Verb{%
+ \tx@NodeScale
+ [ #1 (\oenode{}{}) {\tx@ScreenCoor}
+ NewOptexpFiberComp
+ }%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@compalias}
+% Components which have a \opt{compname} assigned, must also be available by
+% their component number. Here, all necessary informations (nodes, component
+% dictionary) are referenced such that any information is accessible via
+% numeber or name.
+% \begin{macrocode}
+\def\POE@compalias#1#2{%
+ \POE@Verb{%
+% \end{macrocode}
+% Copy the component dictionary
+% \begin{macrocode}
+ /\oenode{}{#1} dup currentdict exch known {
+ load /#2 ED
+ } {
+ pop
+ } ifelse
+ (#2) (\oenode{}{#1})
+ tx@NodeDict begin
+% \end{macrocode}
+% Copy all interface nodes of the component.
+% \begin{macrocode}
+ 1 {
+ 3 copy inttostr dup
+ 3 1 roll 2 copy NodeName
+ currentdict exch known {
+ NodeName load 3 1 roll NodeName ED
+ 1 add
+ } {
+ pop (N) NodeName load 3 1 roll
+ pop (N) NodeName ED
+ pop exit
+ } ifelse
+ } loop
+% \end{macrocode}
+% Copy all other nodes associated with the component (reference nodes, center
+% node, label node etc).
+% \begin{macrocode}
+ [ (A) (B) (@A) (@B) (Center) (Label) (Rotref)
+ (TrefA) (TrefB) (@TrefA) (@TrefB) (Ext)
+ counttomark {
+ counttomark 3 add -2 roll 2 copy counttomark 1 add 2 roll
+ 3 -1 roll dup 4 1 roll NodeName dup
+ currentdict exch known {
+ load 3 1 roll exch NodeName ED
+ } {
+ pop pop pop
+ } ifelse
+ } repeat pop pop pop
+ end
+ }%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optplane}
+% Define an invisible plane which is used only for ray tracing. The first node
+% is the origin, the second one is the difference vector.
+% \begin{macrocode}
+\def\optplane{%
+ \@ifnextchar[%]
+ {\optplane@i}{\optplane@i[]}%
+}%
+\def\optplane@i[#1](#2){%
+ \pst@getcoor{#2}\POE@tempa
+% \end{macrocode}
+% Set the height to 0 to circumvent problems with the NA beeing too low
+% \begin{macrocode}
+ \optplate[#1, plateheight=0, linestyle=none]%
+ (! \POE@tempa exch 1 sub exch \tx@UserCoor)%
+ (! \POE@tempa exch 1 add exch \tx@UserCoor)%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\begin@OptexpObj}
+% \begin{macrocode}
+\def\begin@OptexpObj{%
+ \global\advance\POE@cnt by 1
+ \addbefore@par{compname={}}%
+ \pst@killglue
+ \begingroup
+ \POE@insideobjtrue
+ \POE@Verb{InitOptexpComp }%
+ \use@par
+% \end{macrocode}
+% The \opt{compshift} refers to the $y$-direction, shifting in $x$-direction
+% is done by \opt{abspos} or \opt{position}
+% \begin{macrocode}
+ \let\POE@key@comp@Yshift\POE@key@compshift%
+ \def\POE@key@comp@Xshift{0}%
+ \edef\POE@refnodeA{\oenodeRefA{}}%
+ \edef\POE@refnodeB{\oenodeRefB{}}%
+ \edef\POE@trefnodeA{\oenodeTrefA{}}%
+ \edef\POE@trefnodeB{\oenodeTrefB{}}%
+ \def\POE@transformnodes{%
+ \POE@transformnode{\oenodeRefA{}}{\oenodeTrefA{}}%
+ \POE@transformnode{\oenodeRefB{}}{\oenodeTrefB{}}%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\begin@OptexpFiberObj}
+% \begin{macrocode}
+\let\begin@OptexpFiberObj\begin@OptexpObj
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\begin@OptexpTripole}
+% \begin{macrocode}
+\let\POE@disablepos\relax
+\def\begin@OptexpTripole{%
+ \begin@OptexpObj
+% \end{macrocode}
+% for multipoles the default shifting is in $x$-direction
+% \begin{macrocode}
+ \def\POE@key@comp@Xshift{\POE@key@compshift\space neg }%
+ \def\POE@key@comp@Yshift{0}%
+% \end{macrocode}
+% The positioning parameters are disabled, because \opt{compshift} does the job for tripoles.
+% \begin{macrocode}
+ \def\POE@disablepos{%
+ \let\POE@key@abspos\@empty
+ \let\POE@key@position\@empty
+ }%
+ \POE@positionrefnodes
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@positionrefnodes}
+% \begin{macrocode}
+\def\POE@positionrefnodes{%
+ \edef\POE@refnodeA{\oenode@RefA{}}%
+ \edef\POE@refnodeB{\oenode@RefB{}}%
+ \edef\POE@trefnodeA{\oenode@TrefA{}}%
+ \edef\POE@trefnodeB{\oenode@TrefB{}}%
+ \def\POE@transformnodes{%
+ \POE@transformnode{\oenodeRefA{}}{\oenodeTrefA{}}%
+ \POE@transformnode{\oenodeRefB{}}{\oenodeTrefB{}}%
+ \POE@transformnode{\oenode@RefA{}}{\oenode@TrefA{}}%
+ \POE@transformnode{\oenode@RefB{}}{\oenode@TrefB{}}%
+ }%
+}%
+%
+% \begin{macro}{\end@OptexpObj}
+% \begin{macrocode}
+\def\end@OptexpObj{%
+ \ifnum9<1\POE@key@compname\else
+ \POE@compalias{\POE@key@compname}{\oenode{}{\the\POE@cnt}}%
+ \fi
+ \endgroup
+ \ignorespaces%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\end@OptexpDipole}
+% \begin{macrocode}
+\let\end@OptexpDipole\end@OptexpObj
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\end@OptexpTripole}
+% \begin{macrocode}
+\let\end@OptexpTripole\end@OptexpObj
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\addafter@par}
+% Analog to \cs{addbefore@par} from pstricks.tex, but inserts new options at
+% the end of the current token register. This can be useful to preset options
+% that are not allowed to be changed by the user.
+% \begin{macrocode}
+\def\addafter@par#1{%
+ \ifx\pst@par\@empty
+ \def\pst@par{#1}%
+ \else
+ \toks@{#1}%
+ \pst@toks\expandafter{\pst@par}%
+ \edef\pst@par{\the\pst@toks,\the\toks@}%
+ \fi%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\def\getCLWH{CLW \pst@number\psxunit 2 mul div }%
+\def\getCLW{CLW \pst@number\psxunit div }%
+\let\POE@restorerefnodes\relax
+% \end{macrocode}
+%
+% New high-level macros
+% 1) Allow a compressed notation of all provided elements, as most of the organizing code
+% is mostly equal.
+%
+% 2) Provide a rather easy-to-use interface for the user to allow new user-defined elements
+%
+% \begin{macro}{\newOptexpDipole}
+% \begin{macrocode}
+\def\newOptexpDipole{%
+ \@ifnextchar[%]
+ {\POE@newdipole}{\POE@newdipole[]}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\newOptexpDipoleNolabel}
+% \begin{macrocode}
+\def\newOptexpDipoleNolabel{%
+ \PackageWarning{pst-optexp}{%
+ \string\newOptexpDipoleNolabel\space is deprecated,\MessageBreak
+ use \string\newOptexpDipole\space instead.}%
+ \newOptexpDipole
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\newOptexpTripole}
+% \begin{macrocode}
+\def\newOptexpTripole{%
+ \@ifnextchar[%]
+ {\POE@newtripole}{\POE@newtripole[]}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\newOptexpFiberDipole}
+% \begin{macrocode}
+\def\newOptexpFiberDipole{%
+ \@ifnextchar[%]
+ {\POE@newfiberdipole}{\POE@newfiberdipole[]}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@newdipole}
+% \begin{macrocode}
+\def\POE@newdipole[#1]#2#3{%
+ \@ifundefined{#2@i}{%
+ \@namedef{#2}{\pst@object{#2}}%
+ \expandafter\def\csname #2@i\endcsname(##1)(##2){%
+ \@ifnextchar\bgroup%
+ {\@nameuse{#2@i@}(##1)(##2)}%
+ {\@nameuse{#2@i@}(##1)(##2){}}%
+ }%
+ \expandafter\def\csname #2@i@\endcsname(##1)(##2)##3{%
+ \addbefore@par{#3}%
+ \addafter@par{#1}%
+ \begin@OptexpObj
+ \ifPOE@backlayer
+ \POE@regNodes{##1}{##2}
+ \POE@extnodealign
+ \fi
+ \POE@drawcomponent[#2]{##3}{\@nameuse{#2@ii}}
+ \ifPOE@backlayer
+ \POE@Verb{ (1) (N) (\oenode{}{}) CorrectDipoleIfc }%
+ \POE@drawInternalConnections
+ \fi
+ \end@OptexpDipole
+ }%
+ \dipole@iimacro{#2}%
+ }{%
+ \PackageError{pst-optexp}{%
+ dipole component `#2' already defined
+ }%
+ }%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@newfiberdipole}
+% \begin{macrocode}
+\def\POE@newfiberdipole[#1]#2#3{%
+ \@ifundefined{#2@i}{%
+ \@namedef{#2}{\pst@object{#2}}%
+ \expandafter\def\csname #2@i\endcsname(##1)(##2){%
+ \@ifnextchar\bgroup%
+ {\@nameuse{#2@i@}(##1)(##2)}%
+ {\@nameuse{#2@i@}(##1)(##2){}}%
+ }%
+ \expandafter\def\csname #2@i@\endcsname(##1)(##2)##3{%
+ \addbefore@par{#3}%
+ \addafter@par{#1}%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \POE@regNodes{##1}{##2}
+ \POE@extnodealign
+ \fi
+ \POE@drawcomponent[#2]{##3}{\@nameuse{#2@ii}}
+ \ifPOE@backlayer
+ \POE@Verb{ (1) (N) (\oenode{}{}) CorrectDipoleIfc }%
+ \ifPOE@fiberpreset@
+ \POE@drawPresetFibers
+ \fi
+ \fi
+ \end@OptexpDipole
+ }%
+ \fiberdipole@iimacro{#2}%
+ }{%
+ \PackageError{pst-optexp}{%
+ fiber dipole object `#2' already defined
+ }%
+ }%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@newtripole}
+% Equivalent to \cs{POE@newdipole} for tripole objects.
+% \begin{macrocode}
+\def\POE@newtripole[#1]#2#3{%
+ \@ifundefined{#2@i}{%
+ \@namedef{#2}{\pst@object{#2}}%
+ \expandafter\def\csname #2@i\endcsname(##1)(##2)(##3){%
+ \@ifnextchar\bgroup{\@nameuse{#2@i@}(##1)(##2)(##3)}%
+ {\@nameuse{#2@i@}(##1)(##2)(##3){}}%
+ }%
+ \expandafter\def\csname #2@i@\endcsname(##1)(##2)(##3)##4{%
+ \addbefore@par{#3}%
+ \addafter@par{ref@angle=180,#1}%
+ \begin@OptexpTripole
+ \ifPOE@backlayer
+ \POE@calcNodes{##1}{##2}{##3}%
+ \POE@regNodes{##1}{##3}%
+ \fi
+ \POE@drawcomponent[#2]{##4}{\@nameuse{#2@ii}}
+ \ifPOE@backlayer
+ \POE@drawInternalConnections
+ \fi
+ \end@OptexpTripole
+ }%
+ \tripole@iimacro{#2}%
+ }{%
+ \PackageError{pst-optexp}{%
+ tripole object `#2' already defined
+ }%
+ }%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dipole@iimacro}
+% \begin{macrocode}
+\def\dipole@iimacro#1{%
+ \POE@iimacro{#1}{\dipole@nodes}%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\fiberdipole@iimacro}
+% \begin{macrocode}
+\def\fiberdipole@iimacro#1{%
+ \POE@iimacro{#1}{\fiberdipole@nodes}%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\tripole@iimacro}
+% \begin{macrocode}
+\def\tripole@iimacro#1{%
+ \POE@iimacro{#1}{\tripole@nodes}%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\POE@iimacro}
+% \begin{macrocode}
+\def\POE@iimacro#1#2{%
+ \@namedef{#1@ii}{%
+ \ifPOE@backlayer
+ \pnode(0,0){\oenodeCenter{}}%
+ \fi
+ \@ifundefined{#1@iii}{%
+ \ifPOE@backlayer
+ \@ifundefined{#1@nodes}{#2}{\@nameuse{#1@nodes}}%
+ \fi
+ \ifPOE@frontlayer
+ \@nameuse{#1@comp}%
+ \fi
+ }{%
+ \ifPOE@backlayer
+ \PackageWarning{pst-optexp}{%
+ Using #1@iii, please switch to the new\MessageBreak
+ interface system.}%
+ \@nameuse{#1@iii}%
+ \fi
+ }%
+ }%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@newfiberquadrupole}
+% \begin{macrocode}
+\def\optcoupler{\pst@object{optcoupler}}%
+\def\optcoupler@i(#1)(#2)(#3)(#4){%
+ \@ifnextchar\bgroup%
+ {\@nameuse{optcoupler@i@}(#1)(#2)(#3)(#4)}%
+ {\@nameuse{optcoupler@i@}(#1)(#2)(#3)(#4){}}%
+}%
+\def\optcoupler@i@(#1)(#2)(#3)(#4)#5{%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \ifx\POE@key@coupleralign\POE@str@top
+ \pnode(#1){\oenodeRefA{}}
+ \pnode(#3){\oenodeRefB{}}
+ \else\ifx\POE@key@coupleralign\POE@str@bottom
+ \pnode(#2){\oenodeRefA{}}
+ \pnode(#4){\oenodeRefB{}}
+ \else
+ \pst@getcoor{#1}\POE@tempa%
+ \pst@getcoor{#2}\POE@tempb%
+ \pnode(!\POE@tempa \POE@tempb
+ \POE@dict{VecAdd 0.5 VecScale}
+ \tx@UserCoor){\oenodeRefA{}}
+ \pst@getcoor{#3}\POE@tempa%
+ \pst@getcoor{#4}\POE@tempb%
+ \pnode(!\POE@tempa \POE@tempb
+ \POE@dict{VecAdd 0.5 VecScale}
+ \tx@UserCoor){\oenodeRefB{}}
+ \fi\fi
+ \fi
+ \POE@drawcomponent[optcoupler]{#5}{\@nameuse{optcoupler@ii}}
+ \ifPOE@backlayer
+ \POE@Verb{%
+ (1) (3) (\oenode{}{}) CorrectDipoleIfc
+ (2) (N) (\oenode{}{}) CorrectDipoleIfc
+ }%
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetin@
+ \ifPOE@fiberpresetin@top
+ \drawfiber@{FiberIn1}[stopnode=1]{(#1)}%
+ {\POE@key@compname}
+ \fi
+ \ifPOE@fiberpresetin@bottom
+ \drawfiber@{FiberIn2}[stopnode=2]{(#2)}%
+ {\POE@key@compname}
+ \fi
+ \fi
+ \ifPOE@fiberpresetout@
+ \ifPOE@fiberpresetout@top
+ \drawfiber@{FiberOut}[startnode=3]{\POE@key@compname}%
+ {(#3)}
+ \fi
+ \ifPOE@fiberpresetout@bottom
+ \drawfiber@{FiberOut2}[startnode=N]{\POE@key@compname}%
+ {(#4)}
+ \fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+\fiberdipole@iimacro{optcoupler}%
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{\wdmsplitter}
+% \begin{macrocode}
+\def\wdmsplitter{\pst@object{wdmsplitter}}%
+\def\wdmsplitter@i(#1)(#2)(#3){%
+ \@ifnextchar\bgroup%
+ {\wdmsplitter@i@(#1)(#2)(#3)}%
+ {\wdmsplitter@i@(#1)(#2)(#3){}}%
+}%
+\def\wdmsplitter@i@(#1)(#2)(#3)#4{%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \pnode(#1){\oenodeRefA{}}
+ \ifx\POE@key@coupleralign\POE@str@top
+ \pnode(#2){\oenodeRefB{}}
+ \else\ifx\POE@key@coupleralign\POE@str@bottom
+ \pnode(#3){\oenodeRefB{}}
+ \else
+ \pst@getcoor{#2}\POE@tempa%
+ \pst@getcoor{#3}\POE@tempb%
+ \pnode(!\POE@tempa \POE@tempb
+ \POE@dict{VecAdd 0.5 VecScale}
+ \tx@UserCoor){\oenodeRefB{}}
+ \fi\fi
+ \fi
+ \POE@drawcomponent[wdmsplitter]{#4}\wdmsplitter@ii
+ \ifPOE@backlayer
+ \POE@Verb{%
+ (1) (2) (\oenode{}{}) CorrectDipoleIfc
+ (1) (N) (\oenode{}{}) CorrectDipoleIfc
+ }%
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetin@
+ \drawfiber@{FiberIn}[stopnode=1]{(#1)}{\POE@key@compname}
+ \fi
+ \ifPOE@fiberpresetout@
+ \ifPOE@fiberpresetout@top
+ \drawfiber@{FiberOut1}[startnode=2]%
+ {\POE@key@compname}{(#2)}
+ \fi
+ \ifPOE@fiberpresetout@bottom
+ \drawfiber@{FiberOut2}[startnode=N]%
+ {\POE@key@compname}{(#3)}
+ \fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+\fiberdipole@iimacro{wdmsplitter}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\wdmcoupler}
+% \begin{macrocode}
+\def\wdmcoupler{\pst@object{wdmcoupler}}%
+\def\wdmcoupler@i(#1)(#2)(#3){%
+ \@ifnextchar\bgroup%
+ {\wdmcoupler@i@(#1)(#2)(#3)}%
+ {\wdmcoupler@i@(#1)(#2)(#3){}}%
+}%
+\def\wdmcoupler@i@(#1)(#2)(#3)#4{%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \pnode(#3){\oenodeRefB{}}
+ \ifx\POE@key@coupleralign\POE@str@top
+ \pnode(#1){\oenodeRefA{}}
+ \else\ifx\POE@key@coupleralign\POE@str@bottom
+ \pnode(#2){\oenodeRefA{}}
+ \else
+ \pst@getcoor{#1}\POE@tempa%
+ \pst@getcoor{#2}\POE@tempb%
+ \pnode(!\POE@tempa \POE@tempb
+ \POE@dict{VecAdd 0.5 VecScale}
+ \tx@UserCoor){\oenodeRefA{}}
+ \fi\fi
+ \fi
+ \POE@drawcomponent[wdmcoupler]{#4}\wdmcoupler@ii
+ \ifPOE@backlayer
+ \POE@Verb{%
+ (1) (N) (\oenode{}{}) CorrectDipoleIfc
+ (2) (N) (\oenode{}{}) CorrectDipoleIfc
+ }%
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetout@
+ \drawfiber@{FiberOut}[startnode=N]{\POE@key@compname}{(#3)}
+ \fi
+ \ifPOE@fiberpresetin@
+ \ifPOE@fiberpresetin@top
+ \drawfiber@{FiberIn1}[stopnode=1]{(#1)}{\POE@key@compname}
+ \fi
+ \ifPOE@fiberpresetin@bottom
+ \drawfiber@{FiberIn2}[stopnode=2]{(#2)}{\POE@key@compname}
+ \fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+\fiberdipole@iimacro{wdmcoupler}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\optcirculator}
+% \begin{macrocode}
+\def\optcirculator{\pst@object{optcirculator}}%
+\def\optcirculator@i(#1)(#2)(#3){%
+ \@ifnextchar\bgroup%
+ {\optcirculator@i@(#1)(#2)(#3)}%
+ {\optcirculator@i@(#1)(#2)(#3){}}%
+}%
+\def\optcirculator@i@(#1)(#2)(#3)#4{%
+ \addafter@par{ref@angle=180}%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \POE@regNodes{#1}{#2}
+ \ifx\POE@key@position\@empty
+ \ifx\POE@key@abspos\@empty
+ \POE@positionrefnodes
+ \pst@getcoor{#1}\POE@tempa%
+ \pst@getcoor{#2}\POE@tempc%
+ \pst@getcoor{#3}\POE@tempb%
+ \pnode(! \POE@dict{%
+ \POE@tempa \tx@UserCoor 2 copy 2 copy
+ \POE@tempc \tx@UserCoor 4 2 roll @ABVect
+ 2 copy 2 copy 10 4 roll
+ \POE@tempb \tx@UserCoor 6 -2 roll @ABVect
+ 4 2 roll tx@EcldDict begin Project end VecAdd
+ 2 copy 6 -2 roll -0.5 VecScale VecAdd
+ }){\oenode@RefA{}}%
+ \pnode(! \POE@dict{4 2 roll 0.5 VecScale VecAdd})%
+ {\oenode@RefB{}}%
+ \fi
+ \fi
+ \fi
+ \POE@drawcomponent[optcirculator]{#4}\optcirculator@ii
+ \ifPOE@backlayer
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetin@top
+ \drawfiber@{FiberIn}[stopnode=1]{(#1)}{\POE@key@compname}
+ \fi
+ \ifPOE@fiberpresetout@
+ \ifPOE@fiberpresetout@top
+ \drawfiber@{FiberOut1}[startnode=N]%
+ {\POE@key@compname}{(#2)}
+ \fi
+ \ifPOE@fiberpresetout@bottom
+ \drawfiber@{FiberOut2}[startnode=2, fiberalign=center]%
+ {\POE@key@compname}{(#3)}
+ \fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+\fiberdipole@iimacro{optcirculator}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@calcNodes}
+% Some of the components need three points to be positioned.
+% These are:
+%
+% \begin{enumerate}
+% \item starting point of the beam (in the PS-Code: (XA,YA))
+% \item reflection point on the surface (XG, YG)
+% \item end point (XB,YB)
+% \end{enumerate}
+%
+% With these three points \cs{poe@calcNodes} calculates two new points 'tempNode@A'
+% and 'tempNode@B', between which the component is placed by the macro
+% \cs{poe@drawcomponent} in the way, that 'angle of incidence' == 'angle of deflection'
+% regarding the reflection surface (mirror, diagonal of the beamsplitter,
+% grid etc.)
+% \begin{macrocode}
+\def\POE@calcNodes#1#2#3{{%
+ \pst@getcoor{#1}\POE@tempa%
+ \pst@getcoor{#2}\POE@tempb%
+ \pst@getcoor{#3}\POE@tempc%
+ \pnode(! \POE@dict{%
+ \POE@tempa \tx@UserCoor
+ \POE@tempc \tx@UserCoor
+ \POE@tempb \tx@UserCoor
+ calcNodes
+ X@A Y@A}){\oenode@RefA{}}%
+ \pnode(! \POE@dict{X@B Y@B}){\oenode@RefB{}}%
+}\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
+% macros the given points are assigned to the temporary nodes.
+% \begin{macrocode}
+\def\POE@regNodes#1#2{%
+ \pnode(#1){\oenodeRefA{}}
+ \pnode(#2){\oenodeRefB{}}
+ \POE@Verb{%
+ /@xref \POE@key@extnode@xref\space def
+ /@yref \POE@key@extnode@yref\space def
+ }%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@extnodealign}
+% \begin{macrocode}
+\def\POE@extnodealign{%
+ \ifx\POE@key@extnodealign\POE@str@absolute
+ \POE@Verb{%
+ /N@\oenodeRefA{} @GetCenter /N@\oenodeRefB{} @GetCenter
+ @ABVect exch
+ dup 0 gt 3 1 roll 0 eq exch 0 lt and or
+ { /RefFac -1 def } if
+ }%
+ \fi
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@pnode@shiftedrot}
+% Define a new node \#3 shifted by (\#1) relative to existing node \#2.
+% Aditionally rotate the new node by \#4 degree around existing node as origin.
+% \begin{macrocode}
+\def\POE@pnode@shiftedrot(#1)#2#3#4{%
+ \pst@getcoor{#1}\POE@temp%
+ \pnode(!%
+ \POE@temp /YDiff ED /XDiff ED %
+ /N@#2 load GetCenter /YShifted ED /XShifted ED
+ /rot@angle #4 \POE@key@labelrefangle\space add def
+ /XDiff@Rot rot@angle cos XDiff mul rot@angle sin YDiff mul add def
+ /YDiff@Rot rot@angle cos YDiff mul rot@angle sin XDiff mul sub def
+ XShifted XDiff@Rot add YShifted YDiff@Rot add neg \tx@UserCoor
+ ){#3}%
+ \psset[optexp]{ref@angle=0}
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@nlput}
+% We cannot use \cs{nlput} from \opt{pst-node}, because that does not work
+% correctly for negative distances together with \opt{nrot=:U}, which happens
+% for \opt{position=start}.
+% \begin{macrocode}
+\def\POE@nlput{\pst@object{POE@nlput}}
+\def\POE@nlput@i(#1)(#2)#3#4{%
+ \begin@SpecialObj
+ \POE@LDNode(#1)(#2){#3}
+ \pcline[linestyle=none](temp@nlputA)(temp@nlputB)%
+ \ncput[npos=0.5]{#4}%
+ \end@SpecialObj}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@LDNode}
+% \begin{macrocode}
+\def\POE@LDNode(#1)(#2)#3{%
+ \pst@getcoor{#1}\pst@tempA%
+ \pst@getcoor{#2}\pst@tempB%
+ \pnode(!
+ \pst@tempA \tx@UserCoor /YA ED /XA ED
+ \pst@tempB \tx@UserCoor /YB ED /XB ED
+ /dx XB XA sub def
+ /dy YB YA sub def
+ /angle dy dx Atan def
+ XA #3 1 sub angle cos mul add
+ YA #3 1 sub angle sin mul add ){temp@nlputA}%
+ \pnode(!
+ \pst@tempA \tx@UserCoor /YA ED /XA ED
+ \pst@tempB \tx@UserCoor /YB ED /XB ED
+ /dx XB XA sub def
+ /dy YB YA sub def
+ /angle dy dx Atan def
+ XA #3 1 add angle cos mul add
+ YA #3 1 add angle sin mul add ){temp@nlputB}%
+}
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@putlabelrelative}
+% Used to put the label for labelref=relative
+% \begin{macrocode}
+\def\POE@putlabelrelative#1{%
+ \nput[labelsep=0]{\POE@key@labelangle}%
+ {\oenodeLabel{}}%
+ {\rput[\POE@key@labelalign](0,0){\POE@key@labelstyle #1}}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@putcomp}
+% Place the component in argument \#1 and define a new node
+% \oenodeLabel{} for positioning of the label.
+% \begin{macrocode}
+\def\POE@putcomp#1{%
+ \rput(! \POE@key@comp@Xshift\space\POE@key@comp@Yshift){%
+ \pnode(! \POE@dict{
+ \POE@key@rotate@xref\space
+ \POE@key@rotate@yref\space
+ DefineExtNode}){\oenodeRotref{}}%
+ \ifdim\POE@key@angle pt=0pt
+ #1%
+ \POE@pnode@shiftedrot(0,\POE@key@labeloffset)%
+ {\oenodeCenter{}}%
+ {\oenodeLabel{}}%
+ {\POE@key@labelangle}%
+ \else
+ \psrotate(\oenodeRotref{}){\POE@key@angle}{%
+ #1%
+ \POE@pnode@shiftedrot(0,\POE@key@labeloffset)%
+ {\oenodeCenter{}}%
+ {\oenodeLabel{}}%
+ {\POE@key@labelangle}%
+ }%
+ \fi%
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@putlabel}
+% Positioning of the label depending on the reference coordinates.
+% Needs possibly a previously defined node \cs{oenodeLabel} which
+% marks exactly the position of the label relative to the component.
+% This is defined by calling \cs{poe@putcomp}.
+% \begin{macrocode}
+\def\POE@putlabel#1{%
+ \def\POE@temp{#1}%
+% \end{macrocode}
+% Put the label only if it's not empty.
+% \begin{macrocode}
+ \ifx\POE@temp\@empty\else
+% \end{macrocode}
+% For \opt{global} positioning, the label is placed in global coordinate system
+% with respect to the center node.
+% \begin{macrocode}
+ \ifx\POE@key@labelref\POE@str@labelref@global
+ \nput[labelsep=\POE@key@labeloffset]%
+ {\POE@key@labelangle}%
+ {\oenodeCenter{}}%
+ {\pnode(0,0){\oenodeLabel{}}%
+ \rput[\POE@key@labelalign](0,0){\POE@key@labelstyle #1}}%
+% \end{macrocode}
+% Rotate the label node together with the component, but do not rotate the label
+% text itself.
+% \begin{macrocode}
+ \else\ifx\POE@key@labelref\POE@str@labelref@relgrav
+ \rput[\POE@key@labelalign](\oenodeLabel{}){%
+ \POE@key@labelstyle #1}%
+% \end{macrocode}
+% Rotate label node and label text with the component.
+% \begin{macrocode}
+ \else\ifx\POE@key@labelref\POE@str@relative
+ \begingroup
+% \end{macrocode}
+% Redefine InitNC only for positioning of the label with labelref=relative
+% \begin{macrocode}
+ \pst@def{InitNC}< % kindly contributed by Herbert Voss
+ /b ED /a ED
+ /NodeSepTypeB ED /NodeSepTypeA ED
+ /NodeSepB ED /NodeSepA ED
+ /OffsetB ED /OffsetA ED
+ tx@NodeDict a known tx@NodeDict b known and dup {
+ /NodeA a load def /NodeB b load def
+ NodeA GetCenter NodeB GetCenter
+ 4 copy exch 4 -1 roll 2 copy gt
+ { pop pop pop pop /yB ED /xB ED /yA ED /xA ED }
+ { eq 3 1 roll lt and
+ { /yB ED /xB ED /yA ED /xA ED}
+ { /yA ED /xA ED /yB ED /xB ED} ifelse
+ } ifelse
+ } if >%
+ \ncline[linestyle=none,fillstyle=none, npos=]%
+ {\POE@trefnodeA}{\POE@trefnodeB}%
+ \ifx\POE@key@position\@empty
+ \ifx\POE@key@abspos\@empty
+ \ncput[nrot=:U,npos=]{\POE@putlabelrelative{#1}}%
+ \else
+ \POE@nlput[nrot=:U](\POE@trefnodeA)(\POE@trefnodeB)%
+ {\POE@key@abspos}{\POE@putlabelrelative{#1}}%
+ \fi
+ \else
+ \ncput[nrot=:U, npos=\POE@key@position]%
+ {\POE@putlabelrelative{#1}}%
+ \fi
+ \endgroup
+ \fi\fi\fi
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Free-ray components}
+%
+% Define all free-ray dipoles
+% \begin{macrocode}
+\newOptexpDipole{lens}{}%
+\newOptexpDipole{pinhole}{}%
+\newOptexpDipole{crystal}{}%
+\newOptexpDipole{polarization}{}%
+\newOptexpDipole{optbox}{}%
+\newOptexpDipole{optplate}{}%
+\newOptexpDipole{optretplate}{}%
+\newOptexpDipole[endbox]{optdetector}{}%
+\newOptexpDipole{optdiode}{allowbeaminside=false}%
+\newOptexpDipole{doveprism}{}%
+% \end{macrocode}
+%
+% Define all free-ray tripoles
+% \begin{macrocode}
+\newOptexpTripole{mirror}{}%
+\newOptexpTripole[ref@angle=-135]{beamsplitter}{}%
+\newOptexpTripole{optgrating}{}%
+\def\optgrid{%
+ \PackageWarning{pst-optexp}{%
+ \string\optgrid\space is deprecated,\MessageBreak
+ use \string\optgrating\space instead.}%
+ \optgrating%
+}%
+\newOptexpTripole[ref@angle=-135]{pentaprism}{}%
+\newOptexpTripole[ref@angle=-135]{rightangleprism}{}%
+\newOptexpTripole[ref@angle=-135]{optprism}{}%
+% \end{macrocode}
+%
+% \begin{macro}{\optdipole}
+% \begin{macrocode}
+\def\optdipole{\pst@object{optdipole}}
+\def\optdipole@i(#1)(#2)#3#4{%
+ \begin@OptexpObj
+ \ifPOE@backlayer
+ \POE@regNodes{#1}{#2}
+ \POE@extnodealign
+ \fi
+ \POE@drawcomponent{#4}{%
+ \ifPOE@backlayer
+ \pnode(0,0){\oenodeCenter{}}%
+ \newOptexpComp{{0 0} {0 1} 0 0 trans {PlainIfc} 1 }%
+ \fi
+ \ifPOE@frontlayer
+ #3
+ \fi
+ }%
+ \ifPOE@backlayer
+ \POE@drawInternalConnections
+ \fi
+ \end@OptexpObj
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\opttripole}
+% \begin{macrocode}
+\def\opttripole{\pst@object{opttripole}}
+\def\opttripole@i(#1)(#2)(#3)#4#5{%
+ \begin@OptexpTripole
+ \ifPOE@backlayer
+ \POE@regNodes{#1}{#3}%
+ \POE@calcNodes{#1}{#2}{#3}%
+ \fi
+ \POE@drawcomponent{#5}{%
+ \pnode(0,0){\oenodeCenter{}}%
+ \newOptexpComp{{0 0} {1 0} 0 0 refl {PlainIfc} 1 }%
+ #4
+ }%
+ \POE@drawInternalConnections
+ \end@OptexpTripole
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fibercollimator}
+% \begin{macrocode}
+\def\fibercollimator{\pst@object{fibercollimator}}
+\def\fibercollimator@i(#1)(#2){%
+ \def\POE@tempa{#1}%
+ \def\POE@tempb{#2}%
+ \def\POE@tempc{}%
+ \def\POE@tempd{}%
+ \@ifnextchar(%)
+ {\fibercollimator@ii}{\fibercollimator@iv}%
+}%
+\def\fibercollimator@ii(#1){%
+ \def\POE@tempc{#1}%
+ \@ifnextchar(%)
+ {\fibercollimator@iii}{\fibercollimator@iv}%
+}%
+\def\fibercollimator@iii(#1){%
+ \def\POE@tempd{#1}%
+ \fibercollimator@iv
+}%
+\def\fibercollimator@iv{%
+ \@ifnextchar\bgroup{\fibercollimator@v}{\fibercollimator@v{}}%
+}%
+\def\fibercollimator@v#1{%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \POE@regNodes{\POE@tempa}{\POE@tempb}%
+ \POE@extnodealign
+ \fi
+ \POE@drawcomponent[fibercollimator]{#1}{%
+ \pnode(0,0){\oenodeCenter{}}%
+ \ifPOE@backlayer
+ \fibercollimator@nodes
+ \fi
+ \ifPOE@frontlayer
+ \fibercollimator@comp
+ \fi
+ }%
+ \ifPOE@backlayer
+ \ifPOE@beam
+ \drawbeam{(\oenodeRefA{})}{\POE@key@compname}
+ \fi
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetout@
+ \ifx\@empty\POE@tempc
+ \drawfiber{\POE@key@compname}{(\oenodeRefB{})}
+ \else\ifx\@empty\POE@tempd
+ \psbezier[style=FiberOut](\oenodeOut{})(\POE@tempb)%
+ (\POE@tempb)(\POE@tempc)%
+ \else
+ \psbezier[style=FiberOut](\oenodeOut{})(\POE@tempb)%
+ (\POE@tempc)(\POE@tempd)%
+ \fi\fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% Define all fiber dipoles
+% \begin{macrocode}
+\newOptexpFiberDipole{optfiber}{newOptComp={}}
+\newOptexpFiberDipole{optamp}{}
+\newOptexpFiberDipole{optmzm}{}
+\newOptexpFiberDipole{optfilter}{allowbeaminside=false}
+\newOptexpFiberDipole{polcontrol}{}
+\newOptexpFiberDipole{optisolator}{}
+\newOptexpFiberDipole{optfiberpolarizer}{}
+\newOptexpFiberDipole{optswitch}{}
+\newOptexpFiberDipole{fiberdelayline}{}
+% \end{macrocode}
+%
+% \begin{macro}{\POE@drawcomponent}
+% This macro is called by every unit
+% The first parameter contains the label, the second one the drawing code
+% \begin{macrocode}
+\def\POE@drawcomponent{%
+ \@ifnextchar[%]
+ {\POE@drawcomponent@i}{\POE@drawcomponent@i[]}%
+}%
+\def\POE@drawcomponent@i[#1]#2#3{%
+ \def\@@comp{%
+ #3%
+ \ifx\POE@key@extnode\@empty\else
+ \ifPOE@backlayer
+ \pnode(! \POE@dict{
+ \POE@key@extnode@xref\space
+ \POE@key@extnode@yref\space
+ DefineExtNode}){\oenodeExt{}}%
+ \POE@Verb{%
+ tx@NodeDict begin /N@\oenodeExt{} load
+ \ifnum9<1\POE@key@compname
+ /N@ExtNode
+ \else
+ /N@\POE@key@compname ExtNode
+ \fi
+ ED end
+ }%
+ \fi
+ \fi
+ }%
+ \@ifundefined{#1@ref}{}{\@nameuse{#1@ref}}%
+ \ifPOE@endbox
+ \psset[optexp]{abspos={%
+ \POE@dict{%
+ /N@\POE@refnodeA\space @GetCenter \tx@UserCoor
+ /N@\POE@refnodeB\space @GetCenter \tx@UserCoor
+ @ABDist @@x0 @@x add add
+ }%
+ }}%
+ \else\ifPOE@startbox
+ \psset[optexp]{abspos={\POE@dict{ @@x0 neg @@x sub }}}%
+ \fi\fi
+ \POE@disablepos
+ \ncline[linestyle=none,fillstyle=none,npos=]%
+ {\POE@refnodeA}{\POE@refnodeB}%
+% \end{macrocode}
+% Positioning of the component
+% \begin{macrocode}
+ \begingroup
+ \psset{style=OptComp}%
+% \end{macrocode}
+% linestyle to use, if component should be marked as optional
+% \begin{macrocode}
+ \ifPOE@component@optional
+ \psset{style=OptionalStyle}%
+ \fi
+% \end{macrocode}
+% If parameter \opt{position} is given, use it for \opt{npos}.
+% \begin{macrocode}
+ \ifx\POE@key@abspos\@empty
+% \end{macrocode}
+% Then check if absolute positioning with \opt{abspos} is wanted.
+% \begin{macrocode}
+ \ifx\POE@key@position\@empty
+ \ncput[nrot=:U,npos=]{\POE@putcomp{\@@comp}}%
+ \else
+ \ncput[nrot=:U,npos=\POE@key@position]{\POE@putcomp{\@@comp}}%
+ \fi
+ \else
+ \POE@nlput[nrot=:U](\POE@refnodeA)(\POE@refnodeB)%
+ {\POE@key@abspos}{\POE@putcomp{\@@comp}}%
+ \fi
+ \endgroup
+ \ifPOE@backlayer
+ \POE@transformnodes
+ \fi
+ \ifPOE@frontlayer
+ \POE@putlabel{#2}%
+ \fi
+% \end{macrocode}
+% Show some special dots for debugging
+% \begin{macrocode}
+ \ifPOE@debug@showoptdots
+ \ifPOE@frontlayer
+ \psdot[linecolor=red](\oenodeCenter{})
+ \psdot[linecolor=red, dotstyle=x, dotscale=1.5](\oenodeLabel{})
+ \psdot[linecolor=black](\oenodeRefA{})
+ \psdot[linecolor=black](\oenodeRefB{})
+ \psdot[linecolor=black, dotstyle=x,
+ dotscale=1.5](\oenodeTrefA{})
+ \psdot[linecolor=black, dotstyle=x,
+ dotscale=1.5](\oenodeTrefB{})
+ \fi
+ \fi
+ \ifPOE@debug@showifcnodes
+ \ifPOE@frontlayer
+ \POE@ifcnodes[style=IfcNodeStyle]
+ \fi
+ \fi
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{POE@setref}
+% \begin{macrocode}
+\let\POE@setref\POE@Verb
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{POE@transformnode}
+% Transform node \opt{\#1} according to the positioning parameters
+% (\opt{compshift}, \opt{position}, and \opt{abspos}) with respect to the
+% rotation reference node and define it as \opt{\#2}.
+% \begin{macrocode}
+\def\POE@transformnode#1#2{%
+ \pnode(!
+ \POE@dict{%
+ /N@\oenodeRotref{} @GetCenter 2 copy
+ /N@#1 @GetCenter
+ \POE@key@comp@Xshift\space\POE@key@comp@Yshift\space
+ \tx@ScreenCoor VecAdd 4 2 roll @ABVect
+ \POE@key@angle\space matrix rotate dtransform VecAdd
+ \tx@UserCoor
+ }){#2}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@ifcnodes}
+% \begin{macrocode}
+\def\POE@ifcnodes{\pst@object{POE@ifcnodes}}
+\def\POE@ifcnodes@i{%
+ \begin@SpecialObj%
+ \solid@star%
+ \addto@pscode{
+ \psk@dotsize
+ \@nameuse{psds@\psk@dotstyle}
+ \POE@dict{[ (\oenode{}{}) false GetInternalBeamNodes %]
+ counttomark 2 idiv { Dot } repeat
+ pop}
+ }%
+ \end@SpecialObj
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{POE@extnodes}
+% \begin{macrocode}
+\def\POE@extnodes{\pst@object{POE@extnodes}}
+\def\POE@extnodes@i#1{%
+ \begin@SpecialObj
+ \let\POE@setref\addto@pscode
+ \addto@pscode{\pst@optexpdict InitOptexpComp }
+ \@ifundefined{#1@ref}{}{\@nameuse{#1@ref}}%
+ \solid@star%
+ \addto@pscode{
+ \psk@dotsize
+ \@nameuse{psds@\psk@dotstyle}
+ @@x 0 eq { [0] }{ [ @@x neg 0 @@x ] } ifelse
+ {
+ @@y 0 eq { [0] }{ [@@y neg 0 @@y ] } ifelse
+ {
+ exch dup 3 1 roll
+ @@x0 add exch @@y0 add \tx@ScreenCoor
+ /\oenode{}{} load begin CompMtrx end transform CM itransform
+ Dot
+ } forall
+ pop
+ } forall
+ end
+ }%
+ \end@SpecialObj
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\tripole@nodes}
+% \begin{macrocode}
+\def\tripole@nodes{%
+ \newOptexpComp{{0 0} {1 0} @@x neg @@x refl {PlainIfc} 1}%
+ \pnode(! \POE@dict{@@y0 @@x0}){\oenodeCenter{}}
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\dipole@nodes}
+% \begin{macrocode}
+\def\dipole@nodes{%
+ \newOptexpComp{%
+ {@@x0 @@x sub 0} {0 1} @@y0 @@y sub @@y0 @@y add trans {PlainIfc}
+ @@x 0 eq not {
+ {@@x0 @@x add 0} {0 1} @@y0 @@y sub @@y0 @@y add trans {PlainIfc}
+ } if \POE@key@n }%
+ \pnode(! \POE@dict{@@x0 @@y0}){\oenodeCenter{}}
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{fiberdipole@nodes}
+% \begin{macrocode}
+\def\fiberdipole@nodes{%
+ \newOptexpFiberComp{%
+ {@@x0 @@x sub 0}
+ @@x 0 eq not {
+ {@@x0 @@x add 0}
+ } if }%
+ \pnode(! \POE@dict{@@x0 @@y0}){\oenodeCenter{}}
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Free-ray components}
+%
+% \subsubsection{mirror}
+%
+% \begin{macro}{\mirror@ref}
+% \begin{macrocode}
+\def\mirror@ref{%
+ \ifdim\POE@key@mirrorradius pt=0pt
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@piezo
+ \POE@setref{/@@y0 \pst@number\psyunit def}%
+ \bgroup
+ \psset{style=PiezoMirror}
+ \POE@setref{%
+ \pst@number\psyunit @@y0 div
+ \POE@key@mirrorwidth\space 0.5 mul mul 2.5 div /@@y0 ED
+ }%
+ \egroup
+ \else
+ \POE@setref{/@@x \POE@key@mirrorwidth\space 0.5 mul def}%
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@plain\else
+ \POE@setref{\POE@key@mirrordepth\space 0.5 mul dup /@@y0 ED /@@y ED}
+ \fi
+ \fi
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mirror@nodes}
+% \begin{macrocode}
+\def\mirror@nodes{%
+ \ifdim\POE@key@mirrorradius pt=0pt
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@semitrans
+ \newOptexpCompAmb{%
+ {0 0} {1 0}
+ \POE@key@mirrorwidth\space -0.5 mul dup neg
+ refl {PlainIfc}
+ {0 \POE@key@mirrordepth} {1 0}
+ \POE@key@mirrorwidth\space -0.5 mul dup neg
+ trans {PlainIfc}
+ \POE@key@mirrordepth\space -1e-5 lt {
+ 12 6 roll 2
+ } {
+ \POE@key@mirrordepth\space 1e-5 lt {
+ 6 {pop} repeat
+ } if
+ 1
+ } ifelse
+ \POE@key@n }%
+ \else
+ \newOptexpComp{%
+ {0 0} {1 0}
+ \POE@key@mirrorwidth\space -0.5 mul dup neg
+ refl {PlainIfc} 1 }%
+ \fi
+ \else
+ \newOptexpComp{%
+ {0 0} {0 \POE@key@mirrorradius\space neg}
+ \POE@key@mirrorwidth\space -0.5 mul dup neg
+ refl {CurvedIfc} 1 }%
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@semitrans
+ \PackageWarning{pst-optexp}{%
+ Mirrortype 'semitrans' does not support curved\MessageBreak
+ mirror, falling back to 'plain' type.}%
+ \fi
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\mirror@comp}
+% \begin{macrocode}
+\def\mirror@comp{%
+ \edef\@ht{%
+ \POE@key@mirrorwidth\space\pst@number\psyunit mul 0.5 mul %
+ }%
+ \edef\@dp{\POE@key@mirrordepth\space\pst@number\psxunit mul }%
+ \edef\@r{\POE@key@mirrorradius\space\pst@number\psxunit mul }%
+ \edef\@postcode{%
+ neg 5 -1 roll exch 5 2 roll 90 add exch 90 add exch ArcR %
+ }%
+ \edef\@extpostcode{%
+ neg \@dp add 5 -1 roll exch 5 2 roll 90 add exch 90 add %
+ }%
+% \end{macrocode}
+% concave mirrors
+% \begin{macrocode}
+ \ifdim\POE@key@mirrorradius pt<0pt
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@extended
+% \end{macrocode}
+% extended concave mirror
+% \begin{macrocode}
+ \bgroup
+ \psset{style=ExtendedMirror}
+ \begin@ClosedObj
+ \addto@pscode{%
+ \pst@optexpdict \@ht \@r rightCurvedIfc \@postcode
+ \@ht \@r rightCurvedIfc \@extpostcode arc
+ closepath end}%
+ \end@ClosedObj
+ \egroup
+ \fi
+ \bgroup
+ \psset{linewidth=\POE@key@mirrorlinewidth}
+ \begin@OpenObj
+ \addto@pscode{\POE@dict{ \@ht \@r rightCurvedIfc \@postcode }}%
+ \end@OpenObj
+ \egroup
+% \end{macrocode}
+% convex mirrors
+% \begin{macrocode}
+ \else\ifdim\POE@key@mirrorradius pt>0pt
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@extended
+% \end{macrocode}
+% extended convex mirror
+% \begin{macrocode}
+ \bgroup
+ \psset{style=ExtendedMirror}
+ \begin@ClosedObj
+ \addto@pscode{%
+ \pst@optexpdict \@ht \@r rightCurvedIfc \@postcode
+ \@ht \@r rightCurvedIfc \@extpostcode arcn
+ closepath end}%
+ \end@ClosedObj
+ \egroup
+ \fi
+ \bgroup
+ \psset{linewidth=\POE@key@mirrorlinewidth}
+ \begin@OpenObj
+ \addto@pscode{\POE@dict{ \@ht \@r rightCurvedIfc \@postcode }}%
+ \end@OpenObj
+ \egroup
+ \else
+% \end{macrocode}
+% plain mirror
+% \begin{macrocode}
+ \edef\@ht{\POE@key@mirrorwidth\space 0.5 mul }%
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@piezo
+ \psframe[style=PiezoMirror,
+ dimen=outer](! \@ht 4 div 0)%
+ (! \@ht -4 div \@ht 2.5 div)
+ \ifx\POE@key@extnode\@empty
+ \psbezier(! 0 \@ht 2.5 div)%
+ (! 0 \@ht 1.5 div)%
+ (! \@ht 2 div \@ht 2 div)%
+ (! \@ht 4 div \@ht)
+ \fi
+ \else\ifx\POE@key@mirrortype\POE@str@mirrortype@extended
+ \psframe[style=ExtendedMirror]%
+ (! \@ht neg \POE@key@mirrordepth\space )%
+ (! \@ht 0)
+ \else\ifx\POE@key@mirrortype\POE@str@mirrortype@semitrans
+ \psframe[style=SemitransMirror]%
+ (! \@ht neg \POE@key@mirrordepth\space )%
+ (! \@ht 0)
+ \fi\fi\fi
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@semitrans
+ \psline[linewidth=\POE@key@mirrorlinewidth]%
+ (! \@ht neg 0)(! \@ht 0)
+ \else
+ \psline[linewidth=\POE@key@mirrorlinewidth]%
+ (! \@ht neg \getCLWH)(! \@ht \getCLWH)
+ \fi
+ \fi\fi
+ \ifPOE@variable
+ \psarc[style=VariableStyle]%
+ (! \POE@key@mirrorwidth\space 0.5 mul 0.4 sub
+ \ifdim\POE@key@mirrorradius pt=0pt
+ 0
+ \else
+ \POE@key@mirrorradius\space dup \POE@dict{sign} neg exch
+ \POE@key@mirrorwidth\space 0.5 mul \POE@dict{capHeight} mul
+ \fi){0.6}{-20}{20}
+ \psarc[style=VariableStyle]%
+ (! 0.4 \POE@key@mirrorwidth\space 0.5 mul sub
+ \ifdim\POE@key@mirrorradius pt=0pt
+ 0
+ \else
+ \POE@key@mirrorradius\space dup \POE@dict{sign} neg exch
+ \POE@key@mirrorwidth\space 0.5 mul \POE@dict{capHeight} mul
+ \fi){0.6}{160}{200}
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{lens}
+%
+% \begin{macro}{\lens@ref}
+% \begin{macrocode}
+\def\lens@ref{%
+ \ifdim\POE@key@lensradiusleft pt=0pt
+ \edef\@th{0 }%
+ \else
+ \edef\@th{%
+ \ifPOE@thicklens
+ \POE@key@lenswidth\space 0.5 mul
+ \else
+ \ifdim\POE@key@lensradiusleft pt<0pt
+ \POE@key@lensheight\space 0.075 mul
+ \else
+ \POE@key@lensradiusleft
+ \POE@key@lensheight\space 0.5 mul capHeight
+ \fi
+ \fi
+ \space}%
+ \fi
+ \ifdim\POE@key@lensradiusright pt=0pt\else
+ \edef\@th{%
+ \@th\space
+ \ifPOE@thicklens
+ \POE@key@lenswidth\space 0.5 mul
+ \else
+ \ifdim\POE@key@lensradiusright pt<0pt
+ \POE@key@lensheight\space 0.075 mul
+ \else
+ \POE@key@lensradiusright
+ \POE@key@lensheight\space 0.5 mul capHeight
+ \fi
+ \fi
+ \space add
+ \space}%
+ \fi
+ \POE@setref{%
+ /@@y \POE@key@lensheight\space 0.5 mul def
+ /@@x \@th 0.5 mul def
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lens@nodes}
+% \begin{macrocode}
+\def\lens@nodes{%
+ \newOptexpComp{%
+ {@@x neg 0}
+ \ifdim\POE@key@lensradiusleft pt=0pt
+ {0 1}
+ \POE@key@lensheight\space -0.5 mul dup neg
+ trans {PlainIfc}
+ \else
+ {\POE@key@lensradiusleft\space 0}
+ \POE@key@lensheight\space -0.5 mul dup neg
+ trans {CurvedIfc}
+ \fi
+ {@@x 0}
+ \ifdim\POE@key@lensradiusright pt=0pt
+ {0 1}
+ \POE@key@lensheight\space -0.5 mul dup neg
+ trans {PlainIfc}
+ \else
+ {\POE@key@lensradiusright\space neg 0}
+ \POE@key@lensheight\space -0.5 mul dup neg
+ trans {CurvedIfc}
+ \fi
+ \POE@key@n
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\lens@comp}
+% \begin{macrocode}
+\def\lens@comp{%
+ \addbefore@par{linejoin=1}%
+ \begin@ClosedObj
+ \addto@pscode{\pst@optexpdict }%
+ \def\@th{0}%
+ \def\@wd{\POE@key@lenswidth\space\pst@number\psxunit mul 2 div }%
+ \def\@ht{\POE@key@lensheight\space\pst@number\psyunit mul 2 div }%
+ \def\@rL{\POE@key@lensradiusleft\space\pst@number\psrunit mul }%
+ \def\@rR{\POE@key@lensradiusright\space\pst@number\psrunit mul }%
+ \ifdim\POE@key@lensradiusleft pt=0pt\else
+ \addto@pscode{ \@ht \@rL leftCurvedIfc }%
+ \fi
+ \ifdim\POE@key@lensradiusright pt=0pt\else
+ \addto@pscode{ \@ht \@rR rightCurvedIfc }%
+ \fi
+ \def\@@x{@@x \pst@number\psxunit mul }%
+% \end{macrocode}
+% Check some special cases:
+%
+% 1) Left is plain - right concave / convex
+% \begin{macrocode}
+ \ifdim\POE@key@lensradiusleft pt=0pt
+ \ifdim\POE@key@lensradiusright pt=0pt\else
+ \addto@pscode{%
+ \@@x sub neg 5 1 roll
+ \@@x neg \@ht neg moveto ArcR
+ \@@x neg \@ht lineto
+ }%
+ \fi
+ \fi
+% \end{macrocode}
+% 2) Right is plain - left concave / convex
+% \begin{macrocode}
+ \ifdim\POE@key@lensradiusright pt=0pt
+ \ifdim\POE@key@lensradiusleft pt=0pt\else
+ \addto@pscode{%
+ \@@x sub 5 1 roll
+ \@@x \@ht moveto ArcL
+ \@@x \@ht neg lineto
+ }%
+ \fi
+ \fi
+% \end{macrocode}
+% 3) right and left are both curved
+% \begin{macrocode}
+ \ifdim\POE@key@lensradiusright pt=0pt\else
+ \ifdim\POE@key@lensradiusleft pt=0pt\else
+ \addto@pscode{%
+ \@@x dup
+ 7 1 roll sub neg 5 1 roll
+ ArcR sub 5 1 roll ArcL
+ }%
+ \fi
+ \fi
+ \addto@pscode{closepath 1 setlinejoin end }%
+ \end@ClosedObj
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{pinhole}
+%
+% \begin{macro}{\pinhole@ref}
+% \begin{macrocode}
+\def\pinhole@ref{%
+ \POE@setref{/@@y \POE@key@outerheight\space 0.5 mul def}%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pinhole@nodes}
+% \begin{macrocode}
+\def\pinhole@nodes{%
+ \newOptexpComp{%
+ {-1e-4 0} {0 1} @@y0 @@y sub @@y0 @@y add trans {PlainIfc}
+ {0 0} {0 1} \POE@key@innerheight\space -0.5 mul dup neg
+ trans {PlainIfc}
+ {1e-4 0} {0 1} @@y0 @@y sub @@y0 @@y add trans {PlainIfc}
+ \POE@key@n }%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pinhole@comp}
+% \begin{macrocode}
+\def\pinhole@comp{%
+ \ifdim\POE@key@phwidth pt=0pt
+ \psline[linewidth=\POE@key@phlinewidth]%
+ (! 0 \POE@key@outerheight\space 2 div)%
+ (! 0 \POE@key@innerheight\space 2 div)%
+ \psline[linewidth=\POE@key@phlinewidth]%
+ (! 0 \POE@key@outerheight\space -2 div)%
+ (! 0 \POE@key@innerheight\space -2 div)%
+ \else
+ \pspolygon*[linestyle=none]%
+ (! 0 \POE@key@innerheight\space 2 div)%
+ (! 0 \POE@key@outerheight\space 2 div)%
+ (! \POE@key@phwidth\space\POE@key@outerheight\space 2 div)%
+ (! \POE@key@phwidth\space\POE@key@innerheight\space dup neg
+ \POE@key@outerheight\space add 2 div add 2 div)%
+ \pspolygon*[linestyle=none]%
+ (! 0 \POE@key@innerheight\space -2 div)%
+ (! 0 \POE@key@outerheight\space -2 div)%
+ (! \POE@key@phwidth\space\POE@key@outerheight\space -2 div)%
+ (! \POE@key@phwidth\space\POE@key@innerheight\space dup neg
+ \POE@key@outerheight\space add 2 div add -2 div)%
+ \fi
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{beamsplitter}
+%
+% \begin{macro}{\beamsplitter@ref}
+% \begin{macrocode}
+\def\beamsplitter@ref{%
+ \POE@setref{/@@x \POE@key@bssize\space 0.5 sqrt mul def }%
+}%
+% \begin{macro}{\beamsplitter@nodes}
+% \begin{macrocode}
+\def\beamsplitter@nodes{%
+ \edef\@bs@wd{\POE@key@bssize\space 0.5 mul }%
+ \ifx\POE@key@bsstyle\POE@str@bsstyle@cube
+ \newOptexpCompAmb{%
+ {\@bs@wd 2 sqrt div neg dup} {-1 1} \@bs@wd neg \@bs@wd
+ trans {PlainIfc}
+ {\@bs@wd 2 sqrt div dup neg} {1 1} \@bs@wd neg \@bs@wd
+ trans {PlainIfc}
+ {0 0} {1 0} \@bs@wd 2 sqrt mul dup neg exch
+ trans {PlainIfc}
+ {\@bs@wd 2 sqrt div dup} {-1 1} \@bs@wd neg \@bs@wd
+ trans {PlainIfc}
+ {\@bs@wd 2 sqrt div neg dup neg} {1 1} \@bs@wd neg \@bs@wd
+ trans {PlainIfc}
+ 3 \POE@key@n
+ }%
+ \else\ifx\POE@key@bsstyle\POE@str@bsstyle@plate
+ \newOptexpCompAmb{%
+ {0 0} {1 0} \@bs@wd neg \@bs@wd trans {PlainIfc} 1 1 }%
+ \fi\fi
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\beamsplitter@comp}
+% \begin{macrocode}
+\def\beamsplitter@comp{%
+ \edef\@bs@wd{\POE@key@bssize\space 2.0 div }%
+ \ifx\POE@key@bsstyle\POE@str@bsstyle@cube
+ \psline[arrows=cc-cc](! \@bs@wd neg 2 sqrt mul 0)
+ (! \@bs@wd 2 sqrt mul 0)
+ \rput[c]{45}(0,0){%
+ \psframe(! \@bs@wd neg \@bs@wd neg)(! \@bs@wd \@bs@wd)
+ }
+ \else\ifx\POE@key@bsstyle\POE@str@bsstyle@plate
+ \psline(! \@bs@wd neg 2 sqrt mul 0)(! \@bs@wd 2 sqrt mul 0)
+ \fi\fi
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{crystal}
+%
+% \begin{macro}{\crystal@ref}
+% \begin{macrocode}
+\def\crystal@ref{%
+ \let\POE@key@optboxwidth\POE@key@crystalwidth
+ \let\POE@key@optboxheight\POE@key@crystalheight
+ \optbox@ref
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\crystal@comp}
+% \begin{macrocode}
+\def\crystal@comp{%
+ \edef\@wd{\POE@key@crystalwidth\space 0.5 mul }
+ \edef\@ht{\POE@key@crystalheight\space 0.5 mul }
+ \psframe(! \@wd neg \@ht neg)(! \@wd \@ht)
+ \ifPOE@voltage%
+ \psline(!\@wd 4 div 3 mul neg \@ht)%
+ (! \@wd 4 div 3 mul neg \@ht 0.2 add)
+ \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)%
+ (! \@wd 4 div 3 mul neg \@ht neg 0.2 sub)%
+ \psline(! \@wd 4 div 3 mul neg 0.15 sub \@ht neg 0.2 sub)%
+ (! \@wd 4 div 3 mul neg 0.15 add \@ht neg 0.2 sub)%
+ \fi
+ \ifPOE@lamp
+ \rput(! \@wd \@ht){%
+ \psset{style=CrystalLamp}%
+ \rput(0, 0.4){\crystal@lamp}%
+ }%
+ \fi
+ \ifdim\POE@key@caxislength pt=0pt\else
+ \def\@cl{%
+ \POE@key@caxislength\space
+ \ifPOE@caxisinv -1 mul\space\fi
+ }%
+ \psline[style=CrystalCaxis](! 0 \@cl \POE@dict{sign} \@ht mul)%
+ (! 0 \@cl \POE@dict{sign} neg \@ht mul \@cl sub)%
+ \fi
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\crystal@lamp}
+% \begin{macrocode}
+\def\crystal@lamp{%
+ \pscurve[fillstyle=none](-0.015, 0)(-0.03, -0.045)(-0.06, -0.075)%
+ (-0.075, -0.15)(0, -0.21)(0.075, -0.15)(0.06, -0.075)%
+ (0.03, -0.045)(0.015, 0)
+ \multido{\i=-30+40}{7}{%
+ \rput{\i}(0, -0.135){%
+ \psline(-0.105, 0)(-0.18, 0)
+ }%
+ }%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{polarization}
+%
+% \begin{macro}{\polarization@comp}
+% \begin{macrocode}
+\def\polarization@comp{%
+ \edef\@sz{\POE@key@polsize\space 0.5 mul }%
+ \psset{style=Polarization}%
+ \ifx\POE@key@poltype\POE@str@pol@polparallel
+ \psline[arrows=<->](! 0 \@sz neg)(! 0 \@sz)
+ \fi
+ \ifx\POE@key@poltype\POE@str@pol@polperp
+ \psdot(0,0)
+ \pscircle[fillstyle=none](0,0){0.12}
+ \fi
+ \ifx\POE@key@poltype\POE@str@pol@polmisc
+ \psline[arrows=<->](! 0 \@sz neg)(! 0 \@sz)
+ \psdot(0,0)
+ \pscircle[fillstyle=none](0,0){0.12}
+ \fi
+ \ifx\POE@key@poltype\POE@str@pol@polrcirc
+ \psellipticarc[arrows=->]%
+ (0,0)(! \@sz 2 div \@sz){20}{-20}
+ \fi
+ \ifx\POE@key@poltype\POE@str@pol@pollcirc
+ \psellipticarc[arrows=<-]%
+ (0,0)(! \@sz 2 div \@sz){20}{-20}
+ \fi
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{optgrating}
+%
+% \begin{macro}{\optgrating@ref}
+% \begin{macrocode}
+\def\optgrating@ref{%
+ \POE@setref{/@@x \POE@key@gratingwidth\space 0.5 mul def}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optgrating@comp}
+% \begin{macrocode}
+\def\optgrating@comp{%
+ \edef\@cnt{\POE@key@gratingcount\space}%
+ \edef\@wd{\POE@key@gratingwidth\space 0.5 mul }%
+ \ifdim\POE@key@gratingheight pt<\POE@key@gratingdepth pt
+ \edef\@ht{\POE@key@gratingdepth\space}%
+ \else
+ \edef\@ht{\POE@key@gratingheight\space}%
+ \fi
+ \edef\@dp{\POE@key@gratingdepth\space}%
+ \edef\@step{\POE@key@gratingwidth\space\@cnt div }%
+ \ifx\POE@key@gratingtype\POE@str@gratingtype@blazed
+ \pscustom[linewidth=\POE@key@gratinglinewidth, linejoin=1]{%
+ \psline[liftpen=1](! \@wd \@dp)(! \@wd \@ht)%
+ (! \@wd neg \@ht)(! \@wd neg \@dp)%
+ \multido{\i=0+1}{\POE@key@gratingcount}{%
+ \psline[liftpen=1]%
+ (! \@wd neg \i\space \@step mul add \@dp)%
+ (! \@wd neg \i\space
+ \ifPOE@reverse\else 1 add \fi \@step mul add 0)%
+ (! \@wd neg \i\space 1 add \@step mul add \@dp)%
+ }%
+ \closepath
+ }%
+ \else\ifx\POE@key@gratingtype\POE@str@gratingtype@binary
+ \pscustom[linewidth=\POE@key@gratinglinewidth]{%
+ \psline[liftpen=1](! \@wd \@dp)(! \@wd \@ht)%
+ (! \@wd neg \@ht)(! \@wd neg \@dp)%
+ \multido{\i=0+1}{\POE@key@gratingcount}{%
+ \psline[liftpen=1]%
+ (! \@wd neg \i\space \@step mul add \@dp)%
+ (! \@wd neg \i\space \@step mul add 0)%
+ (! \@wd neg \i\space 0.5 add \@step mul add 0)%
+ (! \@wd neg \i\space 0.5 add \@step mul add \@dp)%
+ (! \@wd neg \i\space 1 add \@step mul add \@dp)%
+ }%
+ }%
+ \fi\fi
+ \ifPOE@variable
+ \psarc[style=VariableStyle]%
+ (! \POE@key@gratingwidth\space 0.5 mul 0.4 sub
+ \POE@key@gratingheight\space 0.5 mul){0.6}{-20}{20}
+ \psarc[style=VariableStyle]%
+ (! 0.4 \POE@key@gratingwidth\space 0.5 mul sub
+ \POE@key@gratingheight\space 0.5 mul){0.6}{160}{200}
+ \fi
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{optbox}
+%
+% \begin{macro}{\optbox@ref}
+% \begin{macrocode}
+\def\optbox@ref{%
+ \POE@setref{%
+ /@@x \POE@key@optboxwidth\space 0.5 mul def
+ /@@y \POE@key@optboxheight\space 0.5 mul def
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optbox@comp}
+% \begin{macrocode}
+\def\optbox@comp{%
+ \edef\@wd{\POE@key@optboxwidth\space 0.5 mul }
+ \edef\@ht{\POE@key@optboxheight\space 0.5 mul }
+ \psframe[dimen=outer](! \@wd neg \@ht neg)(! \@wd \@ht)
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{optplate}
+%
+% \begin{macro}{\optplate@ref}
+% \begin{macrocode}
+\def\optplate@ref{%
+ \POE@setref{/@@y \POE@key@plateheight\space 0.5 mul def }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optplate@comp}
+% \begin{macrocode}
+\def\optplate@comp{%
+ \psline[linewidth=\POE@key@platelinewidth]%
+ (! \POE@dict{0 @@y neg})(! \POE@dict{0 @@y})
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{optdetector}
+%
+% \begin{macro}{\optdetector@ref}
+% \begin{macrocode}
+\def\optdetector@ref{%
+ \ifx\POE@key@detsize\@empty
+ \POE@setref{%
+ /@@y \POE@key@detheight\space 0.5 mul def
+ /@@x \POE@key@detwidth\space 0.5 mul def
+ }%
+ \else
+ \POE@setref{%
+ /@@y \POE@key@detsize\space 0.5 mul def
+ /@@x \POE@key@detsize\space 0.5 mul
+ \ifx\POE@key@dettype\POE@str@dettype@round 0.5 mul\fi
+ \space def
+ }%
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optdetector@nodes}
+% \begin{macrocode}
+\def\optdetector@nodes{%
+ \dipole@nodes
+ \ifx\POE@key@dettype\POE@str@dettype@round
+ \pnode(! \POE@dict{@@x0 @@x -0.2 mul add} 0){\oenodeCenter{}}%
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optdetector@comp}
+% \begin{macrocode}
+\def\optdetector@comp{%
+ \ifx\POE@key@dettype\POE@str@dettype@round
+ \psellipticwedge(!\POE@dict{@@x0 @@x sub @@y0})%
+ (!\POE@dict{@@x 2 mul @@y}){-90}{90}%
+ \else\ifx\POE@key@dettype\POE@str@dettype@diode
+ \ifx\POE@key@detsize\@empty
+ \ifdim\POE@key@detwidth pt<\POE@key@detheight pt
+ \def\@sz{\POE@key@detwidth\space 0.5 mul }%
+ \else
+ \def\@sz{\POE@key@detheight\space 0.5 mul }%
+ \fi
+ \else
+ \def\@sz{\POE@key@detsize\space 0.5 mul }%
+ \fi
+ \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})%
+ (! \POE@dict{@@x @@y})%
+ \bgroup
+ \psset{style=DetectorStyle}
+ \pspolygon(! \@sz -0.2 mul \@sz -0.4 mul)%
+ (! \@sz 0.6 mul \@sz -0.4 mul)%
+ (! \@sz 0.2 mul \@sz 0.4 mul)%
+ \psline(! \@sz -0.2 mul \@sz 0.4 mul \getCLWH add)%
+ (! \@sz 0.6 mul \@sz 0.4 mul \getCLWH add)
+ \psset{arrows=->, arrowinset=0, arrowscale=0.8}%
+ \psline(! \@sz -0.8 mul \@sz 0.3 mul)%
+ (! \@sz -0.3 mul \@sz 0.15 mul)%
+ \psline(! \@sz -0.8 mul 0)(! \@sz -0.3 mul \@sz -0.15 mul)%
+ \egroup
+ \fi\fi
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{optretplate}
+%
+% \begin{macro}{\optretplate@ref}
+% \begin{macrocode}
+\def\optretplate@ref{%
+ \POE@setref{%
+ /@@y \POE@key@plateheight\space 0.5 mul def
+ /@@x \POE@key@platewidth\space 0.5 mul def
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optretplate@comp}
+% \begin{macrocode}
+\def\optretplate@comp{%
+ \edef\@ht{\POE@key@plateheight\space 0.5 mul }%
+ \edef\@wd{\POE@key@platewidth\space 0.5 mul }%
+ \psframe(! \@wd neg \@ht neg)(! \@wd \@ht)
+ \psline{cc-cc}(! \@wd neg \@ht)(! \@wd \@ht neg)
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{optdiode}
+%
+% \begin{macro}{\optdiode@ref}
+% \begin{macrocode}
+\def\optdiode@ref{%
+ \POE@setref{%
+ \POE@key@optdiodesize\space 0.5 mul dup /@@y ED /@@x ED
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optdiode@comp}
+% \begin{macrocode}
+\def\optdiode@comp{%
+ \edef\@sz{\POE@key@optdiodesize\space}%
+ \psframe[dimen=outer](! \@sz -0.5 mul dup)(!\@sz 0.5 mul dup)
+ \pspolygon(! \@sz -0.2 mul \@sz -0.2 mul)
+ (! \@sz -0.2 mul \@sz 0.2 mul)
+ (! \@sz 0.2 mul 0)
+ \psline(! \@sz 0.2 mul \getCLWH add \@sz 0.2 mul)%
+ (! \@sz 0.2 mul \getCLWH add \@sz -0.2 mul)
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{doveprism}
+%
+% \begin{macro}{doveprism@ref}
+% \begin{macrocode}
+\def\doveprism@ref{%
+ \POE@setref{/@@x \POE@key@doveprismwidth\space 0.5 mul def
+ /@@y \POE@key@doveprismheight\space 0.5 mul def}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\doveprism@nodes}
+% \begin{macrocode}
+\def\doveprism@nodes{%
+ \newOptexpComp{%
+ /@htsq @@y 2 sqrt mul def
+ {@@x neg @@y add 0} {1 1}
+ @htsq neg @htsq trans {PlainIfc}
+ {0 @@y neg} {1 0}
+ @@x neg dup neg
+ refl {PlainIfc}
+ {@@x @@y sub 0} {-1 1}
+ @htsq neg @htsq trans {PlainIfc}
+ \POE@key@n true
+ }%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\doveprism@comp}
+% \begin{macrocode}
+\def\doveprism@comp{%
+ \edef\@ht{\POE@key@doveprismheight\space 0.5 mul }%
+ \edef\@wd{\POE@key@doveprismwidth\space 0.5 mul }%
+ \pspolygon(! \@wd neg \@ht neg)%
+ (! \@wd \@ht neg)%
+ (! \@wd \@ht 2 mul sub \@ht)%
+ (! \@ht 2 mul \@wd sub \@ht)%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{pentaprism}
+%
+% \begin{macro}{\pentaprism@nodes}
+% \begin{macrocode}
+\def\pentaprism@nodes{%
+ \edef\@sz{\POE@key@pentaprismsize\space}%
+ \newOptexpComp{%
+ {\@sz 2 sqrt -2 mul div dup } {-1 1}
+ \@sz -0.5 mul dup neg trans {PlainIfc}
+ {\@sz 2 sqrt div 67.5 cos \@sz mul
+ 67.5 sin 2 mul div sub \@sz 2 div}
+ {67.5 cos \@sz mul 67.5 sin div neg \@sz}
+ \@sz 22.5 cos div -0.5 mul dup neg refl {PlainIfc}
+ {\@sz 2 sqrt div neg 67.5 cos \@sz mul
+ 67.5 sin 2 mul div add \@sz 2 div}
+ {67.5 cos \@sz mul 67.5 sin div \@sz}
+ \@sz 22.5 cos div -0.5 mul dup neg refl {PlainIfc}
+ {\@sz 2 sqrt 2 mul div dup neg} {1 1}
+ \@sz -0.5 mul dup neg trans {PlainIfc}
+ \POE@key@n
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\pentaprism@comp}
+% \begin{macrocode}
+\def\pentaprism@comp{%
+ \edef\@sz{\POE@key@pentaprismsize\space}%
+ \pscustom{%
+ \psline(! \@sz 2 sqrt div 0)%
+ (! \@sz 2 sqrt div 67.5 cos \@sz mul
+ 67.5 sin div sub \@sz)%
+ (! 67.5 cos \@sz mul 67.5 sin div \@sz
+ 2 sqrt div sub \@sz)%
+ (! \@sz 2 sqrt div neg 0)%
+ (! 0 \@sz 2 sqrt div neg)%
+ \closepath
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{optprism}
+%
+% \begin{macro}{\optprism@nodes}
+% \begin{macrocode}
+\def\optprism@nodes{%
+ \edef\@sz{\POE@key@prismsize\space}%
+ \edef\@ang{\POE@key@prismangle\space 0.5 mul\space}%
+ \edef\@hshift{%
+ \ifx\POE@key@prismalign\POE@str@auto
+ \@sz 0.6 mul \@ang tan mul \POE@dict{OEangle} 0.5 mul tan div
+ \else
+ 0
+ \fi
+ }%
+ \newOptexpComp{%
+ {\@sz -0.6 mul \@ang tan mul \@hshift neg}
+ {90 \@ang sub dup cos exch sin}
+ \@sz \@ang cos div dup -0.4 mul exch 0.6 mul trans {PlainIfc}
+ {\@sz 0.6 mul \@ang tan mul \@hshift neg}
+ {90 \@ang add dup cos exch sin}
+ \@sz \@ang cos div dup -0.4 mul exch 0.6 mul trans {PlainIfc}
+ \POE@key@n true }%
+ \pnode(! 0 \@hshift neg){\oenodeCenter{}}
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optprism@comp}
+% \begin{macrocode}
+\def\optprism@comp{%
+ \edef\@sz{\POE@key@prismsize\space}%
+ \edef\@altan{\POE@key@prismangle\space 0.5 mul tan }%
+ \edef\@hshift{%
+ \ifx\POE@key@prismalign\POE@str@auto
+ \@sz 0.6 mul \@altan mul \POE@dict{OEangle} 0.5 mul tan div
+ \else
+ 0
+ \fi
+ }%
+ \pspolygon(! \@sz neg \@altan mul \@sz -0.4 mul \@hshift sub)
+ (! \@sz \@altan mul \@sz -0.4 mul \@hshift sub)
+ (! 0 \@sz 0.6 mul \@hshift sub)
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{rightangleprism}
+%
+% \begin{macro}{\rightangleprism@ref}
+% \begin{macrocode}
+\def\rightangleprism@ref{%
+ \POE@setref{%
+ tx@EcldDict begin
+ OEangle 0.5 mul
+ { x sin modA mul }
+ { OEangle x sub sin modB mul }
+ NewtonSolving pop
+ end
+ /@htA exch def
+ OEangle 0.5 mul exch sub /dOEangle exch def
+ /@OEtrafo {dOEangle matrix rotate dtransform } bind def
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\rightangleprism@nodes}
+% \begin{macrocode}
+\def\rightangleprism@nodes{%
+ \edef\@sz{\POE@key@raprismsize\space}%
+ \edef\@ht{\POE@dict{OEangle 0.5 mul sin modA mul} }%
+ \newOptexpComp{%
+ {@htA neg @htA \@sz 0.5 mul sub @OEtrafo} {1 0 @OEtrafo}
+ @htA \@sz 0.5 mul sub @htA trans {PlainIfc}
+ {@htA neg 0 @OEtrafo} {1 1 @OEtrafo}
+ @htA 2 sqrt mul dup \@sz 2 sqrt div sub exch refl {PlainIfc}
+ {@htA 0 @OEtrafo} {-1 1 @OEtrafo}
+ @htA 2 sqrt mul dup \@sz 2 sqrt div sub exch refl {PlainIfc}
+ {@htA dup \@sz 0.5 mul sub @OEtrafo} {1 0 @OEtrafo}
+ @htA neg \@sz 0.5 mul @htA sub trans {PlainIfc}
+ \POE@key@n
+ }%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\rightangleprism@comp}
+% \begin{macrocode}
+\def\rightangleprism@comp{%
+ \edef\@sz{\POE@key@raprismsize\space 0.5 mul }%
+ \pspolygon(!\POE@dict{\@sz neg @htA \@sz sub @OEtrafo})
+ (!\POE@dict{\@sz @htA \@sz sub @OEtrafo})
+ (! 0 \POE@dict{@htA @OEtrafo})%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsection{Fiber components}
+%
+% \subsubsection{optfiber}
+%
+% \begin{macro}{optfiber@ref}
+% \begin{macrocode}
+\def\optfiber@ref{%
+ \POE@setref{/@@x \POE@key@fiberloopsep\space\POE@key@fiberloops\space
+ 1 sub mul 0.5 mul def }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\optfiber@nodes}
+% \begin{macrocode}
+\def\optfiber@nodes{%
+ \newOptexpFiberComp{{@@x neg 0} {@@x 0}}%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optfiber@comp}
+% \begin{macrocode}
+\def\optfiber@comp{%
+ \edef\@f@cnt{\POE@key@fiberloops\space}%
+ \edef\@f@r{\POE@key@fiberloopradius\space}%
+ \edef\@f@sep{\POE@key@fiberloopsep\space}%
+ \parametricplot[plotpoints=200, style=Fiber]{0}{1}{%
+ t 360 mul \@f@cnt mul sin \@f@r mul \@f@sep
+ \@f@cnt 1 sub mul t 0.5 sub mul add
+ 1 t 360 mul \@f@cnt mul cos sub \@f@r mul
+ }%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{optmzm}
+%
+% \begin{macro}{\optmzm@ref}
+% \begin{macrocode}
+\def\optmzm@ref{%
+ \POE@setref{%
+ /@@x \POE@key@optmzmwidth\space 0.5 mul def
+ /@@y \POE@key@optmzmheight\space 0.5 mul def
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optmzm@comp}
+% \begin{macrocode}
+\def\optmzm@comp{%
+ \bgroup
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber, arrows=-, ArrowInside=-}
+ \fi
+ \psline(! \POE@dict{@@x} neg 0)(! \POE@dict{@@x} -0.7 mul 0)%
+ (! \POE@dict{@@x} -0.4 mul \POE@dict{@@y} 0.6 mul)%
+ (! \POE@dict{@@x 0.4 mul @@y 0.6 mul})%
+ (! \POE@dict{@@x} 0.7 mul 0)(! \POE@dict{@@x} 0)%
+ (! \POE@dict{@@x} 0.7 mul 0)%
+ (! \POE@dict{@@x 0.4 mul @@y -0.6 mul})%
+ (! \POE@dict{@@x -0.4 mul @@y -0.6 mul})%
+ (! \POE@dict{@@x} -0.7 mul 0)%
+ \egroup
+ \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})%
+ (!\POE@dict{@@x @@y})
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{optfilter}
+%
+% \begin{macro}{\optfilter@ref}
+% \begin{macrocode}
+\def\optfilter@ref{%
+ \POE@setref{\POE@key@filtersize\space 0.5 mul dup /@@y ED /@@x ED }%
+}%
+\let\optfilter@nodes\dipole@nodes
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optfilter@comp}
+% \begin{macrocode}
+\def\optfilter@comp{%
+ \edef\@sz{\POE@key@filtersize\space 0.5 mul }%
+ \def\filter@curve{%
+ \parametricplot[plotstyle=curve,arrows=-]{-1}{1}{%
+ t \@sz mul 0.7 mul t Pi mul RadtoDeg
+ 90 add cos 0.2 \@sz mul mul}%
+ }%
+ \psframe[dimen=outer](! \@sz neg dup)(! \@sz dup)
+ \bgroup
+ \psset{style=FilterStyle}%
+ \ifx\POE@key@filtertype\POE@str@filtertype@bandpass
+ \psline(! -0.3 \@sz mul -0.65 \@sz mul)%
+ (! 0.3 \@sz mul -0.35 \@sz mul)%
+ \psline(! -0.3 \@sz mul 0.35 \@sz mul)%
+ (! 0.3 \@sz mul 0.65 \@sz mul)%
+ \rput(! 0 -0.5 \@sz mul){\filter@curve}
+ \rput(0, 0){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \rput(! 0 0.5 \@sz mul){\filter@curve}
+ \else\ifx\POE@key@filtertype\POE@str@filtertype@bandstop
+ \psline(! -0.3 \@sz mul -0.15 \@sz mul)%
+ (! 0.3 \@sz mul 0.15 \@sz mul)%
+ \rput(! 0 -0.5 \@sz mul){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \rput(0, 0){\filter@curve}
+ \rput(! 0 0.5 \@sz mul){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \else\ifx\POE@key@filtertype\POE@str@filtertype@lowpass
+ \psline(! -0.3 \@sz mul -0.15 \@sz mul)%
+ (! 0.3 \@sz mul 0.15 \@sz mul)%
+ \psline(! -0.3 \@sz mul 0.35 \@sz mul)%
+ (! 0.3 \@sz mul 0.65 \@sz mul)%
+ \rput(! 0 -0.5 \@sz mul){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \rput(0, 0){\filter@curve}
+ \rput(! 0 0.5 \@sz mul){\filter@curve}
+ \else\ifx\POE@key@filtertype\POE@str@filtertype@highpass
+ \psline(! -0.3 \@sz mul -0.15 \@sz mul)%
+ (! 0.3 \@sz mul 0.15 \@sz mul)%
+ \psline(! -0.3 \@sz mul -0.65 \@sz mul)%
+ (! 0.3 \@sz mul -0.35 \@sz mul)%
+ \rput(! 0 0.5 \@sz mul){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \rput(0, 0){\filter@curve}
+ \rput(! 0 -0.5 \@sz mul){\filter@curve}
+ \fi\fi\fi\fi
+ \egroup
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+%\subsubsection{optamp}
+%
+% \begin{macro}{optamp@ref}
+% \begin{macrocode}
+\def\optamp@ref{%
+ \POE@setref{/@@x \POE@key@optampwidth\space 0.5 mul def
+ /@@y \POE@key@optampheight\space 0.5 mul def
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\optamp@nodes}
+% \begin{macrocode}
+\def\optamp@nodes{%
+ \newOptexpFiberComp{{@@x neg 0} {@@x 0}}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optamp@comp}
+% \begin{macrocode}
+\def\optamp@comp{%
+ \def\@wd{\POE@key@optampwidth\space 0.5 mul }%
+ \def\@ht{\POE@key@optampheight\space 0.5 mul }%
+ \pspolygon(! \@wd 0)(! \@wd neg \@ht)(! \@wd neg \@ht neg)
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+%\subsubsection{polcontrol}
+%
+% \begin{macro}{polcontrol@ref}
+% \begin{macrocode}
+\def\polcontrol@ref{%
+ \ifx\POE@key@polcontroltype\POE@str@polcontroltype@linear
+ \POE@setref{/@@x \POE@key@polcontrolsize\space 2 mul def}%
+ \else
+ \POE@setref{/@@x \POE@key@polcontrolsize\space 1.5 mul def}%
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\polcontrol@nodes}
+% \begin{macrocode}
+\def\polcontrol@nodes{%
+ \newOptexpFiberComp{{@@x neg 0} {@@x 0}}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\polcontrol@comp}
+% \begin{macrocode}
+\def\polcontrol@comp{%
+ \edef\@sz{\POE@key@polcontrolsize\space}%
+ \ifPOE@optexpenv
+ \psline[style=Fiber, arrows=-, ArrowInside=-](\oenodeIn{})(\oenodeOut{})
+ \fi
+ \bgroup
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber, arrows=-, ArrowInside=-}%
+ \fi
+ \ifx\POE@key@polcontroltype\POE@str@polcontroltype@linear
+ \multips(! -2 \@sz mul \@sz)(! 2 \@sz mul 0){3}{%
+ \pscircle(0,0){\POE@key@polcontrolsize}%
+ }%
+ \else
+ \pscircle(! -1.5 \@sz mul \@sz neg){\POE@key@polcontrolsize}
+ \pscircle(! 0 \@sz){\POE@key@polcontrolsize}%
+ \pscircle(! 1.5 \@sz mul \@sz neg){\POE@key@polcontrolsize}
+ \fi
+ \egroup
+ \ifPOE@optexpenv\else
+ \psline[style=Fiber, arrows=-, ArrowInside=-](\oenodeIn{})(\oenodeOut{})
+ \fi
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{optisolator}
+%
+% \begin{macro}{\optisolator@ref}
+% \begin{macrocode}
+\def\optisolator@ref{%
+ \POE@setref{%
+ /@@x \POE@key@isolatorwidth\space 0.5 mul def
+ /@@y \POE@key@isolatorheight\space 0.5 mul def
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optisolator@comp}
+% \begin{macrocode}
+\def\optisolator@comp{%
+ \edef\@ht{\POE@key@isolatorheight\space 0.5 mul }%
+ \edef\@wd{\POE@key@isolatorwidth\space 0.5 mul }%
+ \psframe[dimen=outer](! \@wd neg \@ht neg)(! \@wd \@ht)
+ \psline[style=IsolatorArrow,
+ arrows=->](! \@wd neg 0.6 mul 0)(!\@wd 0.6 mul 0)
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{optfiberpolarizer}
+% \begin{macro}{\optfiberpolarizer@ref}
+% \begin{macrocode}
+\def\optfiberpolarizer@ref{%
+ \POE@setref{%
+ /@@x \POE@key@fiberpolwidth\space 0.5 mul def
+ /@@y \POE@key@fiberpolheight\space 0.5 mul def
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optfiberpolarizer@comp}
+% \begin{macrocode}
+\def\optfiberpolarizer@comp{%
+ \edef\@ht{\POE@key@fiberpolheight\space 0.5 mul }%
+ \edef\@wd{\POE@key@fiberpolwidth\space 0.5 mul }%
+ \psframe[dimen=outer](! \@wd neg \@ht neg)(! \@wd \@ht)
+ \psline(! \@wd neg 0.2 mul \@ht neg)(!\@wd 0.2 mul \@ht)
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{optswitch}
+%
+% \begin{macro}{\optswitch@ref}
+% \begin{macrocode}
+\def\optswitch@ref{%
+ \POE@setref{\POE@key@switchsize\space 0.5 mul dup /@@y ED /@@x ED }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optswitch@comp}
+% \begin{macrocode}
+\def\optswitch@comp{%
+% \end{macrocode}
+% storing the linewidth of the object allows for some aesthetic fine tuning
+% \begin{macrocode}
+ \pstVerb{tx@Dict begin /@lw \getCLW def end}%
+ \bgroup
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber, arrows=-, ArrowInside=-}
+ \fi
+ \psline[arrows=-](! \POE@dict{@@x} neg 0)%
+ (! \POE@dict{@@x} -0.6 mul @lw sub 0)%
+ \psline[arrows=-](! \POE@dict{@@x} 0.6 mul 0)(! \POE@dict{@@x} 0)%
+ \egroup
+ \ifx\POE@key@switchstyle\POE@str@closed%
+ \bgroup
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \psdot[dotsize=3\pslinewidth](! \POE@dict{@@x} 0.6 mul 0)%
+ \psdot[dotsize=3\pslinewidth](! \POE@dict{@@x} -0.6 mul 0)%
+ \psline[arrows=-, linewidth=1.5\pslinewidth]%
+ (! \POE@dict{@@x} -0.6 mul @lw)(! \POE@dict{@@x} 0.6 mul @lw)%
+ \egroup
+ \else
+ \psline[arrows=-, linewidth=1.5\pslinewidth]%
+ (! \POE@dict{@@x} -0.6 mul @lw add @lw)%
+ (! \POE@dict{@@x 0.6 mul @@y 0.6 mul})%
+ \pscircle(! \POE@dict{@@x} -0.6 mul 0){\pslinewidth}%
+ \psdot[dotsize=3\pslinewidth](! \POE@dict{@@x} 0.6 mul 0)%
+ \fi
+ \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})%
+ (! \POE@dict{@@x @@y})%
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{fiberdelayline}
+%
+% \begin{macro}{\fiberdelayline@ref}
+% \begin{macrocode}
+\def\fiberdelayline@ref{%
+ \POE@setref{%
+ /@@y \POE@key@fdlheight\space 0.5 mul def
+ /@@x \POE@key@fdlwidth\space 0.5 mul def
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macrocode}
+\def\POE@get@yarrowscale#1 #2 #3 #4\@nil{%
+ \def\POE@tempA{#3\space}%
+}%
+% \end{macrocode}
+% \begin{macro}{\fiberdelayline@comp}
+% \begin{macrocode}
+\def\fiberdelayline@comp{%
+ \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})%
+ (! \POE@dict{@@x @@y})
+ \begingroup
+ \psset{style=FdlArrow}
+ \use@par
+ \pst@expandafter\POE@get@yarrowscale{\psk@arrowscale}\@nil
+ \def\@arrowshift{%
+ \psk@arrowlength\space \psk@arrowsize\space
+ \pst@number\pslinewidth\space mul add mul
+ \POE@tempA mul
+ @@y 2.9 mul @@x 0.6 mul atan 2 copy cos mul 3 1 roll sin mul
+ \tx@UserCoor abs exch abs exch\space
+ }%
+ \psline(! \POE@dict{@@x -0.4 mul @@y -1.6 mul})%
+ (! \POE@dict{@@x 0.2 mul @@y 1.3 mul \@arrowshift VecAdd})
+ \endgroup
+\ignorespaces}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{optcoupler}
+% \begin{macro}{\optcoupler@nodes}
+% \begin{macrocode}
+\def\optcoupler@nodes{%
+ \edef\@sep{\POE@key@couplersep\space 0.5 mul }%
+ \newOptexpFiberComp{%
+ {@@x neg @@y0 \@sep add}
+ {@@x neg @@y0 \@sep sub}
+ {@@x @@y0 \@sep add}
+ {@@x @@y0 \@sep sub} }%
+ \pnode(! 0 \POE@dict{@@y0}){\oenodeCenter{}}
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@coupler@ref}
+% \begin{macrocode}
+\def\POE@coupler@ref{%
+ \POE@setref{%
+ /@@y0
+ \ifx\POE@key@coupleralign\POE@str@top
+ \POE@key@couplersep\space -0.5 mul
+ \else\ifx\POE@key@coupleralign\POE@str@bottom
+ \POE@key@couplersep\space 0.5 mul
+ \else
+ 0
+ \fi\fi
+ def
+ /@@x \POE@key@couplerwidth\space 0.5 mul def
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \POE@key@couplersep
+ \else
+ \POE@key@couplerheight\space 0.5 mul
+ \fi
+ \space /@@y ED
+ }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+\let\optcoupler@ref\POE@coupler@ref
+% \end{macrocode}
+%
+% \begin{macro}{\wdmcoupler@ref}
+% The \cs{wdmcoupler} and \cs{wdmsplitter} need a little correction for centered alignment and \opt{couplertype} set to \opt{none}.
+% \begin{macrocode}
+\def\wdmcoupler@ref{%
+ \POE@coupler@ref
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@center
+ \POE@setref{/@@y 0 def }%
+ \fi
+ \fi
+}%
+\let\wdmsplitter@ref\wdmcoupler@ref
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optcoupler@comp}
+% \begin{macrocode}
+\def\optcoupler@comp{%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \psline[style=Fiber](\oenode{1}{})(\oenode{3}{})
+ \psline[style=Fiber](\oenode{2}{})(\oenode{N}{})
+ \fi
+ \POE@coupler@comp
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\POE@coupler@comp}
+% \begin{macrocode}
+\def\POE@coupler@comp{%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \else\ifx\POE@key@couplertype\POE@str@couplertype@ellipse
+ \psellipse(! 0 \POE@dict{@@y0})(! \POE@dict{@@x @@y})
+ \else
+ \psframe[dimen=outer](!\POE@dict{@@x neg @@y0 @@y sub})%
+ (!\POE@dict{@@x @@y0 @@y add})%
+ \ifx\POE@key@couplertype\POE@str@couplertype@cross
+ \psline(! \POE@dict{@@x -0.5 mul @@y0 @@y 0.5 mul sub})%
+ (! \POE@dict{@@x 0.5 mul @@y0 @@y 0.5 mul add})%
+ \psline(! \POE@dict{@@x -0.5 mul @@y0 @@y 0.5 mul add})%
+ (! \POE@dict{@@x 0.5 mul @@y0 @@y 0.5 mul sub})%
+ \fi
+ \fi\fi
+ \ifx\POE@key@couplertype\POE@str@couplertype@cross\else
+ \ifPOE@variable
+ \begingroup
+% \end{macrocode}
+% we set the style this way to be able to access the arrow and line parameters
+% already before the psline command
+% \begin{macrocode}
+ \psset{style=VariableCoupler}
+ \use@par
+ \pst@expandafter\POE@get@yarrowscale{\psk@arrowscale}\@nil
+ \def\@arrowshift{%
+ \psk@arrowlength\space\psk@arrowsize\space
+ \pst@number\pslinewidth\space mul add mul
+ \POE@tempA mul
+ 1.6 0.8 atan 2 copy cos mul 3 1 roll sin mul
+ \tx@UserCoor abs exch abs exch\space
+ }%
+ \psline(!\POE@dict{@@x -0.4 mul @@y0 @@x sub})%
+ (!\POE@dict{@@x 0.4 mul @@x 0.7 mul @@y0 add
+ \@arrowshift VecAdd})
+ \endgroup
+ \fi
+ \fi
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{wdmcoupler}
+% \begin{macro}{\wdmcoupler@nodes}
+% \begin{macrocode}
+\def\wdmcoupler@nodes{%
+ \edef\@sep{\POE@key@couplersep\space 0.5 mul }%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@center
+ \edef\@sep{0 }%
+ \fi
+ \fi
+ \newOptexpFiberComp{%
+ {@@x neg @@y0 \@sep add}
+ {@@x neg @@y0 \@sep sub}
+ {@@x 0}}%
+ \pnode(! 0 \POE@dict{@@y0}){\oenodeCenter{}}
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\wdmcoupler@comp}
+% \begin{macrocode}
+\def\wdmcoupler@comp{%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@top
+ \psline[style=Fiber](\oenode{1}{})(\oenodeOut{})
+ \psline[style=Fiber]%
+ (!/N@\oenodeOut{} \POE@dict{@GetCenter}
+ \tx@UserCoor \POE@key@couplersep\space sub)(\oenode{2}{})
+ \else
+ \psline[style=Fiber](\oenode{2}{})(\oenodeOut{})
+ \ifx\POE@key@coupleralign\POE@str@bottom
+ \psline[style=Fiber]%
+ (!/N@\oenodeOut{} \POE@dict{@GetCenter}
+ \tx@UserCoor \POE@key@couplersep\space add)(\oenode{1}{})
+ \fi
+ \fi
+ \fi
+ \POE@coupler@comp
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{wdmsplitter}
+% \begin{macro}{\wdmsplitter@nodes}
+% \begin{macrocode}
+\def\wdmsplitter@nodes{%
+ \edef\@sep{\POE@key@couplersep\space 0.5 mul }%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@center
+ \edef\@sep{0 }%
+ \fi
+ \fi
+ \newOptexpFiberComp{%
+ {@@x neg 0}
+ {@@x @@y0 \@sep add}
+ {@@x @@y0 \@sep sub}}
+ \pnode(! 0 \POE@dict{@@y0}){\oenodeCenter{}}
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\wdmsplitter@comp}
+% \begin{macrocode}
+\def\wdmsplitter@comp{%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@top
+ \psline[style=Fiber](\oenodeIn{})(\oenode{2}{})
+ \psline[style=Fiber](! \POE@dict{/N@\oenodeIn{} @GetCenter}
+ \tx@UserCoor \POE@key@couplersep\space sub)(\oenode{N}{})
+ \else
+ \psline[style=Fiber](\oenodeIn{})(\oenode{N}{})
+ \ifx\POE@key@coupleralign\POE@str@bottom
+ \psline[style=Fiber](! \POE@dict{/N@\oenodeIn{} @GetCenter}
+ \tx@UserCoor \POE@key@couplersep\space sub)(\oenode{2}{})
+ \fi
+ \fi
+ \fi
+ \POE@coupler@comp
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{optcirculator}
+%
+% \begin{macro}{optcirculator@ref}
+% \begin{macrocode}
+\def\optcirculator@ref{%
+ \POE@setref{\POE@key@optcircsize\space 0.5 mul dup /@@x ED /@@y ED }%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\optcirculator@nodes}
+% \begin{macrocode}
+\def\optcirculator@nodes{%
+ \newOptexpFiberComp{{@@x neg 0} {0 @@y neg} {@@x 0}}%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\optcirculator@comp}
+% \begin{macrocode}
+\def\optcirculator@comp{%
+ \edef\@sz{\POE@key@optcircsize\space 0.5 mul }%
+ \pscircle(0,0){! \@sz}
+ \psarc[style=OptCircArrow](0,0)%
+ {! \POE@key@optcircsize\space 0.5 mul}%
+ {\POE@key@optcircangleA}%
+ {\POE@key@optcircangleB}
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \subsubsection{fibercollimator}
+%
+% \begin{macro}{fibercollimator@ref}
+% \begin{macrocode}
+\def\fibercollimator@ref{%
+ \POE@setref{%
+ /@@x \POE@key@fibercolwidth\space 0.5 mul def
+ /@@y \POE@key@fibercolheight\space 0.5 mul def}%
+}%
+% \end{macrocode}
+% \end{macro}
+% \begin{macro}{\fibercollimator@nodes}
+% \begin{macrocode}
+\def\fibercollimator@nodes{%
+ \pnode(!\POE@dict{@@x neg} 0){\oenodeIn{}}
+ \newOptexpComp{{@@x neg 0} {0 1} @@y neg @@y trans {PlainIfc}
+ {@@x 0} {0 1} 0 0 trans {PlainIfc} 1 }%
+}%
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{\fibercollimator@comp}
+% \begin{macrocode}
+\def\fibercollimator@comp{%
+ \def\@wd{\POE@key@fibercolwidth\space 0.5 mul }%
+ \def\@ht{\POE@key@fibercolheight\space 0.5 mul }%
+ \pspolygon(!\@wd neg \getCLWH add \@ht neg)%
+ (!\@wd 0)(!\@wd neg \getCLWH add \@ht)
+}%
+% \end{macrocode}
+% \end{macro}
+%
+%</stylefile>
+%
+% \chapter{The Postscript header file}
+% \makeatletter
+%^^A Copied this definition from doc.sty and changed it not to add a
+%^^A backslash to the Postscript procedure name in the index.
+% \def\SpecialIndex@#1#2{%
+% \@SpecialIndexHelper@#1\@nil
+% \def\@tempb{ }%
+% \ifcat \@tempb\@gtempa
+% \special@index{\quotechar\space\actualchar
+% \string\verb\quotechar*\verbatimchar
+% \quotechar\space\verbatimchar#2}%
+% \else
+% \def\@tempb##1##2\relax{\ifx\relax##2\relax
+% \def\@tempc{\special@index{\quotechar##1\actualchar
+% \string\verb\quotechar*\verbatimchar
+% \quotechar##1\verbatimchar#2}}%
+% \else
+% \def\@tempc{\special@index{##1##2\actualchar
+% \string\verb\quotechar*\verbatimchar##1##2\verbatimchar#2}}%
+% \fi}%
+% \expandafter\@tempb\@gtempa\relax
+% \@tempc
+% \fi}
+% \makeatother
+%
+%<*prolog>
+%
+% This is the dictionary where all components are stored in.
+% \begin{macrocode}
+/tx@OptexpDict 200 dict def
+tx@OptexpDict begin
+/DebugOE false def
+/DebugDepth 0 def
+/DebugBegin {
+ DebugOE {
+ /DebugProcName ED
+ DebugDepth 2 mul string
+ 0 1 DebugDepth 2 mul 1 sub {
+ dup 2 mod 0 eq { (|) }{( )} ifelse
+ 3 -1 roll dup 4 2 roll
+ putinterval
+ } for
+ DebugProcName strcat ==
+ /DebugDepth DebugDepth 1 add def
+ }{
+ pop
+ } ifelse
+} bind def
+/DebugEnd {
+ DebugOE {
+ /DebugDepth DebugDepth 1 sub def
+ DebugDepth 2 mul 2 add string
+ 0 1 DebugDepth 2 mul 1 sub {
+ dup 2 mod 0 eq { (|) }{ ( ) } ifelse
+ 3 -1 roll dup 4 2 roll
+ putinterval
+ } for
+ dup DebugDepth 2 mul (+-) putinterval
+ ( done) strcat ==
+ } if
+} bind def
+/DebugMsg {
+ DebugOE {
+ DebugDepth 1 add 2 mul string
+ 0 1 DebugDepth 2 mul 1 add {
+ dup 2 mod 0 eq { (|) }{( )} ifelse
+ 3 -1 roll dup 4 2 roll
+ putinterval
+ } for
+ exch strcat ==
+ }{
+ pop
+ } ifelse
+} bind def
+% \end{macrocode}
+% \begin{macro}{strcat}
+% Concatenate two strings and leave the result on the stack
+% \begin{pssyntax}
+% \PSstring{str1} \PSstring{str2} \PSop{strcat} \PSstring{str1str2}
+% \end{pssyntax}
+% \begin{macrocode}
+/strcat {
+ exch 2 copy
+ length exch length add
+ string dup dup 5 2 roll
+ copy length exch
+ putinterval
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{nametostr}
+% Convert a literal name to string. This is required, because some PSTricks
+% parameter like \opt{angleA} do not allow round braces in the argument, so
+% some string must be passed as name and then converted to a string.
+% \begin{pssyntax}
+% \PSname{name} \PSop{nametostr} \PSstring{name}
+% \end{pssyntax}
+% \begin{macrocode}
+/nametostr {
+ dup length string cvs
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{PrintWarning}
+% Print a warning about the raytracing. This is enabled or disabled via option
+% \opt{pswarning}.
+% \begin{macrocode}
+/PrintWarning {
+ (Warning: ) exch strcat ==
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{inttostr}
+% Convert an integer to a string.
+% \begin{pssyntax}
+% \PSvar{int} \PSop{inttostr} \PSstring{int}
+% \end{pssyntax}
+% \begin{macrocode}
+/inttostr {
+ dup type /integertype eq {
+ dup log 1 add floor cvi string cvs
+ } if
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{IfcCopy}
+% Copy an interface \PSvar{from} to an interface \PSvar{to}, must be called
+% within the respective component dictionary. This involves also copying the
+% node associated with the interface.
+% \begin{pssyntax}
+% \PSvar{from} \PSvar{to} \PSop{CopyIfc}
+% \end{pssyntax}
+% \begin{macrocode}
+/IfcCopy {
+ 2 copy IfcName exch IfcName load dup
+ length dict copy def
+ name exch NodeName name 3 -1 roll NodeName
+ tx@NodeDict begin
+ load dup length dict copy def
+ end
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{calcNodes}
+% Calculate the reference node coordinates for reflective components and
+% stores them as \PSvar{X@A}, \PSvar{Y@A}, \PSvar{X@B} and \PSvar{Y@B}. Some
+% other values (\PSvar{modA}, \PSvar{modB}, and \PSvar{OEangle}) are also
+% stored for some special components
+% \begin{pssyntax}
+% \PSvar{XB} \PSvar{YB} \PSvar{XA} \PSvar{YA} \PSvar{XG} \PSvar{YG} \PSop{calcNodes}
+% \end{pssyntax}
+% \begin{macrocode}
+/calcNodes {
+ (calcNode) DebugBegin
+ /YG exch def /XG exch def
+ /ay YG 3 -1 roll sub def
+ /ax XG 3 -1 roll sub def
+ /by exch YG sub def
+ /bx exch XG sub def
+ /a ax ay Pyth def
+% \end{macrocode}
+% Used by \cs{rightangleprism}.
+% \begin{macrocode}
+ /modA a def
+ /b bx by Pyth def
+ /modB b def
+ /cx ax a div bx b div add def
+ /cy ay a div by b div add def
+ /c@tmp cx cy Pyth def
+ /c ax bx add ay by add Pyth def
+% \end{macrocode}
+% Used by \cs{rightangleprism} and \cs{optprism}.
+% \begin{macrocode}
+ /OEangle c dup mul a dup mul sub b dup mul sub
+ -2 a b mul mul div Acos def
+% \end{macrocode}
+% If $c=0$, then set the coordinates of the vector manually depending whether
+% \PSvar{a} and \PSvar{b} are parallel or antiparallel.
+% \begin{macrocode}
+ c 0 eq {
+ ax ay bx by DotProd 0 gt {
+% \end{macrocode}
+% $\text{dotprod} > 0$, i.e. \PSvar{a} and \PSvar{b} are parallel.
+% \begin{macrocode}
+ /cx ax def
+ /cy ay def
+ }{
+ /cx ay def
+ /cy ax neg def
+ } ifelse
+ /c@tmp a def
+ } if
+ /X@A XG cx c@tmp div add def
+ /Y@A YG cy c@tmp div add def
+ /X@B XG cx c@tmp div sub def
+ /Y@B YG cy c@tmp div sub def
+% \end{macrocode}
+% Test the chirality (the order) of the input points. Input angles $> 90$\textdegree
+% don't make sense, in this case we exhange the calculated reference nodes.
+% \begin{macrocode}
+ ax by mul ay bx mul sub 0 le {
+ Y@A X@A
+ /X@A X@B def
+ /Y@A Y@B def
+ /X@B exch def
+ /Y@B exch def
+ modA modB /modA exch def /modB exch def
+ } if
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{capHeight}
+% Calculate the height \PSvar{a} of a pole cap, used for curved interfaces.
+% \begin{pssyntax}
+% \PSvar{R} \PSvar{h} \PSop{capHeight} \PSvar{a}
+% \end{pssyntax}
+% \PSvar{R} is the circle radius and \PSvar{h} the width of the pole cap.
+% \begin{macrocode}
+/capHeight {
+ dup mul neg exch abs dup 3 1 roll dup mul add sqrt sub
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{leftCurvedIfc}
+% Calculate some parameters for the «left» interface of a lens. Defines and
+% \PSname{ArcL} which is used later in the code to actually draw the interface
+% curve.
+% \begin{pssyntax}
+% \PSvar{h R1} \PSop{leftCurvedIfc} \PSvar{y |R1| alpha\textunderscore b
+% alpha\textunderscore t R1}
+% \end{pssyntax}
+% \begin{macrocode}
+/leftCurvedIfc {
+ /R1 exch def /h exch def
+ 0 R1 abs dup R1 h capHeight exch sub R1 sign mul dup
+ h exch atan exch
+ h neg exch atan
+ R1 0 lt {
+ /ArcL /arcn load def
+ } {
+ /ArcL /arc load def
+ } ifelse
+ R1
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{rightCurvedIfc}
+% Analogous to \PSname{leftCurvedIfc} for «right» interfaces, defines
+% \PSname{ArcR} for later use.
+% \begin{pssyntax}
+% \PSvar{h R2} \PSop{leftCurvedIfc} \PSvar{y |R2| alpha\textunderscore b
+% alpha\textunderscore t R2}
+% \end{pssyntax}
+% \begin{macrocode}
+/rightCurvedIfc {
+ /R2 exch def /h exch def
+ 0 R2 abs dup R2 h capHeight sub R2 sign mul dup
+ h neg exch atan exch
+ h exch atan
+ R2 0 lt {
+ /ArcR /arcn load def
+ } {
+ /ArcR /arc load def
+ } ifelse
+ R2
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{SlopeAngle}
+% Calculate slope angle of a line from \PSname{nodeA} to \PSname{nodeB}.
+% \begin{pssyntax}
+% \PSname{nodeB} \PSname{nodeA} \PSop{SlopeAngle} \PSvar{angle}
+% \end{pssyntax}
+% \begin{macrocode}
+/SlopeAngle {
+ (SlopeAngle) DebugBegin
+ @GetCenter 3 -1 roll @GetCenter @ABVect exch atan
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{DefineExtNode}
+% Constructs the coordinates of an external node based on values that have
+% been set beforehand. \PSvar{xref} and \PSvar{yref} are the values which are
+% defined by \opt{extnode} parameter. \PSvar{RefFac} is defined by parameter
+% \opt{extnodealign}, which determines it the reference of the external node
+% position should be the global coordinate system, or the line between the
+% reference nodes.
+% \begin{pssyntax}
+% \PSvar{xref yref} \PSop{DefineExtNode} \PSvar{X Y}
+% \end{pssyntax}
+% \begin{macrocode}
+/DefineExtNode {%
+ (DefineExtNode) DebugBegin
+ @@y mul RefFac mul @@y0 add
+ exch @@x mul RefFac mul @@x0 add exch
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{GetInternalNodeNames}
+% Push all internal node names of \PSstring{basicname} on the
+% stack. If \PSvar{reverse} is \PSvar{true}, the names are pushed in
+% reverse order.
+% \begin{pssyntax}
+% \PSstring{basicname} \PSvar{reverse} \PSop{GetInternalNodeNames}
+% \PSname{N@basicnameN} \ldots{} \PSname{N@basicname1} (if
+% \PSvar{reverse = false})
+% \end{pssyntax}
+% \begin{macrocode}
+/GetInternalNodeNames {
+ (GetInternalNodeNames) DebugBegin
+ /reverse ED
+ dup cvn load /N get dup
+ reverse { -1 1 } { 1 1 3 -1 roll } ifelse
+ { 2 copy eq { pop (N) } { inttostr } ifelse
+ 3 -1 roll dup 4 1 roll exch NodeName 3 1 roll
+ } for
+ pop pop
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{GetInternalBeamNodes}
+% This is like \PSvar{GetInternalNodeNames}, but leaves the node
+% coordinates on the stack
+% \begin{pssyntax}
+% \PSstring{basicnodename} \PSvar{reverse} \PSop{GetInternalBeamNodes}
+% \PSvar{XN YN \ldots\ X1 Y1} (if \PSvar{reverse = false})
+% \end{pssyntax}
+% \begin{macrocode}
+/GetInternalBeamNodes {
+ (GetInternalBeamNodes) DebugBegin
+ [ 3 1 roll GetInternalNodeNames ]
+ { @GetCenter } forall
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{GetInternalBeamNodesCompat}
+% Equivalent to \PSvar{GetInternalBeamNodes} only that it checks if the
+% component is ambiguous (i.e. it is a beamsplitter), in which case it returns
+% only the center node. Used only for the deprecated \opt{conn} parameter.
+% \begin{macrocode}
+/GetInternalBeamNodesCompat {
+ exch dup 3 1 roll (C) NodeName dup tx@NodeDict exch known {
+ @GetCenter ToVec
+ 3 1 roll pop pop
+ } {
+ pop GetInternalBeamNodes
+ } ifelse
+} bind def
+/GetInternalBeamNodeCompat {
+ exch dup 3 1 roll (C) NodeName dup tx@NodeDict exch known {
+ @GetCenter ToVec
+ 3 1 roll pop pop
+ } {
+ pop NodeName @GetCenter ToVec
+ } ifelse
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{InitOptexpComp}
+% Initialize some global variables for positioning of external
+% nodes. This is called at the beginning of every component.
+% \begin{macrocode}
+/InitOptexpComp {%
+ /@@x 0 def
+ /@@y 0 def
+ /@@x0 0 def
+ /@@y0 0 def
+ /@xref 0 def
+ /@yref 0 def
+ /RefFac 1 def
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{NewTempNodeComp}
+% If \cs{draw*beam} is invoked with a node as parameter, a
+% temporary \cs{optplane} is defined. The plane vector of this temporary plane
+% is set such that it is perpendicular to the connection between the node and the following
+% interface node.
+%
+% This is the only procedure which sets the \PSname{adjustRel} flag
+% which indicates adjustment of the plane vector rotation depending on
+% the incoming or outgoing connection direction.
+%
+% For an explanation of all other dictionary members, please see
+% \PSvar{NewOptexpComp}.
+% \begin{pssyntax}
+% \PSproc{x y} \PSproc{dx dy} \PSstring{name} \PSproc{scaling}
+% \PSop{NewTempNodeComp}
+% \end{pssyntax}
+% \begin{macrocode}
+/NewTempNodeComp {
+ (NewTempNodeComp) DebugBegin
+ /sc ED
+ dup cvn
+ 6 dict dup 3 1 roll def begin
+ /ambiguous false def
+ /allowbeaminside false def
+ /name ED
+ /correct false def
+% \end{macrocode}
+% This definition does not work like for \PSvar{NewOptexpComp}, because
+% a current point may not be available. Therefore, we translate to the
+% $(X, Y)$ node and define $X = Y = 0$.
+% \begin{macrocode}
+ {0 0} exch 3 -1 roll exec
+ gsave
+ translate
+ /CompMtrx CM def
+ grestore
+ /N 1 def
+ /n bgRefIndex def
+ 5 dict dup dup /P@1 ED /P@N ED
+ begin
+ /mode trans def
+ {} 0 0 PlainIfc
+ end
+ /adjustRel true def
+ end
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{CurvedIfc}
+% Defines a curved interface.
+% \begin{pssyntax}
+% \PSproc{X Y} \PSproc{DX DY} \PSproc{scl} \PSvar{NAlow NAup} \PSop{CurvedIfc}
+% \end{pssyntax}
+% \begin{macrocode}
+/CurvedIfc {
+ 5 2 roll
+ 2 copy 5 3 roll exec 3 -1 roll exec VecAdd
+ 5 -1 roll exec /Y ED /X ED
+ exch exec 3 -1 roll 3 copy exec /RY ED /RX ED
+ 3 1 roll NormalizeVec 3 -1 roll exec
+ tx@Dict begin Pyth end dup
+ 3 1 roll mul 1.00001 mul /NAup ED
+ mul 1.00001 mul /NAlow ED
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{PlainIfc}
+% \begin{pssyntax}
+% \PSproc{X Y} \PSproc{DX DY} \PSproc{scl} \PSvar{NAlow NAup} \PSop{PlainIfc}
+% \end{pssyntax}
+% \begin{macrocode}
+/PlainIfc {
+ 5 2 roll
+ dup 3 -1 roll exec NormalizeVec 3 -1 roll exec 2 copy /DY ED /DX ED
+ tx@Dict begin Pyth end dup 4 2 roll
+ exch exec 3 -1 roll exec /Y ED /X ED
+ 3 1 roll mul 1.00001 mul /NAup ED
+ mul 1.00001 mul /NAlow ED
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{NewCompIfc}
+% Defines a new interface of a component, must be called within \PSvar{NewOptexpComp}.
+% \begin{pssyntax}
+% \PSproc{x y} \PSproc{dx dy|rx ry} \PSvar{NAlow NAup mode}
+% \PSstring{CompName} \PSstring{Name} \PSproc{New\ldots Ifc} \PSproc{scaling}
+% \PSop{NewCompIfc}
+% \end{pssyntax}
+% \begin{psarglist}
+% \psargitem{\PSproc{x y}} The coordinates of the interface node which lies on the optical axis.??
+% \psargitem{\PSproc{dx dy | rx ry}} For a plane interface, this is the vector that describes the plane, for a curved interface this is the
+% \psargitem{\PSvar{NAlow NAup}}
+% \psargitem{\PSvar{mode}} An integer which characterizes if an interface is
+% reflective or transmittive. You should use the predefined variable
+% \PSname{refl} and \PSname{trans} for this.
+% \psargitem{\PSstring{CompName}} The name of the component we are in.
+% \psargitem{\PSstring{Name}} The name of the new interface. It is prefixed by «P@».
+% \psargitem{\PSproc{\ldots Ifc}} Contain the actual procedure to define the
+% concrete interface type, can be \PSproc{PlainIfc} or
+% \PSproc{CurvedIfc}.
+% \end{psarglist}
+% \begin{macrocode}
+/NewCompIfc {
+ /scl ED
+ /next ED
+ dup (P@) exch strcat cvn
+ 6 dict dup
+ 3 1 roll def
+ begin
+ 3 -1 roll
+ /mode ED
+ 6 -1 roll dup 7 -1 roll
+ {scl} 8 -2 roll next
+ end
+% \end{macrocode}
+% store a new node \PSname{N@NameX}, with X=1..N this node always
+% represents the intersection of an untilted and unshifted incoming beam
+% on the optical axis with the respective interface
+% \begin{macrocode}
+ exec scl ToVec 3 1 roll NodeName @NewNode
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% Define some constants.
+% \begin{macrocode}
+/relative 0 def /absolute 1 def /center 2 def
+/refl 0 def /trans 1 def /absorb 2 def
+/desc 0 def /asc 1 def /amb 2 def
+/ok 0 def /tir 1 def /missed 2 def
+/bgRefIndex 0 def
+% \end{macrocode}
+%
+% \begin{macro}{NewOptexpComp}
+% \PSvar{NewOptexpComp} creates a new dictionary that contains everything needed
+% for an optical component. It contains the following variables:
+% \begin{psarglist}
+% \psargitem{\PSvar{n}} The basic refractive index which was set for the
+% component. This may be overwritten with the \opt{n} option of the
+% \nxLcs{drawbeam} macros.
+%
+% \psargitem{\PSvar{CompMtrx}} The transformation matrix at time of
+% the component definition. The method is the same as for the
+% \nxLPack{pst-node} nodes.
+%
+% \psargitem{\PSvar{name}} The name of the component. This is build of
+% several components which are put together in the \TeX\ code.
+%
+% \psargitem{\PSvar{N}} The number of interfaces of the component.
+%
+% \psargitem{\PSvar{P@1\ldots P@N}} The actual
+% interfaces. \PSvar{P@1} and \PSvar{P@N} are always defined, even if
+% \PSvar{N = 1}. In that case the two names link to the same
+% dictionary, so that changes in one of them are automatically present
+% also in the second one.
+%
+% \psargitem{\PSproc{sc}} The scaling procedure for the coordinates to convert
+% 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
+% \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
+% drawing and requires special attention.
+%
+% \psargitem{\PSvar{correct}} If \opt{true}, the input vectors after
+% the transmittive interfaces are corrected when using
+% \opt{connectifc}.
+% \end{psarglist}
+%
+% \begin{pssyntax}
+% \PSvar{[} \PSproc{x y} \PSproc{dx dy | rx ry} \PSvar{NAlow NAup} \PSvar{type}
+% \PSproc{\ldots Ifc} \PSvar{\ldots{} [n] correct? amb? allowbeaminside?}
+% \PSstring{CompName} \PSproc{scaling} \PSop{NewOptexpComp}
+% \end{pssyntax}
+% \begin{macrocode}
+/NewOptexpComp {
+ (NewOptexpComp) DebugBegin
+ /sc ED dup cvn
+ gsave
+ 12 dict dup 3 1 roll def begin
+ /name ED
+ /allowbeaminside ED
+ /ambiguous ED
+ dup type /booleantype eq not { false } if /correct ED
+ tx@Dict begin
+ STV {CP T} stopped pop
+ end
+ /CompMtrx CM def
+ grestore
+ counttomark dup 6 idiv dup /N ED 6 mul eq { 1 } if
+ cvx 1 EvalRefIndex /n ED
+% \end{macrocode}
+% This defines for ambiguous components, which interface coincides with the
+% ambiguous interface. 0 indicates that there is no ambiguous interface.
+% \begin{macrocode}
+ ambiguous {
+ /ambIfc ED
+ }{
+ /ambIfc 0 def
+ } ifelse
+ 1 N eq {
+% \end{macrocode}
+% only a single plane is specified, create the aliases.
+% \begin{macrocode}
+ name (1) 3 -1 roll {sc} NewCompIfc
+ (1) (N) IfcCopy
+ }{
+ N -1 1 { %
+ dup N eq { pop (N) }{inttostr} ifelse
+ exch name 3 1 roll {sc} NewCompIfc
+ } for
+ } ifelse
+ ambiguous ambIfc 0 gt and {
+ ambIfc N eq { (N) }{ ambIfc inttostr } ifelse (C) IfcCopy
+ } if
+ end
+ pop
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{NewOptexpFiberComp}
+% \begin{pssyntax}
+% \PSvar{[} \PSvar{x y} \ldots
+% \PSstring{CompName} \PSproc{scaling} \PSop{NewOptexpFiberComp}
+% \end{pssyntax}
+% \begin{macrocode}
+/NewOptexpFiberComp {
+ (NewOptexpFiberComp) DebugBegin
+ /sc ED dup cvn
+ gsave
+ 12 dict dup 3 1 roll def begin
+ /name ED
+ tx@Dict begin
+ STV {CP T} stopped pop
+ end
+ /CompMtrx CM def
+ grestore
+ counttomark /N ED
+ 1 N eq {
+% \end{macrocode}
+% only a single plane is specified, create the aliases.
+% \begin{macrocode}
+ {0 1} 0 0 trans name (1) {PlainIfc} {sc} NewCompIfc
+ (1) (N) IfcCopy
+ }{
+ N -1 1 {
+ dup N eq { pop (N) }{inttostr} ifelse
+ {0 1} 0 0 absorb name 6 -1 roll {PlainIfc} {sc} NewCompIfc
+ } for
+ } ifelse
+ end
+ pop
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{IfcAlias}
+% Create an alias of an interface. This involves creating also an
+% alias for the associated node. Must be called withing
+% \PSvar{NewOptexpComp}.
+%
+% \PSstring{OrigPN} \PSstring{AliasPN} \PSop{IfcAlias}
+% \begin{macrocode}
+/IfcAlias {
+ 2 copy IfcName exch IfcName load def
+ tx@NodeDict begin
+ name exch NodeName name 3 -1 roll NodeName load def
+ end
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{GetPlaneVec}
+% Push the coordinates of the plane vector on the stack, for curved interfaces
+% this is the tangent at the interface node.
+% \begin{pssyntax}
+% \PSvar{IfcNum} \PSstring{CompName} \PSop{GetPlaneVec} \PSvar{dX dY}
+% \end{pssyntax}
+% \begin{macrocode}
+/GetPlaneVec {
+ (GetPlaneVec) DebugBegin
+ cvn load begin
+ IfcName load begin
+ currentdict /RX known {
+ RX RY CompMtrx dtransform CM idtransform
+ neg exch
+ } {
+ DX DY CompMtrx dtransform CM idtransform
+ } ifelse
+ end
+ end
+ DebugEnd
+} 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}{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
+% \begin{pssyntax}
+% \PSvar{IfcNum} \PSstring{CompName} \PSop{GetIfcCenterCorr} \PSvar{X|XCorr Y|YCorr}
+% \end{pssyntax}
+% \begin{macrocode}
+/GetIfcCenterCorr {
+ (GetIfcCenterCorr) DebugBegin
+ cvn load begin
+ IfcName load begin
+ currentdict /XCorr known {
+ XCorr YCorr
+ }{
+ X Y
+ } ifelse
+ currentdict /RX known {
+ RX neg RY neg VecAdd
+ } if
+ CompMtrx transform CM itransform
+ end
+ end
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{TransformInVec}
+% Transform the input vector as specified with \opt{beamangle} and
+% \opt{beamdiv} from coordinates relative to the connection between first and
+% second components to absolute coordinates.
+% \begin{pssyntax}
+% \PSproc{Ifc2} \PSproc{Ifc1} \PSproc{InVec} \PSop{TransformInVec} \PSproc{InVec'}
+% \end{pssyntax}
+% \begin{macrocode}
+/TransformInVec {
+ (TransformInVec) DebugBegin
+ 3 1 roll
+ GetIfcCenter 4 2 roll
+ GetIfcCenter 5 -2 roll
+ @ABVect
+ 3 -1 roll exec 2 copy 6 2 roll
+ 0 eq exch 0 eq and not {
+% \end{macrocode}
+% invec != (0,0)
+% \begin{macrocode}
+ exch atan matrix rotate dtransform
+ } {
+ 4 2 roll pop pop
+ } ifelse
+ ToVec
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{TransformStartPos}
+% Startpos is relative to the connection between first and second components
+% transform to absolute coordinates and shift by first plane center
+% Plane2 Plane1 \PSproc{StartPos} -> \PSproc{StartPos'+Plane1Center}
+% \begin{macrocode}
+/TransformStartPos {
+ (TransformStartPos) DebugBegin
+ exec 2 copy 6 2 roll 0 eq exch 0 eq and not
+ 3 1 roll GetIfcCenter 4 2 roll
+ GetIfcCenter 5 2 roll {
+ 2 copy 8 2 roll
+ @ABVect exch atan matrix rotate dtransform
+ VecAdd
+ } {
+ 6 2 roll pop pop pop pop
+ } ifelse
+ ToVec
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{GetNearestPlane}
+% \begin{pssyntax}
+% \PSvar{X Y} \PSstring{CompName} \PSop{GetNearestPlane} \PSvar{PlaneNumber}
+% \end{pssyntax}
+% \begin{macrocode}
+/GetNearestPlane {
+ (GetNearestPlane) DebugBegin
+ 3 copy 1 exch GetIfcCenter @ABDist /dist ED /nearestPlane 1 def
+ dup cvn load /N get 2 1 3 -1 roll {
+% \end{macrocode}
+% iterate through plane 2 to plane N of CompName
+% \begin{macrocode}
+ 4 copy exch GetIfcCenter @ABDist dup dist lt {
+ /dist ED /nearestPlane ED
+ } {
+ pop pop
+ } ifelse
+ } for
+ pop pop pop nearestPlane
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{PushAmbCompPlanesOnStack}
+% Components which do not have an unambiguous behaviour (beamslitter, can
+% transmit and reflect) like lenses (transmission only) or mirrors (reflection
+% only), must be evaluated to see which mode should be used. Argument is
+% [(name) draw], draw is a boolean which is true if the inner beams should be
+% drawn.
+% \begin{macrocode}
+/PushAmbCompPlanesOnStack {
+ (PushAmbCompPlanesOnStack) DebugBegin
+ currentdict /outToPlane undef
+ PN IfcCnt eq not {
+% \end{macrocode}
+% not the last component, there should be another one on the stack
+% \begin{macrocode}
+ 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.
+% \begin{macrocode}
+ 0 get (C) exch
+ } {
+% \end{macrocode}
+% otherwise use the interface on the stack
+% \begin{macrocode}
+ exec pop pop pop
+ } ifelse
+ [ 3 1 roll ] cvx /outToPlane ED
+% \end{macrocode}
+% outToPlane is \PSproc{(PN) (compName)}
+% \begin{macrocode}
+ } if
+% \end{macrocode}
+% the old plane number, without counting the additional planes of the current ambcomp
+% \begin{macrocode}
+ /IfcCntTmp IfcCnt def
+% \end{macrocode}
+% Load some parameters from \opt{ambcomp}
+% \begin{macrocode}
+ aload pop /draw ED /name ED
+ name cvn load /N get /N ED
+ currentdict /Curr known {
+ /CurrTmp /Curr load def
+ /CurrVecTmp /CurrVec load def
+ } {
+ /CurrTmp /CurrLow load def
+ /CurrVecTmp /CurrVecLow load def
+ } ifelse
+% \end{macrocode}
+% \PSvar{CurrTmp} is the current point of the beam on the interface prior to the
+% ambiguos component, \PSvar{CurrVecTmp} its outgoing vector. For wide beams,
+% the lower ray is used.
+% \begin{macrocode}
+ PN 1 eq {
+% \end{macrocode}
+% If it is the first interface, the starting point is always the (C) plane
+% \begin{macrocode}
+ [ (C) name name GetRefIndex trans draw] cvx
+% \end{macrocode}
+% Now check which is the outgoing plane
+% \begin{macrocode}
+ name /outToPlane load GetNextPlane
+ dup 0 eq not {
+% \end{macrocode}
+% If there is one, i.e. if \PSvar{GetNextPlane} leaves something not equal to \PSvar{0} on the stack, this is the plane.
+% \begin{macrocode}
+ [ exch name bgRefIndex trans draw ] cvx exch
+ /IfcCntTmp IfcCntTmp 1 add def
+ } {
+ pop
+ } ifelse
+ }{
+ CurrTmp name GetNearestPlane dup /firstPlane ED
+ name isAmbiguousIfc not {
+% \end{macrocode}
+% The first interface is not the ambiguous one.
+%
+% check if mode is trans or refl
+% \begin{macrocode}
+ CurrVecTmp firstPlane name GetPlaneVec NormalVec
+ (C) name GetIfcCenter firstPlane name GetIfcCenter
+ @ABVect 2 copy 6 2 roll DotProd
+ 0 lt { trans }{ refl } ifelse
+ 3 1 roll ToVec /CurrVecTmp ED
+ [ firstPlane name
+ connectifc {
+ bgRefIndex
+ }{
+ name GetRefIndex
+ } ifelse
+% \end{macrocode}
+% always draw to first interface
+% \begin{macrocode}
+ 5 -1 roll true ] cvx
+ /IfcCntTmp IfcCntTmp 1 add def
+ } if
+ PN IfcCnt eq {
+% \end{macrocode}
+% its the last comp, just put the center plane on the stack
+% \begin{macrocode}
+ [ (C) name
+ name GetRefIndex
+ trans draw ] cvx
+ IfcCntTmp IfcCnt gt { exch } if
+ } {
+% \end{macrocode}
+% check the mode of the ambiguous interface
+% \begin{macrocode}
+ [ (C) name
+ name GetRefIndex
+ CurrVecTmp (C) name GetPlaneVec NormalVec outToPlane
+ GetIfcCenter (C) name GetIfcCenter @ABVect DotProd
+ 0 lt { trans } { refl } ifelse % mode
+ draw ] cvx
+% \end{macrocode}
+% now check which is the outgoing plane
+% \begin{macrocode}
+ name /outToPlane load GetNextPlane
+ dup dup name isAmbiguousIfc exch 0 eq or not {
+ [ exch name bgRefIndex trans draw ] cvx exch
+ firstPlane name isAmbiguousIfc not { 3 -1 roll } if
+ /IfcCntTmp IfcCntTmp 1 add def
+ } {
+ pop
+% \end{macrocode}
+% The ambiguous interface is the last one, correct it to have the bgRefIndex.
+% \begin{macrocode}
+ exec 3 -1 roll pop bgRefIndex 3 1 roll [ 6 1 roll ] cvx
+ firstPlane name isAmbiguousIfc not { exch } if
+ } ifelse
+ } ifelse
+ } ifelse
+ /IfcCnt IfcCntTmp def
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{GetNextPlane}
+% \PSstring{comp} \PSproc{outToPlane} \PSop{GetNextPlane} \PSvar{PlaneNumber}
+% \begin{macrocode}
+/GetNextPlane {
+ (GetNextPlane) DebugBegin
+ 2 copy (C) 3 -1 roll
+ GetIfcCenter 3 -1 roll exec GetIfcCenter
+ 4 2 roll 4 copy @ABVect /VecY ED /VecX ED
+ @ABDist /centerDist ED
+ /sprod 1 def
+ /nextPlane 0 def
+ exch dup 3 1 roll
+ cvn load dup /ambIfc get /ambIfc ED /N get 1 1 3 -1 roll {
+% \end{macrocode}
+% iterate through all interfaces of CompName which do not coincide with the ambiguous interface
+% \begin{macrocode}
+ dup ambIfc eq not {
+ 3 copy 3 -1 roll 2 copy
+ GetPlaneVec VecX VecY 4 2 roll NormalVec
+ VecX VecY DotProd dup sprod lt 5 2 roll
+ GetIfcCenter 3 -1 roll exec GetIfcCenter @ABDist
+ centerDist lt and
+ { /sprod ED /nextPlane ED } { pop pop } ifelse
+ } {
+ pop
+ } ifelse
+ } for
+ pop pop nextPlane
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{TraceBeam}
+% [ CompN ... Comp1 \PSproc{options} \PSproc{start point} \PSvar{beamangle}
+% -> Yn Xn drawToN? ... Y1 X1 drawTo1? Y0 X0
+% \begin{macrocode}
+/TraceBeam {
+ (Tracebeam) DebugBegin
+ AngToVec /InVec ED /StartPoint ED
+ /oldbeaminsidelast currentdict /beaminsidelast known {
+ beaminsidelast
+ } {
+ false
+ } ifelse def
+% \end{macrocode}
+% execute options
+% \begin{macrocode}
+ exec
+ connectifc {
+ /nbeam bgRefIndex def
+ } if
+ /startinside startinside beaminsidefirst or def
+ /stopinside stopinside beaminsidelast or def
+ /PrevCorrect false def
+ PrearrangePlanes
+ PushAllPlanesOnStack
+ currentdict /lastVecTmp known {
+ lastVecTmp beamangle matrix rotate dtransform ToVec
+ } {
+ beamalign relative eq counttomark 2 ge and {
+ 2 copy /InVec load TransformInVec
+ } {
+ /InVec load
+ } ifelse
+ } ifelse
+ /CurrVec ED
+ currentdict /lastBeamPointTmp known {
+ /lastBeamPointTmp load /Curr ED
+ }{
+ counttomark 2 ge {
+ 2 copy /StartPoint load TransformStartPos
+ } {
+ /StartPoint load
+ } ifelse
+ /Curr ED
+ } ifelse
+ counttomark /IfcCnt ED
+% \end{macrocode}
+% Init the refractive index
+% \begin{macrocode}
+ /n1 bgRefIndex def
+ /PN 1 def
+ (start looping) DebugMsg
+ {
+ PN IfcCnt gt {
+ exit
+ } if
+ (checked) DebugMsg
+% \end{macrocode}
+% iterate over all planes
+% \begin{macrocode}
+ dup xcheck not {
+% \end{macrocode}
+% array, not executable
+% \begin{macrocode}
+ PushAmbCompPlanesOnStack
+ } if
+ exec
+ /draw ED /Mode ED /n2 ED 2 copy /CompName ED /IfcNum ED
+ GetIfcCenter ToVec /CurrCenter ED
+ Curr CurrVec
+ connectifc PrevCorrect PN 2 gt and PN 2 eq or and {
+ CurrVec CurrCenter PrevCenter PrevMode
+ currentdict /relAngle known
+ { relAngle } { 0 } ifelse connectInterfaces
+ /relAngle ED
+ } if
+ IfcNum CompName Mode n2 8 4 roll HandleInterface
+ missed eq {
+ counttomark PN 1 sub 3 mul sub {pop} repeat
+ (The beam missed an interface) Warning exit
+ exit
+ } if
+ PN 1 eq {
+ pop pop
+ /draw beaminsidefirst oldbeaminsidelast xor def
+ } {
+ ToVec /CurrVec ED
+ } ifelse
+ 2 copy
+ ToVec /Curr ED
+ draw PN skipconn 1 add gt and
+ counttomark 3 roll
+ /PrevCenter /CurrCenter load def
+ /lastBeamPointTmp /Curr load def
+ /lastVecTmp /CurrVec load def
+ /PrevMode Mode def
+ CompName cvn load /correct get /PrevCorrect ED
+ PN IfcCnt eq {
+ exit
+ } {
+ CurrVec 0 eq exch 0 eq and {
+ IfcCnt PN sub {pop} repeat
+ (Total internal reflection occured, this is not supported)
+ Warning
+ exit
+ } if
+ /PN PN 1 add def
+ } ifelse
+ } loop
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{sign}
+% \begin{macrocode}
+/sign {
+ 0 ge { 1 } { -1 } ifelse
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{TraceAndFillWideBeam}
+% Fill a wide beam. This has an own procedure, because each segment
+% of the beam must be filled separately.
+% \begin{pssyntax}
+% \PSvar{[} \PSstring{CompN} \PSvar{\ldots{}} \PSstring{Comp1}
+% \PSproc{options} \PSproc{start point up} \PSvar{beamangle\_up}
+% \PSproc{start point low} \PSvar{beamangle\_low} \PSop{FillWideBeam}
+% \end{pssyntax}
+% \begin{macrocode}
+/TraceAndFillWideBeam {
+ (TraceAndFillWideBeam) DebugBegin
+ AngToVec /InvecLow ED /StartLow ED
+ AngToVec /InvecUp ED /StartUp ED
+% \end{macrocode}
+% execute user options
+% \begin{macrocode}
+ exec
+ connectifc {
+ /nbeam bgRefIndex def
+ } if
+ /startinside startinside beaminsidefirst or def
+ /stopinside stopinside beaminsidelast or def
+% \end{macrocode}
+% Number of segments already drawn
+% \begin{macrocode}
+ /DrawnSegm 0 def
+% \end{macrocode}
+% whether the previous plane required correction of the input vector (used only with \opt{connectifc})
+% \begin{macrocode}
+ /PrevCorrect false def
+ PrearrangePlanes
+ PushAllPlanesOnStack
+ currentdict /lastVecTmpUp known
+ currentdict /lastVecTmpLow known and {
+ /CurrVecLow lastVecTmpLow beamangle matrix rotate dtransform ToVec def
+ /CurrVecUp lastVecTmpUp beamangle matrix rotate dtransform ToVec def
+ }{
+% \end{macrocode}
+% If the \opt{beamangle} is not absolute, use the connection between the first
+% two planes as reference and transform the input vectors accordingly.
+% \begin{macrocode}
+ beamalign relative eq counttomark 2 ge and {
+ 2 copy /InvecLow load TransformInVec /CurrVecLow ED
+ 2 copy /InvecUp load TransformInVec /CurrVecUp ED
+ } {
+ /CurrVecLow /InvecLow load def
+ /CurrVecUp /InvecUp load def
+ } ifelse
+ } ifelse
+% \end{macrocode}
+% If \opt{loadbeampoints} is set, the nodes \PSname{lastBeamPointTmpLow} and
+% \PSname{lastBeamPointTmpUp} are defined and used as starting points.
+% \begin{macrocode}
+ currentdict /lastBeamPointTmpLow known
+ currentdict /lastBeamPointTmpUp known and {
+ /lastBeamPointTmpLow load /CurrLow ED
+ /lastBeamPointTmpUp load /CurrUp ED
+ } {
+ counttomark 2 ge {
+ 2 copy /StartLow load TransformStartPos /CurrLow ED
+ 2 copy /StartUp load TransformStartPos /CurrUp ED
+ } {
+ /StartLow load /CurrLow ED
+ /StartUp load /CurrUp ED
+ } ifelse
+ } ifelse
+% \end{macrocode}
+% \PSvar{IfcCnt} is the number of interfaces pushed on the stack by
+% \PSvar{PushAllPlanesOnStack}. This number may be corrected later if an
+% ambiguous components is among them.
+% \begin{macrocode}
+ counttomark /IfcCnt ED
+ /n1 bgRefIndex def
+ /CurrR false def
+ /ret missed def
+ /PN 1 def
+ {
+ PN IfcCnt gt {
+ exit
+ } if
+ dup xcheck not {
+% \end{macrocode}
+% Found an array (not executable) instead of a procedure. This is an ambiguous
+% component, resolve the interfaces depending on the input vector and
+% surrounding interfaces. This can change \PSvar{IfcCnt}.
+% \begin{macrocode}
+ PushAmbCompPlanesOnStack
+ } if
+% \end{macrocode}
+% push the interface on the stack
+% \begin{macrocode}
+ exec
+% \end{macrocode}
+% \PSvar{draw} indicates if the beam to the current interface should be drawn.
+% \begin{macrocode}
+ PN skipconn 1 add gt and /draw ED
+% \end{macrocode}
+% \PSvar{Mode} stores the mode (transmittive or reflective) of the current interface.
+% \begin{macrocode}
+ /Mode ED /n2 ED 2 copy /CompName ED /IfcNum ED
+% \end{macrocode}
+% \PSvar{CurrPCenter} holds the coordinates of the current interface center.
+% \begin{macrocode}
+ GetIfcCenter ToVec /CurrPCenter ED
+ /oldn1 n1 def
+% \end{macrocode}
+% Calculate new upper vector and intersection point
+% \begin{macrocode}
+ CurrUp CurrVecUp
+ connectifc PrevCorrect PN 2 gt and PN 2 eq or and {
+ CurrVecUp CurrPCenter PrevPCenter PrevMode
+ currentdict /relAngleUp known { relAngleUp } { 0 } ifelse
+ connectInterfaces /relAngleUp ED
+ } if
+ /CurrVecUp load /PrevVecUp ED
+ /CurrUp load /PrevUp ED
+ IfcNum CompName Mode n2 8 4 roll HandleInterface
+ dup /ret ED
+ missed eq {
+ counttomark {pop} repeat
+ (The upper beam missed an interface) Warning exit
+ } if
+ ToVec /CurrVecUp ED
+ ToVec /CurrUp ED
+ /n1 oldn1 def
+% \end{macrocode}
+% Calculate new lower vector and intersection point
+% \begin{macrocode}
+ /CurrVecLow load /PrevVecLow ED
+ /CurrLow load /PrevLow ED
+ CurrLow CurrVecLow
+ connectifc PrevCorrect PN 2 gt and PN 2 eq or and {
+ CurrVecLow CurrPCenter PrevPCenter PrevMode
+ currentdict /relAngleLow known { relAngleLow } { 0 } ifelse
+ connectInterfaces /relAngleLow ED
+ } if
+ IfcNum CompName Mode n2 8 4 roll HandleInterface
+ dup missed eq {
+ /ret ED
+ (The lower beam missed an interface) Warning
+ counttomark {pop} repeat exit
+ } if
+ tir eq ret tir eq or {
+ /ret tir def
+ } {
+ /ret ok def
+ } ifelse
+ ToVec /CurrVecLow ED
+ ToVec /CurrLow ED
+% \end{macrocode}
+% lower done
+% \begin{macrocode}
+ /PrevR CurrR def
+ PrevR type /realtype eq {
+ /CurrCenter load /PrevCenter ED
+ } if
+ IfcNum CompName isCurved {
+ IfcNum CompName LoadIfc
+ tx@Dict begin Pyth end /CurrR ED
+ ToVec /CurrCenter ED
+ } {
+ /CurrR false def
+ /CurrCenter false def
+ } ifelse
+ PN 1 gt currentdict /fillBeam known and {
+ draw {
+ /DrawnSegm DrawnSegm 1 add def
+ PrevUp moveto CurrUp lineto
+ IfcNum CompName isCurved {
+ CurrCenter CurrUp CurrLow
+ 4 copy 3 -1 roll eq 3 1 roll eq and {
+ 6 {pop} repeat
+ } {
+ TangentCrosspoint
+ CurrLow CurrR arct
+ } ifelse
+ } {
+ CurrLow lineto
+ } ifelse
+ PrevLow lineto
+ PrevR type /booleantype eq not {
+% \end{macrocode}
+% previous interface was also curved
+% \begin{macrocode}
+ PrevCenter PrevLow PrevUp
+ 4 copy 3 -1 roll eq 3 1 roll eq and {
+ 6 {pop} repeat
+ } {
+ TangentCrosspoint
+ PrevUp PrevR arct
+ } ifelse
+ } {
+ PrevUp lineto
+ } ifelse
+ } if
+ Mode refl eq draw and
+ draw not DrawnSegm 0 gt and or {
+ fillBeam newpath
+ /DrawnSegm 0 def
+ } if
+ } if
+ PN 1 eq {
+% \end{macrocode}
+% PN == 1
+% \begin{macrocode}
+ /CurrVecUp /PrevVecUp load def
+ /CurrVecLow /PrevVecLow load def
+ } if
+% \end{macrocode}
+% If the beam should also be stroked, push the coordinates and the 'draw' information on the stack
+% \begin{macrocode}
+ strokeBeam {
+ CurrUp draw CurrLow draw counttomark 1 add 6 roll
+ } if
+ PN IfcCnt eq ret tir eq or {
+ DrawnSegm 0 gt currentdict /fillBeam known and {
+ fillBeam newpath
+ /DrawnSegm 0 def
+ } if
+ ret tir eq {
+ IfcCnt PN sub {pop} repeat
+ (Total internal reflection occured, this is not supported)
+ Warning
+ } if
+ exit
+ } if
+ /PN PN 1 add def
+ /PrevPCenter /CurrPCenter load def
+ /PrevMode Mode def
+ CompName cvn load /correct get /PrevCorrect ED
+ } loop
+ DrawnSegm 0 gt currentdict /fillBeam known and {
+ fillBeam newpath
+ /DrawnSegm 0 def
+ } if
+ ret missed eq not {
+ CurrUp CurrLow @ABVect
+ CurrVecUp CurrVecLow 3 -1 roll add 3 1 roll add exch
+ 4 -1 roll mul 3 1 roll mul sub 0 gt {
+% \end{macrocode}
+% swap upper and lower beam points for next beam
+% \begin{macrocode}
+ /lastBeamPointTmpUp /CurrLow load def
+ /lastBeamPointTmpLow /CurrUp load def
+ /lastVecTmpUp /CurrVecLow load def
+ /lastVecTmpLow /CurrVecUp load def
+ } {
+ /lastBeamPointTmpLow /CurrLow load def
+ /lastBeamPointTmpUp /CurrUp load def
+ /lastVecTmpUp /CurrVecUp load def
+ /lastVecTmpLow /CurrVecLow load def
+ } ifelse
+ } if
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{isAmbiguous}
+% Check if \PSvar{compname} is ambiguous, i.e. if it can have alternating beam
+% paths depending on the input and output plane (e.g. beamsplitter can either
+% transmit or reflect a beam).
+% \begin{pssyntax}
+% \PSstring{compname} \PSop{isAmbiguous} \PSvar{boolean}
+% \end{pssyntax}
+% \begin{macrocode}
+/isAmbiguous {
+ cvn load dup /ambiguous known {
+ /ambiguous get
+ } {
+ pop false
+ } ifelse
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{isAmbiguousIfc}
+% Check if interface \PSvar{IfcNum} is the ambiguous interface of \PSvar{compname}.
+% \begin{pssyntax}
+% \PSvar{IfcNum} \PSstring{compname} \PSop{isAmbiguousIfc} \PSvar{boolean}
+% \end{pssyntax}
+% \begin{macrocode}
+/isAmbiguousIfc {
+ cvn load dup /ambiguous known {
+ /ambIfc get eq
+ } {
+ pop pop false
+ } ifelse
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{isCurved}
+% Check if interface \PSvar{IfcNum} of componente \PSvar{compname} is curved.
+% \begin{pssyntax}
+% \PSvar{IfcNum} \PSstring{compname} \PSop{isCurved} \PSvar{bool}
+% \end{pssyntax}
+% \begin{macrocode}
+/isCurved {
+ cvn load begin
+ IfcName load /RX known
+ end
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{HandleInterface}
+% \begin{pssyntax}
+% \PSvar{IfcNum} \PSstring{CompName} \PSvar{mode n2 X0 Y0 Xin Yin}
+% \PSop{HandleInterface}
+% \PSvar{X0' Y0' Xout Yout status}
+% \end{pssyntax}
+% \begin{macrocode}
+/HandleInterface {
+ (HandleInterface) DebugBegin
+ /Yin ED /Xin ED /Y0 ED /X0 ED /n2 ED /mode ED
+ 2 copy 2 copy LoadIfc
+ 6 -2 roll isCurved { CurvedInterface }{ PlainInterface } ifelse
+% \end{macrocode}
+% IfcNum CompName X0' Y0' Xout Yout status
+%
+% Check if X0' Y0' are within the numerical aperture of the interface
+% \begin{macrocode}
+ dup missed eq not useNA connectifc not and and {
+ 7 3 roll 2 copy 9 2 roll
+ 4 2 roll 2 copy
+ %% X0' Y0' Xout Yout status X0' Y0' IfcNum CompName IfcNum CompName
+ cvn load begin IfcName load dup /NAlow get exch /NAup get end
+ 2 copy lt {
+ 4 2 roll 2 copy LoadIfc NormalizeVec
+ 6 -2 roll isCurved {
+ neg exch
+ } if
+ %% ... X0' Y0' NAlow NAup X Y dXp dYp
+ 8 -2 roll 6 -2 roll
+ %% ... NAlow NAup dXp dYp X0' Y0' X Y
+ @ABVect DotProd
+ dup 4 -1 roll ge 3 1 roll ge and not
+ {
+ pop missed
+ } if
+ }{
+ 6 {pop} repeat
+ } ifelse
+ } {
+ 7 -2 roll pop pop
+ } ifelse
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{LoadIfc}
+% \begin{pssyntax}
+% \PSvar{IfcNum} \PSstring{CompName} \PSop{LoadIfc} \PSvar{X Y} \PSvar{dX|RY dY|RY}
+% \end{pssyntax}
+% \begin{macrocode}
+/LoadIfc {
+ (LoadIfc) DebugBegin
+ cvn load begin
+ IfcName load begin
+ X Y
+ CompMtrx transform CM itransform
+ currentdict /RX known { RX RY }{ DX DY } ifelse
+ CompMtrx dtransform CM idtransform
+ end
+ end
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{isFreeray}
+% Check if \PSvar{compname} is a free-ray componente by checking if there is a
+% refractive index associated with it.
+% \begin{pssyntax}
+% \PSstring{compname} \PSop{isFreeray} \PSvar{boolean}
+% \end{pssyntax}
+% \begin{macrocode}
+/isFreeray {
+ cvn load /n known
+ dup not {
+ (Encountered fiber component in beam path) Warning
+ } if
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{PrearrangePlanes}
+% \begin{pssyntax}
+% \PSvar{[} \PSstring{CompN} \PSvar{\ldots} \PSvar{Comp1} \PSop{PrearrangePlanes}\\
+% \PSvar{[} \PSvar{desc|asc} \PSstring{CompN} \PSvar{\ldots} \PSvar{desc|asc} \PSstring{Comp1}
+% \end{pssyntax}
+% \begin{macrocode}
+/PrearrangePlanes {
+ (PrearrangePlanes) DebugBegin
+ counttomark /N ED
+ /CompA ED dup /CompB ED
+ CompA isFreeray {
+ CompA isAmbiguous {
+ amb dup CompA
+ } {
+ CompB isAmbiguous {
+ 1 CompA GetIfcCenter (C) CompB GetIfcCenter @ABDist
+ (N) CompA GetIfcCenter (C) CompB GetIfcCenter @ABDist
+ } {
+ 1 CompA GetIfcCenter
+ 1 CompB GetIfcCenter
+ (N) CompB GetIfcCenter
+ true OrderNodes exch pop
+ (N) CompA GetIfcCenter
+ 1 CompB GetIfcCenter
+ (N) CompB GetIfcCenter
+ true OrderNodes exch pop
+ } ifelse
+ le { desc } { asc } ifelse dup CompA
+ } ifelse
+ counttomark 2 roll
+ } {
+ counttomark 1 sub { pop } repeat
+ /N 0 def
+ } ifelse
+ 2 1 N {
+ /i ED exch /CompB ED
+ CompB isFreeray not {
+ counttomark i 1 sub 2 mul 1 add sub { pop } repeat
+ exit
+ } if
+ CompB isAmbiguous not {
+ dup desc eq { 1 } { dup amb eq { (C) }{ (N) } ifelse } ifelse
+ CompA GetIfcCenter
+ 1 CompB GetIfcCenter
+ (N) CompB GetIfcCenter false OrderNodes dup dup
+% \end{macrocode}
+% check if we have a NodeIfc
+% \begin{macrocode}
+ 4 -1 roll CompA exch 5 -1 roll CompB exch
+ i 2 eq {
+% \end{macrocode}
+% check also the first plane
+% \begin{macrocode}
+ 4 copy 4 2 roll AdjustRelRot
+ } if
+ AdjustRelRot
+ } {
+ pop amb dup
+ } ifelse
+ CompB /CompA CompB def
+ counttomark 2 roll
+ } for pop
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{AdjustRelRot}
+% Adjusts the relative orientation of \PSstring{CompB} based on the
+% relative connection between \PSstring{CompA} and \PSstring{CompB}.
+% \begin{pssyntax}
+% \PSstring{CompA} \PSvar{desc|asc} \PSstring{CompB} \PSvar{desc|asc} \PSop{AdjustRelRot}
+% \end{pssyntax}
+% \begin{macrocode}
+/AdjustRelRot {
+ (AdjustRelRot) DebugBegin
+ exch dup cvn load /adjustRel known {
+ dup dup 4 2 roll isAmbiguous {
+ exch pop (C)
+ }{
+ desc eq { (N) }{ 1 } ifelse
+ } ifelse
+ exch GetIfcCenter 5 3 roll
+ exch dup 3 1 roll isAmbiguous {
+ pop (C)
+ }{
+ desc eq { 1 }{ (N) } ifelse
+ } ifelse
+ exch GetIfcCenter
+ @ABVect exch atan exch
+ cvn load begin
+ adjustRel {
+ matrix rotate CompMtrx matrix concatmatrix /CompMtrx ED
+ /adjustRel false def
+ } {
+ pop
+ } ifelse
+ end
+ } {
+ pop pop pop pop
+ } ifelse
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{PushAllPlanesOnStack}
+% \begin{pssyntax}
+% \PSvar{[} \PSvar{desc|asc} \PSstring{CompN} \PSvar{\ldots} \PSvar{desc|asc} \PSstring{Comp1} \PSop{PushAllPlanesOnStack}
+% \PSvar{[} \PSproc{PN \PSstring{CompName} n mode draw?} \PSvar{\ldots{}}
+% \end{pssyntax}
+% \begin{psarglist}
+% \psargitem{PN} The number of the plane of the component \PSstring{CompNameN}, can be an integer or a string.
+% \psargitem{CompName} The name of the component which the interface \PSvar{PN} belongs to.
+% \psargitem{n} The refractive index after the respective interface.
+% \psargitem{mode} Specifies if the interface is transmittive (\PSvar{trans}) or reflective (\PSvar{refl}).
+% \psargitem{draw?} Specifies if the connection to this interface should be drawn or if the current point is only moved.
+% \end{psarglist}
+% \begin{macrocode}
+/PushAllPlanesOnStack {
+ (PushAllPlanesOnStack) DebugBegin
+ counttomark 2 div cvi /@N ED
+ 1 1 @N {
+% \end{macrocode}
+% iterate over all components
+% \begin{macrocode}
+ /last false def
+ /first false def
+ dup 1 eq {
+ /first true def pop beaminsidefirst
+ } {
+ @N eq {
+ beaminsidelast
+ /last true def
+ } {
+ beaminside
+ } ifelse
+ } ifelse
+ exch load dup dup /allowbeaminside get 4 -1 roll and
+ /drawinside ED
+ /ambiguous get {
+ /name get drawinside [ 3 1 roll ]
+ counttomark 1 roll pop
+ } {
+ begin
+% \end{macrocode}
+% Start of the component dict.
+% \begin{macrocode}
+ desc eq {
+ N N -1 1 1
+ } {
+ 1 1 1 N N
+ } ifelse
+ first startinside not and {
+% \end{macrocode}
+% first comp and we do not start inside
+% \begin{macrocode}
+ 5 -2 roll
+ pop pop
+ 2 copy 5 2 roll
+ } if
+ 5 1 roll
+ {
+% \end{macrocode}
+% iterate over all planes
+% \begin{macrocode}
+ 3 1 roll 2 copy 5 -1 roll
+ dup 3 1 roll
+ eq first not and {
+% \end{macrocode}
+% always draw the line to the first plane of a component
+% \begin{macrocode}
+ true
+ } {
+% \end{macrocode}
+% the other beams depend on some options
+% \begin{macrocode}
+ drawinside
+ } ifelse
+ exch dup 4 -1 roll eq {
+% \end{macrocode}
+% after the last component plane we have always air
+% \begin{macrocode}
+ bgRefIndex
+ }{
+% \end{macrocode}
+% otherwise the respective refractive index of the component
+% \begin{macrocode}
+ name GetRefIndex
+ } ifelse
+ exch dup N eq {
+ pop (N)
+ } {
+ inttostr
+ } ifelse exch
+ 3 1 roll name
+ 4 1 roll
+ dup IfcName load /mode get
+ 3 1 roll 5 1 roll
+ [ 6 1 roll ] cvx counttomark 1 roll
+ last {
+ savebeampoints 1 ge stopinside not and
+ savebeampoints 1 lt beaminsidelast not and or {
+ exit
+ } if
+ } if
+ } for pop pop
+ end
+ } ifelse
+ } for
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{IfcName}
+% Construct the interface name from \PSvar{num}. This must be called within a dict of a
+% optexpcomp, because the last node ends with (N) instead of the number and we must
+% know the number of component interfaces.
+% \begin{pssyntax}
+% \PSvar{num} \PSop{IfcName} \PSname{P@num}
+% \end{pssyntax}
+% \begin{macrocode}
+/IfcName {
+ dup dup 1 eq not exch N eq and {
+ pop (N)
+ } {
+ inttostr
+ } ifelse
+ (P@) exch strcat cvn
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{NodeName}
+% Construct the plane name from IfcNum. This must be called within a dict of a
+% optexpcomp, because the last node ends with (N) instead of the number and we must
+% know the plane count of the component.
+% \begin{pssyntax}
+% \PSstring{name} \PSvar{num} \PSop{NodeName} \PSname{N@namenum}
+% \end{pssyntax}
+% \begin{macrocode}
+/NodeName {
+ dup /stringtype eq not { inttostr } if
+ strcat (N@) exch strcat cvn
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{OrderNodes}
+% Check if node (\PSvar{XB1}, \PSvar{YB1}) or (\PSvar{XBN}, \PSvar{YBN}) is nearer to node (\PSvar{XA}, \PSvar{YA}). If it
+% \PSvar{B1} is nearer, push \PSvar{asc} on the stack, otherwise
+% \PSvar{desc}. If \PSvar{calcDist} is \opt{true} it leaves also the actual
+% smallest distance on the stack.
+% \begin{pssyntax}
+% \PSvar{XA YA XB1 YB1 XBN YBN calcDist} \PSop{OrderNodes} \PSvar{desc|asc} \PSvar{distance}
+% \end{pssyntax}
+% \begin{macrocode}
+/OrderNodes {
+ 7 1 roll 6 -2 roll 2 copy 8 2 roll
+ @ABDist 5 1 roll @ABDist 2 copy gt {
+ pop asc exch
+ } {
+ exch pop desc exch
+ } ifelse
+ 3 -1 roll not {
+ pop
+ } if
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{NormalVec}
+% Construct a normal vector $\vec{n}$ to the plane such that its
+% scalar product with the incomping wave vector $\vec{v}_\text{in}$ is
+% negative: $\vec{n}\cdot (-\vec{v}_\text{in}) > 0$.
+% \begin{pssyntax}
+% \PSvar{Xin Yin Xplane Yplane} \PSop{NormalVec} \PSvar{Xnorm Ynorm}
+% \end{pssyntax}
+% \begin{macrocode}
+/NormalVec {
+ neg exch 2 copy 6 2 roll DotProd 0 gt {
+ -1 mul exch -1 mul exch
+ } if
+ NormalizeVec
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{DotProd}
+% Scalar product between two vectors.
+% \begin{pssyntax}
+% \PSvar{Xa Ya Xb Yb} \PSop{DotProd} \PSvar{val}
+% \end{pssyntax}
+% \begin{macrocode}
+/DotProd {
+ 3 -1 roll mul 3 1 roll mul add
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{VecAngle}
+% Angle between two vectors $\cos(\alpha) = \frac{ab}{|a||b|}$
+% \begin{pssyntax}
+% \PSvar{Xa Ya Xb Yb} \PSop{VecAngle} \PSvar{angle}
+% \end{pssyntax}
+% \begin{macrocode}
+/VecAngle {
+ 4 copy 4 copy DotProd 5 1 roll
+ tx@Dict begin
+ Pyth 3 1 roll Pyth
+ end mul
+ div Acos
+ 5 2 roll mul 4 1 roll 3 -1 roll mul 3 -1 roll sub
+ 0 le { -1 }{ 1 } ifelse mul
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{VecAdd}
+% Addition of two vectors.
+% \begin{pssyntax}
+% \PSvar{Xa Ya Xb Yb} \PSop{VecAdd} \PSvar{Xa+Xb Ya+Yb}
+% \end{pssyntax}
+% \begin{macrocode}
+/VecAdd {
+ 3 -1 roll add 3 1 roll add exch
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{VecScale}
+% Scale a vector by a factor \PSvar{fac}.
+% \begin{pssyntax}
+% \PSvar{Xa Ya fac} \PSop{VecScale} \PSvar{fac}$\cdot$\PSvar{Xa} \PSvar{fac}$\cdot$\PSvar{Ya}
+% \end{pssyntax}
+% \begin{macrocode}
+/VecScale {
+ dup 4 -1 roll mul 3 1 roll mul
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{ToVec}
+% Convert two numbers to a procedure holding the two values. This
+% representation is used to save coordinate values of nodes and vectors.
+% \begin{pssyntax}
+% \PSvar{X Y} \PSop{ToVec} \PSproc{X Y}
+% \end{pssyntax}
+% \begin{macrocode}
+/ToVec {
+ [ 3 1 roll ] cvx
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{AngToVec}
+% Convert an angle to the related vector representation (normalized). The
+% angle is with respect to the positive $x$-axis.
+% \begin{pssyntax}
+% \PSvar{angle} \PSop{AngToVec} \PSproc{X Y}
+% \end{pssyntax}
+% \begin{macrocode}
+/AngToVec {
+ dup cos exch sin ToVec
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{NormalizeVec}
+% Normalize a vector ($X'^2 + Y'^2 = 1$)
+% \begin{pssyntax}
+% \PSvar{X Y} \PSop{NormalizeVec} \PSvar{X' Y'}
+% \end{pssyntax}
+% \begin{macrocode}
+/NormalizeVec {
+ 2 copy
+ tx@Dict begin
+ Pyth
+ end
+ dup 3 1 roll div 3 1 roll div exch
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{@ABVect}
+% Shorthand definition for \PSvar{ABVect} procedure of the \nxLPack{pst-eucl} package.
+% \begin{pssyntax}
+% \PSvar{Xa Ya Xb Yb} \PSop{@ABVect} \PSvar{dX dY}
+% \end{pssyntax}
+% \begin{macrocode}
+/@ABVect {
+ tx@EcldDict begin ABVect end
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{@ABDist}
+% Shorthand definition for \PSvar{ABDist} procedure of the \nxLPack{pst-eucl} package.
+% \begin{pssyntax}
+% \PSvar{Xa Ya Xb Yb} \PSop{@ABDist} \PSvar{dist}
+% \end{pssyntax}
+% \begin{macrocode}
+/@ABDist {
+ tx@EcldDict begin ABDist end
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{@InterLines}
+% Shorthand definition for \PSvar{InterLines} procedure of the
+% \nxLPack{pst-eucl} package. Takes care of a bug in the
+% \nxLPack{pst-eucl} package, that too many items are popped off the
+% stack if no intersection point exists.
+% \begin{pssyntax}
+% \PSvar{X1 Y1 X2 Y2 X3 Y3 X4 Y4} \PSop{@InterLines} \PSvar{X Y ret}
+% \end{pssyntax}
+% \begin{macrocode}
+/@InterLines {
+ tx@EcldDict begin
+ EqDr /D1c exch def /D1b exch def /D1a exch def
+ EqDr /D2c exch def /D2b exch def /D2a exch def
+ D1a D2b mul D1b D2a mul sub dup
+ ZeroEq { % parallel lines
+ pop 0 0 missed
+ }{
+ /Det exch def
+ D1b D2c mul D1c D2b mul sub Det div
+ D1a D2c mul D2a D1c mul sub Det div
+ ok
+ } ifelse
+ end
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{@GetCenter}
+% Shorthand definition for the \PSvar{GetCenter} procedure of the
+% \nxLPack{pst-node} package. Takes either a string or a literal name
+% for the node name \PSvar{name}.
+% \begin{pssyntax}
+% \PSname{name} \PSop{@GetCenter} \PSvar{X Y}
+% \end{pssyntax}
+% \begin{macrocode}
+/@GetCenter {
+ tx@NodeDict begin load GetCenter end
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{@NewNode}
+% Shorthand definition for creating a new pnode.
+% \begin{macrocode}
+/@NewNode {
+ tx@NodeDict begin
+ false exch 10 {InitPnode } NewNode
+ end
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{RefractVec}
+% Calculate the refracted vector, the normal plane vector must be
+% constructed with \PSvar{NormVec}, see
+% \url{http://en.wikipedia.org/wiki/Snell%27s_law#Vector_form} for the
+% formulas.
+% \begin{pssyntax}
+% \PSvar{Xin Yin Xnorm Ynorm n1 n2} \PSop{RefractVec} \PSvar{Xout Yout}
+% \end{pssyntax}
+% If it would be total internal reflection, the output vector is (0, 0).
+% \begin{macrocode}
+/RefractVec {
+ (RefractVec) DebugBegin
+ TransformRefIndex exch TransformRefIndex exch div /n ED
+ /Ynorm ED /Xnorm ED
+ NormalizeVec /Yin ED /Xin ED
+ n abs 1 eq {
+ Xin Yin
+ }{
+ /costheta1 Xnorm Ynorm Xin neg Yin neg DotProd def
+ 1 n dup mul 1 costheta1 dup mul sub mul sub
+ dup 0 lt {
+% \end{macrocode}
+% would be total internal reflection, stop
+% \begin{macrocode}
+ pop 0 0
+ } {
+ sqrt /costheta2 ED
+ n Xin mul n Yin mul
+ n costheta1 mul costheta2 sub dup
+ Xnorm mul exch Ynorm mul VecAdd
+ } ifelse
+ } ifelse
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{ReflectVec}
+% Calculate the reflected vector, the normal plane vector must be
+% constructed with \PSvar{NormVec}.
+% \begin{pssyntax}
+% \PSvar{Xin Yin Xnorm Ynorm} \PSop{ReflectVec} \PSvar{Xout Yout}
+% \end{pssyntax}
+% \begin{macrocode}
+/ReflectVec {
+ (ReflectVec) 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}
+%
+% \begin{macro}{CurvedInterface}
+% \begin{pssyntax}
+% \PSvar{Xp Yp Xr Yr} \PSop{CurvedInterface} \PSvar{X0' Y0' Xout Yout status}
+% \end{pssyntax}
+% \begin{macrocode}
+/CurvedInterface {
+ (CurvedInterface) DebugBegin
+ 2 copy /Yr ED /Xr ED
+ tx@Dict begin Pyth end /radius ED /Yp ED /Xp ED
+ /X0n X0 Xp sub def /Y0n Y0 Yp sub def
+ tx@EcldDict begin
+ X0n Y0n 2 copy 2 copy Xin 3 -1 roll add Yin 3 -1 roll add
+ 2 copy 6 2 roll EqDr radius InterLineCircle
+ end
+ 4 copy
+ 0 eq 3 {exch 0 eq and} repeat {
+% \end{macrocode}
+% if all coordinates are zero we missed the circle, stop
+% \begin{macrocode}
+ missed
+ } {
+ 4 copy
+% \end{macrocode}
+% Chose which of the two intersection points to take.
+% \begin{macrocode}
+ Xr neg Yr neg 2 copy
+ 8 -2 roll @ABDist
+ 5 1 roll @ABDist
+ gt {
+% \end{macrocode}
+% «dist from first point» $>$ «dist from second point», take second point.
+% \begin{macrocode}
+ 4 2 roll
+ } if pop pop
+ Xp Yp VecAdd
+ 2 copy Xp Yp 4 2 roll @ABVect exch neg Xin Yin 4 2 roll NormalVec
+ Xin Yin 4 2 roll
+% \end{macrocode}
+% on stack: crossing point, in vector, and normal vector
+% \begin{macrocode}
+ mode trans eq {
+ n1 n2 RefractVec
+ 2 copy 0 eq exch 0 eq and { tir } { ok } ifelse
+ } {
+ ReflectVec ok
+ } ifelse /n1 n2 def
+ 5 -2 roll 2 copy 7 2 roll X0 Y0 @ABVect Xin Yin DotProd 0 lt
+ PN 1 gt and {
+ pop missed
+ } if
+ } ifelse
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{PlainInterface}
+% \begin{pssyntax}
+% \PSvar{Xp Yp dXp dYp} \PSop{PlainInterface} \PSvar{X0' Y0' Xout Yout status}
+% \end{pssyntax}
+% \begin{macrocode}
+/PlainInterface {%
+ (PlainInterface) DebugBegin
+ /dYp ED /dXp ED /Yp ED /Xp ED
+ Xp Yp Xp dXp add Yp dYp add X0 Y0 X0 Xin add Y0 Yin add
+ @InterLines missed eq {
+ 0 0 missed
+ } {
+ Xin Yin Xin Yin dXp dYp NormalVec
+ mode trans eq {
+ n1 n2 RefractVec
+ 2 copy 0 eq exch 0 eq and { tir } { ok } ifelse
+ } {
+ ReflectVec ok
+ } ifelse /n1 n2 def
+ 5 -2 roll 2 copy 7 2 roll X0 Y0 @ABVect Xin Yin DotProd 0 lt
+ PN 1 gt and {
+ pop missed
+ } if
+ } ifelse
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+%
+% \begin{macro}{TransformRefIndex}
+% If the refractive index on the stack is for the background (has value
+% \opt{bgRefIndex}, which is \opt{0}), we replace it here with its actual
+% value (\opt{1}). This is necessary to distinguish between background index
+% and components having an index of \opt{1}, which can be changed with option
+% \opt{n}.
+% \begin{pssyntax}
+% \PSvar{n} \PSop{TransformRefIndex} \PSvar{n|1}
+% \end{pssyntax}
+% \begin{macrocode}
+/TransformRefIndex {
+ dup bgRefIndex eq { pop 1 } if
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{GetRefIndex}
+% Evaluate the refractive index of component \opt{name}.
+% \begin{pssyntax}
+% \PSstring{name} \PSop{GetRefIndex} \PSvar{neval}
+% \end{pssyntax}
+% \begin{macrocode}
+/GetRefIndex {
+ cvn load /n get /nbeam load exch
+ EvalRefIndex
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{EvalRefIndex}
+% Evaluate the expression in \opt{nbeam} after setting refractive index to
+% \opt{n}.
+% \begin{pssyntax}
+% \PSproc{nbeam} \PSvar{n} \PSop{GetRefIndex} \PSvar{neval}
+% \end{pssyntax}
+% \begin{macrocode}
+/EvalRefIndex {
+ dup bgRefIndex eq not {
+ 1 dict begin
+% \end{macrocode}
+% Store \opt{n} locally for evaluation of the mathematical expression in
+% \opt{nbeam}.
+% \begin{macrocode}
+ /n ED
+ exec
+ end
+ } if
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{Sellmaier}
+% Calculate the refractive index for BK7 glass with the Sellmaier
+% equation. The wavelength must be given in nanometre. The coefficients are
+% taken from \href{http://en.wikipedia.org/wiki/Sellmeier_equation}.
+% \begin{pssyntax}
+% \PSvar{lambda} \PSop{Sellmaier} \PSvar{n}
+% \end{pssyntax}
+% \begin{macrocode}
+/Sellmaier {
+ dup mul
+ dup dup 1.03961212 mul exch 6000.69867 sub div
+ exch dup dup 0.231792344 mul exch 20017.9144 sub div
+ exch dup 1.01046945 mul exch 103.560653e6 sub div
+ add add 1 add sqrt
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{TangentCrosspoint}
+% Xp Yp Xt1 Yt1 Xt2 Yt2
+% \begin{macrocode}
+/TangentCrosspoint {
+ 4 copy 4 copy 14 -2 roll 2 copy
+ 6 2 roll @ABVect neg exch
+ 6 2 roll @ABVect neg exch
+ 8 -2 roll VecAdd 10 2 roll VecAdd
+ @InterLines pop
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{NearestNodeTmp}
+% {NodeB} CompA -> shortest distance, planenum
+% \begin{macrocode}
+/NearestNodeTmp {
+ exch /NodeB ED
+ /dist -1 def
+ dup cvn load /N get dup 1 eq {
+ [ exch (N) ]
+ } {
+ [ exch 1 1 3 -1 roll { } for ]
+ } ifelse
+ {
+ 2 copy pop
+ GetIfcCenterCorr 2 copy
+ NodeB @ABDist
+ dist 0 lt {
+ /dist ED
+ ToVec /node ED
+ } {
+ dup dist lt {
+ /dist ED
+ ToVec /node ED
+ } {
+ pop pop pop
+ } ifelse
+ } ifelse
+ } forall
+ pop dist /node load
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{NearestNode}
+% CompA/NodeA CombB/NodeB -> Coordinates of nodeA or the node of CompA which is nearest to nodeB
+% \begin{macrocode}
+/NearestNode {
+ (NearestNode) DebugBegin
+ dup xcheck not { nametostr } if /CompB ED
+ dup xcheck not {
+% \end{macrocode}
+% CompA is a component
+% \begin{macrocode}
+ nametostr /CompA ED
+ /CompB load dup xcheck not {
+% \end{macrocode}
+% CompB is a component
+% \begin{macrocode}
+ /mindist -1 def
+ [ exch false GetInternalNodeNames ]
+ { @GetCenter ToVec
+ CompA NearestNodeTmp
+ exch dup mindist ge mindist 0 ge and {
+ pop pop
+ }{
+ /mindist ED /minnodeA ED
+ } ifelse
+ } forall
+ minnodeA
+ } {
+ CompA NearestNodeTmp exch pop exec
+ } ifelse
+ } {
+% \end{macrocode}
+% else, it is a node and we already have the appropriate coordinates on the
+% stack
+% \begin{macrocode}
+ exec
+ } ifelse
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{RelFiberAngle}
+% Calculate start angle of \cs{nccurve} from CompA to CompB
+%
+% \begin{pssyntax}
+% \PSvar{Xb Yb Xa Ya A B} \PSvar{fiberalign} \PSop{RelFiberAngle} \PSvar{angle}
+% \end{pssyntax}
+% \begin{macrocode}
+/RelFiberAngle {
+ (RelFiberAngle) DebugBegin
+ /fiberalign ED
+ dup xcheck not { nametostr } if /CompB ED
+ dup xcheck not { nametostr } if /CompA ED
+ /CompA load xcheck {
+ /CompB load xcheck {
+% \end{macrocode}
+% both parameters are nodes, so the angle is that of the direct connection line.
+% \begin{macrocode}
+ @ABVect exch atan
+ } {
+% \end{macrocode}
+% B is a component, and A is a node: the angle at node A is calculated through component B
+% \begin{macrocode}
+ 4 copy @ABVect 6 2 roll pop pop 2 copy
+% \end{macrocode}
+% on stack: Xb-Xa Yb-Ya Xb Yb Xb Yb
+% \begin{macrocode}
+ CompB (Center) NodeName @GetCenter
+% \end{macrocode}
+% on stack: Xb-Xa Yb-Ya Xb Yb Xb Yb Xbc Ybc
+% \begin{macrocode}
+ 4 2 roll @ABVect 4 2 roll
+ CompB
+ fiberalign center eq {
+ RelFiberAngle@center
+ }{
+ RelFiberAngle@ref
+ } ifelse
+ 2 copy exch atan
+ 7 3 roll 2 copy 9 -2 roll
+ DotProd 0 gt 5 1 roll DotProd 0 gt xor { 180 add } if
+ } ifelse
+ } {
+% \end{macrocode}
+% A is a component, B is insignificant
+%
+% discard coordinates of B
+% \begin{macrocode}
+ 4 2 roll pop pop 2 copy
+ CompA (Center) NodeName @GetCenter
+ 4 2 roll @ABVect 4 2 roll
+% \end{macrocode}
+% on stack: Xac-Xa Yac-Xa Xa Ya
+% \begin{macrocode}
+ CompA fiberalign center eq {
+ RelFiberAngle@center
+ }{
+ RelFiberAngle@tref
+ } ifelse
+ 2 copy exch atan
+% \end{macrocode}
+% Xac-Xa Yac-Ya XaB-XaA YaB-YaA angleTrefline
+% \begin{macrocode}
+ 5 1 roll DotProd 0 gt { 180 add } if
+ } ifelse
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{/RelFiberAngle@ref}
+% \begin{pssyntax}
+% \PSvar{Xa Ya CompA} \PSop{RelFiberAngle@ref} \PSvar{dX dY}
+% \end{pssyntax}
+% \begin{macrocode}
+/RelFiberAngle@ref {
+ 3 1 roll pop pop
+ dup (A) NodeName exch (B) NodeName
+ @GetCenter 3 -1 roll @GetCenter @ABVect
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{/RelFiberAngle@tref}
+% Same as \PSname{RelFiberAngle@ref} but uses the transformed reference nodes.
+% \begin{pssyntax}
+% \PSvar{Xa Ya CompA} \PSop{RelFiberAngle@ref} \PSvar{dX dY}
+% \end{pssyntax}
+% \begin{macrocode}
+/RelFiberAngle@tref {
+ 3 1 roll pop pop
+ dup (TrefA) NodeName exch (TrefB) NodeName
+ @GetCenter 3 -1 roll @GetCenter @ABVect
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{/RelFiberAngle@center}
+% \begin{macrocode}
+/RelFiberAngle@center {
+ (Center) NodeName @GetCenter 4 2 roll @ABVect
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{getsubnode}
+% subname node/name -> coordinates
+% \begin{macrocode}
+/getsubnode {
+ dup xcheck {
+ exch pop exec
+ } {
+ nametostr exch nametostr exch GetIfcCenter
+ } ifelse
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{connectInterfaces}
+% \begin{pssyntax}
+% \PSproc{vec}
+% \end{pssyntax}
+% InVec Center CenterTmp PrevMode relangle
+% \begin{macrocode}
+/connectInterfaces {
+ /relAngleTmp ED
+ PN 2 eq {
+% \end{macrocode}
+% initialize relAngle, the angle between plane connection and input vector
+% \begin{macrocode}
+ pop @ABVect NormalizeVec 4 2 roll VecAngle /relAngleTmp ED
+ } if
+ PN 3 ge {
+ trans eq {
+% \end{macrocode}
+% previous plane was transmittive, recalculate the input vector
+% \begin{macrocode}
+ @ABVect NormalizeVec 4 2 roll pop pop % remove Vec from stack
+ relAngleTmp matrix rotate dtransform
+ 4 2 roll pop pop
+ } {
+% \end{macrocode}
+% else, the previous plane was reflective, recalculate relAngle
+% \begin{macrocode}
+ @ABVect NormalizeVec 4 2 roll VecAngle /relAngleTmp ED
+ } ifelse
+ } if
+ relAngleTmp
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{GetCompRange}
+% \PSstring{basename} \PSvar{start stop}
+% \PSop{GetCompRange} \PSstring{basenamestart} \ldots\ \PSstring{basenamestop}
+% \begin{macrocode}
+/GetCompRange {
+ 2 copy gt { 1 }{ -1 } ifelse 3 -1 roll
+ { exch dup 3 -1 roll inttostr strcat exch} for
+ pop
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{CorrectDipoleIfc}
+% For a dipole which has two interface nodes (1) and (N) which are very close
+% together ($\text{dist} < 10^{-7}$) or which coincide, the automatic angle
+% estimation of the fiber connections does not work properly. So these
+% interfaces are separated as less as possible so that the NearestNode
+% procedure estimates two different distances. The changed nodes are saved
+% only in the interface dictionaly as XCorr and YCorr. You must use these for
+% the fiber connections.
+% \begin{pssyntax}
+% \PSstring{node1} \PSstring{node2} \PSstring{basename} \PSop{CorrectDipoleIfc}
+% \end{pssyntax}
+% \begin{macrocode}
+/CorrectDipoleIfc {
+ (CorrectDipoleIfc) DebugBegin
+ dup dup 3 copy
+ 8 -1 roll dup 9 1 roll NodeName exch 7 -1 roll dup 7 1 roll NodeName
+ gsave
+ tx@Dict begin
+ STV CP T
+ exch @GetCenter 3 -1 roll @GetCenter
+ end
+ grestore
+ 4 copy @ABDist 1e-7 lt {
+% \end{macrocode}
+% The two nodes are closer together than $10^{-7}$, correct that to avoid
+% problems with the angle direction when drawing fibers.
+% \begin{macrocode}
+ 6 -1 roll
+ gsave
+ tx@Dict begin
+ STV CP T
+ (TrefA) NodeName @GetCenter 7 -1 roll
+ (TrefB) NodeName @GetCenter
+ end
+ grestore
+ @ABVect NormalizeVec 2 copy
+% \end{macrocode}
+% The floating-point precision of the Postscript interpreter is
+% approximately 8 digits, so in order to have an effect, the nodes must
+% be separated by $10^{-7}$ times the maximum coordinate value.
+% \begin{macrocode}
+ 8 -2 roll abs exch abs max -1e-6 mul VecScale
+ 8 -2 roll cvn load begin
+ IfcName load begin
+ X Y VecAdd /YCorr exch def /XCorr exch def
+ end
+ end
+ 4 2 roll abs exch abs max 1e-6 mul VecScale
+ 4 2 roll cvn load begin
+ IfcName load begin
+ X Y VecAdd /YCorr exch def /XCorr exch def
+ end
+ end
+ } {
+ 10 { pop } repeat
+ } ifelse
+ DebugEnd
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{debug}
+% Print out the last \opt{N} elements from the stack, checks for
+% stackunderflow. I \opt{N} is negative, the complete stack is
+% printed. Compared to the \PSvar{stack} operand, it prints the content of
+% procedures and array, which we use a lot.
+% \begin{pssyntax}
+% \PSvar{N} \PSop{debug}
+% \end{pssyntax}
+% \begin{macrocode}
+/debug {
+ /@N ED count dup @N gt @N 0 ge and { pop @N } if
+ copy @N { == } repeat
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macro}{debugComp}
+% Print out all parameters and planes of the component \opt{compname}.
+% \begin{pssyntax}
+% \PSstring{compname} \PSop{debugComp}
+% \end{pssyntax}
+% \begin{macrocode}
+/debugComp {
+ dup (debug comp ") exch strcat ("===============) strcat ==
+ cvn load {
+ dup type /dicttype eq {
+ (plane----------------) ==
+ { == == } forall
+ (-----------done) ==
+ } { == } ifelse
+ ==
+ } forall
+ (================== done) ==
+} bind def
+% \end{macrocode}
+% \end{macro}
+%
+% \begin{macrocode}
+end % tx@OptexpDict
+% \end{macrocode}
+%</prolog>
+% \Finale
+% \endinput
+%
+%<*indexstyle>
+headings_flag 1
+heading_prefix "\\textbf{"
+heading_suffix "}\n"
+quote '"'
+level '!'
+actual '='
+preamble
+ "\\begin{theindex}\n"
+item_1
+ "\\par\\leavevmode\\hangindent10pt\\makebox[15pt][l]{ -- }"
+item_01
+ "\\par\\leavevmode\\hangindent10pt\\makebox[15pt][l]{ -- }"
+item_x1
+ "\\par\\leavevmode\\hangindent10pt\\makebox[15pt][l]{ -- }"
+item_2
+ "\\par\\leavevmode\\hangindent20pt\\makebox[30pt][l]{ -- -- }"
+item_12
+ "\\par\\leavevmode\\hangindent20pt\\makebox[30pt][l]{ -- -- }"
+item_x2
+ "\\par\\leavevmode\\hangindent20pt\\makebox[30pt][l]{ -- -- }"
+%</indexstyle>
diff --git a/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.ins b/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.ins
new file mode 100644
index 00000000000..3b1de09b794
--- /dev/null
+++ b/Master/texmf-dist/source/latex/pst-optexp/pst-optexp.ins
@@ -0,0 +1,96 @@
+%%
+%% Copyright (C) 2007-2012 by Christoph Bersch <usenet@bersch.net>
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008/05/04 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The current maintainer of this work is Christoph Bersch.
+%%
+%% This work consists of the files pst-optexp.dtx and pst-optexp.ins
+%% and the derived files
+%% pst-optexp.sty, pst-optexp.tex, pst-optexp.pro.
+%%
+%% Distribution:
+%% CTAN:graphics/pstricks/contrib/pst-optexp/pst-optexp.ins
+%% CTAN:graphics/pstricks/contrib/pst-optexp/pst-optexp.dtx
+%% CTAN:graphics/pstricks/contrib/pst-optexp/pst-optexp.pdf
+%% CTAN:graphics/pstricks/contrib/pst-optexp/pst-optexp-DE.pdf
+%%
+%% Unpacking:
+%% tex pst-optexp.ins
+%%
+%% Documentation:
+%% make doc
+%% make doc-DE
+%% make quickref
+%%
+%% Installation:
+%% TDS:tex/latex/pst-optexp/pst-optexp.sty
+%% TDS:dvips/pst-optexp/pst-optexp.pro
+%% TDS:doc/generic/pst-optexp/pst-optexp.pdf
+%% TDS:doc/generic/pst-optexp/pst-optexp-DE.pdf
+%% TDS:doc/generic/pst-optexp/pst-optexp-quickref.pdf
+%% TDS:source/generic/pst-optexp/pst-optexp.ins
+%% TDS:source/generic/pst-optexp/pst-optexp.dtx
+%%
+\input docstrip.tex
+\keepsilent
+
+\preamble
+
+This is a generated file.
+
+Project: pst-optexp
+Version: 3.0 (2012/07/09)
+
+Copyright (C) 2007-2012 by Christoph Bersch <usenet@bersch.net>
+
+This work may be distributed and/or modified under the
+conditions of the LaTeX Project Public License, either version 1.3c
+of this license or (at your option) any later version.
+The latest version of this license is in
+ http://www.latex-project.org/lppl.txt
+and version 1.3c or later is part of all distributions of LaTeX
+version 2008/05/04 or later.
+
+This work has the LPPL maintenance status "maintained".
+
+The current maintainer of this work is Christoph Bersch.
+
+This work consists of the files pst-optexp.dtx and pst-optexp.ins
+and the derived files
+ pst-optexp.sty, pst-optexp.pro.
+
+\endpreamble
+
+\askforoverwritefalse
+
+\generate{\file{pst-optexp.sty}{\from{pst-optexp.dtx}{stylefile}}
+ \file{pst-optexp.ist}{\from{pst-optexp.dtx}{indexstyle}}
+ \usepostamble\empty%
+ \file{pst-optexp.pro}{\from{pst-optexp.dtx}{prolog}}}
+
+\obeyspaces
+\Msg{*************************************************************}
+\Msg{* *}
+\Msg{* To finish the installation you have to move the following *}
+\Msg{* file into a directory searched by TeX: *}
+\Msg{* *}
+\Msg{* pst-optexp.sty *}
+\Msg{* pst-optexp.pro *}
+\Msg{* *}
+\Msg{* To produce the documentation run the file pst-optexp.dtx *}
+\Msg{* through LaTeX, preferably using the Makefile. *}
+\Msg{* *}
+\Msg{* Happy TeXing! *}
+\Msg{* *}
+\Msg{*************************************************************}
+
+\endbatchfile
diff --git a/Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex b/Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex
deleted file mode 100644
index 03b23973d64..00000000000
--- a/Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex
+++ /dev/null
@@ -1,2455 +0,0 @@
-%%
-%% This is file `pst-optexp.tex',
-%%
-%% IMPORTANT NOTICE:
-%%
-%% Package `pst-optexp.tex'
-%%
-%% Christoph Bersch <usenet _at_ bersch.net>
-%%
-%% This program can be redistributed and/or modified under the terms
-%% of the LaTeX Project Public License Distributed from CTAN archives
-%% in directory CTAN:/macros/latex/base/lppl.txt.
-%%
-%% DESCRIPTION:
-%% `pst-optexp' is a PSTricks package to draw optical experimental setups
-%%
-%% HISTORY -> see file Changes
-%%
-%% Naming conventions:
-%% macros starting with
-%% \POS are _P_STricks _O_ptexp _S_trings
-%% \POK are _P_STricks _O_ptexp _K_eys
-%% \ifPOE are _P_STricks _O_pt_e_xp ifs
-%%
-\csname PSToptexpLoaded\endcsname
-\let\PSToptexpLoaded\endinput
-%
-%
-\def\fileversion{2.1}
-\def\filedate{2009/11/05}
-\message{`pst-optexp' v\fileversion, \filedate\space (CB)}
-%
-\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
-\pst@addfams{optexp}
-\pstheader{pst-optexp.pro}
-\def\pst@optexpdict{tx@OptexpDict begin }
-\SpecialCoor
-%
-%
-% IF's
-%
-\newif\ifPOE@variable
-\newif\ifPOE@crystal@voltage
-\newif\ifPOE@crystal@caxisinv
-\newif\ifPOE@reverse
-\newif\ifPOE@crystal@lamp
-\newif\ifPOE@component@optional
-\newif\ifPOE@debug@showoptdots
-\newif\ifPOE@endbox
-\newif\ifPOE@thicklens
-\newif\ifPOE@usefiberstyle
-\newif\ifPOE@connjoin
-\newif\ifPOE@fiber@
-%
-\newdimen\optboxwidth
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Strings
-%
-\def\POS@pol@polperp{perp}
-\def\POS@pol@polparallel{parallel}
-\def\POS@pol@polmisc{misc}
-\def\POS@pol@polrcirc{rcirc}
-\def\POS@pol@pollcirc{lcirc}
-\def\POS@mirror@type@piezo{piezo}
-\def\POS@mirror@type@plain{plain}
-\def\POS@mirror@type@extended{extended}
-\def\POS@optgrid@type@blazed{blazed}
-\def\POS@optgrid@type@binary{binary}
-%
-\def\POS@lens@type@plainconvex{plainconvex}
-\def\POS@lens@type@convexplain{convexplain}
-\def\POS@lens@type@biconvex{biconvex}
-\def\POS@lens@type@plainconcave{plainconcave}
-\def\POS@lens@type@concaveplain{concaveplain}
-\def\POS@lens@type@biconcave{biconcave}
-%
-\def\POS@labelref@relative{relative}
-\def\POS@labelref@relgrav{relgrav}
-\def\POS@labelref@global{global}
-%
-\edef\POS@filter@type@bandpass{bandpass}
-\edef\POS@filter@type@bandstop{bandstop}
-%
-\edef\POS@coupler@type@none{none}
-\edef\POS@coupler@type@elliptic{elliptic}
-%
-\edef\POS@optexp@top{top}
-\edef\POS@optexp@bottom{bottom}
-\edef\POS@optexp@center{center}
-\edef\POS@optexp@closed{closed}
-\edef\POS@optexp@opened{opened}
-\edef\POS@optexp@basicname@default{tempNode@}
-\edef\POS@optexp@basicname@postfix{Intern}
-\edef\POS@optexp@extnode@postfix{ExtNode}
-\edef\POS@detector@round{round}
-\edef\POS@detector@diode{diode}
-\edef\POS@bs@cube{cube}
-\edef\POS@bs@plate{plate}
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% psstyles
-%
-\newpsstyle{OptionalStyle}{linestyle=dashed,dash=1.5pt 1pt}%
-\newpsstyle{ExtendedMirror}{linestyle=none,%
- hatchwidth=0.5\POK@mirror@linewidth,
- hatchsep=1.4\POK@mirror@linewidth,%
- fillstyle=hlines}%
-\newpsstyle{PiezoMirror}{fillstyle=solid,fillcolor=black!30}%
-\newpsstyle{Beam}{linecolor=green!90!black,linewidth=\pslinewidth}%
-\define@key[psset]{optexp}{newBeam}{\newpsstyle{Beam}{#1}}
-\define@key[psset]{optexp}{addtoBeam}{\addtopsstyle{Beam}{#1}}
-%
-\newpsstyle{Fiber}{}%
-\define@key[psset]{optexp}{newFiber}{\newpsstyle{Fiber}{#1}}
-\define@key[psset]{optexp}{addtoFiber}{\addtopsstyle{Fiber}{#1}}
-%
-\newpsstyle{FiberIn}{style=Fiber}%
-\define@key[psset]{optexp}{newFiberIn}{\newpsstyle{FiberIn}{#1}}
-\define@key[psset]{optexp}{addtoFiberIn}{\addtopsstyle{FiberIn}{#1}}
-%
-\newpsstyle{FiberOut}{style=Fiber}%
-\define@key[psset]{optexp}{newFiberOut}{\newpsstyle{FiberOut}{#1}}
-\define@key[psset]{optexp}{addtoFiberOut}{\addtopsstyle{FiberOut}{#1}}
-%
-\newpsstyle{FiberIn1}{style=FiberIn}%
-\define@key[psset]{optexp}{newFiberIn1}{\newpsstyle{FiberIn1}{#1}}
-\define@key[psset]{optexp}{addtoFiberIn1}{\addtopsstyle{FiberIn1}{#1}}
-%
-\newpsstyle{FiberIn2}{style=FiberIn}%
-\define@key[psset]{optexp}{newFiberIn2}{\newpsstyle{FiberIn2}{#1}}
-\define@key[psset]{optexp}{addtoFiberIn2}{\addtopsstyle{FiberIn2}{#1}}
-%
-\newpsstyle{FiberOut1}{style=FiberOut}%
-\define@key[psset]{optexp}{newFiberOut1}{\newpsstyle{FiberOut1}{#1}}
-\define@key[psset]{optexp}{addtoFiberOut1}{\addtopsstyle{FiberOut1}{#1}}
-%
-\newpsstyle{FiberOut2}{style=FiberOut}%
-\define@key[psset]{optexp}{newFiberOut2}{\newpsstyle{FiberOut2}{#1}}
-\define@key[psset]{optexp}{addtoFiberOut2}{\addtopsstyle{FiberOut2}{#1}}
-%
-\newpsstyle{OptComp}{}%
-\define@key[psset]{optexp}{newOptComp}{\newpsstyle{OptComp}{#1}}
-\define@key[psset]{optexp}{addtoOptComp}{\addtopsstyle{OptComp}{#1}}
-%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Parameterdefinitions
-%
-% General
-\define@boolkey[psset]{optexp}[POE@component@]{optional}[true]{}
-\define@key[psset]{optexp}{position}{\edef\POK@position{#1}}
-\define@key[psset]{optexp}{abspos}{\edef\POK@abspos{#1}}
-\define@key[psset]{optexp}{angle}{\edef\POK@angle{#1}}
-\define@boolkey[psset]{optexp}[POE@]{usefiberstyle}[true]{}
-%
-% Label
-\define@key[psset]{optexp}{labelangle}{\edef\POK@label@angle{#1}}
-\define@key[psset]{optexp}{labeloffset}{\edef\POK@label@offset{#1}}
-\define@key[psset]{optexp}{labelstyle}{\def\POK@label@style{#1}}
-\define@key[psset]{optexp}{labelalign}{\def\POK@label@align{#1}}
-\define@key[psset]{optexp}{labelref}{\edef\POK@label@ref{#1}}
-\define@key[psset]{optexp}{label}{%
- \pst@expandafter\psset@@label{#1} {} {} {} {} {}\@nil
-}%
-% offset angle align ref
-\def\psset@@label#1 #2 #3 #4 #5\@nil{%
- \edef\@empty@dot{.}%
- \edef\pst@temp{#4}%
- \ifx\pst@temp\@empty\else
- \ifx\pst@temp\@empty@dot\else
- \psset{labelref=#4}
- \fi
- \fi
- \edef\pst@temp{#3}
- \ifx\pst@temp\@empty\else
- \ifx\pst@temp\@empty@dot\else
- \psset{labelalign=#3}
- \fi
- \fi
- \edef\pst@temp{#2}%
- \ifx\pst@temp\@empty\else
- \ifx\pst@temp\@empty@dot\else
- \psset{labelangle=#2}%
- \fi
- \fi
- \edef\pst@temp{#1}%
- \ifx\pst@temp\@empty\else
- \ifx\pst@temp\@empty@dot\else
- \psset{labeloffset=#1}
- \fi
- \fi
-}%
-\define@boolkey[psset]{optexp}[POE@label@]{innerlabel}[true]{}
-% for internal use only
-\define@key[psset]{optexp}{ref@angle}{\edef\POK@label@refangle{#1}}
-% labelrelative is obsolete
-\define@choicekey[psset]{optexp}{labelrelative}[\val\nr]{true,false}[true]{%
- \ifcase\nr\relax
- \psset{labelref=relative}
- \or
- \psset{labelref=global}
- \fi
- \PackageWarning{pst-optexp}{labelrelative is obsolete, please use labelref=relative instead}
-}
-%
-% Debug
-\define@boolkey[psset]{optexp}[POE@debug@]{showoptdots}[true]{}
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Parameters for free-ray components
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Lens
-\define@key[psset]{optexp}{lensheight}{\edef\POK@lens@height{#1}}
-\define@key[psset]{optexp}{lenswidth}{\edef\POK@lens@width{#1}}
-\define@key[psset]{optexp}{lensradiusleft}{\edef\POK@lens@radiusLeft{#1}}
-\define@key[psset]{optexp}{lensradiusright}{\edef\POK@lens@radiusRight{#1}}
-\define@boolkey[psset]{optexp}[POE@]{thicklens}[true]{}
-\define@key[psset]{optexp}{lensradius}{%
- \psset{lensradiusleft=#1,%
- lensradiusright=#1}%
- \edef\POK@lens@radius{#1}%
-}%
-% Lens Type (only for backward compatibility)
-% 0 -> plainconvex
-% 1 -> convexplain
-% 2 -> biconvex
-% 3 -> plainconcave
-% 4 -> concaveplain
-% 5 -> biconcave
-%
-\define@key[psset]{optexp}{lenstype}{%
- \def\pst@tempA{#1}
- \edef\POK@lens@type{%
- \ifx\POS@lens@type@plainconvex\pst@tempA 0\else
- \ifx\POS@lens@type@convexplain\pst@tempA 1\else
- \ifx\POS@lens@type@biconvex\pst@tempA 2\else
- \ifx\POS@lens@type@plainconcave\pst@tempA 3\else
- \ifx\POS@lens@type@concaveplain\pst@tempA 4\else
- \ifx\POS@lens@type@biconcave\pst@tempA 5%
- \fi\fi\fi\fi\fi\fi%
-}}
-\define@key[psset]{optexp}{lens}{%
- \pst@expandafter\psset@@lens{#1} {} {} {} {} {}\@nil
-}%
-\def\psset@@lens#1 #2 #3 #4 #5\@nil{%
- \edef\pst@temp{#4}%
- \ifx\pst@temp\@empty\else
- \psset{lenswidth=#4}%
- \fi
- \edef\pst@temp{#3}%
- \ifx\pst@temp\@empty\else
- \psset{lensheight=#3}
- \fi
- \edef\pst@temp{#2}%
- \ifx\pst@temp\@empty
- \psset{lensradiusright=#1}%
- \else
- \psset{lensradiusright=#2}%
- \fi
- \psset{lensradiusleft=#1}%
-}%
-%
-% Pinhole
-\define@key[psset]{optexp}{innerheight}{\edef\POK@pinhole@iheight{#1}}
-\define@key[psset]{optexp}{iwidth}{%
- \edef\POK@pinhole@iheight{#1}%
- \PackageWarning{pst-optexp}{iwidth is obsolete, use innerheight instead}
-}
-\define@key[psset]{optexp}{outerheight}{\edef\POK@pinhole@oheight{#1}}
-\define@key[psset]{optexp}{owidth}{%
- \edef\POK@pinhole@oheight{#1}%
- \PackageWarning{pst-optexp}{owidth is obsolete, use outerheight instead}
-}
-\define@key[psset]{optexp}{phlinewidth}{\edef\POK@pinhole@linewidth{#1}}
-%
-% Beamsplitter
-\define@key[psset]{optexp}{bssize}{\edef\POK@bssize{#1}}
-\define@key[psset]{optexp}{bsstyle}{\edef\POK@bsstyle{#1}}
-\define@key[psset]{optexp}{bswidth}{%
- \edef\POK@bssize{#1}%
- \PackageWarning{pst-optexp}{bswidth is obsolete, use bssize instead}%
-}
-%
-% Crystal
-\define@key[psset]{optexp}{crystalwidth}{\edef\POK@crystal@width{#1}}
-\define@key[psset]{optexp}{crystalheight}{\edef\POK@crystal@height{#1}}
-\define@key[psset]{optexp}{caxislength}{\edef\POK@crystal@caxislength{#1}}
-\define@boolkey[psset]{optexp}[POE@crystal@]{voltage}[true]{}
-\define@boolkey[psset]{optexp}[POE@crystal@]{caxisinv}[true]{}
-\define@boolkey[psset]{optexp}[POE@crystal@]{lamp}[true]{}
-\define@key[psset]{optexp}{lampscale}{\def\POK@lamp@scale{#1}}
-%
-% Mirror
-\define@key[psset]{optexp}{mirrorwidth}{\edef\POK@mirror@width{#1}}
-\define@key[psset]{optexp}{mirrorlinewidth}{\edef\POK@mirror@linewidth{#1}}
-%\define@key[psset]{optexp}{mirrortype}{\edef\POK@mirror@type{#1}}% piezo, extended, plain
-\define@choicekey+[psset]{optexp}{mirrortype}[\val\nr]{piezo,extended,plain}%
- {\edef\POK@mirror@type{#1}}%
- {\PackageError{pst-optexp}{Unknown value '\val' for mirrortype}}
-\define@key[psset]{optexp}{mirrordepth}{\edef\POK@mirror@depth{#1}}
-\define@key[psset]{optexp}{mirrorradius}{\edef\POK@mirror@radius{#1}}
-\define@boolkey[psset]{optexp}[POE@]{variable}[true]{}
-%
-% Grid
-\define@key[psset]{optexp}{optgridcount}{\edef\POK@optgrid@count{#1}}
-\define@key[psset]{optexp}{optgridwidth}{\edef\POK@optgrid@width{#1}}
-\define@key[psset]{optexp}{optgridheight}{\edef\POK@optgrid@height{#1}}
-\define@choicekey+[psset]{optexp}{optgridtype}[\val\nr]{binary,blazed}%
- {\edef\POK@optgrid@type{#1}}
- {\PackageError{pst-optexp}{Unknown value '\val' for optgridtype}}
-\define@key[psset]{optexp}{optgriddepth}{\edef\POK@optgrid@depth{#1}}
-\define@key[psset]{optexp}{optgridlinewidth}{\edef\POK@optgrid@linewidth{#1}}
-\define@boolkey[psset]{optexp}[POE@]{reverse}[true]{}
-%
-% Box
-\define@key[psset]{optexp}{optboxwidth}{%
- \pssetlength\optboxwidth{#1}%
- \edef\POK@optbox@width{#1}%
-}
-\define@key[psset]{optexp}{optboxheight}{\edef\POK@optbox@height{#1}}
-\define@boolkey[psset]{optexp}[POE@]{endbox}[true]{}
-\define@key[psset]{optexp}{refractiveindex}{\edef\POK@optbox@n{#1}}
-%
-% Plate
-\define@key[psset]{optexp}{platelinewidth}{\edef\POK@plate@linewidth{#1}}
-\define@key[psset]{optexp}{plateheight}{\edef\POK@plate@height{#1}}
-%
-% Optical Retardation Plate
-\define@key[psset]{optexp}{platewidth}{\edef\POK@plate@width{#1}}
-%
-% Detector
-\define@key[psset]{optexp}{detsize}{\edef\POK@detector@size{#1}}
-\define@choicekey+[psset]{optexp}{dettype}[\val\nr]{round,diode}%
- {\edef\POK@detector@type{\val}}
- {\PackageError{pst-optexp}{Unknown value '\val' for key dettype}}
-%
-% Polarization
-\define@key[psset]{optexp}{polwidth}{%
- \edef\POK@polarization@size{#1}%
- \PackageWarning{pst-optexp}{polwidth is obsolete, use polsize instead}%
-}
-\define@key[psset]{optexp}{polsize}{\edef\POK@polarization@size{#1}}
-\define@key[psset]{optexp}{pollinewidth}{\edef\POK@polarization@linewidth{#1}}
-\define@choicekey+[psset]{optexp}{poltype}[\val\nr]{parallel,misc,perp,rcirc,lcirc}%
- {\edef\POK@pol@type{#1}}
- {\PackageError{pst-optexp}{Unknown value '\val' for key poltype}}
-\define@key[psset]{optexp}{pol}{%
- \edef\POK@poltype{#1}%
- \PackageWarning{pst-optexp}{pol is obsolete, use poltype instead}%
-}
-%
-% Optical Diode
-\define@key[psset]{optexp}{optdiodesize}{\edef\POK@diode@size{#1}}
-%
-% Penta Prism
-\define@key[psset]{optexp}{pentaprismsize}{\edef\POK@pentaprism@size{#1}}
-%
-% Right-Angle Prism
-\define@key[psset]{optexp}{raprismsize}{\edef\POK@raprism@size{#1}}
-%
-% Prism
-\define@key[psset]{optexp}{prismsize}{\edef\POK@prism@size{#1}}
-\define@key[psset]{optexp}{prismangle}{\edef\POK@prism@angle{#1}}
-%
-% Dove Prism
-\define@key[psset]{optexp}{doveprismsize}{\edef\POK@doveprism@size{#1}}
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Parameters for fiber-optical components
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Fiber
-\define@key[psset]{optexp}{fiberloops}{\edef\POK@fiber@count{#1}}
-\define@key[psset]{optexp}{fiberloopradius}{\edef\POK@fiber@radius{#1}}
-\define@key[psset]{optexp}{fiberloopsep}{\edef\POK@fiber@sep{#1}}
-%
-% Filter
-\define@key[psset]{optexp}{filtersize}{\edef\POK@filter@size{#1}}
-\define@choicekey+[psset]{optexp}{filtertype}[\val\nr]{bandstop,bandpass}%
- {\edef\POK@filter@type{#1}}%
- {\PackageError{pst-optexp}{Unknown value '\val' for key filtertype}}
-%
-% Polarization controller
-\define@key[psset]{optexp}{polcontrolsize}{\edef\POK@polcontrol@size{#1}}
-%
-% Optical amplifier
-\define@key[psset]{optexp}{optampsize}{\edef\POK@optamp@size{#1}}
-%
-% Mach-Zehnder-Modulator
-\define@key[psset]{optexp}{optmzmsize}{\edef\POK@optmzm@size{#1}}
-%
-% Isolator
-\define@key[psset]{optexp}{isolatorsize}{\edef\POK@isolator@size{#1}}
-%
-% Fiber polarizer
-\define@key[psset]{optexp}{fiberpolsize}{\edef\POK@fiberpol@size{#1}}
-%
-% Optical switch
-\define@key[psset]{optexp}{switchsize}{\edef\POK@switch@size{#1}}
-\define@choicekey+[psset]{optexp}{switchstyle}[\val\nr]{opened,closed}%
- {\edef\POK@switch@style{#1}}%
- {\PackageError{pst-optexp}{Unknown value '\val' for key switchstyle}}
-%
-% Fiber delay line
-\define@key[psset]{optexp}{fdlsize}{\edef\POK@fdl@size{#1}}
-%
-% Fiber collimator
-\define@key[psset]{optexp}{fibercolsize}{\edef\POK@fibercol@size{#1}}
-%
-% Coupler
-\define@key[psset]{optexp}{couplersize}{\edef\POK@coupler@size{#1}}
-\define@key[psset]{optexp}{couplersep}{\edef\POK@coupler@sep{#1}}
-\define@choicekey+[psset]{optexp}{couplertype}[\val\nr]{none,elliptic}%
- {\edef\POK@coupler@type{#1}}%
- {\PackageError{pst-optexp}{Unknown value '\val' for key couplertype}}
-\define@key[psset]{optexp}{align}{\edef\POK@align{#1}}
-%
-%
-\define@key[psset]{optexp}{compshift}{\edef\POK@comp@shift{#1}}
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Code for the extnode parameter (additional input node)
-%
-\define@key[psset]{optexp}{extnoden@me}{\edef\POK@extnode@name{#1}}
-%
-% (this part was copied and adapted from \psset@@ref from pstricks.tex)
-\define@key[psset]{optexp}{extnode}{%
- \edef\POK@extnode{#1}%
- \ifx\@empty\POK@extnode\else
- \pst@expandafter\psset@@extnode{#1}\@empty,,\@nil
- \fi
-}%
-\def\POK@xref{0}%
-\def\POK@yref{0}%
-\def\psset@@extnode#1#2,#3,#4\@nil{%
- \def\POK@xref{0}%
- \def\POK@yref{0}%
- \ifx\@empty#3\@empty
- \@nameuse{getref@optexp@#1}%
- \@nameuse{getref@optexp@#2}%
- \else
- \pst@checknum{#1#2}\POK@xref%
- \pst@checknum{#3}\POK@yref%
- \fi}%
-\def\getref@optexp@c{}%
-\def\getref@optexp@t{\def\POK@yref{1}}%
-\def\getref@optexp@b{\def\POK@yref{-1}}%
-\def\getref@optexp@l{\def\POK@xref{-1}}%
-\def\getref@optexp@r{\def\POK@xref{1}}%
-%
-%
-\define@key[psset]{optexp}{rotateref}{%
- \def\pst@temp{#1}%
- \ifx\@empty\pst@temp\else
- \pst@expandafter\psset@@rotateref{#1}\@empty,,\@nil
- \fi
-}%
-\def\POK@rotate@xref{0}%
-\def\POK@rotate@yref{0}%
-\def\psset@@rotateref#1#2,#3,#4\@nil{%
- \def\POK@rotate@xref{0}%
- \def\POK@rotate@yref{0}%
- \ifx\@empty#3\@empty
- \@nameuse{getref@optexp@rotate@#1}%
- \@nameuse{getref@optexp@rotate@#2}%
- \else
- \pst@checknum{#1#2}\POK@rotate@xref%
- \pst@checknum{#3}\POK@rotate@yref%
- \fi}%
-\def\getref@optexp@rotate@c{}%
-\def\getref@optexp@rotate@t{\def\POK@rotate@yref{1}}%
-\def\getref@optexp@rotate@b{\def\POK@rotate@yref{-1}}%
-\def\getref@optexp@rotate@l{\def\POK@rotate@xref{-1}}%
-\def\getref@optexp@rotate@r{\def\POK@rotate@xref{1}}%
-%
-%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% THIS IS THE COMPLETE AND NEW CODE FOR ALL CONNECTIONS %%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-\define@key[psset]{optexp}{b@sicname}{%
- \edef\pst@temp{#1}%
- \ifx\pst@temp\@empty%
- \edef\POK@basicname{\POS@optexp@basicname@default}%
- \else%
- \edef\POK@basicname{#1\POS@optexp@basicname@postfix}%
- \fi%
-}%
-\def\POE@complist{}%
-\g@addto@macro{\endpspicture}{\gdef\POE@complist{}}%
-\define@key[psset]{optexp}{@compname}{%
- \edef\POK@compname{#1}%
- \psset{b@sicname=#1}%
- \psset{extnoden@me=#1\POS@optexp@extnode@postfix}%
- % check if compname was already defined
- \ifx\POK@compname\@empty\else
- \@expandtwoargs\in@{,#1,}{,\POE@complist,}%
- \ifin@
- \PackageWarning{pst-optexp}%
- {^^Jcompname '#1' already used. Previously defined nodes will be overwritten!^^J}%
- \else
- % Use definition of \XKV@addtolist@x with an \xdef instead of \edef in order
- % to keep the bookkeeping global
- \xdef\POE@complist{\POE@complist\ifx\POE@complist\@empty\else,\fi#1}%
- \fi
- \fi
-}%
-\define@key[psset]{optexp}{connjoin}{%
- \edef\pst@temp{#1}%
- \ifnum\pst@temp<0
- \POE@connjoinfalse
- \else\ifnum\pst@temp>2
- \POE@connjoinfalse
- \else
- \POE@connjointrue
- \edef\POK@connjoin{\pst@temp}
- \fi\fi
-}%
-\define@key[psset]{optexp}{conn}{%
- \edef\pst@tempg{#1}%
- \expandafter\psset@@conn\pst@tempg\@empty-\@empty\@nil
- \if@pst\else
- \pstrickserr{Bad connection specification: #1}\@ehpa
- \fi
-}%
-\def\psset@@conn#1-#2\@empty#3\@nil{%
- \@psttrue
- \def\next##1,#1-##2,##3\@nil{\def\pst@tempg{##2}}%
- \expandafter\next\pst@optexp@conntable,#1-#1,\@nil
- \@ifundefined{psoe@cs@in@\pst@tempg}%
- {\@pstfalse\def\psk@connIn{}}%
- {\edef\psk@connIn{psoe@cs@in@\pst@tempg}}%
- \@ifundefined{psoe@cs@out@#2}%
- {\@pstfalse\def\psk@connOut{}}%
- {\def\psk@connOut{psoe@cs@out@#2}}%
-}%
-\def\psk@connIn{}%
-\def\psk@connOut{}%
-% this is the conntable for the direct drawing of the connections
-\def\pst@optexp@conntable{,o-o,i-i,f-f}%
-%
-\def\psoe@cs@out@{}%
-\def\psoe@cs@in@{}%
-\def\psoe@cs@in@o{\psline[style=Beam](\POS@optexp@basicname@default A)(\optexp@nodeA)}%
-\def\psoe@cs@out@o{\psline[style=Beam](\optexp@nodeB)(\POS@optexp@basicname@default B)}%
-\def\psoe@cs@in@f{%
- \pccurve[angleA=!\pst@optexpdict FiberAngleA end,
- angleB=!\pst@optexpdict FiberAngleB end,
- style=FiberIn](\POS@optexp@basicname@default A)(\optexp@nodeA)%
-}%
-\def\psoe@cs@out@f{%
- \pccurve[angleA=!\pst@optexpdict FiberAngleA end,
- angleB=!\pst@optexpdict FiberAngleB end,
- style=FiberOut](\optexp@nodeB)(\POS@optexp@basicname@default B)%
-}%
-\def\psoe@cs@in@i{%
- \def\pst@par{style=Beam}
- \begin@OpenObj
- \addto@pscode{%
- [
- \pst@optexpdict
- (\POK@basicname) false GetInternalBeamNodes
- /N@\POS@optexp@basicname@default A tx@NodeDict begin load GetCenter end
- end
- }%
- \psline@ii
-}%
-\def\psoe@cs@out@i{%
- \def\pst@par{style=Beam}
- \begin@OpenObj
- \addto@pscode{%
- [
- \pst@optexpdict
- /N@\POS@optexp@basicname@default B tx@NodeDict begin load GetCenter end
- (\POK@basicname) false GetInternalBeamNodes
- end
- }%
- \psline@ii
-}%
-%
-%
-\def\drawbeam{%
- \def\conntable{,a-a,b-b,A-A,B-B}%
- \begingroup
- \psset{style=Beam}%
- \pst@object{drawbeam}
-}%
-\def\drawbeam@i#1#2{%
- \def\pst@tempA{\pst@optexp@getfirstchar#1\@nil}%
- \def\pst@tempB{\pst@optexp@getfirstchar#2\@nil}%
- \ifPOE@connjoin
- \psset{linejoin=\POK@connjoin}%
- \fi
- \begin@OpenObj%
- \if(\pst@tempB
- % second parameter is a node
- \pst@optexp@@getcoor#2
- \def\psk@connOut{pst@coor}%
- \else
- \pst@optexp@check@compname{#2}%
- \edef\POK@basicnameB{#2\POS@optexp@basicname@postfix}%
- \fi
- \if(\pst@tempA
- % % first parameter is a node
- \pst@optexp@@getcoor#1%
- \def\psk@connIn{pst@coor}%
- \else
- \pst@optexp@check@compname{#1}%
- \edef\POK@basicnameA{#1\POS@optexp@basicname@postfix}%
- \fi
- \let\POK@basicname\POK@basicnameB
- \addto@pscode{[ \@nameuse{\psk@connOut}}%
- \let\POK@basicname\POK@basicnameA
- \addto@pscode{\@nameuse{\psk@connIn}}%
- \psline@ii
- \endgroup
-\ignorespaces}%
-%
-\def\pst@optexp@check@compname#1{%
- % check if 'compname' is defined
- \@expandtwoargs\in@{,#1,}{,\POE@complist,}%
- \ifin@\else
- \PackageError{pst-optexp}{^^Jcompname '#1' undefined!^^J}
- \fi
-}%
-\def\pst@optexp@getfirstchar#1#2\@nil{#1}%
-\def\pst@optexp@@getcoor(#1){%
- \pst@@getcoor{#1}%
-\ignorespaces}%
-%
-% IN
-\def\psoe@cs@in@a{tx@NodeDict begin /N@\POK@basicname 1 load GetCenter end }%
-\def\psoe@cs@in@A{\pst@optexpdict (\POK@basicname) true GetInternalBeamNodes end }%
-\def\psoe@cs@in@b{tx@NodeDict begin /N@\POK@basicname N load GetCenter end }%
-\def\psoe@cs@in@B{\pst@optexpdict (\POK@basicname) false GetInternalBeamNodes end }%
-%
-% OUT
-%
-\def\psoe@cs@out@a{tx@NodeDict begin N@\POK@basicname 1 GetCenter end }%
-\def\psoe@cs@out@A{\pst@optexpdict (\POK@basicname) false GetInternalBeamNodes end }%
-\def\psoe@cs@out@b{tx@NodeDict begin N@\POK@basicname N GetCenter end }%
-\def\psoe@cs@out@B{\pst@optexpdict (\POK@basicname) true GetInternalBeamNodes end }%
-%
-%
-\define@choicekey[psset]{optexp}{beam}[\val\nr]{}[]{%
- \psset{conn=i-o}%
-}
-\define@choicekey[psset]{optexp}{fiber}[\val\nr]{}[]{%
- \psset{conn=f-f, fiber@=true}%
-}
-%
-% The fiber@ parameter is for internal use only to allow using \pscustom and connjoin
-% when drawing internal beams.
-\define@boolkey[psset]{optexp}[POE@]{fiber@}[true]{}
-\def\optexp@nodeA{\POK@basicname 1}%
-\def\optexp@nodeB{\POK@basicname N}%
-\def\optexp@node#1{\POK@basicname #1}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% BASIC MACROS
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-\def\pst@OptexpVerb#1{\pst@Verb{\pst@optexpdict #1 end }}%
-\def\begin@OptexpObj{%
- \define@key[psset]{optexp}{compname}{\psset{@compname=##1}}
- \pst@killglue
- \begingroup
- \pst@OptexpVerb{InitOptexpComp}%
- \use@par
- % Usually the shift refers to the y-direction, shifting in x-direction
- % is done by 'abspos' or 'position'
- \let\POK@comp@Yshift\POK@comp@shift%
- \def\POK@comp@Xshift{0}%
-}%
-\def\begin@OptexpMultipole{%
- \begin@OptexpObj
- % for multipoles the default shifting is in x-direction
- \let\POK@comp@Xshift\POK@comp@shift%
- \def\POK@comp@Yshift{0}%
-}%
-\def\end@OptexpObj{%
- \pst@OptexpVerb{(\POS@optexp@basicname@default) (\POK@basicname) CloseOptexpComp}%
- \endgroup
- \ignorespaces%
-}%
-\let\end@OptexpDipole\end@OptexpObj
-\let\end@OptexpMultipole\end@OptexpObj
-%
-% Command analog to addbefore@par which is defined in pstricks.tex
-% addafter@par inserts new options at the _end_ of the current token register.
-% This can be useful to preset options that are not allowed to be changed by the
-% user.
-%
-\def\addafter@par#1{%
- \ifx\pst@par\@empty
- \def\pst@par{#1}%
- \else
- \toks@{#1}%
- \pst@toks\expandafter{\pst@par}%
- \edef\pst@par{\the\pst@toks,\the\toks@}%
- \fi%
-}%
-\def\getCLWH{CLW \pst@number\psxunit 2 mul div\space}%
-\def\getCLW{CLW \pst@number\psxunit div\space}%
-% Define new node '#3' which is shifted by (#1) relative to an existing
-% node '#2'
-\def\defShiftedNode(#1)(#2)#3{%
- \pst@getcoor{#1}\pst@tempOrig%
- \pst@getcoor{#2}\pst@tempDiff%
- \pnode(!%
- \pst@tempDiff \pst@tempOrig
- 3 -1 roll add \pst@number\psyunit div
- 3 1 roll add \pst@number\psxunit div exch){#3}%
-}%
-%
-% New high-level macros
-% 1) Allow a compressed notation of all provided elements, as most of the organizing code
-% is mostly equal.
-%
-% 2) Provide a rather easy-to-use interface for the user to allow new user-defined elements
-%
-\def\newOptexpDipole{\@ifnextchar[{\new@optexpdipole}{\new@optexpdipole[]}}
-\def\newOptexpDipoleNolabel{\@ifnextchar[{\new@optexpdipolenolabel}{\new@optexpdipolenolabel[]}}
-\def\newOptexpTripole{\@ifnextchar[{\new@optexptripole}{\new@optexptripole[]}}
-\def\newOptexpFiberDipole{\@ifnextchar[{\new@optexpfiberdipole}{\new@optexpfiberdipole[]}}
-\def\newOptexpFiberQuadrupole{\@ifnextchar[{\new@optexpfiberquadrupole}{\new@optexpfiberquadrupole[]}}
-\def\new@optexpfiberdipole[#1]#2#3{%
- \new@optexpdipole[fiber,#1]{#2}{#3}%
-}%
-%
-\def\draw@InternalConnections{%
- \ifPOE@endbox
- \@nameuse{\psk@connIn}
- \else
- \ifPOE@fiber@
- \@nameuse{\psk@connIn}
- \@nameuse{\psk@connOut}
- \else
- \ifPOE@connjoin
- \def\tmp@A{psoe@cs@in@i}%
- \ifx\tmp@A\psk@connIn
- \def\tmp@B{psoe@cs@out@o}
- \ifx\tmp@B\psk@connOut
- \pscustom[style=Beam, linejoin=\POK@connjoin]{\@nameuse{\psk@connIn}\@nameuse{\psk@connOut}}%
- \else\ifx\@empty\psk@connOut
- \pscustom[style=Beam, linejoin=\POK@connjoin]{\@nameuse{\psk@connIn}\@nameuse{\psk@connOut}}%
- \else
- \@nameuse{\psk@connIn}\@nameuse{\psk@connOut}%
- \fi\fi
- \else
- \def\tmp@A{psoe@cs@out@i}%
- \ifx\tmp@A\psk@connOut
- \def\tmp@B{psoe@cs@in@o}
- \ifx\tmp@B\psk@connIn
- \pscustom[style=Beam, linejoin=\POK@connjoin]{\@nameuse{\psk@connIn}\@nameuse{\psk@connOut}}%
- \else\ifx\@empty\psk@connIn
- \pscustom[style=Beam, linejoin=\POK@connjoin]{\@nameuse{\psk@connIn}\@nameuse{\psk@connOut}}%
- \else
- \@nameuse{\psk@connIn}\@nameuse{\psk@connOut}%
- \fi\fi
- \else
- \@nameuse{\psk@connIn}\@nameuse{\psk@connOut}%
- \fi
- \fi
- \else
- \@nameuse{\psk@connIn}\@nameuse{\psk@connOut}%
- \fi
- \fi
- \fi
-}%
-%
-% Creates new macros ...@i and ...@ii which provide most code for the arrangement
-% of the objects. A tempNode@Label is predefined as well as two internal nodes if compname is
-% defined.
-% ...@iii must be defined manually and should contain all the stroking code
-\def\new@optexpdipole[#1]#2#3{%
- \@ifundefined{#2@i}{%
- \@namedef{#2}{\pst@object{#2}}%
- \expandafter\def\csname #2@i\endcsname(##1)(##2)##3{%
- \addbefore@par{#3}%
- \addafter@par{#1}%
- \pst@regNodes{##1}{##2}
- \begin@OptexpObj
- \pst@adjustTempNodes
- \pst@draw@component{##3}{\@nameuse{#2@ii}}
- % connect
- \draw@InternalConnections
- \end@OptexpObj
- }%
- \@namedef{#2@ii}{%
- \pnode(0,0){tempNode@Label}%
- \pnode(0,0){\optexp@nodeA}%
- \pnode(0,0){\optexp@nodeB}%
- \@nameuse{#2@iii}%
- }%
- }{%
- \@pstrickserr{OptExp dipole object `#2' already defined}\@eha}%
-\ignorespaces}%
-%
-% Equivalent to new@optexdipole, only that objects without labels are created.
-\def\new@optexpdipolenolabel[#1]#2#3{%
- \@ifundefined{#2@i}{%
- \@namedef{#2}{\pst@object{#2}}%
- \expandafter\def\csname #2@i\endcsname(##1)(##2){%
- \addbefore@par{#3}%
- \addafter@par{#1}%
- \pst@regNodes{##1}{##2}
- \begin@OptexpObj
- \pst@adjustTempNodes
- \pst@draw@component{}{\@nameuse{#2@ii}}
- % connect
- \draw@InternalConnections
- \end@OptexpObj
- }%
- \@namedef{#2@ii}{%
- \pnode(0,0){tempNode@Label}%
- \pnode(0,0){\optexp@nodeA}%
- \pnode(0,0){\optexp@nodeB}%
- \@nameuse{#2@iii}%
- }%
- }{%
- \@pstrickserr{OptExp dipole object `#2' already defined}\@eha}%
-\ignorespaces}%
-%
-% Equivalent to new@optexpdipole for tripole objects.
-\def\new@optexptripole[#1]#2#3{%
- \@ifundefined{#2@i}{%
- \@namedef{#2}{\pst@object{#2}}%
- \expandafter\def\csname #2@i\endcsname(##1)(##2)(##3)##4{%
- \addbefore@par{#3}%
- \addafter@par{ref@angle=180,#1}%
- \pst@calcNodes{##1}{##2}{##3}
- \begin@OptexpMultipole
- \pst@draw@component{##4}{\@nameuse{#2@ii}}
- % adjust tempNode@A and tempNode@B for the connections
- % \pnode(##1){tempNode@A}
- % \pnode(##3){tempNode@B}
- % check if node must be switched, therefore we implement this
- % directly as PS code
- \pst@getcoor{##1}\pst@tempA%
- \pst@getcoor{##3}\pst@tempB%
- \pst@Verb{%
- \pst@optexpdict
- tx@NodeDict begin
- {\pst@tempA } false chirality 0 le { /N@tempNode@B }{ /N@tempNode@A } ifelse
- 10 {InitPnode } NewNode
- {\pst@tempB } false chirality 0 le { /N@tempNode@A }{ /N@tempNode@B } ifelse
- 10 {InitPnode } NewNode
- end end
- }%
- \draw@InternalConnections
- \end@OptexpMultipole
- }%
- \@namedef{#2@ii}{%
- \pnode(0,0){tempNode@Label}%
- \pnode(0,0){\optexp@nodeA}%
- \pnode(0,0){\optexp@nodeB}%
- \@nameuse{#2@iii}%
- }%
- }{%
- \@pstrickserr{OptExp tripole object `#2' already defined}\@eha}%
-\ignorespaces}%
-%
-%
-\def\new@optexpfiberquadrupole[#1]#2#3{%
- \@ifundefined{#2@i}{%
- \@namedef{#2}{\pst@object{#2}}%
- \expandafter\def\csname #2@i\endcsname(##1)(##2)(##3)(##4)##5{%
- \addbefore@par{#3}%
- \addafter@par{#1}%
- %
- \begin@OptexpObj
- %
- \ifx\POK@align\POS@optexp@top
- \pnode(##1){tempNode@A}
- \pnode(##3){tempNode@B}
- \else\ifx\POK@align\POS@optexp@bottom
- \pnode(##2){tempNode@A}
- \pnode(##4){tempNode@B}
- \else
- \pst@getcoor{##1}\pst@tempA%
- \pst@getcoor{##2}\pst@tempB%
- \pnode(!\pst@tempA\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@tempB\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@optexpdict mwNode end){tempNode@A}
- \pst@getcoor{##3}\pst@tempA%
- \pst@getcoor{##4}\pst@tempB%
- \pnode(!\pst@tempA\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@tempB\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@optexpdict mwNode end){tempNode@B}
- \fi\fi
- %
- \pst@draw@component{##5}{\@nameuse{#2@ii}}
- %
- % connect the fibers
- \psset{angleA=! \pst@optexpdict FiberAngleA end,
- angleB=! \pst@optexpdict FiberAngleB end}
- \pccurve[style=FiberIn1](##1)(tempNode@A@1)
- \pccurve[style=FiberIn2](##2)(tempNode@A@2)
- \pccurve[style=FiberOut1](tempNode@B@1)(##3)
- \pccurve[style=FiberOut2](tempNode@B@2)(##4)
- \end@OptexpObj
- }%
- \@namedef{#2@ii}{%
- \pnode(0,0){tempNode@Label}%
- \@nameuse{#2@iii}%
- }%
- }{%
- \@pstrickserr{OptExp fiber quadrupole object `#2' already defined}\@eha}%
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% Fiber tripole macros
-%
-\def\wdmsplitter{\pst@object{wdmsplitter}}%
-\def\wdmsplitter@i(#1)(#2)(#3)#4{%
- \begin@OptexpObj
- \pnode(#1){tempNode@A}
- \ifx\POK@align\POS@optexp@top
- \pnode(#2){tempNode@B}
- \else\ifx\POK@align\POS@optexp@bottom
- \pnode(#3){tempNode@B}
- \else
- \pst@getcoor{#2}\pst@tempA%
- \pst@getcoor{#3}\pst@tempB%
- \pnode(!\pst@tempA\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@tempB\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@optexpdict mwNode end){tempNode@B}
- \fi\fi
- %
- \pst@draw@component{#4}\wdmsplitter@ii
- %
- % default connection angles
- \psset{angleA=! \pst@optexpdict FiberAngleA end,
- angleB=! \pst@optexpdict FiberAngleB end}
- %
- % connect the fibers
- \pccurve[style=FiberIn](#1)(tempNode@A@)
- \pccurve[style=FiberOut1](tempNode@B@1)(#2)
- \pccurve[style=FiberOut2](tempNode@B@2)(#3)
- \end@OptexpObj
-}%
-%
-%
-\def\wdmcoupler{\pst@object{wdmcoupler}}%
-\def\wdmcoupler@i(#1)(#2)(#3)#4{%
- \begin@OptexpObj
- \pnode(#3){tempNode@B}
- \ifx\POK@align\POS@optexp@top
- \pnode(#1){tempNode@A}
- \else\ifx\POK@align\POS@optexp@bottom
- \pnode(#2){tempNode@A}
- \else
- \pst@getcoor{#1}\pst@tempA%
- \pst@getcoor{#2}\pst@tempB%
- \pnode(!\pst@tempA\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@tempB\pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@optexpdict mwNode end){tempNode@A}
- \fi\fi
- %
- \pst@draw@component{#4}\wdmcoupler@ii
- %
- % default connection angles
- \psset{angleA=! \pst@optexpdict FiberAngleA end,
- angleB=! \pst@optexpdict FiberAngleB end}
- %
- % connect the fibers
- \pccurve[style=FiberOut](tempNode@B@)(#3)
- \pccurve[style=FiberIn1](#1)(tempNode@A@1)
- \pccurve[style=FiberIn2](#2)(tempNode@A@2)
- \end@OptexpObj
-}%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Some of the components need three points to be positioned.
-% These are:
-%
-% 1. starting point of the beam (in the PS-Code: (XA,YA))
-% 2. reflection point on the surface (XG, YG)
-% 3. end point (XB,YB)
-%
-% With these three points \pst@calcNodes calculates two new points 'tempNode@A'
-% and 'tempNode@B', between which the component is placed by the macro
-% \pst@draw@component in the way, that 'angle of incidence' == 'angle of deflection'
-% regarding the reflection surface (mirror, diagonal of the beamsplitter,
-% grid etc.)
-%
-\def\pst@calcNodes#1#2#3{{%
- \pst@getcoor{#1}\pst@tempa%
- \pst@getcoor{#2}\pst@tempb%
- \pst@getcoor{#3}\pst@tempc%
- \pnode(!%
- \pst@optexpdict
- \pst@tempa \pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@tempc \pst@number\psyunit div exch \pst@number\psxunit div exch
- \pst@tempb \pst@number\psyunit div exch \pst@number\psxunit div exch
- calcNodes
- /ExchCoorSwitch
- Y@A X@A neg Y@B X@B neg ExchCoor def
- X@A Y@A end){tempNode@A}%
- \pnode(! \pst@optexpdict X@B Y@B end){tempNode@B}%
-}\ignorespaces}%
-%
-%
-% If a macro needs only two points, they are equivalent to
-% 'tempNode@A' and 'tempNode@B'. But for easier implementation of other
-% macros the given points are assigned to the temporary nodes.
-%
-\def\pst@regNodes#1#2{%
- \pnode(#1){tempNode@A}
- \pnode(#2){tempNode@B}
-\ignorespaces}%
-\def\pst@adjustTempNodes{%
- \pst@Verb{tx@NodeDict begin N@tempNode@A GetCenter N@tempNode@B GetCenter end
- \pst@optexpdict ExchCoor dup end
- {/@xref \POK@xref\space neg def /@yref \POK@yref\space neg def}
- {/@xref \POK@xref\space def /@yref \POK@yref\space def} ifelse
- \pst@optexpdict /ExchCoorSwitch ED end
- tx@OptexpDict /chirality known not {\pst@optexpdict /chirality 1 def
- end } if
- }%
-\ignorespaces}%
-%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% Some other usefuls macros
-%
-% Define a new node #3 shifted by (#1) relative to existing node #2.
-% Aditionally rotate the new node by #4 degree around existing node as origin.
-%
-\def\pst@defShiftedRotLabelNode(#1)#2#3#4{%
- \pst@getcoor{#1}\pst@tempDiff%
- \pnode(!%
- \pst@tempDiff /YDiff ED /XDiff ED %
- /N@#2 load GetCenter /YShifted ED /XShifted ED
- /rot@angle #4 \POK@label@refangle\space add def
- /XDiff@Rot rot@angle cos XDiff mul rot@angle sin YDiff mul add def
- /YDiff@Rot rot@angle cos YDiff mul rot@angle sin XDiff mul sub def
- XShifted XDiff@Rot add \pst@number\psxunit div
- YShifted YDiff@Rot add \pst@number\psyunit div neg
- ){#3}%
- % reset reference label to 0
- \psset{ref@angle=0}
-}%
-%
-% Define a new node #3 that is shifted by (#1)
-% with respect to the existing node #2
-\def\pst@defShiftedLabelNode(#1)#2#3{%
- \pst@defShiftedRotLabelNode(#1){#2}{#3}{0}%
-}%
-%
-% Used to put the label for labelref=relative
-%
-\def\put@RelLabel#1{%
- \nput[labelsep=0]{\POK@label@angle}%
- {tempNode@LabelShifted}%
- {\rput[\POK@label@align](0,0){\POK@label@style #1}}%
-}%
-%
-% Place the component in argument #1 and define a new node 'tempNode@LabelShifted'
-% for positioning of the label
-\def\put@Comp#1{%
- \rput(\POK@comp@Xshift,\POK@comp@Yshift){%
- #1%
- \pst@defShiftedRotLabelNode(0,\POK@label@offset)%
- {tempNode@Label}%
- {tempNode@LabelShifted}%
- {\POK@label@angle}%
- }%
-}%
-%
-% Positioning of the label depending on the reference coordinates.
-% Needs possibly a previously defined node tempNode@LabelShifted which
-% marks exactly the position of the label relative to the component.
-% This is defined by calling \put@Comp.
-%
-% Parameter 'labelref' which sets the reference coordinates can have
-% the values
-% global => labelangle rotates the label origin in global coordinate
-% system, text is not rotated
-% relgrav => labelangle rotates the label origin relativ to the local
-% coordinate system of the component, text is not rotated
-% relative => as relgrav but text is rotated together with object.
-%
-\def\put@Label#1{%
- \def\pst@temp{#1}%
- \ifx\pst@temp\@empty\else
- \ifx\POK@label@ref\POS@labelref@global
- %
- % global
- \nput[labelsep=\POK@label@offset]%
- {\POK@label@angle}%
- {tempNode@Label}%
- {\rput[\POK@label@align](0,0){\POK@label@style #1}}%
- %
- \else\ifx\POK@label@ref\POS@labelref@relgrav
- %
- % relgrav
- \rput[\POK@label@align](tempNode@LabelShifted){\POK@label@style #1}%
- %
- \else\ifx\POK@label@ref\POS@labelref@relative
- %
- % relative
- \begingroup
- %
- % Redefine InitNC only for positioning of the label with
- % labelref=relative
- %
- \pst@def{InitNC}< % kindly contributed by Herbert Voss
- /b ED /a ED % second and first node
- /NodeSepTypeB ED /NodeSepTypeA ED
- /NodeSepB ED /NodeSepA ED
- /OffsetB ED /OffsetA ED
- tx@NodeDict a known tx@NodeDict b known and dup {
- /NodeA a load def /NodeB b load def
- NodeA GetCenter NodeB GetCenter % xA yA xB yB
- 4 copy exch 4 -1 roll 2 copy gt % yA yB xB xA
-% 4 copy pop exch pop le % xA xB
- { pop pop pop pop /yB ED /xB ED /yA ED /xA ED }
- { eq 3 1 roll lt and
- { /yB ED /xB ED /yA ED /xA ED}
- { /yA ED /xA ED /yB ED /xB ED} ifelse
- } ifelse
- } if >%
- %
- \ncline[linestyle=none,fillstyle=none,npos=]{tempNode@A}{tempNode@B}%
- %
- %
- \ifx\POK@position\@empty
- \ifx\POK@abspos\@empty
- \ncput[nrot=:U,npos=]{\put@RelLabel{#1}}
- \else
- \nlput[nrot=:U](tempNode@A)(tempNode@B){\POK@abspos}{\put@RelLabel{#1}}
- \fi
- \else
- \ncput[nrot=:U,npos=\POK@position]{\put@RelLabel{#1}}
- \fi
- %
- \endgroup
- \fi\fi\fi
- \fi
-}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FREE-RAY COMPONENTS
-%
-% DIPOLES
-%
-\newOptexpDipole{lens}{}%
-\newOptexpDipole{pinhole}{}%
-\newOptexpDipole{crystal}{}%
-\newOptexpDipoleNolabel{polarization}{}%
-\newOptexpDipole{optbox}{}%
-\newOptexpDipole{optplate}{}%
-\newOptexpDipole{optretplate}{}%
-\newOptexpDipole[endbox]{optdetector}{}%
-\@ifundefined{PSTcircLoaded}{\newpsobject{detector}{optdetector}}{}{}%
-\newOptexpDipole{optdiode}{}%
-\newOptexpDipole{doveprism}{}%
-%
-% TRIPOLES
-%
-\newOptexpTripole{mirror}{}%
-\newOptexpTripole[ref@angle=-135]{beamsplitter}{}%
-\newOptexpTripole{optgrid}{}%
-\newOptexpTripole[ref@angle=-135]{pentaprism}{}%
-\newOptexpTripole[ref@angle=-135]{rightangleprism}{}%
-\newOptexpTripole[ref@angle=-135]{optprism}{}%
-%
-% SPECIAL OBJECTS
-%
-\def\optdipole{\pst@object{optdipole}}
-\def\optdipole@i(#1)(#2)#3#4{%
- \pst@regNodes{#1}{#2}
- \begin@OptexpObj
- \pst@adjustTempNodes
- \pst@draw@component{#4}{%
- \pnode(0,0){tempNode@Label}%
- \pnode(0,0){\optexp@nodeA}%
- \pnode(0,0){\optexp@nodeB}%
- #3
- }%
- \draw@InternalConnections
- \end@OptexpObj
-}%
-\def\opttripole{\pst@object{opttripole}}
-\def\opttripole@i(#1)(#2)(#3)#4#5{%
- \pst@calcNodes{#1}{#2}{#3}
- \begin@OptexpMultipole
- \pst@draw@component{#5}{%
- \pnode(0,0){tempNode@Label}%
- \pnode(0,0){\optexp@nodeA}%
- \pnode(0,0){\optexp@nodeB}%
- #4
- }%
- % adjust tempNode@A and tempNode@B for the connections
- % \pnode(##1){tempNode@A}
- % \pnode(##3){tempNode@B}
- % check if node must be switched, therefore we implement this
- % directly as PS code
- \pst@getcoor{#1}\pst@tempA%
- \pst@getcoor{#3}\pst@tempB%
- \pst@Verb{%
- \pst@optexpdict
- tx@NodeDict begin
- {\pst@tempA } false chirality 0 le { /N@tempNode@B }{ /N@tempNode@A } ifelse
- 10 {InitPnode } NewNode
- {\pst@tempB } false chirality 0 le { /N@tempNode@A }{ /N@tempNode@B } ifelse
- 10 {InitPnode } NewNode
- end end
- }%
- \draw@InternalConnections
- \end@OptexpMultipole
-}%
-\def\fibercollimator{\pst@object{fibercollimator}}
-\def\fibercollimator@i(#1)(#2){%
- \addbefore@par{conn=o-f}
- \def\pst@tempA{#1}%
- \def\pst@tempB{#2}%
- \def\pst@tempC{}%
- \def\pst@tempD{}%
- \pst@regNodes{\pst@tempA}{\pst@tempB}
- \pst@adjustTempNodes
- \@ifnextchar({\fibercollimator@ii}{\fibercollimator@iv}%
-}%
-%
-\def\fibercollimator@ii(#1){%
- \def\pst@tempC{#1}%
- \@ifnextchar({\fibercollimator@iii}{\fibercollimator@iv}%
-}%
-%
-\def\fibercollimator@iii(#1)#2{%
- \def\pst@tempD{#1}%
- \fibercollimator@iv{#2}%
-}
-\def\fibercollimator@iv#1{%
- \begin@OptexpObj
- \pst@draw@component{#1}{%
- \pnode(0,0){tempNode@Label}%
- \pnode(0,0){\optexp@nodeA}%
- \pnode(0,0){\optexp@nodeB}%
- \fibercollimator@v%
- }%
- \@nameuse{\psk@connIn}%
- \ifx\@empty\pst@tempC
- \@nameuse{\psk@connOut}%
- \else\ifx\@empty\pst@tempD
- \psbezier[style=FiberOut](\pst@tempC)(\pst@tempB)(\pst@tempB)(\optexp@nodeB)%
- \else
- \psbezier[style=FiberOut](\pst@tempD)(\pst@tempC)(\pst@tempB)(\optexp@nodeB)%
- \fi\fi
- \end@OptexpObj
-}%
-% \def\fibercollimator@i(#1)(#2){%
-% \addbefore@par{conn=o-f}
-% \def\pst@tempA{#1}%
-% \def\pst@tempB{#2}%
-% \@ifnextchar({\fibercollimator@ii}{\fibercollimator@iii}%
-% }%
-% %
-% \def\fibercollimator@ii(#1)#2{%
-% \pst@regNodes{\pst@tempA}{\pst@tempB}
-% \pst@adjustTempNodes
-% \begin@OptexpObj
-% \pst@draw@component{#2}{%
-% \pnode(0,0){tempNode@Label}%
-% \pnode(0,0){\optexp@nodeA}%
-% \pnode(0,0){\optexp@nodeB}%
-% \fibercollimator@iv%
-% }%
-% \@nameuse{\psk@connIn}%
-% \psbezier[style=FiberOut](#1)(\pst@tempB)(\pst@tempB)(\optexp@nodeB)%
-% \end@OptexpObj
-% }%
-% %
-% \def\fibercollimator@iii#1{%
-% \pst@regNodes{\pst@tempA}{\pst@tempB}
-% \begin@OptexpObj
-% \pst@adjustTempNodes
-% \pst@draw@component{#1}{%
-% \pnode(0,0){tempNode@Label}%
-% \pnode(0,0){\optexp@nodeA}%
-% \pnode(0,0){\optexp@nodeB}%
-% \fibercollimator@iv%
-% }%
-% \@nameuse{\psk@connIn}%
-% \@nameuse{\psk@connOut}%
-% \end@OptexpObj
-% }%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FIBER COMPONENTS
-\newOptexpFiberDipole{optfiber}{}
-\newOptexpFiberDipole{optamp}{}
-\newOptexpFiberDipole{optmzm}{}
-\newOptexpFiberDipole{optfilter}{}
-\newOptexpFiberDipole{polcontrol}{}
-\newOptexpFiberDipole{optisolator}{}
-\newOptexpFiberDipole{optfiberpolarizer}{}
-\newOptexpFiberDipole{optswitch}{}
-\newOptexpFiberDipole{fiberdelayline}{}
-\newOptexpFiberQuadrupole{optcoupler}{}
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% default settings
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\psset{%
-% general
- position=\@empty
- ,abspos=\@empty
- ,angle=0
- ,rotateref=c
-% lens
- ,lenswidth=0.2
- ,lensheight=1
- ,lenstype=\@empty
- ,lensradius=\@empty
- ,lensradiusleft=1
- ,lensradiusright=1
- ,thicklens=false
-% pinhole
- ,phlinewidth=2\pslinewidth
- ,outerheight=1
- ,innerheight=0.1
-% beamsplitter
- ,bssize=0.8
-% ,bsstyle=cube
-% crystal
- ,crystalwidth=1.4
- ,crystalheight=0.6
- ,caxislength=0.6
- ,lampscale=0.3
-% mirror
- ,mirrorwidth=1
- ,mirrordepth=0.1
- ,mirrorradius=0
- % can't use the \POS@mirror@type@plain macro as \define@choicekey
- % does not expand the list containing the alternatives
- ,mirrortype=plain
- ,mirrorlinewidth=2\pslinewidth
- ,variable=false
-% optgrid
- ,optgridcount=10
- ,optgridwidth=1
- ,optgridheight=0.15
- ,optgriddepth=0.075
- ,optgridtype=blazed
- ,optgridlinewidth=0.7\pslinewidth
- ,reverse=false
-% optbox
- ,optboxwidth=1.4
- ,optboxheight=0.8
- ,refractiveindex=\@empty
-% optplate
- ,plateheight=1
- ,platelinewidth=2\pslinewidth
-% optretplate
- ,platewidth=0.1
-% detector
- ,detsize=0.8
- ,dettype=round
-% polarization
- ,poltype=parallel
- ,polsize=0.6
- ,pollinewidth=0.7\pslinewidth
-% optdiode
- ,optdiodesize=0.8
-% pentaprism
- ,pentaprismsize=0.7
-% rightangleprism
- ,raprismsize=1.5
-% optprism
- ,prismsize=1
- ,prismangle=60
-% doveprism
- ,doveprismsize=0.6
-% label
- ,labeloffset=0.8
- ,labelangle=0
- ,labelstyle=\small
- ,labelalign=c
- ,labelref=relgrav
- ,ref@angle=0
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-% fiber optics
- ,@compname=\@empty
- ,extnode=\@empty
- ,fiberloops=3
- ,fiberloopradius=0.4
- ,fiberloopsep=0.3
- ,optmzmsize=0.8
- ,optampsize=0.8
- ,filtersize=0.8
- ,filtertype=bandpass
- ,polcontrolsize=0.15
- ,isolatorsize=0.6
- ,fiberpolsize=0.6
- ,couplersize=0.2
- ,couplersep=0.05
- ,couplertype=elliptic
- ,switchsize=0.8
- ,switchstyle=opened
- ,fdlsize=0.6
- ,fibercolsize=0.3
- ,conn=-
- ,usefiberstyle=false
- ,bsstyle=cube
- ,compshift=0
- ,connjoin=1
-}%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% DRAW COMPONENTS
-%
-% This macro is called by every unit
-%
-\def\pst@draw@component#1#2{%
- %
- \def\@@comp{%
- #2
- \ifx\POK@extnode\@empty\else
- \pnode(! \pst@optexpdict ExtNode end){\POK@extnode@name}
- \fi
- }%
- \ifPOE@endbox%
- \ifx\POK@label@offset\@empty
- \psset{labeloffset=0}
- \fi
- \psset{position=1}%
- \fi%
- %
- \ncline[linestyle=none,fillstyle=none,npos=]{tempNode@A}{tempNode@B}%
- %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %
- % Positioning of the component
- %
- \begingroup
- %
- \psset{style=OptComp}
- %
- % linestyle to use, if component should be marked as optional
- \ifPOE@component@optional
- \psset{style=OptionalStyle}%
- \fi
- % if parameter 'position' is given, use it for 'npos'
- \ifx\POK@position\@empty
- %
- % then check if absolute positioning is wanted
- \ifx\POK@abspos\@empty
- \ncput[nrot=:U,npos=]{\put@Comp{\@@comp}}
- \else
- \nlput[nrot=:U](tempNode@A)(tempNode@B){\POK@abspos}{\put@Comp{\@@comp}}
- \fi
- \else
- \ncput[nrot=:U,npos=\POK@position]{\put@Comp{\@@comp}}
- \fi
- \endgroup
- %
- % Now put the label
- \ifPOE@label@innerlabel
- \ifdim\optboxwidth>0pt
- \psset{labeloffset=0, labelref=relative}
- \put@Label{\parbox{\optboxwidth}{#1}}%
- \else
- \put@Label{#1}%
- \fi
- \else
- \put@Label{#1}%
- \fi
- %
- % Show some special dots for debugging
- \ifPOE@debug@showoptdots
- \psdot[linecolor=red](tempNode@Label)
- \psdot[linecolor=red](tempNode@LabelShifted)
- \psdot[linecolor=black](tempNode@A)
- \psdot[linecolor=black](tempNode@B)
- \fi
- %
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% IMPLEMENTATIONS OF ALL ...@iii MACROS
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% MIRROR
-%
-\def\mirror@iii{%
- \edef\@mirror@ht{\POK@mirror@width\space\pst@number\psyunit mul 2 div }%
- \edef\@mirror@dp{\POK@mirror@depth\space\pst@number\psxunit mul }%
- \edef\@mirror@r{\POK@mirror@radius\space\pst@number\psxunit mul }%
- \edef\@mirror@postcode{neg 5 -1 roll exch 5 2 roll 90 add exch 90 add exch ArcR }%
- \edef\@mirror@extpostcode{neg \@mirror@dp add 5 -1 roll exch 5 2 roll 90 add exch 90 add }%
- %
- %
- % concave mirrors
- %
- \ifdim\POK@mirror@radius pt<0pt
- % always draw the input plane
- \begin@OpenObj
- \addto@pscode{\pst@optexpdict \@mirror@ht \@mirror@r rightConcave \@mirror@postcode end}%
- \end@OpenObj
- \ifx\POK@mirror@type\POS@mirror@type@extended
- %
- % extended concave mirror
- \psset{style=ExtendedMirror}
- \begin@ClosedObj
- \addto@pscode{\pst@optexpdict \@mirror@ht \@mirror@r rightConcave \@mirror@postcode
- \@mirror@ht \@mirror@r rightConcave \@mirror@extpostcode arc
- closepath end}%
- \end@ClosedObj
- \fi
- %
- %
- % convex mirrors
- %
- \else\ifdim\POK@mirror@radius pt>0pt
- % always draw the input plane
- \begin@OpenObj
- \addto@pscode{\pst@optexpdict \@mirror@ht \@mirror@r rightConvex \@mirror@postcode end}%
- \end@OpenObj
- \ifx\POK@mirror@type\POS@mirror@type@extended
- %
- % extended convex mirror
- \psset{style=ExtendedMirror}
- \begin@ClosedObj
- \addto@pscode{\pst@optexpdict \@mirror@ht \@mirror@r rightConvex \@mirror@postcode
- \@mirror@ht \@mirror@r rightConvex \@mirror@extpostcode arcn
- closepath end}%
- \end@ClosedObj
- \fi
- \else
- %
- % plain mirror
- %
- \edef\@m@wd{\POK@mirror@width\space 2 div }
- \ifPOE@variable
- \psarc[linewidth=0.8\pslinewidth,arrowinset=0,arrowscale=0.8]{<->}
- (! \@m@wd 0.4 sub 0){0.6}{-20}{20}
- \psarc[linewidth=0.8\pslinewidth,arrowinset=0,arrowscale=0.8]{<->}
- (! \@m@wd 0.4 sub neg 0){0.6}{160}{200}
- \fi
- \psline[linewidth=\POK@mirror@linewidth](! \@m@wd neg \getCLWH)(! \@m@wd \getCLWH)
- %
- % mirrortype
- \ifx\POK@mirror@type\POS@mirror@type@piezo%
- %
- % piezo
- \psframe[style=PiezoMirror,dimen=outer](! \@m@wd 4 div 0)(! \@m@wd -4 div \@m@wd 2.5 div)
- \ifx\POK@extnode\@empty
- \psbezier(! 0 \@m@wd 2.5 div)%
- (! 0 \@m@wd 1.5 div)%
- (! \@m@wd 2 div \@m@wd 2 div)%
- (! \@m@wd 4 div \@m@wd)%
- \else
- \pst@Verb{/@@y0 \@m@wd 2.5 div def }%
- \fi
- \else\ifx\POK@mirror@type\POS@mirror@type@extended%
- %
- % extended
- \psframe[style=ExtendedMirror]%
- (! \@m@wd neg \POK@mirror@depth\space )%
- (! \@m@wd 0)%
- \fi\fi
- \fi\fi
-}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% LENS
-%
-\def\lens@iii{%
- %
- % use old lens code to maintain backward compatibility
- \ifx\POK@lens@type\@empty
- % NEW CODE!
- \begin@ClosedObj
- \edef\@lens@newwd{0\space}%
- \edef\@lens@wd{\POK@lens@width\space\pst@number\psxunit mul 2 div }%
- \edef\@lens@th{0}%
- \addto@pscode{%
- \pst@optexpdict
- /@wd \POK@lens@width\space\pst@number\psxunit mul 2 div def
- /@ht \POK@lens@height\space\pst@number\psyunit mul 2 div def
- /@rL \POK@lens@radiusLeft\space\pst@number\psxunit mul def
- /@rR \POK@lens@radiusRight\space\pst@number\psxunit mul def
- /@th 0 def
- }%
- %
- % distinguish between all the different lens-combination possibilities
- %
- \ifdim\POK@lens@radiusLeft pt=0pt\else
- % this takes the /a1 definition from the leftC* procedures
- % the macro is necessary for the outer nodes
- \edef\@lens@newwd{%
- \POK@lens@radiusLeft\space\POK@lens@height\space 2 div segLen
- \ifdim\POK@lens@radiusLeft pt<0pt
- 0.5 mul
- \fi\space
- }%
- %
- \edef\@lens@th{\ifPOE@thicklens \POK@lens@width\space 2 div \else \POK@lens@radiusLeft\space\POK@lens@height\space 2 div segLen \fi}%
- \addto@pscode{%
- /@th \ifPOE@thicklens @wd \else @rL @ht segLen \fi def
- @ht @rL
- \ifdim\POK@lens@radiusLeft pt<0pt
- leftConcave
- \else
- leftConvex
- \fi
- }%
- \fi
- \ifdim\POK@lens@radiusRight pt=0pt\else
- % this takes the /a1 definition from the rightC* procedures
- % the macro is necessary for the outer nodes
- \edef\@lens@th{\@lens@th\space\ifPOE@thicklens \POK@lens@width\space 2 div\else \POK@lens@radiusRight\space\POK@lens@height\space 2 div segLen \fi\space add}%
- \addto@pscode{%
- /@th @th \ifPOE@thicklens @wd \else @rR @ht segLen \fi add def
- @ht @rR
- \ifdim\POK@lens@radiusRight pt<0pt
- rightConcave
- \else
- rightConvex
- \fi
- }%
- \fi
- %
- % check some special cases
- %
- % 1) Left is plain - right concave
- % \- right convex
- \ifdim\POK@lens@radiusLeft pt=0pt
- \ifdim\POK@lens@radiusRight pt=0pt\else
- \addto@pscode{%
- @th 2 div sub neg 5 1 roll
- @th 2 div neg @ht neg moveto ArcR
- @th 2 div neg @ht lineto
- }%
- \fi
- \fi
- %
- %
- % 2) Right is plain - left concave
- % \- left convex
- \ifdim\POK@lens@radiusRight pt=0pt
- \ifdim\POK@lens@radiusLeft pt=0pt\else
- \addto@pscode{%
- @th 2 div sub 5 1 roll
- @th 2 div @ht moveto ArcL
- @th 2 div @ht neg lineto
- }%
- \fi
- \fi
- %
- % 3) right and left are both curved
- \ifdim\POK@lens@radiusRight pt=0pt\else
- \ifdim\POK@lens@radiusLeft pt=0pt\else
- \addto@pscode{%
- @th 2 div dup
- 7 1 roll sub neg 5 1 roll
- ArcR sub 5 1 roll ArcL
- }%
- \fi
- \fi
- %
- % now complete the object
- \addto@pscode{closepath 1 setlinejoin end }%
- \pnode(! \pst@optexpdict\space\@lens@th\space -2 div 0 end){\optexp@nodeA}
- \pnode(! \pst@optexpdict\space\@lens@th\space 2 div 0 end){\optexp@nodeB}
- \end@ClosedObj
- %
- % OLD CODE (compatibility)
- \else
- \pst@draw@lens
- \fi
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% LENS (old) maintained for backward compatibility
-% used only if lensheight and lenswidth must be used to draw the lens
-% (i.e. when lensradius is not defined)
-%
-\def\pst@draw@lens{%
-%
- \edef\@l@h{\POK@lens@height\space 2 div\space}%
- \edef\@l@a{\POK@lens@width\space 2 div\space}%
- %
- \ifnum\POK@lens@type<3
- % CONVEX
- \ifx\POK@lens@radius\@empty
- \edef\@l@r{\@l@a 2 div \@l@h dup mul 2 \@l@a mul div add\space}%
- \else
- \edef\@l@r{\POK@lens@radius\space}%
- \edef\@l@a{\@l@r dup dup mul \@l@h dup mul sub sqrt sub\space}%
- \fi
- %
- % define some parameters only for convex lenses
- \edef\@l@d{\@l@r \@l@a sub\space}%
- \edef\@l@alpha{\@l@h \@l@d atan\space}%
- \edef\@l@y{\@l@d\space}%
- \else
- % CONCAVE
- \ifx\POK@lens@radius\@empty
- \edef\@l@r{\@l@h 1.5 mul\space}%
- \else
- \edef\@l@r{\POK@lens@radius\space}%
- \fi%
- %
- % define some parameters only for concave lenses
- \edef\@l@d{\@l@r dup mul \@l@h dup mul sub sqrt\space}%
- \edef\@l@alpha{\@l@h \@l@d atan\space}%
- \edef\@l@y{\@l@r \@l@a add\space}%
- \fi%
- %
- %
- \def\temp@LeftPlot{%
- \parametricplot[liftpen=1]{-1}{1}{%
- \@l@r \@l@alpha t mul 180 add cos mul \@l@y add \@l@r \@l@alpha t mul 180 add sin mul}%
- }%
- \def\temp@RightPlot{%
- \parametricplot[liftpen=1]{-1}{1}{%
- \@l@r \@l@alpha t mul cos mul \@l@y sub \@l@r \@l@alpha t mul sin mul}%
- }%
- %
- %
- \pscustom{%
- \ifcase\POK@lens@type
- % plainconvex
- \temp@RightPlot%
- \closepath%
- \or
- % convexplain
- \temp@LeftPlot%
- \closepath%
- \or
- % biconvex
- \temp@LeftPlot%
- \temp@RightPlot%
- \closepath
- \or
- % plainconcave
- \temp@LeftPlot%
- \psline[liftpen=1](! 0 \@l@h neg)%
- (! 0 \@l@h)%
- (! \@l@r \@l@d sub \@l@a add \@l@h)%
- \closepath
- \or%
- % concaveplain
- \temp@RightPlot%
- \psline[liftpen=1](! 0 \@l@h)%
- (! 0 \@l@h neg)%
- (! \@l@r \@l@d sub \@l@a add neg \@l@h neg)%
- \closepath
- \or
- % biconcave
- \temp@RightPlot%
- \temp@LeftPlot%
- \closepath
- \fi
- }%
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% PINHOLE
-%
-\def\pinhole@iii{%
- \psline[linewidth=\POK@pinhole@linewidth]%
- (! 0 \POK@pinhole@oheight\space 2 div)%
- (! 0 \POK@pinhole@iheight\space 2 div)%
- \psline[linewidth=\POK@pinhole@linewidth]%
- (! 0 \POK@pinhole@oheight\space -2 div)%
- (! 0 \POK@pinhole@iheight\space -2 div)%
-\ignorespaces}
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% BEAMSPLITTER
-%
-\def\beamsplitter@iii{%
- \edef\@bs@wd{\POK@bssize\space 2.0 div\space}%
- \ifx\POK@bsstyle\POS@bs@cube
- \psline{cc-cc}(! \@bs@wd neg 2 sqrt mul 0)(! \@bs@wd 2 sqrt mul 0)
- \rput[c]{45}(0,0){\psframe(! \@bs@wd neg \@bs@wd neg)(! \@bs@wd \@bs@wd)}
- \else\ifx\POK@bsstyle\POS@bs@plate
- \psline(! \@bs@wd neg 2 sqrt mul 0)(! \@bs@wd 2 sqrt mul 0)
- \fi\fi
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% CRYSTAL
-%
-\def\crystal@iii{%
- \pst@Verb{%
- /@@x \POK@crystal@width\space 0.5 mul def
- /@@y \POK@crystal@height\space 0.5 mul def
- }%
- \psrotate(! @@x \POK@rotate@xref\space mul @@y \POK@rotate@yref\space mul)
- {\POK@angle}{%
- \psframe(! @@x neg @@y neg)(! @@x @@y)
- \ifPOE@crystal@voltage%
- \psline(! @@x 4 div 3 mul neg @@y)%
- (! @@x 4 div 3 mul neg @@y 0.2 add)
- \pscircle[fillstyle=solid,%
- fillcolor=white](! @@x 4 div 3 mul neg @@y 0.2 add){0.04}
- \psline(! @@x 4 div 3 mul neg @@y neg)%
- (! @@x 4 div 3 mul neg @@y neg 0.2 sub)%
- \psline(! @@x 4 div 3 mul neg 0.15 sub @@y neg 0.2 sub)%
- (! @@x 4 div 3 mul neg 0.15 add @@y neg 0.2 sub)%
- \fi
- %
- \ifPOE@crystal@lamp
- \rput{180}(! @@x @@y 1.4 \POK@lamp@scale\space mul add){\crystal@lamp}%
- \fi
- % plot c-axis only, if caxislength > 0
- \ifdim\POK@crystal@caxislength pt>0pt
- \edef\@c@caxisL{\POK@crystal@caxislength\space 2 div\space}%
- \ifPOE@crystal@caxisinv
- %
- % invert the c-axis
- \psline[linestyle=dashed,%
- dash=2pt 2pt,%
- linewidth=0.7\pslinewidth,%
- arrowinset=0]{->}%
- (! 0 @@y neg)(! 0 @@y \@c@caxisL add)%
- \else
- \psline[linestyle=dashed,%
- dash=2pt 2pt,%
- linewidth=0.7\pslinewidth,%
- arrowinset=0]{->}%
- (! 0 @@y)(! 0 @@y neg \@c@caxisL sub)%
- \fi
- \fi
- \pnode(0,0){tempNode@Label}
- \pnode(! @@x neg 0){\optexp@nodeA}
- \pnode(! @@x
- \ifx\POK@optbox@n\@empty 0 \else
- \POK@angle\space sin neg dup dup mul neg \POK@optbox@n\space dup mul add sqrt div 2 @@x mul mul
- \fi
- ){\optexp@nodeB}
- %\pnode(! \@c@wd neg 0){\optexp@nodeA}
- %\pnode(! \@c@wd 0){\optexp@nodeB}
- }%
-\ignorespaces}%
-%
-% LAMP FOR THE CRYSTAL
-%
-\def\crystal@lamp{%
- \psset{linewidth=0.6\pslinewidth}
- \edef\@l@s{\POK@lamp@scale\space}%
- %
- \pscurve[fillstyle=none](! -0.05 \@l@s mul 0)%
- (! -0.1 \@l@s mul 0.15 \@l@s mul)%
- (! -0.2 \@l@s mul 0.25 \@l@s mul)%
- (! -0.25 \@l@s mul 0.5 \@l@s mul)%
- (! 0 0.7 \@l@s mul)%
- (! 0.25 \@l@s mul 0.5 \@l@s mul)%
- (! 0.2 \@l@s mul 0.25 \@l@s mul)%
- (! 0.1 \@l@s mul 0.15 \@l@s mul)%
- (! 0.05 \@l@s mul 0)
- \multido{\i=-210+40}{7}{%
- \rput{\i}(! 0 0.45 \@l@s mul){\psline(! -0.35 \@l@s mul 0)(! -0.6 \@l@s mul 0)}
- }
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% POLARIZATION
-%
-\def\polarization@iii{%
-%
- \edef\@pol@size{\POK@polarization@size\space 2 div\space}%
- \ifx\POK@pol@type\POS@pol@polparallel
- \psline[linestyle=solid,linewidth=\POK@polarization@linewidth,arrowscale=0.8]{<->}%
- (! 0 \@pol@size neg)(! 0 \@pol@size)%
- \fi
- \ifx\POK@pol@type\POS@pol@polperp
- \psdot[dotsize=0.05](0,0)%
- \pscircle[fillstyle=none,linestyle=solid,linewidth=\POK@polarization@linewidth](0,0){0.12}%
- \fi
- \ifx\POK@pol@type\POS@pol@polmisc
- \psline[linestyle=solid,linewidth=\POK@polarization@linewidth,arrowscale=0.8]{<->}%
- (! 0 \@pol@size neg)(! 0 \@pol@size)%
- \psdot[dotsize=0.05](0,0)%
- \pscircle[fillstyle=none,linestyle=solid,linewidth=0.7\pslinewidth](0,0){0.12}%
- \fi
- \ifx\POK@pol@type\POS@pol@polrcirc
- \psellipticarc[linewidth=\POK@polarization@linewidth]{->}%
- (0,0)(! \@pol@size 2 div \@pol@size){20}{-20}%
- \fi
- \ifx\POK@pol@type\POS@pol@pollcirc
- \psellipticarc[linewidth=\POK@polarization@linewidth]{<-}%
- (0,0)(! \@pol@size 2 div \@pol@size){20}{-20}
- \fi
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTICAL GRID
-%
-\def\optgrid@iii{%
- \edef\@g@cnt{\POK@optgrid@count\space}%
- \edef\@g@wd{\POK@optgrid@width\space 2 div\space}%
- \edef\@g@ht{\POK@optgrid@height\space}%
- \edef\@g@dp{\POK@optgrid@depth\space}%
- \edef\@g@step{\POK@optgrid@width\space\@g@cnt div\space}%
- \ifx\POK@optgrid@type\POS@optgrid@type@blazed
- \ifPOE@reverse%
- \pscustom[linewidth=\POK@optgrid@linewidth, linejoin=1]{%
- \psline[liftpen=1](! \@g@wd \@g@dp)(! \@g@wd \@g@ht)%
- (! \@g@wd neg \@g@ht)(! \@g@wd neg \@g@dp)
- \multido{\i=0+1}{\POK@optgrid@count}{%
- \psline[liftpen=1](! \@g@wd neg \i\space \@g@step mul add \@g@dp)%
- (! \@g@wd neg \i\space \@g@step mul add 0)%
- (! \@g@wd neg \i\space 1 add \@g@step mul add \@g@dp)%
- }%
- \closepath
- }%
- \else%
- \pscustom[linewidth=\POK@optgrid@linewidth, linejoin=1]{%
- \psline[liftpen=1](! \@g@wd \@g@dp)(! \@g@wd \@g@ht)%
- (! \@g@wd neg \@g@ht)(! \@g@wd neg \@g@dp)
- \multido{\i=0+1}{\POK@optgrid@count}{%
- \psline[liftpen=1](! \@g@wd neg \i\space \@g@step mul add \@g@dp)%
- (! \@g@wd neg \i\space 1 add \@g@step mul add 0)%
- (! \@g@wd neg \i\space 1 add \@g@step mul add \@g@dp)%
- }%
- \closepath
- }%
- \fi%
- \else\ifx\POK@optgrid@type\POS@optgrid@type@binary
- \pscustom[linewidth=\POK@optgrid@linewidth]{%
- \psline[liftpen=1](! \@g@wd \@g@dp)(! \@g@wd \@g@ht)%
- (! \@g@wd neg \@g@ht)(! \@g@wd neg \@g@dp)
- \multido{\i=0+1}{\POK@optgrid@count}{%
- \psline[liftpen=1](! \@g@wd neg \i\space \@g@step mul add \@g@dp)%
- (! \@g@wd neg \i\space \@g@step mul add 0)%
- (! \@g@wd neg \i\space 0.5 add \@g@step mul add 0)%
- (! \@g@wd neg \i\space 0.5 add \@g@step mul add \@g@dp)%
- (! \@g@wd neg \i\space 1 add \@g@step mul add \@g@dp)%
- }%
- }%
- \fi\fi
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTBOX
-%
-\def\optbox@iii{%
- \pst@Verb{%
- /@@x \POK@optbox@width\space 0.5 mul def
- /@@y \POK@optbox@height\space 0.5 mul def
- }%
- \ifPOE@endbox
- \pst@Verb{/@@x0 @@x def}%
- \psrotate(! @@x0 @@x \POK@rotate@xref\space mul add
- @@y0 @@y \POK@rotate@yref\space mul add){\POK@angle}{%
- \pnode(! @@x 0){tempNode@Label}%
- \psframe[dimen=outer](! 0 @@y neg)(! @@x 2 mul @@y)
- \pnode(tempNode@B){\optexp@nodeA}
- }%
- \else
- \psrotate(! @@x0 @@x \POK@rotate@xref\space mul add
- @@y0 @@y \POK@rotate@yref\space mul add){\POK@angle}{%
- \pnode(! @@x neg 0){\optexp@nodeA}
- \pnode(! @@x
- \ifx\POK@optbox@n\@empty 0 \else
- \POK@angle\space sin neg dup dup mul neg \POK@optbox@n\space dup mul add sqrt div 2 @@x mul mul
- \fi
- ){\optexp@nodeB}
- \pnode(0,0){tempNode@Label}
- \psframe[dimen=outer](! @@x neg @@y neg)(! @@x @@y)
- }%
- \fi
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTPLATE
-%
-\def\optplate@iii{%
- \psline[linewidth=\POK@plate@linewidth]%
- (! \POK@plate@height\space 2 div \POK@angle\space 2 copy sin mul 3 1 roll cos mul neg)%
- (! \POK@plate@height\space 2 div \POK@angle\space 2 copy sin mul neg 3 1 roll cos mul )%
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% DETECTOR
-%
-\def\optdetector@iii{%
- \pnode(tempNode@B){\optexp@nodeA}
- \ifx\POK@detector@type\POS@detector@round
- \pnode(! \POK@detector@size\space .2 mul 0){tempNode@Label}%
- \begin@ClosedObj
- % I could have use pswedge but then a correction of the component size
- % depending on the current linewidth is not possible
- \addto@pscode{CLW 0.5 mul 0 \POK@detector@size\space\pst@number\psrunit mul 0.5 mul
- CLW sub -90 90 arc closepath }%
- \end@ClosedObj
- \pst@Verb{/@@x0 \POK@detector@size\space 0.5 mul def}%
- \else\ifx\POK@detector@type\POS@detector@diode
- \edef\@sz{\POK@detector@size\space 0.5 mul\space}%
- \psframe[dimen=outer](! 0 \@sz neg)(!\@sz 2 mul \@sz)
- \pspolygon(! \@sz 0.8 mul \@sz -0.4 mul)%
- (! \@sz 1.6 mul \@sz -0.4 mul)%
- (! \@sz 1.2 mul \@sz 0.4 mul)%
- \psline(! \@sz 0.8 mul \@sz 0.4 mul \getCLWH add)(! \@sz 1.6 mul \@sz 0.4 mul \getCLWH add)
- \psset{arrows=->, arrowinset=0, arrowscale=0.8}
- \psline(! \@sz 0.2 mul \@sz 0.6 mul)(! \@sz 0.7 mul \@sz 0.3 mul)
- \psline(! \@sz 0.2 mul \@sz 0.3 mul)(! \@sz 0.7 mul 0)
- \psline(! \@sz 0.2 mul 0)(! \@sz 0.7 mul \@sz -0.3 mul)
- \pst@Verb{/@@x0 \@sz def /@@x \@sz def /@@y \@sz def}%
- \pnode(! \@sz 0){tempNode@Label}
- \fi\fi
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTRETPLATE
-%
-\def\optretplate@iii{%
- \edef\@p@ht{\POK@plate@height\space 2 div\space}%
- \edef\@p@wd{\POK@plate@width\space 2 div\space}%
- \psframe(! \@p@wd neg \@p@ht neg)(! \@p@wd \@p@ht)
- \psline{cc-cc}(! \@p@wd neg \@p@ht)(! \@p@wd \@p@ht neg)
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTDIODE
-%
-\def\optdiode@iii{%
- \edef\@sz{\POK@diode@size\space}%
- \psframe[dimen=outer](! \@sz -0.5 mul dup)(!\@sz 0.5 mul dup)
- \pspolygon(! \@sz -0.2 mul \@sz -0.2 mul)
- (! \@sz -0.2 mul \@sz 0.2 mul)
- (! \@sz 0.2 mul 0)
- \psline(! \@sz 0.2 mul \getCLWH add \@sz 0.2 mul)(! \@sz 0.2 mul \getCLWH add \@sz -0.2 mul)
- \pnode(! \@sz -0.5 mul 0){\optexp@nodeA}
- \pnode(! \@sz 0.5 mul 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% DOVE PRISM
-%
-\def\doveprism@iii{%
- \edef\@ht{\POK@doveprism@size\space 0.5 mul\space}%
- \edef\@wd{\POK@doveprism@size\space 1.5 mul\space}%
- \pspolygon(! \@wd neg \@ht neg)%
- (! \@wd \@ht neg)%
- (! \@ht dup)%
- (! \@ht neg \@ht)%
- \pnode(!\@wd \@ht add -0.5 mul 0){\optexp@nodeA}
- \pnode(! 0 \@ht neg){\optexp@node{2}}
- \pnode(!\@wd \@ht add 0.5 mul 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% PENTA PRISM
-%
-\def\pentaprism@iii{%
- \edef\@pp@size{\POK@pentaprism@size\space}%
- \pscustom{%
- \psline(! \@pp@size 2 sqrt div 0)%
- (! \@pp@size 2 sqrt div 67.5 cos \@pp@size mul 67.5 sin div sub \@pp@size)%
- (! 67.5 cos \@pp@size mul 67.5 sin div \@pp@size 2 sqrt div sub \@pp@size)%
- (! \@pp@size 2 sqrt div neg 0)%
- (! 0 \@pp@size 2 sqrt div neg)%
- \closepath
- }%
- \pnode(! \@pp@size 2 sqrt div 67.5 cos \@pp@size mul 67.5 sin 2 mul div sub \@pp@size 2 div){\optexp@nodeA}%
- \pnode(! 67.5 cos \@pp@size mul 67.5 sin 2 mul div \@pp@size 2 sqrt div sub \@pp@size 2 div){\optexp@nodeB}%
-}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% PRISM
-%
-\def\optprism@iii{%
- %
-% \pst@Verb{%
-% /@sz \POK@prism@size\space def
-% /@alpha \POK@prism@angle\space 0.5 mul def
-% /@hshift @sz 0.5 mul @alpha tan mul \pst@optexpdict OEangle end 0.5 mul tan div def
-% }%
-% \pspolygon(! @sz neg @alpha tan mul @sz -0.5 mul @hshift sub)
-% (! @sz @alpha tan mul @sz -0.5 mul @hshift sub)
-% (! 0 @sz 0.5 mul @hshift sub)
-% \pnode(! @sz -0.5 mul @alpha tan mul @hshift neg){\optexp@nodeA}
-% \pnode(! @sz 0.5 mul @alpha tan mul @hshift neg){\optexp@nodeB}
- \pst@Verb{%
- /@sz \POK@prism@size\space def
- /@alpha \POK@prism@angle\space 0.5 mul def
- /@hshift @sz 0.6 mul @alpha tan mul \pst@optexpdict OEangle end 0.5 mul tan div def
- }%
- \pspolygon(! @sz neg @alpha tan mul @sz -0.4 mul @hshift sub)
- (! @sz @alpha tan mul @sz -0.4 mul @hshift sub)
- (! 0 @sz 0.6 mul @hshift sub)
- \pnode(! @sz -0.6 mul @alpha tan mul @hshift neg){\optexp@nodeA}
- \pnode(! @sz 0.6 mul @alpha tan mul @hshift neg){\optexp@nodeB}
-}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% RIGHT-ANGLE PRISM
-%
-\def\rightangleprism@iii{%
- %
- \pst@Verb{%
- /prism@size \POK@raprism@size\space 0.5 mul def
- /h \pst@optexpdict OEangle 0.5 mul sin modA mul end def
- }%
- \pspolygon(! prism@size neg h \getCLW add prism@size sub)
- (! prism@size h \getCLW add prism@size sub)
- (! 0 h \getCLW 2 sqrt mul add)%
- \pnode(! h neg 0){\optexp@nodeA}
- \pnode(! h 0){\optexp@nodeB}
-}%
-%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FIBER OPTICS
-%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FIBER
-%
-\def\optfiber@iii{%
- \edef\@f@cnt{\POK@fiber@count\space}%
- \edef\@f@r{\POK@fiber@radius\space}%
- \edef\@f@sep{\POK@fiber@sep\space}%
- \parametricplot[plotpoints=200,style=Fiber]{0}{1}{%
- t 360 mul \@f@cnt mul sin \@f@r mul \@f@sep \@f@cnt 1 sub mul t 0.5 sub mul add
- 1 t 360 mul \@f@cnt mul cos sub \@f@r mul
- }%
- \pnode(!\@f@sep \@f@cnt 1 sub mul \@f@r mul 0.5 mul neg 0){\optexp@nodeA}
- \pnode(!\@f@sep \@f@cnt 1 sub mul \@f@r mul 0.5 mul 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTMZM
-%
-\def\optmzm@iii{%
- \pst@Verb{%
- /@@x \POK@optmzm@size\space 0.8 mul def
- /@@y \POK@optmzm@size\space 0.5 mul def
- }%
- \bgroup
- \ifPOE@usefiberstyle
- \psset{style=Fiber}
- \fi
- \psline(! @@x neg 0)(! @@x -0.7 mul 0)(! @@x -0.4 mul @@y 0.6 mul)%
- (! @@x 0.4 mul @@y 0.6 mul)(! @@x 0.7 mul 0)(! @@x 0)%
- (! @@x 0.7 mul 0)(! @@x 0.4 mul @@y -0.6 mul)%
- (! @@x -0.4 mul @@y -0.6 mul)(! @@x -0.7 mul 0)%
- \egroup
- \psframe[dimen=outer](! @@x neg @@y neg)(! @@x @@y)
- %
- \pnode(! @@x neg 0){\optexp@nodeA}
- \pnode(! @@x 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTICAL FILTER
-%
-\def\optfilter@iii{%
- \pst@Verb{%
- /@@x \POK@filter@size\space 0.5 mul def
- /@@y @@x def
- }%
- \def\filter@curve{%
- \parametricplot[plotstyle=curve,arrows=c-c]{-1}{1}{%
- t @@x mul 0.7 mul t Pi mul RadtoDeg 90 add cos 0.2 @@x mul mul}%
- }%
- \psframe[dimen=outer](! @@x neg dup)(! @@x dup)
- \multips(! 0 -0.5 @@y mul)(! 0 0.5 @@y mul){3}{\filter@curve}
- \ifx\POK@filter@type\POS@filter@type@bandpass
- \psline(! -0.3 @@x mul -0.65 @@y mul)%
- (! 0.3 @@x mul -0.35 @@y mul)%
- \psline(! -0.3 @@x mul 0.35 @@y mul)%
- (! 0.3 @@x mul 0.65 @@y mul)%
- \rput(! 0 -0.5 @@y mul){\filter@curve}
- \rput(0, 0){%
- \ifPOE@usefiberstyle
- \psset{style=Fiber}
- \fi
- \filter@curve}
- \rput(! 0 0.5 @@y mul){\filter@curve}
- \else\ifx\POK@filter@type\POS@filter@type@bandstop
- \psline(! -0.3 @@x mul -0.15 @@y mul)%
- (! 0.3 @@x mul 0.15 @@y mul)%
- \rput(! 0 -0.5 @@y mul){%
- \ifPOE@usefiberstyle
- \psset{style=Fiber}
- \fi
- \filter@curve}
- \rput(0, 0){\filter@curve}
- \rput(! 0 0.5 @@y mul){%
- \ifPOE@usefiberstyle
- \psset{style=Fiber}
- \fi
- \filter@curve}
- \fi\fi
- %
- \pnode(! @@x neg 0){\optexp@nodeA}
- \pnode(! @@x 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% OPTICAL AMPLIFIER
-%
-\def\optamp@iii{%
- \edef\@sz{\POK@optamp@size\space 0.5 mul\space}%
- \edef\@xl{0.75 sqrt \@sz mul\space}%
- \pspolygon(! \@xl 0)(! \getCLWH \@xl sub \@sz)(! \getCLWH \@xl sub \@sz neg)
- \pnode(!\@xl neg 0){\optexp@nodeA}
- \pnode(!\@xl 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% POLARIZATION CONTROLLER
-%
-\def\polcontrol@iii{%
- \edef\@sz{\POK@polcontrol@size\space}%
- \ifPOE@usefiberstyle
- \psset{style=Fiber}
- \fi
- \multips(! -2.5 \@sz mul \@sz)(! 2.5 \@sz mul 0){3}{\pscircle(0,0){\POK@polcontrol@size}}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% ISOLATOR
-%
-\def\optisolator@iii{%
- \edef\@ht{\POK@isolator@size\space 2 div\space}%
- \edef\@wd{\POK@isolator@size\space 0.8 mul\space}%
- \psframe[dimen=outer](! \@wd neg \@ht neg)(! \@wd \@ht)
- \psline[linewidth=2\pslinewidth,arrowinset=0]{->}(! \@wd neg 0.6 mul 0)(!\@wd 0.6 mul 0)
- \pnode(! \@wd neg 0){\optexp@nodeA}
- \pnode(! \@wd 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FIBER POLARIZER
-%
-\def\optfiberpolarizer@iii{%
- \edef\@ht{\POK@fiberpol@size\space 2 div\space}%
- \edef\@wd{\POK@fiberpol@size\space 0.8 mul\space}%
- \psframe[dimen=outer](! \@wd neg \@ht neg)(! \@wd \@ht)
- \psline(! \@wd neg 0.2 mul \@ht neg)(!\@wd 0.2 mul \@ht)
- \pnode(! \@wd neg 0){\optexp@nodeA}
- \pnode(! \@wd 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% SWITCH
-%
-\def\optswitch@iii{%
- \pst@Verb{%
- /@@x \POK@switch@size\space 0.5 mul def
- /@@y @@x def
- }%
- \pnode(! @@x neg 0){\optexp@nodeA}%
- \pnode(! @@x 0){\optexp@nodeB}%
- % storing the linewidth of the object allows for some aesthetic fine tuning
- \pstVerb{tx@Dict begin /@lw \getCLW def end}%
- % the fiber parts
- \bgroup
- \ifPOE@usefiberstyle
- \psset{style=Fiber}
- \fi
- \psline[arrows=-](! @@x neg 0)(! @@x -0.6 mul @lw sub 0)%
- \psline[arrows=-](! @@x 0.6 mul 0)(! @@x 0)%
- \egroup
- % different styles
- \ifx\POK@switch@style\POS@optexp@closed%
- %
- \bgroup
- \ifPOE@usefiberstyle
- \psset{style=Fiber}
- \fi
- \psdot[dotsize=3\pslinewidth](! @@x 0.6 mul 0)%
- \psdot[dotsize=3\pslinewidth](! @@x -0.6 mul 0)%
- \psline[arrows=-, linewidth=1.5\pslinewidth](! @@x -0.6 mul @lw)(! @@x 0.6 mul @lw)%
- \egroup
- \else
- \psline[arrows=-, linewidth=1.5\pslinewidth](! @@x -0.6 mul @lw add @lw)(! @@x 0.6 mul dup)%
- \pscircle(! @@x -0.6 mul 0){\pslinewidth}%
- \psdot[dotsize=3\pslinewidth](! @@x 0.6 mul 0)%
- \fi
- \psframe[dimen=outer](! @@x neg dup)(! @@x dup)%
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FIBER DELAY LINE
-%
-\def\fiberdelayline@iii{%
- \pst@Verb{%
- /@@x \POK@fdl@size\space 0.8 mul def
- /@@y \POK@fdl@size\space 0.5 mul def
- }%
- \psframe[dimen=outer](! @@x neg @@y neg)(! @@x @@y)
- \psline{->}(! @@x -0.3 mul @@y -1.5 mul)(! @@x 0.3 mul @@y 1.7 mul)
- \pnode(! @@x neg 0){\optexp@nodeA}
- \pnode(! @@x 0){\optexp@nodeB}
-\ignorespaces}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% COUPLER
-%
-\def\optcoupler@iii{%
- \edef\@sz{\POK@coupler@size\space}%
- \edef\@sep{\POK@coupler@sep\space 0.5 mul\space}%
- \ifx\POK@align\POS@optexp@top
- \pst@Verb{/@yshift \@sep neg def}%
- \else\ifx\POK@align\POS@optexp@bottom
- \pst@Verb{/@yshift \@sep def}%
- \else
- \pst@Verb{/@yshift 0 def}%
- \fi\fi
- \ifx\POK@coupler@type\POS@coupler@type@elliptic
- \psellipse[dimen=outer](!0 @yshift)(! \@sz \@sz 0.4 mul)
- \ifPOE@variable
- \psline[arrowinset=0]{->}(!\@sz -0.5 mul \@sz neg @yshift add)(!\@sz 0.5 mul \@sz @yshift add)
- \fi
- \pnode(! \@sz neg \getCLW 0.3 mul add @yshift \@sep add){tempNode@A@1}
- \pnode(! \@sz neg \getCLW 0.3 mul add @yshift \@sep sub){tempNode@A@2}
- \pnode(! \@sz \getCLW 0.3 mul sub @yshift \@sep add){tempNode@B@1}
- \pnode(! \@sz \getCLW 0.3 mul sub @yshift \@sep sub){tempNode@B@2}
- \pnode(! 0 @yshift){tempNode@Label}
- \else\ifx\POK@coupler@type\POS@coupler@type@none
- \pnode(! \@sz -0.5 mul @yshift \@sep add){tempNode@A@1}
- \pnode(! \@sz -0.5 mul @yshift \@sep sub){tempNode@A@2}
- \pnode(! \@sz 0.5 mul @yshift \@sep add){tempNode@B@1}
- \pnode(! \@sz 0.5 mul @yshift \@sep sub){tempNode@B@2}
- \psline[style=Fiber](tempNode@A@1)(tempNode@B@1)
- \psline[style=Fiber](tempNode@A@2)(tempNode@B@2)
- \fi\fi
-}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% WDM COUPLER
-%
-\def\wdmcoupler@ii{%
- \edef\@sz{\POK@coupler@size\space}%
- \edef\@sep{\POK@coupler@sep\space 0.5 mul\space}%
- \ifx\POK@align\POS@optexp@top
- \pst@Verb{/@yshift \@sep neg def}%
- \else\ifx\POK@align\POS@optexp@bottom
- \pst@Verb{/@yshift \@sep def}%
- \else
- \pst@Verb{/@yshift 0 def}%
- \fi\fi
- \ifx\POK@coupler@type\POS@coupler@type@elliptic
- \psellipse[dimen=outer](!0 @yshift)(! \@sz \@sz 0.4 mul)
- \pnode(! \@sz neg \getCLW 0.3 mul add @yshift \@sep add){tempNode@A@1}
- \pnode(! \@sz neg \getCLW 0.3 mul add @yshift \@sep sub){tempNode@A@2}
- \pnode(!0 @yshift){tempNode@Label}
- \pnode(! \@sz \getCLW 0.3 mul sub 0){tempNode@B@}
- \else\ifx\POK@coupler@type\POS@coupler@type@none
- \pnode(0,0){tempNode@A@1}
- \pnode(0,0){tempNode@A@2}
- \pnode(0,0){tempNode@B@}
- \pnode(0,0){tempNode@Label}
- \fi\fi
-}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% WDM SPLITTER
-%
-\def\wdmsplitter@ii{%
- \edef\@sz{\POK@coupler@size\space}%
- \edef\@sep{\POK@coupler@sep\space 0.5 mul\space}%
- %
- \ifx\POK@align\POS@optexp@top
- \pst@Verb{/@yshift \@sep neg def}%
- \else\ifx\POK@align\POS@optexp@bottom
- \pst@Verb{/@yshift \@sep def}%
- \else
- \pst@Verb{/@yshift 0 def}%
- \fi\fi
- \ifx\POK@coupler@type\POS@coupler@type@elliptic
- \psellipse[dimen=outer](! 0 @yshift)(! \@sz \@sz 0.4 mul)
- \pnode(! \@sz neg \getCLW 0.3 mul add 0){tempNode@A@}
- \pnode(! \@sz \getCLW 0.3 mul sub @yshift \@sep add){tempNode@B@1}
- \pnode(! \@sz \getCLW 0.3 mul sub @yshift \@sep sub){tempNode@B@2}
- \pnode(! 0 @yshift){tempNode@Label}
- \else\ifx\POK@coupler@type\POS@coupler@type@none
- \pnode(0,0){tempNode@A@}
- \pnode(0,0){tempNode@B@1}
- \pnode(0,0){tempNode@B@2}
- \pnode(0,0){tempNode@Label}
- \fi\fi
-}%
-%
-%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%
-% FIBER COLLIMATOR
-%
-\def\fibercollimator@v{%
- \def\@sz{\POK@fibercol@size\space 0.5 mul\space}%
- \pspolygon(! \@sz neg \getCLWH add \@sz neg)(!\@sz 0)(!\@sz neg \getCLWH add \@sz)
- \pnode(!\@sz neg 0){\optexp@nodeA}
- \pnode(!\@sz 0){\optexp@nodeB}
-}%
-%
-%
-\endinput
-%
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 b4662177d39..015c381ec49 100644
--- a/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
+++ b/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
@@ -1,15 +1,4113 @@
-\ProvidesPackage{pst-optexp}[2009/11/05 package wrapper for
-pst-optexp.tex]
+%%
+%% This is file `pst-optexp.sty',
+%% generated with the docstrip utility.
+%%
+%% The original source files were:
+%%
+%% pst-optexp.dtx (with options: `stylefile')
+%%
+%% This is a generated file.
+%%
+%% Project: pst-optexp
+%% Version: 3.0 (2012/07/09)
+%%
+%% Copyright (C) 2007-2012 by Christoph Bersch <usenet@bersch.net>
+%%
+%% This work may be distributed and/or modified under the
+%% conditions of the LaTeX Project Public License, either version 1.3c
+%% of this license or (at your option) any later version.
+%% The latest version of this license is in
+%% http://www.latex-project.org/lppl.txt
+%% and version 1.3c or later is part of all distributions of LaTeX
+%% version 2008/05/04 or later.
+%%
+%% This work has the LPPL maintenance status "maintained".
+%%
+%% The current maintainer of this work is Christoph Bersch.
+%%
+%% This work consists of the files pst-optexp.dtx and pst-optexp.ins
+%% and the derived files
+%% pst-optexp.sty, pst-optexp.pro.
+%%
+\NeedsTeXFormat{LaTeX2e}[1999/12/01]
+\ProvidesPackage{pst-optexp}
+ [2012/07/09 v3.0 Optical experimental setups with PSTricks]
\RequirePackage{pstricks}
\RequirePackage{pst-xkey}
\RequirePackage{pst-node}
\RequirePackage{pst-plot}
\RequirePackage{multido}
+\RequirePackage{pst-eucl}
\RequirePackage{pstricks-add}
-%
-%
-\input{pst-optexp.tex}
-\ProvidesFile{pst-optexp.tex}
- [\filedate\space v\fileversion\space `PST-optexp' (cb)]
-\IfFileExists{pst-optexp.pro}{\@addtofilelist{pst-optexp.pro}}{}%
+\RequirePackage{environ}
+\@addtofilelist{pst-optexp.pro}{}%
+\pst@addfams{optexp}
+\pstheader{pst-optexp.pro}
+\gdef\POE@complist{}%
+\gdef\POE@beamlist{1}%
+\g@addto@macro{\endpspicture}{%
+ \expandafter\XKV@for@n\expandafter{\POE@beamlist}\POE@temp{%
+ \POE@Verb{%
+ /lastBeamPointUp\POE@temp\space
+ /lastBeamPointLow\POE@temp\space
+ /lastBeamPoint\POE@temp\space
+ 3 { currentdict exch undef } repeat
+ /N@\oenodeBeam{\POE@temp}
+ /N@\oenodeBeamUp{\POE@temp}
+ /N@\oenodeBeamLow{\POE@temp}
+ 3 { tx@NodeDict exch undef } repeat
+ }%
+ }%
+ \gdef\POE@complist{}\gdef\POE@beamlist{1}\global\POE@cnt=0\relax
+}%
+\def\pst@optexpdict{tx@OptexpDict begin }
+\def\POE@dict#1{\pst@optexpdict #1 end}
+\SpecialCoor
+\newif\ifPOE@connjoin
+\newif\ifPOE@backlayer
+\newif\ifPOE@frontlayer
+\newif\ifPOE@optexpenv
+\newif\ifPOE@variable
+\newif\ifPOE@voltage
+\newif\ifPOE@caxisinv
+\newif\ifPOE@reverse
+\newif\ifPOE@lamp
+\newif\ifPOE@component@optional
+\newif\ifPOE@debug@showoptdots
+\newif\ifPOE@debug@showifcnodes
+\newif\ifPOE@endbox
+\newif\ifPOE@startbox
+\newif\ifPOE@thicklens
+\newif\ifPOE@usefiberstyle
+\newif\ifPOE@fiber@
+\newif\ifPOE@nofiber@
+\newif\ifPOE@fiberin@
+\newif\ifPOE@fiberin@top
+\newif\ifPOE@fiberin@bottom
+\newif\ifPOE@fiberout@
+\newif\ifPOE@fiberout@top
+\newif\ifPOE@fiberout@bottom
+\newif\ifPOE@fiberpreset@
+\newif\ifPOE@nofiberpreset@
+\newif\ifPOE@fiberpresetin@
+\newif\ifPOE@fiberpresetin@top
+\newif\ifPOE@fiberpresetin@bottom
+\newif\ifPOE@fiberpresetout@
+\newif\ifPOE@fiberpresetout@top
+\newif\ifPOE@fiberpresetout@bottom
+\newif\ifPOE@beam
+\newif\ifPOE@startinside
+\newif\ifPOE@stopinside
+\newif\ifPOE@beaminsidefirst
+\newif\ifPOE@beaminsidelast
+\newif\ifPOE@savebeam
+\newif\ifPOE@loadbeam
+\newif\ifPOE@beaminside
+\newif\ifPOE@raytrace
+\newif\ifPOE@pswarning
+\newif\ifPOE@useNA
+\newif\ifPOE@insideobj\POE@insideobjfalse
+\newcount\POE@cnt
+\newcount\POE@oldcnt
+\newcount\POE@nodecnt
+\newdimen\POE@dim
+\def\POE@str@pol@polperp{perp}
+\def\POE@str@pol@polparallel{parallel}
+\def\POE@str@pol@polmisc{misc}
+\def\POE@str@pol@polrcirc{rcirc}
+\def\POE@str@pol@pollcirc{lcirc}
+\def\POE@str@mirrortype@piezo{piezo}
+\def\POE@str@mirrortype@plain{plain}
+\def\POE@str@mirrortype@extended{extended}
+\def\POE@str@mirrortype@semitrans{semitrans}
+\def\POE@str@gratingtype@blazed{blazed}
+\def\POE@str@gratingtype@binary{binary}
+\def\POE@str@relative{relative}
+\def\POE@str@absolute{absolute}
+\def\POE@str@labelref@relgrav{relgrav}
+\def\POE@str@labelref@global{global}
+\def\POE@str@filtertype@bandpass{bandpass}
+\def\POE@str@filtertype@bandstop{bandstop}
+\def\POE@str@filtertype@lowpass{lowpass}
+\def\POE@str@filtertype@highpass{highpass}
+\def\POE@str@couplertype@none{none}
+\def\POE@str@couplertype@ellipse{ellipse}
+\def\POE@str@couplertype@elliptic{elliptic}
+\def\POE@str@couplertype@rectangle{rectangle}
+\def\POE@str@couplertype@cross{cross}
+\def\POE@str@polcontroltype@linear{linear}
+\def\POE@str@polcontroltype@triangle{triangle}
+\def\POE@str@top{top}
+\def\POE@str@bottom{bottom}
+\def\POE@str@center{center}
+\def\POE@str@closed{closed}
+\def\POE@str@opened{opened}
+\def\POE@str@dettype@round{round}
+\def\POE@str@dettype@diode{diode}
+\def\POE@str@bsstyle@cube{cube}
+\def\POE@str@bsstyle@plate{plate}
+\def\POE@str@auto{auto}
+\def\POE@str@center{center}
+\def\POE@str@verbose{verbose}
+\def\POE@str@quiet{quiet}
+\def\POE@Verb#1{\pst@Verb{\pst@optexpdict #1 end }}%
+\newpsstyle{OptComp}{}%
+\define@key[psset]{optexp}{newOptComp}{%
+ \newpsstyle{OptComp}{#1}%
+}
+\define@key[psset]{optexp}{addtoOptComp}{%
+ \addtopsstyle{OptComp}{#1}%
+}
+\newpsstyle{OptionalStyle}{linestyle=dashed,dash=1.5pt 1pt}%
+\newpsstyle{IfcNodeStyle}{dotstyle=x, dotscale=1.5, linecolor=blue}%
+\newpsstyle{Beam}{linecolor=green!90!black, linejoin=1}%
+\define@key[psset]{optexp}{newBeam}{%
+ \newpsstyle{Beam}{#1}%
+}
+\define@key[psset]{optexp}{addtoBeam}{%
+ \addtopsstyle{Beam}{#1}%
+}
+\newpsstyle{Fiber}{}%
+\define@key[psset]{optexp}{newFiber}{%
+ \newpsstyle{Fiber}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiber}{%
+ \addtopsstyle{Fiber}{#1}%
+}
+\newpsstyle{FiberIn}{style=Fiber}%
+\define@key[psset]{optexp}{newFiberIn}{%
+ \newpsstyle{FiberIn}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberIn}{%
+ \addtopsstyle{FiberIn}{#1}%
+}
+\newpsstyle{FiberOut}{style=Fiber}%
+\define@key[psset]{optexp}{newFiberOut}{%
+ \newpsstyle{FiberOut}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberOut}{%
+ \addtopsstyle{FiberOut}{#1}%
+}
+\newpsstyle{FiberIn1}{style=FiberIn}%
+\define@key[psset]{optexp}{newFiberIn1}{%
+ \newpsstyle{FiberIn1}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberIn1}{%
+ \addtopsstyle{FiberIn1}{#1}%
+}
+\newpsstyle{FiberIn2}{style=FiberIn}%
+\define@key[psset]{optexp}{newFiberIn2}{%
+ \newpsstyle{FiberIn2}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberIn2}{%
+ \addtopsstyle{FiberIn2}{#1}%
+}
+\newpsstyle{FiberOut1}{style=FiberOut}%
+\define@key[psset]{optexp}{newFiberOut1}{%
+ \newpsstyle{FiberOut1}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberOut1}{%
+ \addtopsstyle{FiberOut1}{#1}%
+}
+\newpsstyle{FiberOut2}{style=FiberOut}%
+\define@key[psset]{optexp}{newFiberOut2}{%
+ \newpsstyle{FiberOut2}{#1}%
+}
+\define@key[psset]{optexp}{addtoFiberOut2}{%
+ \addtopsstyle{FiberOut2}{#1}%
+}
+\newpsstyle{ExtendedMirror}{%
+ linestyle=none, hatchwidth=0.5\pslinewidth,
+ hatchsep=1.4\pslinewidth, fillstyle=hlines
+}%
+\newpsstyle{VariableStyle}{%
+ linewidth=0.8\pslinewidth, arrowinset=0, arrowscale=0.8, arrows=<->
+}
+\newpsstyle{SemitransMirror}{linestyle=none, fillstyle=solid,fillcolor=black!30}%
+\newpsstyle{PiezoMirror}{fillstyle=solid,fillcolor=black!30}%
+\newpsstyle{IsolatorArrow}{linewidth=2\pslinewidth, arrowinset=0}
+\newpsstyle{CrystalCaxis}{%
+ linestyle=dashed, dash=2pt 2pt, linewidth=0.7\pslinewidth,
+ arrowinset=0, arrows=->
+}
+\newpsstyle{CrystalLamp}{linewidth=0.6\pslinewidth}
+\newpsstyle{FdlArrow}{arrowinset=0, arrows=->}
+\newpsstyle{VariableCoupler}{arrowinset=0, arrows=->}
+\define@boolkey[psset]{optexp}[POE@component@]{optional}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{usefiberstyle}[true]{}
+\define@boolkey[psset]{optexp}[POE@debug@]{showoptdots}[true]{}
+\define@boolkey[psset]{optexp}[POE@debug@]{showifcnodes}[true]{}
+\define@choicekey*+[psset]{optexp}{position}[\val\nr]{start,end}{%
+ \ifcase\nr\relax
+ \psset[optexp]{startbox, endbox=false}%
+ \or
+ \psset[optexp]{startbox=false, endbox=true}%
+ \fi
+}{\edef\POE@key@position{#1}}%
+\define@choicekey*+[psset]{optexp}{abspos}[\val\nr]{start,end}{%
+ \ifcase\nr\relax
+ \psset[optexp]{startbox, endbox=false}%
+ \or
+ \psset[optexp]{startbox=false, endbox=true}%
+ \fi
+}{\edef\POE@key@abspos{#1}}%
+\define@key[psset]{optexp}{compshift}{%
+ \pst@checknum{#1}\POE@key@compshift
+}
+\define@key[psset]{optexp}{angle}{%
+ \pst@checknum{#1}\POE@key@angle
+}
+\psset[optexp]{%
+ position={},
+ abspos={},
+ compshift=0,
+ angle=0
+}%
+\define@boolkey[psset]{optexp}[POE@]{backlayer}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{frontlayer}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{optexpenv}[true]{}
+\psset[optexp]{backlayer, frontlayer}%
+\define@key[psset]{optexp}{labelangle}{%
+ \pst@checknum{#1}\POE@key@labelangle
+}
+\define@key[psset]{optexp}{labeloffset}{%
+ \pst@checknum{#1}\POE@key@labeloffset
+}
+\define@key[psset]{optexp}{labelstyle}{%
+ \def\POE@key@labelstyle{#1}%
+}
+\define@key[psset]{optexp}{labelalign}{%
+ \def\POE@key@labelalign{#1}%
+}
+\define@key[psset]{optexp}{labelref}{%
+ \edef\POE@key@labelref{#1}%
+}
+\define@choicekey*+[psset]{optexp}{innerlabel}%
+ [\val\nr]{true}[true]%
+ {\ifcase\nr\relax
+ \psset[optexp]{labeloffset=0, labelref=relative}%
+ \fi}
+ {\PackageError{pst-optexp}{Unknown value '\val' for innerlabel}}%
+\define@key[psset]{optexp}{label}{%
+ \pst@expandafter\POE@psset@@label{#1} {} {} {} {} {}\@nil
+}%
+\def\POE@psset@@label#1 #2 #3 #4 #5\@nil{%
+ \edef\POE@temp{#4}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{labelref=#4}%
+ \fi
+ \fi
+ \edef\POE@temp{#3}
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{labelalign=#3}%
+ \fi
+ \fi
+ \edef\POE@temp{#2}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{labelangle=#2}%
+ \fi
+ \fi
+ \edef\POE@temp{#1}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{labeloffset=#1}%
+ \fi
+ \fi
+}%
+\define@key[psset]{optexp}{ref@angle}{%
+ \pst@checknum{#1}\POE@key@labelrefangle
+}%
+\psset[optexp]{%
+ labeloffset=0.8,
+ labelangle=0,
+ labelstyle=,
+ labelalign=c,
+ labelref=relgrav,
+ ref@angle=0
+}%
+\define@choicekey+[psset]{optexp}{extnodealign}%
+ [\val\nr]{rel,abs,relative,absolute}%
+ {%
+ \ifcase\nr\relax
+ \let\POE@key@extnodealign\POE@str@relative
+ \or
+ \let\POE@key@extnodealign\POE@str@absolute
+ \else
+ \def\POE@key@extnodealign{#1}%
+ \fi
+ }%
+ {\PackageError{pst-optexp}{Unknown value '\val' for extnodealign.}}
+\define@key[psset]{optexp}{extnode}{%
+ \edef\POE@key@extnode{#1}%
+ \ifx\@empty\POE@key@extnode\else
+ \pst@expandafter\POE@psset@@extnode{#1}\@empty,,\@nil
+ \fi
+}%
+\def\POE@key@extnode@xref{0}%
+\def\POE@key@extnode@yref{0}%
+\def\POE@psset@@extnode#1#2,#3,#4\@nil{%
+ \def\POE@key@extnode@xref{0}%
+ \def\POE@key@extnode@yref{0}%
+ \ifx\@empty#3\@empty
+ \@nameuse{POE@getref@#1}%
+ \@nameuse{POE@getref@#2}%
+ \else
+ \pst@checknum{#1#2}\POE@key@extnode@xref%
+ \pst@checknum{#3}\POE@key@extnode@yref%
+ \fi
+}%
+\def\POE@getref@c{}%
+\def\POE@getref@t{\def\POE@key@extnode@yref{1}}%
+\def\POE@getref@b{\def\POE@key@extnode@yref{-1}}%
+\def\POE@getref@l{\def\POE@key@extnode@xref{-1}}%
+\def\POE@getref@r{\def\POE@key@extnode@xref{1}}%
+\psset[optexp]{%
+ extnode=\@empty,
+ extnodealign=abs
+}%
+\define@key[psset]{optexp}{rotateref}{%
+ \def\POE@temp{#1}%
+ \ifx\@empty\POE@temp\else
+ \pst@expandafter\POE@psset@@rotateref{#1}\@empty,,\@nil
+ \fi
+}%
+\def\POE@key@rotate@xref{0}%
+\def\POE@key@rotate@yref{0}%
+\def\POE@psset@@rotateref#1#2,#3,#4\@nil{%
+ \def\POE@key@rotate@xref{0}%
+ \def\POE@key@rotate@yref{0}%
+ \ifx\@empty#3\@empty
+ \@nameuse{POE@getref@rotate@#1}%
+ \@nameuse{POE@getref@rotate@#2}%
+ \else
+ \pst@checknum{#1#2}\POE@key@rotate@xref%
+ \pst@checknum{#3}\POE@key@rotate@yref%
+ \fi}%
+\def\POE@getref@rotate@c{}%
+\def\POE@getref@rotate@t{\def\POE@key@rotate@yref{1}}%
+\def\POE@getref@rotate@b{\def\POE@key@rotate@yref{-1}}%
+\def\POE@getref@rotate@l{\def\POE@key@rotate@xref{-1}}%
+\def\POE@getref@rotate@r{\def\POE@key@rotate@xref{1}}%
+\psset[optexp]{rotateref=c}%
+\define@choicekey*[psset]{optexp}{namingscheme}%
+ [\val\nr]{old,new}[new]{%
+ \ifcase\nr\relax
+ \edef\POE@str@basicname@default{tempNode}
+ \edef\POE@str@basicname@prefix{}
+ \gdef\POE@str@basicname@sep{Intern}
+ \edef\POE@str@extnode@postfix{ExtNode}
+ \or
+ \edef\POE@str@basicname@default{@}
+ \edef\POE@str@basicname@prefix{OE@}
+ \gdef\POE@str@basicname@sep{}
+ \edef\POE@str@extnode@postfix{Ext}
+ \fi
+}%
+\psset[optexp]{namingscheme=new}%
+\define@key[psset]{optexp}{b@sicname}{%
+ \edef\POE@key@b@sicname{\POE@str@basicname@prefix#1}%
+}%
+\define@key[psset]{optexp}{compname}{%
+ \ifPOE@insideobj\else
+ \PackageError{pst-optexp}{compname allowed only inside an object}
+ \fi
+ \edef\POE@temp{#1}%
+ \ifx\POE@temp\@empty
+ \edef\POE@key@compname{\the\POE@cnt}%
+ \else
+ \edef\POE@key@compname{#1}%
+ \fi
+ \@expandtwoargs\in@{,\POE@key@compname,}{,\POE@complist,}%
+ \ifin@
+ \PackageWarning{pst-optexp}{%
+ ^^Jcompname '\POE@key@compname' already used,\MessageBreak
+ previous nodes will be overwritten!^^J
+ }%
+ \else
+ \xdef\POE@complist{%
+ \POE@key@compname\ifx\POE@complist\@empty\else,\fi\POE@complist
+ }%
+ \fi
+}%
+\POE@insideobjtrue
+\psset[optexp]{compname=\@empty}
+\POE@insideobjfalse
+\define@boolkey[psset]{optexp}[POE@]{pswarning}[true]{}
+\psset[optexp]{pswarning=false}%
+\define@key[psset]{optexp}{lensheight}{%
+ \pst@checknum{#1}\POE@key@lensheight
+}
+\define@key[psset]{optexp}{lenswidth}{%
+ \pst@checknum{#1}\POE@key@lenswidth
+ \ifdim\POE@key@lenswidth pt > 0pt
+ \psset[optexp]{thicklens=true}
+ \fi
+}
+\define@key[psset]{optexp}{lensradiusleft}{%
+ \pst@checknum{#1}\POE@key@lensradiusleft
+}
+\define@key[psset]{optexp}{lensradiusright}{%
+ \pst@checknum{#1}\POE@key@lensradiusright
+}
+\define@boolkey[psset]{optexp}[POE@]{thicklens}[true]{}
+\define@key[psset]{optexp}{lensradius}{%
+ \pst@expandafter\POE@psset@@lensradius{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@lensradius#1 #2 #3\@nil{%
+ \edef\POE@temp{#1}%
+ \ifx\POE@temp\@empty\else
+ \psset[optexp]{lensradiusleft=#1}%
+ \fi
+ \edef\POE@temp{#2}%
+ \ifx\POE@temp\@empty
+ \psset[optexp]{lensradiusright=#1}%
+ \else
+ \psset[optexp]{lensradiusright=#2}%
+ \fi
+}%
+\define@key[psset]{optexp}{lens}{%
+ \pst@expandafter\POE@psset@@lens{#1} {} {} {} {} {}\@nil
+}%
+\def\POE@psset@@lens#1 #2 #3 #4 #5\@nil{%
+ \edef\POE@temp{#4}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{lenswidth=#4}%
+ \fi
+ \fi
+ \edef\POE@temp{#3}%
+ \ifx\POE@temp\@empty\else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{lensheight=#3}
+ \fi
+ \fi
+ \edef\POE@temp{#2}%
+ \ifx\POE@temp\@empty
+ \psset[optexp]{lensradiusright=#1}%
+ \else
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{lensradiusright=#2}%
+ \fi
+ \fi
+ \edef\POE@temp{#1}%
+ \expandafter\ifx\POE@temp.\else
+ \psset[optexp]{lensradiusleft=#1}%
+ \fi
+}%
+\psset[optexp]{%
+ lenswidth=0,
+ lensheight=1,
+ lensradiusleft=1,
+ lensradiusright=1
+}%
+\define@key[psset]{optexp}{innerheight}{%
+ \pst@checknum{#1}\POE@key@innerheight
+}
+\define@key[psset]{optexp}{outerheight}{%
+ \pst@checknum{#1}\POE@key@outerheight
+}
+\define@key[psset]{optexp}{phlinewidth}{%
+ \edef\POE@key@phlinewidth{#1}%
+}
+\define@key[psset]{optexp}{phwidth}{%
+ \edef\POE@key@phwidth{#1}%
+}
+\psset[optexp]{%
+ phlinewidth=2\pslinewidth,
+ phwidth=0,
+ outerheight=1,
+ innerheight=0.1
+}%
+\define@key[psset]{optexp}{crystalwidth}{%
+ \pst@checknum{#1}\POE@key@crystalwidth
+}
+\define@key[psset]{optexp}{crystalheight}{%
+ \pst@checknum{#1}\POE@key@crystalheight
+}
+\define@key[psset]{optexp}{crystalsize}{%
+ \pst@expandafter\POE@psset@@crystalsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@crystalsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \PackageWarning{pst-optexp}{%
+ Parameter 'crystalsize' requires two numbers}%
+ \fi
+ \psset[optexp]{crystalwidth=#1}%
+ \psset[optexp]{crystalheight=#2}%
+}%
+\define@key[psset]{optexp}{caxislength}{%
+ \pst@checknum{#1}\POE@key@caxislength
+}
+\define@boolkey[psset]{optexp}[POE@]{voltage}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{caxisinv}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{lamp}[true]{}
+\define@key[psset]{optexp}{lampscale}{%
+ \pst@checknum{#1}\POE@key@lampscale
+ \pst@divide{\POE@key@lampscale pt}{0.3pt}{\POE@key@lampscale}
+ \addtopsstyle{CrystalLamp}{unit=\POE@key@lampscale}
+ \PackageWarning{pst-optexp}{%
+ Parameter 'lampscale' is deprecated, \MessageBreak
+ use style 'CrystalLamp' instead.}%
+}
+\psset[optexp]{%
+ crystalwidth=1.4,
+ crystalheight=0.6,
+ caxislength=0.3
+}%
+\define@key[psset]{optexp}{optboxwidth}{%
+ \pst@checknum{#1}\POE@key@optboxwidth
+}
+\define@key[psset]{optexp}{optboxheight}{%
+ \pst@checknum{#1}\POE@key@optboxheight
+}
+\define@key[psset]{optexp}{optboxsize}{%
+ \pst@expandafter\POE@psset@@optboxsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@optboxsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optboxsize' requires two numbers}%
+ \fi
+ \psset[optexp]{optboxwidth=#1, optboxheight=#2}%
+}%
+\define@boolkey[psset]{optexp}[POE@]{endbox}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{startbox}[true]{}
+\psset[optexp]{%
+ optboxwidth=1.4,
+ optboxheight=0.8
+}%
+\define@key[psset]{optexp}{platelinewidth}{%
+ \edef\POE@key@platelinewidth{#1}%
+}
+\define@key[psset]{optexp}{plateheight}{%
+ \pst@checknum{#1}\POE@key@plateheight
+}
+\psset[optexp]{%
+ plateheight=1,
+ platelinewidth=2\pslinewidth
+}%
+\define@key[psset]{optexp}{platewidth}{%
+ \pst@checknum{#1}\POE@key@platewidth
+}
+\define@key[psset]{optexp}{platesize}{%
+ \pst@expandafter\POE@psset@@platesize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@platesize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \PackageWarning{pst-optexp}{%
+ Parameter 'platesize' requires two numbers}%
+ \fi
+ \psset[optexp]{platewidth=#1, plateheight=#2}%
+}%
+\psset[optexp]{platewidth=0.1}%
+\define@key[psset]{optexp}{detsize}{%
+ \pst@expandafter\POE@psset@@detsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@detsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@detsize
+ \else
+ \let\POE@key@detsize\@empty
+ \pst@checknum{#1}\POE@key@detwidth
+ \pst@checknum{#2}\POE@key@detheight
+ \fi
+}%
+\define@choicekey*+[psset]{optexp}{dettype}[\val\nr]{round,diode}%
+ {\edef\POE@key@dettype{\val}}
+ {\PackageError{pst-optexp}{Unknown value '\val' for dettype.}}
+\newpsstyle{DetectorStyle}{}
+\psset[optexp]{%
+ detsize=0.8,
+ dettype=round
+}%
+\define@key[psset]{optexp}{polsize}{%
+ \pst@checknum{#1}\POE@key@polsize
+}
+\define@key[psset]{optexp}{pollinewidth}{%
+ \edef\POE@key@pollinewidth{#1}%
+ \PackageWarning{pst-optexp}{%
+ Parameter 'pollinewidth' is deprecated, \MessageBreak
+ use style 'Polarization'.}%
+}%
+\def\POE@key@pollinewidth{0.7\pslinewidth}%
+\newpsstyle{Polarization}{%
+ linewidth=\POE@key@pollinewidth,
+ arrowscale=0.8, dotsize=3\pslinewidth}
+\define@choicekey+[psset]{optexp}{poltype}%
+ [\val\nr]{parallel,misc,perp,rcirc,lcirc}%
+ {\edef\POE@key@poltype{#1}}
+ {\PackageError{pst-optexp}{Unknown value '\val' for poltype.}%
+}
+\psset[optexp]{%
+ poltype=parallel,
+ polsize=0.6
+}%
+\define@key[psset]{optexp}{optdiodesize}{%
+ \pst@checknum{#1}\POE@key@optdiodesize
+}
+\psset[optexp]{optdiodesize=0.8}%
+\define@key[psset]{optexp}{doveprismsize}{%
+ \pst@expandafter\POE@psset@@doveprismsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@doveprismsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@doveprismheight
+ \pstFPmul\POE@key@doveprismwidth{3}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@doveprismwidth
+ \pst@checknum{#2}\POE@key@doveprismheight
+ \fi
+}%
+\psset[optexp]{doveprismsize=0.6}%
+\define@key[psset]{optexp}{bssize}{%
+ \pst@checknum{#1}\POE@key@bssize
+}
+\define@key[psset]{optexp}{bsstyle}{%
+ \edef\POE@key@bsstyle{#1}%
+}
+\psset[optexp]{%
+ bssize=0.8,
+ bsstyle=cube
+}%
+\define@key[psset]{optexp}{mirrorwidth}{%
+ \pst@checknum{#1}\POE@key@mirrorwidth
+}
+\define@key[psset]{optexp}{mirrorlinewidth}{%
+ \edef\POE@key@mirrorlinewidth{#1}%
+}
+\define@choicekey*[psset]{optexp}{mirrortype}%
+ [\val\nr]{piezo,extended,plain,semitrans}{%
+ \edef\POE@key@mirrortype{#1}%
+}
+\define@key[psset]{optexp}{mirrordepth}{%
+ \pst@checknum{#1}\POE@key@mirrordepth
+}
+\define@key[psset]{optexp}{mirrorradius}{%
+ \pst@checknum{#1}\POE@key@mirrorradius
+}
+\define@boolkey[psset]{optexp}[POE@]{variable}[true]{}
+\psset[optexp]{%
+ mirrorwidth=1,
+ mirrordepth=0.15,
+ mirrorradius=0,
+ mirrortype=plain,
+ mirrorlinewidth=2\pslinewidth
+}%
+\define@key[psset]{optexp}{optgridcount}{%
+ \pst@checknum{#1}\POE@key@gratingcount
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridcount' is deprecated,\MessageBreak
+ use 'gratingcount' instead.}%
+}%
+\define@key[psset]{optexp}{optgridwidth}{%
+ \pst@checknum{#1}\POE@key@gratingwidth
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridwidth' is deprecated,\MessageBreak
+ use 'gratingwidth' instead.}%
+}%
+\define@key[psset]{optexp}{optgridheight}{%
+ \pst@checknum{#1}\POE@key@gratingheight
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridheight' is deprecated,\MessageBreak
+ use 'gratingheight' instead.}%
+}%
+\define@choicekey*[psset]{optexp}{optgridtype}%
+ [\val\nr]{binary,blazed}{%
+ \edef\POE@key@gratingtype{#1}%
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridtype' is deprecated,\MessageBreak
+ use 'gratingtype' instead.}%
+}%
+\define@key[psset]{optexp}{optgriddepth}{%
+ \pst@checknum{#1}\POE@key@gratingdepth
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgriddepth' is deprecated,\MessageBreak
+ use 'gratingdepth' instead.}%
+}%
+\define@key[psset]{optexp}{optgridlinewidth}{%
+ \edef\POE@key@gratinglinewidth{#1}%
+ \PackageWarning{pst-optexp}{%
+ Parameter 'optgridlinewidth' is deprecated,\MessageBreak
+ use 'gratinglinewidth' instead.}%
+}%
+\define@key[psset]{optexp}{gratingcount}{%
+ \pst@checknum{#1}\POE@key@gratingcount
+}
+\define@key[psset]{optexp}{gratingwidth}{%
+ \pst@checknum{#1}\POE@key@gratingwidth
+}
+\define@key[psset]{optexp}{gratingheight}{%
+ \pst@checknum{#1}\POE@key@gratingheight
+}
+\define@choicekey*[psset]{optexp}{gratingtype}%
+ [\val\nr]{binary,blazed}{%
+ \edef\POE@key@gratingtype{#1}%
+}
+\define@key[psset]{optexp}{gratingdepth}{%
+ \pst@checknum{#1}\POE@key@gratingdepth
+}
+\define@key[psset]{optexp}{gratinglinewidth}{%
+ \edef\POE@key@gratinglinewidth{#1}%
+}
+\define@boolkey[psset]{optexp}[POE@]{reverse}[true]{}
+\psset[optexp]{%
+ gratingcount=10,
+ gratingwidth=1,
+ gratingheight=0.15,
+ gratingdepth=0.075,
+ gratingtype=blazed,
+ gratinglinewidth=0.7\pslinewidth,
+}%
+\define@key[psset]{optexp}{pentaprismsize}{%
+ \pst@checknum{#1}\POE@key@pentaprismsize
+}
+\psset[optexp]{pentaprismsize=0.7}
+\define@key[psset]{optexp}{raprismsize}{%
+ \pst@checknum{#1}\POE@key@raprismsize
+}
+\psset[optexp]{raprismsize=1.5}
+\define@key[psset]{optexp}{prismsize}{%
+ \pst@checknum{#1}\POE@key@prismsize
+}
+\define@key[psset]{optexp}{prismangle}{%
+ \pst@checknum{#1}\POE@key@prismangle
+}
+\define@choicekey+[psset]{optexp}{prismalign}[\val\nr]%
+ {auto,center}%
+ {\def\POE@key@prismalign{#1}}%
+ {\PackageError{pst-optexp}{Unknown value '\val' for prismalign.}}%
+\psset[optexp]{%
+ prismsize=1,
+ prismangle=60,
+ prismalign=auto
+}%
+\define@key[psset]{optexp}{fiberloops}{%
+ \pst@checknum{#1}\POE@key@fiberloops
+}
+\define@key[psset]{optexp}{fiberloopradius}{%
+ \pst@checknum{#1}\POE@key@fiberloopradius
+}
+\define@key[psset]{optexp}{fiberloopsep}{%
+ \pst@checknum{#1}\POE@key@fiberloopsep
+}
+\psset[optexp]{%
+ fiberloops=3,
+ fiberloopradius=0.4,
+ fiberloopsep=0.3
+}%
+\define@key[psset]{optexp}{filtersize}{%
+ \pst@checknum{#1}\POE@key@filtersize
+}
+\define@choicekey+[psset]{optexp}{filtertype}[\val\nr]%
+ {bandstop,bandpass,lowpass,highpass}%
+ {\def\POE@key@filtertype{#1}}%
+ {\PackageError{pst-optexp}{Unknown value '\val' for filtertype}}
+\newpsstyle{FilterStyle}{}
+\psset[optexp]{%
+ filtersize=0.8,
+ filtertype=bandpass
+}%
+\define@key[psset]{optexp}{polcontrolsize}{%
+ \pst@checknum{#1}\POE@key@polcontrolsize
+}
+\define@choicekey+[psset]{optexp}{polcontroltype}[\val\nr]%
+ {linear,triangle}%
+ {\def\POE@key@polcontroltype{#1}}%
+ {\PackageError{pst-optexp}{Unknown polcontroltype '\val'}}
+\psset[optexp]{%
+ polcontrolsize=0.15,
+ polcontroltype=linear
+}%
+\define@key[psset]{optexp}{optampsize}{%
+ \pst@expandafter\POE@psset@@optampsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@optampsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@optampheight
+ \pstFPmul\POE@key@optampwidth{0.866}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@optampwidth
+ \pst@checknum{#2}\POE@key@optampheight
+ \fi
+}%
+\psset[optexp]{optampsize=0.8}
+\define@key[psset]{optexp}{optmzmsize}{%
+ \pst@expandafter\POE@psset@@optmzmsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@optmzmsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@optmzmheight
+ \pstFPmul\POE@key@optmzmwidth{1.6}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@optmzmwidth
+ \pst@checknum{#2}\POE@key@optmzmheight
+ \fi
+}%
+\psset[optexp]{optmzmsize=0.8}
+\define@key[psset]{optexp}{isolatorsize}{%
+ \pst@expandafter\POE@psset@@isolatorsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@isolatorsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@isolatorheight
+ \pstFPmul\POE@key@isolatorwidth{1.6}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@isolatorwidth
+ \pst@checknum{#2}\POE@key@isolatorheight
+ \fi
+}%
+\psset[optexp]{isolatorsize=0.6}%
+\define@key[psset]{optexp}{fiberpolsize}{%
+ \pst@expandafter\POE@psset@@fiberpolsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@fiberpolsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@fiberpolheight
+ \pstFPmul\POE@key@fiberpolwidth{1.6}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@fiberpolwidth
+ \pst@checknum{#2}\POE@key@fiberpolheight
+ \fi
+}%
+\psset[optexp]{fiberpolsize=0.6}%
+\define@key[psset]{optexp}{switchsize}{%
+ \pst@checknum{#1}\POE@key@switchsize
+}
+\define@choicekey+[psset]{optexp}{switchstyle}%
+ [\val\nr]{opened,closed}%
+ {\edef\POE@key@switchstyle{#1}}%
+ {\PackageError{pst-optexp}{Unknown value '\val' for switchstyle.}}
+\psset[optexp]{%
+ switchsize=0.8,
+ switchstyle=opened
+}%
+\define@key[psset]{optexp}{fdlsize}{%
+ \pst@expandafter\POE@psset@@fdlsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@fdlsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@fdlheight
+ \pstFPmul\POE@key@fdlwidth{1.6}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@fdlwidth
+ \pst@checknum{#2}\POE@key@fdlheight
+ \fi
+}%
+\psset[optexp]{fdlsize=0.6}%
+\define@key[psset]{optexp}{fibercolsize}{%
+ \pst@expandafter\POE@psset@@fibercolsize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@fibercolsize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pst@checknum{#1}\POE@key@fibercolheight
+ \pstFPmul\POE@key@fibercolwidth{0.866}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@fibercolwidth
+ \pst@checknum{#2}\POE@key@fibercolheight
+ \fi
+}%
+\psset[optexp]{fibercolsize=0.3}%
+\define@key[psset]{optexp}{optcircsize}{%
+ \pst@checknum{#1}\POE@key@optcircsize
+}%
+\define@key[psset]{optexp}{optcircangleA}{%
+ \pst@checknum{#1}\POE@key@optcircangleA
+}%
+\define@key[psset]{optexp}{optcircangleB}{%
+ \pst@checknum{#1}\POE@key@optcircangleB
+}%
+\define@key[psset]{optexp}{optcircangle}{%
+ \pst@expandafter\POE@psset@@optcircangle{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@optcircangle#1 #2 #3\@nil{%
+ \edef\POE@tempA{#1}%
+ \edef\POE@tempB{#2}%
+ \ifx\\#2\\
+ \PackageError{pst-optexp}{optcircangle requires two numbers}%
+ \else\ifx\\#1\\
+ \PackageError{pst-optexp}{optcircangle requires two numbers}%
+ \else
+ \psset[optexp]{optcircangleA=#1, optcircangleB=#2}%
+ \fi\fi
+}%
+\psset[optexp]{%
+ optcircsize=0.8,
+ optcircangle=-160 -20
+}%
+\newpsstyle{OptCircArrow}{unit=0.7, arrows=->, arrowinset=0}
+\define@key[psset]{optexp}{couplersize}{%
+ \pst@expandafter\POE@psset@@couplersize{#1} {} {} {}\@nil
+}%
+\def\POE@psset@@couplersize#1 #2 #3\@nil{%
+ \ifx\\#2\\
+ \pstFPmul\POE@key@couplerheight{0.8}{#1}
+ \pstFPmul\POE@key@couplerwidth{2}{#1}
+ \else
+ \pst@checknum{#1}\POE@key@couplerwidth
+ \pst@checknum{#2}\POE@key@couplerheight
+ \fi
+}%
+\define@key[psset]{optexp}{couplersep}{%
+ \pst@checknum{#1}\POE@key@couplersep
+}
+\define@choicekey+[psset]{optexp}{couplertype}%
+ [\val\nr]{none,elliptic,ellipse,cross,rectangle}%
+ {%
+ \edef\POE@key@couplertype{#1}
+ \ifx\POE@key@couplertype\POE@str@couplertype@elliptic
+ \let\POE@key@couplertype\POE@str@couplertype@ellipse
+ \fi
+ }%
+ {\PackageError{pst-optexp}{Unknown value '\val' for couplertype.}}
+\define@key[psset]{optexp}{align}{%
+ \psset[optexp]{coupleralign=#1}%
+ \PackageWarning{pst-optexp}{%
+ Parameter 'align' is deprecated,\MessageBreak
+ use 'coupleralign' instead.}%
+}
+\define@choicekey+[psset]{optexp}{coupleralign}%
+ [\val\nr]{t,b,c,top,bottom,center}%
+ {%
+ \ifcase\nr\relax
+ \let\POE@key@coupleralign\POE@str@top
+ \or
+ \let\POE@key@coupleralign\POE@str@bottom
+ \or
+ \let\POE@key@coupleralign\POE@str@center
+ \else
+ \def\POE@key@coupleralign{#1}%
+ \fi}%
+ {\PackageError{pst-optexp}{Unknown value '\val' for coupleralign.}}
+\psset[optexp]{%
+ couplersize=0.2,
+ couplersep=0.05,
+ coupleralign=center,
+ couplertype=elliptic
+}%
+\define@boolkey[psset]{optexp}[POE@]{beam}[true]{}
+\define@key[psset]{optexp}{refractiveindex}{%
+ \psset[optexp]{n=#1}%
+ \PackageWarning{pst-optexp}{%
+ Option 'refractiveindex' is deprecated,\MessageBreak
+ use 'n' instead}%
+}%
+\define@key[psset]{optexp}{n}{%
+ \POE@parsealg{n}#1\@nil
+}
+\def\POE@parsealg#1#2#3\@nil{%
+ \ifx#2*\relax
+ \POE@@parsealg#3\@nil
+ \expandafter\let\csname POE@key@#1\endcsname\POE@tempA
+ \else
+ \@namedef{POE@key@#1}{[#2#3] }%
+ \fi
+}
+\def\POE@@parsealg#1#2\@nil{%
+ \edef\POE@tempA{tx@Dict begin (#1#2) AlgParser end }%
+}
+\define@key[psset]{optexp}{beamangle}{%
+ \edef\POE@key@beamangle{#1}%
+}%
+\define@key[psset]{optexp}{beampos}{%
+ \edef\POE@key@beampos{#1}%
+}%
+\define@key[psset]{optexp}{beamdiv}{%
+ \edef\POE@key@beamdiv{#1}%
+}%
+\define@key[psset]{optexp}{beamwidth}{%
+ \edef\POE@key@beamwidth{#1}%
+}%
+\define@boolkey[psset]{optexp}[POE@]{startinside}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{stopinside}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{beaminsidefirst}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{beaminsidelast}[true]{}%
+\define@choicekey+[psset]{optexp}{savebeampoints}%
+ [\val\nr]{true,false}[true]{%
+ \ifcase\nr\relax
+ \def\POE@key@savebeampoints{1}
+ \or
+ \def\POE@key@savebeampoints{0}
+ \fi
+ }{%
+ \ifnum9<1#1
+ \def\POE@key@savebeampoints{#1}
+ \else
+ \PackageError{pst-optexp}%
+ {savebeampoints must be a positive integer or 0.}%
+ \fi
+ \@expandtwoargs\in@{,\POE@key@savebeampoints,}{,\POE@beamlist,}%
+ \ifin@\else
+ \xdef\POE@beamlist{%
+ \POE@key@savebeampoints
+ \ifx\POE@beamlist\@empty\else,\fi\POE@beamlist
+ }%
+ \fi
+}%
+\define@choicekey+[psset]{optexp}{loadbeampoints}%
+ [\val\nr]{true,false}[true]{%
+ \ifcase\nr\relax
+ \def\POE@key@loadbeampoints{1}
+ \or
+ \def\POE@key@loadbeampoints{0}
+ \fi
+ }{%
+ \ifnum9<1#1
+ \def\POE@key@loadbeampoints{#1}%
+ \else
+ \PackageError{pst-optexp}%
+ {loadbeampoints must be a positive integer or 0.}%
+ \fi
+ \@expandtwoargs\in@{,\POE@key@loadbeampoints,}{,\POE@beamlist,}%
+ \ifin@\else
+ \xdef\POE@beamlist{%
+ \POE@key@loadbeampoints
+ \ifx\POE@beamlist\@empty\else,\fi\POE@beamlist
+ }%
+ \fi
+}%
+\define@key[psset]{optexp}{loadbeam}[true]{%
+ \setkeys+[psset]{optexp}{loadbeampoints=#1}%
+ \ifdim\POE@key@loadbeampoints pt>0pt
+ \POE@loadbeamtrue
+ \else
+ \POE@loadbeamfalse
+ \fi
+}%
+\define@key[psset]{optexp}{savebeam}[true]{%
+ \setkeys+[psset]{optexp}{savebeampoints=#1}%
+ \ifdim\POE@key@savebeampoints pt>0pt
+ \POE@savebeamtrue
+ \else
+ \POE@savebeamfalse
+ \fi
+}%
+\define@boolkey[psset]{optexp}[POE@]{beaminside}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{allowbeaminside}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{raytrace}[true]{}%
+\define@boolkey[psset]{optexp}[POE@]{useNA}[true]{}%
+\define@key[psset]{optexp}{skipconn}{%
+ \pst@checknum{#1}\POE@key@skipconn
+}%
+\define@choicekey+[psset]{optexp}{beamalign}%
+ [\val\nr]{rel,abs,relative,absolute}%
+ {%
+ \ifcase\nr\relax
+ \let\POE@key@beamalign\POE@str@relative
+ \or
+ \let\POE@key@beamalign\POE@str@absolute
+ \else
+ \def\POE@key@beamalign{#1}%
+ \fi
+ }%
+ {\PackageError{pst-optexp}{Unknown value '\val' for beamalign.}}
+\define@key[psset]{optexp}{ArrowInsideMinLength}{%
+ \def\POE@key@ArrowInsideMinLength{#1}%
+}%
+\define@key[psset]{optexp}{ArrowInsideMaxLength}{%
+ \def\POE@key@ArrowInsideMaxLength{#1}%
+}%
+\psset[optexp]{%
+ raytrace=true
+ ,useNA=true
+ ,startinside=false
+ ,stopinside=false
+ ,allowbeaminside=true
+ ,beaminside=true
+ ,beaminsidefirst=false
+ ,beaminsidelast=false
+ ,loadbeam=false
+ ,savebeam=false
+ ,loadbeampoints=false
+ ,savebeampoints=true
+ ,beamangle=0
+ ,beampos=\@empty
+ ,beamalign=relative
+ ,beamwidth=0
+ ,beamdiv=0
+ ,n=1.5
+ ,skipconn=0
+ ,ArrowInsideMinLength=0.2
+ ,ArrowInsideMaxLength=-1
+}%
+\define@key[psset]{optexp}{fiber}[all]{%
+ \POE@psset@fibercheck#1\@nil
+}
+\def\POE@psset@fibercheck#1#2\@nil{%
+ \ifx#1*\relax
+ \ifx\\#2\\
+ \psset[optexp]{fiber@preset=all}%
+ \else
+ \psset[optexp]{fiber@preset=#2}%
+ \fi
+ \else\ifx#1+\relax
+ \ifx\\#2\\
+ \psset[optexp]{fiber@all=all}%
+ \else
+ \psset[optexp]{fiber@all=#2}%
+ \fi
+ \else
+ \psset[optexp]{fiber@all=#1#2}%
+ \psset[optexp]{fiber@preset=#1#2}%
+ \fi\fi
+}%
+\define@choicekey*+[psset]{optexp}{fiber@preset}%
+ [\val\nr]{false,none,true,all}[all]{%
+ \ifcase\nr\relax
+ \POE@getfiberpreset@none
+ \or
+ \POE@getfiberpreset@none
+ \or
+ \POE@getfiberpreset@all
+ \or
+ \POE@getfiberpreset@all
+ \fi
+}{%
+ \ifx\@empty\val
+ \POE@getfiberpreset@none
+ \else
+ \pst@expandafter\POE@psset@@fiberpreset{#1}\@empty,,\@nil
+ \fi
+}%
+\def\POE@psset@@fiberpreset#1#2,#3,#4\@nil{%
+ \POE@getfiberpreset@all
+ \ifx\\#3\\
+ \@nameuse{POE@getfiberpreset@#1}%
+ \@nameuse{POE@getfiberpreset@#2}%
+ \fi
+}%
+\def\POE@getfiberpreset@none{%
+ \psset[optexp]{fiberpreset@=false}%
+}%
+\def\POE@getfiberpreset@all{%
+ \psset[optexp]{%
+ fiberpreset@, fiberpresetin@, fiberpresetout@,
+ fiberpresetin@top, fiberpresetin@bottom,
+ fiberpresetout@top, fiberpresetout@bottom}%
+}%
+\def\POE@getfiberpreset@t{%
+ \psset[optexp]{fiberpresetin@bottom=false, fiberpresetout@bottom=false}}%
+\def\POE@getfiberpreset@b{%
+ \psset[optexp]{fiberpresetin@top=false, fiberpresetout@top=false}}%
+\def\POE@getfiberpreset@l{\psset[optexp]{fiberpresetout@=false}}%
+\def\POE@getfiberpreset@r{\psset[optexp]{fiberpresetin@=false}}%
+\let\POE@getfiberpreset@i\POE@getfiberpreset@l
+\let\POE@getfiberpreset@o\POE@getfiberpreset@r
+\define@choicekey*+[psset]{optexp}{fiber@all}%
+ [\val\nr]{false,none,true,all}[all]{%
+ \ifcase\nr\relax
+ \POE@getfiber@none
+ \or
+ \POE@getfiber@none
+ \or
+ \POE@getfiber@all
+ \or
+ \POE@getfiber@all
+ \fi
+}{%
+ \ifx\@empty\val
+ \POE@getfiber@none
+ \else
+ \pst@expandafter\POE@psset@@fiber{#1}\@empty,,\@nil
+ \fi
+}%
+\def\POE@psset@@fiber#1#2,#3,#4\@nil{%
+ \POE@getfiber@all
+ \ifx\@empty#3\@empty
+ \@nameuse{POE@getfiber@#1}%
+ \@nameuse{POE@getfiber@#2}%
+ \fi
+}%
+\def\POE@getfiber@none{%
+ \psset[optexp]{fiber@=false}%
+}%
+\def\POE@getfiber@all{%
+ \psset[optexp]{%
+ fiber@, fiberin@, fiberout@,
+ fiberin@top, fiberin@bottom,
+ fiberout@top, fiberout@bottom}%
+}%
+\def\POE@getfiber@t{%
+ \psset[optexp]{fiberin@bottom=false, fiberout@bottom=false}}%
+\def\POE@getfiber@b{%
+ \psset[optexp]{fiberin@top=false, fiberout@top=false}}%
+\def\POE@getfiber@l{\psset[optexp]{fiberout@=false}}%
+\def\POE@getfiber@r{\psset[optexp]{fiberin@=false}}%
+\let\POE@getfiber@i\POE@getfiber@l
+\let\POE@getfiber@o\POE@getfiber@r
+\define@boolkey[psset]{optexp}[POE@]{fiber@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{nofiber@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberin@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberin@top}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberin@bottom}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberout@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberout@top}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberout@bottom}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpreset@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{nofiberpreset@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetin@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetin@top}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetin@bottom}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetout@}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetout@top}[true]{}
+\define@boolkey[psset]{optexp}[POE@]{fiberpresetout@bottom}[true]{}
+\psset[optexp]{fiber=*all}%
+\define@key[psset]{optexp}{fiberangleA}{%
+ \pst@checknum{#1}\POE@key@fiberangleA
+}%
+\define@key[psset]{optexp}{fiberangleB}{%
+ \pst@checknum{#1}\POE@key@fiberangleB
+}%
+\define@choicekey+[psset]{optexp}{fiberalign}%
+ [\val\nr]{rel,abs,relative,center,absolute}%
+ {%
+ \ifcase\nr\relax
+ \let\POE@key@fiberalign\POE@str@relative
+ \or
+ \let\POE@key@fiberalign\POE@str@absolute
+ \else
+ \def\POE@key@fiberalign{#1}%
+ \fi
+ }%
+ {\PackageError{pst-optexp}{Unknown value '\val' for fiberalign.}}%
+\define@key[psset]{optexp}{fiberstyle}{%
+ \@ifundefined{nc#1}%
+ {\PackageError{pst-optexp}{Unknown value '#1' for fiberstyle.}}%
+ {\def\POE@key@fiberstyle{#1}}}
+\psset[optexp]{%
+ fiberangleA=0,
+ fiberangleB=0,
+ fiberalign=relative,
+ fiberstyle=curve
+}%
+\define@choicekey+[psset]{optexp}{startnode}%
+ [\val\nr]{auto,1,2,3,4,N}%
+ {\edef\POE@key@startnode{\val}}
+ {\PackageError{pst-optexp}{Unknown startnode number '\val'}}
+\define@choicekey+[psset]{optexp}{stopnode}[\val\nr]{auto,1,2,3,4,N}%
+ {\edef\POE@key@stopnode{\val}}
+ {\PackageError{pst-optexp}{Unknown stopnode number '\val'}}
+\psset[optexp]{%
+ startnode=auto,
+ stopnode=auto
+}%
+\newenvironment{optexp}{\Collect@Body\POE@collect}{}
+\long\def\POE@collect#1{%
+ \psset[optexp]{optexpenv}
+ \global\POE@oldcnt=\POE@cnt
+ \bgroup
+ \psset[optexp]{backlayer=true, frontlayer=false}#1%
+ \egroup
+ \gdef\POE@complist{}\global\POE@cnt=\POE@oldcnt\relax
+ \psset[optexp]{backlayer=false, frontlayer=true}%
+ #1}%
+\def\backlayer#1{\ifPOE@backlayer #1\fi\ignorespaces}
+\def\frontlayer#1{\ifPOE@frontlayer #1\fi\ignorespaces}
+\def\POE@getnode#1#2\@nil{%
+ \ifx(#1\relax%)
+ \POE@getcoor#1#2
+ \edef\POE@temp{{\pst@coor}}%
+ \else
+ \edef\POE@temp{/\oenode{}{#1#2}\space}%
+ \fi%
+}%
+\def\POE@getcoor(#1){\pst@@getcoor{#1}}%
+\def\drawfiber{\drawfiber@{Fiber}}%
+\def\drawfiber@#1{%
+ \ifPst@custom\else
+ \def\pst@par{style=#1}%
+ \fi
+ \@ifnextchar[%]
+ {\drawfiber@i}{\drawfiber@i[]}%
+}%
+\def\drawfiber@i[#1]#2{%
+ \addafter@par{#1}%
+ \def\POE@tempe{#2}%
+ \@ifnextchar\bgroup{\drawfiber@ii}{}%
+}%
+\def\drawfiber@ii#1{%
+ \expandafter\drawfiber@iii\expandafter{\POE@tempe}{#1}%
+ \def\POE@tempe{#1}%
+ \@ifnextchar\bgroup{\drawfiber@ii}{}%
+}%
+\def\drawfiber@iii#1#2{%
+ \begingroup
+ \let\psk@angleA\relax
+ \let\psk@angleB\relax
+ \use@par
+ \def\POE@tempa{#1}
+ \ifx\POE@tempa\@empty
+ \edef\POE@comps{/\oenode{}{}\space}
+ \else
+ \expandafter\POE@getnode#1\@nil
+ \edef\POE@comps{\POE@temp}
+ \fi
+ \def\POE@tempb{#2}
+ \ifx\POE@tempb\@empty
+ \edef\POE@comps{/\oenode{}{}\space \POE@comps}
+ \else
+ \expandafter\POE@getnode#2\@nil
+ \edef\POE@comps{\POE@temp\space \POE@comps}
+ \fi
+ \ifPOE@backlayer
+ \ifx\POE@key@startnode\POE@str@auto\else
+ \POE@pnode{/\POE@key@startnode\space \POE@comps exch pop
+ \POE@dict{getsubnode} \tx@UserCoor}{@@A}
+ \fi
+ \ifx\POE@key@stopnode\POE@str@auto\else
+ \POE@pnode{/\POE@key@stopnode\space \POE@comps pop
+ \POE@dict{getsubnode} \tx@UserCoor}{@@B}
+ \fi
+ \ifx\POE@key@startnode\POE@str@auto
+ \ifx\POE@key@stopnode\POE@str@auto
+ \POE@pnode{\POE@comps exch \POE@dict{NearestNode}
+ \tx@UserCoor}{@@A}
+ \POE@pnode{\POE@comps pop
+ \POE@dict{/N@@@A @GetCenter ToVec NearestNode}
+ \tx@UserCoor}{@@B}
+ \else
+ \POE@pnode{\POE@comps exch pop /N@@@B
+ \POE@dict{@GetCenter ToVec NearestNode}
+ \tx@UserCoor}{@@A}
+ \fi
+ \else\ifx\POE@key@stopnode\POE@str@auto
+ \POE@pnode{\POE@comps pop /N@@@A
+ \POE@dict{@GetCenter ToVec NearestNode}
+ \tx@UserCoor}{@@B}
+ \fi\fi
+ \pst@getcoor{@@A}\POE@tempa
+ \pst@getcoor{@@B}\POE@tempb
+ \ifx\psk@angleA\relax
+ \ifx\POE@key@fiberalign\POE@str@absolute
+ \psset{angleA=\POE@key@fiberangleA}%
+ \else
+ \psset{angleA=! \POE@dict{%
+ \POE@tempb \POE@tempa \POE@comps exch
+ \POE@key@fiberalign\space RelFiberAngle
+ \POE@key@fiberangleA\space add }
+ }%
+ \fi
+ \fi
+ \ifx\psk@angleB\relax
+ \ifx\POE@key@fiberalign\POE@str@absolute
+ \psset{angleB=\POE@key@fiberangleB}%
+ \else
+ \psset{angleB=! \POE@dict{%
+ \POE@tempa \POE@tempb \POE@comps
+ \POE@key@fiberalign\space RelFiberAngle
+ \POE@key@fiberangleB\space add}
+ }%
+ \fi
+ \fi
+ \@nameuse{nc\POE@key@fiberstyle}{@@A}{@@B}
+ \fi
+ \endgroup
+}%
+\def\POE@pnode#1#2{%
+ \ifPst@custom
+ \code{%
+ gsave
+ /currentpoint load stopped { 0 0 moveto } if
+ 1 8.3021995 div dup neg scale
+ tx@NodeDict begin
+ {#1 \tx@ScreenCoor } false /N@#2 10 {InitPnode}
+ /NodeScale {} def NewNode
+ end
+ grestore
+ }%
+ \else
+ \pnode(!#1){#2}
+ \fi
+}%
+\def\begin@BeamObj{%
+ \addbefore@par{n=n}%
+ \begin@SpecialObj%
+ \addto@pscode{%
+ \pst@optexpdict
+ /loadbeampoints \POE@key@loadbeampoints\space def
+ /loadbeam \ifPOE@loadbeam true \else false \fi def
+ /beamangle \POE@key@beamangle\space def
+ /savebeampoints \POE@key@savebeampoints\space def
+ /savebeam \ifPOE@savebeam true \else false \fi def
+ /beaminsidefirst \ifPOE@beaminsidefirst true \else false \fi def
+ /beaminsidelast \ifPOE@beaminsidelast true \else false \fi def
+ /beaminside \ifPOE@beaminside true \else false \fi def
+ /startinside \ifPOE@startinside true \else false \fi def
+ /stopinside \ifPOE@stopinside true \else false \fi def
+ /connectifc \ifPOE@raytrace false \else true \fi def
+ /beamalign
+ \ifx\POE@key@beamalign\POE@str@absolute\space
+ absolute
+ \else
+ relative
+ \fi def
+ /skipconn \POE@key@skipconn\space def
+ /useNA \ifPOE@useNA true \else false \fi def
+ }%
+}%
+\def\begin@WideBeamObj{%
+ \addbefore@par{style=Beam}%
+ \begin@BeamObj
+ \let\pst@linetype\pst@arrowtype
+ \pst@addarrowdef%
+}%
+\let\begin@SingleBeamObj\begin@WideBeamObj
+\def\drawbeam{\pst@object{drawbeam}}%
+\def\drawbeam@i{%
+ \def\POE@conntable{,a-a,b-b,A-A,B-B}%
+ \begin@SingleBeamObj
+ \POE@getcomps[\drawbeam@ii%
+}%
+\def\drawwidebeam{\pst@object{drawwidebeam}}%
+\def\drawwidebeam@i{%
+ \begin@WideBeamObj
+ \POE@getcomps[\drawwidebeam@ii%
+}%
+\def\POE@beam@use@pscode{%
+ \pstverb{%
+ \pst@dict
+ \tx@STP
+ \pst@newpath
+ \psk@origin
+ \psk@swapaxes
+ \pst@code
+ end
+ count /ocount exch def
+ }%
+ \gdef\pst@code{}%
+}%
+\def\end@BeamObj{%
+ \addto@pscode{ end }%
+ \let\psk@fillstyle\relax
+ \ifPOE@optexpenv
+ \ifPOE@frontlayer
+ \def\pst@code{ false false }%
+ \fi
+ \fi
+ \let\use@pscode\POE@beam@use@pscode
+ \end@SpecialObj%
+}%
+\def\drawbeam@ii{%
+ \ifx\POE@key@conn\@empty
+ \drawbeam@iii
+ \else
+ \drawbeam@compat
+ \fi
+}
+\def\drawbeam@iii{%
+ \ifx\pslinestyle\@none
+ \addto@pscode{ false false }%
+ \else
+ \addto@pscode{%
+ {/nbeam {\POE@key@n cvx exec} bind def
+ \ifPOE@pswarning
+ /Warning /PrintWarning load def
+ \else
+ /Warning /pop load def
+ \fi}%
+ [ \POE@key@beampos\space counttomark dup
+ 0 eq {
+ pop 0 0
+ } {
+ 1 eq {
+ 0 exch
+ } if
+ } ifelse \tx@ScreenCoor] cvx
+ \POE@key@beamangle\space
+ currentdict /lastBeamPointTmp undef
+ currentdict /lastVecTmp undef
+ loadbeampoints 1 ge
+ tx@NodeDict /N@\oenodeBeam{\POE@key@loadbeampoints} known and {
+ /N@\oenodeBeam{\POE@key@loadbeampoints} @GetCenter ToVec
+ /lastBeamPointTmp ED
+ } if
+ currentdict /lastVec\POE@key@loadbeampoints\space known
+ loadbeam and {
+ /lastVecTmp /lastVec\POE@key@loadbeampoints\space load def
+ } if
+ TraceBeam
+ \POE@strokesinglebeam
+ savebeampoints 1 ge
+ currentdict /lastBeamPointTmp known and dup {
+ lastBeamPointTmp
+ /N@\oenodeBeam{\POE@key@savebeampoints}\space 4 -1 roll
+ } if
+ savebeam currentdict /lastVecTmp known and dup {
+ /lastVec\POE@key@savebeampoints\space lastVecTmp 4 -1 roll
+ } if
+ }%
+ \fi
+ \end@BeamObj
+ \POE@Verb{%
+ { tx@OptexpDict begin ToVec def end } if
+ { \tx@NodeScale @NewNode } if
+ }%
+}%
+\def\tx@NodeScale{%
+ \pst@nodedict
+ /NodeScale {\ifx\pstnodescale\@undefined\else\pstnodescale\fi} def
+ end }
+\def\POE@strokesinglebeam{%
+ gsave
+ /Lineto /lineto load def
+ \tx@Drawbeam
+ \tx@setlinejoin
+ \pst@number\pslinewidth SLW
+ \pst@usecolor\pslinecolor
+ \tx@setStrokeTransparency
+ \@nameuse{psls@\pslinestyle}
+ grestore
+}%
+\def\drawwidebeam@ii{%
+ \def\pst@fill##1{ gsave ##1 grestore }%
+ \addto@pscode{%
+ {/nbeam {\POE@key@n cvx exec} bind def
+ \ifPOE@pswarning
+ /Warning /PrintWarning load def
+ \else
+ /Warning /pop load def
+ \fi}%
+ }%
+ \addto@pscode{%
+ \POE@key@beamangle\space dup
+ \POE@key@beamdiv\space 0.5 mul dup 4 -1 roll add 3 1 roll sub
+ }%
+ \addto@pscode{%
+ [ \POE@key@beampos\space counttomark dup
+ 0 eq {
+ pop 0 0
+ } {
+ 1 eq {
+ 0 exch
+ } if
+ } ifelse
+ mark \POE@key@beamwidth\space counttomark 0 eq {
+ 0
+ } {
+ 0.5 mul
+ } ifelse
+ exch pop
+ 3 copy add \tx@ScreenCoor\space ToVec
+ 5 1 roll sub \tx@ScreenCoor
+ ] cvx
+ }%
+ \addto@pscode{ exch 4 -1 roll 4 2 roll exch }%
+ \addto@pscode{%
+ counttomark mark exch 2 add 1 roll
+ gsave
+ \ifx\psk@fillstyle\relax
+ currentdict /fillBeam undef
+ \else
+ /fillBeam {\psk@fillstyle} def
+ \fi
+ /strokeBeam \ifx\pslinestyle\@none false \else true \fi def
+ [/lastBeamPointTmpLow /lastBeamPointTmpUp
+ /lastVecTmpLow /lastVecTmpUp]
+ {currentdict exch undef} forall
+ tx@NodeDict /N@\oenodeBeamLow{\POE@key@loadbeampoints} known
+ tx@NodeDict /N@\oenodeBeamUp{\POE@key@loadbeampoints} known
+ loadbeampoints 1 ge and and {
+ /N@\oenodeBeamLow{\POE@key@loadbeampoints} @GetCenter ToVec
+ /lastBeamPointTmpLow ED
+ /N@\oenodeBeamUp{\POE@key@loadbeampoints} @GetCenter ToVec
+ /lastBeamPointTmpUp ED
+ } if
+ loadbeam
+ currentdict /lastVecLow\POE@key@loadbeampoints\space known and
+ currentdict /lastVecUp\POE@key@loadbeampoints\space known and {
+ /lastVecTmpLow /lastVecLow\POE@key@loadbeampoints\space load def
+ /lastVecTmpUp /lastVecUp\POE@key@loadbeampoints\space load def
+ } if
+ TraceAndFillWideBeam
+ grestore pop % pop off the mark
+ counttomark 0 gt strokeBeam and {
+ counttomark dup /cnta ED /cntb ED
+ cnta 6 idiv {
+ cnta 3 roll /cnta cnta 3 sub def
+ /cntb cntb 3 sub def
+ cntb 3 roll /cntb cntb 3 sub def
+ } repeat
+ counttomark 2 idiv 1 add mark exch 1 roll
+ \POE@strokesinglebeam
+ \POE@strokesinglebeam
+ } {
+ pop % pop off the mark
+ } ifelse
+ currentdict /fillBeam known strokeBeam or
+ savebeampoints 1 ge and
+ currentdict /lastBeamPointTmpLow known and
+ currentdict /lastBeamPointTmpUp known and dup {
+ lastBeamPointTmpLow /N@\oenodeBeamLow{\POE@key@savebeampoints}
+ lastBeamPointTmpUp /N@\oenodeBeamUp{\POE@key@savebeampoints}
+ 7 -1 roll
+ } if
+ currentdict /fillBeam known strokeBeam or
+ savebeam and
+ currentdict /lastVecTmpLow known and
+ currentdict /lastVecTmpUp known and dup {
+ /lastVecLow\POE@key@savebeampoints\space lastVecTmpLow
+ /lastVecUp\POE@key@savebeampoints\space lastVecTmpUp
+ 7 -1 roll
+ } if
+ }%
+ \end@BeamObj
+ \POE@Verb{%
+ { tx@OptexpDict begin ToVec def ToVec def end } if
+ { \tx@NodeScale @NewNode @NewNode } if
+ }%
+}%
+\pst@def{Drawbeam}<
+ { counttomark 6 le {
+ exit
+ } if
+ 3 index not {
+ pop pop pop
+ }{
+ exit
+ } ifelse
+ } loop
+ { counttomark 3 le {
+ exit
+ } if
+ counttomark 3 sub index not {
+ counttomark -3 roll pop pop pop
+ }{
+ exit
+ } ifelse
+ } loop
+ counttomark 3 le {
+ cleartomark
+ }{
+ counttomark 3 div cvi /N ED
+ (\psk@ArrowInside) length 0 gt {
+ \ifx\psk@arrowA\arrowType@H % do we have a Hook arrow at the beginning?
+ \pst@number\pshooklength % yes
+ \else
+ \psk@arrowsize\space CLW mul add dup \psk@arrowlength\space mul exch \psk@arrowinset mul neg add
+ \fi
+ /arrowlength exch def
+ 6 copy pop % copy all four values for the arrow line
+ /y1 ED /x1 ED pop /y2 ED /x2 ED % save them
+ /Alpha y2 y1 sub x2 x1 sub Atan def % the gradient of the line
+ pop 3 -1 roll 5 1 roll
+ ArrowA
+ x1 Alpha cos arrowlength mul add % dx add
+ y1 Alpha sin arrowlength mul add % dy add, to get the current point at the end of the arrow tip
+ 5 -1 roll 3 1 roll true
+ /N N 1 sub def
+ N {
+ 6 copy pop
+ /y1 ED /x1 ED pop /y2 ED /x2 ED /draw ED
+ x1 y1 x2 y2 @ABDist dup
+ \POE@key@ArrowInsideMinLength\space\pst@number\psunit mul ge
+ exch \POE@key@ArrowInsideMaxLength\space\pst@number\psunit mul dup 0 lt
+ 3 1 roll le or and {
+ x1 y1
+ \psk@ArrowInsidePos\space 1 gt {
+ /Alpha y2 y1 sub x2 x1 sub Atan def
+ /ArrowPos \psk@ArrowInsideOffset\space def
+ /dArrowPos \psk@ArrowInsidePos\space abs def
+ \psk@ArrowInsideNo\space cvi {
+ /ArrowPos ArrowPos dArrowPos add def
+ x1 Alpha cos ArrowPos mul add
+ y1 Alpha sin ArrowPos mul add
+ 6 index { ArrowInside } if
+ pop pop
+ } repeat
+ }{
+ /ArrowPos \psk@ArrowInsideOffset\space def
+ /dArrowPos \psk@ArrowInsideNo 1 gt {%
+ 1.0 \psk@ArrowInsideNo 1.0 add div
+ }{\psk@ArrowInsidePos } ifelse def
+ \psk@ArrowInsideNo\space cvi {
+ /ArrowPos ArrowPos dArrowPos add def
+ x2 x1 sub ArrowPos mul x1 add
+ y2 y1 sub ArrowPos mul y1 add
+ 6 index { ArrowInside } if
+ pop pop
+ } repeat
+ } ifelse
+ pop pop
+ } if
+ draw {Lineto}{moveto} ifelse
+ } repeat
+ }{
+ pop 5 copy 3 -1 roll pop
+ ArrowA pop pop pop pop
+ counttomark 3 idiv -1 2 {
+ pop {
+ lineto
+ }{
+ moveto
+ } ifelse
+ } for
+ } ifelse
+ {CP 4 2 roll ArrowB lineto pop pop } {moveto} ifelse
+ pop
+ } ifelse
+>
+\def\POE@getcomprange#1-#2\@nil{%
+ \ifx\\#2\\%
+ \ifx\\#1\\%
+ % empty option
+ \edef\POE@firstcomp{\the\POE@cnt}%
+ \edef\POE@lastcomp{\the\POE@cnt}%
+ \else
+ \edef\POE@firstcomp{#1}%
+ \edef\POE@lastcomp{#1}%
+ \fi
+ \else
+ \ifx\\#1\\%
+ \edef\POE@firstcomp{1}%
+ \else
+ \edef\POE@firstcomp{#1}%
+ \fi
+ \POE@getlastcomp#2%
+ \fi
+ \ifnum\POE@firstcomp<1
+ \def\POE@firstcomp{1}%
+ \else\ifnum\POE@firstcomp>\the\POE@cnt
+ \edef\POE@firstcomp{\the\POE@cnt}%
+ \fi\fi
+ \ifnum\POE@lastcomp>\the\POE@cnt
+ \edef\POE@lastcomp{\the\POE@cnt}%
+ \else\ifnum\POE@lastcomp<1
+ \def\POE@lastcomp{1}%
+ \fi\fi
+}
+\def\POE@getlastcomp#1-{%
+ \ifx.#1.%
+ \edef\POE@lastcomp{\the\POE@cnt}%
+ \else
+ \ifx\@empty#1\relax
+ \edef\POE@lastcomp{\the\POE@cnt}%
+ \else
+ \edef\POE@lastcomp{#1}%
+ \fi
+ \fi
+}
+\def\POE@getcomps#1#2{%
+ \ifx\POE@key@conn\@empty
+ \def\POE@aftercomps{\addto@pscode{#1 \POE@comps }#2}%
+ \else
+ \def\POE@aftercomps{#2}%
+ \fi
+ \def\POE@comps{}%
+ \POE@@getcomps%
+}%
+\def\POE@@getcomps{%
+ \@ifnextchar\bgroup{\POE@@@getcomps}{\POE@aftercomps}%
+}%
+\def\POE@@@getcomps#1{%
+ \def\POE@temp{#1\@empty}%
+ \expandafter\POE@@@@getcomps\POE@temp\@nil
+}%
+\def\POE@@@@getcomps#1#2\@nil{%
+ \edef\POE@temp{#1}%
+ \ifx\POE@temp\@empty
+ \POE@getcomp{(\oenode{}{})}%
+ \else\ifx(#1\relax%)
+ \POE@getplanenode#1#2%
+ \else\ifnum9<1#1\relax
+ \POE@getcomprange#1#2-\@nil
+ \POE@getcomp{%
+ (\POE@str@basicname@prefix\POE@str@basicname@default)
+ \POE@firstcomp\space\POE@lastcomp\space GetCompRange %
+ }%
+ \else\ifx-#1\relax
+ \POE@getcomprange#1#2-\@nil
+ \POE@getcomp{%
+ (\POE@str@basicname@prefix\POE@str@basicname@default)
+ \POE@firstcomp\space\POE@lastcomp\space GetCompRange %
+ }%
+ \else
+ \POE@getcomp{(\oenode{}{#1#2})}%
+ \fi\fi\fi\fi%
+ \POE@@getcomps%
+}%
+\def\POE@getplanenode(#1){%
+ \pst@@getcoor{#1}%
+ \ifx\POE@key@conn\@empty
+ \advance\POE@nodecnt by 1
+ \POE@getcomp{%
+ {\pst@coor} {0 1}
+ (\POE@str@basicname@default N@\the\POE@nodecnt)
+ {\tx@UserCoor} NewTempNodeComp
+ (\POE@str@basicname@default N@\the\POE@nodecnt)
+ }%
+ \else
+ \POE@getcomp{{\pst@coor} }%
+ \fi
+}%
+\def\POE@getcomp#1{%
+ \ifx\POE@comps\@empty
+ \edef\POE@tempc{#1}%
+ \else
+ \edef\POE@tempd{#1}%
+ \fi
+ \edef\POE@comps{#1 \POE@comps}%
+}%
+\def\POE@drawInternalConnections{%
+ \ifx\POE@key@conn\@empty
+ \POE@drawInternalConnectionsNew
+ \else
+ \POE@drawInternalConnectionsOld
+ \fi
+}%
+\def\POE@drawPresetFibers{%
+ \ifPOE@endbox
+ \ifPOE@fiberpresetin@
+ \drawfiber@{FiberIn}{(\oenodeRefA{})}{}
+ \fi
+ \else\ifPOE@startbox
+ \ifPOE@fiberpresetout@
+ \drawfiber@{FiberOut}{}{(\oenodeRefB{})}
+ \fi
+ \else
+ \ifPOE@fiberpresetin@
+ \drawfiber@{FiberIn}{(\oenodeRefA{})}{}
+ \fi
+ \ifPOE@fiberpresetout@
+ \drawfiber@{FiberOut}{}{(\oenodeRefB{})}
+ \fi
+ \fi\fi
+}%
+\def\POE@drawInternalConnectionsNew{%
+ \ifPOE@beam
+ \ifPOE@endbox
+ \drawbeam[raytrace=false]{(\oenodeRefA{})}{}
+ \else\ifPOE@startbox
+ \drawbeam[raytrace=false]{}{(\oenodeRefB{})}
+ \else
+ \drawbeam[raytrace=false]{(\oenodeRefA{})}{}{(\oenodeRefB{})}
+ \fi\fi
+ \else\ifPOE@fiber@
+ \ifPOE@endbox
+ \ifPOE@fiberin@
+ \drawfiber@{FiberIn}{(\oenodeRefA{})}{}
+ \fi
+ \else\ifPOE@startbox
+ \ifPOE@fiberout@
+ \drawfiber@{FiberOut}{}{(\oenodeRefB{})}
+ \fi
+ \else
+ \ifPOE@fiberin@
+ \drawfiber@{FiberIn}{(\oenodeRefA{})}{}
+ \fi
+ \ifPOE@fiberout@
+ \drawfiber@{FiberOut}{}{(\oenodeRefB{})}
+ \fi
+ \fi\fi
+ \fi\fi
+}%
+\def\POE@drawInternalConnectionsOld{%
+ \ifPOE@endbox
+ \@nameuse{\POE@connIn}
+ \else
+ \ifPOE@fiber@
+ \ifPOE@fiberin@
+ \@nameuse{\POE@connIn}
+ \fi
+ \ifPOE@fiberout@
+ \@nameuse{\POE@connOut}
+ \fi
+ \else
+ \ifPOE@connjoin
+ \def\POE@tempa{POE@conn@in@i}%
+ \ifx\POE@tempa\POE@connIn
+ \def\POE@tempb{POE@conn@out@o}
+ \ifx\POE@tempb\POE@connOut
+ \pscustom[style=Beam, linejoin=\POE@key@connjoin]{%
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}}%
+ \else\ifx\@empty\POE@connOut
+ \pscustom[style=Beam, linejoin=\POE@key@connjoin]{%
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}}%
+ \else
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}%
+ \fi\fi
+ \else
+ \def\POE@tempa{POE@conn@in@o}%
+ \ifx\POE@tempa\POE@connIn
+ \def\POE@tempb{POE@conn@out@o}
+ \ifx\POE@tempb\POE@connOut
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}%
+ \else\ifx\@empty\POE@connOut
+ \pscustom[style=Beam, linejoin=\POE@key@connjoin]{%
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}}%
+ \else
+ \pscustom[style=Beam, linejoin=\POE@key@connjoin]{%
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}}%
+ \fi\fi
+ \else
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}%
+ \fi
+ \fi
+ \else
+ \@nameuse{\POE@connIn}\@nameuse{\POE@connOut}%
+ \fi
+ \fi
+ \fi
+}%
+\def\optexp@nodeA{\oenodeIn{}}%
+\def\optexp@nodeB{\oenodeOut{}}%
+\define@key[psset]{optexp}{connjoin}{%
+ \edef\POE@temp{#1}%
+ \ifnum\POE@temp<0
+ \POE@connjoinfalse
+ \else\ifnum\POE@temp>2
+ \POE@connjoinfalse
+ \else
+ \POE@connjointrue
+ \edef\POE@key@connjoin{\POE@temp}
+ \fi\fi
+}%
+\def\POE@key@conn{}%
+\define@key[psset]{optexp}{conn}{%
+ \edef\POE@key@conn{#1}%
+ \expandafter\POE@psset@@conn\POE@key@conn\@empty-\@empty\@nil
+ \if@pst\else
+ \PackageError{pst-optexp}{Bad connection specification: #1}%
+ \fi
+}%
+\def\POE@psset@@conn#1-#2\@empty#3\@nil{%
+ \@psttrue
+ \def\POE@next##1,#1-##2,##3\@nil{\def\POE@temp{##2}}%
+ \expandafter\POE@next\POE@conntable,#1-#1,\@nil
+ \@ifundefined{POE@conn@in@\POE@temp}%
+ {\@pstfalse\def\POE@connIn{}}%
+ {\edef\POE@connIn{POE@conn@in@\POE@temp}}%
+ \@ifundefined{POE@conn@out@#2}%
+ {\@pstfalse\def\POE@connOut{}}%
+ {\def\POE@connOut{POE@conn@out@#2}}%
+}%
+\def\POE@connIn{}%
+\def\POE@connOut{}%
+\def\POE@conntable{,o-o,i-i,f-f}%
+\def\POE@conn@out@{\ifPOE@insideobj\else\POE@conn@out@a\fi}%
+\def\POE@conn@in@{\ifPOE@insideobj\else\POE@conn@in@a\fi}%
+\def\POE@conn@in@o{%
+ \psline[style=Beam](\oenodeRefA{})(\optexp@nodeA)%
+}%
+\def\POE@conn@out@o{%
+ \psline[style=Beam](\optexp@nodeB)(\oenodeRefB{})%
+}%
+\def\POE@conn@in@f{%
+ \pccurve[%
+ angleA=!\POE@dict{/N@\oenodeRefA{} /N@\oenodeRefB{} SlopeAngle},
+ angleB=!\POE@dict{/N@\oenodeRefB{} /N@\oenodeRefA{} SlopeAngle},
+ style=FiberIn](\oenodeRefA{})(\optexp@nodeA)%
+}%
+\def\POE@conn@out@f{%
+ \pccurve[%
+ angleA=!\POE@dict{/N@\oenodeRefA{} /N@\oenodeRefB{} SlopeAngle},
+ angleB=!\POE@dict{/N@\oenodeRefB{} /N@\oenodeRefA{} SlopeAngle},
+ style=FiberOut](\optexp@nodeB)(\oenodeRefB{})%
+}%
+\def\POE@conn@in@i{%
+ \def\pst@par{style=Beam}
+ \begin@OpenObj
+ \addto@pscode{%
+ [%]
+ \pst@optexpdict
+ (\oenode{}{}) true GetInternalBeamNodesCompat
+ /N@\oenodeRefA{} @GetCenter
+ end
+ }%
+ \psline@ii
+}%
+\def\POE@conn@out@i{%
+ \def\pst@par{style=Beam}
+ \begin@OpenObj
+ \addto@pscode{%
+ [%]
+ \pst@optexpdict
+ /N@\oenodeRefB{} @GetCenter
+ (\oenode{}{}) true GetInternalBeamNodesCompat
+ end
+ }%
+ \psline@ii
+}%
+\def\POE@conn@in@a{%
+ dup xcheck not {
+ \POE@dict{1 GetInternalBeamNodeCompat}
+ } if
+ exec
+}%
+\def\POE@conn@in@A{%
+ dup xcheck not {
+ false \POE@dict{GetInternalBeamNodesCompat} %
+ } if
+ exec
+}%
+\def\POE@conn@in@b{%
+ dup xcheck not {
+ \POE@dict{(N) GetInternalBeamNodeCompat}
+ } if
+ exec
+}%
+\def\POE@conn@in@B{%
+ dup xcheck not {
+ true \POE@dict{GetInternalBeamNodesCompat} %
+ } if
+ exec
+}%
+\let\POE@conn@out@a\POE@conn@in@a
+\let\POE@conn@out@A\POE@conn@in@B
+\let\POE@conn@out@b\POE@conn@in@b
+\let\POE@conn@out@B\POE@conn@in@A
+\def\drawbeam@compat{%
+ \ifPOE@connjoin
+ \setkeys+[psset]{optexp}{linejoin=\POE@key@connjoin}%
+ \fi
+ \addto@pscode{[% ]
+ \POE@tempd\space
+ \@nameuse{\POE@connOut}
+ \POE@tempc\space
+ \@nameuse{\POE@connIn}}%
+ \psline@ii
+\ignorespaces}%
+\def\defShiftedNode(#1)(#2)#3{%
+ \PackageWarning{pst-optexp}{%
+ \string\defShiftedNode\space is deprecated,\MessageBreak
+ use \string\nodexn\space(pst-node) instead.}%
+ \pst@getcoor{#1}\pst@tempa%
+ \pst@getcoor{#2}\pst@tempb%
+ \pnode(! \pst@tempb \pst@tempa \POE@dict{VecAdd} \tx@UserCoor){#3}%
+}%
+\def\POE@checkcompname#1{%
+ \@expandtwoargs\in@{,#1,}{,\POE@complist,}%
+ \ifin@\else
+ \PackageError{pst-optexp}{^^Jcompname '#1' undefined!^^J}
+ \fi
+}%
+\def\POE@getlastcompname{%
+ \expandafter\POE@getlastcompname@i \POE@complist,\relax,\@nil
+}%
+\def\POE@getlastcompname@i#1,#2,#3\@nil{#1}%
+\def\oenode#1#2{%
+ \POE@str@basicname@prefix%
+ \ifx\\#2\\%
+ \ifnum9<1\POE@getlastcompname%
+ \POE@str@basicname@default%
+ \POE@getlastcompname%
+ \else%
+ \POE@getlastcompname%
+ \POE@str@basicname@sep%
+ \fi%
+ \else%
+ \ifnum9<1#2%
+ \POE@str@basicname@default%
+ #2%
+ \else%
+ #2\POE@str@basicname@sep%
+ \fi%
+ \fi%
+ #1%
+}%
+\def\oenodeExt#1{\oenode{\POE@str@extnode@postfix}{#1}}%
+\def\oenodeIn#1{\oenode{1}{#1}}%
+\def\oenodeOut#1{\oenode{N}{#1}}%
+\def\oenodeCenter#1{\oenode{Center}{#1}}%
+\def\oenodeLabel#1{\oenode{Label}{#1}}%
+\def\oenodeRefA#1{\oenode{A}{#1}}%
+\def\oenodeRefB#1{\oenode{B}{#1}}%
+\def\oenodeRotref#1{\oenode{Rotref}{#1}}%
+\def\oenodeTrefA#1{\oenode{TrefA}{#1}}%
+\def\oenodeTrefB#1{\oenode{TrefB}{#1}}%
+\def\oenode@RefA#1{\oenode{@A}{#1}}%
+\def\oenode@RefB#1{\oenode{@B}{#1}}%
+\def\oenode@TrefA#1{\oenode{@TrefA}{#1}}%
+\def\oenode@TrefB#1{\oenode{@TrefB}{#1}}%
+\def\oenodeIfc#1#2{%
+ \ifnum9<1#1 %
+ \oenode{#1}{#2}%
+ \else\ifx#1N %
+ \oenode{#1}{#2}%
+ \else\ifx#1C %
+ \oenode{#1}{#2}%
+ \else
+ \PackageWarning{pst-optexp}{%
+ \string\oenodeIfc\space node argument must be\MessageBreak
+ integer, 'N', or 'C'}
+ \fi\fi\fi
+}%
+\def\oenodeBeam#1{%
+ \POE@str@basicname@prefix\POE@str@basicname@default Beam%
+ \ifx\\#1\\1\else#1\fi
+}%
+\def\oenodeBeamUp#1{%
+ \POE@str@basicname@prefix\POE@str@basicname@default BeamUp%
+ \ifx\\#1\\1\else#1\fi
+}%
+\def\oenodeBeamLow#1{%
+ \POE@str@basicname@prefix\POE@str@basicname@default BeamLow%
+ \ifx\\#1\\1\else#1\fi
+}%
+\def\newOptexpComp@#1#2{%
+ \POE@Verb{%
+ \tx@NodeScale
+ [ #1 #2 \ifPOE@allowbeaminside true \else false \fi
+ (\oenode{}{}) {\tx@ScreenCoor}
+ NewOptexpComp
+ }%
+\ignorespaces}%
+\def\newOptexpComp#1{%
+ \newOptexpComp@{#1}{false}%
+\ignorespaces}%
+\def\newOptexpCompAmb#1{%
+ \newOptexpComp@{#1}{true}%
+\ignorespaces}%
+\def\newOptexpFiberComp#1{%
+ \POE@Verb{%
+ \tx@NodeScale
+ [ #1 (\oenode{}{}) {\tx@ScreenCoor}
+ NewOptexpFiberComp
+ }%
+\ignorespaces}%
+\def\POE@compalias#1#2{%
+ \POE@Verb{%
+ /\oenode{}{#1} dup currentdict exch known {
+ load /#2 ED
+ } {
+ pop
+ } ifelse
+ (#2) (\oenode{}{#1})
+ tx@NodeDict begin
+ 1 {
+ 3 copy inttostr dup
+ 3 1 roll 2 copy NodeName
+ currentdict exch known {
+ NodeName load 3 1 roll NodeName ED
+ 1 add
+ } {
+ pop (N) NodeName load 3 1 roll
+ pop (N) NodeName ED
+ pop exit
+ } ifelse
+ } loop
+ [ (A) (B) (@A) (@B) (Center) (Label) (Rotref)
+ (TrefA) (TrefB) (@TrefA) (@TrefB) (Ext)
+ counttomark {
+ counttomark 3 add -2 roll 2 copy counttomark 1 add 2 roll
+ 3 -1 roll dup 4 1 roll NodeName dup
+ currentdict exch known {
+ load 3 1 roll exch NodeName ED
+ } {
+ pop pop pop
+ } ifelse
+ } repeat pop pop pop
+ end
+ }%
+\ignorespaces}%
+\def\optplane{%
+ \@ifnextchar[%]
+ {\optplane@i}{\optplane@i[]}%
+}%
+\def\optplane@i[#1](#2){%
+ \pst@getcoor{#2}\POE@tempa
+ \optplate[#1, plateheight=0, linestyle=none]%
+ (! \POE@tempa exch 1 sub exch \tx@UserCoor)%
+ (! \POE@tempa exch 1 add exch \tx@UserCoor)%
+\ignorespaces}%
+\def\begin@OptexpObj{%
+ \global\advance\POE@cnt by 1
+ \addbefore@par{compname={}}%
+ \pst@killglue
+ \begingroup
+ \POE@insideobjtrue
+ \POE@Verb{InitOptexpComp }%
+ \use@par
+ \let\POE@key@comp@Yshift\POE@key@compshift%
+ \def\POE@key@comp@Xshift{0}%
+ \edef\POE@refnodeA{\oenodeRefA{}}%
+ \edef\POE@refnodeB{\oenodeRefB{}}%
+ \edef\POE@trefnodeA{\oenodeTrefA{}}%
+ \edef\POE@trefnodeB{\oenodeTrefB{}}%
+ \def\POE@transformnodes{%
+ \POE@transformnode{\oenodeRefA{}}{\oenodeTrefA{}}%
+ \POE@transformnode{\oenodeRefB{}}{\oenodeTrefB{}}%
+ }%
+}%
+\let\begin@OptexpFiberObj\begin@OptexpObj
+\let\POE@disablepos\relax
+\def\begin@OptexpTripole{%
+ \begin@OptexpObj
+ \def\POE@key@comp@Xshift{\POE@key@compshift\space neg }%
+ \def\POE@key@comp@Yshift{0}%
+ \def\POE@disablepos{%
+ \let\POE@key@abspos\@empty
+ \let\POE@key@position\@empty
+ }%
+ \POE@positionrefnodes
+}%
+\def\POE@positionrefnodes{%
+ \edef\POE@refnodeA{\oenode@RefA{}}%
+ \edef\POE@refnodeB{\oenode@RefB{}}%
+ \edef\POE@trefnodeA{\oenode@TrefA{}}%
+ \edef\POE@trefnodeB{\oenode@TrefB{}}%
+ \def\POE@transformnodes{%
+ \POE@transformnode{\oenodeRefA{}}{\oenodeTrefA{}}%
+ \POE@transformnode{\oenodeRefB{}}{\oenodeTrefB{}}%
+ \POE@transformnode{\oenode@RefA{}}{\oenode@TrefA{}}%
+ \POE@transformnode{\oenode@RefB{}}{\oenode@TrefB{}}%
+ }%
+}%
+\def\end@OptexpObj{%
+ \ifnum9<1\POE@key@compname\else
+ \POE@compalias{\POE@key@compname}{\oenode{}{\the\POE@cnt}}%
+ \fi
+ \endgroup
+ \ignorespaces%
+}%
+\let\end@OptexpDipole\end@OptexpObj
+\let\end@OptexpTripole\end@OptexpObj
+\def\addafter@par#1{%
+ \ifx\pst@par\@empty
+ \def\pst@par{#1}%
+ \else
+ \toks@{#1}%
+ \pst@toks\expandafter{\pst@par}%
+ \edef\pst@par{\the\pst@toks,\the\toks@}%
+ \fi%
+}%
+\def\getCLWH{CLW \pst@number\psxunit 2 mul div }%
+\def\getCLW{CLW \pst@number\psxunit div }%
+\let\POE@restorerefnodes\relax
+\def\newOptexpDipole{%
+ \@ifnextchar[%]
+ {\POE@newdipole}{\POE@newdipole[]}%
+}%
+\def\newOptexpDipoleNolabel{%
+ \PackageWarning{pst-optexp}{%
+ \string\newOptexpDipoleNolabel\space is deprecated,\MessageBreak
+ use \string\newOptexpDipole\space instead.}%
+ \newOptexpDipole
+}%
+\def\newOptexpTripole{%
+ \@ifnextchar[%]
+ {\POE@newtripole}{\POE@newtripole[]}%
+}%
+\def\newOptexpFiberDipole{%
+ \@ifnextchar[%]
+ {\POE@newfiberdipole}{\POE@newfiberdipole[]}%
+}%
+\def\POE@newdipole[#1]#2#3{%
+ \@ifundefined{#2@i}{%
+ \@namedef{#2}{\pst@object{#2}}%
+ \expandafter\def\csname #2@i\endcsname(##1)(##2){%
+ \@ifnextchar\bgroup%
+ {\@nameuse{#2@i@}(##1)(##2)}%
+ {\@nameuse{#2@i@}(##1)(##2){}}%
+ }%
+ \expandafter\def\csname #2@i@\endcsname(##1)(##2)##3{%
+ \addbefore@par{#3}%
+ \addafter@par{#1}%
+ \begin@OptexpObj
+ \ifPOE@backlayer
+ \POE@regNodes{##1}{##2}
+ \POE@extnodealign
+ \fi
+ \POE@drawcomponent[#2]{##3}{\@nameuse{#2@ii}}
+ \ifPOE@backlayer
+ \POE@Verb{ (1) (N) (\oenode{}{}) CorrectDipoleIfc }%
+ \POE@drawInternalConnections
+ \fi
+ \end@OptexpDipole
+ }%
+ \dipole@iimacro{#2}%
+ }{%
+ \PackageError{pst-optexp}{%
+ dipole component `#2' already defined
+ }%
+ }%
+\ignorespaces}%
+\def\POE@newfiberdipole[#1]#2#3{%
+ \@ifundefined{#2@i}{%
+ \@namedef{#2}{\pst@object{#2}}%
+ \expandafter\def\csname #2@i\endcsname(##1)(##2){%
+ \@ifnextchar\bgroup%
+ {\@nameuse{#2@i@}(##1)(##2)}%
+ {\@nameuse{#2@i@}(##1)(##2){}}%
+ }%
+ \expandafter\def\csname #2@i@\endcsname(##1)(##2)##3{%
+ \addbefore@par{#3}%
+ \addafter@par{#1}%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \POE@regNodes{##1}{##2}
+ \POE@extnodealign
+ \fi
+ \POE@drawcomponent[#2]{##3}{\@nameuse{#2@ii}}
+ \ifPOE@backlayer
+ \POE@Verb{ (1) (N) (\oenode{}{}) CorrectDipoleIfc }%
+ \ifPOE@fiberpreset@
+ \POE@drawPresetFibers
+ \fi
+ \fi
+ \end@OptexpDipole
+ }%
+ \fiberdipole@iimacro{#2}%
+ }{%
+ \PackageError{pst-optexp}{%
+ fiber dipole object `#2' already defined
+ }%
+ }%
+\ignorespaces}%
+\def\POE@newtripole[#1]#2#3{%
+ \@ifundefined{#2@i}{%
+ \@namedef{#2}{\pst@object{#2}}%
+ \expandafter\def\csname #2@i\endcsname(##1)(##2)(##3){%
+ \@ifnextchar\bgroup{\@nameuse{#2@i@}(##1)(##2)(##3)}%
+ {\@nameuse{#2@i@}(##1)(##2)(##3){}}%
+ }%
+ \expandafter\def\csname #2@i@\endcsname(##1)(##2)(##3)##4{%
+ \addbefore@par{#3}%
+ \addafter@par{ref@angle=180,#1}%
+ \begin@OptexpTripole
+ \ifPOE@backlayer
+ \POE@calcNodes{##1}{##2}{##3}%
+ \POE@regNodes{##1}{##3}%
+ \fi
+ \POE@drawcomponent[#2]{##4}{\@nameuse{#2@ii}}
+ \ifPOE@backlayer
+ \POE@drawInternalConnections
+ \fi
+ \end@OptexpTripole
+ }%
+ \tripole@iimacro{#2}%
+ }{%
+ \PackageError{pst-optexp}{%
+ tripole object `#2' already defined
+ }%
+ }%
+\ignorespaces}%
+\def\dipole@iimacro#1{%
+ \POE@iimacro{#1}{\dipole@nodes}%
+\ignorespaces}%
+\def\fiberdipole@iimacro#1{%
+ \POE@iimacro{#1}{\fiberdipole@nodes}%
+\ignorespaces}%
+\def\tripole@iimacro#1{%
+ \POE@iimacro{#1}{\tripole@nodes}%
+\ignorespaces}%
+\def\POE@iimacro#1#2{%
+ \@namedef{#1@ii}{%
+ \ifPOE@backlayer
+ \pnode(0,0){\oenodeCenter{}}%
+ \fi
+ \@ifundefined{#1@iii}{%
+ \ifPOE@backlayer
+ \@ifundefined{#1@nodes}{#2}{\@nameuse{#1@nodes}}%
+ \fi
+ \ifPOE@frontlayer
+ \@nameuse{#1@comp}%
+ \fi
+ }{%
+ \ifPOE@backlayer
+ \PackageWarning{pst-optexp}{%
+ Using #1@iii, please switch to the new\MessageBreak
+ interface system.}%
+ \@nameuse{#1@iii}%
+ \fi
+ }%
+ }%
+\ignorespaces}%
+\def\optcoupler{\pst@object{optcoupler}}%
+\def\optcoupler@i(#1)(#2)(#3)(#4){%
+ \@ifnextchar\bgroup%
+ {\@nameuse{optcoupler@i@}(#1)(#2)(#3)(#4)}%
+ {\@nameuse{optcoupler@i@}(#1)(#2)(#3)(#4){}}%
+}%
+\def\optcoupler@i@(#1)(#2)(#3)(#4)#5{%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \ifx\POE@key@coupleralign\POE@str@top
+ \pnode(#1){\oenodeRefA{}}
+ \pnode(#3){\oenodeRefB{}}
+ \else\ifx\POE@key@coupleralign\POE@str@bottom
+ \pnode(#2){\oenodeRefA{}}
+ \pnode(#4){\oenodeRefB{}}
+ \else
+ \pst@getcoor{#1}\POE@tempa%
+ \pst@getcoor{#2}\POE@tempb%
+ \pnode(!\POE@tempa \POE@tempb
+ \POE@dict{VecAdd 0.5 VecScale}
+ \tx@UserCoor){\oenodeRefA{}}
+ \pst@getcoor{#3}\POE@tempa%
+ \pst@getcoor{#4}\POE@tempb%
+ \pnode(!\POE@tempa \POE@tempb
+ \POE@dict{VecAdd 0.5 VecScale}
+ \tx@UserCoor){\oenodeRefB{}}
+ \fi\fi
+ \fi
+ \POE@drawcomponent[optcoupler]{#5}{\@nameuse{optcoupler@ii}}
+ \ifPOE@backlayer
+ \POE@Verb{%
+ (1) (3) (\oenode{}{}) CorrectDipoleIfc
+ (2) (N) (\oenode{}{}) CorrectDipoleIfc
+ }%
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetin@
+ \ifPOE@fiberpresetin@top
+ \drawfiber@{FiberIn1}[stopnode=1]{(#1)}%
+ {\POE@key@compname}
+ \fi
+ \ifPOE@fiberpresetin@bottom
+ \drawfiber@{FiberIn2}[stopnode=2]{(#2)}%
+ {\POE@key@compname}
+ \fi
+ \fi
+ \ifPOE@fiberpresetout@
+ \ifPOE@fiberpresetout@top
+ \drawfiber@{FiberOut}[startnode=3]{\POE@key@compname}%
+ {(#3)}
+ \fi
+ \ifPOE@fiberpresetout@bottom
+ \drawfiber@{FiberOut2}[startnode=N]{\POE@key@compname}%
+ {(#4)}
+ \fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+\fiberdipole@iimacro{optcoupler}%
+\def\wdmsplitter{\pst@object{wdmsplitter}}%
+\def\wdmsplitter@i(#1)(#2)(#3){%
+ \@ifnextchar\bgroup%
+ {\wdmsplitter@i@(#1)(#2)(#3)}%
+ {\wdmsplitter@i@(#1)(#2)(#3){}}%
+}%
+\def\wdmsplitter@i@(#1)(#2)(#3)#4{%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \pnode(#1){\oenodeRefA{}}
+ \ifx\POE@key@coupleralign\POE@str@top
+ \pnode(#2){\oenodeRefB{}}
+ \else\ifx\POE@key@coupleralign\POE@str@bottom
+ \pnode(#3){\oenodeRefB{}}
+ \else
+ \pst@getcoor{#2}\POE@tempa%
+ \pst@getcoor{#3}\POE@tempb%
+ \pnode(!\POE@tempa \POE@tempb
+ \POE@dict{VecAdd 0.5 VecScale}
+ \tx@UserCoor){\oenodeRefB{}}
+ \fi\fi
+ \fi
+ \POE@drawcomponent[wdmsplitter]{#4}\wdmsplitter@ii
+ \ifPOE@backlayer
+ \POE@Verb{%
+ (1) (2) (\oenode{}{}) CorrectDipoleIfc
+ (1) (N) (\oenode{}{}) CorrectDipoleIfc
+ }%
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetin@
+ \drawfiber@{FiberIn}[stopnode=1]{(#1)}{\POE@key@compname}
+ \fi
+ \ifPOE@fiberpresetout@
+ \ifPOE@fiberpresetout@top
+ \drawfiber@{FiberOut1}[startnode=2]%
+ {\POE@key@compname}{(#2)}
+ \fi
+ \ifPOE@fiberpresetout@bottom
+ \drawfiber@{FiberOut2}[startnode=N]%
+ {\POE@key@compname}{(#3)}
+ \fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+\fiberdipole@iimacro{wdmsplitter}%
+\def\wdmcoupler{\pst@object{wdmcoupler}}%
+\def\wdmcoupler@i(#1)(#2)(#3){%
+ \@ifnextchar\bgroup%
+ {\wdmcoupler@i@(#1)(#2)(#3)}%
+ {\wdmcoupler@i@(#1)(#2)(#3){}}%
+}%
+\def\wdmcoupler@i@(#1)(#2)(#3)#4{%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \pnode(#3){\oenodeRefB{}}
+ \ifx\POE@key@coupleralign\POE@str@top
+ \pnode(#1){\oenodeRefA{}}
+ \else\ifx\POE@key@coupleralign\POE@str@bottom
+ \pnode(#2){\oenodeRefA{}}
+ \else
+ \pst@getcoor{#1}\POE@tempa%
+ \pst@getcoor{#2}\POE@tempb%
+ \pnode(!\POE@tempa \POE@tempb
+ \POE@dict{VecAdd 0.5 VecScale}
+ \tx@UserCoor){\oenodeRefA{}}
+ \fi\fi
+ \fi
+ \POE@drawcomponent[wdmcoupler]{#4}\wdmcoupler@ii
+ \ifPOE@backlayer
+ \POE@Verb{%
+ (1) (N) (\oenode{}{}) CorrectDipoleIfc
+ (2) (N) (\oenode{}{}) CorrectDipoleIfc
+ }%
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetout@
+ \drawfiber@{FiberOut}[startnode=N]{\POE@key@compname}{(#3)}
+ \fi
+ \ifPOE@fiberpresetin@
+ \ifPOE@fiberpresetin@top
+ \drawfiber@{FiberIn1}[stopnode=1]{(#1)}{\POE@key@compname}
+ \fi
+ \ifPOE@fiberpresetin@bottom
+ \drawfiber@{FiberIn2}[stopnode=2]{(#2)}{\POE@key@compname}
+ \fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+\fiberdipole@iimacro{wdmcoupler}%
+\def\optcirculator{\pst@object{optcirculator}}%
+\def\optcirculator@i(#1)(#2)(#3){%
+ \@ifnextchar\bgroup%
+ {\optcirculator@i@(#1)(#2)(#3)}%
+ {\optcirculator@i@(#1)(#2)(#3){}}%
+}%
+\def\optcirculator@i@(#1)(#2)(#3)#4{%
+ \addafter@par{ref@angle=180}%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \POE@regNodes{#1}{#2}
+ \ifx\POE@key@position\@empty
+ \ifx\POE@key@abspos\@empty
+ \POE@positionrefnodes
+ \pst@getcoor{#1}\POE@tempa%
+ \pst@getcoor{#2}\POE@tempc%
+ \pst@getcoor{#3}\POE@tempb%
+ \pnode(! \POE@dict{%
+ \POE@tempa \tx@UserCoor 2 copy 2 copy
+ \POE@tempc \tx@UserCoor 4 2 roll @ABVect
+ 2 copy 2 copy 10 4 roll
+ \POE@tempb \tx@UserCoor 6 -2 roll @ABVect
+ 4 2 roll tx@EcldDict begin Project end VecAdd
+ 2 copy 6 -2 roll -0.5 VecScale VecAdd
+ }){\oenode@RefA{}}%
+ \pnode(! \POE@dict{4 2 roll 0.5 VecScale VecAdd})%
+ {\oenode@RefB{}}%
+ \fi
+ \fi
+ \fi
+ \POE@drawcomponent[optcirculator]{#4}\optcirculator@ii
+ \ifPOE@backlayer
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetin@top
+ \drawfiber@{FiberIn}[stopnode=1]{(#1)}{\POE@key@compname}
+ \fi
+ \ifPOE@fiberpresetout@
+ \ifPOE@fiberpresetout@top
+ \drawfiber@{FiberOut1}[startnode=N]%
+ {\POE@key@compname}{(#2)}
+ \fi
+ \ifPOE@fiberpresetout@bottom
+ \drawfiber@{FiberOut2}[startnode=2, fiberalign=center]%
+ {\POE@key@compname}{(#3)}
+ \fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+\fiberdipole@iimacro{optcirculator}%
+\def\POE@calcNodes#1#2#3{{%
+ \pst@getcoor{#1}\POE@tempa%
+ \pst@getcoor{#2}\POE@tempb%
+ \pst@getcoor{#3}\POE@tempc%
+ \pnode(! \POE@dict{%
+ \POE@tempa \tx@UserCoor
+ \POE@tempc \tx@UserCoor
+ \POE@tempb \tx@UserCoor
+ calcNodes
+ X@A Y@A}){\oenode@RefA{}}%
+ \pnode(! \POE@dict{X@B Y@B}){\oenode@RefB{}}%
+}\ignorespaces}%
+\def\POE@regNodes#1#2{%
+ \pnode(#1){\oenodeRefA{}}
+ \pnode(#2){\oenodeRefB{}}
+ \POE@Verb{%
+ /@xref \POE@key@extnode@xref\space def
+ /@yref \POE@key@extnode@yref\space def
+ }%
+\ignorespaces}%
+\def\POE@extnodealign{%
+ \ifx\POE@key@extnodealign\POE@str@absolute
+ \POE@Verb{%
+ /N@\oenodeRefA{} @GetCenter /N@\oenodeRefB{} @GetCenter
+ @ABVect exch
+ dup 0 gt 3 1 roll 0 eq exch 0 lt and or
+ { /RefFac -1 def } if
+ }%
+ \fi
+\ignorespaces}%
+\def\POE@pnode@shiftedrot(#1)#2#3#4{%
+ \pst@getcoor{#1}\POE@temp%
+ \pnode(!%
+ \POE@temp /YDiff ED /XDiff ED %
+ /N@#2 load GetCenter /YShifted ED /XShifted ED
+ /rot@angle #4 \POE@key@labelrefangle\space add def
+ /XDiff@Rot rot@angle cos XDiff mul rot@angle sin YDiff mul add def
+ /YDiff@Rot rot@angle cos YDiff mul rot@angle sin XDiff mul sub def
+ XShifted XDiff@Rot add YShifted YDiff@Rot add neg \tx@UserCoor
+ ){#3}%
+ \psset[optexp]{ref@angle=0}
+}%
+\def\POE@nlput{\pst@object{POE@nlput}}
+\def\POE@nlput@i(#1)(#2)#3#4{%
+ \begin@SpecialObj
+ \POE@LDNode(#1)(#2){#3}
+ \pcline[linestyle=none](temp@nlputA)(temp@nlputB)%
+ \ncput[npos=0.5]{#4}%
+ \end@SpecialObj}
+\def\POE@LDNode(#1)(#2)#3{%
+ \pst@getcoor{#1}\pst@tempA%
+ \pst@getcoor{#2}\pst@tempB%
+ \pnode(!
+ \pst@tempA \tx@UserCoor /YA ED /XA ED
+ \pst@tempB \tx@UserCoor /YB ED /XB ED
+ /dx XB XA sub def
+ /dy YB YA sub def
+ /angle dy dx Atan def
+ XA #3 1 sub angle cos mul add
+ YA #3 1 sub angle sin mul add ){temp@nlputA}%
+ \pnode(!
+ \pst@tempA \tx@UserCoor /YA ED /XA ED
+ \pst@tempB \tx@UserCoor /YB ED /XB ED
+ /dx XB XA sub def
+ /dy YB YA sub def
+ /angle dy dx Atan def
+ XA #3 1 add angle cos mul add
+ YA #3 1 add angle sin mul add ){temp@nlputB}%
+}
+\def\POE@putlabelrelative#1{%
+ \nput[labelsep=0]{\POE@key@labelangle}%
+ {\oenodeLabel{}}%
+ {\rput[\POE@key@labelalign](0,0){\POE@key@labelstyle #1}}%
+}%
+\def\POE@putcomp#1{%
+ \rput(! \POE@key@comp@Xshift\space\POE@key@comp@Yshift){%
+ \pnode(! \POE@dict{
+ \POE@key@rotate@xref\space
+ \POE@key@rotate@yref\space
+ DefineExtNode}){\oenodeRotref{}}%
+ \ifdim\POE@key@angle pt=0pt
+ #1%
+ \POE@pnode@shiftedrot(0,\POE@key@labeloffset)%
+ {\oenodeCenter{}}%
+ {\oenodeLabel{}}%
+ {\POE@key@labelangle}%
+ \else
+ \psrotate(\oenodeRotref{}){\POE@key@angle}{%
+ #1%
+ \POE@pnode@shiftedrot(0,\POE@key@labeloffset)%
+ {\oenodeCenter{}}%
+ {\oenodeLabel{}}%
+ {\POE@key@labelangle}%
+ }%
+ \fi%
+ }%
+}%
+\def\POE@putlabel#1{%
+ \def\POE@temp{#1}%
+ \ifx\POE@temp\@empty\else
+ \ifx\POE@key@labelref\POE@str@labelref@global
+ \nput[labelsep=\POE@key@labeloffset]%
+ {\POE@key@labelangle}%
+ {\oenodeCenter{}}%
+ {\pnode(0,0){\oenodeLabel{}}%
+ \rput[\POE@key@labelalign](0,0){\POE@key@labelstyle #1}}%
+ \else\ifx\POE@key@labelref\POE@str@labelref@relgrav
+ \rput[\POE@key@labelalign](\oenodeLabel{}){%
+ \POE@key@labelstyle #1}%
+ \else\ifx\POE@key@labelref\POE@str@relative
+ \begingroup
+ \pst@def{InitNC}< % kindly contributed by Herbert Voss
+ /b ED /a ED
+ /NodeSepTypeB ED /NodeSepTypeA ED
+ /NodeSepB ED /NodeSepA ED
+ /OffsetB ED /OffsetA ED
+ tx@NodeDict a known tx@NodeDict b known and dup {
+ /NodeA a load def /NodeB b load def
+ NodeA GetCenter NodeB GetCenter
+ 4 copy exch 4 -1 roll 2 copy gt
+ { pop pop pop pop /yB ED /xB ED /yA ED /xA ED }
+ { eq 3 1 roll lt and
+ { /yB ED /xB ED /yA ED /xA ED}
+ { /yA ED /xA ED /yB ED /xB ED} ifelse
+ } ifelse
+ } if >%
+ \ncline[linestyle=none,fillstyle=none, npos=]%
+ {\POE@trefnodeA}{\POE@trefnodeB}%
+ \ifx\POE@key@position\@empty
+ \ifx\POE@key@abspos\@empty
+ \ncput[nrot=:U,npos=]{\POE@putlabelrelative{#1}}%
+ \else
+ \POE@nlput[nrot=:U](\POE@trefnodeA)(\POE@trefnodeB)%
+ {\POE@key@abspos}{\POE@putlabelrelative{#1}}%
+ \fi
+ \else
+ \ncput[nrot=:U, npos=\POE@key@position]%
+ {\POE@putlabelrelative{#1}}%
+ \fi
+ \endgroup
+ \fi\fi\fi
+ \fi
+}%
+\newOptexpDipole{lens}{}%
+\newOptexpDipole{pinhole}{}%
+\newOptexpDipole{crystal}{}%
+\newOptexpDipole{polarization}{}%
+\newOptexpDipole{optbox}{}%
+\newOptexpDipole{optplate}{}%
+\newOptexpDipole{optretplate}{}%
+\newOptexpDipole[endbox]{optdetector}{}%
+\newOptexpDipole{optdiode}{allowbeaminside=false}%
+\newOptexpDipole{doveprism}{}%
+\newOptexpTripole{mirror}{}%
+\newOptexpTripole[ref@angle=-135]{beamsplitter}{}%
+\newOptexpTripole{optgrating}{}%
+\def\optgrid{%
+ \PackageWarning{pst-optexp}{%
+ \string\optgrid\space is deprecated,\MessageBreak
+ use \string\optgrating\space instead.}%
+ \optgrating%
+}%
+\newOptexpTripole[ref@angle=-135]{pentaprism}{}%
+\newOptexpTripole[ref@angle=-135]{rightangleprism}{}%
+\newOptexpTripole[ref@angle=-135]{optprism}{}%
+\def\optdipole{\pst@object{optdipole}}
+\def\optdipole@i(#1)(#2)#3#4{%
+ \begin@OptexpObj
+ \ifPOE@backlayer
+ \POE@regNodes{#1}{#2}
+ \POE@extnodealign
+ \fi
+ \POE@drawcomponent{#4}{%
+ \ifPOE@backlayer
+ \pnode(0,0){\oenodeCenter{}}%
+ \newOptexpComp{{0 0} {0 1} 0 0 trans {PlainIfc} 1 }%
+ \fi
+ \ifPOE@frontlayer
+ #3
+ \fi
+ }%
+ \ifPOE@backlayer
+ \POE@drawInternalConnections
+ \fi
+ \end@OptexpObj
+}%
+\def\opttripole{\pst@object{opttripole}}
+\def\opttripole@i(#1)(#2)(#3)#4#5{%
+ \begin@OptexpTripole
+ \ifPOE@backlayer
+ \POE@regNodes{#1}{#3}%
+ \POE@calcNodes{#1}{#2}{#3}%
+ \fi
+ \POE@drawcomponent{#5}{%
+ \pnode(0,0){\oenodeCenter{}}%
+ \newOptexpComp{{0 0} {1 0} 0 0 refl {PlainIfc} 1 }%
+ #4
+ }%
+ \POE@drawInternalConnections
+ \end@OptexpTripole
+}%
+\def\fibercollimator{\pst@object{fibercollimator}}
+\def\fibercollimator@i(#1)(#2){%
+ \def\POE@tempa{#1}%
+ \def\POE@tempb{#2}%
+ \def\POE@tempc{}%
+ \def\POE@tempd{}%
+ \@ifnextchar(%)
+ {\fibercollimator@ii}{\fibercollimator@iv}%
+}%
+\def\fibercollimator@ii(#1){%
+ \def\POE@tempc{#1}%
+ \@ifnextchar(%)
+ {\fibercollimator@iii}{\fibercollimator@iv}%
+}%
+\def\fibercollimator@iii(#1){%
+ \def\POE@tempd{#1}%
+ \fibercollimator@iv
+}%
+\def\fibercollimator@iv{%
+ \@ifnextchar\bgroup{\fibercollimator@v}{\fibercollimator@v{}}%
+}%
+\def\fibercollimator@v#1{%
+ \begin@OptexpFiberObj
+ \ifPOE@backlayer
+ \POE@regNodes{\POE@tempa}{\POE@tempb}%
+ \POE@extnodealign
+ \fi
+ \POE@drawcomponent[fibercollimator]{#1}{%
+ \pnode(0,0){\oenodeCenter{}}%
+ \ifPOE@backlayer
+ \fibercollimator@nodes
+ \fi
+ \ifPOE@frontlayer
+ \fibercollimator@comp
+ \fi
+ }%
+ \ifPOE@backlayer
+ \ifPOE@beam
+ \drawbeam{(\oenodeRefA{})}{\POE@key@compname}
+ \fi
+ \ifPOE@fiberpreset@
+ \ifPOE@fiberpresetout@
+ \ifx\@empty\POE@tempc
+ \drawfiber{\POE@key@compname}{(\oenodeRefB{})}
+ \else\ifx\@empty\POE@tempd
+ \psbezier[style=FiberOut](\oenodeOut{})(\POE@tempb)%
+ (\POE@tempb)(\POE@tempc)%
+ \else
+ \psbezier[style=FiberOut](\oenodeOut{})(\POE@tempb)%
+ (\POE@tempc)(\POE@tempd)%
+ \fi\fi
+ \fi
+ \fi
+ \fi
+ \end@OptexpObj
+}%
+\newOptexpFiberDipole{optfiber}{newOptComp={}}
+\newOptexpFiberDipole{optamp}{}
+\newOptexpFiberDipole{optmzm}{}
+\newOptexpFiberDipole{optfilter}{allowbeaminside=false}
+\newOptexpFiberDipole{polcontrol}{}
+\newOptexpFiberDipole{optisolator}{}
+\newOptexpFiberDipole{optfiberpolarizer}{}
+\newOptexpFiberDipole{optswitch}{}
+\newOptexpFiberDipole{fiberdelayline}{}
+\def\POE@drawcomponent{%
+ \@ifnextchar[%]
+ {\POE@drawcomponent@i}{\POE@drawcomponent@i[]}%
+}%
+\def\POE@drawcomponent@i[#1]#2#3{%
+ \def\@@comp{%
+ #3%
+ \ifx\POE@key@extnode\@empty\else
+ \ifPOE@backlayer
+ \pnode(! \POE@dict{
+ \POE@key@extnode@xref\space
+ \POE@key@extnode@yref\space
+ DefineExtNode}){\oenodeExt{}}%
+ \POE@Verb{%
+ tx@NodeDict begin /N@\oenodeExt{} load
+ \ifnum9<1\POE@key@compname
+ /N@ExtNode
+ \else
+ /N@\POE@key@compname ExtNode
+ \fi
+ ED end
+ }%
+ \fi
+ \fi
+ }%
+ \@ifundefined{#1@ref}{}{\@nameuse{#1@ref}}%
+ \ifPOE@endbox
+ \psset[optexp]{abspos={%
+ \POE@dict{%
+ /N@\POE@refnodeA\space @GetCenter \tx@UserCoor
+ /N@\POE@refnodeB\space @GetCenter \tx@UserCoor
+ @ABDist @@x0 @@x add add
+ }%
+ }}%
+ \else\ifPOE@startbox
+ \psset[optexp]{abspos={\POE@dict{ @@x0 neg @@x sub }}}%
+ \fi\fi
+ \POE@disablepos
+ \ncline[linestyle=none,fillstyle=none,npos=]%
+ {\POE@refnodeA}{\POE@refnodeB}%
+ \begingroup
+ \psset{style=OptComp}%
+ \ifPOE@component@optional
+ \psset{style=OptionalStyle}%
+ \fi
+ \ifx\POE@key@abspos\@empty
+ \ifx\POE@key@position\@empty
+ \ncput[nrot=:U,npos=]{\POE@putcomp{\@@comp}}%
+ \else
+ \ncput[nrot=:U,npos=\POE@key@position]{\POE@putcomp{\@@comp}}%
+ \fi
+ \else
+ \POE@nlput[nrot=:U](\POE@refnodeA)(\POE@refnodeB)%
+ {\POE@key@abspos}{\POE@putcomp{\@@comp}}%
+ \fi
+ \endgroup
+ \ifPOE@backlayer
+ \POE@transformnodes
+ \fi
+ \ifPOE@frontlayer
+ \POE@putlabel{#2}%
+ \fi
+ \ifPOE@debug@showoptdots
+ \ifPOE@frontlayer
+ \psdot[linecolor=red](\oenodeCenter{})
+ \psdot[linecolor=red, dotstyle=x, dotscale=1.5](\oenodeLabel{})
+ \psdot[linecolor=black](\oenodeRefA{})
+ \psdot[linecolor=black](\oenodeRefB{})
+ \psdot[linecolor=black, dotstyle=x,
+ dotscale=1.5](\oenodeTrefA{})
+ \psdot[linecolor=black, dotstyle=x,
+ dotscale=1.5](\oenodeTrefB{})
+ \fi
+ \fi
+ \ifPOE@debug@showifcnodes
+ \ifPOE@frontlayer
+ \POE@ifcnodes[style=IfcNodeStyle]
+ \fi
+ \fi
+\ignorespaces}%
+\let\POE@setref\POE@Verb
+\def\POE@transformnode#1#2{%
+ \pnode(!
+ \POE@dict{%
+ /N@\oenodeRotref{} @GetCenter 2 copy
+ /N@#1 @GetCenter
+ \POE@key@comp@Xshift\space\POE@key@comp@Yshift\space
+ \tx@ScreenCoor VecAdd 4 2 roll @ABVect
+ \POE@key@angle\space matrix rotate dtransform VecAdd
+ \tx@UserCoor
+ }){#2}%
+}%
+\def\POE@ifcnodes{\pst@object{POE@ifcnodes}}
+\def\POE@ifcnodes@i{%
+ \begin@SpecialObj%
+ \solid@star%
+ \addto@pscode{
+ \psk@dotsize
+ \@nameuse{psds@\psk@dotstyle}
+ \POE@dict{[ (\oenode{}{}) false GetInternalBeamNodes %]
+ counttomark 2 idiv { Dot } repeat
+ pop}
+ }%
+ \end@SpecialObj
+}%
+\def\POE@extnodes{\pst@object{POE@extnodes}}
+\def\POE@extnodes@i#1{%
+ \begin@SpecialObj
+ \let\POE@setref\addto@pscode
+ \addto@pscode{\pst@optexpdict InitOptexpComp }
+ \@ifundefined{#1@ref}{}{\@nameuse{#1@ref}}%
+ \solid@star%
+ \addto@pscode{
+ \psk@dotsize
+ \@nameuse{psds@\psk@dotstyle}
+ @@x 0 eq { [0] }{ [ @@x neg 0 @@x ] } ifelse
+ {
+ @@y 0 eq { [0] }{ [@@y neg 0 @@y ] } ifelse
+ {
+ exch dup 3 1 roll
+ @@x0 add exch @@y0 add \tx@ScreenCoor
+ /\oenode{}{} load begin CompMtrx end transform CM itransform
+ Dot
+ } forall
+ pop
+ } forall
+ end
+ }%
+ \end@SpecialObj
+}%
+\def\tripole@nodes{%
+ \newOptexpComp{{0 0} {1 0} @@x neg @@x refl {PlainIfc} 1}%
+ \pnode(! \POE@dict{@@y0 @@x0}){\oenodeCenter{}}
+\ignorespaces}%
+\def\dipole@nodes{%
+ \newOptexpComp{%
+ {@@x0 @@x sub 0} {0 1} @@y0 @@y sub @@y0 @@y add trans {PlainIfc}
+ @@x 0 eq not {
+ {@@x0 @@x add 0} {0 1} @@y0 @@y sub @@y0 @@y add trans {PlainIfc}
+ } if \POE@key@n }%
+ \pnode(! \POE@dict{@@x0 @@y0}){\oenodeCenter{}}
+\ignorespaces}%
+\def\fiberdipole@nodes{%
+ \newOptexpFiberComp{%
+ {@@x0 @@x sub 0}
+ @@x 0 eq not {
+ {@@x0 @@x add 0}
+ } if }%
+ \pnode(! \POE@dict{@@x0 @@y0}){\oenodeCenter{}}
+\ignorespaces}%
+\def\mirror@ref{%
+ \ifdim\POE@key@mirrorradius pt=0pt
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@piezo
+ \POE@setref{/@@y0 \pst@number\psyunit def}%
+ \bgroup
+ \psset{style=PiezoMirror}
+ \POE@setref{%
+ \pst@number\psyunit @@y0 div
+ \POE@key@mirrorwidth\space 0.5 mul mul 2.5 div /@@y0 ED
+ }%
+ \egroup
+ \else
+ \POE@setref{/@@x \POE@key@mirrorwidth\space 0.5 mul def}%
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@plain\else
+ \POE@setref{\POE@key@mirrordepth\space 0.5 mul dup /@@y0 ED /@@y ED}
+ \fi
+ \fi
+ \fi
+}%
+\def\mirror@nodes{%
+ \ifdim\POE@key@mirrorradius pt=0pt
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@semitrans
+ \newOptexpCompAmb{%
+ {0 0} {1 0}
+ \POE@key@mirrorwidth\space -0.5 mul dup neg
+ refl {PlainIfc}
+ {0 \POE@key@mirrordepth} {1 0}
+ \POE@key@mirrorwidth\space -0.5 mul dup neg
+ trans {PlainIfc}
+ \POE@key@mirrordepth\space -1e-5 lt {
+ 12 6 roll 2
+ } {
+ \POE@key@mirrordepth\space 1e-5 lt {
+ 6 {pop} repeat
+ } if
+ 1
+ } ifelse
+ \POE@key@n }%
+ \else
+ \newOptexpComp{%
+ {0 0} {1 0}
+ \POE@key@mirrorwidth\space -0.5 mul dup neg
+ refl {PlainIfc} 1 }%
+ \fi
+ \else
+ \newOptexpComp{%
+ {0 0} {0 \POE@key@mirrorradius\space neg}
+ \POE@key@mirrorwidth\space -0.5 mul dup neg
+ refl {CurvedIfc} 1 }%
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@semitrans
+ \PackageWarning{pst-optexp}{%
+ Mirrortype 'semitrans' does not support curved\MessageBreak
+ mirror, falling back to 'plain' type.}%
+ \fi
+ \fi
+}%
+\def\mirror@comp{%
+ \edef\@ht{%
+ \POE@key@mirrorwidth\space\pst@number\psyunit mul 0.5 mul %
+ }%
+ \edef\@dp{\POE@key@mirrordepth\space\pst@number\psxunit mul }%
+ \edef\@r{\POE@key@mirrorradius\space\pst@number\psxunit mul }%
+ \edef\@postcode{%
+ neg 5 -1 roll exch 5 2 roll 90 add exch 90 add exch ArcR %
+ }%
+ \edef\@extpostcode{%
+ neg \@dp add 5 -1 roll exch 5 2 roll 90 add exch 90 add %
+ }%
+ \ifdim\POE@key@mirrorradius pt<0pt
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@extended
+ \bgroup
+ \psset{style=ExtendedMirror}
+ \begin@ClosedObj
+ \addto@pscode{%
+ \pst@optexpdict \@ht \@r rightCurvedIfc \@postcode
+ \@ht \@r rightCurvedIfc \@extpostcode arc
+ closepath end}%
+ \end@ClosedObj
+ \egroup
+ \fi
+ \bgroup
+ \psset{linewidth=\POE@key@mirrorlinewidth}
+ \begin@OpenObj
+ \addto@pscode{\POE@dict{ \@ht \@r rightCurvedIfc \@postcode }}%
+ \end@OpenObj
+ \egroup
+ \else\ifdim\POE@key@mirrorradius pt>0pt
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@extended
+ \bgroup
+ \psset{style=ExtendedMirror}
+ \begin@ClosedObj
+ \addto@pscode{%
+ \pst@optexpdict \@ht \@r rightCurvedIfc \@postcode
+ \@ht \@r rightCurvedIfc \@extpostcode arcn
+ closepath end}%
+ \end@ClosedObj
+ \egroup
+ \fi
+ \bgroup
+ \psset{linewidth=\POE@key@mirrorlinewidth}
+ \begin@OpenObj
+ \addto@pscode{\POE@dict{ \@ht \@r rightCurvedIfc \@postcode }}%
+ \end@OpenObj
+ \egroup
+ \else
+ \edef\@ht{\POE@key@mirrorwidth\space 0.5 mul }%
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@piezo
+ \psframe[style=PiezoMirror,
+ dimen=outer](! \@ht 4 div 0)%
+ (! \@ht -4 div \@ht 2.5 div)
+ \ifx\POE@key@extnode\@empty
+ \psbezier(! 0 \@ht 2.5 div)%
+ (! 0 \@ht 1.5 div)%
+ (! \@ht 2 div \@ht 2 div)%
+ (! \@ht 4 div \@ht)
+ \fi
+ \else\ifx\POE@key@mirrortype\POE@str@mirrortype@extended
+ \psframe[style=ExtendedMirror]%
+ (! \@ht neg \POE@key@mirrordepth\space )%
+ (! \@ht 0)
+ \else\ifx\POE@key@mirrortype\POE@str@mirrortype@semitrans
+ \psframe[style=SemitransMirror]%
+ (! \@ht neg \POE@key@mirrordepth\space )%
+ (! \@ht 0)
+ \fi\fi\fi
+ \ifx\POE@key@mirrortype\POE@str@mirrortype@semitrans
+ \psline[linewidth=\POE@key@mirrorlinewidth]%
+ (! \@ht neg 0)(! \@ht 0)
+ \else
+ \psline[linewidth=\POE@key@mirrorlinewidth]%
+ (! \@ht neg \getCLWH)(! \@ht \getCLWH)
+ \fi
+ \fi\fi
+ \ifPOE@variable
+ \psarc[style=VariableStyle]%
+ (! \POE@key@mirrorwidth\space 0.5 mul 0.4 sub
+ \ifdim\POE@key@mirrorradius pt=0pt
+ 0
+ \else
+ \POE@key@mirrorradius\space dup \POE@dict{sign} neg exch
+ \POE@key@mirrorwidth\space 0.5 mul \POE@dict{capHeight} mul
+ \fi){0.6}{-20}{20}
+ \psarc[style=VariableStyle]%
+ (! 0.4 \POE@key@mirrorwidth\space 0.5 mul sub
+ \ifdim\POE@key@mirrorradius pt=0pt
+ 0
+ \else
+ \POE@key@mirrorradius\space dup \POE@dict{sign} neg exch
+ \POE@key@mirrorwidth\space 0.5 mul \POE@dict{capHeight} mul
+ \fi){0.6}{160}{200}
+ \fi
+}%
+\def\lens@ref{%
+ \ifdim\POE@key@lensradiusleft pt=0pt
+ \edef\@th{0 }%
+ \else
+ \edef\@th{%
+ \ifPOE@thicklens
+ \POE@key@lenswidth\space 0.5 mul
+ \else
+ \ifdim\POE@key@lensradiusleft pt<0pt
+ \POE@key@lensheight\space 0.075 mul
+ \else
+ \POE@key@lensradiusleft
+ \POE@key@lensheight\space 0.5 mul capHeight
+ \fi
+ \fi
+ \space}%
+ \fi
+ \ifdim\POE@key@lensradiusright pt=0pt\else
+ \edef\@th{%
+ \@th\space
+ \ifPOE@thicklens
+ \POE@key@lenswidth\space 0.5 mul
+ \else
+ \ifdim\POE@key@lensradiusright pt<0pt
+ \POE@key@lensheight\space 0.075 mul
+ \else
+ \POE@key@lensradiusright
+ \POE@key@lensheight\space 0.5 mul capHeight
+ \fi
+ \fi
+ \space add
+ \space}%
+ \fi
+ \POE@setref{%
+ /@@y \POE@key@lensheight\space 0.5 mul def
+ /@@x \@th 0.5 mul def
+ }%
+}%
+\def\lens@nodes{%
+ \newOptexpComp{%
+ {@@x neg 0}
+ \ifdim\POE@key@lensradiusleft pt=0pt
+ {0 1}
+ \POE@key@lensheight\space -0.5 mul dup neg
+ trans {PlainIfc}
+ \else
+ {\POE@key@lensradiusleft\space 0}
+ \POE@key@lensheight\space -0.5 mul dup neg
+ trans {CurvedIfc}
+ \fi
+ {@@x 0}
+ \ifdim\POE@key@lensradiusright pt=0pt
+ {0 1}
+ \POE@key@lensheight\space -0.5 mul dup neg
+ trans {PlainIfc}
+ \else
+ {\POE@key@lensradiusright\space neg 0}
+ \POE@key@lensheight\space -0.5 mul dup neg
+ trans {CurvedIfc}
+ \fi
+ \POE@key@n
+ }%
+}%
+\def\lens@comp{%
+ \addbefore@par{linejoin=1}%
+ \begin@ClosedObj
+ \addto@pscode{\pst@optexpdict }%
+ \def\@th{0}%
+ \def\@wd{\POE@key@lenswidth\space\pst@number\psxunit mul 2 div }%
+ \def\@ht{\POE@key@lensheight\space\pst@number\psyunit mul 2 div }%
+ \def\@rL{\POE@key@lensradiusleft\space\pst@number\psrunit mul }%
+ \def\@rR{\POE@key@lensradiusright\space\pst@number\psrunit mul }%
+ \ifdim\POE@key@lensradiusleft pt=0pt\else
+ \addto@pscode{ \@ht \@rL leftCurvedIfc }%
+ \fi
+ \ifdim\POE@key@lensradiusright pt=0pt\else
+ \addto@pscode{ \@ht \@rR rightCurvedIfc }%
+ \fi
+ \def\@@x{@@x \pst@number\psxunit mul }%
+ \ifdim\POE@key@lensradiusleft pt=0pt
+ \ifdim\POE@key@lensradiusright pt=0pt\else
+ \addto@pscode{%
+ \@@x sub neg 5 1 roll
+ \@@x neg \@ht neg moveto ArcR
+ \@@x neg \@ht lineto
+ }%
+ \fi
+ \fi
+ \ifdim\POE@key@lensradiusright pt=0pt
+ \ifdim\POE@key@lensradiusleft pt=0pt\else
+ \addto@pscode{%
+ \@@x sub 5 1 roll
+ \@@x \@ht moveto ArcL
+ \@@x \@ht neg lineto
+ }%
+ \fi
+ \fi
+ \ifdim\POE@key@lensradiusright pt=0pt\else
+ \ifdim\POE@key@lensradiusleft pt=0pt\else
+ \addto@pscode{%
+ \@@x dup
+ 7 1 roll sub neg 5 1 roll
+ ArcR sub 5 1 roll ArcL
+ }%
+ \fi
+ \fi
+ \addto@pscode{closepath 1 setlinejoin end }%
+ \end@ClosedObj
+\ignorespaces}%
+\def\pinhole@ref{%
+ \POE@setref{/@@y \POE@key@outerheight\space 0.5 mul def}%
+\ignorespaces}%
+\def\pinhole@nodes{%
+ \newOptexpComp{%
+ {-1e-4 0} {0 1} @@y0 @@y sub @@y0 @@y add trans {PlainIfc}
+ {0 0} {0 1} \POE@key@innerheight\space -0.5 mul dup neg
+ trans {PlainIfc}
+ {1e-4 0} {0 1} @@y0 @@y sub @@y0 @@y add trans {PlainIfc}
+ \POE@key@n }%
+\ignorespaces}%
+\def\pinhole@comp{%
+ \ifdim\POE@key@phwidth pt=0pt
+ \psline[linewidth=\POE@key@phlinewidth]%
+ (! 0 \POE@key@outerheight\space 2 div)%
+ (! 0 \POE@key@innerheight\space 2 div)%
+ \psline[linewidth=\POE@key@phlinewidth]%
+ (! 0 \POE@key@outerheight\space -2 div)%
+ (! 0 \POE@key@innerheight\space -2 div)%
+ \else
+ \pspolygon*[linestyle=none]%
+ (! 0 \POE@key@innerheight\space 2 div)%
+ (! 0 \POE@key@outerheight\space 2 div)%
+ (! \POE@key@phwidth\space\POE@key@outerheight\space 2 div)%
+ (! \POE@key@phwidth\space\POE@key@innerheight\space dup neg
+ \POE@key@outerheight\space add 2 div add 2 div)%
+ \pspolygon*[linestyle=none]%
+ (! 0 \POE@key@innerheight\space -2 div)%
+ (! 0 \POE@key@outerheight\space -2 div)%
+ (! \POE@key@phwidth\space\POE@key@outerheight\space -2 div)%
+ (! \POE@key@phwidth\space\POE@key@innerheight\space dup neg
+ \POE@key@outerheight\space add 2 div add -2 div)%
+ \fi
+\ignorespaces}%
+\def\beamsplitter@ref{%
+ \POE@setref{/@@x \POE@key@bssize\space 0.5 sqrt mul def }%
+}%
+\def\beamsplitter@nodes{%
+ \edef\@bs@wd{\POE@key@bssize\space 0.5 mul }%
+ \ifx\POE@key@bsstyle\POE@str@bsstyle@cube
+ \newOptexpCompAmb{%
+ {\@bs@wd 2 sqrt div neg dup} {-1 1} \@bs@wd neg \@bs@wd
+ trans {PlainIfc}
+ {\@bs@wd 2 sqrt div dup neg} {1 1} \@bs@wd neg \@bs@wd
+ trans {PlainIfc}
+ {0 0} {1 0} \@bs@wd 2 sqrt mul dup neg exch
+ trans {PlainIfc}
+ {\@bs@wd 2 sqrt div dup} {-1 1} \@bs@wd neg \@bs@wd
+ trans {PlainIfc}
+ {\@bs@wd 2 sqrt div neg dup neg} {1 1} \@bs@wd neg \@bs@wd
+ trans {PlainIfc}
+ 3 \POE@key@n
+ }%
+ \else\ifx\POE@key@bsstyle\POE@str@bsstyle@plate
+ \newOptexpCompAmb{%
+ {0 0} {1 0} \@bs@wd neg \@bs@wd trans {PlainIfc} 1 1 }%
+ \fi\fi
+\ignorespaces}%
+\def\beamsplitter@comp{%
+ \edef\@bs@wd{\POE@key@bssize\space 2.0 div }%
+ \ifx\POE@key@bsstyle\POE@str@bsstyle@cube
+ \psline[arrows=cc-cc](! \@bs@wd neg 2 sqrt mul 0)
+ (! \@bs@wd 2 sqrt mul 0)
+ \rput[c]{45}(0,0){%
+ \psframe(! \@bs@wd neg \@bs@wd neg)(! \@bs@wd \@bs@wd)
+ }
+ \else\ifx\POE@key@bsstyle\POE@str@bsstyle@plate
+ \psline(! \@bs@wd neg 2 sqrt mul 0)(! \@bs@wd 2 sqrt mul 0)
+ \fi\fi
+\ignorespaces}%
+\def\crystal@ref{%
+ \let\POE@key@optboxwidth\POE@key@crystalwidth
+ \let\POE@key@optboxheight\POE@key@crystalheight
+ \optbox@ref
+}%
+\def\crystal@comp{%
+ \edef\@wd{\POE@key@crystalwidth\space 0.5 mul }
+ \edef\@ht{\POE@key@crystalheight\space 0.5 mul }
+ \psframe(! \@wd neg \@ht neg)(! \@wd \@ht)
+ \ifPOE@voltage%
+ \psline(!\@wd 4 div 3 mul neg \@ht)%
+ (! \@wd 4 div 3 mul neg \@ht 0.2 add)
+ \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)%
+ (! \@wd 4 div 3 mul neg \@ht neg 0.2 sub)%
+ \psline(! \@wd 4 div 3 mul neg 0.15 sub \@ht neg 0.2 sub)%
+ (! \@wd 4 div 3 mul neg 0.15 add \@ht neg 0.2 sub)%
+ \fi
+ \ifPOE@lamp
+ \rput(! \@wd \@ht){%
+ \psset{style=CrystalLamp}%
+ \rput(0, 0.4){\crystal@lamp}%
+ }%
+ \fi
+ \ifdim\POE@key@caxislength pt=0pt\else
+ \def\@cl{%
+ \POE@key@caxislength\space
+ \ifPOE@caxisinv -1 mul\space\fi
+ }%
+ \psline[style=CrystalCaxis](! 0 \@cl \POE@dict{sign} \@ht mul)%
+ (! 0 \@cl \POE@dict{sign} neg \@ht mul \@cl sub)%
+ \fi
+\ignorespaces}%
+\def\crystal@lamp{%
+ \pscurve[fillstyle=none](-0.015, 0)(-0.03, -0.045)(-0.06, -0.075)%
+ (-0.075, -0.15)(0, -0.21)(0.075, -0.15)(0.06, -0.075)%
+ (0.03, -0.045)(0.015, 0)
+ \multido{\i=-30+40}{7}{%
+ \rput{\i}(0, -0.135){%
+ \psline(-0.105, 0)(-0.18, 0)
+ }%
+ }%
+\ignorespaces}%
+\def\polarization@comp{%
+ \edef\@sz{\POE@key@polsize\space 0.5 mul }%
+ \psset{style=Polarization}%
+ \ifx\POE@key@poltype\POE@str@pol@polparallel
+ \psline[arrows=<->](! 0 \@sz neg)(! 0 \@sz)
+ \fi
+ \ifx\POE@key@poltype\POE@str@pol@polperp
+ \psdot(0,0)
+ \pscircle[fillstyle=none](0,0){0.12}
+ \fi
+ \ifx\POE@key@poltype\POE@str@pol@polmisc
+ \psline[arrows=<->](! 0 \@sz neg)(! 0 \@sz)
+ \psdot(0,0)
+ \pscircle[fillstyle=none](0,0){0.12}
+ \fi
+ \ifx\POE@key@poltype\POE@str@pol@polrcirc
+ \psellipticarc[arrows=->]%
+ (0,0)(! \@sz 2 div \@sz){20}{-20}
+ \fi
+ \ifx\POE@key@poltype\POE@str@pol@pollcirc
+ \psellipticarc[arrows=<-]%
+ (0,0)(! \@sz 2 div \@sz){20}{-20}
+ \fi
+\ignorespaces}%
+\def\optgrating@ref{%
+ \POE@setref{/@@x \POE@key@gratingwidth\space 0.5 mul def}%
+}%
+\def\optgrating@comp{%
+ \edef\@cnt{\POE@key@gratingcount\space}%
+ \edef\@wd{\POE@key@gratingwidth\space 0.5 mul }%
+ \ifdim\POE@key@gratingheight pt<\POE@key@gratingdepth pt
+ \edef\@ht{\POE@key@gratingdepth\space}%
+ \else
+ \edef\@ht{\POE@key@gratingheight\space}%
+ \fi
+ \edef\@dp{\POE@key@gratingdepth\space}%
+ \edef\@step{\POE@key@gratingwidth\space\@cnt div }%
+ \ifx\POE@key@gratingtype\POE@str@gratingtype@blazed
+ \pscustom[linewidth=\POE@key@gratinglinewidth, linejoin=1]{%
+ \psline[liftpen=1](! \@wd \@dp)(! \@wd \@ht)%
+ (! \@wd neg \@ht)(! \@wd neg \@dp)%
+ \multido{\i=0+1}{\POE@key@gratingcount}{%
+ \psline[liftpen=1]%
+ (! \@wd neg \i\space \@step mul add \@dp)%
+ (! \@wd neg \i\space
+ \ifPOE@reverse\else 1 add \fi \@step mul add 0)%
+ (! \@wd neg \i\space 1 add \@step mul add \@dp)%
+ }%
+ \closepath
+ }%
+ \else\ifx\POE@key@gratingtype\POE@str@gratingtype@binary
+ \pscustom[linewidth=\POE@key@gratinglinewidth]{%
+ \psline[liftpen=1](! \@wd \@dp)(! \@wd \@ht)%
+ (! \@wd neg \@ht)(! \@wd neg \@dp)%
+ \multido{\i=0+1}{\POE@key@gratingcount}{%
+ \psline[liftpen=1]%
+ (! \@wd neg \i\space \@step mul add \@dp)%
+ (! \@wd neg \i\space \@step mul add 0)%
+ (! \@wd neg \i\space 0.5 add \@step mul add 0)%
+ (! \@wd neg \i\space 0.5 add \@step mul add \@dp)%
+ (! \@wd neg \i\space 1 add \@step mul add \@dp)%
+ }%
+ }%
+ \fi\fi
+ \ifPOE@variable
+ \psarc[style=VariableStyle]%
+ (! \POE@key@gratingwidth\space 0.5 mul 0.4 sub
+ \POE@key@gratingheight\space 0.5 mul){0.6}{-20}{20}
+ \psarc[style=VariableStyle]%
+ (! 0.4 \POE@key@gratingwidth\space 0.5 mul sub
+ \POE@key@gratingheight\space 0.5 mul){0.6}{160}{200}
+ \fi
+\ignorespaces}%
+\def\optbox@ref{%
+ \POE@setref{%
+ /@@x \POE@key@optboxwidth\space 0.5 mul def
+ /@@y \POE@key@optboxheight\space 0.5 mul def
+ }%
+}%
+\def\optbox@comp{%
+ \edef\@wd{\POE@key@optboxwidth\space 0.5 mul }
+ \edef\@ht{\POE@key@optboxheight\space 0.5 mul }
+ \psframe[dimen=outer](! \@wd neg \@ht neg)(! \@wd \@ht)
+\ignorespaces}%
+\def\optplate@ref{%
+ \POE@setref{/@@y \POE@key@plateheight\space 0.5 mul def }%
+}%
+\def\optplate@comp{%
+ \psline[linewidth=\POE@key@platelinewidth]%
+ (! \POE@dict{0 @@y neg})(! \POE@dict{0 @@y})
+\ignorespaces}%
+\def\optdetector@ref{%
+ \ifx\POE@key@detsize\@empty
+ \POE@setref{%
+ /@@y \POE@key@detheight\space 0.5 mul def
+ /@@x \POE@key@detwidth\space 0.5 mul def
+ }%
+ \else
+ \POE@setref{%
+ /@@y \POE@key@detsize\space 0.5 mul def
+ /@@x \POE@key@detsize\space 0.5 mul
+ \ifx\POE@key@dettype\POE@str@dettype@round 0.5 mul\fi
+ \space def
+ }%
+ \fi
+}%
+\def\optdetector@nodes{%
+ \dipole@nodes
+ \ifx\POE@key@dettype\POE@str@dettype@round
+ \pnode(! \POE@dict{@@x0 @@x -0.2 mul add} 0){\oenodeCenter{}}%
+ \fi
+}%
+\def\optdetector@comp{%
+ \ifx\POE@key@dettype\POE@str@dettype@round
+ \psellipticwedge(!\POE@dict{@@x0 @@x sub @@y0})%
+ (!\POE@dict{@@x 2 mul @@y}){-90}{90}%
+ \else\ifx\POE@key@dettype\POE@str@dettype@diode
+ \ifx\POE@key@detsize\@empty
+ \ifdim\POE@key@detwidth pt<\POE@key@detheight pt
+ \def\@sz{\POE@key@detwidth\space 0.5 mul }%
+ \else
+ \def\@sz{\POE@key@detheight\space 0.5 mul }%
+ \fi
+ \else
+ \def\@sz{\POE@key@detsize\space 0.5 mul }%
+ \fi
+ \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})%
+ (! \POE@dict{@@x @@y})%
+ \bgroup
+ \psset{style=DetectorStyle}
+ \pspolygon(! \@sz -0.2 mul \@sz -0.4 mul)%
+ (! \@sz 0.6 mul \@sz -0.4 mul)%
+ (! \@sz 0.2 mul \@sz 0.4 mul)%
+ \psline(! \@sz -0.2 mul \@sz 0.4 mul \getCLWH add)%
+ (! \@sz 0.6 mul \@sz 0.4 mul \getCLWH add)
+ \psset{arrows=->, arrowinset=0, arrowscale=0.8}%
+ \psline(! \@sz -0.8 mul \@sz 0.3 mul)%
+ (! \@sz -0.3 mul \@sz 0.15 mul)%
+ \psline(! \@sz -0.8 mul 0)(! \@sz -0.3 mul \@sz -0.15 mul)%
+ \egroup
+ \fi\fi
+\ignorespaces}%
+\def\optretplate@ref{%
+ \POE@setref{%
+ /@@y \POE@key@plateheight\space 0.5 mul def
+ /@@x \POE@key@platewidth\space 0.5 mul def
+ }%
+}%
+\def\optretplate@comp{%
+ \edef\@ht{\POE@key@plateheight\space 0.5 mul }%
+ \edef\@wd{\POE@key@platewidth\space 0.5 mul }%
+ \psframe(! \@wd neg \@ht neg)(! \@wd \@ht)
+ \psline{cc-cc}(! \@wd neg \@ht)(! \@wd \@ht neg)
+\ignorespaces}%
+\def\optdiode@ref{%
+ \POE@setref{%
+ \POE@key@optdiodesize\space 0.5 mul dup /@@y ED /@@x ED
+ }%
+}%
+\def\optdiode@comp{%
+ \edef\@sz{\POE@key@optdiodesize\space}%
+ \psframe[dimen=outer](! \@sz -0.5 mul dup)(!\@sz 0.5 mul dup)
+ \pspolygon(! \@sz -0.2 mul \@sz -0.2 mul)
+ (! \@sz -0.2 mul \@sz 0.2 mul)
+ (! \@sz 0.2 mul 0)
+ \psline(! \@sz 0.2 mul \getCLWH add \@sz 0.2 mul)%
+ (! \@sz 0.2 mul \getCLWH add \@sz -0.2 mul)
+\ignorespaces}%
+\def\doveprism@ref{%
+ \POE@setref{/@@x \POE@key@doveprismwidth\space 0.5 mul def
+ /@@y \POE@key@doveprismheight\space 0.5 mul def}%
+}%
+\def\doveprism@nodes{%
+ \newOptexpComp{%
+ /@htsq @@y 2 sqrt mul def
+ {@@x neg @@y add 0} {1 1}
+ @htsq neg @htsq trans {PlainIfc}
+ {0 @@y neg} {1 0}
+ @@x neg dup neg
+ refl {PlainIfc}
+ {@@x @@y sub 0} {-1 1}
+ @htsq neg @htsq trans {PlainIfc}
+ \POE@key@n true
+ }%
+\ignorespaces}%
+\def\doveprism@comp{%
+ \edef\@ht{\POE@key@doveprismheight\space 0.5 mul }%
+ \edef\@wd{\POE@key@doveprismwidth\space 0.5 mul }%
+ \pspolygon(! \@wd neg \@ht neg)%
+ (! \@wd \@ht neg)%
+ (! \@wd \@ht 2 mul sub \@ht)%
+ (! \@ht 2 mul \@wd sub \@ht)%
+\ignorespaces}%
+\def\pentaprism@nodes{%
+ \edef\@sz{\POE@key@pentaprismsize\space}%
+ \newOptexpComp{%
+ {\@sz 2 sqrt -2 mul div dup } {-1 1}
+ \@sz -0.5 mul dup neg trans {PlainIfc}
+ {\@sz 2 sqrt div 67.5 cos \@sz mul
+ 67.5 sin 2 mul div sub \@sz 2 div}
+ {67.5 cos \@sz mul 67.5 sin div neg \@sz}
+ \@sz 22.5 cos div -0.5 mul dup neg refl {PlainIfc}
+ {\@sz 2 sqrt div neg 67.5 cos \@sz mul
+ 67.5 sin 2 mul div add \@sz 2 div}
+ {67.5 cos \@sz mul 67.5 sin div \@sz}
+ \@sz 22.5 cos div -0.5 mul dup neg refl {PlainIfc}
+ {\@sz 2 sqrt 2 mul div dup neg} {1 1}
+ \@sz -0.5 mul dup neg trans {PlainIfc}
+ \POE@key@n
+ }%
+}%
+\def\pentaprism@comp{%
+ \edef\@sz{\POE@key@pentaprismsize\space}%
+ \pscustom{%
+ \psline(! \@sz 2 sqrt div 0)%
+ (! \@sz 2 sqrt div 67.5 cos \@sz mul
+ 67.5 sin div sub \@sz)%
+ (! 67.5 cos \@sz mul 67.5 sin div \@sz
+ 2 sqrt div sub \@sz)%
+ (! \@sz 2 sqrt div neg 0)%
+ (! 0 \@sz 2 sqrt div neg)%
+ \closepath
+ }%
+}%
+\def\optprism@nodes{%
+ \edef\@sz{\POE@key@prismsize\space}%
+ \edef\@ang{\POE@key@prismangle\space 0.5 mul\space}%
+ \edef\@hshift{%
+ \ifx\POE@key@prismalign\POE@str@auto
+ \@sz 0.6 mul \@ang tan mul \POE@dict{OEangle} 0.5 mul tan div
+ \else
+ 0
+ \fi
+ }%
+ \newOptexpComp{%
+ {\@sz -0.6 mul \@ang tan mul \@hshift neg}
+ {90 \@ang sub dup cos exch sin}
+ \@sz \@ang cos div dup -0.4 mul exch 0.6 mul trans {PlainIfc}
+ {\@sz 0.6 mul \@ang tan mul \@hshift neg}
+ {90 \@ang add dup cos exch sin}
+ \@sz \@ang cos div dup -0.4 mul exch 0.6 mul trans {PlainIfc}
+ \POE@key@n true }%
+ \pnode(! 0 \@hshift neg){\oenodeCenter{}}
+}%
+\def\optprism@comp{%
+ \edef\@sz{\POE@key@prismsize\space}%
+ \edef\@altan{\POE@key@prismangle\space 0.5 mul tan }%
+ \edef\@hshift{%
+ \ifx\POE@key@prismalign\POE@str@auto
+ \@sz 0.6 mul \@altan mul \POE@dict{OEangle} 0.5 mul tan div
+ \else
+ 0
+ \fi
+ }%
+ \pspolygon(! \@sz neg \@altan mul \@sz -0.4 mul \@hshift sub)
+ (! \@sz \@altan mul \@sz -0.4 mul \@hshift sub)
+ (! 0 \@sz 0.6 mul \@hshift sub)
+}%
+\def\rightangleprism@ref{%
+ \POE@setref{%
+ tx@EcldDict begin
+ OEangle 0.5 mul
+ { x sin modA mul }
+ { OEangle x sub sin modB mul }
+ NewtonSolving pop
+ end
+ /@htA exch def
+ OEangle 0.5 mul exch sub /dOEangle exch def
+ /@OEtrafo {dOEangle matrix rotate dtransform } bind def
+ }%
+}%
+\def\rightangleprism@nodes{%
+ \edef\@sz{\POE@key@raprismsize\space}%
+ \edef\@ht{\POE@dict{OEangle 0.5 mul sin modA mul} }%
+ \newOptexpComp{%
+ {@htA neg @htA \@sz 0.5 mul sub @OEtrafo} {1 0 @OEtrafo}
+ @htA \@sz 0.5 mul sub @htA trans {PlainIfc}
+ {@htA neg 0 @OEtrafo} {1 1 @OEtrafo}
+ @htA 2 sqrt mul dup \@sz 2 sqrt div sub exch refl {PlainIfc}
+ {@htA 0 @OEtrafo} {-1 1 @OEtrafo}
+ @htA 2 sqrt mul dup \@sz 2 sqrt div sub exch refl {PlainIfc}
+ {@htA dup \@sz 0.5 mul sub @OEtrafo} {1 0 @OEtrafo}
+ @htA neg \@sz 0.5 mul @htA sub trans {PlainIfc}
+ \POE@key@n
+ }%
+\ignorespaces}%
+\def\rightangleprism@comp{%
+ \edef\@sz{\POE@key@raprismsize\space 0.5 mul }%
+ \pspolygon(!\POE@dict{\@sz neg @htA \@sz sub @OEtrafo})
+ (!\POE@dict{\@sz @htA \@sz sub @OEtrafo})
+ (! 0 \POE@dict{@htA @OEtrafo})%
+\ignorespaces}%
+\def\optfiber@ref{%
+ \POE@setref{/@@x \POE@key@fiberloopsep\space\POE@key@fiberloops\space
+ 1 sub mul 0.5 mul def }%
+}%
+\def\optfiber@nodes{%
+ \newOptexpFiberComp{{@@x neg 0} {@@x 0}}%
+\ignorespaces}%
+\def\optfiber@comp{%
+ \edef\@f@cnt{\POE@key@fiberloops\space}%
+ \edef\@f@r{\POE@key@fiberloopradius\space}%
+ \edef\@f@sep{\POE@key@fiberloopsep\space}%
+ \parametricplot[plotpoints=200, style=Fiber]{0}{1}{%
+ t 360 mul \@f@cnt mul sin \@f@r mul \@f@sep
+ \@f@cnt 1 sub mul t 0.5 sub mul add
+ 1 t 360 mul \@f@cnt mul cos sub \@f@r mul
+ }%
+\ignorespaces}%
+\def\optmzm@ref{%
+ \POE@setref{%
+ /@@x \POE@key@optmzmwidth\space 0.5 mul def
+ /@@y \POE@key@optmzmheight\space 0.5 mul def
+ }%
+}%
+\def\optmzm@comp{%
+ \bgroup
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber, arrows=-, ArrowInside=-}
+ \fi
+ \psline(! \POE@dict{@@x} neg 0)(! \POE@dict{@@x} -0.7 mul 0)%
+ (! \POE@dict{@@x} -0.4 mul \POE@dict{@@y} 0.6 mul)%
+ (! \POE@dict{@@x 0.4 mul @@y 0.6 mul})%
+ (! \POE@dict{@@x} 0.7 mul 0)(! \POE@dict{@@x} 0)%
+ (! \POE@dict{@@x} 0.7 mul 0)%
+ (! \POE@dict{@@x 0.4 mul @@y -0.6 mul})%
+ (! \POE@dict{@@x -0.4 mul @@y -0.6 mul})%
+ (! \POE@dict{@@x} -0.7 mul 0)%
+ \egroup
+ \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})%
+ (!\POE@dict{@@x @@y})
+\ignorespaces}%
+\def\optfilter@ref{%
+ \POE@setref{\POE@key@filtersize\space 0.5 mul dup /@@y ED /@@x ED }%
+}%
+\let\optfilter@nodes\dipole@nodes
+\def\optfilter@comp{%
+ \edef\@sz{\POE@key@filtersize\space 0.5 mul }%
+ \def\filter@curve{%
+ \parametricplot[plotstyle=curve,arrows=-]{-1}{1}{%
+ t \@sz mul 0.7 mul t Pi mul RadtoDeg
+ 90 add cos 0.2 \@sz mul mul}%
+ }%
+ \psframe[dimen=outer](! \@sz neg dup)(! \@sz dup)
+ \bgroup
+ \psset{style=FilterStyle}%
+ \ifx\POE@key@filtertype\POE@str@filtertype@bandpass
+ \psline(! -0.3 \@sz mul -0.65 \@sz mul)%
+ (! 0.3 \@sz mul -0.35 \@sz mul)%
+ \psline(! -0.3 \@sz mul 0.35 \@sz mul)%
+ (! 0.3 \@sz mul 0.65 \@sz mul)%
+ \rput(! 0 -0.5 \@sz mul){\filter@curve}
+ \rput(0, 0){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \rput(! 0 0.5 \@sz mul){\filter@curve}
+ \else\ifx\POE@key@filtertype\POE@str@filtertype@bandstop
+ \psline(! -0.3 \@sz mul -0.15 \@sz mul)%
+ (! 0.3 \@sz mul 0.15 \@sz mul)%
+ \rput(! 0 -0.5 \@sz mul){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \rput(0, 0){\filter@curve}
+ \rput(! 0 0.5 \@sz mul){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \else\ifx\POE@key@filtertype\POE@str@filtertype@lowpass
+ \psline(! -0.3 \@sz mul -0.15 \@sz mul)%
+ (! 0.3 \@sz mul 0.15 \@sz mul)%
+ \psline(! -0.3 \@sz mul 0.35 \@sz mul)%
+ (! 0.3 \@sz mul 0.65 \@sz mul)%
+ \rput(! 0 -0.5 \@sz mul){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \rput(0, 0){\filter@curve}
+ \rput(! 0 0.5 \@sz mul){\filter@curve}
+ \else\ifx\POE@key@filtertype\POE@str@filtertype@highpass
+ \psline(! -0.3 \@sz mul -0.15 \@sz mul)%
+ (! 0.3 \@sz mul 0.15 \@sz mul)%
+ \psline(! -0.3 \@sz mul -0.65 \@sz mul)%
+ (! 0.3 \@sz mul -0.35 \@sz mul)%
+ \rput(! 0 0.5 \@sz mul){%
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \filter@curve}
+ \rput(0, 0){\filter@curve}
+ \rput(! 0 -0.5 \@sz mul){\filter@curve}
+ \fi\fi\fi\fi
+ \egroup
+\ignorespaces}%
+\def\optamp@ref{%
+ \POE@setref{/@@x \POE@key@optampwidth\space 0.5 mul def
+ /@@y \POE@key@optampheight\space 0.5 mul def
+ }%
+}%
+\def\optamp@nodes{%
+ \newOptexpFiberComp{{@@x neg 0} {@@x 0}}%
+}%
+\def\optamp@comp{%
+ \def\@wd{\POE@key@optampwidth\space 0.5 mul }%
+ \def\@ht{\POE@key@optampheight\space 0.5 mul }%
+ \pspolygon(! \@wd 0)(! \@wd neg \@ht)(! \@wd neg \@ht neg)
+\ignorespaces}%
+\def\polcontrol@ref{%
+ \ifx\POE@key@polcontroltype\POE@str@polcontroltype@linear
+ \POE@setref{/@@x \POE@key@polcontrolsize\space 2 mul def}%
+ \else
+ \POE@setref{/@@x \POE@key@polcontrolsize\space 1.5 mul def}%
+ \fi
+}%
+\def\polcontrol@nodes{%
+ \newOptexpFiberComp{{@@x neg 0} {@@x 0}}%
+}%
+\def\polcontrol@comp{%
+ \edef\@sz{\POE@key@polcontrolsize\space}%
+ \ifPOE@optexpenv
+ \psline[style=Fiber, arrows=-, ArrowInside=-](\oenodeIn{})(\oenodeOut{})
+ \fi
+ \bgroup
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber, arrows=-, ArrowInside=-}%
+ \fi
+ \ifx\POE@key@polcontroltype\POE@str@polcontroltype@linear
+ \multips(! -2 \@sz mul \@sz)(! 2 \@sz mul 0){3}{%
+ \pscircle(0,0){\POE@key@polcontrolsize}%
+ }%
+ \else
+ \pscircle(! -1.5 \@sz mul \@sz neg){\POE@key@polcontrolsize}
+ \pscircle(! 0 \@sz){\POE@key@polcontrolsize}%
+ \pscircle(! 1.5 \@sz mul \@sz neg){\POE@key@polcontrolsize}
+ \fi
+ \egroup
+ \ifPOE@optexpenv\else
+ \psline[style=Fiber, arrows=-, ArrowInside=-](\oenodeIn{})(\oenodeOut{})
+ \fi
+\ignorespaces}%
+\def\optisolator@ref{%
+ \POE@setref{%
+ /@@x \POE@key@isolatorwidth\space 0.5 mul def
+ /@@y \POE@key@isolatorheight\space 0.5 mul def
+ }%
+}%
+\def\optisolator@comp{%
+ \edef\@ht{\POE@key@isolatorheight\space 0.5 mul }%
+ \edef\@wd{\POE@key@isolatorwidth\space 0.5 mul }%
+ \psframe[dimen=outer](! \@wd neg \@ht neg)(! \@wd \@ht)
+ \psline[style=IsolatorArrow,
+ arrows=->](! \@wd neg 0.6 mul 0)(!\@wd 0.6 mul 0)
+\ignorespaces}%
+\def\optfiberpolarizer@ref{%
+ \POE@setref{%
+ /@@x \POE@key@fiberpolwidth\space 0.5 mul def
+ /@@y \POE@key@fiberpolheight\space 0.5 mul def
+ }%
+}%
+\def\optfiberpolarizer@comp{%
+ \edef\@ht{\POE@key@fiberpolheight\space 0.5 mul }%
+ \edef\@wd{\POE@key@fiberpolwidth\space 0.5 mul }%
+ \psframe[dimen=outer](! \@wd neg \@ht neg)(! \@wd \@ht)
+ \psline(! \@wd neg 0.2 mul \@ht neg)(!\@wd 0.2 mul \@ht)
+\ignorespaces}%
+\def\optswitch@ref{%
+ \POE@setref{\POE@key@switchsize\space 0.5 mul dup /@@y ED /@@x ED }%
+}%
+\def\optswitch@comp{%
+ \pstVerb{tx@Dict begin /@lw \getCLW def end}%
+ \bgroup
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber, arrows=-, ArrowInside=-}
+ \fi
+ \psline[arrows=-](! \POE@dict{@@x} neg 0)%
+ (! \POE@dict{@@x} -0.6 mul @lw sub 0)%
+ \psline[arrows=-](! \POE@dict{@@x} 0.6 mul 0)(! \POE@dict{@@x} 0)%
+ \egroup
+ \ifx\POE@key@switchstyle\POE@str@closed%
+ \bgroup
+ \ifPOE@usefiberstyle
+ \psset{style=Fiber}
+ \fi
+ \psdot[dotsize=3\pslinewidth](! \POE@dict{@@x} 0.6 mul 0)%
+ \psdot[dotsize=3\pslinewidth](! \POE@dict{@@x} -0.6 mul 0)%
+ \psline[arrows=-, linewidth=1.5\pslinewidth]%
+ (! \POE@dict{@@x} -0.6 mul @lw)(! \POE@dict{@@x} 0.6 mul @lw)%
+ \egroup
+ \else
+ \psline[arrows=-, linewidth=1.5\pslinewidth]%
+ (! \POE@dict{@@x} -0.6 mul @lw add @lw)%
+ (! \POE@dict{@@x 0.6 mul @@y 0.6 mul})%
+ \pscircle(! \POE@dict{@@x} -0.6 mul 0){\pslinewidth}%
+ \psdot[dotsize=3\pslinewidth](! \POE@dict{@@x} 0.6 mul 0)%
+ \fi
+ \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})%
+ (! \POE@dict{@@x @@y})%
+\ignorespaces}%
+\def\fiberdelayline@ref{%
+ \POE@setref{%
+ /@@y \POE@key@fdlheight\space 0.5 mul def
+ /@@x \POE@key@fdlwidth\space 0.5 mul def
+ }%
+}%
+\def\POE@get@yarrowscale#1 #2 #3 #4\@nil{%
+ \def\POE@tempA{#3\space}%
+}%
+\def\fiberdelayline@comp{%
+ \psframe[dimen=outer](! \POE@dict{@@x neg @@y neg})%
+ (! \POE@dict{@@x @@y})
+ \begingroup
+ \psset{style=FdlArrow}
+ \use@par
+ \pst@expandafter\POE@get@yarrowscale{\psk@arrowscale}\@nil
+ \def\@arrowshift{%
+ \psk@arrowlength\space \psk@arrowsize\space
+ \pst@number\pslinewidth\space mul add mul
+ \POE@tempA mul
+ @@y 2.9 mul @@x 0.6 mul atan 2 copy cos mul 3 1 roll sin mul
+ \tx@UserCoor abs exch abs exch\space
+ }%
+ \psline(! \POE@dict{@@x -0.4 mul @@y -1.6 mul})%
+ (! \POE@dict{@@x 0.2 mul @@y 1.3 mul \@arrowshift VecAdd})
+ \endgroup
+\ignorespaces}%
+\def\optcoupler@nodes{%
+ \edef\@sep{\POE@key@couplersep\space 0.5 mul }%
+ \newOptexpFiberComp{%
+ {@@x neg @@y0 \@sep add}
+ {@@x neg @@y0 \@sep sub}
+ {@@x @@y0 \@sep add}
+ {@@x @@y0 \@sep sub} }%
+ \pnode(! 0 \POE@dict{@@y0}){\oenodeCenter{}}
+}%
+\def\POE@coupler@ref{%
+ \POE@setref{%
+ /@@y0
+ \ifx\POE@key@coupleralign\POE@str@top
+ \POE@key@couplersep\space -0.5 mul
+ \else\ifx\POE@key@coupleralign\POE@str@bottom
+ \POE@key@couplersep\space 0.5 mul
+ \else
+ 0
+ \fi\fi
+ def
+ /@@x \POE@key@couplerwidth\space 0.5 mul def
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \POE@key@couplersep
+ \else
+ \POE@key@couplerheight\space 0.5 mul
+ \fi
+ \space /@@y ED
+ }%
+}%
+\let\optcoupler@ref\POE@coupler@ref
+\def\wdmcoupler@ref{%
+ \POE@coupler@ref
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@center
+ \POE@setref{/@@y 0 def }%
+ \fi
+ \fi
+}%
+\let\wdmsplitter@ref\wdmcoupler@ref
+\def\optcoupler@comp{%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \psline[style=Fiber](\oenode{1}{})(\oenode{3}{})
+ \psline[style=Fiber](\oenode{2}{})(\oenode{N}{})
+ \fi
+ \POE@coupler@comp
+}%
+\def\POE@coupler@comp{%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \else\ifx\POE@key@couplertype\POE@str@couplertype@ellipse
+ \psellipse(! 0 \POE@dict{@@y0})(! \POE@dict{@@x @@y})
+ \else
+ \psframe[dimen=outer](!\POE@dict{@@x neg @@y0 @@y sub})%
+ (!\POE@dict{@@x @@y0 @@y add})%
+ \ifx\POE@key@couplertype\POE@str@couplertype@cross
+ \psline(! \POE@dict{@@x -0.5 mul @@y0 @@y 0.5 mul sub})%
+ (! \POE@dict{@@x 0.5 mul @@y0 @@y 0.5 mul add})%
+ \psline(! \POE@dict{@@x -0.5 mul @@y0 @@y 0.5 mul add})%
+ (! \POE@dict{@@x 0.5 mul @@y0 @@y 0.5 mul sub})%
+ \fi
+ \fi\fi
+ \ifx\POE@key@couplertype\POE@str@couplertype@cross\else
+ \ifPOE@variable
+ \begingroup
+ \psset{style=VariableCoupler}
+ \use@par
+ \pst@expandafter\POE@get@yarrowscale{\psk@arrowscale}\@nil
+ \def\@arrowshift{%
+ \psk@arrowlength\space\psk@arrowsize\space
+ \pst@number\pslinewidth\space mul add mul
+ \POE@tempA mul
+ 1.6 0.8 atan 2 copy cos mul 3 1 roll sin mul
+ \tx@UserCoor abs exch abs exch\space
+ }%
+ \psline(!\POE@dict{@@x -0.4 mul @@y0 @@x sub})%
+ (!\POE@dict{@@x 0.4 mul @@x 0.7 mul @@y0 add
+ \@arrowshift VecAdd})
+ \endgroup
+ \fi
+ \fi
+}%
+\def\wdmcoupler@nodes{%
+ \edef\@sep{\POE@key@couplersep\space 0.5 mul }%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@center
+ \edef\@sep{0 }%
+ \fi
+ \fi
+ \newOptexpFiberComp{%
+ {@@x neg @@y0 \@sep add}
+ {@@x neg @@y0 \@sep sub}
+ {@@x 0}}%
+ \pnode(! 0 \POE@dict{@@y0}){\oenodeCenter{}}
+}%
+\def\wdmcoupler@comp{%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@top
+ \psline[style=Fiber](\oenode{1}{})(\oenodeOut{})
+ \psline[style=Fiber]%
+ (!/N@\oenodeOut{} \POE@dict{@GetCenter}
+ \tx@UserCoor \POE@key@couplersep\space sub)(\oenode{2}{})
+ \else
+ \psline[style=Fiber](\oenode{2}{})(\oenodeOut{})
+ \ifx\POE@key@coupleralign\POE@str@bottom
+ \psline[style=Fiber]%
+ (!/N@\oenodeOut{} \POE@dict{@GetCenter}
+ \tx@UserCoor \POE@key@couplersep\space add)(\oenode{1}{})
+ \fi
+ \fi
+ \fi
+ \POE@coupler@comp
+}%
+\def\wdmsplitter@nodes{%
+ \edef\@sep{\POE@key@couplersep\space 0.5 mul }%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@center
+ \edef\@sep{0 }%
+ \fi
+ \fi
+ \newOptexpFiberComp{%
+ {@@x neg 0}
+ {@@x @@y0 \@sep add}
+ {@@x @@y0 \@sep sub}}
+ \pnode(! 0 \POE@dict{@@y0}){\oenodeCenter{}}
+}%
+\def\wdmsplitter@comp{%
+ \ifx\POE@key@couplertype\POE@str@couplertype@none
+ \ifx\POE@key@coupleralign\POE@str@top
+ \psline[style=Fiber](\oenodeIn{})(\oenode{2}{})
+ \psline[style=Fiber](! \POE@dict{/N@\oenodeIn{} @GetCenter}
+ \tx@UserCoor \POE@key@couplersep\space sub)(\oenode{N}{})
+ \else
+ \psline[style=Fiber](\oenodeIn{})(\oenode{N}{})
+ \ifx\POE@key@coupleralign\POE@str@bottom
+ \psline[style=Fiber](! \POE@dict{/N@\oenodeIn{} @GetCenter}
+ \tx@UserCoor \POE@key@couplersep\space sub)(\oenode{2}{})
+ \fi
+ \fi
+ \fi
+ \POE@coupler@comp
+}%
+\def\optcirculator@ref{%
+ \POE@setref{\POE@key@optcircsize\space 0.5 mul dup /@@x ED /@@y ED }%
+}%
+\def\optcirculator@nodes{%
+ \newOptexpFiberComp{{@@x neg 0} {0 @@y neg} {@@x 0}}%
+}%
+\def\optcirculator@comp{%
+ \edef\@sz{\POE@key@optcircsize\space 0.5 mul }%
+ \pscircle(0,0){! \@sz}
+ \psarc[style=OptCircArrow](0,0)%
+ {! \POE@key@optcircsize\space 0.5 mul}%
+ {\POE@key@optcircangleA}%
+ {\POE@key@optcircangleB}
+}%
+\def\fibercollimator@ref{%
+ \POE@setref{%
+ /@@x \POE@key@fibercolwidth\space 0.5 mul def
+ /@@y \POE@key@fibercolheight\space 0.5 mul def}%
+}%
+\def\fibercollimator@nodes{%
+ \pnode(!\POE@dict{@@x neg} 0){\oenodeIn{}}
+ \newOptexpComp{{@@x neg 0} {0 1} @@y neg @@y trans {PlainIfc}
+ {@@x 0} {0 1} 0 0 trans {PlainIfc} 1 }%
+}%
+\def\fibercollimator@comp{%
+ \def\@wd{\POE@key@fibercolwidth\space 0.5 mul }%
+ \def\@ht{\POE@key@fibercolheight\space 0.5 mul }%
+ \pspolygon(!\@wd neg \getCLWH add \@ht neg)%
+ (!\@wd 0)(!\@wd neg \getCLWH add \@ht)
+}%
\endinput
+%%
+%% End of file `pst-optexp.sty'.
diff --git a/Master/tlpkg/libexec/ctan2tds b/Master/tlpkg/libexec/ctan2tds
index f479ab94158..e07fec69551 100755
--- a/Master/tlpkg/libexec/ctan2tds
+++ b/Master/tlpkg/libexec/ctan2tds
@@ -765,7 +765,6 @@ chomp ($Build = `cd $Master/../Build/source && pwd`);
'pst-math', "&MAKEpst",
'pst-mirror', "&MAKEpst",
'pst-node', "&MAKEpst",
- 'pst-optexp', "&MAKEpst",
'pst-ob3d', "&MAKEpst",
'pst-optic', "&MAKEpst",
'pst-osci', "&MAKEpst",