在 pst-optexp 中添加箭头来绘制宽光束

在 pst-optexp 中添加箭头来绘制宽光束

我使用 pst-optexp 进行了此设置。我想添加箭头来指示宽光束的方向:

在此处输入图片描述

代码:

\documentclass[margin=0]{standalone}
\usepackage{pst-optexp}
\usepackage{newtxtext,newtxmath}
\usepackage{siunitx}
\newpsobject{flipmirror}{beamsplitter}{bsstyle=plate}
\newpsobject{ndfilter}{optdipole}{optdipolesize=0.5,allowbeaminside=false,
  optdipolecomp={%
    \psframe(-0.25,-0.25)(0.25,0.25)
    \rput(0,0){}%
}}
\begin{document}
\begin{pspicture}(10,5)
  \psset[optexp]{fiber=none,usefiberstyle}
  \newpsstyle{FilterStyle}{linecolor=green}
  \newpsstyle{Fiber}{linecolor=black}
  \newpsstyle{Beam}{linestyle=none,fillstyle=solid,fillcolor=green,opacity=1}
  \pnodes(2,4){Laser}(8,4){M1}(8,2){M2}(4,4){BP}(6,4){ND}(1,2){M3}(1,1){End}(4,2){FM}(9,2){OB}
  (4,1){SPEC}
  \optbox[optboxsize=2 1,innerlabel,position=start](Laser)(M1){\SI{532}{\nano\meter}}
  \ndfilter[compname=ND,labeloffset=0.5](BP)(M1){ND}
  \mirror[compname=M1,labeloffset=0.5,mirrortype=extended](ND)(M1)(M2){M}
  \beamsplitter[labelangle=-45,compname=M2,bsstyle=plate,labeloffset=0.5](M1)(M2)(OB){BS}
  \lens[n=2, lensradius=1 1,lensheight=1,compname=L](8,2)(10,2){O}
  \optfilter[filtertype=lowpass,filtersize=0.5,compname=SP,labeloffset=0.5,labelangle=-180](M2)(FM){LP}
  \flipmirror[labelangle=-45,compname=FM,labeloffset=0.5](M2)(FM)(SPEC){FM}
  \optbox[position=end,optboxsize=1 1,innerlabel](FM)(SPEC){SPEC}
  \mirror[compname=M3,labeloffset=0.5,mirrortype=extended](FM)(M3)(End){M}
  \optdetector[compname=APD,labelangle=180,dettype=diode](M3)(End){APD}
  \optplate(9,2)(10,2){S}
  \drawwidebeam[beamwidth=0.1] {1-5}{11}
  \drawwidebeam[beamwidth=0.1] {4}{6}
  \drawwidebeam[beamwidth=0.1,fillstyle=solid,fillcolor=red,opacity=1] {6-8}
  \drawwidebeam[beamwidth=0.1,fillstyle=solid,fillcolor=red,opacity=1] {7}{9}{10}
\end{pspicture}
\end{document}

预期结果:

在此处输入图片描述

我怎样才能做到这一点?

答案1

宽光束不支持箭头。基本上,它们是填充区域,还必须能够处理弯曲的边缘。

一般来说,您需要为箭头绘制额外的光束。

在你的情况下,这不是问题,因为所有应该得到箭头的宽梁都可以用 替换\drawbeam,它采用标准arrows参数。请注意,我优化了线连接,linejoin=2并将所有梁推到组件后面,方法是将整个设置包装在一个optexp环境中

\documentclass[margin=0]{standalone}
\usepackage{pst-optexp}
\usepackage{newtxtext,newtxmath}
\usepackage{siunitx}
\newpsobject{flipmirror}{beamsplitter}{bsstyle=plate}
\newpsobject{ndfilter}{optdipole}{optdipolesize=0.5,allowbeaminside=false,
  optdipolecomp={%
    \psframe(-0.25,-0.25)(0.25,0.25)
    \rput(0,0){}%
}}
\begin{document}
\begin{pspicture}(10,5)
  \begin{optexp}
    \psset[optexp]{fiber=none,usefiberstyle}
    \newpsstyle{FilterStyle}{linecolor=green}
    \newpsstyle{Fiber}{linecolor=black}
    \pnodes(2,4){Laser}(8,4){M1}(8,2){M2}(4,4){BP}(6,4){ND}(1,2){M3}(1,1){End}(4,2){FM}(9,2){OB}
    (4,1){SPEC}
    \optbox[optboxsize=2 1,innerlabel,position=start](Laser)(M1){\SI{532}{\nano\meter}}
    \ndfilter[compname=ND,labeloffset=0.5](BP)(M1){ND}
    \mirror[compname=M1,labeloffset=0.5,mirrortype=extended](ND)(M1)(M2){M}
    \beamsplitter[labelangle=-45,compname=M2,bsstyle=plate,labeloffset=0.5](M1)(M2)(OB){BS}
    \lens[n=2, lensradius=1 1,lensheight=1,compname=L](8,2)(10,2){O}
    \optfilter[filtertype=lowpass,filtersize=0.5,compname=SP,labeloffset=0.5,labelangle=-180](M2)(FM){LP}
    \flipmirror[labelangle=-45,compname=FM,labeloffset=0.5](M2)(FM)(SPEC){FM}
    \optbox[position=end,optboxsize=1 1,innerlabel](FM)(SPEC){SPEC}
    \mirror[compname=M3,labeloffset=0.5,mirrortype=extended](FM)(M3)(End){M}
    \optdetector[compname=APD,labelangle=180,dettype=diode](M3)(End){APD}
    \optplate(9,2)(10,2){S}
    \newpsstyle{Beam}{beamwidth=0.1, linewidth=0.1, linejoin=2, fillcolor=green, fillstyle=solid, linecolor=green}
    \drawbeam[arrows=->]{1-2}
    \drawbeam[arrows=->]{2-4}
    \drawwidebeam[linestyle=none]{4}{5}{11}
    \drawbeam[arrows=->]{4}{6}
    \drawbeam[linecolor=red, arrows=->]{6-8}
    \drawbeam[linecolor=red, arrows=->]{7}{9}{10}
  \end{optexp}
\end{pspicture}
\end{document}

在此处输入图片描述

相关内容