%%
%% This is file `pst-gr3d.tex',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% pst-gr3d.dtx  (with options: `pst-gr3d')
%% 
%% IMPORTANT NOTICE:
%% 
%% For the copyright see the source file.
%% 
%% Any modified versions of this file must be renamed
%% with new filenames distinct from pst-gr3d.tex.
%% 
%% For distribution of the original source see the terms
%% for copying and modification in the file pst-gr3d.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-gr3d.dtx'
%%
%% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr>
%%
%% February 19, 2001
%%
%% 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-gr3d' is a PSTricks package to draw three dimensional grids
%%   with various customization
%%
\def\fileversion{1.33}
\def\filedate{2005/01/14}
\message{`PST-Grid3d' v\fileversion, \filedate\space (Denis Girou)}
\csname PSTGridThreeDLoaded\endcsname
\let\PSTGridThreeDLoaded\endinput
\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
\ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi
\ifx\PSTthreeDLoaded\endinput\else\input pst-3d.tex\fi
\ifx\MultidoLoaded\endinput\else\input multido.tex\fi
\input pst-key.tex
\edef\PstAtCode{\the\catcode`\@}
\catcode`\@=11\relax
%% change Pst@Debug to prevent a clash with pst-fill
%% which has the same option. Now pstricks defines Pst@Debug
%%\def\psset@PstDebug#1{\pst@getint{#1}{\Pst@Debug}}
%% end hv 2004-06-22
\newif\ifPst@PstPicture
\define@key{psset}{PstPicture}[true]{\@nameuse{Pst@PstPicture#1}}
\newif\ifPstGridThreeD@Nodes
\define@key{psset}{GridThreeDNodes}[true]{\@nameuse{PstGridThreeD@Nodes#1}}
\define@key{psset}{GridThreeDXUnit}{\pst@getint{#1}{\PstGridThreeD@XUnit}}
\define@key{psset}{GridThreeDYUnit}{\pst@getint{#1}{\PstGridThreeD@YUnit}}
\define@key{psset}{GridThreeDZUnit}{\pst@getint{#1}{\PstGridThreeD@ZUnit}}
\define@key{psset}{GridThreeDXPos}{\pst@getint{#1}{\PstGridThreeD@XPos}}
\define@key{psset}{GridThreeDYPos}{\pst@getint{#1}{\PstGridThreeD@YPos}}
\define@key{psset}{GridThreeDZPos}{\pst@getint{#1}{\PstGridThreeD@ZPos}}
\def\psset@Rx#1{\psset@XnodesepA{#1}}
\def\psset@Ry#1{\psset@offsetA{#1}}
\psset@viewpoint{1.2 -0.6 0.8}
\setkeys{psset}{%
PstDebug=0,PstPicture=true,GridThreeDNodes=false,
GridThreeDXPos=0,GridThreeDYPos=0,GridThreeDZPos=0,
GridThreeDXUnit=1,GridThreeDYUnit=1,GridThreeDZUnit=1}
\def\PstGridThreeD{\@ifnextchar[{\PstGridThreeD@i}{\PstGridThreeD@i[]}}
\def\PstGridThreeD@i[#1](#2,#3,#4){{%
\psset{dimen=middle}%
\setkeys{psset}{#1}%
\pst@cnth=#2
\multiply\pst@cnth\PstGridThreeD@XUnit
\divide\pst@cnth\tw@
\ifodd\pst@cnth
  \edef\PstGridThreeD@PictureYmin{-\the\pst@cnth}%
\else
  \edef\PstGridThreeD@PictureYmin{-\the\pst@cnth.5}%
\fi
\pst@cntg=#3
\multiply\pst@cntg\PstGridThreeD@YUnit
\pst@cnth=#2
\divide\pst@cnth\tw@
\multiply\pst@cnth\PstGridThreeD@XUnit
\advance\pst@cntg\pst@cnth
\pst@cnth=#3
\advance\pst@cnth\m@ne
\multiply\pst@cnth\PstGridThreeD@YUnit
\divide\pst@cnth\tw@
\pst@cntd=#4
\multiply\pst@cntd\PstGridThreeD@ZUnit
\advance\pst@cntd\pst@cnth
\ifnum\pst@cnth=\z@
  \edef\PstGridThreeD@PictureYmax{\the\pst@cntd.5}%
\else
  \edef\PstGridThreeD@PictureYmax{\the\pst@cntd}%
\fi
\ifPst@PstPicture
  \ifnum\Pst@Debug=\@ne
    \psframebox[framesep=0]{%
  \fi
  \pspicture(0,\PstGridThreeD@PictureYmin)
            (\the\pst@cntg,\PstGridThreeD@PictureYmax)
\fi
\pst@cntd=\PstGridThreeD@XPos
\multiply\pst@cntd\PstGridThreeD@XUnit
\pst@cntg=\PstGridThreeD@YPos
\multiply\pst@cntg\PstGridThreeD@YUnit
\pst@cnth=\PstGridThreeD@ZPos
\multiply\pst@cnth\PstGridThreeD@ZUnit
\ifx\PstGridThreeDHookZFace\empty
\else
  \pst@cntc=#4
  \advance\pst@cntc\@ne
  \multido{\iz=#4+-\PstGridThreeD@ZUnit}{\pst@cntc}{% Z face hook
    \ThreeDput[normal=0 0 1](\pst@cntd,\pst@cntg,\iz){\PstGridThreeDHookZFace}}
\fi
\pst@cntc=#2
\advance\pst@cntc\@ne
\multido{\ix=\pst@cntd+\PstGridThreeD@XUnit}{\pst@cntc}{%
  \ThreeDput[normal=1 0 0](\ix,\pst@cntg,\pst@cnth){%
    \PstGridThreeDHookXFace
    \psgrid[xunit=\PstGridThreeD@YUnit,yunit=\PstGridThreeD@ZUnit,
            subgriddiv=0,gridlabels=0](#3,#4)}}
\pst@cnta=#3
\multiply\pst@cnta\PstGridThreeD@YUnit
\advance\pst@cnta\pst@cntg
\pst@cntc=#3
\advance\pst@cntc\@ne
\multido{\iy=\pst@cnta+-\PstGridThreeD@YUnit}{\pst@cntc}{%
  \ThreeDput[normal=0 1 0](\pst@cntd,\iy,\pst@cnth){%
    \PstGridThreeDYFace{#2}{#4}{\iy}}}
\PstGridThreeD@HookEnd
\ifPst@PstPicture
  \endpspicture
  \ifnum\Pst@Debug=\@ne
}
  \fi
\fi}}
\def\PstGridThreeDYFace#1#2#3{%
\PstGridThreeDHookYFace%
\psgrid[xunit=\PstGridThreeD@XUnit,yunit=\PstGridThreeD@ZUnit,
        subgriddiv=0,gridlabels=0](-#1,#2)
\pst@cnta=#1
\advance\pst@cnta\@ne
\pst@cntb=#2
\advance\pst@cntb\@ne
\pst@cntg=#3
\multido{\ia=0+-\PstGridThreeD@XUnit}{\pst@cnta}{%
  \pst@cntc=\multidocount
  \advance\pst@cntc\m@ne
  \multido{\ib=0+\PstGridThreeD@ZUnit}{\pst@cntb}{%
    \ifPstGridThreeD@Nodes
      \pst@cntd=\multidocount
      \advance\pst@cntd\m@ne
      \pnode(\ia,\ib){Gr3dNode\the\pst@cntc\the\pst@cntg\the\pst@cntd}
    \fi
    \ifx\PstGridThreeDHookNode\empty
    \else
      \rput(\ia,\ib){\PstGridThreeDHookNode}
    \fi}}}
\def\PstGridThreeDHookNode{}
\def\PstGridThreeDHookXFace{}
\def\PstGridThreeDHookYFace{}
\def\PstGridThreeDHookZFace{}
\def\PstGridThreeDHookEnd{}
\def\PstGridThreeD@HookEnd{%
\def\PstGridThreeD@HookEnd{}%
\PstGridThreeDHookEnd}
\def\PstGridThreeDNodeProcessor#1{{%
\psset{unit=0.3}
\pspicture(-0.5,-0.5)(0.5,0.5)
  \pscircle*[linecolor=#1]{0.5}
  \pscircle*[linecolor=white]{0.2}
\endpspicture}}
\catcode`\@=\PstAtCode\relax
\endinput
%%
%% End of file `pst-gr3d.tex'.
