Beamsplitter and transmission beam problem

by Allen Chiu   Last Updated May 15, 2019 19:23 PM

I tried to draw a figure such that the laser beam is transmitted and reflected from a beam splitter. However, following the description on the internet, I ran into two problems, 1) The cubic beam splitter (labeled as a PBS) is rotated 2) The transmitted laser (from PBS to CCD2) doesn't show.

I'd very much appreciate if someone can help me. Thanks

Here's my code (I compiled it with XeLaTeX):

\documentclass[a4paper,landscape]{article}
\usepackage{pst-optexp}
\usepackage{pstricks}

\begin{document}
\begin{pspicture}[showgrid](20, 10)
  \pnodes(5.75, 5){GM}(7, 5){D1}(7, 8){D2}(11, 8){pbs3}
  \pnodes(11, 9.5){m1}(18, 9.5){CCD1}(19.5, 8){CCD2}
  \optbox[compname=GM, position=start, optboxsize=2.5 2.5, innerlabel](GM)(D1){GM}
  \beamsplitter[bsstyle=plate, compname=D1](GM)(D1)(D2){Dichroic}
  \beamsplitter[bsstyle=plate, compname=D2](D1)(D2)(pbs3){Dichroic}
  \beamsplitter[compname=pbs3](D2)(pbs3)(m1){PBS}
  \mirror[compname=m1, mirrorwidth=1.5](pbs3)(m1)(CCD1)
  \optbox[compname=CCD1, position=end, optboxwidth=0.5](m1)(CCD1){CCD1}
  \optbox[compname=CCD2, position=end, optboxwidth=0.5](pbs3)(CCD2){CCD2}


  \addtopsstyle{Beam}{fillstyle=solid, fillcolor=green, opacity=0.2}
  \drawwidebeam[beamwidth=0.5]{GM}{D1}{D2}{pbs3}{m1}{CCD1}
  \drawwidebeam[beamwidth=0.5]{GM}{D1}{D2}{pbs3}{CCD2}

\end{pspicture}
\end{document}

Here's the result enter image description here

Here's the list of packages I use

 article.cls    2014/09/29 v1.4h Standard LaTeX document class
  size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option)
pst-optexp.sty    2014/11/26 v5.2 Optical experimental setups with PSTricks
  ifthen.sty    2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
pstricks.sty    2018/01/06 v0.67 LaTeX wrapper for 'PSTricks' (RN,HV)
   iftex.sty    2013/04/04 v0.2 Provides if(tex) conditional for PDFTeX, XeTeX,
 and LuaTeX
shellesc.sty    2016/06/07 v0.02a unified shell escape interface for LaTeX
  xcolor.sty    2016/05/11 v2.12 LaTeX color extensions (UK)
   color.cfg    2016/01/02 v1.6 sample color configuration
   xetex.def    2017/06/24 v5.0h Graphics/color driver for xetex
pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
pst-xkey.tex    2005/11/25 v1.6 PSTricks specialization of xkeyval (HA)
 xkeyval.sty    2014/12/03 v2.7a package option processing (HA)
 xkeyval.tex    2014/12/03 v2.7a key=value parser (HA)
pstricks.tex    2018/01/06 v2.82 'PSTricks' (tvz,hv)
  pst-fp.tex    2018/01/06 v2.82 'PST-fp' (hv)
pst-xkey.sty    2005/11/25 v1.6 package wrapper for pst-xkey.tex (HA)
pst-node.sty    2010/04/22 package wrapper for pst-node.tex
pst-node.tex    2017/12/30 1.41 `pst-node' (tvz,hv)
pst-plot.sty    2011/04/13 package wrapper for pst-plot.tex (hv)
 multido.sty    2004/05/17 package wrapper for PSTricks `multido.tex', (HV/RN)
 multido.tex    2010/05/14 v1.42 'multido' (tvz,hv)
pst-plot.tex    2018/03/28 1.90 'pst-plot' (tvz,hv)
pst-eucl.sty    2014/05/17 package wrapper for PSTricks pst-eucl.tex
pst-tools.sty    2012/01/01 package wrapper for pst-tools.tex (hv)
pst-tools.tex    2018/03/28 v1.90 'PST-tools' (hv)
pst-eucl.tex    2017/04/18 v1.56 'PST-eucl' (dr,hv)
pst-intersect.sty    2014/03/16 v0.4 package wrapper for pst-intersect.tex
pst-func.sty    2017/08/17 package wrapper for pst-func.tex (hv)
pst-math.sty    2014/07/30 package wrapper for PSTricks pst-math.tex
pstricks-add.sty    2018/02/03 v. 0.15 package wrapper for pstricks-add.tex (hv
)
  pst-3d.sty    2009/07/28 package wrapper for pst-3d.tex (hv)
  pst-3d.tex    2017/04/18 v1.56 'PST-3d' (hv)
pstricks-add.tex    2017/04/18 v1.56 'PSTricks-add' (hv)
  xparse.sty    2018/02/21 L3 Experimental document command parser
   expl3.sty    2018/03/05 L3 programming layer (loader) 
expl3-code.tex    2018/03/05 L3 programming layer 
l3xdvipdfmx.def    
pst-func.tex    2018/04/08 v0.89 'PST-func' (hv)
pst-intersect.tex
 environ.sty    2014/05/04 v0.3 A new way to define environments
trimspaces.sty    2009/09/17 v1.1 Trim spaces around a token list
pst-optexp.pro


Answers 1


pst-optexp cannot be run with xelatex. Run it with latex->dvips->ps2pdf -dNOSAFER (the latest GhostScript version doesn't support transparency without the NoSafer option):

\documentclass[a4paper,landscape]{article}
\usepackage{pstricks}
\usepackage{pst-optexp}    
\begin{document}

\begin{pspicture}[showgrid](3,3)(20, 10)
    \pnodes(5.75, 5){GM}(7, 5){D1}(7, 8){D2}(11, 8){pbs3}
    \pnodes(11, 9.5){m1}(18, 9.5){CCD1}(19.5, 8){CCD2}
    \optbox[compname=GM, position=start, optboxsize=2.5 2.5, innerlabel](GM)(D1){GM}
    \beamsplitter[bsstyle=plate, compname=D1](GM)(D1)(D2){Dichroic}
    \beamsplitter[bsstyle=plate, compname=D2](D1)(D2)(pbs3){Dichroic}
    \beamsplitter[compname=pbs3](D2)(pbs3)(m1){PBS}
    \mirror[compname=m1, mirrorwidth=1.5](pbs3)(m1)(CCD1)
    \optbox[compname=CCD1, position=end, optboxwidth=0.5](m1)(CCD1){CCD1}
    \optbox[compname=CCD2, position=end, optboxwidth=0.5](pbs3)(CCD2){CCD2}

    \addtopsstyle{Beam}{fillstyle=solid, fillcolor=green, opacity=0.2}
    \drawwidebeam[beamwidth=0.5]{GM}{D1}{D2}{pbs3}{m1}{CCD1}
    \drawwidebeam[beamwidth=0.5]{GM}{D1}{D2}{pbs3}{CCD2}    
\end{pspicture}
\end{document}

enter image description here

Red-Cloud
Red-Cloud
May 15, 2019 19:09 PM

Related Questions


Updated July 16, 2017 14:23 PM

Updated November 09, 2016 08:09 AM

Updated July 11, 2017 19:23 PM

Updated August 29, 2017 15:23 PM

Updated December 10, 2017 14:23 PM