From f6b1250ed24d6489698126ab69a0528101a24ff6 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Mon, 28 Jul 2008 22:53:54 +0000 Subject: pst-optexp update (28jul08) git-svn-id: svn://tug.org/texlive/trunk@9853 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/doc/generic/pst-optexp/Changes | 21 + Master/texmf-dist/doc/generic/pst-optexp/README | 4 +- .../doc/generic/pst-optexp/parque-nacional.eps | 286 ++++ .../doc/generic/pst-optexp/pst-optexp-doc.pdf | Bin 256902 -> 472204 bytes .../doc/generic/pst-optexp/pst-optexp-doc.tex | 1630 +++++++++++++++---- Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro | 86 +- .../tex/generic/pst-optexp/pst-optexp.tex | 1651 ++++++++++++++++---- .../texmf-dist/tex/latex/pst-optexp/pst-optexp.sty | 5 +- 8 files changed, 3062 insertions(+), 621 deletions(-) create mode 100644 Master/texmf-dist/doc/generic/pst-optexp/parque-nacional.eps (limited to 'Master/texmf-dist') diff --git a/Master/texmf-dist/doc/generic/pst-optexp/Changes b/Master/texmf-dist/doc/generic/pst-optexp/Changes index 6b1ccc2752f..3ab0afda9e1 100644 --- a/Master/texmf-dist/doc/generic/pst-optexp/Changes +++ b/Master/texmf-dist/doc/generic/pst-optexp/Changes @@ -1,3 +1,24 @@ +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 diff --git a/Master/texmf-dist/doc/generic/pst-optexp/README b/Master/texmf-dist/doc/generic/pst-optexp/README index 43672507567..ac2ac3a19df 100644 --- a/Master/texmf-dist/doc/generic/pst-optexp/README +++ b/Master/texmf-dist/doc/generic/pst-optexp/README @@ -4,7 +4,7 @@ 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 1.2 +This is version 2.0 For a changelog see file Changes Save the files @@ -29,4 +29,4 @@ See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html for the details of that license. -- -Christoph Bersch 2008/06/17 +Christoph Bersch 2008/07/27 diff --git a/Master/texmf-dist/doc/generic/pst-optexp/parque-nacional.eps b/Master/texmf-dist/doc/generic/pst-optexp/parque-nacional.eps new file mode 100644 index 00000000000..9576fcfe18a --- /dev/null +++ b/Master/texmf-dist/doc/generic/pst-optexp/parque-nacional.eps @@ -0,0 +1,286 @@ +%!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`[\![LbIS[utmW+pLKbgIj#Umkd]=W=Y>Q6Op+D/T;\oX5dX<,'8Uf9U^ +O$OnX=eS$OM,T@1O+HIQ&?S\r.:\IUs4SMeVHdCR!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,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^B0/%$;/9`@X4j11l,D1DL +Ia*,W_KL4bBMP*.[&PC$WSn(o4`NB3b0k.<,u/DC>09AIs@H>?nAY-tgo)OpXT>j +U*#8gS>@PH&3E/@C&:aTsfVT[kGS"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[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$<'Fj(0b"DnVr,UlX7cC%__o0se-@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 +are(ho`0m\Ddh[lu0=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'^S<60GE.XE2H>K0F;O +cOn-C:H5lm\PW?;fYIn3JucXcOION.fLdSjp2R)>iHBF@%>N*1>P+F%i2iRSkOEC +Z8las)5QQ6fBt7,>t=#6b/K:uNmV3_)'-!lD6_LeKnl$0CA +H-^Vpk)4h`[O8o(<;`bcOqUoT1_e!`$@17g-%+`lYfnMX +?d5;0jK?MI[QgG#CfCO^-KD7lq].l)r,qp2[%s%ZO>C]#Si*rf@gZSubC2);L5T* +,o#ds:q8->jBf8b>E.no9u>Eiiq_oZbnkLf +`(s2AUe`VRj'"p#PAT;rrBp4Ir^pGN?!D3A]q9(,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-a.7Hl_L*MbQ]5SBNDDE.VID!B,X!Y4Q^5u)apK[tHX+Ie\Jeci29!!\S%lo +6P(J:kW"=<3Zm;91h>D^6QZ*#&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&NRafYh,%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&'r1NF#*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#\$ +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!bp*.SC;.ug +@AI=AVjYM>aJ'o&i(.#!*c%j_Q]M$iJ/57K#(B1YYo +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 +,&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&>`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*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^9gh-PM^J0Jcu%c,^)8 +@+"KN^tUL]>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':em=K#Wge$L[+ia2pP;u41:+DT#Q#j=TMcM\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;-Ua!`i;Bjbg%,q/cn8ouZ,3b[9O@D:ReTbr9dSi!BS*(PWnUaKcD9.mh43A/LT5aZ +@>Toh]RAfST=3o_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[O9sV'T.G+Z;C9X?2YD;oq<.!(M`:rr=.s)GOnb8%c&Job.i$J*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'i2>G;-W%EnHFEq+oa,fd!\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%ipp\.up)U;7C+F +1EaXOU$nl2tBgoVeVDfgmuiOSjGJT8P\@HeV8@ +?Fa8G6&L;`lHqlb7)4pY8X7.C3R_gPoU))?0]Ce@Cn'jT,VXd.=#=MjSKolqiZA` +HQ?drNaN/+U^GeGo6-+'qGiol&ZCphe[UIo4D$N%!cWE9$`CXih]8M]EP`_<>ao +K/kQc+4dMq.j]#Ghl9WFdUS<]oW(K3;K;@6A/G_'>s4m&dpA0fgIk=38lArdmbru:%PYJRM)9K6rr?I>A4f*+> +KSF#*h.%gL"Ku!b#B$JAWrHsc(m7HeeBjW+I8Ka=u;!"dB&WM[%< +?K0#RAm=("ej7M2k0;)akiUIPnF?fdC.qNZ`(h!)9QCg>\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&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 +D4hYtOf)g&O0.trsBqtkTZjR#4$NN;>Zm3$r+.'b= +,)=;'Si:V@$t3re22X)X[+qJTMp/\q.VWdnK&T^J(NXPl-!.iK)CHDU`Vcf9 +^1@rplmPKDjk8ONi=Gq&UU]1W".@bKPKj1=LoO.bk=-e@#hRXo"gMTc(h$;5EFmDA"WL\6"A%$* +b1Y6D/g!ZBDDuR'ao(UbNCe/f(@i,5)UXH@g_#Ybe6A<*,@0D08r_SYEM?-0ddTmo3P,$Hjj^rDOb<`et5C +Z\JJ[l[D^r9#@m_SNj,ab'8oom;d2Yf.NW,%!:M$Z#]P;-^:6KF[oXakmSVXYe6J3&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$?]\Ci;:j'\V/Dq;j"/VYW>:eFh;K]CQVNTpOTlkCt(DkTcHhEEC +<#!f4D^sJ2V+8%WDEkib1NTm#1Wr*rhG]CK\!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[/Q44_bBGj2U])ds10ee-)%SSP>YWn0oh]a9ieSg3&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/$sB2HKPto@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&9YJjBXUrGYDQl$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]HPB +W@5l^!.Z\$/[i]5d\rOK#?0^?Q1m,;DBu((ER(eM2$!%K]6D/*cNrbA*%rY_^1G6 +oi(WGIZ^?t#>r,\RC-0'Ge>,*29S` +1J#J5AlQNGQ?tBn+/i)![_X=[TT7A%D@!c'-)O;%R[,@0E`@(]b5m_`^&H8IqmML +$3`GCLQ8.5[Ka6CB[cm4s-.7VT2N5:lAoEMfA[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)OqMi/%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( +_+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(%%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*[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 index c1e4e745bb4..a4d22535f41 100644 Binary files a/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.pdf and b/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.pdf 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 index 2ae93949627..2c54a8a9dda 100644 --- a/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.tex +++ b/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.tex @@ -3,6 +3,7 @@ \usepackage[latin1]{inputenc} \usepackage[T1]{fontenc} \usepackage[english]{babel} +\usepackage{textcomp} \usepackage{scrpage2} \usepackage{url} @@ -10,31 +11,48 @@ \usepackage{pst-optexp} \let\verPstOptExp\fileversion \let\datePstOptExp\filedate -\usepackage{multicol} \usepackage{showexpl} \lstset{breakatwhitespace} \usepackage{nicefrac} \usepackage{graphicx} +\usepackage{array} +\usepackage{longtable} +\usepackage{booktabs} +\usepackage{multicol} +\usepackage{multirow} +\usepackage{tabularx} +\usepackage{caption} +\usepackage{float} \usepackage[colorlinks,linktocpage]{hyperref} % +\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}} \let\param\textrm \newcommand{\paramvalue}[1]{\texttt{#1}} \newcommand{\defaultparam}[1]{\emph{default:} \paramvalue{#1}} -\def\lbracket{[} -\def\rbracket{]} - +\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{} 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-\leftmargin + {\list{}{\labelwidth\z@ \itemindent-0.5\leftmargin \itemsep0pt \parsep0pt \let\makelabel\descriptionlabel}} {\endlist} @@ -46,21 +64,21 @@ \ofoot{\pagemark} \pagestyle{scrheadings} -\psset{subgriddiv=0,griddots=10,gridlabels=7pt} - +\psset{usefiberstyle=true} +\addtopsstyle{Fiber}{linecolor=red} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \begin{document} \title{\texttt{pst-optexp}\\ A PSTricks package to draw optical experimental setups} \author{Christoph Bersch \textless \href{mailto:usenet@bersch.net}{\texttt{usenet@bersch.net}}\textgreater} \date{\datePstOptExp\enspace\enspace Version \verPstOptExp} - \maketitle - +\pdfbookmark[1]{Table of Contents}{toc} \setlength{\columnseprule}{0.6pt} \begin{multicols}{2} {\parskip 0pt \tableofcontents} \end{multicols} + \section{Introduction} The package \texttt{pst-optexp} is a collection of optical components that facilitate easy sketching of optical experimental @@ -69,60 +87,543 @@ 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{Components} +\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 \texttt{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 Options} + +\begin{description} +\paramitem{optional}{}{false} +\paramitem{showoptdots}{}{false} +\styleitem{OptionalStyle}{} +\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{Positioning}\label{sec:positioning} + +\begin{description} +\paramitem{position}{}{\{\}} +\paramitem{abspos}{}{\{\}} +\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}{}{0.8} +\paramitem{labelangle}{}{0} +\paramitem{labelstyle}{}{\cs{small}} +\paramitem{labelalign}{\footnote{\refstringexplanation}}{c} +\paramitem{labelref}{relative|relgrav|global}{relgrav} +\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+72}{5}{% + \optbox[endbox, + labelref=relative, + labeloffset=0, + optboxwidth=1](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](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](0,0)(1;\i){\i} + } +\end{pspicture} +\end{LTXexample} + +\medskip + +\subsection{Named Objects}\label{sec:namedobj} + +\begin{description} + \paramitem{compname}{}{\{\}} +\end{description} + +\noindent Every \texttt{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 \texttt{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 + ExtNode & Node for external connections (\emph{external node})\\ + Intern1 & Node which should be connected to the first reference node. + In the text we refer to this node as \emph{left outer node} \\ + 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} & \\ + 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}{\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 \texttt{pst-circ}) or a detector to a computer. + +\parameter{extnode} controls the position of the additional node and +takes a \paramvalue{} 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{} 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}{}{-} +\item[\param{fiber}:] alias for \parameter{conn=f-f} +\item[\param{beam}:] alias for \parameter{conn=o-i} +\end{description} -In the sections \ref{sec:lens}--\ref{sec:custom} the -available components with their parameters are described. Up to now -there are two types of components: those which require two reference -points and do not alter the direction of the passing light beam (for -example lenses and retardation plates) and those which work in -reflection and require three reference points (mirrors, grids, -beamsplitters etc.). +\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{}. + +\begin{table}\centering +\addtolength{\extrarowheight}{1.5mm} +\begin{tabularx}{0.8\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{}, their detailed description and scope.}\label{tab:conn} +\end{table} + +The first letter (before the dash) in the \paramvalue{} +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:styles}). + +The way how to really use this kind of connections should become more +clear after looking at the following examples in this section. + +\medskip -In section \ref{sec:general} general parameters are described that are -not proprietary to a specific unit but can be used for several different -components. Finally, in section \ref{sec:labels} the options for the -positioning of labels are explained. +\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} -The appearence of all components can be changed with the corresponding -standard PSTricks parameters such as \parameter{fillstyle} -or \parameter{linestyle}. For some components changing only parts of the -layout is possible (e.g. the extended part of mirrors). For those cases -psstyles are provided that influence only the corresponing part of the -components and can be redefined using \cs{newpsstyle}. +\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, \texttt{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=...]{}{} +\end{lstlisting} + +\medskip + +\noindent If \paramvalue{} or \paramvalue{} 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{} object, the other one to +the \paramvalue{} 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} -\item[\param{lensheight}:] \paramvalue{} (\defaultparam{1}) -\item[\param{lenswidth}:] \paramvalue{} (\defaultparam{0.3}) -\item[\param{lensradius}:] \paramvalue{ []} (\defaultparam{\cs{empty}}) -\item[\param{lensradiusleft}:] \paramvalue{} (\defaultparam{1}) -\item[\param{lensradiusright}:] \paramvalue{} (\defaultparam{1}) -\item[\param{lens}:] \paramvalue{ [ [ []]]} (\defaultparam{\cs{empty}}) -\item[\param{thicklens}:] \paramvalue{}(\defaultparam{false}) +\paramitem{lensheight}{}{1} +\paramitem{lenswidth}{}{0.2} +\paramitem{lensradius}{ []}{\{\}} +\paramitem{lensradiusleft}{}{1} +\paramitem{lensradiusright}{}{1} +\paramitem{lens}{ [ [ []]]}{\{\}} +\paramitem{thicklens}{}{false} \end{description} \medskip \begin{LTXexample}[width=5.5cm] -\begin{pspicture}(5,6)\psgrid +\begin{pspicture}[showgrid=true](5,6) % concave lenses \pnode(0,5){A}\pnode(5,5){B} - \psline[style=OptBeam](A)(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=OptBeam](A)(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=OptBeam](A)(B) - \lens[position=0.3,lens=-1.5 1 1 0.5,thicklens](A)(B){thicklens} + \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} @@ -138,14 +639,14 @@ 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 \parameter{true}. Then \parameter{lenswidth} is used as width of the lens at +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} +the \parameter{lensheight} and the fourth one the \parameter{lenswidth}. \textbf{Compatibility:} The whole implementation of the lens was changed in version 1.2. It allows a much more flexible definition of different lens @@ -157,41 +658,37 @@ adapt their code to use the new parameters, as the old code will be removed in future versions. \medskip -\subsection{Optical plate} +\subsection{Optical Plate} \begin{description} -\item[\param{plateheight}:] \paramvalue{} (\defaultparam{1}) -\item[\param{platelinewidth}:] \paramvalue{} (\defaultparam{2\cs{pslinewidth}}) +\paramitem{plateheight}{}{1} +\paramitem{platelinewidth}{}{2\cs{pslinewidth}} \end{description} \medskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,2)\psgrid - \pnode(0,1.2){A} - \pnode(3,1.2){B} - \psline[style=OptBeam](A)(B) - \optplate(A)(B){filter} +\begin{pspicture}[showgrid=true](3,2) + \optplate[beam](0,1.2)(3,1.2){filter} \end{pspicture} \end{LTXexample} \medskip -\subsection{Retardation plate} +\subsection{Retardation Plate} \begin{description} -\item[\param{plateheight}:] \paramvalue{} (\defaultparam{1}) -\item[\param{platewidth}:] \paramvalue{} (\defaultparam{0.1}) +\paramitem{plateheight}{}{1} +\paramitem{platewidth}{}{0.1} \end{description} \medskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,2)\psgrid +\begin{pspicture}[showgrid=true](3,2) \pnode(0,1.2){A} \pnode(3,1.2){B} - \psline[style=OptBeam](A)(B) - \optretplate(A)(B){$\nicefrac{\lambda}{2}$} + \optretplate[beam](A)(B){$\nicefrac{\lambda}{2}$} \end{pspicture} \end{LTXexample} @@ -200,19 +697,18 @@ removed in future versions. \subsection{Pinhole} \begin{description} -\item[\param{outerheight}:] \paramvalue{} (\defaultparam{1}) -\item[\param{innerheight}:] \paramvalue{} (\defaultparam{0.1}) -\item[\param{phlinewidth}:] \paramvalue{} (\defaultparam{2\cs{pslinewidth}}) +\paramitem{outerheight}{}{1} +\paramitem{innerheight}{}{0.1} +\paramitem{phlinewidth}{}{2\cs{pslinewidth}} \end{description} \medskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,2)\psgrid +\begin{pspicture}[showgrid=true](3,2) \pnode(0,1.2){A} \pnode(3,1.2){B} - \psline[style=OptBeam](A)(B) - \pinhole(A)(B){PH} + \pinhole[beam](A)(B){PH} \end{pspicture} \end{LTXexample} @@ -221,66 +717,104 @@ removed in future versions. \subsection{Crystal}\label{sec:crystal} \begin{description} -\item[\param{crystalwidth}:] \paramvalue{} (\defaultparam{2}) -\item[\param{crystalheight}:] \paramvalue{} (\defaultparam{0.8}) -\item[\param{caxislength}:] \paramvalue{} (\defaultparam{0.6}) -\item[\param{caxisinv}:] \paramvalue{} (\defaultparam{false}) -\item[\param{voltage}:] \paramvalue{} (\defaultparam{false}) -\item[\param{lamp}:] \paramvalue{} (\defaultparam{false}) -\item[\param{lampscale}:] \paramvalue{} (\defaultparam{0.3}) +\paramitem{crystalwidth}{}{1.4} +\paramitem{crystalheight}{}{0.6} +\paramitem{caxislength}{}{0.6} +\paramitem{caxisinv}{}{false} +\paramitem{voltage}{}{false} +\paramitem{lamp}{}{false} +\paramitem{lampscale}{}{0.3} +\paramitem{angle}{}{0} +\paramitem{rotateref}{}{c} \end{description} -\medskip +\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}(3,2)\psgrid +\begin{pspicture}[showgrid=true](3,2) \pnode(0,1.2){A} \pnode(3,1.2){B} - \crystal[crystalwidth=1.5, crystalheight=0.6, fillstyle=solid, fillcolor=yellow!90!black, labelangle=-45, labeloffset=1.2, voltage, lamp](A)(B){SBN:Ce} - \psline[style=OptBeam](A)(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} +\subsection{Box}\label{sec:box} \begin{description} -\item[\param{optboxheight}:] \paramvalue{} (\defaultparam{0.5}) -\item[\param{optboxwidth}:] \paramvalue{} (\defaultparam{1}) -\item[\param{endbox}:] \paramvalue{} (\defaultparam{false}) +\paramitem{optboxheight}{}{0.8} +\paramitem{optboxwidth}{}{1.4} +\paramitem{endbox}{}{false} +\paramitem{angle}{}{0} +\paramitem{rotateref}{\footnote{\refstringexplanation}}{c} +\paramitem{refractiveindex}{}{\{\}} \end{description} \medskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,2)\psgrid - \pnode(0,0){A} - \pnode(3,2){B} - \psline[style=OptBeam](A)(B) - \optbox(A)(B){box} +\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}(3,2)\psgrid - \pnode(0,0){A} - \pnode(1.7,1){B} - \psline[style=OptBeam](A)(B) - \optbox[endbox](A)(B){box} +\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}(3,2)\psgrid +\begin{pspicture}[showgrid=true](3,2) \pnode(0,0){A} \pnode(1.7,1){B} - \psline[style=OptBeam](A)(B) - \optbox[endbox,labelref=relative,labeloffset=0](A)(B){box} + \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} @@ -289,17 +823,65 @@ removed in future versions. \subsection{Detector} \begin{description} -\item[\param{detsize}:] \paramvalue{} (\defaultparam{0.5}) +\paramitem{detsize}{}{0.8} +\paramitem{dettype}{round|diode}{round} \end{description} -\medskip +With \texttt{pst-optexp} version 2.0 the name for the detector was +changed to \cs{optdetector} as the package \texttt{pst-circ} also +provides a \cs{detector} macro. For compatibility reasons the old +\cs{detector} macro is available when \texttt{pst-circ} is not loaded +before \texttt{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}(3,2)\psgrid +\begin{pspicture}[showgrid=true](3,2) \pnode(0,0){A} \pnode(1.7,1){B} - \psline[style=OptBeam](A)(B) - \detector(A)(B){detector} + \optdetector[beam, dettype=diode](A)(B){detector} +\end{pspicture} +\end{LTXexample} + +\medskip + +\subsection{Optical Diode}\label{sec:optdiode} + +\begin{description} +\paramitem{optdiodesize}{}{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}{}{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} @@ -308,19 +890,19 @@ removed in future versions. \subsection{Polarization} \begin{description} -\item[\param{poltype}:] \paramvalue{parallel|perp|misc|lcirc|rcirc} (\defaultparam{parallel}) -\item[\param{polsize}:] \paramvalue{} (\defaultparam{0.6}) -\item[\param{pollinewidth}:] \paramvalue{} (\defaultparam{0.7\cs{pslinewidth}}) +\paramitem{poltype}{parallel|perp|misc|lcirc|rcirc}{parallel} +\paramitem{polsize}{}{0.6} +\paramitem{pollinewidth}{}{0.7\cs{pslinewidth}} \end{description} \medskip \begin{LTXexample}[width=3.4cm] -\begin{pspicture}(3,5)\psgrid +\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=OptBeam} + \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) @@ -336,78 +918,80 @@ removed in future versions. \subsection{Mirror}\label{sec:mirror} \begin{description} -\item[\param{mirrorwidth}:] \paramvalue{} (\defaultparam{1}) -\item[\param{mirrorradius}:] \paramvalue{} (\defaultparam{0}) -\item[\param{mirrorlinewidth}:] \paramvalue{} (\defaultparam{2\cs{pslinewidth}}) -\item[\param{mirrortype}:] \paramvalue{normal|piezo|extended} (\defaultparam{normal}) -\item[\param{mirrordepth}:] \paramvalue{} (\defaultparam{0.08}) -\item[\param{variable}:] \paramvalue{} (\defaultparam{false}) +\paramitem{mirrorwidth}{}{1} +\paramitem{mirrorradius}{}{0} +\paramitem{mirrorlinewidth}{}{2\cs{pslinewidth}} +\paramitem{mirrortype}{normal|piezo|extended}{normal} +\paramitem{mirrordepth}{}{0.1} +\paramitem{variable}{}{false} +\styleitem{ExtendedMirror}{} +\styleitem{PiezoMirror}{} \end{description} -The parameter \texttt{mirrorradius} defines the curvature of the mirror. A -value of \texttt{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 \parameter{ExtendedMirror} and can be changed using -\cs{newpsstyle}. The appearence of the piezo mirror likewise can be -changed by adapting the psstyle \parameter{PiezoMirror}. +\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}(3,3)\psgrid +\begin{pspicture}[showgrid=true](3,3) \pnode(0,0){A} \pnode(1.8,2.2){G} \pnode(0,3){B} - \psline[style=OptBeam](A)(G)(B) - \mirror(A)(G)(B){mirror} + \mirror[beam](A)(G)(B){mirror} \end{pspicture} \end{LTXexample} \bigskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,3)\psgrid +\begin{pspicture}[showgrid=true](3,3) \pnode(0,0){A} \pnode(1.8,2.2){G} \pnode(0,3){B} - \psline[style=OptBeam](A)(G)(B) - \mirror[variable](A)(G)(B){M$_\mathrm{var}$} + \mirror[beam, variable](A)(G)(B){M$_\mathrm{var}$} \end{pspicture} \end{LTXexample} \bigskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,3)\psgrid +\begin{pspicture}[showgrid=true](3,3) \pnode(0,0){A} \pnode(1.8,2.2){G} \pnode(0,3){B} - \psline[style=OptBeam](A)(G)(B) - \mirror[mirrortype=piezo,labelangle=-90](A)(G)(B){piezo} + \mirror[beam, mirrortype=piezo,labelangle=-90](A)(G)(B){piezo} \end{pspicture} \end{LTXexample} \bigskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,3)\psgrid +\begin{pspicture}[showgrid=true](3,3) \pnode(0,0){A} \pnode(1.8,2.2){G} \pnode(0,3){B} - \psline[style=OptBeam](A)(G)(B) - \mirror[mirrortype=extended](A)(G)(B){M$_\mathrm{ext}$} + \mirror[beam, mirrortype=extended](A)(G)(B){M$_\mathrm{ext}$} \end{pspicture} \end{LTXexample} +\bigskip + \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,3)\psgrid - \pnode(0,0){A}\pnode(0.7,2){G1} - \pnode(1.5,1){G2}\pnode(2,3){B} +\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=OptBeam](A)(G1)(G2)(B) - \mirror[mirrortype=extended, mirrorradius=1](A)(G1)(G2){M$_v$} - \mirror[mirrorradius=-1](G1)(G2)(B){M$_x$} + \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} @@ -416,45 +1000,43 @@ changed by adapting the psstyle \parameter{PiezoMirror}. \subsection{Beamsplitter} \begin{description} -\item[\param{bssize}:] \paramvalue{} (\defaultparam{0.8}) +\paramitem{bssize}{}{0.8} \end{description} \medskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,3)\psgrid +\begin{pspicture}[showgrid=true](3,3) \pnode(0,2){A} \pnode(2,2){G} \pnode(3,0){B} - \psline[style=OptBeam](A)(G)(B) - \beamsplitter(A)(G)(B){BS} + \beamsplitter[beam](A)(G)(B){BS} \end{pspicture} \end{LTXexample} \medskip -\subsection{Optical grid} +\subsection{Optical Grid} \begin{description} -\item[\param{optgridcount}:] \paramvalue{} (\defaultparam{10}) -\item[\param{optgridwidth}:] \paramvalue{} (\defaultparam{1}) -\item[\param{optgridheight}:] \paramvalue{} (\defaultparam{0.1}) -\item[\param{optgriddepth}:] \paramvalue{} (\defaultparam{0.05}) -\item[\param{optgridtype}:] \paramvalue{blazed|binary} (\defaultparam{blazed}) -\item[\param{optgridlinewidth}:] \paramvalue{} (\defaultparam{0.7\cs{pslinewidth}}) -\item[\param{reverse}:] \paramvalue{} (\defaultparam{false}) +\paramitem{optgridcount}{}{10} +\paramitem{optgridwidth}{}{1} +\paramitem{optgridheight}{}{0.1} +\paramitem{optgriddepth}{}{0.05} +\paramitem{optgridtype}{blazed|binary}{blazed} +\paramitem{optgridlinewidth}{}{0.7\cs{pslinewidth}} +\paramitem{reverse}{}{false} \end{description} \medskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,3)\psgrid +\begin{pspicture}[showgrid=true](3,3) \pnode(0,3){A} \pnode(1.8,2.2){G} \pnode(0,0){B} - \psline[style=OptBeam](A)(G)(B) - \optgrid(A)(G)(B){grid} + \optgrid[beam](A)(G)(B){grid} \end{pspicture} \end{LTXexample} @@ -462,24 +1044,23 @@ changed by adapting the psstyle \parameter{PiezoMirror}. \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,3)\psgrid +\begin{pspicture}[showgrid=true](3,3) \pnode(0,3){A} \pnode(1.8,2.2){G} \pnode(0,0){B} - \psline[style=OptBeam](A)(G)(B) - \optgrid[reverse](A)(G)(B){grid} + \optgrid[beam, reverse](A)(G)(B){grid} \end{pspicture} \end{LTXexample} \bigskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,3)\psgrid +\begin{pspicture}[showgrid=true](3,3) \pnode(0,3){A} \pnode(1.8,2.2){G} \pnode(0,0){B} - \psline[style=OptBeam](A)(G)(B) - \optgrid[optgridcount=6,% + \optgrid[beam,% + optgridcount=6,% optgriddepth=0.2,% optgridheight=0.3](A)(G)(B){grid} \end{pspicture} @@ -488,25 +1069,86 @@ changed by adapting the psstyle \parameter{PiezoMirror}. \bigskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,3)\psgrid +\begin{pspicture}[showgrid=true](3,3) \pnode(0,3){A} \pnode(1.8,2.2){G} \pnode(0,0){B} - \psline[style=OptBeam](A)(G)(B) - \optgrid[optgridtype=binary](A)(G)(B){grid} + \optgrid[beam, optgridtype=binary](A)(G)(B){grid} +\end{pspicture} +\end{LTXexample} + +\medskip + +\subsection{Prism}\label{sec:prism} +\begin{description} + \paramitem{prismsize}{}{1} + \paramitem{prismangle}{}{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}{}{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{Custom components}\label{sec:custom} +\subsection{Penta Prism}\label{sec:ppprism} +\begin{description} + \paramitem{pentaprismsize}{}{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 see -sec.~\ref{sec:newobj}. +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}(3,3)\psgrid +\begin{pspicture}[showgrid=true](3,3) \pnode(0,2){A} \pnode(3,1){B} \optdipole[labeloffset=1](A)(B){% @@ -521,7 +1163,7 @@ sec.~\ref{sec:newobj}. \bigskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,3)\psgrid +\begin{pspicture}[showgrid=true](3,3) \pnode(0,0){A} \pnode(1.5,2){G} \pnode(3,1.5){B} @@ -532,205 +1174,426 @@ sec.~\ref{sec:newobj}. \medskip -\subsection{General options}\label{sec:general} +\section{Fiber-Optical Objects} \begin{description} -\item[\param{angle}:] \paramvalue{} (\defaultparam{0}) -\item[\param{optional}:] \paramvalue{} (\defaultparam{false}) -\item[\param{position}:] \paramvalue{} (\defaultparam{\cs{empty}}) -\item[\param{abspos}:] \paramvalue{} (\defaultparam{\cs{empty}}) -\item[\param{showoptdots}:] \paramvalue{} (\defaultparam{false}) +\paramitem{usefiberstyle}{}{false} \end{description} -The parameter \parameter{angle} is available for the macros \cs{optbox} -and \cs{crystal} only, as for the most other cases it would make -no sense. \parameter{optional} can be used with every component and marks it as -optional and can be configured by changing the psstyle \parameter{OptionalStyle}. -\parameter{position} is equivalent to the \parameter{npos} parameter of \cs{ncput}, -but is used only for the \lq dipole\rq-macros to position the component -between the two given points. In addition, there is a parameter -\parameter{abspos} that allows absolute positioning between the two line -points. \parameter{showoptdots} shows in black the two points calculated for the -positioning of the component, and in red the reference points for the -label. +Fiber-optical objects are automatically connected to the reference +nodes. The style of all fiber connections can be configured +independently (see Sec.~\ref{sec:styles}). + +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}{}{3} +\paramitem{fiberloopradius}{}{0.4} +\paramitem{fiberloopsep}{}{0.3} +\end{description} \medskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,2)\psgrid - \pnode(0,1.2){A} - \pnode(3,1.2){B} - \psline[style=OptBeam](A)(B) - \optbox[angle=10](A)(B){box} +\begin{pspicture}[showgrid=true](3,2) + \optfiber[labeloffset=0.4](0,1)(3,1){SSMF} \end{pspicture} \end{LTXexample} -\bigskip +\medskip + +\subsection{Amplifier} +\begin{description} +\paramitem{optampsize}{}{0.8} +\end{description} + +\medskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,2)\psgrid - \pnode(0,1.2){A} - \pnode(3,1.2){B} - \psline[style=OptBeam](A)(B) - \lens[optional](A)(B){L} +\begin{pspicture}[showgrid=true](3,2) + \optamp(0,1)(3,1){EDFA} \end{pspicture} \end{LTXexample} -\bigskip +\medskip + +\subsection{Mach-Zehnder Modulator} +\begin{description} +\paramitem{optmzmsize}{}{0.8} +\end{description} + +\medskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,2)\psgrid - \pnode(0,1.2){A} - \pnode(3,1.2){B} - \psline[style=OptBeam](A)(B) - \lens[position=0.8](A)(B){L} +\begin{pspicture}[showgrid=true](3,2) + \optmzm(0,1)(3,1){MZM} \end{pspicture} \end{LTXexample} -\bigskip +\medskip + +\subsection{Filter} +\begin{description} +\paramitem{filtersize}{}{0.8} +\paramitem{filtertype}{bandpass|bandstop}{bandpass} +\end{description} + +\medskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,2)\psgrid - \pnode(0,1.2){A} - \pnode(3,1.2){B} - \psline[style=OptBeam](A)(B) - \lens[abspos=1](A)(B){L} +\begin{pspicture}[showgrid=true](3,2) + \optfilter(0,1)(3,1){bandpass} \end{pspicture} \end{LTXexample} \bigskip \begin{LTXexample}[width=3.5cm] -\begin{pspicture}(3,3)\psgrid - \pnode(0,0){A} - \pnode(1.5,2){G} - \pnode(0,3){B} - \psline[style=OptBeam](A)(G)(B) - \mirror[showoptdots](A)(G)(B){mirror} +\begin{pspicture}[showgrid=true](3,2) + \optfilter[filtertype=bandstop](0,1)(3,1){bandstop} \end{pspicture} \end{LTXexample} \medskip -\subsection{Labels}\label{sec:labels} +\subsection{Polarization Controller} +\begin{description} +\paramitem{polcontrolsize}{}{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} -\item[\param{labeloffset}:] \paramvalue{} (\defaultparam{1}) -\item[\param{labelangle}:] \paramvalue{} (\defaultparam{0}) -\item[\param{labelstyle}:] \paramvalue{} (\defaultparam{\cs{small}}) -\item[\param{labelalign}:] \paramvalue{<\cs{rput} ref string>} (\defaultparam{c}) -\item[\param{labelref}:] \paramvalue{relative|relgrav|global} (\defaultparam{relgrav}) +\paramitem{isolatorsize}{}{0.6} \end{description} -\parameter{labeloffset} specifies the offset from the center of the component, -\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=3.5cm] +\begin{pspicture}[showgrid=true](3,2) + \optisolator(0,1)(3,1){} +\end{pspicture} +\end{LTXexample} \medskip -\begin{LTXexample}[width=5cm] -\begin{pspicture}(-2,-2)(2.5,2) - \multido{\i=0+72}{5}{% - \optbox[endbox, - labelref=relative, - labeloffset=0, - optboxwidth=1](0,0)(1;\i){\i} - } +\subsection{Optical Switch} +\begin{description} +\paramitem{switchsize}{}{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}{}{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 Collimator} + +\begin{description} +\paramitem{fibercolsize}{}{0.3} +\end{description} + +The connection type for the fiber collimator is fixed to \parameter{conn=o-f}. + +\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 + +\subsection{Coupler}\label{sec:coupler} +\begin{description} +\paramitem{couplersize}{}{0.2} +\paramitem{couplersep}{}{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=5cm] -\begin{pspicture}(-2,-2)(2.5,2) - \multido{\i=0+72}{5}{% - \optbox[endbox, - labelref=relgrav, - optboxwidth=1](0,0)(1;\i){\i} - } +\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=5cm] -\begin{pspicture}(-2,-2)(2.5,2) - \multido{\i=0+72}{5}{% - \optbox[endbox, - labelref=global, - optboxwidth=1](0,0)(1;\i){\i} - } +\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} -\section{Defining new components} +\medskip + +\subsection{Fiber Styles}\label{sec:styles} + +\begin{description} +\paramitem{Fiber}{}{linecolor=red} +\paramitem{FiberIn}{}{style=Fiber} +\paramitem{FiberIn1}{}{style=FiberIn} +\paramitem{FiberIn2}{}{style=FiberIn} +\paramitem{FiberOut}{}{style=Fiber} +\paramitem{FiberOut1}{}{style=FiberOut} +\paramitem{FiberOut2}{}{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. -\subsection{Customized versions of existing macros} +\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{new\ldots} and \parameter{addto\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. The following examples defines a -new object \cs{sbn} for the special crystal used in -Sec.~\ref{sec:crystal}. +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}{crystalwidth=1.5, crystalheight=0.6, voltage, lamp, labelangle=45, labeloffset=1.2, fillstyle=solid, fillcolor=yellow!90!black} -\begin{pspicture}(3,2)\psgrid +\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=OptBeam](0,1)(3,1) + \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 -If you need more than one type of lenses in your setup it is very cumbersome to specify all parameters every time. +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}(5,2)\psgrid +\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=OptBeam](A)(B) + \psline[style=Beam](A)(B) \end{pspicture} \end{LTXexample} \medskip -\subsection{Defining new objects}\label{sec:newobj} +\subsection{Defining New Objects}\label{sec:newobj} Since version 1.2 \texttt{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 the new -component. All you have to do is to define a new 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 object which takes no label +\cs{newOptexpDipoleNolabel} defines a new free-ray object without label (like \cs{polarization}) and \cs{newOptexpTripole} defines a new -reflective component. +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. +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 withing the \cs{mycomponent@iii} +how the coordinate system is handled within the \cs{mycomponent@iii} macro. \medskip @@ -738,21 +1601,21 @@ macro. \begin{LTXexample}[width=4.5cm] \newOptexpTripole{mygrid}{subgriddiv=5, griddots=0, subgridwidth=\pslinewidth, gridwidth=2\pslinewidth} \makeatletter -\def\mygrid@iii{% put here all drawing code +\def\mygrid@iii{% put here all PSTricks drawing code \psgrid(-1,0)(1,1) }% \makeatother -\begin{pspicture}(4,4)\psgrid +\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=OptBeam](A)(G)(B) + \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 -\texttt{tempNode@Label} in the \cs{mycomponent@iii} macro. +\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. @@ -760,22 +1623,20 @@ incorporate this in a new released version. \newpage \section{Examples} -\psset{unit=1.2cm} \begin{LTXexample}[pos=t,vsep=8mm] -\begin{pspicture}(0,0.2)(12,1.8) -\pnode(0,1.2){Start}\pnode(11,1.2){CCD} -\psline[linewidth=2\pslinewidth,style=OptBeam](Start)(CCD) -\polarization[poltype=perp,position=0.1](Start)(CCD) +\begin{pspicture}(0,0.2)(13,1.8) +\addtopsstyle{Beam}{linewidth=2\pslinewidth} +\pnode(1.4,1){Start}\pnode(11,1){CCD} +\optbox[endbox, labeloffset=0](CCD)(Start){Laser} +\optbox[endbox, labeloffset=0, beam](Start)(CCD){CCD} +\polarization[poltype=perp, position=0.1](Start)(CCD) \optretplate[position=0.15](Start)(CCD){$\nicefrac{\lambda}{2}$} -\lens[lensheight=0.5, - lensradius=0.5, - position=0.25](Start)(CCD){$L_1$} +\lens[lens=0.5 0.5 0.5, position=0.25](Start)(CCD){$L_1$} \lens[position=0.5](Start)(CCD){$L_2$} \optplate[position=0.57, platelinewidth=3\pslinewidth](Start)(CCD){SLM} -\optplate[position=0.63](Start)(CCD){PF} +\optplate[position=0.63, labelangle=180](Start)(CCD){PF} \polarization[position=0.66](Start)(CCD) \lens[position=0.7](Start)(CCD){$L_3$} -\optbox[endbox,labeloffset=0](Start)(CCD){CCD} \end{pspicture} \end{LTXexample} @@ -783,30 +1644,30 @@ incorporate this in a new released version. \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){Grid} + \pnode(0,0){Grat} \pnode(4;45){Out} \pnode(2.5;67.5){Mvar} - \psline[linewidth=2\pslinewidth, - linecolor=red!90!black](LaserOut)(Grid)(Out)\psline(Grid)(Mvar) - \optbox[endbox, optboxwidth=2, labeloffset=0](Grid)(LaserOut){diodelaser} - \optretplate[position=0.3, labeloffset=0.8](LaserOut)(Grid){$\nicefrac{\lambda}{4}$} - \optgrid(LaserOut)(Grid)(Out){grid} - \mirror[variable](Grid)(Mvar)(Grid){M$_\mathrm{var}$} + \optbox[endbox, optboxwidth=2, labeloffset=0](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=3mm] +\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=OptBeam,linewidth=2\pslinewidth]% - (Laser)(PBS2)(piezo)(BSBwd)(M4f1)(M4f2)(M4f3)(BS4f)(CCD) - \psline[style=OptBeam,linewidth=2\pslinewidth](PBS)(BSFwd)(BS4f) - \psset{mirrorwidth=0.6, plateheight=0.7, outerheight=0.7, labeloffset=0.7, labelstyle=\scriptsize, lensheight=0.8, lenswidth=0.2, bssize=0.5} + \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} @@ -822,32 +1683,207 @@ incorporate this in a new released version. \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} - \crystal[crystalwidth=1, crystalheight=0.5, voltage, lamp, fillstyle=solid, fillcolor=yellow!90!black, labeloffset=0.8](BSFwd)(BSBwd){SBN:Ce} \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](BS4f)(CCD){CCD} + \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} - \psline[style=OptBeam, linewidth=2\pslinewidth](BSFwd)(BSBwd) \end{pspicture} \end{LTXexample} -\section{Todo} +\newpage + +The following schematic configuration of a recirculating loop was +adapted from the publication N. Kikuchi, S. Sasaki and K. Sekine, `10 +Gbit/s dispersion-compensated transmission over 2245~km conventional +fibres in a recirculating loop', Electron. Lett. 31 (\textbf{5}), 375 +(1995). + +\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} -The next thing I will add are components with multiple internal -reflections, as right-angle, penta and dove prisms. The code is almost -ready, I just need to think a bit more about the best way to provide -access to the nodes that are newly defined within the components. +\psset{unit=1cm} +\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} -Fiber optical components are also in preparation. +\section{Complete List of Parameters} +\begin{longtable}{BTT} +\toprule \multicolumn{1}{l}{parameter} & \multicolumn{1}{l}{allowed values} & \multicolumn{1}{l}{default}\\\midrule\endhead +\bottomrule\endfoot +abspos & & \{\}\\ +addtoFiber\ldots & & \\ +newFiber\ldots & & \\ +align & top|bottom|center & center\\ +angle & & 0\\ +beam & \multicolumn{2}{l}{alias for \parameter{conn=o-i}}\\ +bssize & & 0.8\\ +caxisinv & & false\\ +caxislength & & 0.6\\ +compname & & \{\}\\ +conn & & -\\ +couplersep & & 0.1\\ +couplersize & & 0.2\\ +couplertype & none|elliptic & elliptic\\ +crystalheight & & 0.6\\ +crystalwidth & & 1.4\\ +detsize & & 0.8\\ +dettype & round|diode & round\\ +doveprismsize & & 0.6\\ +endbox & & false\\ +extnode & & \{\}\\ +fdlsize & & 0.6\\ +fiber & \multicolumn{2}{l}{alias for \parameter{conn=f-f}}\\ +fibercolsize & & 0.3\\ +fiberloopradius & & 0.4\\ +fiberloops & & 3\\ +fiberloopsep & & 0.3\\ +filtersize & & 0.8\\ +filtertype & bandpass|bandstop & bandpass\\ +innerheight & & 0.1\\ +isolatorsize & & 0.6\\ +labelalign & & c\\ +labelangle & & 0\\ +labeloffset & & 0.8\\ +labelref & relative|relgrav|global & relgrav\\ +labelstyle & & \cs{small}\\ +lamp & & false\\ +lampscale & & 0.3\\ +lens & [ [ []]] & \{\}\\ +lensheight & & 1\\ +lensradius & [] & \{\}\\ +lensradiusleft & & 1\\ +lensradiusright & & 1\\ +lenswidth & & 0.2\\ +mirrordepth & & 0.1\\ +mirrorlinewidth & & 2\cs{pslinewidth}\\ +mirrorradius & & 0\\ +mirrortype & normal|piezo|extended & normal\\ +mirrorwidth & & 1\\ +optampsize & & 0.8\\ +optboxheight & & 0.8\\ +optboxwidth & & 1.4\\ +optdiodesize & & 0.8\\ +optgridcount & & 10\\ +optgriddepth & & 0.05\\ +optgridheight & & 0.1\\ +optgridlinewidth & & 0.7\cs{pslinewidth}\\ +optgridtype & blazed|binary & blazed\\ +optgridwidth & & 1\\ +optional & & false\\ +optmzmsize & & 0.8\\ +outerheight & & 1\\ +pentaprismsize & & 0.7\\ +phlinewidth & & 2\cs{pslinewidth}\\ +plateheight & & 1\\ +platelinewidth & & 2\cs{pslinewidth}\\ +platewidth & & 0.1\\ +polcontrolsize & & 0.15\\ +pollinewidth & & 0.7\cs{pslinewidth}\\ +polsize & & 0.6\\ +poltype & parallel|perp|misc|lcirc|rcirc & parallel\\ +position & & \{\}\\ +prismangle & & 60\\ +prismsize & & 1\\ +raprismsize & & 1.5\\ +refractiveindex & & \{\}\\ +reverse & & false\\ +rotateref & & c\\ +showoptdots & & false\\ +switchsize & & 0.8\\ +switchstyle & opened|closed & opened\\ +thicklens & & false\\ +usefiberstyle & & false\\ +variable & & false\\ +voltage & & 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:styles}\\ +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})\\ +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} + +\texttt{pst-optexp} version 2.0 requires at least version 2.87 of +\texttt{pstricks-add} and \LaTeX. It does not work with plain \TeX. -Drawing of extended beams with focusing and so on could be integrated to +\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ß. diff --git a/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro b/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro index dc59ceba9a3..83cd176af12 100644 --- a/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro +++ b/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro @@ -1,25 +1,35 @@ % % PostScript prologue for pst-optexp.tex. -% version 0.1 2008-06-17 (cb) +% version 0.2 2008-07-27 (cb) % For distribution, see pstricks.tex. % /tx@OptexpDict 20 dict def tx@OptexpDict begin % +% str1 str2 append str1str2 +/strcat { + exch 2 copy + length exch length add + string dup dup 5 2 roll + copy length exch + putinterval +} bind def % % expects: XB YB XA YA XG YG /calcNodes {% def - /YG ED /XG ED + /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' @@ -44,18 +54,19 @@ tx@OptexpDict begin % doesn't really make sens. % So if 'chir' <= 0 exchange the calculated coordinates of % A and B and otherwise leave it as is - ax by mul ay bx mul sub 0 le + /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 ED - /Y@B ED}if + /X@B exch def + /Y@B exch def}if } bind def % % called with: height R1 % leaves on stack: y |R1| alpha_bottom alpha_top R1 /leftConvex {% def - /R1 ED /h ED + /R1 exch def /h exch def /a1 R1 dup dup mul h dup mul sub sqrt sub def 0 R1 abs R1 a1 sub neg dup @@ -68,7 +79,7 @@ tx@OptexpDict begin % called with: height R1 % leaves on stack: y |R1| alpha_bottom alpha_top R1 /leftConcave {% def - /R1 ED /h ED + /R1 exch def /h exch def /a1 R1 abs dup dup mul h dup mul sub sqrt sub def 0 R1 abs R1 neg a1 sub dup @@ -82,7 +93,7 @@ tx@OptexpDict begin % called with: height R2 % leaves on stack: y |R2| alpha_bottom alpha_top R2 /rightConvex {%def - /R2 ED /h ED + /R2 exch def /h exch def /a2 R2 abs dup dup mul h dup mul sub sqrt sub def 0 R2 abs R2 a2 sub dup @@ -95,7 +106,7 @@ tx@OptexpDict begin % called with: height R2 % leaves on stack: y |R2| alpha_bottom alpha_top R2 /rightConcave {%def - /R2 ED /h ED + /R2 exch def /h exch def /a2 R2 abs dup dup mul h dup mul sub sqrt sub def 0 R2 abs R2 a2 add dup @@ -106,4 +117,61 @@ tx@OptexpDict begin 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 +% +% +/InitOptexpComp {% + tx@Dict begin + /@@x 0 def + /@@y 0 def + /@@x0 0 def + /@@y0 0 def + /@xref 0 def + /@yref 0 def + end +} 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 end % tx@OptexpDict diff --git a/Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex b/Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex index 6d7b5fe5bcc..2231aa412ad 100644 --- a/Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex +++ b/Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex @@ -16,12 +16,18 @@ %% %% 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{1.2} -\def\filedate{2008/06/17} +\def\fileversion{2.0} +\def\filedate{2008/07/27} \message{`pst-optexp' v\fileversion, \filedate\space (CB)} % \edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax @@ -30,82 +36,107 @@ \def\pst@optexpdict{tx@OptexpDict begin } \SpecialCoor % -% In some versions of pstricks-add previous to 2.81 the macro -% \nlput is buggy. In these cases it is redefined here. -\ifdim\pstricksaddfileversion pt<2.81pt -\typeout{} -\typeout{pst-optexp: please update pstricks-add to version >= 2.81} -\typeout{} -\def\psLDNode(#1)(#2)#3#4{% -% #1: node A #2: node B #3: dimen measured from A #4: node name - \pst@getcoor{#1}\pst@tempA% - \pst@getcoor{#2}\pst@tempB% - \pssetlength\pst@dimp{#3}% - \pnode(!% - \pst@tempA /YA exch \pst@number\psyunit div def - /XA exch \pst@number\psxunit div def - \pst@tempB /YB exch \pst@number\psyunit div def - /XB exch \pst@number\psxunit div def - /dx XB XA sub def - /dy YB YA sub def - /angle dy dx Atan def - /linelength \pst@number\pst@dimp \pst@number\psunit div def - XA linelength angle cos mul add YA linelength angle sin mul add ){#4}% -}% -\def\nlput{\pst@object{nlput}} -\def\nlput@i(#1)(#2)#3#4{% - \begin@SpecialObj - \psLDNode(#1)(#2){#3}{temp@lnput} - \pcline[linestyle=none](#1)(temp@lnput)% - \ncput[npos=1]{#4}% - \end@SpecialObj -}% +% We need pstricks-add >= 2.87 for the \psrotate macro version that +% can handle Postscript code in the nodes +\ifdim\pstricksaddfileversion pt<2.87pt +\PackageError{pst-optexp}{^^JWe need a pstricks-add version >= 2.87, you have v\pstricksaddfileversion, please update!^^J} \fi % +% % IF's % -\newif\ifPst@optexp@variable -\newif\ifPst@optexp@crystal@voltage -\newif\ifPst@optexp@crystal@caxisinv -\newif\ifPst@optexp@reverse -\newif\ifPst@optexp@crystal@lamp -\newif\ifPst@optexp@component@optional -\newif\ifPst@optexp@debug@showoptdots -\newif\ifPst@optexp@endbox -\newif\ifPst@optexp@thicklens +\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 +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Strings -\def\pst@string@pol@polperp{perp} -\def\pst@string@pol@polparallel{parallel} -\def\pst@string@pol@polmisc{misc} -\def\pst@string@pol@polrcirc{rcirc} -\def\pst@string@pol@pollcirc{lcirc} -\def\pst@string@mirror@type@piezo{piezo} -\def\pst@string@mirror@type@plain{plain} -\def\pst@string@mirror@type@extended{extended} -\def\pst@string@optgrid@type@blazed{blazed} -\def\pst@string@optgrid@type@binary{binary} -% -\def\pst@string@lens@type@plainconvex{plainconvex} -\def\pst@string@lens@type@convexplain{convexplain} -\def\pst@string@lens@type@biconvex{biconvex} -\def\pst@string@lens@type@plainconcave{plainconcave} -\def\pst@string@lens@type@concaveplain{concaveplain} -\def\pst@string@lens@type@biconcave{biconcave} -% -\def\pst@string@labelref@relative{relative} -\def\pst@string@labelref@relgrav{relgrav} -\def\pst@string@labelref@global{global} % +\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} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % psstyles % \newpsstyle{OptionalStyle}{linestyle=dashed,dash=1.5pt 1pt}% \newpsstyle{ExtendedMirror}{linestyle=none,% - hatchwidth=0.5\psk@optexp@mirror@linewidth,%0.6pt,% - hatchsep=1.4\psk@optexp@mirror@linewidth,% + hatchwidth=0.5\POK@mirror@linewidth, + hatchsep=1.4\POK@mirror@linewidth,% fillstyle=hlines}% \newpsstyle{PiezoMirror}{fillstyle=solid,fillcolor=black!30}% -\newpsstyle{OptBeam}{linecolor=green!90!black}% +\newpsstyle{Beam}{linecolor=green!90!black}% +% +\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}} % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -113,21 +144,49 @@ % Parameterdefinitions % % General -\define@boolkey[psset]{optexp}[Pst@optexp@component@]{optional}[true]{} -\define@key[psset]{optexp}{position}{\edef\psk@optexp@position{#1}} -\define@key[psset]{optexp}{abspos}{\edef\psk@optexp@abspos{#1}} -\define@key[psset]{optexp}{angle}{\edef\psk@optexp@angle{#1}} +\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}} +% 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\psk@optexp@lens@height{#1}} -\define@key[psset]{optexp}{lenswidth}{\edef\psk@optexp@lens@width{#1}} -\define@key[psset]{optexp}{lensradiusleft}{\edef\psk@optexp@lens@radiusLeft{#1}} -\define@key[psset]{optexp}{lensradiusright}{\edef\psk@optexp@lens@radiusRight{#1}} -\define@boolkey[psset]{optexp}[Pst@optexp@]{thicklens}[true]{} +\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\psk@optexp@lens@radius{#1}% + \edef\POK@lens@radius{#1}% }% % Lens Type (only for backward compatibility) % 0 -> plainconvex @@ -139,13 +198,13 @@ % \define@key[psset]{optexp}{lenstype}{% \def\pst@tempA{#1} - \edef\psk@optexp@lens@type{% - \ifx\pst@string@lens@type@plainconvex\pst@tempA 0\else - \ifx\pst@string@lens@type@convexplain\pst@tempA 1\else - \ifx\pst@string@lens@type@biconvex\pst@tempA 2\else - \ifx\pst@string@lens@type@plainconcave\pst@tempA 3\else - \ifx\pst@string@lens@type@concaveplain\pst@tempA 4\else - \ifx\pst@string@lens@type@biconcave\pst@tempA 5% + \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}{% @@ -170,99 +229,378 @@ }% % % Pinhole -\define@key[psset]{optexp}{innerheight}{\edef\psk@optexp@pinhole@iheight{#1}} +\define@key[psset]{optexp}{innerheight}{\edef\POK@pinhole@iheight{#1}} \define@key[psset]{optexp}{iwidth}{% - \edef\psk@optexp@pinhole@iheight{#1}% + \edef\POK@pinhole@iheight{#1}% \PackageWarning{pst-optexp}{iwidth is obsolete, use innerheight instead} } -\define@key[psset]{optexp}{outerheight}{\edef\psk@optexp@pinhole@oheight{#1}} +\define@key[psset]{optexp}{outerheight}{\edef\POK@pinhole@oheight{#1}} \define@key[psset]{optexp}{owidth}{% - \edef\psk@optexp@pinhole@oheight{#1}% + \edef\POK@pinhole@oheight{#1}% \PackageWarning{pst-optexp}{owidth is obsolete, use outerheight instead} } -\define@key[psset]{optexp}{phlinewidth}{\edef\psk@optexp@pinhole@linewidth{#1}} +\define@key[psset]{optexp}{phlinewidth}{\edef\POK@pinhole@linewidth{#1}} % % Beamsplitter -\define@key[psset]{optexp}{bssize}{\edef\psk@optexp@bssize{#1}} +\define@key[psset]{optexp}{bssize}{\edef\POK@bssize{#1}} \define@key[psset]{optexp}{bswidth}{% - \edef\psk@optexp@bssize{#1}% + \edef\POK@bssize{#1}% \PackageWarning{pst-optexp}{bswidth is obsolete, use bssize instead}% } % % Crystal -\define@key[psset]{optexp}{crystalwidth}{\edef\psk@optexp@crystal@width{#1}} -\define@key[psset]{optexp}{crystalheight}{\edef\psk@optexp@crystal@height{#1}} -\define@key[psset]{optexp}{caxislength}{\edef\psk@optexp@crystal@caxislength{#1}} -\define@boolkey[psset]{optexp}[Pst@optexp@crystal@]{voltage}[true]{} -\define@boolkey[psset]{optexp}[Pst@optexp@crystal@]{caxisinv}[true]{} -\define@boolkey[psset]{optexp}[Pst@optexp@crystal@]{lamp}[true]{} -\define@key[psset]{optexp}{lampscale}{\def\psk@optexp@lamp@scale{#1}} +\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\psk@optexp@mirror@width{#1}} -\define@key[psset]{optexp}{mirrorlinewidth}{\edef\psk@optexp@mirror@linewidth{#1}} -\define@key[psset]{optexp}{mirrortype}{\edef\psk@optexp@mirror@type{#1}}% piezo, extended, plain -\define@key[psset]{optexp}{mirrordepth}{\edef\psk@optexp@mirror@depth{#1}} -\define@key[psset]{optexp}{mirrorradius}{\edef\psk@optexp@mirror@radius{#1}} -\define@boolkey[psset]{optexp}[Pst@optexp@]{variable}[true]{} +\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\psk@optexp@optgrid@count{#1}} -\define@key[psset]{optexp}{optgridwidth}{\edef\psk@optexp@optgrid@width{#1}} -\define@key[psset]{optexp}{optgridheight}{\edef\psk@optexp@optgrid@height{#1}} -\define@key[psset]{optexp}{optgridtype}{\edef\psk@optexp@optgrid@type{#1}} -\define@key[psset]{optexp}{optgriddepth}{\edef\psk@optexp@optgrid@depth{#1}} -\define@key[psset]{optexp}{optgridlinewidth}{\edef\psk@optexp@optgrid@linewidth{#1}} -\define@boolkey[psset]{optexp}[Pst@optexp@]{reverse}[true]{} +\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}{\edef\psk@optexp@optbox@width{#1}} -\define@key[psset]{optexp}{optboxheight}{\edef\psk@optexp@optbox@height{#1}} -\define@boolkey[psset]{optexp}[Pst@optexp@]{endbox}[true]{} +\define@key[psset]{optexp}{optboxwidth}{\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\psk@optexp@plate@linewidth{#1}} -\define@key[psset]{optexp}{plateheight}{\edef\psk@optexp@plate@height{#1}} +\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\psk@optexp@plate@width{#1}} +\define@key[psset]{optexp}{platewidth}{\edef\POK@plate@width{#1}} % % Detector -\define@key[psset]{optexp}{detsize}{\edef\psk@optexp@detector@size{#1}} +\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\psk@optexp@polarization@size{#1}% + \edef\POK@polarization@size{#1}% \PackageWarning{pst-optexp}{polwidth is obsolete, use polsize instead}% } -\define@key[psset]{optexp}{polsize}{\edef\psk@optexp@polarization@size{#1}} -\define@key[psset]{optexp}{pollinewidth}{\edef\psk@optexp@polarization@linewidth{#1}} -\define@key[psset]{optexp}{poltype}{\edef\psk@optexp@pol@type{#1}} +\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\psk@optexp@poltype{#1}% + \edef\POK@poltype{#1}% \PackageWarning{pst-optexp}{pol is obsolete, use poltype instead}% } % -% Label -\define@key[psset]{optexp}{labelangle}{\edef\psk@optexp@label@angle{#1}} -\define@key[psset]{optexp}{labeloffset}{\edef\psk@optexp@label@offset{#1}} -\define@key[psset]{optexp}{labelstyle}{\def\psk@optexp@label@style{#1}} -\define@key[psset]{optexp}{labelalign}{\def\psk@optexp@label@align{#1}} -\define@key[psset]{optexp}{labelref}{\edef\psk@optexp@label@ref{#1}} -% for internal use only -\define@key[psset]{optexp}{ref@angle}{\edef\psk@optexp@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} +% 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}} +% +% 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}} +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% 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}{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}% + \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}% +} +\def\optexp@nodeA{\POK@basicname 1}% +\def\optexp@nodeB{\POK@basicname N}% +\def\optexp@node#1{\POK@basicname #1}% % -% Debug -\define@boolkey[psset]{optexp}[Pst@optexp@debug@]{showoptdots}[true]{} +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% END %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -276,6 +614,19 @@ % This can be useful to preset options that are not allowed to be changed by the % user. % +\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 +}% +\def\end@OptexpObj{% + \pst@OptexpVerb{(\POS@optexp@basicname@default) (\POK@basicname) CloseOptexpComp}% + \endgroup + \ignorespaces% +}% \def\addafter@par#1{% \ifx\pst@par\@empty \def\pst@par{#1}% @@ -284,7 +635,19 @@ \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 @@ -295,6 +658,11 @@ \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}% +}% % % 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 @@ -304,17 +672,22 @@ \@ifundefined{#2@i}{% \@namedef{#2}{\pst@object{#2}}% \expandafter\def\csname #2@i\endcsname(##1)(##2)##3{% - \pst@killglue \addbefore@par{#3}% \addafter@par{#1}% - \begingroup - \use@par + \begin@OptexpObj \pst@regNodes{##1}{##2} \pst@draw@component{##3}{\@nameuse{#2@ii}} - \endgroup + % connect + \@nameuse{\psk@connIn} + \ifPOE@endbox\else + \@nameuse{\psk@connOut} + \fi + \end@OptexpObj }% \@namedef{#2@ii}{% \pnode(0,0){tempNode@Label}% + \pnode(0,0){\optexp@nodeA}% + \pnode(0,0){\optexp@nodeB}% \@nameuse{#2@iii}% }% }{% @@ -326,17 +699,20 @@ \@ifundefined{#2@i}{% \@namedef{#2}{\pst@object{#2}}% \expandafter\def\csname #2@i\endcsname(##1)(##2){% - \pst@killglue \addbefore@par{#3}% \addafter@par{#1}% - \begingroup - \use@par + \begin@OptexpObj \pst@regNodes{##1}{##2} \pst@draw@component{}{\@nameuse{#2@ii}} - \endgroup + % + \@nameuse{\psk@connIn} + \@nameuse{\psk@connOut} + \end@OptexpObj }% \@namedef{#2@ii}{% \pnode(0,0){tempNode@Label}% + \pnode(0,0){\optexp@nodeA}% + \pnode(0,0){\optexp@nodeB}% \@nameuse{#2@iii}% }% }{% @@ -348,22 +724,147 @@ \@ifundefined{#2@i}{% \@namedef{#2}{\pst@object{#2}}% \expandafter\def\csname #2@i\endcsname(##1)(##2)(##3)##4{% - \pst@killglue \addbefore@par{#3}% \addafter@par{ref@angle=180,#1}% - \begingroup - \use@par + \begin@OptexpObj \pst@calcNodes{##1}{##2}{##3} \pst@draw@component{##4}{\@nameuse{#2@ii}} - \endgroup + % 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 + }% + \@nameuse{\psk@connIn}% + \@nameuse{\psk@connOut}% + \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 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 + % + % connect the fibers + \psset{angleA=! \pst@optexpdict FiberAngleA end, + angleB=! \pst@optexpdict FiberAngleB end} + \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 + % + % connect the fibers + \psset{angleA=! \pst@optexpdict FiberAngleA end, + angleB=! \pst@optexpdict FiberAngleB end} + \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. @@ -401,6 +902,11 @@ \def\pst@regNodes#1#2{% \pnode(#1){tempNode@A} \pnode(#2){tempNode@B} + \pst@Verb{tx@NodeDict begin N@tempNode@A GetCenter pop N@tempNode@B GetCenter pop end + gt {/@xref \POK@xref\space neg def /@yref \POK@yref\space neg def} + {/@xref \POK@xref\space def /@yref \POK@yref\space def} ifelse + tx@OptexpDict /chirality known not {tx@OptexpDict begin /chirality 1 def end } if + }% \ignorespaces}% % % @@ -416,7 +922,7 @@ \pnode(!% \pst@tempDiff /YDiff ED /XDiff ED % /N@#2 load GetCenter /YShifted ED /XShifted ED - /rot@angle #4 \psk@optexp@label@refangle\space add def + /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 @@ -435,19 +941,19 @@ % Used to put the label for labelref=relative % \def\put@RelLabel#1{% - \nput[labelsep=0]{\psk@optexp@label@angle}% + \nput[labelsep=0]{\POK@label@angle}% {tempNode@LabelShifted}% - {\rput[\psk@optexp@label@align](0,0){\psk@optexp@label@style #1}}% + {\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{% #1% - \pst@defShiftedRotLabelNode(0,\psk@optexp@label@offset)% + \pst@defShiftedRotLabelNode(0,\POK@label@offset)% {tempNode@Label}% {tempNode@LabelShifted}% - {\psk@optexp@label@angle}% + {\POK@label@angle}% }% % % Positioning of the label depending on the reference coordinates. @@ -464,20 +970,22 @@ % relative => as relgrav but text is rotated together with object. % \def\put@Label#1{% - \ifx\psk@optexp@label@ref\pst@string@labelref@global + \def\pst@temp{#1}% + \ifx\pst@temp\@empty\else + \ifx\POK@label@ref\POS@labelref@global % % global - \nput[labelsep=\psk@optexp@label@offset]% - {\psk@optexp@label@angle}% + \nput[labelsep=\POK@label@offset]% + {\POK@label@angle}% {tempNode@Label}% - {\rput[\psk@optexp@label@align](0,0){\psk@optexp@label@style #1}}% + {\rput[\POK@label@align](0,0){\POK@label@style #1}}% % - \else\ifx\psk@optexp@label@ref\pst@string@labelref@relgrav + \else\ifx\POK@label@ref\POS@labelref@relgrav % % relgrav - \rput[\psk@optexp@label@align](tempNode@LabelShifted){\psk@optexp@label@style #1}% + \rput[\POK@label@align](tempNode@LabelShifted){\POK@label@style #1}% % - \else\ifx\psk@optexp@label@ref\pst@string@labelref@relative + \else\ifx\POK@label@ref\POS@labelref@relative % % relative \begingroup @@ -493,26 +1001,31 @@ 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 pop exch pop le % xA xB - { /yB ED /xB ED /yA ED /xA ED } - { /yA ED /xA ED /yB ED /xB ED } ifelse + 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\psk@optexp@position\@empty - \ifx\psk@optexp@abspos\@empty + \ifx\POK@position\@empty + \ifx\POK@abspos\@empty \ncput[nrot=:U,npos=]{\put@RelLabel{#1}} \else - \nlput[nrot=:U](tempNode@A)(tempNode@B){\psk@optexp@abspos}{\put@RelLabel{#1}} + \nlput[nrot=:U](tempNode@A)(tempNode@B){\POK@abspos}{\put@RelLabel{#1}} \fi \else - \ncput[nrot=:U,npos=\psk@optexp@position]{\put@RelLabel{#1}} + \ncput[nrot=:U,npos=\POK@position]{\put@RelLabel{#1}} \fi % \endgroup \fi\fi\fi + \fi }% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -529,14 +1042,19 @@ \newOptexpDipole{optbox}{}% \newOptexpDipole{optplate}{}% \newOptexpDipole{optretplate}{}% -\newOptexpDipole[endbox]{detector}{}% -\newOptexpDipole{optdipole}{}% +\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 % @@ -547,9 +1065,15 @@ \use@par \pst@regNodes{#1}{#2} \pst@draw@component{#4}{% - \pnode(0,0){tempNode@Label}% + \pnode(0,0){tempNode@Label}% + \pnode(0,0){\optexp@nodeA}% + \pnode(0,0){\optexp@nodeB}% #3 }% + \@nameuse{\psk@connIn} + \ifPOE@endbox\else + \@nameuse{\psk@connOut} + \fi \endgroup }% \def\opttripole{\pst@object{opttripole}} @@ -560,11 +1084,30 @@ \pst@calcNodes{#1}{#2}{#3} \pst@draw@component{#5}{% \pnode(0,0){tempNode@Label}% + \pnode(0,0){\optexp@nodeA}% + \pnode(0,0){\optexp@nodeB}% #4 }% \endgroup }% % +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% FIBER COMPONENTS +\newOptexpFiberDipole{optfiber}{} +\newOptexpFiberDipole{optamp}{} +\newOptexpFiberDipole{optmzm}{} +\newOptexpFiberDipole{optfilter}{} +\newOptexpFiberDipole{polcontrol}{} +\newOptexpFiberDipole{optisolator}{} +\newOptexpFiberDipole{optswitch}{} +\newOptexpFiberDipole{fiberdelayline}{} +\newOptexpFiberQuadrupole{optcoupler}{} +% +% HYBRID COMPONENTS +\newOptexpDipole{fibercollimator}{conn=o-f} +% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -576,6 +1119,7 @@ position=\@empty ,abspos=\@empty ,angle=0 + ,rotateref=c % lens ,lenswidth=0.2 ,lensheight=1 @@ -583,6 +1127,7 @@ ,lensradius=\@empty ,lensradiusleft=1 ,lensradiusright=1 + ,thicklens=false % pinhole ,phlinewidth=2\pslinewidth ,outerheight=1 @@ -590,37 +1135,54 @@ % beamsplitter ,bssize=0.8 % crystal - ,crystalwidth=2 - ,crystalheight=0.8 + ,crystalwidth=1.4 + ,crystalheight=0.6 ,caxislength=0.6 ,lampscale=0.3 % mirror ,mirrorwidth=1 - ,mirrordepth=0.08 + ,mirrordepth=0.1 ,mirrorradius=0 - ,mirrortype=\pst@string@mirror@type@plain + % 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.1 - ,optgriddepth=0.05 - ,optgridtype=\pst@string@optgrid@type@blazed + ,optgridheight=0.15 + ,optgriddepth=0.075 + ,optgridtype=blazed ,optgridlinewidth=0.7\pslinewidth + ,reverse=false % optbox - ,optboxwidth=1 - ,optboxheight=0.5 + ,optboxwidth=1.4 + ,optboxheight=0.8 + ,refractiveindex=\@empty % optplate ,plateheight=1 ,platelinewidth=2\pslinewidth % optretplate ,platewidth=0.1 % detector - ,detsize=0.5 + ,detsize=0.8 + ,dettype=round % polarization - ,poltype=\pst@string@pol@polparallel + ,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 @@ -628,6 +1190,28 @@ ,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 + ,couplersize=0.2 + ,couplersep=0.05 + ,couplertype=elliptic + ,switchsize=0.8 + ,switchstyle=opened + ,fdlsize=0.6 + ,fibercolsize=0.3 + ,conn=- + ,usefiberstyle=false }% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % @@ -636,47 +1220,57 @@ % This macro is called by every unit % \def\pst@draw@component#1#2{% - % - \ifPst@optexp@endbox% - \ifx\psk@optexp@label@offset\@empty + % + \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% % - % linestyle to use, if component should be marked as optional - \ifPst@optexp@component@optional - \psset{style=OptionalStyle} - \fi \ncline[linestyle=none,fillstyle=none,npos=]{tempNode@A}{tempNode@B}% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % Positioning of the component % + \begingroup + % + % 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\psk@optexp@position\@empty + \ifx\POK@position\@empty % % then check if absolute positioning is wanted - \ifx\psk@optexp@abspos\@empty - \ncput[nrot=:U,npos=]{\put@Comp{#2}} + \ifx\POK@abspos\@empty + \ncput[nrot=:U,npos=]{\put@Comp{\@@comp}} \else - \nlput[nrot=:U](tempNode@A)(tempNode@B){\psk@optexp@abspos}{\put@Comp{#2}} + \nlput[nrot=:U](tempNode@A)(tempNode@B){\POK@abspos}{\put@Comp{\@@comp}} \fi \else - \ncput[nrot=:U,npos=\psk@optexp@position]{\put@Comp{#2}} + \ncput[nrot=:U,npos=\POK@position]{\put@Comp{\@@comp}} \fi + \endgroup % % Now put the label \put@Label{#1}% % % Show some special dots for debugging - \ifPst@optexp@debug@showoptdots + \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}% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -689,21 +1283,21 @@ % MIRROR % \def\mirror@iii{% - \edef\@mirror@ht{\psk@optexp@mirror@width\space\pst@number\psyunit mul 2 div }% - \edef\@mirror@dp{\psk@optexp@mirror@depth\space\pst@number\psxunit mul }% - \edef\@mirror@r{\psk@optexp@mirror@radius\space\pst@number\psxunit mul }% + \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\psk@optexp@mirror@radius pt<0pt + \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\psk@optexp@mirror@type\pst@string@mirror@type@extended + \ifx\POK@mirror@type\POS@mirror@type@extended % % extended concave mirror \psset{style=ExtendedMirror} @@ -717,12 +1311,12 @@ % % convex mirrors % - \else\ifdim\psk@optexp@mirror@radius pt>0pt + \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\psk@optexp@mirror@type\pst@string@mirror@type@extended + \ifx\POK@mirror@type\POS@mirror@type@extended % % extended convex mirror \psset{style=ExtendedMirror} @@ -736,29 +1330,33 @@ % % plain mirror % - \edef\@m@wd{\psk@optexp@mirror@width\space 2 div } - \ifPst@optexp@variable + \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=\psk@optexp@mirror@linewidth](! \@m@wd neg 0)(! \@m@wd 0) + \psline[linewidth=\POK@mirror@linewidth](! \@m@wd neg 0)(! \@m@wd 0) % % mirrortype - \ifx\psk@optexp@mirror@type\pst@string@mirror@type@piezo% + \ifx\POK@mirror@type\POS@mirror@type@piezo% % % piezo - \psframe[style=PiezoMirror](! \@m@wd 4 div 0)(! \@m@wd -4 div \@m@wd 2.5 div) - \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\ifx\psk@optexp@mirror@type\pst@string@mirror@type@extended% + \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 \psk@optexp@mirror@depth\space )% + (! \@m@wd neg \POK@mirror@depth\space )% (! \@m@wd 0)% \fi\fi \fi\fi @@ -771,34 +1369,34 @@ \def\lens@iii{% % % use old lens code to maintain backward compatibility - \ifx\psk@optexp@lens@type\@empty + \ifx\POK@lens@type\@empty % NEW CODE! \begin@ClosedObj - \edef\@lens@wd{\psk@optexp@lens@width\space\pst@number\psxunit mul 2 div }% - \edef\@lens@ht{\psk@optexp@lens@height\space\pst@number\psyunit mul 2 div }% - \edef\@lens@rL{\psk@optexp@lens@radiusLeft\space\pst@number\psxunit mul }% - \edef\@lens@rR{\psk@optexp@lens@radiusRight\space\pst@number\psxunit mul }% + \edef\@lens@wd{\POK@lens@width\space\pst@number\psxunit mul 2 div }% + \edef\@lens@ht{\POK@lens@height\space\pst@number\psyunit mul 2 div }% + \edef\@lens@rL{\POK@lens@radiusLeft\space\pst@number\psxunit mul }% + \edef\@lens@rR{\POK@lens@radiusRight\space\pst@number\psxunit mul }% \edef\@lens@th{}% \addto@pscode{\pst@optexpdict}% % % distinguish between all the different lens-combination possibilities % - \ifdim\psk@optexp@lens@radiusLeft pt=0pt\else - \edef\@lens@th{\ifPst@optexp@thicklens \@lens@wd\else a1 \fi}% + \ifdim\POK@lens@radiusLeft pt=0pt\else + \edef\@lens@th{\ifPOE@thicklens \@lens@wd\else a1 \fi}% \addto@pscode{% \@lens@ht \@lens@rL - \ifdim\psk@optexp@lens@radiusLeft pt<0pt + \ifdim\POK@lens@radiusLeft pt<0pt leftConcave \else leftConvex \fi }% \fi - \ifdim\psk@optexp@lens@radiusRight pt=0pt\else - \edef\@lens@th{\@lens@th\space\ifPst@optexp@thicklens \@lens@wd\else a2 \fi}% + \ifdim\POK@lens@radiusRight pt=0pt\else + \edef\@lens@th{\@lens@th\space\ifPOE@thicklens \@lens@wd\else a2 \fi}% \addto@pscode{% \@lens@ht \@lens@rR - \ifdim\psk@optexp@lens@radiusRight pt<0pt + \ifdim\POK@lens@radiusRight pt<0pt rightConcave \else rightConvex @@ -810,10 +1408,10 @@ % % 1) Left is plain - right concave % \- right convex - \ifdim\psk@optexp@lens@radiusLeft pt=0pt - \ifdim\psk@optexp@lens@radiusRight pt=0pt\else + \ifdim\POK@lens@radiusLeft pt=0pt + \ifdim\POK@lens@radiusRight pt=0pt\else \addto@pscode{\@lens@th 2 div sub neg 5 1 roll }% - \ifdim\psk@optexp@lens@radiusRight pt<0pt + \ifdim\POK@lens@radiusRight pt<0pt \addto@pscode{% \@lens@th 2 div neg \@lens@ht neg moveto ArcR \@lens@th 2 div neg \@lens@ht lineto}% @@ -826,10 +1424,10 @@ % % 2) Right is plain - left concave % \- left convex - \ifdim\psk@optexp@lens@radiusRight pt=0pt - \ifdim\psk@optexp@lens@radiusLeft pt=0pt\else + \ifdim\POK@lens@radiusRight pt=0pt + \ifdim\POK@lens@radiusLeft pt=0pt\else \addto@pscode{\@lens@th 2 div sub 5 1 roll }% - \ifdim\psk@optexp@lens@radiusLeft pt<0pt + \ifdim\POK@lens@radiusLeft pt<0pt \addto@pscode{\@lens@th 2 div \@lens@ht moveto ArcL \@lens@th 2 div \@lens@ht neg lineto }% \else @@ -839,8 +1437,8 @@ \fi % % 3) right and left are both curved - \ifdim\psk@optexp@lens@radiusRight pt=0pt\else - \ifdim\psk@optexp@lens@radiusLeft pt=0pt\else + \ifdim\POK@lens@radiusRight pt=0pt\else + \ifdim\POK@lens@radiusLeft pt=0pt\else \addto@pscode{% \@lens@th\space add 2 div dup 7 1 roll sub neg 5 1 roll @@ -866,15 +1464,15 @@ % \def\pst@draw@lens{% % - \edef\@l@h{\psk@optexp@lens@height\space 2 div\space}% - \edef\@l@a{\psk@optexp@lens@width\space 2 div\space}% + \edef\@l@h{\POK@lens@height\space 2 div\space}% + \edef\@l@a{\POK@lens@width\space 2 div\space}% % - \ifnum\psk@optexp@lens@type<3 + \ifnum\POK@lens@type<3 % CONVEX - \ifx\psk@optexp@lens@radius\@empty + \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{\psk@optexp@lens@radius\space}% + \edef\@l@r{\POK@lens@radius\space}% \edef\@l@a{\@l@r dup dup mul \@l@h dup mul sub sqrt sub\space}% \fi % @@ -884,10 +1482,10 @@ \edef\@l@y{\@l@d\space}% \else % CONCAVE - \ifx\psk@optexp@lens@radius\@empty + \ifx\POK@lens@radius\@empty \edef\@l@r{\@l@h 1.5 mul\space}% \else - \edef\@l@r{\psk@optexp@lens@radius\space}% + \edef\@l@r{\POK@lens@radius\space}% \fi% % % define some parameters only for concave lenses @@ -908,7 +1506,7 @@ % % \pscustom{% - \ifcase\psk@optexp@lens@type + \ifcase\POK@lens@type % plainconvex \temp@RightPlot% \closepath% @@ -949,12 +1547,12 @@ % PINHOLE % \def\pinhole@iii{% - \psline[linewidth=\psk@optexp@pinhole@linewidth]% - (! 0 \psk@optexp@pinhole@oheight\space 2 div)% - (! 0 \psk@optexp@pinhole@iheight\space 2 div)% - \psline[linewidth=\psk@optexp@pinhole@linewidth]% - (! 0 \psk@optexp@pinhole@oheight\space -2 div)% - (! 0 \psk@optexp@pinhole@iheight\space -2 div)% + \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} % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -962,7 +1560,7 @@ % BEAMSPLITTER % \def\beamsplitter@iii{% - \edef\@bs@wd{\psk@optexp@bssize\space 2.0 div\space}% + \edef\@bs@wd{\POK@bssize\space 2.0 div\space}% \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)} \ignorespaces}% @@ -972,51 +1570,63 @@ % CRYSTAL % \def\crystal@iii{% - \edef\@c@wd{\psk@optexp@crystal@width\space 2 div\space}% - \edef\@c@ht{\psk@optexp@crystal@height\space 2 div\space}% - \rput[c]{\psk@optexp@angle}(0,0){% - \psframe(! \@c@wd neg \@c@ht neg)(! \@c@wd \@c@ht) - \ifPst@optexp@crystal@voltage% - \psline(! \@c@wd 4 div 3 mul neg \@c@ht)% - (! \@c@wd 4 div 3 mul neg \@c@ht 0.2 add) + \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](! \@c@wd 4 div 3 mul neg \@c@ht 0.2 add){0.04} - \psline(! \@c@wd 4 div 3 mul neg \@c@ht neg)% - (! \@c@wd 4 div 3 mul neg \@c@ht neg 0.2 sub)% - \psline(! \@c@wd 4 div 3 mul neg 0.15 sub \@c@ht neg 0.2 sub)% - (! \@c@wd 4 div 3 mul neg 0.15 add \@c@ht neg 0.2 sub)% + 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 % - \ifPst@optexp@crystal@lamp - \rput{180}(! \@c@wd \@c@ht 1.4 \psk@optexp@lamp@scale\space mul add){\lamp}% + \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\psk@optexp@crystal@caxislength pt>0pt - \edef\@c@caxisL{\psk@optexp@crystal@caxislength\space 2 div\space}% - \ifPst@optexp@crystal@caxisinv + \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 \@c@ht neg)(! 0 \@c@ht \@c@caxisL add)% + (! 0 @@y neg)(! 0 @@y \@c@caxisL add)% \else \psline[linestyle=dashed,% dash=2pt 2pt,% linewidth=0.7\pslinewidth,% arrowinset=0]{->}% - (! 0 \@c@ht)(! 0 \@c@ht neg \@c@caxisL sub)% + (! 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\lamp{% +\def\crystal@lamp{% \psset{linewidth=0.6\pslinewidth} - \edef\@l@s{\psk@optexp@lamp@scale\space}% + \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)% @@ -1038,27 +1648,27 @@ % \def\polarization@iii{% % - \edef\@pol@size{\psk@optexp@polarization@size\space 2 div\space}% - \ifx\psk@optexp@pol@type\pst@string@pol@polparallel - \psline[linestyle=solid,linewidth=\psk@optexp@polarization@linewidth,arrowscale=0.8]{<->}% + \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\psk@optexp@pol@type\pst@string@pol@polperp + \ifx\POK@pol@type\POS@pol@polperp \psdot[dotsize=0.05](0,0)% - \pscircle[fillstyle=none,linestyle=solid,linewidth=\psk@optexp@polarization@linewidth](0,0){0.12}% + \pscircle[fillstyle=none,linestyle=solid,linewidth=\POK@polarization@linewidth](0,0){0.12}% \fi - \ifx\psk@optexp@pol@type\pst@string@pol@polmisc - \psline[linestyle=solid,linewidth=\psk@optexp@polarization@linewidth,arrowscale=0.8]{<->}% + \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\psk@optexp@pol@type\pst@string@pol@polrcirc - \psellipticarc[linewidth=\psk@optexp@polarization@linewidth]{->}% + \ifx\POK@pol@type\POS@pol@polrcirc + \psellipticarc[linewidth=\POK@polarization@linewidth]{->}% (0,0)(! \@pol@size 2 div \@pol@size){20}{-20}% \fi - \ifx\psk@optexp@pol@type\pst@string@pol@pollcirc - \psellipticarc[linewidth=\psk@optexp@polarization@linewidth]{<-}% + \ifx\POK@pol@type\POS@pol@pollcirc + \psellipticarc[linewidth=\POK@polarization@linewidth]{<-}% (0,0)(! \@pol@size 2 div \@pol@size){20}{-20} \fi \ignorespaces}% @@ -1068,17 +1678,17 @@ % OPTICAL GRID % \def\optgrid@iii{% - \edef\@g@cnt{\psk@optexp@optgrid@count\space}% - \edef\@g@wd{\psk@optexp@optgrid@width\space 2 div\space}% - \edef\@g@ht{\psk@optexp@optgrid@height\space}% - \edef\@g@dp{\psk@optexp@optgrid@depth\space}% - \edef\@g@step{\psk@optexp@optgrid@width\space\@g@cnt div\space}% - \ifx\psk@optexp@optgrid@type\pst@string@optgrid@type@blazed - \ifPst@optexp@reverse% - \pscustom[linewidth=\psk@optexp@optgrid@linewidth]{% + \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]{% \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}{\psk@optexp@optgrid@count}{% + \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)% @@ -1086,10 +1696,10 @@ \closepath }% \else% - \pscustom[linewidth=\psk@optexp@optgrid@linewidth]{% + \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}{\psk@optexp@optgrid@count}{% + \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)% @@ -1097,11 +1707,11 @@ \closepath }% \fi% - \else\ifx\psk@optexp@optgrid@type\pst@string@optgrid@type@binary - \pscustom[linewidth=\psk@optexp@optgrid@linewidth]{% + \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}{\psk@optexp@optgrid@count}{% + \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)% @@ -1117,14 +1727,29 @@ % OPTBOX % \def\optbox@iii{% - \edef\@b@wd{\psk@optexp@optbox@width\space 2 div\space}% - \edef\@b@ht{\psk@optexp@optbox@height\space 2 div\space}% - \ifPst@optexp@endbox - \pnode(! \@b@wd 0){tempNode@Label}% - \psframe(! 0 \@b@ht neg)(! \@b@wd 2 mul \@b@ht)% + \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 - \rput{\psk@optexp@angle}(0,0){% - \psframe(! \@b@wd neg \@b@ht neg)(! \@b@wd \@b@ht)% + \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}% @@ -1134,18 +1759,40 @@ % OPTPLATE % \def\optplate@iii{% - \psline[linewidth=\psk@optexp@plate@linewidth]% - (! 0 \psk@optexp@plate@height\space 2 div neg)% - (! 0 \psk@optexp@plate@height\space 2 div) + \psline[linewidth=\POK@plate@linewidth]% + (! 0 \POK@plate@height\space 2 div neg)% + (! 0 \POK@plate@height\space 2 div) \ignorespaces}% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % DETECTOR % -\def\detector@iii{% - \pnode(! \psk@optexp@detector@size\space 3 div 0){tempNode@Label}% - \pswedge(0,0){\psk@optexp@detector@size}{-90}{90} +\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}% % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@ -1153,12 +1800,394 @@ % OPTRETPLATE % \def\optretplate@iii{% - \edef\@p@ht{\psk@optexp@plate@height\space 2 div\space}% - \edef\@p@wd{\psk@optexp@plate@width\space 2 div\space}% + \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}% +% +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +% +% 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(! @@x neg 0)(! @@x -0.6 mul @lw sub 0)% + \psline(! @@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@iii{% + \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 3f8357a1ec7..b7cfc0a1071 100644 --- a/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty +++ b/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty @@ -1,4 +1,4 @@ -\ProvidesPackage{pst-optexp}[2007/07/18 package wrapper for +\ProvidesPackage{pst-optexp}[2008/06/25 package wrapper for pst-optexp.tex] \RequirePackage{pstricks} \RequirePackage{pst-xkey} @@ -12,5 +12,6 @@ pst-optexp.tex] % \input{pst-optexp.tex} \ProvidesFile{pst-optexp.tex} - [\filedate\space v\fileversion\space `PST-optexp'] + [\filedate\space v\fileversion\space `PST-optexp' (cb)] +\IfFileExists{pst-optexp.pro}{\@addtofilelist{pst-optexp.pro}}{}% \endinput -- cgit v1.2.3