[pstricks] transmission grating in pst-optexp (Christoph Bersch)

Christoph Bersch usenet at bersch.net
Fri Jul 12 15:19:34 CEST 2013


Am 12.07.2013 12:26, schrieb Steffen Wittek:
 > The transmission gratings work like the normal
> gratings only that they are transmissive. The operation is shown here:
> http://www.light-all.com/Writable/Resource/_random_/2009-03-14/reflection_vs_transmission_gratings.jpg
> Do you think that the variant can be extended. Or is there a new object
> needed alltogether?

here is a partial implementation, could you try this out? There are some 
issues, which require a change of pst-optexp.sty. If this concept is 
fine for you, I would release the version with the fully functional 
It is defined as a new component, because the name 'gratingtype' is 
already used to distinguish between blazed and binary gratings. However, 
all grating parameters can be used and have the same meaning.


\def\transmissiongrating at ref{%
   \POE at calcAngle
   \FPadd\POE at key@angle{\POE at key@angle0}{90}
   \FPround\POE at key@angle{\POE at key@angle}{5}
   \POE at setref{/@@y \POE at key@gratingwidth\space 0.5 mul def}%
\def\transmissiongrating at nodes{%
     {0 0} \POE at key@gratingwidth\space 0.5 mul dup neg exch
     OEangle 180 sub abs 1e-5 lt {
       trans {1 0}
     } {
       refl {0 1}
     } ifelse
     4 1 roll {PlainIfc} 1}%
\let\transmissiongrating at comp\optgrating at comp
   \optgrating[reverse, gratingcount=9](A)(B)(C)
   \addtopsstyle{Beam}{ArrowInside=->, ArrowInsidePos=0.8, arrowinset=0, 
   \addtopsstyle{Beam}{loadbeam, savebeam=false}
   \drawbeam[linecolor=red, beamangle=15]{1-2}
   \drawbeam[linecolor=blue, beamangle=-15]{1-2}
   \rput[lB](0,2){reflection grating}
   \transmissiongrating[reverse, gratingcount=9](A)(B)(C)
   \addtopsstyle{Beam}{ArrowInside=->, ArrowInsidePos=0.8, arrowinset=0, 
   \addtopsstyle{Beam}{loadbeam, savebeam=false}
   \drawbeam[linecolor=red, beamangle=5]{1-2}
   \drawbeam[linecolor=blue, beamangle=-5]{1-2}
   \rput[lB](0,2){transmission grating}

More information about the PSTricks mailing list