summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-fr3d/pst-fr3d.tex
blob: cac3278b2ccec9a01c7c6515c8f1cae61f2931ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
%%
%% 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'.