[pstricks] conceptual question for pst-optexp

Herbert Voss Herbert.Voss at FU-Berlin.DE
Wed May 28 22:54:59 CEST 2008


Christoph Bersch schrieb:

> I have a question regarding the design of new components for pst-optexp. 
> Currently there are transmittive objects (e.g. lenses)
> 
> \lens(A)(B){L}
> 
> and reflective objects (e.g. mirrors).
> 
> \mirror(A)(G)(B){M}
> 
> In both cases all used nodes have to be defined by the user.
> 
> Now I am planning to provide new objects with multiple internal 
> reflections. That means that I have to define new nodes inside the 
> object and make them accessible for the user in order to draw the beam.
> 
> To illustrate the problem a bit, consider the following example:
> 
> \documentclass{article}
> \usepackage{pst-node}
> \SpecialCoor
> \makeatletter
> \def\pentaprism{%
>     \edef\@pp at size{2\space}%

\def\@pp at size{2 }%
      \pspolygon(! \@pp at size 2 sqrt div 0)%
         (! \@pp at size 2 sqrt div 67.5 cos \@pp at size
            mul 67.5 sin div sub \@pp at size)%
         (! 67.5 cos \@pp at size mul 67.5 sin div
            \@pp at size 2 sqrt div sub \@pp at size)%
         (! \@pp at size 2 sqrt div neg 0)%
         (! 0 \@pp at size 2 sqrt div neg)%

>     \pnode(! \@pp at size 2 sqrt div 67.5 cos \@pp at size mul
>              67.5 sin 2 mul div sub \@pp at size 2 div){PentaPrism1}%
...

> would then create two nodes e.g. 'PPInput' and 'PPOutput' which can be 
> accessed by the user lateron.
> 
> Do you think this is a good way to implement it or are there better ways?

that is ok!

Herbert



More information about the PSTricks mailing list