summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/generic/pst-fr3d/pst-fr3d.dtx
blob: 346c207efc53754b4b24fd26457fc13e368a30b4 (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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
% \iffalse meta-comment, etc.
%%
%% 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.
%%
% \fi
%
% \DoNotIndex{\\,\^,\@}
% \DoNotIndex{\@ifnextchar,\@nameuse,\@nil,\@undefined}
% \DoNotIndex{\advance}
% \DoNotIndex{\begin}
% \DoNotIndex{\catcode,\CodelineIndex,\csname}
% \DoNotIndex{\def,\define@key,\definecolor,\divide,\DocInput}
% \DoNotIndex{\documentclass,\dp}
% \DoNotIndex{\edef,\else,\EnableCrossrefs,\end,\endcsname,\endinput}
% \DoNotIndex{\endpspicture}
% \DoNotIndex{\fi,\filedate,\fileversion}
% \DoNotIndex{\GetFileInfo}
% \DoNotIndex{\hbadness,\hbox,\hfuzz,\ht}
% \DoNotIndex{\ifdim,\ifx,\input}
% \DoNotIndex{\let}
% \DoNotIndex{\message}
% \DoNotIndex{\newhsbcolor,\newif}
% \DoNotIndex{\OnlyDescription}
% \DoNotIndex{\p@,\ProvidesPackage,\psframebox,\psframesep}
% \DoNotIndex{\psline,\pslinewidth,\pspolygon,\psset,\PstAtCode,\pst@boxg}
% \DoNotIndex{\pst@dima,\pst@dimb,\pst@dimc,\pst@dimd,\pst@dimh}
% \DoNotIndex{\pst@dimtonum,\pst@expandafter,\pst@getnumiii,\pst@hbox}
% \DoNotIndex{\pst@tempa,\pst@tempb,\pst@tempc,\pst@tempg,\pst@temph}
% \DoNotIndex{\pst@tempi,\PSTricksLoaded}
% \DoNotIndex{\RecordChanges,\relax}
% \DoNotIndex{\setbox,\setkeys,\space}
% \DoNotIndex{\the,\tw@}
% \DoNotIndex{\usepackage}
% \DoNotIndex{\wd}
% \DoNotIndex{\z@}
%
% \setcounter{IndexColumns}{2}
%
% \newcommand{\PstFrameBoxThreeDPackage}{`\textsf{pst-fr3d}'}
% \newcommand{\PstFrameBoxThreeDMacro}{\cs{PstFrameBoxThreeD}}
% \newcommand{\ColorPackage}{`\textsf{color}'}
% \newcommand{\PstColPackage}{`\textsf{pstricks}'}
%
% ^^A From ltugboat.cls
%
% ^^A Typeset the name of an environment
% \providecommand\env[1]{\textsf{#1}}
% \providecommand\clsname[1]{\textsf{#1}}
% \providecommand\pkgname[1]{\textsf{#1}}
% \providecommand\optname[1]{\textsf{#1}}
% \providecommand\progname[1]{\textsf{#1}}
%
% ^^A A list of options for a package/class
% \newenvironment{optlist}{\begin{description}%
%   \renewcommand\makelabel[1]{%
%     \descriptionlabel{\mdseries\optname{##1}}}%
%   \itemsep0.25\itemsep}%
%  {\end{description}}
%
% ^^A Utility macros
%
%
% ^^A Example macros - adapted from the `fvrb-ex' package
% ^^A ---------------------------------------------------
%
% ^^A Take care that we use here the four /?_W characters as escape
% ^^A characters, so we can't use these characters in the examples!
%
% \makeatletter
%
% ^^A To highlight some verbatim sequences (comments, macro names, etc.)
% \def\HLEmphasize#1{\textit{#1}}
% \newcommand{\BS}{\texttt{\symbol{`\\}}}
% \def\HLMacro#1{\BS{}def\HLMacro@i#1\@nil}
% \def\HLMacro@i#1def#2\@nil{\HLReverse{#2}}
% \def\HLReverse#1{{\setlength{\fboxsep}{1pt}\HLReverse@i{#1}}}
% \def\HLReverse@i#1{\colorbox{black}{\textcolor{white}{\textbf{#1}}}}
%
% \def\Example{\FV@Environment{}{Example}}
% \def\endExample{%
% \end{VerbatimOut}
% \Below@Example{\input{\jobname.tmp}}
% \endgroup}
%
% \def\CenterExample{\FV@Environment{}{Example}}
% \def\endCenterExample{%
% \end{VerbatimOut}
% \begin{center}
%   \Below@Example{\input{\jobname.tmp}}
% \end{center}
% \endgroup}
%
% \def\SideBySideExample{\FV@Environment{}{Example}}
% \def\endSideBySideExample{%
% \end{VerbatimOut}
% \SideBySide@Example{\input{\jobname.tmp}}
% \endgroup}
%
% \def\FVB@Example{%
% \begingroup
% \FV@UseKeyValues
% \parindent=0pt
% \multiply\topsep by 2
% \VerbatimEnvironment
% \begin{VerbatimOut}[gobble=4,codes={\catcode`\W=12}]{\jobname.tmp}}
%
% \def\Below@Example#1{%
% \VerbatimInput[gobble=0,commentchar=W,commandchars=/?_,frame=single,
%                numbers=left,numbersep=3pt]{\jobname.tmp}
% \catcode`\%=14\relax
% \catcode`\W=9\relax
% ^^A We suppress the effect of the highlighting macros
% \catcode`/=0\relax
% \catcode`?=1\relax
% \catcode`_=2\relax
% \def\HLEmphasize##1{##1}%
% \def\HLMacro##1{##1}%
% \def\HLReverse##1{##1}%
% #1
% \par}
%
% \def\SideBySide@Example#1{%
% \vskip 1mm
% \@tempdimb=\FV@XRightMargin
% \advance\@tempdimb -5mm
% \begin{minipage}[c]{\@tempdimb}
%   \fvset{xrightmargin=0pt}
%   \catcode`\%=14\relax
%   \catcode`\W=9\relax
%   ^^A We suppress the effect of the highlighting macros
%   \catcode`/=0\relax
%   \catcode`?=1\relax
%   \catcode`_=2\relax
%   \def\HLEmphasize##1{##1}%
%   \def\HLMacro##1{##1}%
%   \def\HLReverse##1{##1}%
%   #1
% \end{minipage}%
% \@tempdimb=\textwidth
% \advance\@tempdimb -\FV@XRightMargin
% \advance\@tempdimb 5mm
% \begin{minipage}[c]{\@tempdimb}
%   \VerbatimInput[gobble=0,commentchar=W,commandchars=/?_,
%                  frame=single,numbers=left,numbersep=3pt,
%                  xleftmargin=5mm,xrightmargin=0pt]{\jobname.tmp}
% \end{minipage}
% \vskip 1mm}
%
% \makeatother
%
% ^^A End of example macros from `fvrb-ex'
%
% ^^A For the possible index and changes log
% \setlength{\columnseprule}{0.6pt}
%
% ^^A Beginning of the documentation itself
%
% \title{The \PstFrameBoxThreeDPackage{} package\\
%        A PSTricks package\\
%        for three dimensional framed boxes}
% \author{Denis \textsc{Girou}\thanks{CNRS/IDRIS ---
%         Centre National de la Recherche Scientifique /
%         Institut du D\'eveloppement et des Ressources en Informatique
%         Scientifique --- Orsay --- France ---
%         \mbox{\texttt{<Denis.Girou@idris.fr>}}.}}
% \date{Version 1.0\\February 25, 2002\\
%       {\small Documentation revised February 25, 2002}}
%
% \maketitle
%
% \begin{abstract}
%     This package allow to draw three dimensional framed boxes using the
%   macro \PstFrameBoxThreeDMacro. This is specially useful to draw 3d-like
%   buttons.
% \end{abstract}
%
% \tableofcontents
%
% \section{Introduction}
%
%   \PstFrameBoxThreeDPackage{} offer a unique main macro with few parameters to
% interact on it. This is just a small extension of the \cs{psframebox} macro.
%
%   All the relevant PSTricks parameters can be use with it, but the
% \texttt{linestyle}, \texttt{linecolor}, \texttt{doubleline} and
% \texttt{doublecolor} ones must not be used, as they would be overridden.
% Nevertheless, some usual parameters are not relevant for this kind of boxes
% and would produce ``strange'' results (for instance \texttt{border},
% \texttt{linearc} and \texttt{shadow}).
%
%   As usual, \LaTeX{} users are supposed to have loaded the \PstColPackage{}
% package before this one, to ensure the compatibility with the standard
% \ColorPackage{} \LaTeX{} package.
%
%   The syntax of the macro is the same than the one for the other macros for
% framed boxes, so simply:
%
% \vspace{1mm}
% \noindent%
% \fbox{\PstFrameBoxThreeDMacro\texttt{[optional\_parameters]\{\emph{stuff}\}}}
%
% \vspace{1mm}
%   We can put all the valid material inside such 3d boxes, including other
% framed boxes.
%
%   Note also that, obviously, this documentation is very color oriented, and
% is done to be read on a screen or a colored paper.
%
% \section{Usage}
%
% \subsection{Default behavior}
%
%   The default behavior is the following:
%
% \begin{CenterExample}
%   \PstFrameBoxThreeD{Button}\hfill
%   \PstFrameBoxThreeD{\shortstack{Yes!\\Yes!\\Yes!}}\hfill
%   \PstFrameBoxThreeD{\Huge$\frac{1}{\sqrt{3}}$}%
% \end{CenterExample}
%
%   Of course, we can use all the relevant generic PSTricks parameters for the
% framed boxes (but not those relative to \emph{double} lines), specially
% those applying to boxes:
%
% \begin{CenterExample}
%   \PstFrameBoxThreeD[doublesep=0.1]{Button}\hfill
%   \PstFrameBoxThreeD[doublesep=0.2]{Button}\hfill
%   \PstFrameBoxThreeD[doublesep=0.5]{Button}%
% \end{CenterExample}
%
%   Specially look at the behavior of the \texttt{framesep},
% \texttt{doublesep} and \texttt{linewidth} parameters:
%
% \begin{CenterExample}
%   \PstFrameBoxThreeD[framesep=0.3]{Button}\hfill
%   \PstFrameBoxThreeD[doublesep=0.3]{Button}\hfill
%   \PstFrameBoxThreeD[linewidth=0.3]{Button}\hfill
%   \PstFrameBoxThreeD[doublesep=0.3,linewidth=0.3]{Button}\hfill
%   \PstFrameBoxThreeD[framearc=0.5]{Button}%
% \end{CenterExample}
%
% \subsection{Parameters}
%
%   To change the way the boxes are drawn, we can also use \textbf{four}
% specific parameters:
%
% \begin{optlist}
%   \item [FrameBoxThreeDColorHSB (real real real)]: to define the colors
% used, in the HSB (\emph{hue}, \emph{saturation}, \emph{brightness}) model.
% This is a sequence of three real values, separated by spaces. This will
% define the color of the interior of the frame. And for the borders we will
% use it too, changing it brightness in light and dark.
%
%         Note also that if the \emph{brightness} value is negative, no color
% will fill the interior of the box (this is useful if the general background
% is not white).
%   (\emph{Default:~0~0~0.5} --- it must be three numbers between 0~and~1, but
% as explained the last one can be negative, which has a special meaning).
% \end{optlist}
%
% \begin{CenterExample}
%   \psset{doublesep=0.1}
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.1 0.3 0.5_]{%
%     Button}\hfill
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.6 0.3 0.5_]{%
%     Button}\hfill
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.4 0.1 0.5_]{%
%     \Huge$\frac{1}{\sqrt{3}}$}\hfill
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.9 0.5 0.5_]{%
%     \psovalbox[fillstyle=solid,fillcolor=yellow]{Button}}\hfill
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.4 0.7 0.2_]{%
%     \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.4 0.7 0.5_]{%
%       \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.4 0.7 0.8_]{%
%         Button}}}%
% \end{CenterExample}
%
% \begin{CenterExample}
%   \psset{doublesep=0.2}
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0 0 0.3_]{Button}\hfill
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0 0 0.7_]{Button}\hfill
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0 0 -1_]{Button}\hfill
%   \definecolor{MyGray}{gray}{0.85}
%   \psframe*[linecolor=MyGray](-0.3,-0.65)(2.1,0.9)
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0 0 -1_]{Button}%
% \end{CenterExample}
%
% \begin{SideBySideExample}[xrightmargin=3cm]
%   \PstFrameBoxThreeD%
%     [linewidth=0.2,
%      /HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.3 0.2 0.5_]{%
%     \Huge\textcolor{white}{\textbf{21}}}
% \end{SideBySideExample}
%
% \begin{optlist}
%   \item [FrameBoxThreeDOn (boolean)]: to simulate an ON / OFF button, by
% exchange of the dark and light colors of the borders (this will give the
% same result that to use a negative value for the
% \texttt{FrameBoxThreeDBrightnessDistance} parameter)
%   (\emph{Default:~true}).
% \end{optlist}
%
% \begin{CenterExample}
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.1 0.9 0.5_]{%
%     Button}\hfill
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.1 0.9 0.5_,
%                      /HLEmphasize?FrameBoxThreeDOn_=/HLReverse?false_]{Button}\hfill
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.1 0.9 0.5_,
%                      /HLEmphasize?FrameBoxThreeDOn_=/HLReverse?false_,linewidth=0.2]{Button}%
% \end{CenterExample}
%
% \begin{CenterExample}
%   \PstFrameBoxThreeD[linewidth=0.5,/HLEmphasize?FrameBoxThreeDOn_=/HLReverse?false_,
%                      /HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.8 0.5 0.5_]{%
%     \Large\textcolor{yellow}{\textbf{This is your last chance...}}}
% \end{CenterExample}
%
% \begin{optlist}
%   \item [FrameBoxThreeDOpposite (boolean)]: to use the same color for the
%   left and right borders, and the same other for the bottom and top ones, or
%   rather for left and top and right and bottom.
%   (\emph{Default:~false}).
% \end{optlist}
%
% \begin{CenterExample}
%   \psset{linewidth=0.2}
%   \newcommand{\Button}{\textcolor{white}{\textbf{Button}}}
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.7 0.8 0.8_]{%
%     \Button}\hfill
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.7 0.8 0.8_,
%                      /HLEmphasize?FrameBoxThreeDOn_=/HLReverse?false_]{\Button}\hfill
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.7 0.8 0.8_,
%                      /HLEmphasize?FrameBoxThreeDOpposite_=/HLReverse?true_]{\Button}\hfill
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.7 0.8 0.8_,
%                      /HLEmphasize?FrameBoxThreeDOn_=/HLReverse?false_,
%                      /HLEmphasize?FrameBoxThreeDOpposite_=/HLReverse?true_]{\Button}%
% \end{CenterExample}
%
% \begin{optlist}
%   \item [FrameBoxThreeDBrightnessDistance (real)]: the distance brightness
%   of the color used to fill the interior of the box. If this is a negative
%   number, we will got the same effect that the one of setting
%   \texttt{FrameBoxThreeDOn} to false. And if it value is 0, the borders will
%   have obviously the same color that the interior.
%   (\emph{Default:~0.15} --- it must be a number between -0.5~and~0.5, but the
%   \emph{brightness} plus and minus it must stay between 0~and~1).
% \end{optlist}
%
% \begin{CenterExample}
%   \psset{doublesep=0.2}
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.6 0.3 0.5_]{%
%     Button}\hfill % /HLEmphasize?Default = 0.15_
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.6 0.3 0.5_,
%                      /HLEmphasize?FrameBoxThreeDBrightnessDistance_=/HLReverse?0.3_]{%
%     Button}\hfill
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.6 0.3 0.5_,
%                      /HLEmphasize?FrameBoxThreeDBrightnessDistance_=/HLReverse?0.5_]{%
%     Button}\hfill
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.6 0.3 0.7_,
%                      /HLEmphasize?FrameBoxThreeDBrightnessDistance_=/HLReverse?0.3_]{%
%     Button}\hfill
%   \PstFrameBoxThreeD[/HLEmphasize?FrameBoxThreeDColorHSB_=/HLReverse?0.6 0.3 0.5_,
%                      /HLEmphasize?FrameBoxThreeDBrightnessDistance_=/HLReverse?-0.2_]{%
%     Button}%
% \end{CenterExample}
%
% \section{Examples}
%
%   We give here more advanced examples.
%
% \begin{CenterExample}
%   \psset{doublesep=0.12}
%   \multido{\nButtonA=0.1+0.4}{3}{%
%     \multido{\nButtonB=0+0.05}{11}{%
%       \PstFrameBoxThreeD%
%         [FrameBoxThreeDColorHSB=\nButtonA\space 0.5 0.5,
%          FrameBoxThreeDBrightnessDistance=\nButtonB]{OK}}\\}
% \end{CenterExample}
%
% \begin{CenterExample}
%   \psset{doublesep=0.05}
%   \multido{\nButtonA=0+0.1}{11}{%
%     \multido{\nButtonB=0+0.05}{21}{%
%       \PstFrameBoxThreeD[FrameBoxThreeDColorHSB=%
%                          \nButtonB\space \nButtonA\space 0.8]{\$}}\\}
% \end{CenterExample}
%
% \begin{CenterExample}
%   \psset{gradmidpoint=1,gradangle=90}
%   \psdblframebox[framesep=0.3,fillstyle=gradient,
%                  gradbegin=yellow,gradend=LemonChiffon]{%
%     \shortstack[l]{%
%       \makebox[8cm]{\LARGE\textbf{Introduction}\dotfill}\\
%       {\Large by Catherine \textsc{Parker}}\hfill
%          \raisebox{5.5mm}{%
%            \PstFrameBoxThreeD[linewidth=0.15,
%                               FrameBoxThreeDColorHSB=0.3 0.2 0.5]{%
%              \LARGE\textcolor{white}{3}}}}}
% \end{CenterExample}
%
% \begin{CenterExample}
%   \psshadowbox[framesep=0.3,fillstyle=gradient,
%                gradbegin=Orange,gradend=yellow]{%
%     \setlength{\tabcolsep}{0mm}%
%     \begin{tabular}{ll}
%       \makebox[10cm]{%
%           \LARGE\textbf{Description of the problem\dotfill}} &
%         \raisebox{-5mm}{%
%           \PstFrameBoxThreeD[linewidth=0.15,
%                              FrameBoxThreeDColorHSB=0.9 0.5 0.5]{%
%             \LARGE\textcolor{white}{\textbf{25}}}}\\[-3mm]
%       \textcolor{red}{\large by Helen \textsc{Mitchell}
%       and Ann \textsc{Cartridge}}
%     \end{tabular}}
% \end{CenterExample}
%
% \begin{CenterExample}
%   \newcommand{\MyNode}[2]{%
%   \TR{\PstFrameBoxThreeD[linewidth=0.1,FrameBoxThreeDOn=#2,
%                          FrameBoxThreeDColorHSB=0.2 0.4 0.5,
%                          FrameBoxThreeDBrightnessDistance=0.2]{#1}}}
%   \renewcommand{\psedge}[2]{\ncangle{#2}{#1}}
%
%   \psset{angleB=-90,angleA=90,levelsep=2,treesep=3}
%   \pstree{\MyNode{Richard}{true}}
%          {\pstree{\MyNode{Paul}{true}}
%                  {\pstree{\MyNode{Jack}{true}}
%                          {\MyNode{Michel}{false}}
%                           \MyNode{Adam}{false}}
%                   \MyNode{Herbert}{false}}
% \end{CenterExample}
%
% \begin{CenterExample}
%   \newcommand{\EntryA}[1]{%
%   \PstFrameBoxThreeD[FrameBoxThreeDColorHSB=0.4 0.6 0.5]{%
%     \makebox[2.2cm]{#1}}}
%   \newcommand{\EntryB}[1]{%
%   \PstFrameBoxThreeD[FrameBoxThreeDColorHSB=0.16 1 0.8]{%
%     \makebox[0.5cm]{#1}}}
%   \newcommand{\EntryC}[1]{%
%   \PstFrameBoxThreeD[FrameBoxThreeDColorHSB=0.7 0.2 0.8]{%
%     \makebox[1.4cm]{#1}}}
%   \newcommand{\EntryD}[1]{%
%   \PstFrameBoxThreeD[FrameBoxThreeDColorHSB=0.9 0.5 0.5]{%
%     \makebox[1.4cm]{#1}}}
%
%   \begin{table}[htbp]
%     \centering
%     \large\bfseries
%     \setlength{\tabcolsep}{5mm}%
%     \setlength{\belowcaptionskip}{3mm}%
%     \caption{Results of the year}
%     \PstFrameBoxThreeD[framesep=0.4,doublesep=0.5,
%                        FrameBoxThreeDColorHSB=0.3 0.2 0.4]{%
%       \psset{framesep=0.3,doublesep=0.2}%
%       \begin{tabular}{lrr}
%         \\
%         \EntryA{1st Quarter}&\EntryB{723}&                  \\[1.5cm]
%         \EntryA{2nd Quarter}&\EntryB{819}&\EntryC{+13 \%}   \\[1.5cm]
%         \EntryA{3rd Quarter}&\EntryB{687}&\EntryD{--16.1 \%}\\[1.5cm]
%         \EntryA{4th Quarter}&\EntryB{894}&\EntryC{+30.1 \%} \\[1cm]
%       \end{tabular}}
%   \end{table}
% \end{CenterExample}
%
%
% \StopEventually{}
%
% ^^A .................... End of the documentation part ....................
%
% \section{Driver file}
%
%   The next bit of code contains the documentation driver file for \TeX{},
% i.e., the file that will produce the documentation you are currently
% reading. It will be extracted from this file by the \texttt{docstrip}
% program.
%
%    \begin{macrocode}
%<*driver>
\documentclass{ltxdoc}
\GetFileInfo{pst-fr3d.dtx}
\usepackage{fancyvrb}
\usepackage{multido}
\usepackage{pstricks}
\usepackage{pst-fr3d}
\usepackage{pst-grad}
\usepackage{pst-tree}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\OnlyDescription                % Comment it for implementation details
\hbadness=7000                  % Over and under full box warnings
\hfuzz=3pt
\definecolor{LemonChiffon}{rgb}{1.,0.98,0.8}
\definecolor{Orange}      {rgb}{1.,0.65,0.}
\definecolor{Pink}        {rgb}{1.,0.75,0.8}
\begin{document}
  \DocInput{pst-fr3d.dtx}
\end{document}
%</driver>
%    \end{macrocode}
%
% \section{\PstFrameBoxThreeDPackage{} \LaTeX{} wrapper}
%
%    \begin{macrocode}
%<*latex-wrapper>
\ProvidesPackage{pst-fr3d}[2002/02/25 package wrapper for PSTricks pst-fr3d.tex]
\input pst-fr3d.tex
%</latex-wrapper>
%    \end{macrocode}
%
% \section{\PstFrameBoxThreeDPackage{} code}
%
%    \begin{macrocode}
%<*pst-fr3d>
%    \end{macrocode}
%
% \subsection{Preambule}
%
%   Who we are.
%
%    \begin{macrocode}
\csname PstFrameBoxThreeDLoaded\endcsname
\let\PstFrameBoxThreeDLoaded\endinput
%    \end{macrocode}
%
%   Require the PSTricks package.
%
%    \begin{macrocode}
\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
%    \end{macrocode}
%
%   David \textsc{Carlisle} interface to the `\textsf{keyval}' package.
%
%    \begin{macrocode}
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi
%    \end{macrocode}
%
%   Catcodes changes.
%
%    \begin{macrocode}
\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)}
%    \end{macrocode}
%
% \subsection{Definition of the parameters}
%
%   \texttt{FrameBoxThreeDOn} to draw the 3d framed box with an ON / OFF
% effect.
%
%    \begin{macrocode}
\newif\ifPstFrameBoxThreeD@On
\define@key[psset]{pst-fr3d}{FrameBoxThreeDOn}[true]{\@nameuse{PstFrameBoxThreeD@On#1}}
%    \end{macrocode}
%
%   \texttt{FrameBoxThreeDOpposite} to use the same colors for the opposite
% sides or the contiguous ones.
%
%    \begin{macrocode}
\newif\ifPstFrameBoxThreeD@Opposite
\define@key[psset]{pst-fr3d}{FrameBoxThreeDOpposite}[true]{%
\@nameuse{PstFrameBoxThreeD@Opposite#1}}
%    \end{macrocode}
%
%   \texttt{FrameBoxThreeDColorHSB} to define the colors used, in the HSB
% (\emph{hue}, \emph{saturation}, \emph{brightness}) model. This is a sequence
% of three real values, separated by spaces. This will define the color of the
% interior of the frame. And for the borders we will use it too, changing it
% brightness in light and dark.
%
%    \begin{macrocode}
\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}}
%    \end{macrocode}
%
%   \texttt{FrameBoxThreeDBrightnessDistance} to define the brightness
% distance between the brightness used for the material of the box
% (\texttt{BrightnessC}) and the two brightnesss used for the borders
% (\texttt{BrightnessA} and \texttt{BrightnessB}): \texttt{BrightnessA} =
% \texttt{BrightnessC} + \texttt{FrameBoxThreeDBrightnessDistance} and
% \texttt{BrightnessB} = \texttt{BrightnessC} --
% \texttt{FrameBoxThreeDBrightnessDistance}. It can be a negative number. And
% if the brightness is negative, we will use a value of 0.5 to compute the two
% other colors.
%
%    \begin{macrocode}
\define@key[psset]{pst-fr3d}{FrameBoxThreeDBrightnessDistance}{%
\edef\PstFrameBoxThreeD@BrightnessDistance{#1}}
%    \end{macrocode}
%
%   Next, we set the default values for all these new parameters.
%
%    \begin{macrocode}
\psset{%
  FrameBoxThreeDOn=true,FrameBoxThreeDOpposite=false,
  FrameBoxThreeDColorHSB=0 0 0.5,FrameBoxThreeDBrightnessDistance=0.15}%
%    \end{macrocode}
%
% \subsection{Main macro}
%
%   The general \cs{PstFrameBoxThreeD} macro to draw three dimensional boxed
% frames.
%
% \begin{macro}{\PstFrameBoxThreeD}
%    \begin{macrocode}
\def\PstFrameBoxThreeD{%
\@ifnextchar[{\PstFrameBoxThreeD@i}{\PstFrameBoxThreeD@i[]}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PstFrameBoxThreeD@i}
%    \begin{macrocode}
\def\PstFrameBoxThreeD@i[#1]#2{{%
%    \end{macrocode}
%
%   We force ``dimmen=middle''.
%
%    \begin{macrocode}
\psset{dimen=middle}%
%    \end{macrocode}
%
%   Then we set the local changes of parameters.
%
%    \begin{macrocode}
\psset{#1}%
%    \end{macrocode}
%
%
%   If the brightness is negative, the interior of the frame will not be
% filled with color, and a value of 0.5 will be used to compute the two colors
% of the borders.
%
%    \begin{macrocode}
\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
%    \end{macrocode}
%
%   Computation of the colors of the borders.
%
%    \begin{macrocode}
\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}%
%    \end{macrocode}
%
%   If the \ColorPackage{} \LaTeX{} package was not loaded (using the
% \PstColPackage{} compatibility package which is hightly recommanded for
% \LaTeX{} users), we will use the PSTricks color model.
%
%    \begin{macrocode}
\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
%    \end{macrocode}
%
%   If the \ColorPackage{} \LaTeX{} package was loaded, we will use it as
% color model.
%
%    \begin{macrocode}
\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
%    \end{macrocode}
%
%   Now, we can \emph{really} draw the box and the borders.
%
%   No lines here.
%
%    \begin{macrocode}
\psset{linestyle=none}%
%    \end{macrocode}
%
%   We draw the material in a standard \cs{psframebox} macro, defining
% \texttt{doubleline} to \texttt{true}, to compute correctly the bounding box
% of the box with it borders.
%
%    \begin{macrocode}
\psframebox[fillstyle=\PstFrameBoxThreeD@FillStyle,
            fillcolor=PstFrameBoxThreeD@ColorC,doubleline=true]{#2}%
%    \end{macrocode}
%
%   We save the material to frame in an internal box, without the size of it
% borders.
%
%    \begin{macrocode}
\setbox\pst@boxg=\hbox{\psframebox{#2}}%
%    \end{macrocode}
%
%   Then we save in another internal box the same thing, this time with the
% size of it borders.
%
%    \begin{macrocode}
\setbox\pst@hbox=\hbox{\psframebox[doubleline=true]{#2}}%
%    \end{macrocode}
%
%   We compute the four internal coordinates for the borders.
%
%    \begin{macrocode}
\pst@dima=\wd\pst@hbox
\advance\pst@dima-\wd\pst@boxg
\divide\pst@dima\tw@
%    \end{macrocode}
%
%    \begin{macrocode}
\pst@dimb=\pst@dima
%    \end{macrocode}
%
%    \begin{macrocode}
\advance\pst@dima\wd\pst@boxg
%    \end{macrocode}
%
%   Now, we can draw the borders, of course in a \texttt{solid} mode.
%
%    \begin{macrocode}
\psset{fillstyle=solid}%
%    \end{macrocode}
%
%   We draw first the left then the top borders.
%
%    \begin{macrocode}
\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)
%    \end{macrocode}
%
%   We must compute the colors of the two other borders.
%
%    \begin{macrocode}
\ifPstFrameBoxThreeD@Opposite
  \def\pst@tempa{PstFrameBoxThreeD@ColorA}%
  \def\pst@tempb{PstFrameBoxThreeD@ColorB}%
\else
  \def\pst@tempa{PstFrameBoxThreeD@ColorB}%
  \def\pst@tempb{PstFrameBoxThreeD@ColorA}%
\fi
%    \end{macrocode}
%
%   Now, we draw the right then the bottom borders.
%
%    \begin{macrocode}
\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)
%    \end{macrocode}
%
%   And, to finish, a dark oblique line in the middle of the light border and
% a light oblique line in the middle of the dark border, if the identical
% colors are contiguous.
%
%    \begin{macrocode}
\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}}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Closing}
%
%   Catcodes restoration.
%
%    \begin{macrocode}
\catcode`\@=\PstAtCode\relax
%    \end{macrocode}
%
%    \begin{macrocode}
%</pst-fr3d>
%    \end{macrocode}
%
% \Finale
% \PrintIndex
% \PrintChanges
%
\endinput
%%
%% End of file `pst-fr3d.dtx'