[pstricks] Transmission grating - troubleshooting

Steffen Wittek steffen.wittek at gmx.net
Mon Jul 15 15:18:47 CEST 2013


Hi,

another encountered problem. Beampos doesn't work anymore. The ray 
doesn't see the orientation of the grating. Example:

\documentclass{standalone}

\usepackage[T1]{fontenc}

\usepackage[utf8]{inputenc}

\usepackage{pst-optexp}

\usepackage{fp}

\makeatletter

\newOptexpTripole{transmissiongrating}

\makeatletter

\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{%

    \newOptexpComp{%

      {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

\makeatother


\begin{document}

\begin{pspicture}[showgrid](4,3)

    \pnode(1,2){S1}

    \pnode(1,1){G1}\pnode(2,1){G11}

   

    		\transmissiongrating[gratingwidth=1, gratingheight=0.1](S1)(G1)(G11)

    		\optprism[prismangle=60,compname=P1,labelalign=t](1,1)(2,2)(3,1)

    		\drawbeam[beampos=-0.2](0,1){1}

\end{pspicture}

\end{document}


Any comments on that one?

Best,
Steffen

El 7/15/13 12:00 PM, pstricks-request at tug.org escribió:
> Send PSTricks mailing list submissions to
> 	pstricks at tug.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	http://tug.org/mailman/listinfo/pstricks
> or, via email, send a message with subject or body 'help' to
> 	pstricks-request at tug.org
>
> You can reach the person managing the list at
> 	pstricks-owner at tug.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of PSTricks digest..."
>
>
> Today's Topics:
>
>     1. Re: Transmission grating again (Christoph Bersch)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 15 Jul 2013 11:42:26 +0200
> From: Christoph Bersch <usenet at bersch.net>
> To: <pstricks at tug.org>
> Subject: Re: [pstricks] Transmission grating again
> Message-ID: <51E3C402.3070102 at bersch.net>
> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed
>
> Hi,
>
> a classical 'trailing space' error. Add a comment character at the end
> of the two lines
>
> \FPadd\POE at key@angle{\POE at key@angle0}{90}%
> \FPround\POE at key@angle{\POE at key@angle}{5}%
>                                           ^^^
>
> and the shift disappears.
>
> Christoph
>
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> PSTricks mailing list
> PSTricks at tug.org
> http://tug.org/mailman/listinfo/pstricks
>
>
> ------------------------------
>
> End of PSTricks Digest, Vol 126, Issue 13
> *****************************************

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://tug.org/pipermail/pstricks/attachments/20130715/fc90effd/attachment.html>


More information about the PSTricks mailing list