summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/latex/pst-optexp
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2013-06-28 22:22:09 +0000
committerKarl Berry <karl@freefriends.org>2013-06-28 22:22:09 +0000
commit7982c074840b844f8dcbfaf3eeb885a1c9216999 (patch)
treed3c1b42332e169fcd416e1ef769592c6f7e00c0f /Master/texmf-dist/tex/latex/pst-optexp
parentabf2c2731a05ca038cfbb771f3430be4481f76d8 (diff)
pst-optexp (9jun13)
git-svn-id: svn://tug.org/texlive/trunk@31015 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/tex/latex/pst-optexp')
-rw-r--r--Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty126
1 files changed, 100 insertions, 26 deletions
diff --git a/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty b/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
index 3516f6be687..08aa3e52833 100644
--- a/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
+++ b/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
@@ -9,7 +9,7 @@
%% This is a generated file.
%%
%% Project: pst-optexp
-%% Version: 4.1 (2013/05/21)
+%% Version: 4.2 (2013/06/07)
%%
%% Copyright (C) 2007-2013 by Christoph Bersch <usenet@bersch.net>
%%
@@ -31,7 +31,7 @@
%%
\NeedsTeXFormat{LaTeX2e}[1999/12/01]
\ProvidesPackage{pst-optexp}
- [2013/05/21 v4.1 Optical experimental setups with PSTricks]
+ [2013/06/07 v4.2 Optical experimental setups with PSTricks]
\RequirePackage{ifthen}
\RequirePackage{pstricks}
\RequirePackage{pst-xkey}
@@ -129,6 +129,7 @@
\def\POE@str@center{center}
\def\POE@str@circle{circle}
\def\POE@str@closed{closed}
+\def\POE@str@connection{connection}
\def\POE@str@coupling{coupling}
\def\POE@str@cross{cross}
\def\POE@str@cube{cube}
@@ -168,6 +169,7 @@
\def\POE@str@top{top}
\def\POE@str@transmittive{transmittive}
\def\POE@str@triangle{triangle}
+\def\POE@str@vector{vector}
\def\POE@str@verbose{verbose}
\newpsstyle{OptComp}{}%
\define@key[psset]{optexp}{newOptComp}{%
@@ -1370,6 +1372,12 @@
}%
\define@boolkey[psset]{optexp}[POE@]{startinside}[true]{}%
\define@boolkey[psset]{optexp}[POE@]{stopinside}[true]{}%
+\define@key[psset]{optexp}{startinsidecount}{%
+ \pst@checknum{#1}\POE@key@startinsidecount
+}
+\define@key[psset]{optexp}{stopinsidecount}{%
+ \pst@checknum{#1}\POE@key@stopinsidecount
+}
\define@boolkey[psset]{optexp}[POE@]{beaminsidefirst}[true]{}%
\define@boolkey[psset]{optexp}[POE@]{beaminsidelast}[true]{}%
\define@choicekey+[psset]{optexp}{savebeampoints}%
@@ -1437,9 +1445,24 @@
\define@boolkey[psset]{optexp}[POE@]{forcebeaminside}[true]{}%
\define@boolkey[psset]{optexp}[POE@]{raytrace}[true]{}%
\define@boolkey[psset]{optexp}[POE@]{useNA}[true]{}%
+\define@choicekey+[psset]{optexp}{beamnodealign}%
+ [\val\nr]{vec, conn, vector, connection}%
+ {%
+ \ifcase\nr\relax
+ \let\POE@key@beamnodealign\POE@str@vector
+ \or
+ \let\POE@key@beamnodealign\POE@str@connection
+ \else
+ \def\POE@key@beamnodealign{#1}%
+ \fi
+ }%
+ {\PackageError{pst-optexp}{Unknown value '\val' for beamnodealign}}
\define@key[psset]{optexp}{beampathskip}{%
\pst@checknum{#1}\POE@key@beampathskip
}%
+\define@key[psset]{optexp}{beampathcount}{%
+ \pst@getint{#1}\POE@key@beampathcount
+}%
\define@choicekey+[psset]{optexp}{beamalign}%
[\val\nr]{rel,abs,relative,absolute}%
{%
@@ -1461,6 +1484,7 @@
\psset[optexp]{%
raytrace=true
,useNA=true
+ ,beamnodealign=connection
,startinside=false
,stopinside=false
,allowbeaminside=true
@@ -1479,6 +1503,9 @@
,beamdiv=0
,n=1.5
,beampathskip=0
+ ,beampathcount=-1
+ ,stopinsidecount=-1
+ ,startinsidecount=-1
,ArrowInsideMinLength=0.2
,ArrowInsideMaxLength=-1
}%
@@ -1890,7 +1917,7 @@
startnode=auto,
stopnode=auto
}%
-\newenvironment{optexp}{\Collect@Body\POE@collect}{}
+\newenvironment{optexp}{\Collect@Body\POE@collect}{}%
\long\def\POE@collect#1{%
\psset[optexp]{optexpenv}
\global\POE@oldcnt=\POE@cnt
@@ -2061,11 +2088,23 @@
/beamdiv \POE@key@beamdiv\space def
/savebeampoints \POE@key@savebeampoints\space def
/savebeam \ifPOE@savebeam true \else false \fi def
- /beaminsidefirst \ifPOE@beaminsidefirst true \else false \fi def
- /beaminsidelast \ifPOE@beaminsidelast true \else false \fi def
+ /startinsidecount \POE@key@startinsidecount\space cvi def
+ startinsidecount 0 eq {
+ /beaminsidefirst false def
+ /startinside false def
+ } {
+ /beaminsidefirst \ifPOE@beaminsidefirst true \else false \fi def
+ /startinside \ifPOE@startinside true \else false \fi def
+ } ifelse
+ /stopinsidecount \POE@key@stopinsidecount\space cvi def
+ stopinsidecount 0 eq {
+ /beaminsidelast false def
+ /stopinside false def
+ } {
+ /beaminsidelast \ifPOE@beaminsidelast true \else false \fi def
+ /stopinside \ifPOE@stopinside true \else false \fi def
+ } ifelse
/beaminside \ifPOE@beaminside true \else false \fi def
- /startinside \ifPOE@startinside true \else false \fi def
- /stopinside \ifPOE@stopinside true \else false \fi def
/connectifc \ifPOE@raytrace false \else true \fi def
/beamalign
\ifx\POE@key@beamalign\POE@str@absolute\space
@@ -2074,7 +2113,9 @@
relative
\fi def
/beampathskip \POE@key@beampathskip\space def
+ \POE@key@beampathcount\space dup -1 gt { beampathskip add } if /beampathcount ED
/useNA \ifPOE@useNA true \else false \fi def
+ /aligntovector \ifx\POE@key@beamnodealign\POE@str@vector true \else false \fi def
}%
}%
\def\begin@WideBeamObj{%
@@ -2682,6 +2723,14 @@
\def\oeBeamVec#1{\POE@beamvec{}{#1}}%
\def\oeBeamVecUp#1{\POE@beamvec{Up}{#1}}%
\def\oeBeamVecLow#1{\POE@beamvec{Low}{#1}}%
+\def\oeBeamVecMedian#1{%
+ \oeBeamVecUp{#1} \oeBeamVecLow{#1} \POE@dict{VecAdd NormalizeVec}
+}%
+\def\oeBeamCenter#1{%
+ \psGetNodeCenter{\oenodeBeamUp{#1}} \oenodeBeamUp{#1}.x \oenodeBeamUp{#1}.y
+ \psGetNodeCenter{\oenodeBeamLow{#1}} \oenodeBeamLow{#1}.x \oenodeBeamLow{#1}.y
+ \POE@dict{VecAdd 0.5 VecScale}
+}%
\def\POE@useifccode{%
\POE@Verb{%
[ \pst@code
@@ -4345,6 +4394,14 @@
\closepath
}%
}%
+\def\optprism@ref{%
+ \ifPOE@backlayer
+ \POE@Verb{/OEangle\the\POE@cnt\space OEangle def }%
+ \fi
+ \ifPOE@frontlayer
+ \POE@Verb{/OEangle OEangle\the\POE@cnt\space def }%
+ \fi
+}%
\def\optprism@nodes{%
\edef\@sz{\POE@key@prismsize\space}%
\edef\@ang{\POE@key@prismangle\space 0.5 mul\space}%
@@ -4359,19 +4416,26 @@
0
\fi
}%
- \newOptexpComp{%
- {\@sz -0.6 mul \@ang tan mul \@hshift neg}
- {90 \@ang sub dup cos exch sin}
- \@sz \@ang cos div dup -0.4 mul exch 0.6 mul trans {PlainIfc}
- \ifx\POE@key@prismtype\POE@str@transmittive\else
- {0 \@sz -0.4 mul \@hshift sub }
- {1 0} \@ang tan \@sz mul dup neg exch refl {PlainIfc}
+ \begingroup
+ \ifx\POE@key@prismtype\POE@str@reflective
+ \pst@def{ScreenCoor}< \pst@number\psyunit neg mul exch \pst@number\psxunit mul exch >
\fi
- {\@sz 0.6 mul \@ang tan mul \@hshift neg}
- {90 \@ang add dup cos exch sin}
- \@sz \@ang cos div dup -0.4 mul exch 0.6 mul trans {PlainIfc}
- \POE@key@n true }%
- \pnode(! 0 \@hshift neg){\oenodeCenter{}}
+ \pnode(! 0 \@hshift neg){\oenodeCenter{}}
+ \newOptexpComp{%
+ {\@sz -0.6 mul \@ang tan mul \@hshift neg}
+ {90 \@ang sub dup cos exch sin}
+ \@sz \@ang cos div dup -0.4 mul exch 0.6 mul trans {PlainIfc}
+ {\@sz 0.6 mul \@ang tan mul \@hshift neg}
+ {90 \@ang add dup cos exch sin}
+ \@sz \@ang cos div dup -0.4 mul exch 0.6 mul trans {PlainIfc}
+ \ifx\POE@key@prismtype\POE@str@reflective
+ 12 6 roll
+ {0 \@sz -0.4 mul \@hshift sub }
+ {1 0} \@ang tan \@sz mul dup neg exch refl {PlainIfc}
+ 12 6 roll
+ \fi
+ \POE@key@n true }%
+ \endgroup
}%
\def\optprism@comp{%
\edef\@sz{\POE@key@prismsize\space}%
@@ -4387,17 +4451,27 @@
0
\fi
}%
- \pspolygon(! \@sz neg \@altan mul \@sz -0.4 mul \@hshift sub)
- (! \@sz \@altan mul \@sz -0.4 mul \@hshift sub)
- (! 0 \@sz 0.6 mul \@hshift sub)
+ \edef\POE@temp{\ifx\POE@key@prismtype\POE@str@reflective -1 mul \fi}%
+ \pspolygon(! \@sz neg \@altan mul \@sz -0.4 mul \@hshift sub \POE@temp)
+ (! \@sz \@altan mul \@sz -0.4 mul \@hshift sub \POE@temp)
+ (! 0 \@sz 0.6 mul \@hshift sub \POE@temp)
}%
\def\rightangleprism@ref{%
+ \ifPOE@backlayer
+ \POE@Verb{/OEangle\the\POE@cnt\space OEangle def }%
+ \fi
+ \ifPOE@frontlayer
+ \POE@Verb{/OEangle OEangle\the\POE@cnt\space def }%
+ \fi
\POE@setref{%
+ OEangle 0.5 mul
+ { x sin modA mul }
+ { OEangle x sub sin modB mul }
tx@EcldDict begin
- OEangle 0.5 mul
- { x sin modA mul }
- { OEangle x sub sin modB mul }
- NewtonSolving pop
+ 10 dict begin
+ /ZeroEq { abs 5e-6 lt } bind def
+ NewtonSolving pop
+ end
end
/@htA exch def
OEangle 0.5 mul exch sub /dOEangle exch def