4
\documentclass[pstricks,margin=12pt]{standalone} 
\usepackage{pst-optexp}
\usepackage{pst-node}
\usepackage{pstricks-add}
\psset{useNA=false}
\psset{pswarning}
\begin{document}
\begin{pspicture}[showgrid=true](10,10)
\pnodes(1.5,7){A}
\pnodes(5,7){B}
\pnodes(8,7){C}
\pnodes(8,3){D}
\addtopsstyle{Beam}{fillstyle=solid, fillcolor=red!50!white, opacity=0.3, linestyle=none}
\psset{mirrortype=extended, mirrordepth=0.2}
\psset{mirrorwidth=1.1}
\psset{loadbeampoints}
\psset{savebeampoints=true, loadbeampoints}

\begin{optexp}
\optsource[innerlabel, compname = start](A)(B){Beam}
\lens[compname=L1](A)(B){$L_1$}

%\drawwidebeam[beamwidth=0.4, stopinside]{1-3}
\lens[compname=L2](B)(C){$L_2$}

\mirror[labelangle=-45, compname=M1](B)(C)(D){M}

\optbox[innerlabel, compname= D1](D)(D){Dump}
%\drawwidebeam[beamwidth=0.5](S){}(D)
%\addtopsstyle{Beam}{fillstyle=solid, fillcolor=red!50!white, %opacity=0.3, linestyle=none}
%\drawwidebeam[beamwidth=0.4, beaminsidelast](S){L1}{L2}

\end{optexp}
\drawwidebeam[beamwidth=0.4, stopinside]{1-5}
%\drawwidebeam[beamwidth=0.4,  beamdiv=-20]{2-3}
%\drawwidebeam[loadbeampoints]{M1}{D1}
%\drawwidebeam[loadbeampoints, beamdiv=-20, stopinside]{2-3}
%\drawwidebeam[loadbeampoints, stopinside]{3-5}
%\drawwidebeam[beamwidth=0.5]{4-5}
\end{pspicture}
\end{document}

I am unable to propagate the beam downstream.enter image description here

1 Answer 1

4

The beam misses the dump optbox, because it is drawn in the wrong direction. You use the same node both as start and as end node, in which case the box is oriented horizontally, because we have no defined direction to which to align the box.

If you add a parameter showifcnodes to the optbox you'll see, where the optical interfaces are locate:

\optbox[innerlabel, compname= D1, showifcnodes](D)(D){Dump}

enter image description here

Use e.g. C as other reference point:

\documentclass[pstricks,margin=12pt]{standalone} 
\usepackage{pst-optexp}
\psset{useNA=false, pswarning}
\begin{document}
\begin{pspicture}[showgrid=true](0,2)(9,8)
\pnodes(1.5,7){A}
\pnodes(5,7){B}
\pnodes(8,7){C}
\pnodes(8,3){D}
\addtopsstyle{Beam}{fillstyle=solid, fillcolor=red!50!white, opacity=0.3, linestyle=none}
\psset{mirrortype=extended, mirrordepth=0.2, mirrorwidth=1.1}
\psset{savebeampoints, loadbeampoints}
\begin{optexp}
  \optsource[innerlabel, compname = start](A)(B){Beam}
  \lens[compname=L1](A)(B){$L_1$}
  \lens[compname=L2, n=1.33](B)(C){$L_2$}
  \mirror[labelangle=-45, compname=M1](B)(C)(D){M}
  \optbox[innerlabel, compname= D1, endbox](C)(D){Dump}
  \drawwidebeam[beamwidth=0.4, stopinside]{1-5}
\end{optexp}
\end{pspicture}
\end{document}

Here, I also tweaked parameter n for L2 a bit to get a reasonable beam diameter at dump.

enter image description here

3
  • Your answer definitely merited a positive vote.
    – Sebastiano
    Feb 9, 2020 at 9:18
  • Thank you very much ! Also, sorry if it is such a noob question, but honestly, it's, for me at least, a very hard package to learn since it's so verbose. Feb 9, 2020 at 23:08
  • Don't worry :) It is indeed a quite complex package. I tried to insert a lot of examples, but it involves many concepts which aren't directly apparent.
    – Christoph
    Feb 10, 2020 at 7:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .