%%
%% This is file `pst-fr3d.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pst-fr3d.dtx  (with options: `pst-fr3d')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from pst-fr3d.tex.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file pst-fr3d.dtx.
%% 
%% This generated file may be distributed as long as the
%% original source files, as listed above, are part of the
%% same distribution. (The sources need not necessarily be
%% in the same archive or directory.)
%%
%% Package `pst-fr3d.dtx'
%%
%% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr>
%%
%% February 25, 2002
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
%%
%% DESCRIPTION:
%%   `pst-fr3d' is a PSTricks package to draw three dimensional grids
%%   with various customizations.
%%
\csname PstFrameBoxThreeDLoaded\endcsname
\let\PstFrameBoxThreeDLoaded\endinput
\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi
\edef\PstAtCode{\the\catcode`\@}
\catcode`\@=11\relax
\pst@addfams{pst-fr3d}
\def\fileversion{1.01}
\def\filedate{2004/11/14}
\message{`Pst-FrameBox3d' v\fileversion, \filedate\space (Denis Girou)}
\newif\ifPstFrameBoxThreeD@On
\define@key[psset]{pst-fr3d}{FrameBoxThreeDOn}[true]{\@nameuse{PstFrameBoxThreeD@On#1}}
\newif\ifPstFrameBoxThreeD@Opposite
\define@key[psset]{pst-fr3d}{FrameBoxThreeDOpposite}[true]{%
\@nameuse{PstFrameBoxThreeD@Opposite#1}}
\define@key[psset]{pst-fr3d}{FrameBoxThreeDColorHSB}{%
\PstFrameBoxThreeD@ColorHSB@i#1\@nil}
\def\PstFrameBoxThreeD@ColorHSB@i#1\@nil{%
\pst@expandafter\pst@getnumiii{#1} {} {} {} {}\@nil
\edef\PstFrameBoxThreeD@Hue{\pst@tempg}%
\edef\PstFrameBoxThreeD@Saturation{\pst@temph}%
\edef\PstFrameBoxThreeD@Brightness{\pst@tempi}}
\define@key[psset]{pst-fr3d}{FrameBoxThreeDBrightnessDistance}{%
\edef\PstFrameBoxThreeD@BrightnessDistance{#1}}
\psset{%
  FrameBoxThreeDOn=true,FrameBoxThreeDOpposite=false,
  FrameBoxThreeDColorHSB=0 0 0.5,FrameBoxThreeDBrightnessDistance=0.15}%
\def\PstFrameBoxThreeD{%
\@ifnextchar[{\PstFrameBoxThreeD@i}{\PstFrameBoxThreeD@i[]}}
\def\PstFrameBoxThreeD@i[#1]#2{{%
\psset{dimen=middle}%
\psset{#1}%
\ifdim\PstFrameBoxThreeD@Brightness\p@<\z@%
  \def\PstFrameBoxThreeD@FillStyle{none}%
  \def\pst@tempa{0.5}%
\else
  \def\PstFrameBoxThreeD@FillStyle{solid}%
  \def\pst@tempa{\PstFrameBoxThreeD@Brightness}%
\fi
\pst@dimh=\pst@tempa\p@
\advance\pst@dimh\PstFrameBoxThreeD@BrightnessDistance\p@
\pst@dimtonum{\pst@dimh}{\pst@tempb}%
\advance\pst@dimh-\PstFrameBoxThreeD@BrightnessDistance\p@
\advance\pst@dimh-\PstFrameBoxThreeD@BrightnessDistance\p@
\pst@dimtonum{\pst@dimh}{\pst@tempc}%
\ifx\definecolor\@undefined
  \newhsbcolor{PstFrameBoxThreeD@ColorC}{%
    \PstFrameBoxThreeD@Hue \PstFrameBoxThreeD@Saturation \pst@tempa}%
  \ifPstFrameBoxThreeD@On
    \newhsbcolor{PstFrameBoxThreeD@ColorA}{%
      \PstFrameBoxThreeD@Hue \PstFrameBoxThreeD@Saturation \pst@tempc}%
    \newhsbcolor{PstFrameBoxThreeD@ColorB}{%
      \PstFrameBoxThreeD@Hue \PstFrameBoxThreeD@Saturation \pst@tempb}%
  \else
    \newhsbcolor{PstFrameBoxThreeD@ColorA}{%
      \PstFrameBoxThreeD@Hue \PstFrameBoxThreeD@Saturation \pst@tempb}%
    \newhsbcolor{PstFrameBoxThreeD@ColorB}{%
      \PstFrameBoxThreeD@Hue \PstFrameBoxThreeD@Saturation \pst@tempc}%
  \fi
\else
  \definecolor{PstFrameBoxThreeD@ColorC}{hsb}{%
    \PstFrameBoxThreeD@Hue,\PstFrameBoxThreeD@Saturation,\pst@tempa}%
  \ifPstFrameBoxThreeD@On
    \definecolor{PstFrameBoxThreeD@ColorA}{hsb}{%
      \PstFrameBoxThreeD@Hue,\PstFrameBoxThreeD@Saturation,\pst@tempc}%
    \definecolor{PstFrameBoxThreeD@ColorB}{hsb}{%
      \PstFrameBoxThreeD@Hue,\PstFrameBoxThreeD@Saturation,\pst@tempb}%
  \else
    \definecolor{PstFrameBoxThreeD@ColorA}{hsb}{%
      \PstFrameBoxThreeD@Hue,\PstFrameBoxThreeD@Saturation,\pst@tempb}%
    \definecolor{PstFrameBoxThreeD@ColorB}{hsb}{%
      \PstFrameBoxThreeD@Hue,\PstFrameBoxThreeD@Saturation,\pst@tempc}%
  \fi
\fi
\psset{linestyle=none}%
\psframebox[fillstyle=\PstFrameBoxThreeD@FillStyle,
            fillcolor=PstFrameBoxThreeD@ColorC,doubleline=true]{#2}%
\setbox\pst@boxg=\hbox{\psframebox{#2}}%
\setbox\pst@hbox=\hbox{\psframebox[doubleline=true]{#2}}%
\pst@dima=\wd\pst@hbox
\advance\pst@dima-\wd\pst@boxg
\divide\pst@dima\tw@
\pst@dimb=\pst@dima
\advance\pst@dima\wd\pst@boxg
\psset{fillstyle=solid}%
\pspolygon[fillcolor=PstFrameBoxThreeD@ColorA]
          (-\wd\pst@hbox,-\dp\pst@hbox)(-\pst@dima,-\dp\pst@boxg)
          (-\pst@dima,\ht\pst@boxg)(-\wd\pst@hbox,\ht\pst@hbox)
\pspolygon[fillcolor=PstFrameBoxThreeD@ColorB]
          (-\wd\pst@hbox,\ht\pst@hbox)(-\pst@dima,\ht\pst@boxg)
          (-\pst@dimb,\ht\pst@boxg)(0,\ht\pst@hbox)
\ifPstFrameBoxThreeD@Opposite
  \def\pst@tempa{PstFrameBoxThreeD@ColorA}%
  \def\pst@tempb{PstFrameBoxThreeD@ColorB}%
\else
  \def\pst@tempa{PstFrameBoxThreeD@ColorB}%
  \def\pst@tempb{PstFrameBoxThreeD@ColorA}%
\fi
\pspolygon[fillcolor=\pst@tempa]
          (0,-\dp\pst@hbox)(-\pst@dimb,-\dp\pst@boxg)
          (-\pst@dimb,\ht\pst@boxg)(0,\ht\pst@hbox)
\pspolygon[fillcolor=\pst@tempb]
          (-\wd\pst@hbox,-\dp\pst@hbox)(-\pst@dima,-\dp\pst@boxg)
          (-\pst@dimb,-\dp\pst@boxg)(0,-\dp\pst@hbox)
\ifPstFrameBoxThreeD@Opposite
\else
  \psset{linestyle=solid,linewidth=0.2pt,arrows=cc-cc}%
  \psline[linecolor=PstFrameBoxThreeD@ColorA]
         (-\pst@dimb,\ht\pst@boxg)(0,\ht\pst@hbox)
  \psline[linecolor=PstFrameBoxThreeD@ColorB]
         (-\wd\pst@hbox,-\dp\pst@hbox)(-\pst@dima,-\dp\pst@boxg)
\fi}}
\catcode`\@=\PstAtCode\relax
\endinput
%%
%% End of file `pst-fr3d.tex'.
