summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-light3d/pst-light3d.tex
blob: 04cba260a4f86969abf7441547ffee9cd7f2ebaa (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
%% Package `pst-li3d.tex'
%%
%% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr>
%% and Peter Kleiweg (Rijksuniversiteit Groningen - Nederlands)
%% <kleiweg@let.rug.nl> 
%% 
%% 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-li3d' is a PSTricks package for three dimensional
%%   lighten effect on characters and PSTricks graphics.
%%
%%
\csname PSTLightThreeDLoaded\endcsname
\let\PSTLightThreeDLoaded\endinput
\ifx\PSTricksLoaded\endinput\else\input{pstricks}\fi
%
\input pst-xkey
\pst@addfams{pst-light3d}
%
\def\FileVersion{0.12}
\def\FileDate{2006/11/25}
\message{`Pst-Light3d' v\FileVersion, \FileDate\space(DG/PK)}
%
\edef\PstAtCode{\the\catcode`\@}
\catcode`\@=11\relax
\pstheader{pst-light3d.pro}
%
\define@key[psset]{pst-light3d}{LightThreeDXLength}{%
  \pst@getlength{#1}\PstLightThreeD@XLength}
\define@key[psset]{pst-light3d}{LightThreeDYLength}{%
  \pst@getlength{#1}\PstLightThreeD@YLength}
\define@key[psset]{pst-light3d}{LightThreeDLength}{%
  \pst@getlength{#1}\PstLightThreeD@XLength%
  \pst@getlength{#1}\PstLightThreeD@YLength}
\define@key[psset]{pst-light3d}{LightThreeDSteps}{%
  \pst@getint{#1}\PstLightThreeD@Steps}
\define@key[psset]{pst-light3d}{LightThreeDAngle}{%
  \pst@getangle{#1}\PstLightThreeD@LightAngle}
\define@key[psset]{pst-light3d}{LightThreeDColorPsCommand}{%
  \edef\PstLightThreeD@ColorPsCommand{#1}}
\psset{%
  LightThreeDXLength=0.2,LightThreeDYLength=0.3,%
  LightThreeDSteps=40,LightThreeDAngle=45,%
  LightThreeDColorPsCommand=2.5 div setgray}
\def\PstLightThreeDGraphic{\pst@object{PstLightThreeDGraphic}}
\def\PstLightThreeDGraphic@i{%
  \pst@makebox{%
    \PstLightThreeD@i{%
      /LightThreeDDXa LightThreeDDX def
      /LightThreeDDYa LightThreeDDY def
      /stroke { gsave reversepath LightThreeDPathForAll grestore
        LightThreeDPathForAll } def }{ end }%
  }%
}
\def\PstLightThreeDText{\pst@object{PstLightThreeDText}}
\def\PstLightThreeDText@i{%
  \pst@makebox{%
    \PstLightThreeD@i{%
      /LightThreeDDXa LightThreeDDX Resolution 100 div mul def
      /LightThreeDDYa LightThreeDDY VResolution 100 div mul def
      /tx@LightThreeDSavedShow /show load def
      /show {
        dup
        gsave
        false charpath
        reversepath LightThreeDPathForAll
        grestore true charpath 
      } def }%
    {/show /tx@LightThreeDSavedShow load def end }%
  \begin@ClosedObj%
    \def\use@pscode{%
      \pst@Verb{%
        gsave
        \tx@STV
        \pst@code grestore CP newpath moveto 
      }%
      \gdef\pst@code{}%
    }%
    \end@ClosedObj%
  }%
}%
\def\PstLightThreeD@i#1#2{{%
  \use@par%
  \leavevmode%
  \pstVerb{%
    tx@LightThreeDDict begin
      /LightThreeDDX \PstLightThreeD@XLength\space def
      /LightThreeDDY \PstLightThreeD@YLength\space neg def
      /LightThreeDSteps \PstLightThreeD@Steps def
      /LightThreeDAngle \PstLightThreeD@LightAngle def
      /LightThreeDColorPsCommand {\PstLightThreeD@ColorPsCommand} def
      /LightThreeDMINangle LightThreeDDY LightThreeDDX atan 180 sub def
      /LightThreeDMAXangle LightThreeDDY LightThreeDDX atan def
      #1}%
  \hbox{\box\pst@hbox}%
  \pstVerb{#2}%
}\ignorespaces}
%
\catcode`\@=\PstAtCode\relax
\endinput
%%
%% End of file `pst-li3d.tex'.

\iffalse
0.11 hv use pst-xkey
0.10 hv	initial version
\fi