summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/generic/pst-marble/pst-marble.tex
blob: 9f188063ac0f1e09bdfdfeb9fc0f9e2d14ebee14 (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
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                                                   %%
%% This is file `pst-marble.tex'                                     %%
%%                                                                   %%
%% IMPORTANT NOTICE:                                                 %%
%%                                                                   %%
%% Package `pst-marble'                                              %%
%% Copyright (C) 2018  Aubrey Jaffer                                 %%
%%                                                                   %%
%% Aubrey Jaffers, with help of Manuel Luque, Jürgen Gilg            %%
%% Email address: agj@alum.mit.edu                                   %%
%%                                                                   %%
%% This program can redistributed and/or modified under              %%
%% the terms of the LaTeX Project Public License                     %%
%% Distributed from CTAN archives in directory                       %%
%% macros/latex/base/lppl.txt; either version 1.3c of                %%
%% the License, or (at your option) any later version.               %%
%%                                                                   %%
%% DESCRIPTION:                                                      %%
%%   `pst-marble' is a PSTricks package to draw marble-like patterns %%
%%                                                                   %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\csname PSTMARBLELoaded\endcsname
\let \PSTMARBLELoaded\endinput
\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
\ifx\PSTXKeyLoaded\endinput \else\input pst-xkey.tex\fi
\def\fileversion{1.0}
\def\filedate{2018/10/19}
\message{`PST' v\fileversion, \filedate}
%
\pstheader{pst-marble.pro}
%
\edef\PstAtCode{\the\catcode`\@} \catcode`\@=11\relax
\pst@addfams{pst-marble}
\define@key[psset]{pst-marble}{background}{\def\pst@marble@background{#1 }}
\define@key[psset]{pst-marble}{viscosity}{\def\pst@marble@visc{#1 }}
%\define@key[psset]{pst-marble}{resolution}{\def\pst@marble@resolution{#1 }} %
\define@key[psset]{pst-marble}{actions}{\def\pst@marble@actions{#1 }}
% colors are red, green, and blue components between 0 and 1.
\define@key[psset]{pst-marble}{colors}{\def\pst@marble@colors{#1 }}
\define@boolkey[psset]{pst-marble}[Pst@]{drawcontours}[true]{}
\define@boolkey[psset]{pst-marble}[Pst@]{bckg}[true]{}
\psset[pst-marble]{background=1 1 1,
    viscosity=1000,
    bckg=true,
    actions=0 0 40 colors length concentric-bands,
    colors={
[0.960 0.764 0.576]
[0.316 0.362 0.298]
[0.200 0.050 0.015]
[0.023 0.145 0.451]
[0.866 0.353 0.050]
[0.200 0.050 0.015]
},
    drawcontours=false
    }%
\def\psMarble{\def\pst@par{}\pst@object{psMarble}}
\def\psMarble@i{\@ifnextchar({\psMarble@ii}{\psMarble@ii(10,10)}}
\def\psMarble@ii(#1,#2){%
\begin@SpecialObj
\addto@pscode{%
/cm {\pst@number\psunit mul } bind def
/background [\pst@marble@background] def
/colors [\pst@marble@colors] def
/pagewidth #1 cm def % en cm
/pageheight #2 cm def % en cm
\pst@number\pslinewidth\space 1000 div setlinewidth
plotdict begin
/loy pageheight -2 div def
/hiy pageheight 2 div def
/hix pagewidth 2 div def
/lox pagewidth -2 div def
/orgx hix lox add 2 div def
/orgy hiy loy add 2 div def
orgx orgy translate
/actions [ \pst@marble@actions ] def
/acnt actions length def
\ifPst@drawcontours /Contours {stroke} def \else /Contours {fill} def \fi
\ifPst@bckg
gsave
    background aload pop setrgbcolor
    lox loy pagewidth pageheight rectfill
grestore
\fi
gsave
    lox loy pagewidth pageheight rectclip
    \pst@marble@visc  marble
grestore
end
 }% fin du code ps
 \end@SpecialObj
 }% % fin de la commande PSTricks
\catcode`\@=\PstAtCode\relax
\endinput