Pasé el día de hoy trabajando y aprendiendo más sobre el paquete pst-optexp. Hasta ahora, he logrado resolver todos los problemas que encontré al usarlo.
Pero elfinalparte del dibujo es algo que no puedo arreglar en este momento, cada vez otra parte del dibujo desaparece o se dibuja incorrectamente. Quiero conectar mi APD \optdetector con mi Receptor \optbox usando un cable o una fibra.
Estoy usando Overleaf y el compilador LaTeX normal, ya que noté que ni XeLaTeX ni LuaLaTeX funcionaron con estos paquetes.
Lo que he notado es que cada vez comienza a dar errores que dicen: 'overfull \hbox (xxxpt demasiado ancho) en el párrafo en las líneas xx-xx' donde esas son las últimas líneas del documento.
Aquí está mi dibujo si eso ayuda:
Y finalmente, mi código:
\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}
Respuesta1
Al ejecutar su ejemplo lualatex
para obtener directamente una salida en PDF, obtengo:
\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}
con la secuencia latex->dvips->ps2pdf
hay un problema con
Error: /resultado indefinido en --atan--
que necesita más investigación para \optdetector
. Las coordenadas idénticas me parecen mal...