summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/dvips/pst-marble
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2019-01-26 22:57:13 +0000
committerKarl Berry <karl@freefriends.org>2019-01-26 22:57:13 +0000
commitd4802db53ea2e712cd0acfb472b73891de14e27c (patch)
tree9342e2fa1d3dabcd7f920b0a3018eb8043fecacb /Master/texmf-dist/dvips/pst-marble
parent77f296fc4d17c9378658b6085929e839b4f1b9c8 (diff)
pst-marble (26jan19)
git-svn-id: svn://tug.org/texlive/trunk@49824 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/dvips/pst-marble')
-rw-r--r--Master/texmf-dist/dvips/pst-marble/pst-marble.pro155
1 files changed, 114 insertions, 41 deletions
diff --git a/Master/texmf-dist/dvips/pst-marble/pst-marble.pro b/Master/texmf-dist/dvips/pst-marble/pst-marble.pro
index 478b39d677a..4353cf2db33 100644
--- a/Master/texmf-dist/dvips/pst-marble/pst-marble.pro
+++ b/Master/texmf-dist/dvips/pst-marble/pst-marble.pro
@@ -1,22 +1,17 @@
%%Creator: Aubrey Jaffer
%%For: Voluntocracy
-%%Copyright: 2018 Aubrey Jaffer
+%%Copyright: 2018, 2019 Aubrey Jaffer
%%Creator: Aubrey Jaffer
%%For: Voluntocracy
-%%CreationDate: 2018-10-19
+%%CreationDate: 2019-01-19
/plotdict 100 dict def
plotdict begin
- /URL (http://people.csail.mit.edu/jaffer/Marbling) def
- /pi 3.141592653589793 def
- /e 2.718281828459045 def
- /e^-1 1 e div def
- /m4o3 -4 3.0 div def
-
-%% depend on rendering direction:
-%/zsgn 0 def
-
/URL (http://people.csail.mit.edu/jaffer/Marbling) def
+/pi 3.141592653589793 def
+/e 2.718281828459045 def
+/e^-1 1 e div def
+/m4o3 -4 3.0 div def
% negative viscosity for (raster) reverse-marbling
/marble % nu (viscosity)
@@ -75,7 +70,7 @@ plotdict begin
do-raster
}
{
- orgx orgy translate
+% orgx orgy translate
scl 1.0 div dup scale
do-drops
} ifelse
@@ -96,10 +91,10 @@ plotdict begin
{vortex-deformation}
{
ct /wiggle eq
- {wiggle}
+ {wiggle-deformation}
{
ct /offset eq
- {offset}
+ {offset-deformation}
{(unrecognized token) = ct =} ifelse
} ifelse
} ifelse
@@ -140,14 +135,14 @@ plotdict begin
} loop
} bind def
-/offset % px py dx dy --> px py
+/offset-deformation % px py dx dy --> px py
{
/dy exch .001 mul def /dx exch .001 mul def
dy reverse-rendering? {neg} if add exch
dx reverse-rendering? {neg} if add exch
} bind def
-/wiggle % px py ang {func} --> px py
+/wiggle-deformation % px py ang {func} --> px py
{
/func exch def /ang exch def
/dy ang cos def /dx ang sin def
@@ -156,6 +151,16 @@ plotdict begin
px dx a mul add py dy a mul add
} bind def
+/tines % cnt spacing ofst
+{
+ /ofst exch def
+ /spacing exch def
+ /cnt exch def
+ /hint cnt 1 sub -2 div cvi def
+ hint spacing mul ofst add spacing cnt hint sub spacing mul ofst add
+ {} for
+} bind def
+
/stroke-deformation % px py bx by ex ey V D --> px py
{
/D exch .001 mul def /V exch .001 mul abs def
@@ -379,7 +384,7 @@ plotdict begin
/disc exch def
disc 0. le
{
- disc -1e-3 le
+ disc -0.001 le
{rgb}
{
/a disc neg sqrt sharpen def
@@ -433,7 +438,7 @@ plotdict begin
% Dimensions are relative to a 1000 x 1000 square with the origin
% at its center.
-/color1 [0.960 0.764 0.576] bind def % deep red background
+/color1 [0.960 0.764 0.576] bind def % deep red
/color2 [0.316 0.362 0.298] bind def % blue
/color3 [0.200 0.050 0.015] bind def
/color4 [0.023 0.145 0.451] bind def
@@ -450,27 +455,97 @@ plotdict begin
% [ angle {func} /wiggle ]
% [ dx dy /offset ]
-/Q 1 def
+/color-norm { % rgb
+ /rgb exch def
+ rgb {1 gt} forall or or { [ rgb {255 div} forall ] } { rgb } ifelse
+} bind def
+
+/drop { % cx cy radinc rgb
+ /rgb exch def
+ /radinc exch def
+ /cy exch def
+ /cx exch def
+ [ cx cy radinc -1 rgb color-norm /drop ]
+} bind def
+
+/stir { % cx cy [ r ] w th D
+ /stir 7 array astore
+} bind def
+
+/vortex { % cx cy circ t
+ /vortex 5 array astore
+} bind def
+
+/stroke { % bx by ex ey V D
+ /stroke 7 array astore
+} bind def
-/concentric-bands {
-% xc yc radius increment number of bands % [array of colors]
-% [array of colors] c'est le tableau donné en paramètres colors=
- /nbands exch def
+/rake { % angle [ r ] V tU D
+ /rake 6 array astore
+} bind def
+
+/wiggle { % angle {func}
+ /wiggle 3 array astore
+} bind def
+
+/shift { % angle r
+ /r exch def
+ /th exch def
+ [ th sin r mul th cos r mul /offset ]
+} bind def
+
+/concentric-rings { % xc yc thick [ color ] count
+ /cnt exch def
+ /clra exch def
/rinc exch def
/yc exch def
/xc exch def
- 11 -1 1
- {
- /rad exch sqrt rinc mul def
- /cnt 0 def
- nbands {
- [ xc yc rad background colors cnt colors length mod get /drop]
- /cnt cnt 1 add def
- } repeat
- } for
- [ xc yc rinc 2 div background colors 0 get /drop]
-} def
+ /nclr clra length def
+ cnt 1 sub -1 0
+ {
+ /cnt exch def
+ cnt 0 eq
+ { xc yc rinc 2 div clra 0 get drop }
+ { xc yc cnt sqrt rinc mul clra cnt nclr mod get drop }
+ ifelse
+ } for
+} bind def
+/arc-drops { % xc yc r ang-strt ang-step rgb cnt drad
+ /drad exch def
+ /cnt exch def
+ /rgb exch def
+ /ang-step exch def
+ /ang-strt exch def
+ /r exch def
+ /yc exch def
+ /xc exch def
+ ang-strt ang-step ang-strt ang-step cnt 1 sub mul add
+ {
+ /th exch def
+ th sin r mul xc add th cos r mul yc add drad rgb drop
+ } for
+} bind def
+
+/spiral-drops { % xc yc r ang-strt ang-step rinc rgb cnt drad
+ /drad exch def
+ /cnt exch def
+ /rgb exch def
+ /rinc exch def
+ /ang-step exch def
+ /ang-strt exch def
+ /r exch def
+ /yc exch def
+ /xc exch def
+ ang-strt ang-step ang-strt ang-step cnt 1 sub mul add
+ {
+ /th exch def
+ th sin r mul xc add th cos r mul yc add drad rgb drop
+ /r r rinc add def
+ } for
+} bind def
+
+%
/random-drops {
/count exch def
/color exch def
@@ -481,7 +556,7 @@ count
random:uniform 1100 mul 550 sub
random:uniform 1100 mul 550 sub
e random:uniform exp size mul
- background color /drop
+ -1 color /drop
]
} repeat
} def
@@ -495,13 +570,11 @@ count
random:uniform 1100 mul 550 sub
random:uniform 1100 mul 550 sub
e random:uniform exp size mul
- background colors random:uniform colors length mul floor cvi get /drop
+ -1 colors random:uniform colors length mul floor cvi get /drop
]
} repeat
} def
end
-
-
-
-
-
+% Local Variables:
+% mode: PS
+% End: