我正在尝试pst-optexp包装和……
- 以下是我正在尝试设计的光学装置。到目前为止,我的方法是通过按顺序追踪光束路径来设计流程。我被困在如何设计振镜扫描仪上。还有显微镜物镜。
- 我可以用两种不同的颜色来追踪光束吗?光束从样品台返回,到达光电探测器和 CCD。是否可以用橙色来着色,原来的绿色光束和橙色光束会叠加产生组合颜色值吗?
梅威瑟:
\documentclass{standalone}
\usepackage{pst-optexp}
\begin{document}
\begin{pspicture}[showgrid](0, 0)(12, 8) % bottom left)(upper right)
\pnodes(0,5){A}\pnode(6,5){B}
\lens[abspos=0.5, beam](A)(B){L1} % 0.5
\pinhole[beam](0,5)(3,5) % 1.5
\lens[abspos=2.5, beam](A)(B){L2} % 2.5
\beamsplitter[beam](3.5,5)(3.9,5)(3.9,5.4){BS1} % (3.9,5)
\mirror[beam](5,5)(6.0,5.0)(6,6){DM1} % (6,5)
\optbox[angle = 90, innerlabel, optboxwidth=1, optboxheight=1,beam](6,7)(7.5,6){GS}
\end{pspicture}
\end{document}
MWE输出:
答案1
这不是对你问题的直接回答,但我无法修改pst-optexp
以产生类似于你想要的输出。另一方面,如果你只想在这里和那里放置一些镜头和其他元素,你可以考虑用 Ti 来做到这一点钾Z 图片。(可以pic
使用语法将这些 s 非常轻松地转换为节点path picture
。)请注意,我并不是说它具有该pst-optexp
包的任何计算功能。但是,我觉得大多数用户正在使用 Ti钾Z,因此您可能会获得有关 Ti 的更多支持和答案钾Z 相关的问题。(请注意,我并不是说其中一个更好,我只是观察到 pstricks 的帖子比 Ti 少得多钾Z 帖子。)
\documentclass[border=3.14mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{backgrounds,positioning}
\tikzset{
lens/.pic={
\filldraw[ball color=blue!30,name prefix=] (0,1)
coordinate (-top) arc(40:-40:{1/sin(40)})
-- (0,-1) coordinate (-bottom) arc(-140:-220:{1/sin(40)})
--cycle;
\coordinate (-center) at (0,0);
},
pinhole/.pic={\draw[line width=1mm] (0,1.2) coordinate (-top) -- (0,0.1)
(0,-1.2) coordinate (-bottom) -- (0,-0.1);
\coordinate (-center) at (0,0);
},
beam splitter/.pic={\filldraw[fill=gray!10] (-1.1,1.1) coordinate (-tl)
-- (1.1,1.1) coordinate (-tr) -- (-1.1,-1.1) -- cycle;
\filldraw[fill=gray!20] (-1.1,-1.1) coordinate (-bl)
-- (1.1,-1.1) coordinate (-br) -- (1.1,1.1) -- cycle;
\coordinate (-center) at (0,0);
},
CCD/.pic={\shade[left color=black,right color=gray!50]
(-1.1,0) coordinate (-left) rectangle (0,-0.8) coordinate (-bottom);
\shade[right color=black,left color=gray!50]
(1.1,0) coordinate (-right) rectangle (0,-0.8);
\shade[left color=black,right color=gray!50]
(-0.6,0) rectangle (0,0.4) coordinate (-top);
\shade[right color=black,left color=gray!50]
(0.6,0) rectangle (0,0.4);
\coordinate (-center) at (0,0);
},
photo detector/.pic={\shade[ball color=orange] (70:0.5) arc(70:290:0.5) --
cycle;
\draw[line width=1mm] (0.5,-0.5) -- (0.5,0.5) coordinate[midway](-right);
\coordinate (-center) at (0,0);
},
triangle mirror/.pic={\filldraw[blue!50!black] (-1.1,-1.1) coordinate (-bl)
-- (1.1,-1.1) coordinate (-br) -- (1.1,1.1) coordinate (-tr) --cycle;
\draw[white,line width=0.5mm] (-1.1,-1.075) -- (1.1,1.075);
\coordinate (-center) at (0,0);
\coordinate (-right) at (1.1,0);
\coordinate (-bottom) at (0,-1.1);
}
}
\begin{document}
\begin{tikzpicture}
\pic (lens1) at (1.5,0) {lens};
\pic[right=1.5cm of lens1-center] (pinhole1) {pinhole};
\pic[right=1.5cm of pinhole1-center] (lens2) {lens};
\pic[right=2.5cm of lens2-center] (bs1) {beam splitter};
\pic[below=2.5cm of bs1-center,rotate=90] (lens3) {lens};
\pic[below=2.5cm of lens3-center] (bs2) {beam splitter};
\pic[left=2.5cm of bs2-center] (pinhole2) {pinhole};
\pic[left=2.5cm of pinhole2-center] (pd1) {photo detector};
\pic[below=2.5cm of bs2-center] (CCD1) {CCD};
\pic[right=2.5cm of bs1-center] (mirror1) {triangle mirror};
\node[fill=blue,above=3cm of mirror1-center,minimum width=2.2cm,
minimum height=1.5cm] (G){};
\pic[right=1.5cm of G.east] (lens4) {lens};
\pic[right=1.5cm of lens4-center] (pinhole3) {pinhole};
\pic[right=1.5cm of pinhole3-center] (lens5) {lens};
\pic[right=1.5cm of lens5-center,rotate=90] (mirror2) {triangle mirror};
\node[below=2cm of mirror2-center,minimum width=1.8cm,minimum height=2.8cm]
(O){};
\shade[left color=gray,right color=white]
(O.south west) rectangle (O.north);
\shade[right color=gray,left color=white]
(O.south east) rectangle (O.north);
\filldraw[fill=blue!30] ([xshift=2mm]O.south west) to[out=-30,in=-150]
([xshift=-2mm]O.south east) -- cycle;
\node[draw,xshift=-0.5cm,below=2cm of O,minimum width=1.8cm,minimum height=0.6cm,
fill=gray!50] (B){};
\filldraw[fill=gray!70] (B.south east) --++ (1,0.8) --++ (0,0.6) --
(B.north east) -- cycle;
%
\begin{scope}[on background layer]
\begin{scope}[opacity=0.2,red]
\draw[line width=1cm] (0,0) -- (lens1-center);
\fill ([yshift=0.5cm]lens1-center) -- ([yshift=-0.5cm]lens2-center)
-- ([yshift=0.5cm]lens2-center) -- ([yshift=-0.5cm]lens1-center) -- cycle;
\draw[line width=1cm] (lens2-center) -- (bs1-center) -- (lens3-center);
\fill ([xshift=-0.5cm]lens3-center) -- ([xshift=-0.25cm]bs2-center)
-- ([xshift=0.25cm]bs2-center) -- ([xshift=0.5cm]lens3-center) -- cycle;
\fill ([yshift=0.25cm]bs2-center) -- ([yshift=-0.25cm,xshift=-5cm]bs2-center)
-- ([yshift=0.25cm,xshift=-5cm]bs2-center) -- ([yshift=-0.25cm]bs2-center) -- cycle;
\fill ([xshift=-0.25cm]bs2-center) -- (CCD1-top)
-- ([xshift=0.25cm]bs2-center) -- cycle;
\draw[line width=1cm] (bs1-center) -- (mirror1-right);
\draw[line width=1cm] (mirror1-bottom) -- (G) -- (lens4-center);
\fill ([yshift=0.5cm]lens4-center) -- ([yshift=-0.5cm]lens5-center)
-- ([yshift=0.5cm]lens5-center) -- ([yshift=-0.5cm]lens4-center) -- cycle;
\draw[line width=1cm] (lens5-center) -- (mirror2-bottom);
\draw[line width=1cm] (mirror2-right) -- (O);
\filldraw[fill=gray!30,opacity=1,draw=black] (B.north east) --++ (1,0.8) --++ (-1.8,0) --
(B.north west) -- cycle;
\fill ([xshift=-0.4cm]O.south) -- ++(0.4,-1.6) --
([xshift=0.4cm]O.south) -- cycle;
\end{scope}
\end{scope}
\end{tikzpicture}
\end{document}
答案2
获取自定义反射组件的最简单方法是使用宏\opttripole
,您可以在其中定义任何您想要的内容:
\documentclass[margin=12pt]{standalone}
\usepackage{pst-optexp}
\begin{document}
\begin{pspicture}(0, 0)(8, 2.5)
\pnodes(0,1){A}(6,1){B}(6,2){C}(8,2){D}
\lens[abspos=0.5](A)(B){L1}
\pinhole(0,1)(3,1)
\lens[abspos=2.5](A)(B){L2}
\mirror(A)(B)(C){DM1}
\opttripole[labeloffset=1](B)(C)(D){%
\pspolygon[fillcolor=blue!60,fillstyle=solid,linestyle=none](-0.7,0)(0,0.7)(0.7,0)(0,-0.7)
}{GS}
\drawwidebeam[n=1,beamwidth=0.2,useNA=false]{1-5}(D)
\end{pspicture}
\end{document}
为了使光束绘制开始组件,将整个草图包装在optexp
环境中:
\documentclass[margin=12pt]{standalone}
\usepackage{pst-optexp}
\begin{document}
\begin{pspicture}(0, 0)(8, 2.5)
\begin{optexp}
\pnodes(0,1){A}(6,1){B}(6,2){C}(8,2){D}
\lens[abspos=0.5](A)(B){L1}
\pinhole(0,1)(3,1)
\lens[abspos=2.5](A)(B){L2}
\mirror(A)(B)(C){DM1}
\opttripole[labeloffset=1](B)(C)(D){%
\pspolygon[fillcolor=blue!60,fillstyle=solid,linestyle=none](-0.7,0)(0,0.7)(0.7,0)(0,-0.7)
}{GS}
\drawwidebeam[n=1,beamwidth=0.2,useNA=false]{1-5}(D)
\end{optexp}
\end{pspicture}
\end{document}
最后,如果您想定义一个新的组件以供重复使用,您可以\newpsobject
根据以下示例定义您自己的组件\opttripole
:
\documentclass[margin=12pt]{standalone}
\usepackage{pst-optexp}
\begin{document}
\newpsobject{galvoscanner}{opttripole}{opttripolecomp={%
\pspolygon[fillcolor=blue!60,fillstyle=solid,linestyle=none](-0.7,0)(0,0.7)(0.7,0)(0,-0.7)
}}%
\begin{pspicture}(0, 0)(8, 2.5)
\begin{optexp}
\pnodes(6,1){B}(6,2){C}(8,2){D}
\galvoscanner[labeloffset=1](B)(C)(D){GS}
\drawwidebeam[beamwidth=0.2](B){1}(D)
\end{optexp}
\end{pspicture}
\end{document}