%%              Manuel LUQUE <Mluque5130@aol.com>
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\def\fileversion{1.0}
\def\filedate{2000/07/03}

\message{`PST-R3D' v\fileversion, \filedate}

\csname PSTRtroisD\endcsname
\let\PSTRtroisDLoaded\endinput

% Require PSTricks
\ifx\PSTricksLoaded\endinput\else
  \def\next{\input pstricks.tex}
  \expandafter\next
\fi

\edef\TheAtCode{\the\catcode`\@} \catcode`\@=11
\let\pssetzlength\pssetylength
\def\psset@normale#1{%
  \pst@expandafter\psset@@normale#1 {} {} \@nil
  \let\psk@normale\pst@tempg}
\def\psset@@normale#1 #2 #3\@nil{%
  \begingroup
     \xdef\pst@tempg{%
      #1 #2 }%
  \endgroup}
\psset@normale{30 45}

\def\psset@fuyante#1{\pst@getangle{#1}\psk@fuyante}
\psset@fuyante{45}
\def\psset@reduction#1{\pst@getangle{#1}\psk@reduction}
\psset@reduction{1}

\newif\ifPlanSol
\def\psset@PlanSol#1{%
\@nameuse{@pst#1}%
\if@pst
\pst@def{SetMatrixEmbed}<%
  dup sin /S2 ED cos /C2  ED
  dup sin /S1 ED cos /C1  ED
  dup sin /S3 ED cos /C3  ED
  /Reduction ED
 /Z0 ED /Y0 ED /X0 ED
  [
  C1
  S1 % neg
  S2 S1 mul C2 S3 mul Reduction mul add neg
  S2 C1 mul C2 C3 mul Reduction mul add % neg
  Y0 Z0 S3 mul Reduction mul sub
  X0 Z0 C3 mul Reduction mul sub neg
  ]
 concat
   >%
\else
\pst@def{SetMatrixEmbed}<%
  dup sin /S2 ED cos /C2  ED
  dup sin /S1 ED cos /C1  ED
  dup sin /S3 ED cos /C3  ED
  /Reduction ED
 /Z0 ED /Y0 ED /X0 ED
  [C1 S1 C3 mul Reduction mul add
  S1 S3 Reduction mul mul
  S2 S1 mul neg S2 C1 mul C3 mul Reduction mul add
  C2 S2 C1 mul S3 mul Reduction mul add
  Y0 X0 C3 mul Reduction mul sub
  Z0 X0 S3 mul Reduction mul sub
  ] concat
   >%
\fi}
\psset@PlanSol{false}

\pst@def{TMSave}<%
  tx@Dict /TMatrix known not { /TMatrix { } def /RAngle { 0 } def } if
  /TMatrix [ TMatrix CM ] cvx def>
\pst@def{TMRestore}<%
  CP /TMatrix [ TMatrix setmatrix ] cvx def moveto>
\pst@def{TMChange}<%
  \tx@TMSave
  /cp [ currentpoint ] cvx def % ??? Check this later.
  CM
  CP T \tx@STV
  CM matrix invertmatrix    % Inv(M')
  matrix concatmatrix       % M Inv(M')
  exch
  exec
  concat
  cp moveto>

\let\pssetzlength\pssetylength
\def\perspective{\def\pst@par{}\pst@object{perspective}}
\def\perspective@i{\@ifnextchar({\perspective@ii}{\perspective@ii(\z@,\z@,\z@)}}
\def\perspective@ii(#1,#2,#3){%
  \pst@killglue\pst@makebox{\perspective@iii(#1,#2,#3)}}
\def\perspective@iii(#1,#2,#3){%
  \begingroup
    \use@par
    \if@star\pst@starbox\fi
    \pst@makesmall\pst@hbox
    \pssetxlength\pst@dima{#1}%
    \pssetylength\pst@dimb{#2}%
    \pssetzlength\pst@dimc{#3}%
    \leavevmode
    \hbox{%
      \pst@Verb{%
      { \pst@number\pst@dima
      \pst@number\pst@dimb
      \pst@number\pst@dimc
      \psk@reduction
      \psk@fuyante
      \psk@normale
      \tx@SetMatrixEmbed
      } \tx@TMChange}%
    \box\pst@hbox
    \pst@Verb{\tx@TMRestore}}%
  \endgroup
  \ignorespaces}

\catcode`\@=\TheAtCode\relax
\endinput
