pst-optexp 패키지의 광섬유/와이어를 사용하여 \optDetector와 \optbox를 어떻게 연결합니까?

pst-optexp 패키지의 광섬유/와이어를 사용하여 \optDetector와 \optbox를 어떻게 연결합니까?

저는 오늘 pst-optexp 패키지를 사용하고 이에 대해 더 많은 것을 배우는 데 시간을 보냈습니다. 지금까지 저는 이 앱을 사용하면서 겪었던 모든 문제를 해결했습니다.

하지만결정적인그림의 일부는 제가 지금 당장 고칠 수 없는 부분인데, 매번 그림의 다른 부분이 사라지거나 잘못 그려집니다. 전선이나 광섬유를 사용하여 APD \optDetector를 수신기 \optbox와 연결하고 싶습니다.

저는 Overleaf와 일반 LaTeX 컴파일러를 사용하고 있습니다. XeLaTeX나 LuaLaTeX 모두 이러한 패키지를 사용하여 작동하지 않는다는 것을 알았기 때문입니다.

내가 알아차린 것은 매번 다음과 같은 오류가 발생하기 시작한다는 것입니다: 'xx-xx 줄의 단락에 \hbox가 너무 가득 찼습니다(xxxpt가 너무 넓습니다)'. 여기서 해당 줄은 문서의 마지막 줄입니다.

도움이 된다면 제 그림은 다음과 같습니다. 현재 설정

그리고 마지막으로 내 코드는 다음과 같습니다.

\documentclass[11pt]{article}
\usepackage{pst-all}
\usepackage{pst-optexp}
\usepackage{xkeyval}
\usepackage{nicefrac}
\begin{document}

\psset{unit=1}
\begin{pspicture}[showgrid](13,9)
\pnode(6,2.5){BoxUp}

% Beam coordinates
\pnode(2,5){GreenEnd}
\pnode(6,1.5){GreenStart}
\pnode(GreenEnd){RedStart}
\pnode(11,2){RedEnd}

% Mirror coordinates
\pnodes(5,5){Ldc}(6,5){Mdc}(6,4){Bdc}
\pnodes(8,5){Lfm}(9,5){Mfm}(9,4){Bfm}
\pnodes(9,4){Um1}(9,2){Mm1}(10,2){Rm1}

% Lens coordinates
\pnodes(4,5){LPos}(2,5){LFoc}

%Laser Diode
\optbox[position=start, compname=box](3,-1)(3,-1){Laser Diode}

% Fiber
\optfiber[fiberloopradius=0.2,
linecolor=green,label=0.3,compname=ssmf](3,-1)(5,-1){SSMF}

% Draw laser box
\optbox[position=start, labeloffset=0, labelref=relative, compname=LO](GreenStart)(BoxUp){Laser}

% Draw ND filter
\optfilter[fiber=none,allowbeaminside=false,compname=nd,
labelref=relative,labeloffset=-1](6,2.5)(6,3.5){ND-Filter}

% Draw CMOS Camera
\optbox[position=end, labeloffset=0](RedEnd)(11,2){CMOS}

% Attempt 1 for receiver
\optbox[position=end, labeloffset=0,compname=apdrec](9.6,8)(9.6,8){Receiver}

% Draw semitransparent mirror
\mirror[mirrortype=semitrans,compname=dc](Ldc)(Mdc)(Bdc){DC}

% Draw the focusing objective
\lens[abspos=0,lensradius=2,lenswidth=1.5,
lensheight=0.75,compname=lens1](LPos)(LFoc){x40 Focusing objective}
\addtopsstyle{Beam}{opacity=0.1}

% Draw the green laser beam
\drawwidebeam[beamwidth=0.4,opacity=0.4,
fillstyle=solid,fillcolor=green](GreenStart){nd}{dc}{lens1}(GreenEnd)

% Draw the flip mirror
\mirror[labelangle=45,compname=fm](Lfm)(Mfm)(Bfm){Flip Mirror}

% Edge Filter
\optfilter[filtertype=bandstop,compname=ef,labelref=relative](9,4)(9,3){Edge Filter}

% Mirror to CMOS
\mirror[labelangle=45,compname=m1](Um1)(Mm1)(Rm1)

% Draw the red laser beam
\drawwidebeam[beamwidth=0.2,opacity=0.6,fillstyle=solid, fillcolor=red,linestyle=none](RedStart){dc}{fm}{ef}{m1}(RedEnd)

% Draw the NV-Centers
\crystal[crystalheight=2, crystalwidth=1,labelangle=0,labeloffset=-1.3](2,5)(1,5){NV-Centers}

% Connect ssmf and laser output
\drawfiber[linecolor=green,fiberstyle=angle,linearc=0.5]{ssmf}{LO}

% Draw ramp generator
\elecsynthesizer[synthshape=rectangle,synthsize=2 1,
synthtype=sawtooth,compname=rg,labelref=relative](6,8)(5,8){Ramp Generator}

% Draw MW-source
\optbarcomp[fiber,compname=mw](5,8)(3,8){MW-Generator}

% Connect Rampgenerator with MW-source
\drawfiber[linecolor=black]{rg}{mw}

% Connect MW-source with MW-antenna
\drawfiber[linecolor=black,fiberstyle=angle,linearc=0.5]{mw}(0.5,4,5)

% Extra node
\pnodes(10.8,5){ap}(11.2,5){apa}(12,5){apb}(12,8){apc}(11,8){apd}

% Draw APD-receiver connection (stubborn version)
%\drawfiber[linecolor=black]{apdrec}(apa)(apb)(apc)(apd)

