pst-optexp 中光纤元素之间的平滑过渡

pst-optexp 中光纤元素之间的平滑过渡

嘿,我正在尝试使用绘制一个小型光纤设计pst-optexp,但目前遇到了一些问题。我的 MWE 代码是

\documentclass[margin=5pt]{standalone}
\usepackage[dvipsnames,svgnames,pdf]{pstricks}
\usepackage{auto-pst-pdf}
\usepackage{pst-optexp}
\usepackage{stackengine}
\begin{document}
    \begin{pspicture}[showgrid](16,6)
        \psset[optexp]{fiber=none, usefiberstyle}
        \newpsstyle{Fiber}{linecolor=orange, linewidth=2\pslinewidth}
        \pnodes(9, 4){TSFIn}(11, 4){TSFOut}
        \pnodes(14, 4){LoopIn}(14, 2){LoopOut}
        \pnodes(9, 1){OutputIsolatorIn}(11,1){OutputIsolatorOut}
        \pnodes(13, 2){OutputSplitter}(16, 3){LaserOutHigh}(16, 1){LaserOutLow}
        %Element 1
        \optfiber[compname=ActiveFiber, position=start,linecolor=red](TSFIn)(TSFOut){Active fiber}
        %Element 2
        \optcoupler[compname=FiberLoopCoupler](TSFOut)(OutputIsolatorIn)(LoopIn)(LoopOut){\begin{tabular}{@{}c@{}}Fiber\\loop\\coupler\end{tabular}}
        %Element 3
        \optisolator[compname=OutputIsolator](OutputIsolatorIn)(OutputIsolatorOut){\begin{tabular}{@{}c@{}}Output\\Isolator\end{tabular}}
        %Element 4
        \wdmsplitter[compname=OutputSplitter, coupleralign=bottom](OutputIsolatorOut)(LaserOutHigh)(LaserOutLow){Output splitter}
        \optfiber[compname=FiberLoop, addtoFiberOut={ncurv=1,angleB=0},addtoFiberIn={ncurv=1,angleA=0},compshift=-1,label=-1.5.l](LoopIn)(LoopOut){\begin{tabular}{@{}c@{}}Fiber\\Loop\end{tabular}}
        \drawfiber{1}{2}
        \drawfiber[fiberangleA=0, fiberangleB=180, ncurv=1]{2}(\oenodeIn{OutputIsolator})
        \drawfiber{2}(\oenodeIn{FiberLoop})
        \drawfiber[startnode=1](\oenodeOut{FiberLoop}){2}
        \drawfiber(\oenodeOut{OutputIsolator})(\oenodeIn{OutputSplitter})
        \drawfiber[fiberangleA=0, fiberangleB=0, ncurv=1.2](\oenodeOut{OutputSplitter})(LaserOutHigh)
        \drawfiber[fiberangleA=0, fiberangleB=0, ncurv=1.2](\oenodeOut{OutputSplitter})(LaserOutLow)
    \end{pspicture}
\end{document}

结果是 在此处输入图片描述 现在,我有几个问题至今无法解决:

  • 为什么我的光纤环耦合器倾斜了?
  • 如何让光纤环路的输入和输出变得“平滑”?我尝试调整角度,但没有成功
  • 有没有办法让从组合器到隔离器的过渡更加“平滑”?我找不到一种方法来将拐角的半径增加到更有用的程度
  • 有没有办法将 S 形纳入输出分配器的上部输出?显然设置fiberangleB=0没有帮助

因此,是否有针对我的问题的简单的解决方案,而我(显然)没有在手册中看到?

答案1

只有您至少指定一个组件作为绘制起点/终点,而不是仅指定一个点,该\drawfiber命令才能正常工作。如果组件通过 ID 或名称指定,则只有这样才能pst-optexp使用组件类型及其对齐方式进行正确绘制。

因此,你应该首先只使用

\drawfiber{CompA}{CompB}

在两个组件最近的两个点之间绘制光纤。如果自动选择的点不正确,例如光隔离器和环路耦合器之间的连接,则可以使用startnodestopnode使用其他组件节点。

光纤耦合器位于两个输入节点和两个输出节点之间。您的LoopInLoopOut节点导致它倾斜。

ncurvA另请注意,您可以分别使用和来表示曲线的起点和终点不同的曲率ncurvB

因此,这是您重新设计的示例:

\documentclass[margin=5pt]{standalone}
\usepackage[dvipsnames,svgnames,pdf]{pstricks}
\usepackage{auto-pst-pdf}
\usepackage{pst-optexp}
\usepackage{stackengine}
\begin{document}
    \begin{pspicture}[showgrid](7,0)(16,6)
        \psset[optexp]{fiber=none, usefiberstyle}
        \newpsstyle{Fiber}{linecolor=orange, linewidth=2\pslinewidth}
        \pnodes(9, 4){TSFIn}(11, 4){TSFOut}
        \pnodes(13, 3){LoopIn}(13, 2){LoopOut}
        \pnodes(9, 1){OutputIsolatorIn}(11,1){OutputIsolatorOut}
        \pnodes(13, 2){OutputSplitter}(16, 3){LaserOutHigh}(16, 1){LaserOutLow}
        %Element 1
        \optfiber[compname=ActiveFiber, position=start,linecolor=red](TSFIn)(TSFOut){Active fiber}
        %Element 2
        \optcoupler[compname=FiberLoopCoupler](TSFOut)(OutputIsolatorIn)(LoopIn)(LoopOut){%
          \begin{tabular}{@{}c@{}}Fiber\\loop\\coupler\end{tabular}}
        %Element 3
        \optisolator[compname=OutputIsolator](OutputIsolatorIn)(OutputIsolatorOut){%
          \begin{tabular}{@{}c@{}}Output\\Isolator\end{tabular}}
        %Element 4
        \wdmsplitter[compname=OutputSplitter, coupleralign=bottom](OutputIsolatorOut)(LaserOutHigh)(LaserOutLow){Output splitter}
        \optfiber[compname=FiberLoop, label=-1.5](LoopIn)(LoopOut){\begin{tabular}{@{}c@{}}Fiber\\Loop\end{tabular}}
        \drawfiber{1}{2}
        \drawfiber[ncurv=1.5, stopnode=1]{2}{OutputIsolator}
        \drawfiber[ncurvA=0.2, ncurvB=1.5, stopnode=2]{2}{FiberLoop}
        \drawfiber[ncurvB=0.2, ncurvA=1.5, startnode=1]{FiberLoop}{2}
        \drawfiber{OutputIsolator}{OutputSplitter}
        \drawfiber[ncurv=1.2]{OutputSplitter}(LaserOutHigh)
        \drawfiber[ncurv=1.2]{OutputSplitter}(LaserOutLow)
    \end{pspicture}
\end{document}

输出

在此处输入图片描述

相关内容