2

I am trying my hands at pst-optexp package and ...

  1. The following is the optical setup I am trying to design. So far my approach is to design the flow by tracing the beam path sequentially. I am stuck at the how to design the galvo-scanner. Also the microscope objective.
  2. Can I trace the beam with 2 different colors, the beam traces its path back from the sample stage to reach the photo-detector and CCD. Is it possible to color this with orange , will the original green beam and orange beam superimpose to produce a combined color value?

fig_1

MWE:

\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 OUTPUT:

fig_2 PS: Please ignore the typo errors in the diagram, these will be corrected in the current working edition.

4

That's not a direct answer to your question, but I am unable to modify pst-optexp to produce something similar to your desired output. On the other hand, if all you want to do is to put some lenses and other elements here and there, you might consider doing this with TikZ pics. (One could translate these pics very easily to nodes using the path picture syntax.) Note that I am not claiming that this has any of the computational features of the pst-optexp package. However, I feel that the majority of users is using TikZ by now, so you may get more support and answers for TikZ related questions. (Note that I am not claiming that one or the other is better, I am just observing much less pstricks posts than TikZ posts.)

enter image description here

\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

The easiest way to get a custom reflective component is using the \opttripole macro, where you can define whatever you want:

\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}

enter image description here

To have the beam draw begin the component, wrap the whole sketch in an optexp environment:

\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}

enter image description here

And finally, if you want to define a new component for reuse, you can use \newpsobject to define your own component based on e.g. \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}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.