summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-11-16 19:58:17 +0000
committerKarl Berry <karl@freefriends.org>2009-11-16 19:58:17 +0000
commitee7b4a2078b6b24ffa5e1053b545eb87ae368726 (patch)
tree7dcd1fa54a6ae2878541febd382c5d1df42e32f1
parent494bd0475fd9f4b8ad307a7fb97b96d1f8093936 (diff)
pst-optexp 2.1 (6nov09)
git-svn-id: svn://tug.org/texlive/trunk@16037 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Master/texmf-dist/doc/generic/pst-optexp/Changes29
-rw-r--r--Master/texmf-dist/doc/generic/pst-optexp/README4
-rw-r--r--Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.pdfbin472204 -> 370537 bytes
-rw-r--r--Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.tex434
-rw-r--r--Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro30
-rw-r--r--Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex470
-rw-r--r--Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty4
7 files changed, 723 insertions, 248 deletions
diff --git a/Master/texmf-dist/doc/generic/pst-optexp/Changes b/Master/texmf-dist/doc/generic/pst-optexp/Changes
index 3ab0afda9e1..45c229ab47e 100644
--- a/Master/texmf-dist/doc/generic/pst-optexp/Changes
+++ b/Master/texmf-dist/doc/generic/pst-optexp/Changes
@@ -1,3 +1,32 @@
+2.1 2009-11-05 * Bugfix: removed the buggy check for an appropriate version of
+ pstricks-add.
+
+ * Bugfix: 'thicklens' now also works with plain* lenses
+
+ * Different minor bugfixes
+
+ * Minor enhancements
+
+ * New psstyle 'OptComp' which sets general parameters for all optical
+ components. Appropriate parameters 'addtoOptComp' and 'newOptComp'
+ were also introduced.
+
+ * New parameters:
+ - 'label' allows a more condensed change of several label parameters
+ - 'innerlabel'
+ - 'compshift'
+ - 'bsstyle'
+ - 'connjoin'
+ - 'newBeam' and 'addtoBeam' to allow for local changes
+ of the internal beam style.
+
+ * New component: 'optfiberpolarizer'
+
+ * Changed 'fibercollimator' so that it uses two, three or four nodes.
+
+ * Changed documentation to use 'pst-doc' class.
+
+
2.0 2008-07-27 * Added fiber-optical components
* Added support for components with internal refraction (e.g. prisms)
diff --git a/Master/texmf-dist/doc/generic/pst-optexp/README b/Master/texmf-dist/doc/generic/pst-optexp/README
index ac2ac3a19df..0c6c2f39a25 100644
--- a/Master/texmf-dist/doc/generic/pst-optexp/README
+++ b/Master/texmf-dist/doc/generic/pst-optexp/README
@@ -4,7 +4,7 @@ setups. Mechanisms for proper alignment of different components are
provided internally. This way the user does not have to care for proper
orientation of the elements.
-This is version 2.0
+This is version 2.1
For a changelog see file Changes
Save the files
@@ -29,4 +29,4 @@ See http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
for the details of that license.
--
-Christoph Bersch 2008/07/27
+Christoph Bersch 2009/11/05
diff --git a/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.pdf b/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.pdf
index a4d22535f41..5455f6d9b38 100644
--- a/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.pdf
+++ b/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.pdf
Binary files differ
diff --git a/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.tex b/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.tex
index 2c54a8a9dda..bbab17d1c81 100644
--- a/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.tex
+++ b/Master/texmf-dist/doc/generic/pst-optexp/pst-optexp-doc.tex
@@ -1,29 +1,19 @@
-\documentclass[headinclude,DIV12]{scrartcl}
+%\documentclass[headinclude,DIV12]{scrartcl}
+\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings,
+ headexclude,footexclude,oneside]{pst-doc}
\usepackage[latin1]{inputenc}
-\usepackage[T1]{fontenc}
-\usepackage[english]{babel}
-\usepackage{textcomp}
-
-\usepackage{scrpage2}
-\usepackage{url}
%
+\usepackage{pst-func}
\usepackage{pst-optexp}
\let\verPstOptExp\fileversion
\let\datePstOptExp\filedate
-\usepackage{showexpl}
-\lstset{breakatwhitespace}
+\usepackage{pst-circ}
\usepackage{nicefrac}
-\usepackage{graphicx}
-\usepackage{array}
\usepackage{longtable}
-\usepackage{booktabs}
\usepackage{multicol}
\usepackage{multirow}
-\usepackage{tabularx}
-\usepackage{caption}
\usepackage{float}
-\usepackage[colorlinks,linktocpage]{hyperref}
%
\newfloat{LTXexampleFloat}{H}{expl}
\floatname{LTXexampleFloat}{Listing}
@@ -34,7 +24,7 @@
\newcommand{\OptExpPackage}{\textsf{`pst-optexp'}}
\newcommand{\parameter}[1]{\texttt{#1}}
\newcommand{\nodename}[1]{\emph{#1}}
-\let\param\textrm
+\newcommand{\param}[1]{\normalfont\texttt{#1}}
\newcommand{\paramvalue}[1]{\texttt{#1}}
\newcommand{\defaultparam}[1]{\emph{default:} \paramvalue{#1}}
\newcommand{\paramitem}[3]{\item[\param{#1}:] \paramvalue{#2} (\defaultparam{#3})}
@@ -48,7 +38,7 @@
(left), \paramvalue{r} (right)}
%
% Settings
-\setkomafont{sectioning}{\normalfont\normalcolor\bfseries}
+%\setkomafont{sectioning}{\normalfont\normalcolor\bfseries}
%
\makeatletter
\renewenvironment{description}
@@ -58,29 +48,34 @@
{\endlist}
\makeatother
%
-\clearscrheadfoot
-\setheadsepline{0.4pt}
-\ihead{\OptExpPackage}\ohead{A PSTricks package to draw optical experimental setups}
-\ofoot{\pagemark}
-\pagestyle{scrheadings}
+%\clearscrheadfoot
+%\setheadsepline{0.4pt}
+%\ihead{\OptExpPackage}\ohead{A PSTricks package to draw optical experimental setups}
+%\ofoot{\pagemark}
+%\pagestyle{scrheadings}
\psset{usefiberstyle=true}
-\addtopsstyle{Fiber}{linecolor=red}
+\addtopsstyle{Fiber}{linecolor=red,linewidth=1.5\pslinewidth}
+\addtopsstyle{Beam}{linewidth=1.5\pslinewidth}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-\begin{document}
+\begin{document}\title{\texttt{pstricks-add}\\additionals Macros for \texttt{pstricks}%
+%\thanks{%
+% This document was written with \texttt{Kile: 1.7 (Qt: 3.1.1; KDE: 3.3;}
+% \url{http://sourceforge.net/projects/kile/}) and the PDF output
+% was build with VTeX/Free (\url{http://www.micropress-inc.com/linux})}
+\\
+ \small v.\verPstOptExp}
\title{\texttt{pst-optexp}\\ A PSTricks package to draw optical experimental setups}
- \author{Christoph Bersch \textless
- \href{mailto:usenet@bersch.net}{\texttt{usenet@bersch.net}}\textgreater}
- \date{\datePstOptExp\enspace\enspace Version \verPstOptExp}
+ \author{Christoph Bersch}
+ \date{\datePstOptExp}
\maketitle
-\pdfbookmark[1]{Table of Contents}{toc}
-\setlength{\columnseprule}{0.6pt}
-\begin{multicols}{2}
-{\parskip 0pt \tableofcontents}
-\end{multicols}
+
+\clearpage
+\tableofcontents
+\clearpage
\section{Introduction}
-The package \texttt{pst-optexp} is a collection of optical components
+The package \nxLPack{pst-optexp} is a collection of optical components
that facilitate easy sketching of optical experimental
setups. Mechanisms for proper alignment of different components are
provided internally. This way the user does not have to care for proper
@@ -95,7 +90,7 @@ objects.
\subsection{Concept}
-The objects provided by \texttt{pst-optexp} can be differentiated into
+The objects provided by \nxLPack{pst-optexp} can be differentiated into
two different categories: free-ray and fiber-optical objects.
The free-ray units are subdivided in two different kinds: dipoles which
@@ -131,12 +126,14 @@ fiber-optical or free-ray elements. The way they are treated regarding
the connections to the reference points can be controlled by the
parameters explained in Sec.~\ref{sec:connecting}.
-\subsection{General Options}
+\subsection{General Settings}
\begin{description}
+\paramitem{angle}{<degree>}{0}
+\paramitem{compshift}{<num>}{0}
\paramitem{optional}{<boolean>}{false}
\paramitem{showoptdots}{<boolean>}{false}
-\styleitem{OptionalStyle}{<psstyle>}
+
\end{description}
\parameter{optional} can be used with every object and marks it as
@@ -151,9 +148,38 @@ positioning, the red points mark the label references.
\begin{LTXexample}[pos=t, vsep=0.8cm]
\begin{pspicture}[showgrid=true](8,2)
+\psset{beam}
+\lens[optional](0,1)(3,1){L}
+\mirror[showoptdots](4,1)(7,1)(7,0){mirror}
+\end{pspicture}
+\end{LTXexample}
+
+\medskip
+
+\subsection{Using PSStyles}\label{sec:styles}
+
+\begin{description}
+\styleitem{OptionalStyle}{<psstyle>}
+\paramitem{addtoOptComp}{<psstyle>}{}
+\paramitem{newOptComp}{<psstyle>}{}
+\styleitem{OptComp}{<psstyle>}
+\end{description}
+
+\styleshape{OptComp} affects only the appearence of the optical
+components. This was introduced, because using only the standard
+graphics parameters changes also the connections that are drawn within
+the component.
+
+\medskip
+
+\begin{LTXexample}[pos=t, vsep=0.8cm]
+\begin{pspicture}[showgrid=true](8,2)
\psset{beam}
- \lens[optional](0,1)(3,1){L}
- \mirror[showoptdots](4,1)(7,1)(7,0){mirror}
+ \addtopsstyle{OptComp}{linestyle=dashed, dash=2pt 2pt}
+ % wrong, also beam width is changed
+ \mirror[linewidth=3\pslinewidth](0,1)(3,1)(3,0){mirror}
+ % correct result
+ \mirror[addtoOptComp={linewidth=3\pslinewidth}](5,1)(7,1)(7,0){mirror}
\end{pspicture}
\end{LTXexample}
@@ -200,6 +226,7 @@ two reference nodes. Its value is given in psunits.
\paramitem{labelstyle}{<macro>}{\cs{small}}
\paramitem{labelalign}{<ref string>\footnote{\refstringexplanation}}{c}
\paramitem{labelref}{relative|relgrav|global}{relgrav}
+\paramitem{label}{<offset> <angle> <ref string> <labelref>}{}
\end{description}
\noindent\parameter{labeloffset} specifies the offset from the label
@@ -215,11 +242,12 @@ the following three examples.
\begin{LTXexample}[width=5cm]
\begin{pspicture}(-2,-2)(2.5,2)
- \multido{\i=0+72}{5}{%
+ \multido{\i=0+45}{8}{%
\optbox[endbox,
labelref=relative,
labeloffset=0,
- optboxwidth=1](0,0)(1;\i){\i}
+ optboxwidth=1,
+ optboxheight=0.6](0,0)(1;\i){\i}
}
\end{pspicture}
\end{LTXexample}
@@ -231,7 +259,8 @@ the following three examples.
\multido{\i=0+72}{5}{%
\optbox[endbox,
labelref=relgrav,
- optboxwidth=1](0,0)(1;\i){\i}
+ optboxwidth=1,
+ optboxheight=0.6](0,0)(1;\i){\i}
}
\end{pspicture}
\end{LTXexample}
@@ -243,23 +272,38 @@ the following three examples.
\multido{\i=0+72}{5}{%
\optbox[endbox,
labelref=global,
- optboxwidth=1](0,0)(1;\i){\i}
+ optboxwidth=1,
+ optboxheight=0.6](0,0)(1;\i){\i}
}
\end{pspicture}
\end{LTXexample}
\medskip
+\parameter{label} simplifies the simultaneous change of more than one label-related parameter. It takes up to four space-separated arguments. Unchanged arguments may be specified with a dot.
+
+\medskip
+
+\begin{LTXexample}[width=5cm]
+ \begin{pspicture}[showgrid=true](0,0)(3,3)
+ \psset{endbox, beam}
+ \optbox[label=1 -45](1,0)(2,1){label}
+ \optbox[label=0 . . relative](0.6,0.6)(0.6,1.6){label}
+ \end{pspicture}
+\end{LTXexample}
+
+\medskip
+
\subsection{Named Objects}\label{sec:namedobj}
\begin{description}
\paramitem{compname}{<string>}{\{\}}
\end{description}
-\noindent Every \texttt{pst-optexp} object of an experimental setup can
+\noindent Every \nxLPack{pst-optexp} object of an experimental setup can
be assigned a name that is unique within one pspicture environment. The
name is defined with the parameter \parameter{compname} which is
-defineable only directly within a \texttt{pst-optexp} object: \medskip
+defineable only directly within a \nxLPack{pst-optexp} object: \medskip
\begin{lstlisting}
\optbox[compname=MyBox](A)(B){Box} % valid use of 'compname'
@@ -312,7 +356,7 @@ Sec.~\ref{sec:extnode}) and to connect objects after their definition
\noindent Some of the objects can provide a supplementary node for additional
connections. A laser diode may be connected for example to a frequency synthesizer
-(use package \texttt{pst-circ}) or a detector to a computer.
+(use package \nxLPack{pst-circ}) or a detector to a computer.
\parameter{extnode} controls the position of the additional node and
takes a \paramvalue{<ref string>} as its argument. By default this
@@ -392,6 +436,7 @@ Sec.~\ref{sec:mirror}) which does not depend on the actual value of \parameter{e
\paramitem{conn}{<conn definition>}{-}
\item[\param{fiber}:] alias for \parameter{conn=f-f}
\item[\param{beam}:] alias for \parameter{conn=o-i}
+\paramitem{connjoin}{<int>}{1}
\end{description}
\noindent Simple experimental setups with a few objects can usually be
@@ -409,7 +454,7 @@ their scope for the \paramvalue{<conn definition>}.
\begin{table}\centering
\addtolength{\extrarowheight}{1.5mm}
-\begin{tabularx}{0.8\textwidth}{TXl}
+\begin{tabularx}{0.9\textwidth}{TXl}
\toprule
\multicolumn{1}{l}{conn style} & description & scope\\
\midrule
@@ -445,7 +490,7 @@ All fiber-optical units define \parameter{conn=f-f} which means that
input and output connections are \paramvalue{f}ibers. The boolean
parameter \parameter{fiber} is an alias for \parameter{conn=f-f}. The
fiber connection style can be changed by adapting the \styleshape{Fiber*}
-styles (see Sec.~\ref{sec:styles}).
+styles (see Sec.~\ref{sec:fiberstyles}).
The way how to really use this kind of connections should become more
clear after looking at the following examples in this section.
@@ -493,7 +538,7 @@ This method works unless objects without internal beams (e.g. an optical
diode, Sec.~\ref{sec:optdiode}) or with internal reflections (e.g. a
Dove prism, Sec.~\ref{sec:doveprism}) are used in the straight light
paths of the setup. One possibility would be to create additional nodes,
-but this may be not very comfortable. Therefore, \texttt{pst-optexp}
+but this may be not very comfortable. Therefore, \nxLPack{pst-optexp}
provides a macro \cs{drawbeam} which connects a named object
(Sec.~\ref{sec:namedobj}) to another named object or a node.
@@ -633,20 +678,21 @@ automatic beam connections the \styleshape{Beam} style is used.
The shape of a lens is defined by its two surface radii. A negative
radius gives a concave, a positive radius a convex and a radius of
\texttt{0} a plain surface. The parameters \parameter{lensradiusleft}
-and \parameter{lensradiusright} allow to define independent values for both
-surfaces. \parameter{lensradius} sets both curvatures to the same
+and \parameter{lensradiusright} allow to define independent values for
+both surfaces. \parameter{lensradius} sets both curvatures to the same
value. Usually only \parameter{lensheight} and the two radii are used to
construct the lens. The thickness (or width) is determined
automatically. Manually controlling the thickness of the lens can be
achived by setting \parameter{thicklens}
-to \paramvalue{true}. Then \parameter{lenswidth} is used as width of the lens at
-its waist. Finally, the parameter \parameter{lens} allows the definition of
-all relevant lens parameters at once. It consists of one up to four
-space-separated numbers. The first one gives the left radius. If no
-further value is set, the right radius will be set to the same value and
-all other parameters are left unchanged. Using two numbers defines two
-different radii. The third optional value defines
-the \parameter{lensheight} and the fourth one the \parameter{lenswidth}.
+to \paramvalue{true}. Then \parameter{lenswidth} is used as width of the
+lens at its waist. Finally, the parameter \parameter{lens} allows the
+definition of all relevant lens parameters at once. It consists of one
+up to four space-separated numbers. The first one gives the left
+radius. If no further value is set, the right radius will be set to the
+same value and all other parameters are left unchanged. Using two
+numbers defines two different radii. The third optional value defines
+the \parameter{lensheight} and the fourth one the \parameter{lenswidth}
+which is use only if \parameter{thicklens} is set to \parameter{true}.
\textbf{Compatibility:} The whole implementation of the lens was
changed in version 1.2. It allows a much more flexible definition of different lens
@@ -663,6 +709,7 @@ removed in future versions.
\begin{description}
\paramitem{plateheight}{<num>}{1}
\paramitem{platelinewidth}{<num>}{2\cs{pslinewidth}}
+\paramitem{angle}{<degree>}{0}
\end{description}
\medskip
@@ -675,6 +722,14 @@ removed in future versions.
\medskip
+\begin{LTXexample}[width=3.5cm]
+\begin{pspicture}[showgrid=true](3,2)
+ \optplate[angle=10, beam](0,1.2)(3,1.2){glass plate}
+\end{pspicture}
+\end{LTXexample}
+
+\medskip
+
\subsection{Retardation Plate}
\begin{description}
@@ -827,11 +882,11 @@ operator.
\paramitem{dettype}{round|diode}{round}
\end{description}
-With \texttt{pst-optexp} version 2.0 the name for the detector was
-changed to \cs{optdetector} as the package \texttt{pst-circ} also
+With \nxLPack{pst-optexp} version 2.0 the name for the detector was
+changed to \cs{optdetector} as the package \nxLPack{pst-circ} also
provides a \cs{detector} macro. For compatibility reasons the old
-\cs{detector} macro is available when \texttt{pst-circ} is not loaded
-before \texttt{pst-optexp}.
+\cs{detector} macro is available when \nxLPack{pst-circ} is not loaded
+before \nxLPack{pst-optexp}.
\medskip
@@ -1001,6 +1056,7 @@ piezo mirror, the default piece of wire is omitted.
\begin{description}
\paramitem{bssize}{<num>}{0.8}
+\paramitem{bsstyle}{cube|plate}{cube}
\end{description}
\medskip
@@ -1016,6 +1072,17 @@ piezo mirror, the default piece of wire is omitted.
\medskip
+\begin{LTXexample}[width=3.5cm]
+\begin{pspicture}[showgrid=true](3,3)
+ \pnode(0,2){A}
+ \pnode(2,2){G}
+ \pnode(3,0){B}
+ \beamsplitter[bsstyle=plate, beam](A)(G)(B){BS}
+\end{pspicture}
+\end{LTXexample}
+
+\medskip
+
\subsection{Optical Grid}
@@ -1151,12 +1218,11 @@ your own components see Sec.~\ref{sec:newobj}.
\begin{pspicture}[showgrid=true](3,3)
\pnode(0,2){A}
\pnode(3,1){B}
- \optdipole[labeloffset=1](A)(B){%
+ \optdipole[labeloffset=1, beam](A)(B){%
\rput(0,0){%
\includegraphics[scale=0.25]{parque-nacional}
}
}{label}
- \psline[linecolor=red](A)(B)
\end{pspicture}
\end{LTXexample}
@@ -1167,8 +1233,7 @@ your own components see Sec.~\ref{sec:newobj}.
\pnode(0,0){A}
\pnode(1.5,2){G}
\pnode(3,1.5){B}
- \opttripole(B)(G)(A){\rput[b](0,0){text}}{label}
- \psline[linecolor=red](A)(G)(B)
+ \opttripole[beam](B)(G)(A){\rput[b](0,0){text}}{label}
\end{pspicture}
\end{LTXexample}
@@ -1182,7 +1247,7 @@ your own components see Sec.~\ref{sec:newobj}.
Fiber-optical objects are automatically connected to the reference
nodes. The style of all fiber connections can be configured
-independently (see Sec.~\ref{sec:styles}).
+independently (see Sec.~\ref{sec:fiberstyles}).
For some components it might me nice to highlight some
internals. If \parameter{usefiberstyle} is enabled, for examples the
@@ -1330,13 +1395,35 @@ which would be highlighted.
\medskip
+
+\subsection{Fiber Polarizer}
+
+\begin{description}
+ \paramitem{fiberpolsize}{<num>}{0.6}
+\end{description}
+
+\medskip
+
+\begin{LTXexample}[width=3.5cm]
+\begin{pspicture}[showgrid=true](3,2)
+ \optfiberpolarizer(0,1)(3,1){polarizer}
+\end{pspicture}
+\end{LTXexample}
+
+\medskip
+
\subsection{Fiber Collimator}
\begin{description}
\paramitem{fibercolsize}{<num>}{0.3}
\end{description}
-The connection type for the fiber collimator is fixed to \parameter{conn=o-f}.
+The connection type for the fiber collimator is fixed
+to \parameter{conn=o-f}. The component can be use with two, three or
+four nodes. With more than two points, the fiber is drawn as a
+\cs{psbezier} curve. In the case of three nodes, the middle one is used
+twice. Positioning parameters can still be used to shift the component
+between the first two nodes.
\medskip
@@ -1348,6 +1435,30 @@ The connection type for the fiber collimator is fixed to \parameter{conn=o-f}.
\medskip
+\begin{LTXexample}[width=3.5cm]
+\begin{pspicture}[showgrid=true](3,2)
+ \fibercollimator(0,1)(2,1)(3,2){FC}
+\end{pspicture}
+\end{LTXexample}
+
+\medskip
+
+\begin{LTXexample}[width=3.5cm]
+\begin{pspicture}[showgrid=true](3,2)
+ \fibercollimator(0.5,1)(2.5,1)(2.5,2){FC}
+\end{pspicture}
+\end{LTXexample}
+
+\medskip
+
+\begin{LTXexample}[width=3.5cm]
+\begin{pspicture}[showgrid=true](3,2)
+ \fibercollimator[position=0.2](0.5,1)(2.5,1)(2.5,2)(0.5,2){FC}
+\end{pspicture}
+\end{LTXexample}
+
+\medskip
+
\subsection{Coupler}\label{sec:coupler}
\begin{description}
\paramitem{couplersize}{<num>}{0.2}
@@ -1406,16 +1517,16 @@ The connection type for the fiber collimator is fixed to \parameter{conn=o-f}.
\medskip
-\subsection{Fiber Styles}\label{sec:styles}
+\subsection{Fiber Styles}\label{sec:fiberstyles}
\begin{description}
-\paramitem{Fiber}{<psstyle>}{linecolor=red}
-\paramitem{FiberIn}{<psstyle>}{style=Fiber}
-\paramitem{FiberIn1}{<psstyle>}{style=FiberIn}
-\paramitem{FiberIn2}{<psstyle>}{style=FiberIn}
-\paramitem{FiberOut}{<psstyle>}{style=Fiber}
-\paramitem{FiberOut1}{<psstyle>}{style=FiberOut}
-\paramitem{FiberOut2}{<psstyle>}{style=FiberOut}
+\styleitem{Fiber}{<psstyle>}%{linecolor=red}
+\styleitem{FiberIn}{<psstyle>}%{style=Fiber}
+\styleitem{FiberIn1}{<psstyle>}%{style=FiberIn}
+\styleitem{FiberIn2}{<psstyle>}%{style=FiberIn}
+\styleitem{FiberOut}{<psstyle>}%{style=Fiber}
+\styleitem{FiberOut1}{<psstyle>}%{style=FiberOut}
+\styleitem{FiberOut2}{<psstyle>}%{style=FiberOut}
\end{description}
All these psstyles control the appearence of the fiber parts before and
@@ -1456,7 +1567,7 @@ following code example.
\medskip
In addition to the psstyles there exist
-corresponding \parameter{new\ldots} and \parameter{addto\ldots}
+corresponding \parameter{newFiber\ldots} and \parameter{addtoFiber\ldots}
parameter keys for each of them.
\medskip
@@ -1563,7 +1674,7 @@ it is very cumbersome to specify all parameters every time.
\subsection{Defining New Objects}\label{sec:newobj}
-Since version 1.2 \texttt{pst-optexp} provides some high-level macros to
+Since version 1.2 \nxLPack{pst-optexp} provides some high-level macros to
allow very convenient definition of completely new components. The macro
\cs{newOptexpDipole} generates all organizing code for a new free-ray
component. All you have to do is to define a new `drawing' macro
@@ -1624,19 +1735,16 @@ incorporate this in a new released version.
\section{Examples}
\begin{LTXexample}[pos=t,vsep=8mm]
-\begin{pspicture}(0,0.2)(13,1.8)
-\addtopsstyle{Beam}{linewidth=2\pslinewidth}
-\pnode(1.4,1){Start}\pnode(11,1){CCD}
-\optbox[endbox, labeloffset=0](CCD)(Start){Laser}
-\optbox[endbox, labeloffset=0, beam](Start)(CCD){CCD}
-\polarization[poltype=perp, position=0.1](Start)(CCD)
-\optretplate[position=0.15](Start)(CCD){$\nicefrac{\lambda}{2}$}
-\lens[lens=0.5 0.5 0.5, position=0.25](Start)(CCD){$L_1$}
-\lens[position=0.5](Start)(CCD){$L_2$}
-\optplate[position=0.57, platelinewidth=3\pslinewidth](Start)(CCD){SLM}
-\optplate[position=0.63, labelangle=180](Start)(CCD){PF}
-\polarization[position=0.66](Start)(CCD)
-\lens[position=0.7](Start)(CCD){$L_3$}
+\begin{pspicture}(10,2)
+\psset{optboxwidth=1}\addtopsstyle{Beam}{linewidth=2\pslinewidth}
+\pnode(1,1){Start}\pnode(9,1){CCD}\optbox[endbox, labeloffset=0](CCD)(Start){Laser}
+\optbox[endbox,labeloffset=0,beam](Start)(CCD){CCD}
+\polarization[poltype=perp,abspos=0.5](Start)(CCD)
+\optretplate[abspos=1](Start)(CCD){$\nicefrac{\lambda}{2}$}
+\lens[lens=0.4 0.4 0.5,abspos=2](Start)(CCD){$L_1$}\lens[abspos=4](Start)(CCD){$L_2$}
+\optplate[abspos=6,platelinewidth=3\pslinewidth](Start)(CCD){SLM}
+\optplate[abspos=6.5,labelangle=180](Start)(CCD){PF}
+\polarization[abspos=6.7](Start)(CCD)\lens[abspos=7](Start)(CCD){$L_3$}
\end{pspicture}
\end{LTXexample}
@@ -1644,17 +1752,90 @@ incorporate this in a new released version.
\begin{LTXexample}[pos=t,vsep=8mm]
\begin{pspicture}(-4,-1)(3,3)
- \addtopsstyle{Beam}{linewidth=2\pslinewidth, linecolor=red!90!black}
- \psset{labeloffset=0.5}
- \pnode(-2,0){LaserOut}
- \pnode(0,0){Grat}
- \pnode(4;45){Out}
- \pnode(2.5;67.5){Mvar}
- \optbox[endbox, optboxwidth=2, labeloffset=0](Grat)(LaserOut){diode laser}
- \mirror[variable, conn=o-](Grid)(Mvar)(Grid){M$_\mathrm{var}$}
- \optgrid[beam](LaserOut)(Grat)(Out){grating}
- \optretplate[position=0.3, labeloffset=0.8](LaserOut)(Grat){$\nicefrac{\lambda}{4}$}
- \rput[l](-3,2){Littman setup}
+\addtopsstyle{Beam}{linewidth=2\pslinewidth, linecolor=red!90!black}
+\psset{labeloffset=0.5}
+\pnode(-2,0){LaserOut}\pnode(0,0){Grat}
+\pnode(4;45){Out}\pnode(2.5;67.5){Mvar}
+\optbox[optboxwidth=2,labeloffset=0, endbox](Grat)(LaserOut){diode laser}
+\mirror[variable,conn=o-](Grid)(Mvar)(Grid){M$_\mathrm{var}$}
+\optgrid[beam](LaserOut)(Grat)(Out){grating}
+\optretplate[position=0.3,labeloffset=0.8]%
+ (LaserOut)(Grat){$\nicefrac{\lambda}{4}$}
+\rput[l](-3,2){Littman setup}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[pos=t, vsep=8mm]
+\begin{pspicture}(8.5,1.6)
+ \addtopsstyle{Beam}{linecolor=green!90!black}
+ \pnode(1.6,1){Laser}\pnode(7.6,1){Diode}
+ \optbox[endbox,labeloffset=0](Diode)(Laser){Laser}%
+ \optbox[abspos=4, optboxwidth=1, optboxheight=0.6, labeloffset=1, compname=PC, conn=o-, angle=-10, rotateref=l, refractiveindex=2.3](Laser)(Diode){Photonic Crystal}
+ \optdetector[dettype=diode, conn=o-](PCInternN)(Diode|PCInternN){PD}
+ \defShiftedNode(PCIntern1)(2;170){Angle1}
+ \psline[linestyle=dashed](PCIntern1)(Angle1)
+ \psarc{<->}(PCIntern1){1.3}{330}{30}
+ \psarc[arcsep=1pt]{<->}(PCIntern1){2}{170}{180}
+ \uput{2.1}[175](PCIntern1){\small $\varphi$}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[pos=t, vsep=8mm]
+\begin{pspicture}(6.4,3.2)
+\addtopsstyle{Fiber}{linecolor=red}
+\pnode(2.3,2.3){Lin}\pnode([Xnodesep=0.5]Lin){Lout}
+\pnode([Xnodesep=1.5]Lout){EAMout}
+\pnode([Xnodesep=1.5]EAMout){Det}
+\optbox[fiber, labeloffset=-0.2, endbox, compname=L, extnode=b](Lout)(Lin){%
+ \psGauss[yunit=0.03,sigma=0.03]{-0.5}{0.5}}
+\optbox[fiber, labeloffset=0, optboxwidth=1, compname=EAM, extnode=b](Lout)(EAMout){EAM}
+\optfiber[labeloffset=0.3](EAMout)(Det){fibre}
+\optdetector(EAMout)(Det){OSA}
+\pnode([Xnodesep=-1,offset=-1]LExtNode){Osc}
+\pnode(LExtNode|Osc){PSin}\pnode(EAMExtNode|Osc){PSout}
+\oscillator[output=right](Osc){10\,GHz}{}
+\phaseshifter[labeloffset=-0.7](PSin)(PSout){$\tau$}
+\wire(LExtNode)(PSin)\wire(EAMExtNode)(PSout)
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[pos=t, vsep=8mm]
+\begin{pspicture}(0.9,0.9)(10.4,5.9)
+ \psset{arrowscale=1.5, arrowinset=0}
+ \addtopsstyle{Fiber}{linewidth=2\pslinewidth}
+ \pnode(2,5){PC1in}\pnode(4,5){PC1out}\pnode(6,5){PC2in}
+ \pnode(8,5){PC2out}\pnode(2,2){CplSig}\pnode(5,2){CplIn}
+ \pnode(2,1){CplOut}\pnode(10,4.5){Pump}\pnode(8,2){PumpSig}
+ \optisolator[compshift=0.8, addtoFiberIn={angleA=180}, addtoFiberOut={angleB=180}, labelref=relative, labeloffset=0.6](CplSig)(PC1in){isolator}
+ \polcontrol[addtoFiberIn={arrows=|-}](PC1in)(PC1out){}
+ \optfiberpolarizer[labeloffset=0.6](PC1out)(PC2in){polarizer}
+ \polcontrol[addtoFiberOut={arrows=-|}](PC2in)(PC2out){}
+ \wdmsplitter[labeloffset=0.3, align=bottom, addtoFiberIn={arrows=|-}, addtoFiberOut1={arrows=->}, addtoFiberOut2={arrows=-|}](CplIn)(CplOut)(CplSig){95/5}
+ \wdmcoupler[addtoFiberIn1={ArrowInside=->}, addtoFiberIn2={angleA=0}, addtoFiberOut={angleB=0,arrows=-|}, ncurv=0.9, align=bottom, compshift=0.8](Pump)(PC2out)(PumpSig){Pump}
+ \optbox[endbox,labeloffset=0,labelref=relative]([offset=-0.1]Pump)(Pump){980~nm}
+ \optfiber[fiberloops=2, labeloffset=0.4](CplIn)(PumpSig){Er$^+$-doped}
+\end{pspicture}
+\end{LTXexample}
+
+\begin{LTXexample}[pos=t, vsep=8mm]
+\makeatletter
+\def\LCLV@iii{%
+ \psframe[fillstyle=solid,fillcolor=black,dimen=outer](-0.12,-0.5)(0,0.5)
+ \psframe[fillstyle=solid,fillcolor=gray!50,dimen=outer](0,-0.5)(0.15,0.5)
+ \pnode(-0.12,0){\optexp@nodeA}\pnode(0.15,0){\optexp@nodeB}}
+\makeatother
+\begin{pspicture}(9,5)
+\newOptexpDipole{LCLV}{}\psset{lens=1.2 0 1}
+\pnode(2.4,1){BS1}\pnode([offset=3]BS1){M1}\pnode([Xnodesep=5.5]M1){PP}\pnode(PP|BS1){BS2}
+\LCLV[position=0.2, compname=LCLV](BS1)(BS2){LCLV}\beamsplitter[compname=BS](BS2)(BS1)(M1){BS}
+\optretplate(BS1)(M1){P}\mirror[conn=i-](BS1)(M1)(PP){M}\lens[position=0.2](M1)(PP){L}
+\pinhole(M1)(PP){}\lens[position=0.2](PP)(M1){L}\pentaprism[beam](M1)(PP)(BS2){PP}
+\beamsplitter(PP)(BS2)(BS1){BS}\lens(BS2)(BS1){L}
+\doveprism[compname=Dove,conn=i-,position=0.27](BS2)(BS1){D}
+\drawbeam[conn=b-b]{Dove}{LCLV}\drawbeam[conn=b-a]{BS}{LCLV}
+\psline[arrowscale=1.3, style=Beam]{->}(BS2)([offset=-1]BS2)
+\addtopsstyle{Beam}{arrowscale=1.3, ArrowInside=-<}
+\optbox[labeloffset=0, endbox, conn=o-](BS1)([Xnodesep=-1]BS1){Nd:YAG}
\end{pspicture}
\end{LTXexample}
@@ -1693,14 +1874,6 @@ incorporate this in a new released version.
\end{pspicture}
\end{LTXexample}
-\newpage
-
-The following schematic configuration of a recirculating loop was
-adapted from the publication N. Kikuchi, S. Sasaki and K. Sekine, `10
-Gbit/s dispersion-compensated transmission over 2245~km conventional
-fibres in a recirculating loop', Electron. Lett. 31 (\textbf{5}), 375
-(1995).
-
\psset{unit=0.8cm,labelstyle=\footnotesize}
\begin{LTXexample}[pos=t]
\begin{pspicture}(0.5,4)(13.2,10.5)
@@ -1737,38 +1910,25 @@ fibres in a recirculating loop', Electron. Lett. 31 (\textbf{5}), 375
\end{pspicture}
\end{LTXexample}
-\psset{unit=1cm}
-\begin{LTXexample}[pos=t, vsep=8mm]
-\begin{pspicture}(8.5,1.6)
- \addtopsstyle{Beam}{linecolor=green!90!black}
- \pnode(1.6,1){Laser}
- \pnode(7.6,1){Diode}
- \optbox[endbox,labeloffset=0](Diode)(Laser){Laser}%
- \optbox[abspos=4, optboxwidth=1, optboxheight=0.6, labeloffset=1, compname=PC, conn=o-, angle=-10, rotateref=l, refractiveindex=2.3](Laser)(Diode){Photonic Crystal}
- \optdetector[dettype=diode, conn=o-](PCInternN)(Diode|PCInternN){PD}
- \defShiftedNode(PCIntern1)(2;170){Angle1}
- \psline[linestyle=dashed](PCIntern1)(Angle1)
- \psarc{<->}(PCIntern1){1.3}{330}{30}
- \psarc[arcsep=1pt]{<->}(PCIntern1){2}{170}{180}
- \uput{2.1}[175](PCIntern1){\small $\varphi$}
-\end{pspicture}
-\end{LTXexample}
-
\section{Complete List of Parameters}
-\begin{longtable}{BTT}
+\begin{longtable}{TTT}
\toprule \multicolumn{1}{l}{parameter} & \multicolumn{1}{l}{allowed values} & \multicolumn{1}{l}{default}\\\midrule\endhead
\bottomrule\endfoot
abspos & <num> & \{\}\\
-addtoFiber\ldots & <parameter list> & \\
-newFiber\ldots & <parameter list> & \\
+addtoBeam & <psstyle> & \\
+addtoFiber* & <psstyle> & \\
+addtoOptComp & <psstyle> & \\
align & top|bottom|center & center\\
angle & <degree> & 0\\
beam & \multicolumn{2}{l}{alias for \parameter{conn=o-i}}\\
bssize & <num> & 0.8\\
+bsstyle & cube|plate & cube\\
caxisinv & <boolean> & false\\
caxislength & <num> & 0.6\\
compname & <string> & \{\}\\
+compshift & <num> & 0\\
conn & <conn definition> & -\\
+connjoin & <int> & 1\\
couplersep & <num> & 0.1\\
couplersize & <num> & 0.2\\
couplertype & none|elliptic & elliptic\\
@@ -1778,17 +1938,19 @@ detsize & <num> & 0.8\\
dettype & round|diode & round\\
doveprismsize & <num> & 0.6\\
endbox & <boolean> & false\\
-extnode & <ref string>& \{\}\\
+extnode & <ref string> & \{\}\\
fdlsize & <num> & 0.6\\
fiber & \multicolumn{2}{l}{alias for \parameter{conn=f-f}}\\
fibercolsize & <num> & 0.3\\
fiberloopradius & <num> & 0.4\\
fiberloops & <integer> & 3\\
fiberloopsep & <num> & 0.3\\
+fiberpolsize & <num> & 0.6\\
filtersize & <num> & 0.8\\
filtertype & bandpass|bandstop & bandpass\\
innerheight & <num> & 0.1\\
isolatorsize & <num> & 0.6\\
+label & <offset> <angle> <ref> <labelref> & \\
labelalign & <ref string> & c\\
labelangle & <num> & 0\\
labeloffset & <num> & 0.8\\
@@ -1807,6 +1969,9 @@ mirrorlinewidth & <num> & 2\cs{pslinewidth}\\
mirrorradius & <num> & 0\\
mirrortype & normal|piezo|extended & normal\\
mirrorwidth & <num> & 1\\
+newBeam & <psstyle> & \\
+newFiber* & <psstyle> & \\
+newOptComp & <psstyle> & \\
optampsize & <num> & 0.8\\
optboxheight & <num> & 0.8\\
optboxwidth & <num> & 1.4\\
@@ -1855,13 +2020,14 @@ voltage & <boolean> & false\\
\midrule
Beam & All automatic free-ray connections are drawn using this style\\
ExtendedMirror & Affects the additional part for \parameter{mirrortype=extended}\\
-Fiber & Parent style for all fiber connections. For a detailed discussion see Sec.~\ref{sec:styles}\\
+Fiber & Parent style for all fiber connections. For a detailed discussion see Sec.~\ref{sec:fiberstyles}\\
FiberIn & Left fiber style if only one connection to be drawn (inherits from \styleshape{Fiber})\\
FiberIn1 & Upper left connection (used for couplers only, inherits from \styleshape{FiberIn})\\
FiberIn2 & Lower left connection (used for couplers only, inherits from \styleshape{FiberIn})\\
FiberOut & Right fiber style if only one connection to be drawn (inherits from \styleshape{Fiber})\\
FiberOut1 & Upper right connection (used for couplers only, inherits from \styleshape{FiberOut})\\
FiberOut2 & Lower right connection (used for couplers only, inherits from \styleshape{FiberOut})\\
+OptComp & Affects only the appearance of optical components without changing connections that may be drawn inside the component \\
OptionalStyle & Used for objects with parameter \parameter{optional} set to \paramvalue{true}\\
PiezoMirror & Affects the additional part for \parameter{mirrortype=piezo}\\
\bottomrule
@@ -1870,8 +2036,8 @@ PiezoMirror & Affects the additional part for \parameter{mirrortype=piezo}\\
\section{Requirements}
-\texttt{pst-optexp} version 2.0 requires at least version 2.87 of
-\texttt{pstricks-add} and \LaTeX. It does not work with plain \TeX.
+\nxLPack{pst-optexp} version 2.1 requires at least version 2.87 of
+\nxLPack{pstricks-add} and \LaTeX. It does not work with plain \TeX.
\section{Todo}
diff --git a/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro b/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro
index 83cd176af12..2aff67a4521 100644
--- a/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro
+++ b/Master/texmf-dist/dvips/pst-optexp/pst-optexp.pro
@@ -1,6 +1,6 @@
%
% PostScript prologue for pst-optexp.tex.
-% version 0.2 2008-07-27 (cb)
+% version 0.3 2009-11-05 (cb)
% For distribution, see pstricks.tex.
%
/tx@OptexpDict 20 dict def
@@ -63,11 +63,17 @@ tx@OptexpDict begin
/Y@B exch def}if
} bind def
%
+% called with: R1 height
+% leaves on stack: a1
+/segLen {% def
+ dup mul neg exch abs dup 3 1 roll dup mul add sqrt sub
+} bind def
+%
% called with: height R1
% leaves on stack: y |R1| alpha_bottom alpha_top R1
/leftConvex {% def
/R1 exch def /h exch def
- /a1 R1 dup dup mul h dup mul sub sqrt sub def
+ /a1 R1 h segLen def
0 R1 abs
R1 a1 sub neg dup
h exch atan exch
@@ -80,7 +86,7 @@ tx@OptexpDict begin
% leaves on stack: y |R1| alpha_bottom alpha_top R1
/leftConcave {% def
/R1 exch def /h exch def
- /a1 R1 abs dup dup mul h dup mul sub sqrt sub def
+ /a1 R1 h segLen def
0 R1 abs
R1 neg a1 sub dup
h exch atan exch
@@ -94,7 +100,7 @@ tx@OptexpDict begin
% leaves on stack: y |R2| alpha_bottom alpha_top R2
/rightConvex {%def
/R2 exch def /h exch def
- /a2 R2 abs dup dup mul h dup mul sub sqrt sub def
+ /a2 R2 h segLen def
0 R2 abs
R2 a2 sub dup
h neg exch atan exch
@@ -107,7 +113,7 @@ tx@OptexpDict begin
% leaves on stack: y |R2| alpha_bottom alpha_top R2
/rightConcave {%def
/R2 exch def /h exch def
- /a2 R2 abs dup dup mul h dup mul sub sqrt sub def
+ /a2 R2 h segLen def
0 R2 abs
R2 a2 add dup
h neg exch atan exch
@@ -174,4 +180,18 @@ tx@OptexpDict begin
exch pop [ exch false GetInternalNodeNames ] { tx@NodeDict exch undef } forall
} { pop pop } ifelse
} bind def
+%
+% xa ya xb yb ExchCoor true|false
+/ExchCoor {% def
+ exch 4 -1 roll% ya yb xb xa
+ 2 copy % ya yb xb xa
+ gt
+ { pop pop pop pop false } % xB > xA
+ { eq % xA == xB
+ 3 1 roll gt % yA < yB
+ and
+ { false }
+ { true } ifelse
+ } ifelse
+} bind def
end % tx@OptexpDict
diff --git a/Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex b/Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex
index 2231aa412ad..03b23973d64 100644
--- a/Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex
+++ b/Master/texmf-dist/tex/generic/pst-optexp/pst-optexp.tex
@@ -26,8 +26,8 @@
\let\PSToptexpLoaded\endinput
%
%
-\def\fileversion{2.0}
-\def\filedate{2008/07/27}
+\def\fileversion{2.1}
+\def\filedate{2009/11/05}
\message{`pst-optexp' v\fileversion, \filedate\space (CB)}
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
@@ -36,12 +36,6 @@
\def\pst@optexpdict{tx@OptexpDict begin }
\SpecialCoor
%
-% We need pstricks-add >= 2.87 for the \psrotate macro version that
-% can handle Postscript code in the nodes
-\ifdim\pstricksaddfileversion pt<2.87pt
-\PackageError{pst-optexp}{^^JWe need a pstricks-add version >= 2.87, you have v\pstricksaddfileversion, please update!^^J}
-\fi
-%
%
% IF's
%
@@ -55,6 +49,10 @@
\newif\ifPOE@endbox
\newif\ifPOE@thicklens
\newif\ifPOE@usefiberstyle
+\newif\ifPOE@connjoin
+\newif\ifPOE@fiber@
+%
+\newdimen\optboxwidth
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
@@ -98,6 +96,8 @@
\edef\POS@optexp@extnode@postfix{ExtNode}
\edef\POS@detector@round{round}
\edef\POS@detector@diode{diode}
+\edef\POS@bs@cube{cube}
+\edef\POS@bs@plate{plate}
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% psstyles
@@ -108,7 +108,9 @@
hatchsep=1.4\POK@mirror@linewidth,%
fillstyle=hlines}%
\newpsstyle{PiezoMirror}{fillstyle=solid,fillcolor=black!30}%
-\newpsstyle{Beam}{linecolor=green!90!black}%
+\newpsstyle{Beam}{linecolor=green!90!black,linewidth=\pslinewidth}%
+\define@key[psset]{optexp}{newBeam}{\newpsstyle{Beam}{#1}}
+\define@key[psset]{optexp}{addtoBeam}{\addtopsstyle{Beam}{#1}}
%
\newpsstyle{Fiber}{}%
\define@key[psset]{optexp}{newFiber}{\newpsstyle{Fiber}{#1}}
@@ -138,6 +140,10 @@
\define@key[psset]{optexp}{newFiberOut2}{\newpsstyle{FiberOut2}{#1}}
\define@key[psset]{optexp}{addtoFiberOut2}{\addtopsstyle{FiberOut2}{#1}}
%
+\newpsstyle{OptComp}{}%
+\define@key[psset]{optexp}{newOptComp}{\newpsstyle{OptComp}{#1}}
+\define@key[psset]{optexp}{addtoOptComp}{\addtopsstyle{OptComp}{#1}}
+%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
@@ -156,6 +162,38 @@
\define@key[psset]{optexp}{labelstyle}{\def\POK@label@style{#1}}
\define@key[psset]{optexp}{labelalign}{\def\POK@label@align{#1}}
\define@key[psset]{optexp}{labelref}{\edef\POK@label@ref{#1}}
+\define@key[psset]{optexp}{label}{%
+ \pst@expandafter\psset@@label{#1} {} {} {} {} {}\@nil
+}%
+% offset angle align ref
+\def\psset@@label#1 #2 #3 #4 #5\@nil{%
+ \edef\@empty@dot{.}%
+ \edef\pst@temp{#4}%
+ \ifx\pst@temp\@empty\else
+ \ifx\pst@temp\@empty@dot\else
+ \psset{labelref=#4}
+ \fi
+ \fi
+ \edef\pst@temp{#3}
+ \ifx\pst@temp\@empty\else
+ \ifx\pst@temp\@empty@dot\else
+ \psset{labelalign=#3}
+ \fi
+ \fi
+ \edef\pst@temp{#2}%
+ \ifx\pst@temp\@empty\else
+ \ifx\pst@temp\@empty@dot\else
+ \psset{labelangle=#2}%
+ \fi
+ \fi
+ \edef\pst@temp{#1}%
+ \ifx\pst@temp\@empty\else
+ \ifx\pst@temp\@empty@dot\else
+ \psset{labeloffset=#1}
+ \fi
+ \fi
+}%
+\define@boolkey[psset]{optexp}[POE@label@]{innerlabel}[true]{}
% for internal use only
\define@key[psset]{optexp}{ref@angle}{\edef\POK@label@refangle{#1}}
% labelrelative is obsolete
@@ -243,6 +281,7 @@
%
% Beamsplitter
\define@key[psset]{optexp}{bssize}{\edef\POK@bssize{#1}}
+\define@key[psset]{optexp}{bsstyle}{\edef\POK@bsstyle{#1}}
\define@key[psset]{optexp}{bswidth}{%
\edef\POK@bssize{#1}%
\PackageWarning{pst-optexp}{bswidth is obsolete, use bssize instead}%
@@ -280,7 +319,10 @@
\define@boolkey[psset]{optexp}[POE@]{reverse}[true]{}
%
% Box
-\define@key[psset]{optexp}{optboxwidth}{\edef\POK@optbox@width{#1}}
+\define@key[psset]{optexp}{optboxwidth}{%
+ \pssetlength\optboxwidth{#1}%
+ \edef\POK@optbox@width{#1}%
+}
\define@key[psset]{optexp}{optboxheight}{\edef\POK@optbox@height{#1}}
\define@boolkey[psset]{optexp}[POE@]{endbox}[true]{}
\define@key[psset]{optexp}{refractiveindex}{\edef\POK@optbox@n{#1}}
@@ -357,6 +399,9 @@
% Isolator
\define@key[psset]{optexp}{isolatorsize}{\edef\POK@isolator@size{#1}}
%
+% Fiber polarizer
+\define@key[psset]{optexp}{fiberpolsize}{\edef\POK@fiberpol@size{#1}}
+%
% Optical switch
\define@key[psset]{optexp}{switchsize}{\edef\POK@switch@size{#1}}
\define@choicekey+[psset]{optexp}{switchstyle}[\val\nr]{opened,closed}%
@@ -377,6 +422,9 @@
{\PackageError{pst-optexp}{Unknown value '\val' for key couplertype}}
\define@key[psset]{optexp}{align}{\edef\POK@align{#1}}
%
+%
+\define@key[psset]{optexp}{compshift}{\edef\POK@comp@shift{#1}}
+%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Code for the extnode parameter (additional input node)
@@ -466,6 +514,17 @@
\fi
\fi
}%
+\define@key[psset]{optexp}{connjoin}{%
+ \edef\pst@temp{#1}%
+ \ifnum\pst@temp<0
+ \POE@connjoinfalse
+ \else\ifnum\pst@temp>2
+ \POE@connjoinfalse
+ \else
+ \POE@connjointrue
+ \edef\POK@connjoin{\pst@temp}
+ \fi\fi
+}%
\define@key[psset]{optexp}{conn}{%
\edef\pst@tempg{#1}%
\expandafter\psset@@conn\pst@tempg\@empty-\@empty\@nil
@@ -488,6 +547,7 @@
\def\psk@connOut{}%
% this is the conntable for the direct drawing of the connections
\def\pst@optexp@conntable{,o-o,i-i,f-f}%
+%
\def\psoe@cs@out@{}%
\def\psoe@cs@in@{}%
\def\psoe@cs@in@o{\psline[style=Beam](\POS@optexp@basicname@default A)(\optexp@nodeA)}%
@@ -537,6 +597,9 @@
\def\drawbeam@i#1#2{%
\def\pst@tempA{\pst@optexp@getfirstchar#1\@nil}%
\def\pst@tempB{\pst@optexp@getfirstchar#2\@nil}%
+ \ifPOE@connjoin
+ \psset{linejoin=\POK@connjoin}%
+ \fi
\begin@OpenObj%
\if(\pst@tempB
% second parameter is a node
@@ -592,8 +655,12 @@
\psset{conn=i-o}%
}
\define@choicekey[psset]{optexp}{fiber}[\val\nr]{}[]{%
- \psset{conn=f-f}%
+ \psset{conn=f-f, fiber@=true}%
}
+%
+% The fiber@ parameter is for internal use only to allow using \pscustom and connjoin
+% when drawing internal beams.
+\define@boolkey[psset]{optexp}[POE@]{fiber@}[true]{}
\def\optexp@nodeA{\POK@basicname 1}%
\def\optexp@nodeB{\POK@basicname N}%
\def\optexp@node#1{\POK@basicname #1}%
@@ -609,11 +676,6 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% Command analog to addbefore@par which is defined in pstricks.tex
-% addafter@par inserts new options at the _end_ of the current token register.
-% This can be useful to preset options that are not allowed to be changed by the
-% user.
-%
\def\pst@OptexpVerb#1{\pst@Verb{\pst@optexpdict #1 end }}%
\def\begin@OptexpObj{%
\define@key[psset]{optexp}{compname}{\psset{@compname=##1}}
@@ -621,12 +683,30 @@
\begingroup
\pst@OptexpVerb{InitOptexpComp}%
\use@par
+ % Usually the shift refers to the y-direction, shifting in x-direction
+ % is done by 'abspos' or 'position'
+ \let\POK@comp@Yshift\POK@comp@shift%
+ \def\POK@comp@Xshift{0}%
+}%
+\def\begin@OptexpMultipole{%
+ \begin@OptexpObj
+ % for multipoles the default shifting is in x-direction
+ \let\POK@comp@Xshift\POK@comp@shift%
+ \def\POK@comp@Yshift{0}%
}%
\def\end@OptexpObj{%
\pst@OptexpVerb{(\POS@optexp@basicname@default) (\POK@basicname) CloseOptexpComp}%
\endgroup
\ignorespaces%
}%
+\let\end@OptexpDipole\end@OptexpObj
+\let\end@OptexpMultipole\end@OptexpObj
+%
+% Command analog to addbefore@par which is defined in pstricks.tex
+% addafter@par inserts new options at the _end_ of the current token register.
+% This can be useful to preset options that are not allowed to be changed by the
+% user.
+%
\def\addafter@par#1{%
\ifx\pst@par\@empty
\def\pst@par{#1}%
@@ -664,6 +744,47 @@
\new@optexpdipole[fiber,#1]{#2}{#3}%
}%
%
+\def\draw@InternalConnections{%
+ \ifPOE@endbox
+ \@nameuse{\psk@connIn}
+ \else
+ \ifPOE@fiber@
+ \@nameuse{\psk@connIn}
+ \@nameuse{\psk@connOut}
+ \else
+ \ifPOE@connjoin
+ \def\tmp@A{psoe@cs@in@i}%
+ \ifx\tmp@A\psk@connIn
+ \def\tmp@B{psoe@cs@out@o}
+ \ifx\tmp@B\psk@connOut
+ \pscustom[style=Beam, linejoin=\POK@connjoin]{\@nameuse{\psk@connIn}\@nameuse{\psk@connOut}}%
+ \else\ifx\@empty\psk@connOut
+ \pscustom[style=Beam, linejoin=\POK@connjoin]{\@nameuse{\psk@connIn}\@nameuse{\psk@connOut}}%
+ \else
+ \@nameuse{\psk@connIn}\@nameuse{\psk@connOut}%
+ \fi\fi
+ \else
+ \def\tmp@A{psoe@cs@out@i}%
+ \ifx\tmp@A\psk@connOut
+ \def\tmp@B{psoe@cs@in@o}
+ \ifx\tmp@B\psk@connIn
+ \pscustom[style=Beam, linejoin=\POK@connjoin]{\@nameuse{\psk@connIn}\@nameuse{\psk@connOut}}%
+ \else\ifx\@empty\psk@connIn
+ \pscustom[style=Beam, linejoin=\POK@connjoin]{\@nameuse{\psk@connIn}\@nameuse{\psk@connOut}}%
+ \else
+ \@nameuse{\psk@connIn}\@nameuse{\psk@connOut}%
+ \fi\fi
+ \else
+ \@nameuse{\psk@connIn}\@nameuse{\psk@connOut}%
+ \fi
+ \fi
+ \else
+ \@nameuse{\psk@connIn}\@nameuse{\psk@connOut}%
+ \fi
+ \fi
+ \fi
+}%
+%
% Creates new macros ...@i and ...@ii which provide most code for the arrangement
% of the objects. A tempNode@Label is predefined as well as two internal nodes if compname is
% defined.
@@ -674,14 +795,12 @@
\expandafter\def\csname #2@i\endcsname(##1)(##2)##3{%
\addbefore@par{#3}%
\addafter@par{#1}%
+ \pst@regNodes{##1}{##2}
\begin@OptexpObj
- \pst@regNodes{##1}{##2}
+ \pst@adjustTempNodes
\pst@draw@component{##3}{\@nameuse{#2@ii}}
% connect
- \@nameuse{\psk@connIn}
- \ifPOE@endbox\else
- \@nameuse{\psk@connOut}
- \fi
+ \draw@InternalConnections
\end@OptexpObj
}%
\@namedef{#2@ii}{%
@@ -701,12 +820,12 @@
\expandafter\def\csname #2@i\endcsname(##1)(##2){%
\addbefore@par{#3}%
\addafter@par{#1}%
+ \pst@regNodes{##1}{##2}
\begin@OptexpObj
- \pst@regNodes{##1}{##2}
+ \pst@adjustTempNodes
\pst@draw@component{}{\@nameuse{#2@ii}}
- %
- \@nameuse{\psk@connIn}
- \@nameuse{\psk@connOut}
+ % connect
+ \draw@InternalConnections
\end@OptexpObj
}%
\@namedef{#2@ii}{%
@@ -726,8 +845,8 @@
\expandafter\def\csname #2@i\endcsname(##1)(##2)(##3)##4{%
\addbefore@par{#3}%
\addafter@par{ref@angle=180,#1}%
- \begin@OptexpObj
- \pst@calcNodes{##1}{##2}{##3}
+ \pst@calcNodes{##1}{##2}{##3}
+ \begin@OptexpMultipole
\pst@draw@component{##4}{\@nameuse{#2@ii}}
% adjust tempNode@A and tempNode@B for the connections
% \pnode(##1){tempNode@A}
@@ -745,9 +864,8 @@
10 {InitPnode } NewNode
end end
}%
- \@nameuse{\psk@connIn}%
- \@nameuse{\psk@connOut}%
- \end@OptexpObj
+ \draw@InternalConnections
+ \end@OptexpMultipole
}%
\@namedef{#2@ii}{%
\pnode(0,0){tempNode@Label}%
@@ -766,6 +884,7 @@
\expandafter\def\csname #2@i\endcsname(##1)(##2)(##3)(##4)##5{%
\addbefore@par{#3}%
\addafter@par{#1}%
+ %
\begin@OptexpObj
%
\ifx\POK@align\POS@optexp@top
@@ -812,7 +931,6 @@
\def\wdmsplitter{\pst@object{wdmsplitter}}%
\def\wdmsplitter@i(#1)(#2)(#3)#4{%
\begin@OptexpObj
- %
\pnode(#1){tempNode@A}
\ifx\POK@align\POS@optexp@top
\pnode(#2){tempNode@B}
@@ -825,12 +943,14 @@
\pst@tempB\pst@number\psyunit div exch \pst@number\psxunit div exch
\pst@optexpdict mwNode end){tempNode@B}
\fi\fi
- %
+ %
\pst@draw@component{#4}\wdmsplitter@ii
- %
- % connect the fibers
+ %
+ % default connection angles
\psset{angleA=! \pst@optexpdict FiberAngleA end,
angleB=! \pst@optexpdict FiberAngleB end}
+ %
+ % connect the fibers
\pccurve[style=FiberIn](#1)(tempNode@A@)
\pccurve[style=FiberOut1](tempNode@B@1)(#2)
\pccurve[style=FiberOut2](tempNode@B@2)(#3)
@@ -841,7 +961,6 @@
\def\wdmcoupler{\pst@object{wdmcoupler}}%
\def\wdmcoupler@i(#1)(#2)(#3)#4{%
\begin@OptexpObj
- %
\pnode(#3){tempNode@B}
\ifx\POK@align\POS@optexp@top
\pnode(#1){tempNode@A}
@@ -854,12 +973,14 @@
\pst@tempB\pst@number\psyunit div exch \pst@number\psxunit div exch
\pst@optexpdict mwNode end){tempNode@A}
\fi\fi
- %
+ %
\pst@draw@component{#4}\wdmcoupler@ii
- %
- % connect the fibers
+ %
+ % default connection angles
\psset{angleA=! \pst@optexpdict FiberAngleA end,
angleB=! \pst@optexpdict FiberAngleB end}
+ %
+ % connect the fibers
\pccurve[style=FiberOut](tempNode@B@)(#3)
\pccurve[style=FiberIn1](#1)(tempNode@A@1)
\pccurve[style=FiberIn2](#2)(tempNode@A@2)
@@ -890,6 +1011,8 @@
\pst@tempc \pst@number\psyunit div exch \pst@number\psxunit div exch
\pst@tempb \pst@number\psyunit div exch \pst@number\psxunit div exch
calcNodes
+ /ExchCoorSwitch
+ Y@A X@A neg Y@B X@B neg ExchCoor def
X@A Y@A end){tempNode@A}%
\pnode(! \pst@optexpdict X@B Y@B end){tempNode@B}%
}\ignorespaces}%
@@ -902,10 +1025,15 @@
\def\pst@regNodes#1#2{%
\pnode(#1){tempNode@A}
\pnode(#2){tempNode@B}
- \pst@Verb{tx@NodeDict begin N@tempNode@A GetCenter pop N@tempNode@B GetCenter pop end
- gt {/@xref \POK@xref\space neg def /@yref \POK@yref\space neg def}
- {/@xref \POK@xref\space def /@yref \POK@yref\space def} ifelse
- tx@OptexpDict /chirality known not {tx@OptexpDict begin /chirality 1 def end } if
+\ignorespaces}%
+\def\pst@adjustTempNodes{%
+ \pst@Verb{tx@NodeDict begin N@tempNode@A GetCenter N@tempNode@B GetCenter end
+ \pst@optexpdict ExchCoor dup end
+ {/@xref \POK@xref\space neg def /@yref \POK@yref\space neg def}
+ {/@xref \POK@xref\space def /@yref \POK@yref\space def} ifelse
+ \pst@optexpdict /ExchCoorSwitch ED end
+ tx@OptexpDict /chirality known not {\pst@optexpdict /chirality 1 def
+ end } if
}%
\ignorespaces}%
%
@@ -949,11 +1077,13 @@
% Place the component in argument #1 and define a new node 'tempNode@LabelShifted'
% for positioning of the label
\def\put@Comp#1{%
- #1%
- \pst@defShiftedRotLabelNode(0,\POK@label@offset)%
- {tempNode@Label}%
- {tempNode@LabelShifted}%
- {\POK@label@angle}%
+ \rput(\POK@comp@Xshift,\POK@comp@Yshift){%
+ #1%
+ \pst@defShiftedRotLabelNode(0,\POK@label@offset)%
+ {tempNode@Label}%
+ {tempNode@LabelShifted}%
+ {\POK@label@angle}%
+ }%
}%
%
% Positioning of the label depending on the reference coordinates.
@@ -1060,37 +1190,123 @@
%
\def\optdipole{\pst@object{optdipole}}
\def\optdipole@i(#1)(#2)#3#4{%
- \pst@killglue
- \begingroup
- \use@par
- \pst@regNodes{#1}{#2}
+ \pst@regNodes{#1}{#2}
+ \begin@OptexpObj
+ \pst@adjustTempNodes
\pst@draw@component{#4}{%
\pnode(0,0){tempNode@Label}%
\pnode(0,0){\optexp@nodeA}%
\pnode(0,0){\optexp@nodeB}%
#3
}%
- \@nameuse{\psk@connIn}
- \ifPOE@endbox\else
- \@nameuse{\psk@connOut}
- \fi
- \endgroup
+ \draw@InternalConnections
+ \end@OptexpObj
}%
\def\opttripole{\pst@object{opttripole}}
\def\opttripole@i(#1)(#2)(#3)#4#5{%
- \pst@killglue
- \begingroup
- \use@par
- \pst@calcNodes{#1}{#2}{#3}
+ \pst@calcNodes{#1}{#2}{#3}
+ \begin@OptexpMultipole
\pst@draw@component{#5}{%
\pnode(0,0){tempNode@Label}%
\pnode(0,0){\optexp@nodeA}%
\pnode(0,0){\optexp@nodeB}%
#4
}%
- \endgroup
+ % adjust tempNode@A and tempNode@B for the connections
+ % \pnode(##1){tempNode@A}
+ % \pnode(##3){tempNode@B}
+ % check if node must be switched, therefore we implement this
+ % directly as PS code
+ \pst@getcoor{#1}\pst@tempA%
+ \pst@getcoor{#3}\pst@tempB%
+ \pst@Verb{%
+ \pst@optexpdict
+ tx@NodeDict begin
+ {\pst@tempA } false chirality 0 le { /N@tempNode@B }{ /N@tempNode@A } ifelse
+ 10 {InitPnode } NewNode
+ {\pst@tempB } false chirality 0 le { /N@tempNode@A }{ /N@tempNode@B } ifelse
+ 10 {InitPnode } NewNode
+ end end
+ }%
+ \draw@InternalConnections
+ \end@OptexpMultipole
+}%
+\def\fibercollimator{\pst@object{fibercollimator}}
+\def\fibercollimator@i(#1)(#2){%
+ \addbefore@par{conn=o-f}
+ \def\pst@tempA{#1}%
+ \def\pst@tempB{#2}%
+ \def\pst@tempC{}%
+ \def\pst@tempD{}%
+ \pst@regNodes{\pst@tempA}{\pst@tempB}
+ \pst@adjustTempNodes
+ \@ifnextchar({\fibercollimator@ii}{\fibercollimator@iv}%
+}%
+%
+\def\fibercollimator@ii(#1){%
+ \def\pst@tempC{#1}%
+ \@ifnextchar({\fibercollimator@iii}{\fibercollimator@iv}%
}%
%
+\def\fibercollimator@iii(#1)#2{%
+ \def\pst@tempD{#1}%
+ \fibercollimator@iv{#2}%
+}
+\def\fibercollimator@iv#1{%
+ \begin@OptexpObj
+ \pst@draw@component{#1}{%
+ \pnode(0,0){tempNode@Label}%
+ \pnode(0,0){\optexp@nodeA}%
+ \pnode(0,0){\optexp@nodeB}%
+ \fibercollimator@v%
+ }%
+ \@nameuse{\psk@connIn}%
+ \ifx\@empty\pst@tempC
+ \@nameuse{\psk@connOut}%
+ \else\ifx\@empty\pst@tempD
+ \psbezier[style=FiberOut](\pst@tempC)(\pst@tempB)(\pst@tempB)(\optexp@nodeB)%
+ \else
+ \psbezier[style=FiberOut](\pst@tempD)(\pst@tempC)(\pst@tempB)(\optexp@nodeB)%
+ \fi\fi
+ \end@OptexpObj
+}%
+% \def\fibercollimator@i(#1)(#2){%
+% \addbefore@par{conn=o-f}
+% \def\pst@tempA{#1}%
+% \def\pst@tempB{#2}%
+% \@ifnextchar({\fibercollimator@ii}{\fibercollimator@iii}%
+% }%
+% %
+% \def\fibercollimator@ii(#1)#2{%
+% \pst@regNodes{\pst@tempA}{\pst@tempB}
+% \pst@adjustTempNodes
+% \begin@OptexpObj
+% \pst@draw@component{#2}{%
+% \pnode(0,0){tempNode@Label}%
+% \pnode(0,0){\optexp@nodeA}%
+% \pnode(0,0){\optexp@nodeB}%
+% \fibercollimator@iv%
+% }%
+% \@nameuse{\psk@connIn}%
+% \psbezier[style=FiberOut](#1)(\pst@tempB)(\pst@tempB)(\optexp@nodeB)%
+% \end@OptexpObj
+% }%
+% %
+% \def\fibercollimator@iii#1{%
+% \pst@regNodes{\pst@tempA}{\pst@tempB}
+% \begin@OptexpObj
+% \pst@adjustTempNodes
+% \pst@draw@component{#1}{%
+% \pnode(0,0){tempNode@Label}%
+% \pnode(0,0){\optexp@nodeA}%
+% \pnode(0,0){\optexp@nodeB}%
+% \fibercollimator@iv%
+% }%
+% \@nameuse{\psk@connIn}%
+% \@nameuse{\psk@connOut}%
+% \end@OptexpObj
+% }%
+%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
@@ -1101,14 +1317,11 @@
\newOptexpFiberDipole{optfilter}{}
\newOptexpFiberDipole{polcontrol}{}
\newOptexpFiberDipole{optisolator}{}
+\newOptexpFiberDipole{optfiberpolarizer}{}
\newOptexpFiberDipole{optswitch}{}
\newOptexpFiberDipole{fiberdelayline}{}
\newOptexpFiberQuadrupole{optcoupler}{}
%
-% HYBRID COMPONENTS
-\newOptexpDipole{fibercollimator}{conn=o-f}
-%
-%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% default settings
@@ -1134,6 +1347,7 @@
,innerheight=0.1
% beamsplitter
,bssize=0.8
+% ,bsstyle=cube
% crystal
,crystalwidth=1.4
,crystalheight=0.6
@@ -1203,6 +1417,7 @@
,filtertype=bandpass
,polcontrolsize=0.15
,isolatorsize=0.6
+ ,fiberpolsize=0.6
,couplersize=0.2
,couplersep=0.05
,couplertype=elliptic
@@ -1212,6 +1427,9 @@
,fibercolsize=0.3
,conn=-
,usefiberstyle=false
+ ,bsstyle=cube
+ ,compshift=0
+ ,connjoin=1
}%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
@@ -1241,10 +1459,12 @@
% Positioning of the component
%
\begingroup
+ %
+ \psset{style=OptComp}
%
% linestyle to use, if component should be marked as optional
\ifPOE@component@optional
- \psset{style=OptionalStyle}
+ \psset{style=OptionalStyle}%
\fi
% if parameter 'position' is given, use it for 'npos'
\ifx\POK@position\@empty
@@ -1261,7 +1481,16 @@
\endgroup
%
% Now put the label
- \put@Label{#1}%
+ \ifPOE@label@innerlabel
+ \ifdim\optboxwidth>0pt
+ \psset{labeloffset=0, labelref=relative}
+ \put@Label{\parbox{\optboxwidth}{#1}}%
+ \else
+ \put@Label{#1}%
+ \fi
+ \else
+ \put@Label{#1}%
+ \fi
%
% Show some special dots for debugging
\ifPOE@debug@showoptdots
@@ -1337,7 +1566,7 @@
\psarc[linewidth=0.8\pslinewidth,arrowinset=0,arrowscale=0.8]{<->}
(! \@m@wd 0.4 sub neg 0){0.6}{160}{200}
\fi
- \psline[linewidth=\POK@mirror@linewidth](! \@m@wd neg 0)(! \@m@wd 0)
+ \psline[linewidth=\POK@mirror@linewidth](! \@m@wd neg \getCLWH)(! \@m@wd \getCLWH)
%
% mirrortype
\ifx\POK@mirror@type\POS@mirror@type@piezo%
@@ -1372,19 +1601,34 @@
\ifx\POK@lens@type\@empty
% NEW CODE!
\begin@ClosedObj
+ \edef\@lens@newwd{0\space}%
\edef\@lens@wd{\POK@lens@width\space\pst@number\psxunit mul 2 div }%
- \edef\@lens@ht{\POK@lens@height\space\pst@number\psyunit mul 2 div }%
- \edef\@lens@rL{\POK@lens@radiusLeft\space\pst@number\psxunit mul }%
- \edef\@lens@rR{\POK@lens@radiusRight\space\pst@number\psxunit mul }%
- \edef\@lens@th{}%
- \addto@pscode{\pst@optexpdict}%
+ \edef\@lens@th{0}%
+ \addto@pscode{%
+ \pst@optexpdict
+ /@wd \POK@lens@width\space\pst@number\psxunit mul 2 div def
+ /@ht \POK@lens@height\space\pst@number\psyunit mul 2 div def
+ /@rL \POK@lens@radiusLeft\space\pst@number\psxunit mul def
+ /@rR \POK@lens@radiusRight\space\pst@number\psxunit mul def
+ /@th 0 def
+ }%
%
% distinguish between all the different lens-combination possibilities
%
\ifdim\POK@lens@radiusLeft pt=0pt\else
- \edef\@lens@th{\ifPOE@thicklens \@lens@wd\else a1 \fi}%
+ % this takes the /a1 definition from the leftC* procedures
+ % the macro is necessary for the outer nodes
+ \edef\@lens@newwd{%
+ \POK@lens@radiusLeft\space\POK@lens@height\space 2 div segLen
+ \ifdim\POK@lens@radiusLeft pt<0pt
+ 0.5 mul
+ \fi\space
+ }%
+ %
+ \edef\@lens@th{\ifPOE@thicklens \POK@lens@width\space 2 div \else \POK@lens@radiusLeft\space\POK@lens@height\space 2 div segLen \fi}%
\addto@pscode{%
- \@lens@ht \@lens@rL
+ /@th \ifPOE@thicklens @wd \else @rL @ht segLen \fi def
+ @ht @rL
\ifdim\POK@lens@radiusLeft pt<0pt
leftConcave
\else
@@ -1393,9 +1637,12 @@
}%
\fi
\ifdim\POK@lens@radiusRight pt=0pt\else
- \edef\@lens@th{\@lens@th\space\ifPOE@thicklens \@lens@wd\else a2 \fi}%
+ % this takes the /a1 definition from the rightC* procedures
+ % the macro is necessary for the outer nodes
+ \edef\@lens@th{\@lens@th\space\ifPOE@thicklens \POK@lens@width\space 2 div\else \POK@lens@radiusRight\space\POK@lens@height\space 2 div segLen \fi\space add}%
\addto@pscode{%
- \@lens@ht \@lens@rR
+ /@th @th \ifPOE@thicklens @wd \else @rR @ht segLen \fi add def
+ @ht @rR
\ifdim\POK@lens@radiusRight pt<0pt
rightConcave
\else
@@ -1410,14 +1657,11 @@
% \- right convex
\ifdim\POK@lens@radiusLeft pt=0pt
\ifdim\POK@lens@radiusRight pt=0pt\else
- \addto@pscode{\@lens@th 2 div sub neg 5 1 roll }%
- \ifdim\POK@lens@radiusRight pt<0pt
- \addto@pscode{%
- \@lens@th 2 div neg \@lens@ht neg moveto ArcR
- \@lens@th 2 div neg \@lens@ht lineto}%
- \else
- \addto@pscode{ArcR}%
- \fi
+ \addto@pscode{%
+ @th 2 div sub neg 5 1 roll
+ @th 2 div neg @ht neg moveto ArcR
+ @th 2 div neg @ht lineto
+ }%
\fi
\fi
%
@@ -1426,13 +1670,11 @@
% \- left convex
\ifdim\POK@lens@radiusRight pt=0pt
\ifdim\POK@lens@radiusLeft pt=0pt\else
- \addto@pscode{\@lens@th 2 div sub 5 1 roll }%
- \ifdim\POK@lens@radiusLeft pt<0pt
- \addto@pscode{\@lens@th 2 div \@lens@ht moveto ArcL
- \@lens@th 2 div \@lens@ht neg lineto }%
- \else
- \addto@pscode{ArcL }%
- \fi
+ \addto@pscode{%
+ @th 2 div sub 5 1 roll
+ @th 2 div @ht moveto ArcL
+ @th 2 div @ht neg lineto
+ }%
\fi
\fi
%
@@ -1440,14 +1682,17 @@
\ifdim\POK@lens@radiusRight pt=0pt\else
\ifdim\POK@lens@radiusLeft pt=0pt\else
\addto@pscode{%
- \@lens@th\space add 2 div dup
- 7 1 roll sub neg 5 1 roll
- ArcR sub 5 1 roll ArcL }%
+ @th 2 div dup
+ 7 1 roll sub neg 5 1 roll
+ ArcR sub 5 1 roll ArcL
+ }%
\fi
\fi
%
% now complete the object
\addto@pscode{closepath 1 setlinejoin end }%
+ \pnode(! \pst@optexpdict\space\@lens@th\space -2 div 0 end){\optexp@nodeA}
+ \pnode(! \pst@optexpdict\space\@lens@th\space 2 div 0 end){\optexp@nodeB}
\end@ClosedObj
%
% OLD CODE (compatibility)
@@ -1561,8 +1806,12 @@
%
\def\beamsplitter@iii{%
\edef\@bs@wd{\POK@bssize\space 2.0 div\space}%
- \psline{cc-cc}(! \@bs@wd neg 2 sqrt mul 0)(! \@bs@wd 2 sqrt mul 0)
- \rput[c]{45}(0,0){\psframe(! \@bs@wd neg \@bs@wd neg)(! \@bs@wd \@bs@wd)}
+ \ifx\POK@bsstyle\POS@bs@cube
+ \psline{cc-cc}(! \@bs@wd neg 2 sqrt mul 0)(! \@bs@wd 2 sqrt mul 0)
+ \rput[c]{45}(0,0){\psframe(! \@bs@wd neg \@bs@wd neg)(! \@bs@wd \@bs@wd)}
+ \else\ifx\POK@bsstyle\POS@bs@plate
+ \psline(! \@bs@wd neg 2 sqrt mul 0)(! \@bs@wd 2 sqrt mul 0)
+ \fi\fi
\ignorespaces}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -1685,7 +1934,7 @@
\edef\@g@step{\POK@optgrid@width\space\@g@cnt div\space}%
\ifx\POK@optgrid@type\POS@optgrid@type@blazed
\ifPOE@reverse%
- \pscustom[linewidth=\POK@optgrid@linewidth]{%
+ \pscustom[linewidth=\POK@optgrid@linewidth, linejoin=1]{%
\psline[liftpen=1](! \@g@wd \@g@dp)(! \@g@wd \@g@ht)%
(! \@g@wd neg \@g@ht)(! \@g@wd neg \@g@dp)
\multido{\i=0+1}{\POK@optgrid@count}{%
@@ -1696,7 +1945,7 @@
\closepath
}%
\else%
- \pscustom[linewidth=\POK@optgrid@linewidth]{%
+ \pscustom[linewidth=\POK@optgrid@linewidth, linejoin=1]{%
\psline[liftpen=1](! \@g@wd \@g@dp)(! \@g@wd \@g@ht)%
(! \@g@wd neg \@g@ht)(! \@g@wd neg \@g@dp)
\multido{\i=0+1}{\POK@optgrid@count}{%
@@ -1760,8 +2009,8 @@
%
\def\optplate@iii{%
\psline[linewidth=\POK@plate@linewidth]%
- (! 0 \POK@plate@height\space 2 div neg)%
- (! 0 \POK@plate@height\space 2 div)
+ (! \POK@plate@height\space 2 div \POK@angle\space 2 copy sin mul 3 1 roll cos mul neg)%
+ (! \POK@plate@height\space 2 div \POK@angle\space 2 copy sin mul neg 3 1 roll cos mul )%
\ignorespaces}%
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -2033,6 +2282,19 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
+% FIBER POLARIZER
+%
+\def\optfiberpolarizer@iii{%
+ \edef\@ht{\POK@fiberpol@size\space 2 div\space}%
+ \edef\@wd{\POK@fiberpol@size\space 0.8 mul\space}%
+ \psframe[dimen=outer](! \@wd neg \@ht neg)(! \@wd \@ht)
+ \psline(! \@wd neg 0.2 mul \@ht neg)(!\@wd 0.2 mul \@ht)
+ \pnode(! \@wd neg 0){\optexp@nodeA}
+ \pnode(! \@wd 0){\optexp@nodeB}
+\ignorespaces}%
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
% SWITCH
%
\def\optswitch@iii{%
@@ -2049,8 +2311,8 @@
\ifPOE@usefiberstyle
\psset{style=Fiber}
\fi
- \psline(! @@x neg 0)(! @@x -0.6 mul @lw sub 0)%
- \psline(! @@x 0.6 mul 0)(! @@x 0)%
+ \psline[arrows=-](! @@x neg 0)(! @@x -0.6 mul @lw sub 0)%
+ \psline[arrows=-](! @@x 0.6 mul 0)(! @@x 0)%
\egroup
% different styles
\ifx\POK@switch@style\POS@optexp@closed%
@@ -2181,7 +2443,7 @@
%
% FIBER COLLIMATOR
%
-\def\fibercollimator@iii{%
+\def\fibercollimator@v{%
\def\@sz{\POK@fibercol@size\space 0.5 mul\space}%
\pspolygon(! \@sz neg \getCLWH add \@sz neg)(!\@sz 0)(!\@sz neg \getCLWH add \@sz)
\pnode(!\@sz neg 0){\optexp@nodeA}
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 b7cfc0a1071..b4662177d39 100644
--- a/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
+++ b/Master/texmf-dist/tex/latex/pst-optexp/pst-optexp.sty
@@ -1,13 +1,11 @@
-\ProvidesPackage{pst-optexp}[2008/06/25 package wrapper for
+\ProvidesPackage{pst-optexp}[2009/11/05 package wrapper for
pst-optexp.tex]
\RequirePackage{pstricks}
\RequirePackage{pst-xkey}
\RequirePackage{pst-node}
\RequirePackage{pst-plot}
\RequirePackage{multido}
-%
\RequirePackage{pstricks-add}
-\let\pstricksaddfileversion\fileversion
%
%
\input{pst-optexp.tex}