% Draw APD
\optdetector[position=start,fiber,compname=apd,
labelangle=180](11.2,5)(11.2,5){APD}

%\optbox[position=end, labeloffset=0,compname=apdrec](9.6,8)(9.6,8){Receiver}

\drawwire{apd}(12,6.5){apdrec}

% Optional beam to APD
\drawwidebeam[beamwidth=0.2,opacity=0.6,fillstyle=vlines,
fillcolor=red,linestyle=none]{fm}{apd}

\end{pspicture}

\end{document}

답변1

예제를 실행하여 lualatexPDF 출력을 직접 얻으면 다음과 같은 결과를 얻습니다.

\DocumentMetadata{}
\documentclass[11pt]{article}
\usepackage{pst-optexp}
\usepackage{nicefrac}
\begin{document}
    
\begin{pspicture}[showgrid=false](0,-2)(13,9)
    \pnode(6,2.5){BoxUp}
    % Beam coordinates
    \pnode(2,5){GreenEnd}
    \pnode(6,1.5){GreenStart}
    \pnode(GreenEnd){RedStart}
    \pnode(11,2){RedEnd}
    % Mirror coordinates
    \pnodes(5,5){Ldc}(6,5){Mdc}(6,4){Bdc}
    \pnodes(8,5){Lfm}(9,5){Mfm}(9,4){Bfm}
    \pnodes(9,4){Um1}(9,2){Mm1}(10,2){Rm1}
    % Lens coordinates
    \pnodes(4,5){LPos}(2,5){LFoc}
    %Laser Diode
    \optbox[position=start, compname=box](3,-1)(3,-1){Laser Diode}
    % Fiber
    \optfiber[fiberloopradius=0.2,
    linecolor=green,label=0.3,compname=ssmf](3,-1)(5,-1){SSMF}
    % Draw laser box
    \optbox[position=start, labeloffset=0, labelref=relative, compname=LO](GreenStart)(BoxUp){Laser}
    
    % Draw ND filter
    \optfilter[fiber=none,allowbeaminside=false,compname=nd,
    labelref=relative,labeloffset=-1](6,2.5)(6,3.5){ND-Filter}
    % Draw CMOS Camera
    \optbox[position=end, labeloffset=0](RedEnd)(11,2){CMOS}
    % Attempt 1 for receiver
    \optbox[position=end, labeloffset=0,compname=apdrec](9.6,8)(9.6,8){Receiver}
    % Draw semitransparent mirror
    \mirror[mirrortype=semitrans,compname=dc](Ldc)(Mdc)(Bdc){DC}
    % Draw the focusing objective
    \lens[abspos=0,lensradius=2,lenswidth=1.5,
    lensheight=0.75,compname=lens1](LPos)(LFoc){x40 Focusing objective}
    \addtopsstyle{Beam}{opacity=0.1}
    % Draw the green laser beam
    \drawwidebeam[beamwidth=0.4,opacity=0.4,
    fillstyle=solid,fillcolor=green](GreenStart){nd}{dc}{lens1}(GreenEnd)
    % Draw the flip mirror
    \mirror[labelangle=45,compname=fm](Lfm)(Mfm)(Bfm){Flip Mirror}
    % Edge Filter
    \optfilter[filtertype=bandstop,compname=ef,labelref=relative](9,4)(9,3){Edge Filter}
    % Mirror to CMOS
    \mirror[labelangle=45,compname=m1](Um1)(Mm1)(Rm1)
    % Draw the red laser beam
    \drawwidebeam[beamwidth=0.2,opacity=0.6,fillstyle=solid, fillcolor=red, 
             linestyle=none](RedStart){dc}{fm}{ef}{m1}(RedEnd)
    % Draw the NV-Centers
    \crystal[crystalheight=2, crystalwidth=1,labelangle=0,labeloffset=-1.3](2,5)(1,5){NV-Centers}
    % Connect ssmf and laser output
    \drawfiber[linecolor=green,fiberstyle=angle,linearc=0.5]{ssmf}{LO}
    % Draw ramp generator
    \elecsynthesizer[synthshape=rectangle,synthsize=2 1, synthtype=sawtooth, 
            compname=rg,labelref=relative](6,8)(5,8){Ramp Generator}
    % Draw MW-source
    \optbarcomp[fiber,compname=mw](5,8)(3,8){MW-Generator}
    % Connect Rampgenerator with MW-source
    \drawfiber[linecolor=black]{rg}{mw}
    % Connect MW-source with MW-antenna
    \drawfiber[linecolor=black,fiberstyle=angle,linearc=0.5]{mw}(0.5,4,5)
    % Extra node
    \pnodes(10.8,5){ap}(11.2,5){apa}(12,5){apb}(12,8){apc}(11,8){apd}
    % Draw APD-receiver connection (stubborn version)
    %\drawfiber[linecolor=black]{apdrec}(apa)(apb)(apc)(apd)
    % Draw APD
    \optdetector[position=start,fiber,compname=apd,labelangle=180](11.2,5)(11.2,5){APD}
    %\optbox[position=end, labeloffset=0,compname=apdrec](9.6,8)(9.6,8){Receiver}
    \drawwire{apd}(12,6.5){apdrec}  
    % Optional beam to APD
    \drawwidebeam[beamwidth=0.2,opacity=0.6,fillstyle=vlines,fillcolor=red,linestyle=none]{fm}{apd}
\end{pspicture}
    
\end{document}

여기에 이미지 설명을 입력하세요

순서 latex->dvips->ps2pdf 에 문제가 있다

오류: --atan--의 /undefineresult

에 대해 좀 더 조사가 필요합니다 \optdetector. 똑같은 좌표가 틀리게 보이는데...

관련 정보