I recently discovered pst-optexp and am trying to draw my optical setup for an experiment on it before my deadline. I was looking through the docs and it is an amazing package but there is so much in it that I'm finding it very hard to actually draw what I want, and I was hoping someone could help me. I have spent hours fiddling with it trying to get it to work but I haven't got anything useful and it is getting quite frustrating. My setup is a 4f correlator. I have tried to draw something similar to Ex. 11.5 (page 129 of the docs) but I can't position the lens correctly and get the beams to focus the way I want (it's not worth posting my attempt because I don't think it's at all usable).

A crude sketch of my experimental setup is shown below. As you can see there are a lot of lenses and foci to get right.

setup sketch

1 Answer 1


I know, that the workflow maybe isn't very intuitive and you'll need to workout how you can best work.

Here is a document which reproduces your experimental setup:

\documentclass[margin=5pt, pstricks]{standalone}
   \psset[optexp]{labeloffset=0.8, labelangle=180}
        \optbox[innerlabel, position=start](Start)(End){Laser}
        \lens[lens=-1.5 -1.5 1 0.1, abspos=1, n=2](Start)(End){$D_1$}
        \lens[lens=3 3 1.3, abspos=2.5, n=1.7](Start)(End){$C_2$}
        \pinhole[abspos=4, phwidth=0.05](Start)(End){$A_3$}
        \lens[lens=3 3 1.3, abspos=5.5, n=1.85](Start)(End){$C_4$}
        \lens[lens=3 3 1.3, abspos=8.5, n=1.95](Start)(End){$C_5$}
        \optbox[innerlabel, position=end](Start)(End){CCD}
        \addtopsstyle{Beam}{fillstyle=solid, fillcolor=green!50!white}
        \drawwidebeam[beamwidth=0.1, beamdiv=20]{4-7}
              abspos=7, plateheight=1.5, 
              linewidth=0.5\pslinewidth, linestyle=dashed](Start)(End)%

In this case my workflow was as follows:

  1. Define start and end point.
  2. Position all components from left to right using an absolute position (abspos).
  3. Get the shape of all lenses like you want them to appear.
  4. Start with a wide beam without divergence.
  5. Adapt the refractive index n for every lens to fit your required beam path.

Yes, point 5 isn't how a real optical setup is choosen, but you want to draw a sketch which doesn't allow you to use the 'real' lens radii and focal distances.

I wrapped all components and beams inside an optexp environment, so that the beam is drawn below the components. Only the fourier component, which indicates the Fourier plane, is drawn afterwards because it must be over the beam.

enter image description here

  • That's pretty much exactly what I wanted. Thank you very much!
    – ginny
    Commented Nov 7, 2014 at 20:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .