summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/pst-marble/pst-marble-doc.tex
blob: 81558b32453a61770d3152270e05eff5e63138b5 (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
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%                                                                   %%
%% This is file `pst-marble-doc.tex'                                 %%
%%                                                                   %%
%% IMPORTANT NOTICE:                                                 %%
%%                                                                   %%
%% Package `pst-marble'                                              %%
%%                                                                   %%
%% Aubrey Jaffer with the help of Jürgen Gilg and Manuel Luque       %%
%% Email address: agj@alum.mit.edu                                   %%
%% Copyright (C) 2018  Aubrey Jaffer                                 %%
%%                                                                   %%
%% 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 %%
%%                                                                   %%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\listfiles

\documentclass[%
    11pt,
    english,
    BCOR10mm,
    DIV12,
    bibliography=totoc,
    parskip=false,
    fleqn,
    smallheadings,
    headexclude,
    footexclude,
    oneside,
    dvipsnames,
    svgnames,
    x11names
]{pst-doc}

\usepackage[autostyle]{csquotes}
\usepackage{biblatex}
%\usepackage[style=dtk]{biblatex}
\addbibresource{pst-marble-doc.bib}
\usepackage[utf8]{inputenc}
\let\pstpersFV\fileversion
\usepackage{pstricks,pst-marble,pst-lens,pstricks-add}
\usepackage{amsmath,amssymb}

\let\belowcaptionskip\abovecaptionskip
\parindent0pt

\begin{document}

\title{pst-marble v 1.0}
\subtitle{A PSTricks package to draw marble-like patterns}
\author{%
    Aubrey \textsc{Jaffer}\\
    with the help of\\
    Jürgen \textsc{Gilg}\\
    Manuel \textsc{Luque}
}

\date{\today}
\maketitle
\tableofcontents
\psset{unit=1cm}


\clearpage


\begin{abstract}\parskip4pt\parindent0pt

Marbling originated in Asia as a decorative art more than 800 years ago and spread to Europe in the 1500s where it was used for endpapers and book covers.

The mathematical fascination with paint marbling is that while rakings across the tank stretch and deform the paint boundaries, they do not break or change the topology of the surface.  With mechanical guides, a raking can be undone by reversing the motion of the rake to its original position.  Raking is thus a physical manifestation of a homeomorphism, a continuous function between topological spaces (in this case between a topological space and itself) that has a continuous inverse function.

\begin{center}
\begin{pspicture}(-7,-5)(5,5)
\psMarble[viscosity=1000,background=0.9 0.9 0.9,
    colors={[0.176 0.353 0.129][0.635 0.008 0.094][0.078 0.165 0.518]
            [0.824 0.592 0.031][0.059 0.522 0.392][0.816 0.333 0.475]},
    actions={%
     0 0 40 6 concentric-bands
    [ 0 0 20 background color1 /drop]
    [ 0 240 /offset]
    [ 180 [ -460 60 460 {} for ] 40 200 31 /rake]
    [ 90 {0.75 mul sin -120 mul} /wiggle]
    [ 180 [-750 -150 450] 40 200 31 /rake ]
    [ 90 {0.75 mul sin 240 mul} /wiggle ]
    [ 180 [-450 150 750] 40 200 31 /rake ]
    [ 90 {0.75 mul sin -120 mul} /wiggle ]
    }](10,10)
\psframe(-7,-5)(5,5)
\rput{90}(-6,0){\parbox{10cm}{\centering\bf\Large Marbling effects by Aubrey Jaffer\\ and PSTricks}}
\end{pspicture}
\end{center}
{\tiny\begin{verbatim}
\begin{pspicture}(-7,-5)(5,5)
\psMarble[viscosity=1000,background=0.9 0.9 0.9,
    colors={[0.176 0.353 0.129][0.635 0.008 0.094][0.078 0.165 0.518]
            [0.824 0.592 0.031][0.059 0.522 0.392][0.816 0.333 0.475]},
    actions={%
     0 0 40 6 concentric-bands
    [ 0 0 20 background color1 /drop]
    [ 0 240 /offset]
    [ 180 [ -460 60 460 {} for ] 40 200 31 /rake]
    [ 90 {0.75 mul sin -120 mul} /wiggle]
    [ 180 [-750 -150 450] 40 200 31 /rake ]
    [ 90 {0.75 mul sin 240 mul} /wiggle ]
    [ 180 [-450 150 750] 40 200 31 /rake ]
    [ 90 {0.75 mul sin -120 mul} /wiggle ]
    }](10,10)
\psframe(-7,-5)(5,5)
\rput{90}(-6,0){\parbox{10cm}{\centering\bf\Large Marbling effects by Aubrey Jaffer\\ and PSTricks}}
\end{pspicture}
\end{verbatim}}


\vfill
{\small This program can redistributed and/or modified under the terms of the LaTeX Project Public License Distributed from CTAN archives in directory \texttt{macros/latex/base/lppl.txt}; either version 1.3c of the License, or (at your option) any later version.}
\end{abstract}


\clearpage


\section{Introduction}

Aubrey Jaffer finds a similarity between whirlwinds in the great spot of jupiter and those that appear in some marbled papers.
\begin{center}
\url{http://voluntocracy.blogspot.com/2018/08/}
\end{center}
You can see a swirl on a marbled paper at Wikipedia:
\begin{center}
\url{https://fr.wikipedia.org/wiki/Papier_marbr%C3%A9#/media/File:PaperMarbling003France1880Detail.jpg}
\end{center}

It is true that in both cases, although at very different scales, the laws of fluid mechanics apply.

Aubrey Jaffer's article on the physical and mathematical interpretation of the formation of various types of marbling:
\begin{center}
\url{https://arxiv.org/abs/1702.02106}
\end{center}
Aubrey Jaffer has improved the model shown in the previous version of \texttt{pst-marble}. Now it is closer to reality and more consistent in the choice of units. This version allows to perform more accurate simulations, however with some new parameters, which will be explained.

But then everything will depend on your patience, your talent so that we can exclaim looking at one of your achievements:
\begin{quote}\itshape
``Beautiful, it's a big piece of art that you have done!''
\end{quote}
Many articles deal with marbled paper techniques which are used to adorn bindings and book covers.

Here a link to an article devoted to it by the famous \emph{Encyclopaedia of Diderot and D'Alembert}.
\begin{center}
\url{https://fr.wikisource.org/wiki/L%E2%80%99Encyclop%C3%A9die/1re_%C3%A9dition/MARBREUR_DE_PAPIER}
\end{center}

Aubrey Jaffer and some computer scientists working with him or on their own, tried to understand and model marblings that appear when the artist uses a stylus which he moves the tip on a surface of liquid. As a result in its wake, the drops it encounters get deformed and will also influence the shape of their neighbors according to the properties of the medium (viscosity), the speed of the movement of the stylus, and the nature of its trajectory: line segment, line crossing the whole tank, bow on a circle, ripples, swirls, etc.

The artist can also use a comb (rake) whose spacing between teeth can be adjusted to make more complex figures. These studies follow the laws of fluid mechanics to model and thus be able to create realistic simulations of marbling.

On Aubrey Jaffer's website, we'll find many links concerning the theoretical studies.
\begin{center}
\url{http://people.csail.mit.edu/jaffer/Marbling/}
\end{center}
Compared to the previous version, Aubrey Jaffer has reviewed some parameters:

\texttt{/vortex} now models a Lamb-Oseen vortex. We'll refer to the article he wrote to study the theory:
\begin{center}
\url{http://people.csail.mit.edu/jaffer/Marbling/vortex.pdf}
\end{center}
The documentation illustrates the parameters that are now used:

Center coordinates in mm, circulation in $\mathrm{mm^2/s}$ and time in s.

The primitive \texttt{/line} has now become \texttt{/rake} and allows to represent the obtained image when the artist equips himself with a comb (rake) comprising a certain number of identical teeth of a given diameter. He places the comb perpendicularly to a direction fixed by the angle made with the $Oy$-axis (the angle is positive clockwise) and moves it with a speed of (\texttt{V}) along the indicated direction or contrary to it, depending on the sign of the parameter \texttt{tU}. The positions of the teeth are fixed by the distances (in mm) indicated within the list [between the brackets]---the comb/rake can also comprise only one tooth.

By default, the tank's dimensions are 1 m $\times$ 1 m. The scaling factor of the image is 0.1. All lengths are in mm, velocities (in mm/s), angles (in degrees), angular velocity (in degrees/s), and viscosity and circulation (in $\mathrm{mm^2/s}$).

For a convex stylus (or tine), \texttt{D} (in mm) is the ratio of its submerged volume to its wetted surface area. For a long cylinder it is its diameter.

Aubrey Jaffer retains 1 global parameter: the dynamic viscosity, see in particular the document ``Oseen Flow in Paint Marbling'':
\begin{center}
\url{https://arxiv.org/abs/1702.02106}
\end{center}
There are 10 types of actions defined and ready to use:
\begin{verbatim}
    /drop
    random-drops
    random-drops-colors
    concentric-bands
    /rake
    /stroke
    /stir
    /vortex
    /wiggle
    /offset
\end{verbatim}
They make it possible to create a very large variety of marblings with combinations of the various actions.

Initially there are drops of colors that the artist spreads with a brush on the surface (a bit of a hazard, even if they are located in a given region) and whose size depends on the brush. He performs the operation several times with other colors and also brushes of different sizes. These single drops, circular in shape, are placed with the following command
\begin{verbatim}
    cx cy r [bgc] [rgb]
   [ 0 0 100 [] [0 0 1] /drop]
\end{verbatim}
Note, that the coordinates (\texttt{cx, cy}) of the center of the drop and its radius \texttt{r} are in points, the colors need to be setup in the rgb-color-system: (values between 0 and 1). Details are given in the following sections. So this is the first phase: arrange the drops on the surface in several stages with different radii and colors. To facilitate the experimentation of different types of actions, Aubrey Jaffer imagined an initial background obtained by dropping (one after the other) drops of different colors (we can also differentiate their radii) at the same point, they all have the same center, we then obtain an initial background consisting of concentric rings, named ``concentric-bands''.

Aubrey Jaffer coded all the possible simulations with the expected deformations (rake, stroke, stir, wiggle, vortex) in pure PostScript and his new code, perfectly structured, and whose use is very simple, would be enough to itself, if it weren't necessary for each test, to add lines, delete others, save them within the original PostScript file \ldots

Therefore, Manuel Luque and Jürgen Gilg have decided to adapt that into PSTricks (with the agreement of Aubey Jaffer). A \verb+\psMarble+ command to switch easily between the different types of actions and add a global viscosity parameter to the PostScript code. There are two ways to calculate and represent the drops.
\begin{itemize}
\item We are interested only in their contour whose transformation is calculated after each addition of a new drop and whose interior is colored with its color (each drop retains its color);
\item in the second case we consider the surface as a grid of points (square pixels of side 1 pt) and each drop is represented by the points situated between its edges.
\end{itemize}
When a new drop is placed, the points in that drop retain their color, the outer points are calculated before being assigned their initial color. This possibility is operational by taking a negative value for the viscosity.

The documentation contains, of course, some more other information than within this short introduction and is likely to be reworked and completed as well as the code.


\newpage


\section{Techniques}

\subsection{Drop paint}

The first drop of paint placed within water forms a circle with the area $a$. If a second drop with the area $b$ is placed within the center of the first drop, the total area increases from $a$ to $a+b$. For the first drop, points very close to the center will change from an infinitely small radius to a radius $\sqrt{b/\pi}$; and the points on the border of the circle will change from $\sqrt{a/\pi}$ to $\sqrt{(a+b)/\pi)} $. If we take 2 drops of different colors, this gives:
\begin{center}
\begin{pspicture}(-2,-2)(2,2)
\psMarble[viscosity=120,drawcontours,linewidth=0.2,
   background=1 1 1,
   actions={
      [ 0 0 100 [] [0 0 1] /drop]
           }
         ](4,4)
\psgrid[subgriddiv=0,gridcolor=red!30,subgridcolor=green,gridlabels=0pt,griddots=10]
\end{pspicture}
%\hfill
\begin{pspicture}(-2,-2)(2,2)
\psMarble[viscosity=120,drawcontours,linewidth=0.2,
   background=1 1 1,
   actions={
      [ 0 0 200 [] [0 0 1] /drop]
      [ 0 0 150 [] [1 0 0] /drop]
           }
         ](4,4)
\psgrid[subgriddiv=0,gridcolor=red!30,subgridcolor=green,gridlabels=0pt,griddots=10]
\end{pspicture}
%\hfill
\begin{pspicture}(-2,-2)(2,2)
\psMarble[viscosity=120,% drawcontours,linewidth=0.1,
   background=1 1 1,
   actions={
      [ 0 0 200 [] [0 0 1] /drop]
      [ 0 0 150 [] [1 0 0] /drop]
           }
         ](4,4)
\psgrid[subgriddiv=0,gridcolor=red!30,subgridcolor=green,gridlabels=0pt,griddots=10]
\end{pspicture}
\end{center}
The command to drop a drop is written as follows:
\begin{verbatim}
       cx cy r      r g b
      [ 0 0 100 [] [0 0 1] /drop]
\end{verbatim}
Note that the coordinates of the center of the drop and its radius are in points\footnote {There is a scaling. Example: if the largest dimension of the page is 4, 100 pts will be represented 0.4 cm} and its color is in the system rgb: (values between 0 and 1).

When we place the second drop of radius $r$ at the point $C(cx,cy)$, Aubrey Jaffer considers that this one remains round, intact, but that the first then undergoes the influence of the second and deforms according to the law:
\[
\vec P'=\vec C+\left(\vec P-\vec C\right)\sqrt{1+{r^2\over \left\|\vec P-\vec C\right\|^2}}
\]
$P(x,y)$ is a point of the first drop and $P'(x',y')$ the transformed point.
\begin{center}
\begin{pspicture}(-2,-2)(2,2)
\psMarble[viscosity=120,
   background=1 1 1,
   actions={
      [ 0 0 150 [] [0 0 1] /drop]
           }
         ](4,4)
\rput(0,0){\white 1}
\psgrid[subgriddiv=0,gridcolor=red!30,subgridcolor=green,gridlabels=0pt,griddots=10]
\end{pspicture}
\hspace{1cm}
\begin{pspicture}(-2,-2)(2,2)
\psMarble[viscosity=120,
   background=1 1 1,
   actions={
      [ 0 0 150 [] [0 0 1] /drop]
      [ -250 0 150 [] [1 0 0] /drop]
           }
         ](4,4)
\rput(0,0){\white 1}
\rput(!-250 0.004 mul 0){2}
\psgrid[subgriddiv=0,gridcolor=red!30,subgridcolor=green,gridlabels=0pt,griddots=10]
\end{pspicture}
\end{center}
If a third drop is placed, the two previous drops will then be influenced by the third, which remains intact.
\begin{center}
\begin{pspicture}(-2,-2)(2,2)
\psMarble[viscosity=120,
   background=1 1 1,
   actions={
      [ 0 0 150 [] [0 0 1] /drop]
           }
         ](4,4)
\rput(0,0){\white 1}
\psgrid[subgriddiv=0,gridcolor=red!30,subgridcolor=green,gridlabels=0pt,griddots=10]
\end{pspicture}
\begin{pspicture}(-2,-2)(2,2)
\psMarble[viscosity=120,
   background=1 1 1,
   actions={
      [ 0 0 150 [] [0 0 1] /drop]
      [ -250 0 150 [] [1 0 0] /drop]
           }
         ](4,4)
\rput(0,0){\white 1}
\rput(!-250 0.004 mul 0){2}
\psgrid[subgriddiv=0,gridcolor=red!30,subgridcolor=green,gridlabels=0pt,griddots=10]
\end{pspicture}
\begin{pspicture}(-2,-2)(2,2)
\psMarble[viscosity=120,
   background=1 1 1,
   actions={
      [ 0 0 150 [] [0 0 1] /drop]
      [ -250 0 150 [] [1 0 0] /drop]
      [ 250 0 150 [] [0 1 0] /drop]
           }
         ](4,4)
\rput(0,0){\white 1}
\rput(!-250 0.004 mul 0){2}
\rput(!250 0.004 mul 0){3}
\psgrid[subgriddiv=0,gridcolor=red!30,subgridcolor=green,gridlabels=0pt,griddots=10]
\end{pspicture}
\end{center}
All drops are influenced by the last drop deposited.


\subsection{Random drops}

One of the techniques is to project with a brush drops of color on the surface of the liquid in several stages by changing color. The position of the drops is therefore random. Each drop influences its neighbors and assuming that initially the drops would form a round spot on the surface, they will deform depending on the size and proximity of neighbors. The modeling of this phenomenon has been studied in the document ``\textit{Mathematical Marbling}'' by Shufang Lu, Aubrey Jaffer, Xiaogang Jin, Hanli Zhao and Xiaoyang Mao.
\begin{center}
\url{http://people.csail.mit.edu/jaffer/Marbling/Mathematics}
\end{center}
\begin{center}
\url{https://www.computer.org/csdl/mags/cg/2012/06/mcg2012060026-abs.html}
\end{center}
Then, with a fine stick, a comb one tries to draw the marbling.

The following example illustrates that technique. Three steps with drops of different size and color on which 2 swirls are applied.

\begin{minipage}[t]{6cm}\kern0pt
\begin{pspicture}(-3,-4)(3,4)
\psMarble[%
    actions={
    250 {
     [random:uniform 1000 mul 500 sub  % -500 <x<500
      random:uniform 1000 mul 500 sub  % -500 <y<500
      30 background [0.960 0.764 0.576] /drop]
    } repeat
    200 {
     [random:uniform 1000 mul 500 sub  % -500 <x<500
      random:uniform 1000 mul 500 sub  % -500 <y<500
      25 background [0.270 0.035 0.058] /drop]
    } repeat
    100 {
     [random:uniform 1000 mul 500 sub  % -500 <x<500
      random:uniform 1000 mul 500 sub  % -500 <y<500
     20 background [0.866 0.353 0.000  ] /drop]
    } repeat
    [ 300 200 -32e2 750 /vortex ]
    [ 0 -300  32e2 750 /vortex ]}](6,8)
\end{pspicture}
\end{minipage}
\hfill
\begin{minipage}[t]{10cm}\kern0pt
{\small\begin{verbatim}
\begin{pspicture}(-3,-4)(3,4)
\psMarble[%
    actions={
    250 {
     [random:uniform 1000 mul 500 sub  % -500 <x<500
      random:uniform 1000 mul 500 sub  % -500 <y<500
      30 background [0.960 0.764 0.576] /drop]
    } repeat
    200 {
     [random:uniform 1000 mul 500 sub  % -500 <x<500
      random:uniform 1000 mul 500 sub  % -500 <y<500
      25 background [0.270 0.035 0.058] /drop]
    } repeat
    100 {
     [random:uniform 1000 mul 500 sub  % -500 <x<500
      random:uniform 1000 mul 500 sub  % -500 <y<500
     20 background [0.866 0.353 0.000  ] /drop]
    } repeat
    [ 300 200 -32e2 750 /vortex ]
    [ 0 -300 32e2 750 /vortex ]}](6,8)
\end{pspicture}
\end{verbatim}}
\end{minipage}


\newpage


\subsection{Concentric rings}

Aubrey Jaffer describes the idea of ``concentric rings'' in:
\begin{center}
\url{http://people.csail.mit.edu/jaffer/Marbling/Mathematics}
\end{center}
\begin{quote}\itshape
``At the start of the real marbling process, paints are dropped from one or more locations to form expanding disks on a substrate. The mathematics is described in \href{http://people.csail.mit.edu/jaffer/Marbling/Dropping-Paint}{\emph{Dropping Paint}}. For now, we just want an paint pattern which shows subsequent displacements. In my first renderings, 5 virtual paints are dropped from the center to form 25 concentric rings of equal radial width.

The boundaries between virtual paint rings will be traversed using the Minsky circle algorithm; although walking the circles using coordinates generated by sin and cos would work as well. The angular step size is made inversely proportional to the ring radius, making the distance between successive points uniform.''
\end{quote}
\begin{center}
\begin{pspicture}(-4,-4)(4,4)
\psMarble(8,8)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-4,-4)(4,4)
\psMarble(8,8)
\end{pspicture}
\end{verbatim}}


\newpage


\section{The command \Lcs{psMarble}}

\begin{BDef}
\Lcs{psMarble}\OptArgs\Largr{x , y}
\end{BDef}

The command \Lcs{psMarble} contains the options \nxLkeyword{actions=}, \nxLkeyword{background=}, \nxLkeyword{bckg=true/false}, \nxLkeyword{viscosity=}, \nxLkeyword{drawcontours=true/false} and \nxLkeyword{colors=}.

The optional argument \Largr{x , y} gives the \texttt{x} and \texttt{y} dimension of the image---the default is \Largr{10,10}.

\medskip

\begin{quote}
\begin{tabularx}{\linewidth}{ @{} l >{\ttfamily}l X @{} }\toprule
\textbf{Name}           & \textbf{Default}  & \textbf{Meaning} \\\midrule
\Lkeyword{actions}      & 0 0 40 colors length concentric-bands  & The type of marbling action\\
\Lkeyword{background}   & 0 0 0             & Background color\\
\Lkeyword{bckg}         & true & Boolean: to turn on/off the background color\\
\Lkeyword{colors}       & \parbox{5cm}{
    [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]
    }%
                                  & Colors of the marbling to be set within the rgb-color-system\\
\Lkeyword{drawcontours} & false   & Boolean: if set to \texttt{true}, it only draws the contours\\
\Lkeyword{viscosity}    & 1000    & Global primitive: viscosity of the system---if taken negative pixeled image\\
\bottomrule
\end{tabularx}
\end{quote}

\medskip

\textbf{Notes:}

\begin{itemize}
\item If \texttt{viscosity<0}, the image will be pixeled, if set to positive values it will be non-pixeled.
\item The boolean option \texttt{drawcontours} is by default set to \texttt{false}. If set to \texttt{true}, only the contours are drawn within the image.
\item Sometimes it is quite helpful to be able to turn off the background color. This can be handled with the boolean key \texttt{bckg}, which if set to \texttt{false} turns off the background color.
\item All colors need to be setup within the rgb-color-system.

    If one has a color from another color systen, for example:

    \texttt{0.5 1 1 sethsbcolor} it is sufficient to just add \texttt{currentrgbcolor} at its end, like

    \texttt{0.5 1 1 sethsbcolor currentrgbcolor} to get the equivalent within the rgb-color-system.
\item Following are introduced some basic actions, like \texttt{/drop}, \texttt{random-drops}, \texttt{random-drops-colors}, \texttt{concentric-bands}, \texttt{/rake}, \texttt{/stroke}, \texttt{/stir}, \texttt{/vortex}, \texttt{/wiggle} and \texttt{/offset}.

    Within the basic actions \texttt{/stir} and \texttt{/vortex}, there is defined each with a radius \texttt{r} parameter. If \texttt{r>0} is set, the deformation is counterclockwise, if set to positive values, the deformation is clockwise.
\end{itemize}


\newpage


\section{Rendering}

As designs get more complicated, hundreds of drops and strokes, reverse-rendering is the only practical way to render them.  As the number of strokes increases, the number of points in the contours needs to increase as well. As the number of drops increases, the time to compute each pixel becomes less than the time to compute each contour-point on the drops.

The reason that we don't always reverse-render is because its resolution is limited to the raster; forward-rendering designs remain crisp at any magnification.
\begin{itemize}
\item To use forward-rendering (pixelfree) we choose the option \texttt{viscosity>0} with a positive value.
\item To use reverse-rendering (pixeled) we choose the option \texttt{viscosity<0} with a negative value. When a new drop is placed, the points in that drop retain their color, the outer points are calculated before being assigned their initial color. This possibility is operational by taking for \texttt{viscosity} (characteristic constant) a negative value.
\end{itemize}

\begin{minipage}[t]{6cm}\kern0pt
\begin{pspicture}(-3,-3)(3,3)
\psMarble[viscosity=-1000](6,6)
\end{pspicture}
{\small\begin{verbatim}
\begin{pspicture}(-3,-3)(3,3)
\psMarble[viscosity=-1000](6,6)
\end{pspicture}
\end{verbatim}}
\end{minipage}
\hfill
\begin{minipage}[t]{6cm}\kern0pt
\begin{pspicture}(-3,-3)(3,3)
\psMarble[viscosity=1000](6,6)
\end{pspicture}
{\small\begin{verbatim}
\begin{pspicture}(-3,-3)(3,3)
\psMarble[viscosity=1000](6,6)
\end{pspicture}
\end{verbatim}}
\end{minipage}


\newpage


\section{Colors}

All colors are setup within the rgb-color-system. Besides the preset \nxLkeyword{colors=} which are initially setup within the \texttt{pst-marble.pro}, we can change them within the concentric circles basic figure \texttt{concentric-bands} as follows:

\begin{minipage}[t]{6cm}\kern0pt
\begin{pspicture}(-3,-3)(3,3)
\psMarble(6,6)
\end{pspicture}
{\small\begin{verbatim}
\begin{pspicture}(-3,-3)(3,3)
\psMarble(6,6)
\end{pspicture}
\end{verbatim}}
\end{minipage}
\hfill
\begin{minipage}[t]{6cm}\kern0pt
\begin{pspicture}(-3,-3)(3,3)
\psMarble[colors={
[0.134 0.647 1.0  ]
[0.977 0.855 0.549]
[0.684 0.638 0.702]
[0.73 0.965 0.942 ]
[0.04 0.236 0.424 ]
}](6,6)
\end{pspicture}
{\small\begin{verbatim}
\begin{pspicture}(-3,-3)(3,3)
\psMarble[colors={
[0.134 0.647 1.0  ]
[0.977 0.855 0.549]
[0.684 0.638 0.702]
[0.73 0.965 0.942 ]
[0.04 0.236 0.424 ]
}](6,6)
\end{pspicture}
\end{verbatim}}
\end{minipage}

\bigskip

\textbf{Note:} As experience tells, not all colors will print as well as shown within the PDF file, so one has to print the image to see if the colors are OK for a paper. Here a list of colors that print well:

\bigskip

\definecolor{printcolorA}{rgb}{0.275 0.569 0.796}
\definecolor{printcolorB}{rgb}{0.965 0.882 0.302}
\definecolor{printcolorC}{rgb}{0.176 0.353 0.129}
\definecolor{printcolorD}{rgb}{0.635 0.008 0.094}
\definecolor{printcolorE}{rgb}{0.078 0.165 0.518}
\definecolor{printcolorF}{rgb}{0.824 0.592 0.031}
\definecolor{printcolorG}{rgb}{0.059 0.522 0.392}
\definecolor{printcolorH}{rgb}{0.816 0.333 0.475}
\definecolor{printcolorI}{rgb}{0.365 0.153 0.435}
\definecolor{printcolorJ}{rgb}{0.624 0.588 0.439}

\newcommand{\myPrint}[2]{%
\begin{pspicture}(-1.6,-1)(1.6,1)
\psframe[linecolor=#1,fillstyle=solid,fillcolor=#1](-1.6,-1)(1.6,1)
\rput(0,0){\footnotesize[#2]}
\end{pspicture}
}

\bigskip

{\renewcommand{\arraystretch}{2.75}
\begin{tabular}{ccccc}
\myPrint{printcolorA}{0.275 0.569 0.796} &
\myPrint{printcolorB}{0.965 0.882 0.302} &
\myPrint{printcolorC}{0.176 0.353 0.129} &
\myPrint{printcolorD}{0.176 0.353 0.129} &
\myPrint{printcolorE}{0.078 0.165 0.518} \\
\myPrint{printcolorF}{0.824 0.592 0.031} &
\myPrint{printcolorG}{0.059 0.522 0.392} &
\myPrint{printcolorH}{0.816 0.333 0.475} &
\myPrint{printcolorI}{0.365 0.153 0.435} &
\myPrint{printcolorJ}{0.624 0.588 0.439}
\end{tabular}}


\newpage


\section{Basic actions}

Some of the deformation \nxLkeyword{actions=} which are initially setup within the \texttt{pst-marble.pro} can be manually changed by its parameters:


\subsection{\texttt{/drop}}

\texttt{/drop} defines a single drop set on the surface of a liquid.
\begin{verbatim}
[ cx cy r [ bgc ] [ rgb ] /drop ]

cx, cy  Center coordinates
r       Radius of the paint drop
[bgc]   Background color of paint drop
[rgb]   Color of paint drop
\end{verbatim}
This initially is a circle with its center at \texttt{(cx,cy)} and a radius \texttt{r}. The paint color is defined by the rgb-color-system. The empty slot \texttt{[]} is the background drop color.

In order to interpolate the color in reverse-rendering, the adjacent color must be known.
\begin{center}
\begin{pspicture}(-3,-3)(3,3)
\psMarble[background=1 1 1, %white
actions={%
[ 0 0 50 [] [1 0 0] /drop]
[ -200 0 70 [] [0 1 0] /drop]
[ 200 0 100 [] [0 0 1] /drop]
}](6,6)
\end{pspicture}
\end{center}
\begin{verbatim}
\begin{pspicture}(-3,-3)(3,3)
\psMarble[background=1 1 1, %white
actions={%
[ 0 0 50 [] [1 0 0] /drop]
[ -200 0 70 [] [0 1 0] /drop]
[ 200 0 100 [] [0 0 1] /drop]
}](6,6)
\end{pspicture}
\end{verbatim}
\textbf{Note:} The paint drop top most on the stack is left undeformed (intact), whereas all the others are influenced by each other, according to the system constant. There are as well 6 colors predefined which can be used like that:
\begin{verbatim}
[ 0 0 50 [] color1 /drop]
[ -200 0 70 [] color2 /drop]
[ 200 0 100 [] color3 /drop]
\end{verbatim}


\newpage


\subsection{\texttt{random-drops}}

With \texttt{random-drops}, we randomly place drops onto a liquid surface within an area of (1 m $\times$ 1 m) with also randomly varying radii.

The varying radii of the drops are calculated with: $r=(\text{size (in mm)})\cdot \text{e}^{x}$, with: $\text{e}=2.71828182$ and $0<x<1$.

So the radii will vary between $r_\text{min}=\text{size}$  and $r_\text{max}=2.71828182\cdot \text{size}$

\begin{verbatim}
[ size [ color ] count random-drops ]

count   Number of the drops
size    Size of the drops
color   Color of the drops
\end{verbatim}

\textbf{Note:} If we choose a large number of drops, the compilation time increases.

\medskip

\textbf{Example 1:}

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
    actions={
%  size  color count
    50 [1 0 0 ] 10 random-drops
   }](10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
    actions={
%  size  color count
    50 [1 0 0 ] 10 random-drops
   }](10,10)
\end{pspicture}
\end{verbatim}}

\newpage

\textbf{Example 2:}

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
    actions={
%  size  color count
    50 [1 0 0 ] 10 random-drops
%  size  color count
    20 [0 0 1 ] 50 random-drops
%  size  color count
    15 [0 1 0 ] 100 random-drops
   }](10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
    actions={
%  size  color count
    50 [1 0 0 ] 10 random-drops
%  size  color count
    20 [0 0 1 ] 50 random-drops
%  size  color count
    15 [0 1 0 ] 100 random-drops
   }](10,10)
\end{pspicture}
\end{verbatim}}


\newpage


\subsection{\texttt{random-drops-colors}}

With \texttt{random-drops-colors}, we randomly place drops onto a liquid surface within an area of (1 m $\times$ 1 m) with also randomly varying radii and randomly chosen colors.

The varying radii of the drops are calculated with: $r=(\text{size (in mm)})\cdot \text{e}^{x}$, with: $\text{e}=2.71828182$ and $0<x<1$.

So the radii will vary between $r_\text{min}=\text{size}$  and $r_\text{max}=2.71828182\cdot \text{size}$

The varying colors are calculated with:

\verb+[background colors random:uniform colors length mul floor cvi get /drop]+

\begin{verbatim}
[ size  count random-drops-colors ]

count   Number of the drops
size    Size of the drops
\end{verbatim}

\textbf{Example:}

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
    actions={
% size count
    40 10 random-drops-colors
    25 20 random-drops-colors
    15 50 random-drops-colors
   }](10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
    actions={
% size count
    40 10 random-drops-colors
    25 20 random-drops-colors
    15 50 random-drops-colors
   }](10,10)
\end{pspicture}
\end{verbatim}}


\newpage


\subsection{\texttt{concentric-bands}}

With \texttt{concentric-bands}, we set the number of different colored concentric bands (\texttt{number of bands}) (at center \texttt{cx,cy}) with a \texttt{radius increment}.

The original PostScript code we find within \texttt{pst-marble.pro} as:
\begin{verbatim}
/concentric-bands{
% cx cy:              Center coordinates
% radius increment:   Multiplication coefficient between the sets of bands
% number of bands:    Number of drops within one set = number of elements
%                     within the [array of colors] list
%                     [array of colors]: this is the list of colors
%                                        within the colors={...} key
    /nbands 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
\end{verbatim}

\textbf{Explanation:}

We have 11 sets of drops, within every set, the drops have the same radii and their radii will decrease with every step. The last set is given by the argument \texttt{rinc} and all the other radii are a function of this final radius.

Within the first set of drops (with same radii), the number of drops is \texttt{nbands}---every drop of it has a color taken from the colors array and its radius values \texttt{sqrt(11)*rinc}.

The sets go from 11 to 1 with a step of 1, meaning that the second set has a radius of \texttt{sqrt(10)*rinc} etc.

The last set has a radius of \texttt{sqrt(1)*rinc=rinc}.

A last single drop is then added with the radius of \texttt{r=rinc/2}.



To code it within the \LaTeX{} file we use the following syntax:
\begin{verbatim}
[ cx cy RadInc NbrBands concentric-bands ]

cx, cy        Center coordinates
RadInc        Multiplication coefficient between the bands
NbrBands      Number of the elements within
              the [array of colors] list
              [array of colors]: this is the list of colors
                                 within the colors= key
\end{verbatim}


\newpage


\textbf{Example 1:}

\texttt{concentric-bands} is the default action of the \texttt{actions=\{...\}} key, meaning if \textbf{no} action is chosen, \texttt{concentric-bands} with its default radius increment and its default color list is in effect.
\begin{center}
\begin{pspicture}(-5,-5)(5,5)
    \psMarble(10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
    \psMarble(10,10)
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 2:}

If we want to change \texttt{RadInc} and \texttt{NbrBands}, we do the following:

\medskip

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[
    actions={
% cx cy RadInc NbrBands
  0   0   25    6       concentric-bands
   }](10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[
    actions={
% cx cy RadInc NbrBands
  0   0   25    6       concentric-bands
   }](10,10)
\end{pspicture}
\end{verbatim}}

\medskip

\textbf{Note:} If one increases \texttt{RadInc} to large values $>100$ the area of the annuli increases by square, so not all annuli will be shown within the image, however they are calculated, which leads to longer compilation times and increases the final file size.

Typical values are: $35<\text{\texttt{RadInc}}<50$

\newpage


\textbf{Example 3:}

If we like to change the colors as well, we do this with the \texttt{colors=\{...\}} key, as follows:

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[
    background=0.9 0.9 0.9,
    colors={
     [0.08 0.3 0.51 ]
     [0.18 0.76 1]
     [0.93 1 1]
     [0.08 0.3 0.51 ]
     [0.8 0.75 0.82]
     [1 0.99 0.65]
    },
     actions={
%   cx cy RadInc NbrBands
    0   0   25     6  concentric-bands
   }](10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[
    background=0.9 0.9 0.9,
    colors={
     [0.08 0.3 0.51 ]
     [0.18 0.76 1]
     [0.93 1 1]
     [0.08 0.3 0.51 ]
     [0.8 0.75 0.82]
     [1 0.99 0.65]
    },
     actions={
%   cx cy RadInc NbrBands
    0   0   25     6  concentric-bands
   }](10,10)
\end{pspicture}
\end{verbatim}}

\textbf{Note:} If the parameter \texttt{NbrBands} is i. e. set to 6, this means that there are six different colors within the bands in order (mod 6), so 6 colors should be setup within the \texttt{colors=\{...\}} key. If no colors are individually chosen by the \texttt{colors=\{...\}} key, the 6 predefined colors are used by default.


\newpage


\subsection{\texttt{/rake}}

This is to represent the image obtained when the artist is equipped with a comb (rake) containing a number of identical teeth of a given diameter. He places the comb perpendicularly to the direction fixed by the angle made with the axis $Oy$ (the angle is counted: if taken positive values---clockwise, if taken negative values---counterclockwise)  and moves it with a speed of \texttt{V} in the indicated direction or contrary to it, following the sign of the parameter \texttt{tU}. The positions of the teeth are set up by the distances (in mm) indicated [ between brackets ], the comb can also have only one tooth.

By default, the tank's dimensions are 1 m $\times$ 1 m. The scaling factor of the image is 0.1. All lengths are in mm, velocities (in mm/s), angles (in degrees), angular velocity (in degrees/s), and viscosity and circulation (in mm$^2$/s).

For a convex stylus or tine, \texttt{D} (in mm) is the ratio of its submerged volume to its wetted surface area. For a long cylinder it is its diameter.
\begin{verbatim}
[ angle [ r ] V tU D /rake ]

angle   Angle from y-axis in degrees; 0 is up.
         - If angle positve: direction is north-east (>90 south-east).
         - If angle negative: direction is north-west (<-90 south-west).
[ r ]   List of distances to the teeth of the rake from its center.
         - If r positive: distance to tooth, right to the indicated direction.
         - If r positive: distance to tooth, left to the indicated direction.
V       Stylus velocity in mm/s
tU      Distance between the original points and the deformed points
        along the stylus track.
         - If tU positive: deformation in the indicated direction.
         - If tU negative: deformation contrary to the indicated direction.
D       Stylus diameter in mm.  Make larger to affect paint farther away.
\end{verbatim}
For the following examples \texttt{viscosity=1000} is set. This is a typical value (default value).


\newpage


\textbf{Explanations for the key \texttt{tU}:}

Setting: \verb![ 45 [ 200 ] 20 -100 50 /rake]!

The orange circles are the ones without deformation. The black ones are the ones after deformation.
\begin{itemize}
\item Intersect orange outer circle with the yellow line $= P$ and $R$
\item Intersect the black outer circle with the yellow line $= Q$ and $S$
\end{itemize}
\begin{center}
\begin{pspicture*}(-5,-5)(5,5)
\psgrid[subgriddiv=1,gridcolor=lightgray!10]
\psMarble[viscosity=1000,
linewidth=0.1,
drawcontours,
bckg=false,
actions={9 -2 2
    {
    	/rad exch sqrt 50 mul def
    	[  0  0	rad background [0 0 0] /drop]
    } for
% angle r    V   tU   D
[ 45 [ 200 ] 20 -100 50 /rake]
}]%
\psMarble[viscosity=1000,
linewidth=0.1,
drawcontours,
bckg=false,
actions={9 -2 2
    {
    	/rad exch sqrt 50 mul def
    	[ 0  0	rad background [1 0.5 0] /drop]
    } for
}]%
\psline[linecolor=red](-5,-5)(5,5)
\rput(!2 sqrt 2 sqrt neg){\psline[linecolor=yellow](-5,-5)(5,5)}
\psarcn[linewidth=0.1]{->}(0,0){3}{90}{45}
\uput{3.1}[67.5](0,0){$\alpha=45^{\mathrm{o}}$}
\psline{->}(0,0)(!2 sqrt 2 sqrt neg)
\uput[45](!2 sqrt 2 div 2 sqrt 2 div neg){$r>0$}

\psdot[linecolor=blue,linewidth=0.2pt](2.43,-0.39)
\uput[0](2.43,-0.39){\textcolor{blue}{P}}
\psdot[linecolor=blue,linewidth=0.2pt](1.7,-1.165)
\uput[0](1.7,-1.165){\textcolor{blue}{Q}}
\psline[linecolor=blue,linewidth=1.5pt]{->}(2.43,-0.39)(1.7,-1.165)

\psdot[linecolor=blue,linewidth=0.2pt](0.4,-2.42)
\uput[0](0.4,-2.42){\textcolor{blue}{R}}
\psdot[linecolor=blue,linewidth=0.2pt](-0.3,-3.1)
\uput[0](-0.3,-3.1){\textcolor{blue}{S}}
\psline[linecolor=blue,linewidth=1.5pt]{->}(0.4,-2.42)(-0.3,-3.1)
\end{pspicture*}
\end{center}
\begin{itemize}
\item The distance between $P$ and $Q$ is $|\overrightarrow{PQ}|$:

$\text{\texttt{tU}}=|\overrightarrow{PQ}|=1\,\text{cm}$ with respect to the scaling factor 0.1 for the image, this gives \texttt{tU=100}, as it should.

\item The distance between $R$ and $S$ is $|\overrightarrow{RS}|$:

$\text{\texttt{tU}}=|\overrightarrow{RS}|=1\,\text{cm}$ with respect to the scaling factor 0.1 for the image, this gives \texttt{tU=100}, as it should.
\end{itemize}
\textbf{Note:} Within the given example \texttt{tU=-100} was chosen \textit{negative}. This indicates that the deformation is made contrary to the stylus track (set with \texttt{angle=45} (at a distance \texttt{[r=200]} from the red line) and drawn in yellow, so points to north-east, thus the deformation points move necessarily to south-west.


\newpage


\textbf{Example 1:} \verb+[ 45 [ 200 ] 20 -100 50 /rake]+

The angle is \texttt{angle=45}, means the direction of the stylus track north-east. (If the angle would be chosen to \texttt{angle=-45}, the stylus track would move north-west.

The distance \texttt{[r=200]} (in mm) of one tooth from the center of the rake on the right side referred to the stylus track direction, if \texttt{r} is taken positive; to the left side to the stylus track direction, if \texttt{r} is taken negative.\\
\textbf{Note:} The scaling factor of the image is 0.1. Thus 200 mm $\times$ 0.1 = 2 cm within the image.

The stylus velocity is given with \texttt{V=20} (in mm/s).

The distance  \texttt{tU=-100} between the original points and the deformed points along the stylus track is set to negative (the deformation is made contrary to the to the direction of the stylus track). If taken a positive value for \texttt{tU}, the deformation is made in the direction of the stylus track.

The stylus parameter \texttt{D} (given in mm) is the ratio of its submerged volume to its wetted surface area. The bigger this value, the wider the area of points that are affected by the deformation.
\begin{center}
\psscalebox{0.8}{%
\begin{pspicture*}(-5,-5)(5,5)
\psMarble[viscosity=1000,
linewidth=0.1,
drawcontours,
actions={30 -2 2
    {
    	/rad exch sqrt 50 mul def
    	[  0  0	rad background [0 0 0] /drop]
    } for
% angle r    V   tU   D
[ 45 [ 200 ] 20 -100 50 /rake]
}](10,10)%
\psline[linecolor=red](-5,-5)(5,5)
\rput(!2 sqrt 2 sqrt neg){\psline[linecolor=blue](-5,-5)(5,5)}
\psarcn[linewidth=0.1]{->}(0,0){2}{90}{45}
\uput{2.1}[67.5](0,0){$\alpha=45^{\mathrm{o}}$}
\psline{->}(0,0)(!2 sqrt 2 sqrt neg)
\uput[45](0.707,-0.707){$r>0$}
\rput(!2 sqrt 2 sqrt neg){\psline[linecolor=red,linewidth=0.1]{->}(0,0)(1;225)}
\rput(0.6,-1.7){\red tU}
\psgrid[subgriddiv=1,griddots=10,gridlabels=0pt]
\end{pspicture*}}
\end{center}
{\small\begin{verbatim}
\begin{pspicture*}(-5,-5)(5,5)
\psMarble[viscosity=1000,linewidth=0.1,drawcontours,
actions={30 -2 2
    {
    	/rad exch sqrt 50 mul def
    	[  0  0	rad background [0 0 0] /drop]
    } for
% angle r    V   tU   D
[ 45 [ 200 ] 20 -100 50 /rake]
}](10,10)%
\psline[linecolor=red](-5,-5)(5,5)
\rput(!2 sqrt 2 sqrt neg){\psline[linecolor=blue](-5,-5)(5,5)}
\psarcn[linewidth=0.1]{->}(0,0){2}{90}{45}
\uput{2.1}[67.5](0,0){$\alpha=45^{\mathrm{o}}$}
\psline{->}(0,0)(!2 sqrt 2 sqrt neg)
\uput[45](0.707,-0.707){$r>0$}
\rput(!2 sqrt 2 sqrt neg){\psline[linecolor=red,linewidth=0.1]{->}(0,0)(1;225)}
\rput(0.6,-1.7){\red tU}
\psgrid[subgriddiv=1,griddots=10,gridlabels=0pt]
\end{pspicture*}
\end{verbatim}}


\newpage


\textbf{Example 2:} \verb+[ 45 [ 200 ] 20 100 50 /rake]+

The angle is \texttt{angle=45}, means the direction of the stylus track is north-east.

The distance \texttt{[r=200]} of one tooth from the center of the rake on the right side referred to the stylus track direction, if \texttt{r} is taken positive; to the left side to the stylus track direction, if \texttt{r} is taken negative.\\
\textbf{Note:} The scaling factor of the image is 0.1. Thus 200 mm $\times$ 0.1 = 2 cm within the image.

The stylus velocity is given with \texttt{V=20} (in mm/s).

The distance  \texttt{tU=100} between the original points and the deformed points along the stylus track is set to positive (the deformation is made to the direction of the stylus track).

The stylus parameter \texttt{D} (given in mm) is set to 50 mm.
\begin{center}
\psscalebox{0.8}{%
\begin{pspicture*}(-5,-5)(5,5)
\psMarble[viscosity=1000,linewidth=0.1,drawcontours,
actions={30 -2 2
    {
    	/rad exch sqrt 50 mul def
    	[  0  0	rad background [0 0 0] /drop]
    } for
% angle r V tU D
[ 45 [ 200 ] 20 100 50 /rake]
}](10,10)%
\psline[linecolor=red](-5,-5)(5,5)
\rput(!2 sqrt 2 sqrt neg){\psline[linecolor=blue](-5,-5)(5,5)}
\psarcn[linewidth=0.1]{->}(0,0){2}{90}{45}
\uput{2.1}[67.5](0,0){$\alpha=45^{\mathrm{o}}$}
\psline{->}(0,0)(!2 sqrt 2 sqrt neg)
\uput[45](0.707,-0.707){$r>0$}
\rput(!2 sqrt 2 sqrt neg){\psline[linecolor=red,linewidth=0.1]{->}(0,0)(1;45)}
\rput(2.5,-0.9){\red tU}
\psgrid[subgriddiv=1,griddots=10,gridlabels=0pt]
\end{pspicture*}}
\end{center}
{\small\begin{verbatim}
\begin{pspicture*}(-5,-5)(5,5)
\psMarble[viscosity=1000,linewidth=0.1,drawcontours,
actions={30 -2 2
    {
    	/rad exch sqrt 50 mul def
    	[  0  0	rad background [0 0 0] /drop]
    } for
% angle r     V tU   D
[ 45 [ 200 ] 20 100 50 /rake]
}](10,10)%
\psline[linecolor=red](-5,-5)(5,5)
\rput(!2 sqrt 2 sqrt neg){\psline[linecolor=blue](-5,-5)(5,5)}
\psarcn[linewidth=0.1]{->}(0,0){2}{90}{45}
\uput{2.1}[67.5](0,0){$\alpha=45^{\mathrm{o}}$}
\psline{->}(0,0)(!2 sqrt 2 sqrt neg)
\uput[45](0.707,-0.707){$r>0$}
\rput(!2 sqrt 2 sqrt neg){\psline[linecolor=red,linewidth=0.1]{->}(0,0)(1;45)}
\rput(2.5,-0.9){\red tU}
\psgrid[subgriddiv=1,griddots=10,gridlabels=0pt]
\end{pspicture*}
\end{verbatim}}


\newpage


\textbf{Example 3:} \verb+[ 0 [-500 100 500 {} for] 50 100 30 /rake]+

The angle is \texttt{angle=0}, means the direction of the stylus track is north.

The distance \texttt{[r]} is a list of 11 teeth: \texttt{[-500 100 500 {} for]} meaning the distances of the teeth are: \texttt{-500, -400, -300, -200, -100, 0, 100, 200, 300, 400, 500}. Starting at \texttt{-500} in steps of \texttt{100} up to \texttt{500}. (5 to the left of the indicated direction (the ones with negative values) and 5 to the right of the indicated direction (the ones with the positive values) and one tooth within the center.

The stylus velocity is given with \texttt{V=50} (in mm/s).

The distance  \texttt{tU=100} between the original points and the deformed points along the stylus track is set to positive (the deformation is made to the direction of the stylus track).

The stylus parameter \texttt{D} (given in mm) is set to 30 mm.

\begin{minipage}[t]{8cm}\kern0pt
\begin{center}
\begin{pspicture}(-4,-5)(4,5)
\psset{viscosity=1000}%
\psMarble[
actions={%
% cx cy radinc count
  0   0   35    6  concentric-bands
% angle r V tU D
% rake with 11 teeth aligned 1 cm (= 100 pts)
[ 0 [-500 100 500 {} for] 50 100 30 /rake]
}](8,10)%
\psMarble[
linewidth=0.05,
colors={[1 1 1]},
bckg=false,
drawcontours,
actions={%
% cx cy radinc count
  0   0   35    6  concentric-bands
% angle r V tU D
% rake with 11 teeth aligned 1 cm (= 100 pts)
[ 0 [-500 100 500 {} for] 50 100 30 /rake]
}](8,10)%
\end{pspicture}
\end{center}
\end{minipage}
\hfill
\begin{minipage}[t]{8cm}\kern0pt
{\small\begin{verbatim}
\begin{pspicture}(-4,-5)(4,5)
\psset{viscosity=1000}%
\psMarble[
actions={%
% cx cy radinc count
  0   0   35     6  concentric-bands
% angle r V tU D
% rake with 11 teeth aligned 1 cm (= 100 pts)
[ 0 [-500 100 500 {} for] 50 100 30 /rake]
}](8,10)%
\psMarble[
linewidth=0.05,
colors={[1 1 1]},
bckg=false,
drawcontours,
actions={%
% cx cy radinc count
  0   0   35     6  concentric-bands
% angle r V tU D
% rake with 11 teeth aligned 1 cm (= 100 pts)
[ 0 [-500 100 500 {} for] 50 100 30 /rake]
}](8,10)%
\end{pspicture}
\end{verbatim}}
\end{minipage}

\medskip

\textbf{Note:} Within this example two \verb+\psMarble+ commands are used! The second command of \verb+\psMarble+ is used to highlight the contours of the deformations in white color. Therefore it is needed to suppress the background color for this second command---which can be done with \texttt{bckg=false}.


\newpage


\subsection{\texttt{/stroke}}

The documentation is on the web page:
\begin{center}
\url{http://people.csail.mit.edu/jaffer/Marbling/Mathematics}
\end{center}
Parameters for \texttt{/stroke-deformation}: \texttt{bx, by, ex, ey, V, D}
\begin{verbatim}
[ bx by ex ey V D /stroke ]

bx, by   Beginning of stroke
ex, ey   End of stroke
V        Stylus velocity in mm/s
D        Stylus diameter in mm.  Make larger to affect paint farther away.
\end{verbatim}

\textbf{Example 1:}

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=250,
actions={%
0 0 35 6 concentric-bands
% X1 begin Y1 begin X2 end Y2 end V D
[ 30 sin 400 mul 30 cos 400 mul 30 sin 100 mul 30 cos 100 mul 50 10 /stroke ]
}](10,10)
\psset{linecolor=red,linewidth=0.1}
\pstVerb{/scaleFactor 10 1000 div def
/X1 30 sin 400 mul scaleFactor mul def /Y1 30 cos 400 mul scaleFactor mul def
/X2 30 sin 100 mul scaleFactor mul def /Y2 30 cos 100 mul scaleFactor mul def
}%
\psdot(!X1 Y1)\psline{->}(!X1 Y1)(!X2 Y2)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=250,
actions={%
0 0 35 6 concentric-bands
% X1 begin Y1 begin X2 end Y2 end V D
[ 30 sin 400 mul 30 cos 400 mul 30 sin 100 mul 30 cos 100 mul 50 10 /stroke ]
}](10,10)
\psset{linecolor=red,linewidth=0.1}
\pstVerb{/scaleFactor 10 1000 div def
/X1 30 sin 400 mul scaleFactor mul def /Y1 30 cos 400 mul scaleFactor mul def
/X2 30 sin 100 mul scaleFactor mul def /Y2 30 cos 100 mul scaleFactor mul def
}%
\psdot(!X1 Y1)\psline{->}(!X1 Y1)(!X2 Y2)
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 2:}

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=250,
actions={%
% cx cy radinc count
  0   0   35     6  concentric-bands
% X1 begin Y1 begin X2 end Y2 end V D
[ 30 sin 400 mul 30 cos 400 mul 30 sin 100 mul 30 cos 100 mul 200 30 /stroke ]
}](10,10)
\psset{linecolor=red,linewidth=0.1}
\pstVerb{/scaleFactor 10 1000 div def
/X1 30 sin 400 mul scaleFactor mul def
/Y1 30 cos 400 mul scaleFactor mul def
/X2 30 sin 100 mul scaleFactor mul def
/Y2 30 cos 100 mul scaleFactor mul def
}%
\psdot(!X1 Y1)%(!X2 Y2)
\psline{->}(!X1 Y1)(!X2 Y2)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=250,
actions={%
% cx cy radinc count
  0   0   35     6  concentric-bands
% X1 begin Y1 begin X2 end Y2 end V D
[ 30 sin 400 mul 30 cos 400 mul 30 sin 100 mul 30 cos 100 mul 200 30 /stroke ]
}](10,10)
\psset{linecolor=red,linewidth=0.1}
\pstVerb{/scaleFactor 10 1000 div def
/X1 30 sin 400 mul scaleFactor mul def
/Y1 30 cos 400 mul scaleFactor mul def
/X2 30 sin 100 mul scaleFactor mul def
/Y2 30 cos 100 mul scaleFactor mul def
}%
\psdot(!X1 Y1)%(!X2 Y2)
\psline{->}(!X1 Y1)(!X2 Y2)
\end{pspicture}
\end{verbatim}}


\newpage


\subsection{\texttt{/stir}}

Consider a single stylus (a cylinder of diameter \texttt{D}) that is placed on the $Oy$-axis at a distance $r$ from the chosen center. In a circular motion, the artist rotates the stylus by an angle $\theta$. The angular velocity will influence the shape of the deformation. The direction of rotation is fixed by the sign of $\theta$. If $\theta>0$ the artist rotates counterclockwise \footnote{The sign of $r$ can also indicate the direction of rotation. If $r<0$ the direction of the rotation fixed by $\theta$ inverts.}.
\begin{verbatim}
[ cx cy [ r ] w th D /stir ]

cx, cy      Center coordinates in mm.
[ r ]       List of radii in mm.
w           Angular velocity in degrees/s.
th=theta    Angle displacement at tines in degrees.
D           Tine diameter in mm.
\end{verbatim}

\medskip

\textbf{Explanations for the key \texttt{th}:}

Setting: \verb![ 0 0 [ 350 ] 10 70 10 /stir ]!

\textbf{All} points on the circle are rotated by \texttt{th=70}.  There is \textbf{no} partial stir operation.
\begin{center}
\begin{pspicture*}(-5,-5)(5,5)
\psgrid[subgriddiv=1,gridcolor=lightgray!10]
\psdot[dotstyle=+](0,0)
\pscircle[linestyle=dashed]{3.5}
\psMarble[viscosity=20,bckg=false,
    actions={
    [ 350 0 15 background [0.22 0.27 0.4]  /drop]
    [ 350 20 cos mul 350 20 sin mul 15 background [0.49 0.75 0.79] /drop]
    [ 350 40 cos mul 350 40 sin mul 15 background [0.9 0.8 0.47]   /drop]
    [ 350 60 cos mul 350 60 sin mul 15 background [0.98 0.27 0.317]/drop]
    }]
\psMarble[viscosity=20,bckg=false,
    actions={
    [ 350 0 15 background [0.22 0.27 0.4]  /drop]
    [ 350 20 cos mul 350 20 sin mul 15 background [0.49 0.75 0.79] /drop]
    [ 350 40 cos mul 350 40 sin mul 15 background [0.9 0.8 0.47]   /drop]
    [ 350 60 cos mul 350 60 sin mul 15 background [0.98 0.27 0.317]/drop]
   [ 0 0 [ 350 ] 10 70 10 /stir ]
    }]
\psarc[arrowinset=0]{->}(0,0){3.9}{0}{70}
\psline[linecolor=blue](0;0)(3.5;0)
\psline[linecolor=blue](0;0)(3.5;70)
\uput[30](3.9;35){$\theta=70^\mathrm{o}$}
\end{pspicture*}
\end{center}


\newpage


\textbf{Example 1:}

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[
    actions={
    9 -1 3
    {
	/rad exch sqrt 50 mul def
    [  0  0 rad background [0.22 0.27 0.4]  /drop]
    [  0  0 rad background [0.49 0.75 0.79] /drop]
    [  0  0 rad background [0.9 0.8 0.47]   /drop]
    [  0  0 rad background [0.98 0.27 0.317]/drop]
    } for
    [ 0 -100 [ 200 ] 10 60 30 /stir ]
    }](10,10)
\psdot[dotstyle=+,linecolor=white,linewidth=2pt](0,-1)
\pscircle[linestyle=dashed,linecolor=white](0,-1){2}
\psarc[linewidth=0.05,linestyle=dashed]{->}(0,-1){2}{90}{150}
\psline[linecolor=white,linestyle=dashed](0,-1)(0,1)
\psline[linecolor=white,linestyle=dashed](0,-1)(-1.732,0)
\psgrid[subgriddiv=1,griddots=10,gridlabels=0pt]
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[
    actions={
    9 -1 3
    {
	/rad exch sqrt 50 mul def
    [  0  0 rad background [0.22 0.27 0.4]  /drop]
    [  0  0 rad background [0.49 0.75 0.79] /drop]
    [  0  0 rad background [0.9 0.8 0.47]   /drop]
    [  0  0 rad background [0.98 0.27 0.317]/drop]
    } for
    [ 0 -100 [ 200 ] 10 60 30 /stir ]
    }](10,10)
\psdot[dotstyle=+,linecolor=white,linewidth=2pt](0,-1)
\pscircle[linestyle=dashed,linecolor=white](0,-1){2}
\psarc[linewidth=0.05,linestyle=dashed]{->}(0,-1){2}{90}{150}
\psline[linecolor=white,linestyle=dashed](0,-1)(0,1)
\psline[linecolor=white,linestyle=dashed](0,-1)(-1.732,0)
\psgrid[subgriddiv=1,griddots=10,gridlabels=0pt]
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 2:}

If the artist repeats the same gesture several times, a whirlwind effect is created:

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[
    actions={
    9 -1 3
    {
	/rad exch sqrt 50 mul def
    [  0  0 rad background [0.22 0.27 0.4]  /drop]
    [  0  0 rad background [0.49 0.75 0.79] /drop]
    [  0  0 rad background [0.9 0.8 0.47]   /drop]
    [  0  0 rad background [0.98 0.27 0.317]/drop]
    } for
   5{[ 0 -100 [ 200 ] 10 60 30 /stir ]} repeat
    }](10,10)
\psgrid[subgriddiv=1,griddots=10,gridlabels=0pt]
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[
    actions={
    9 -1 3
    {
	/rad exch sqrt 50 mul def
    [  0  0 rad background [0.22 0.27 0.4]  /drop]
    [  0  0 rad background [0.49 0.75 0.79] /drop]
    [  0  0 rad background [0.9 0.8 0.47]   /drop]
    [  0  0 rad background [0.98 0.27 0.317]/drop]
    } for
   5{[ 0 -100 [ 200 ] 10 60 30 /stir ]} repeat
    }](10,10)
\psgrid[subgriddiv=1,griddots=10,gridlabels=0pt]
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 3:}

The artist turns from two different centers, changing the direction of rotation.

\textbf{Note:} Doing multiple deformations, the order of them is of importance! See the following examples placed next to each other where only the order of deformations is changed.
\begin{center}
\begin{minipage}[t]{8cm}
\begin{pspicture}(-4,-5)(4,5)
\psMarble[
    actions={
    9 -1 3
    {
	/rad exch sqrt 50 mul def
    [  0  0 rad background [0.22 0.27 0.4]  /drop]
    [  0  0 rad background [0.49 0.75 0.79] /drop]
    [  0  0 rad background [0.9 0.8 0.47]   /drop]
    [  0  0 rad background [0.98 0.27 0.317]/drop]
    } for
   [ 0 200 [ 200 ] 10 60 30 /stir ]
   [ 0 -200 [ 200 ] -10 60 30 /stir ]
    }](8,10)
\end{pspicture}
{\small\begin{verbatim}
\begin{pspicture}(-4,-5)(4,5)
\psMarble[
actions={
9 -1 3
{
/rad exch sqrt 50 mul def
[  0  0 rad background [0.22 0.27 0.4]  /drop]
[  0  0 rad background [0.49 0.75 0.79] /drop]
[  0  0 rad background [0.9 0.8 0.47]   /drop]
[  0  0 rad background [0.98 0.27 0.317]/drop]
} for
[ 0 200 [ 200 ] 10 60 30 /stir ]
[ 0 -200 [ 200 ] -10 60 30 /stir ]
}](8,10)
\end{pspicture}
\end{verbatim}}
\end{minipage}
\hfill
\begin{minipage}[t]{8cm}
\begin{pspicture}(-4,-5)(4,5)
\psMarble[
    actions={
    9 -1 3
    {
	/rad exch sqrt 50 mul def
    [  0  0 rad background [0.22 0.27 0.4]  /drop]
    [  0  0 rad background [0.49 0.75 0.79] /drop]
    [  0  0 rad background [0.9 0.8 0.47]   /drop]
    [  0  0 rad background [0.98 0.27 0.317]/drop]
    } for
    [ 0 -200 [ 200 ] -10 60 30 /stir ]
    [ 0 200 [ 200 ] 10 60 30 /stir ]
    }](8,10)
\end{pspicture}
{\small\begin{verbatim}
\begin{pspicture}(-4,-5)(4,5)
\psMarble[
actions={
9 -1 3
{
/rad exch sqrt 50 mul def
[  0  0 rad background [0.22 0.27 0.4]  /drop]
[  0  0 rad background [0.49 0.75 0.79] /drop]
[  0  0 rad background [0.9 0.8 0.47]   /drop]
[  0  0 rad background [0.98 0.27 0.317]/drop]
} for
[ 0 -200 [ 200 ] -10 60 30 /stir ]
[ 0 200 [ 200 ] 10 60 30 /stir ]
}](8,10)
\end{pspicture}
\end{verbatim}}
\end{minipage}
\end{center}


\newpage


\subsection{\texttt{/vortex}}

\begin{verbatim}
[ cx cy circ t /vortex ]

cx, cy  Center coordinates in mm.
circ    Circulation (in mm^2/s) is a simple scale factor.
        Typical value: 30e3 mm^2/s.
t       Time after circulation impulse at center. As t gets very large, the
        whole surface returns to its original pattern, possibly with
        rigid rotation. Typical value 10 s.
\end{verbatim}

\texttt{/vortex} is modeled by a Lamb-Oseen vortex. We refer to the article written by Aubrey Jaffer:
\begin{center}
\url{http://people.csail.mit.edu/jaffer/Marbling/vortex.pdf}
\end{center}
The documentation illustrates the used parameters:

center coordinates in mm, circulation $\mathrm{mm}^2$/s and the time s.

After a long enough time, the whole surface returns to its initial state. This can be proofed within an animation to be compiled by the following verbatim code:

\begin{verbatim}
\documentclass{article}
\usepackage{pst-marble,animate}
\begin{document}
\begin{animateinline}[%
    controls,palindrome,
    begin={\begin{pspicture}(-5,-5)(5,5)},
    end={\end{pspicture}}
    ]{5}% 5 image/s
\multiframe{20}{rA=-3+0.65}{%
\psMarble[
     actions={%
     0 0 40 6 concentric-bands
    [ 0 0 20 background color1 /drop]
    [ 90 [ -400 400 600 {} for ] 40 200 31 /rake]
    [-90 [ -600 400 600 {} for ] 40 200 31 /rake]
    [0 0 -25200  5 \rA\space exp /vortex]
    }](10,10)
    }
\end{animateinline}
\end{document}
\end{verbatim}

Animated gifs can be seen at:
\begin{center}
\url{http://people.csail.mit.edu/jaffer/Marbling/}
\end{center}

\newpage


\textbf{Example 1:}

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
          background=1 1 1,
  actions= {
  9 -1 1
    {
        /rad exch sqrt 50 mul def
        [  0  0    rad background [0.08 0.3 0.51 ] /drop]
        [  0  0    rad background [0.18 0.76 1] /drop]
        [  0  0    rad background [0.93 1 1] /drop]
        [  0  0    rad background [0.08 0.3 0.51 ] /drop]
        [  0  0    rad background [0.8 0.75 0.82] /drop]
        [  0  0    rad background [1 0.99 0.65] /drop]
    } for
    [0 100 /offset]
    [ 0 0 -32e3 10 /vortex ]
    }](10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
          background=1 1 1,
  actions= {
  9 -1 1
    {
        /rad exch sqrt 50 mul def
        [  0  0    rad background [0.08 0.3 0.51 ] /drop]
        [  0  0    rad background [0.18 0.76 1] /drop]
        [  0  0    rad background [0.93 1 1] /drop]
        [  0  0    rad background [0.08 0.3 0.51 ] /drop]
        [  0  0    rad background [0.8 0.75 0.82] /drop]
        [  0  0    rad background [1 0.99 0.65] /drop]
    } for
    [0 100 /offset]
    [ 0 0 -32e3 10 /vortex ]
    }](10,10)
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 2:}

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,drawcontours,
linewidth=0.1,
background=1 1 1,
actions= {
9 -1 1
{
/rad exch sqrt 50 mul def
[ 0 0 rad background [0 0 0 ] /drop]
[ 0 0 rad background [0 0 0 ] /drop]
[ 0 0 rad background [0 0 0 ] /drop]
[ 0 0 rad background [0 0 0 ] /drop]
[ 0 0 rad background [0 0 0 ] /drop]
[ 0 0 rad background [0 0 0 ] /drop]
} for
[0 100 /offset]
[ 0 0 -32e3 10 /vortex ]
}](10,10)
\psdot[dotstyle=+,dotsize=0.25,linecolor=red](0,0)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,drawcontours,
linewidth=0.1,
background=1 1 1,
actions= {
9 -1 1
{
/rad exch sqrt 50 mul def
[ 0 0 rad background [0 0 0 ] /drop]
[ 0 0 rad background [0 0 0 ] /drop]
[ 0 0 rad background [0 0 0 ] /drop]
[ 0 0 rad background [0 0 0 ] /drop]
[ 0 0 rad background [0 0 0 ] /drop]
[ 0 0 rad background [0 0 0 ] /drop]
} for
[0 100 /offset]
[ 0 0 -32e3 10 /vortex ]
}](10,10)
\psdot[dotstyle=+,dotsize=0.25,linecolor=red](0,0)
\end{pspicture}
\end{verbatim}}


\newpage


\subsection{\texttt{/wiggle}}

This instruction simulates the action of an artist who with the tip of the stylus draws undulations on the surface of the liquid.
\begin{verbatim}
[ angle {func} /wiggle ]

angle    Wiggle will be perpendicular to angle from y-axis up.
{func}   Function that "wiggles" the original image.
\end{verbatim}
The direction is defined by the angle (we call it $\alpha=$ \texttt{angle}) with respect to the $y$-axis upwards; a positive value of $\alpha$ points clockwise.
\texttt{(dx, dy)} represents the unit vector in the desired deformation direction, $(u_x=\cos\alpha, u_y=\sin\alpha)$.
\[
a=f(y u_x -xu_y)\Longrightarrow x'=x+au_x;\ y'=y+au_y
\]


\newpage


\textbf{Example 1:}

If one wishes to obtain a sinusoidal undulation parallel to the axis $Oy$, we set $\alpha=0$. In this case $(u_x=1, u_y=0)$, and a function i. e., a sinusoidal function with amplitude 50 and angular velocity $\omega=5$: $f(x,y)=50\sin(5y)$ that is coded: \texttt{\{5 mul sin 50 mul\}}, we will have:

$x'=x+50\sin(5y); \ y'=y$.

It is recalled that the coordinates are in mm. If on the interval $-500 <x <500 $ we want 5 \textit{periods}, we will take as angular velocity: $\omega=5\times 360/1000 = 1.8$
\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[drawcontours,linewidth=0.2,
    actions={
    10 -1 1
    {
	/rad exch sqrt 50 mul def
    [  0  0 rad background [0.22 0.27 0.4]  /drop]
    [  0  0 rad background [0.49 0.75 0.79] /drop]
    [  0  0 rad background [0.9 0.8 0.47]   /drop]
    [  0  0 rad background [0.98 0.27 0.317]/drop]
    } for
    [ 0 {1.8 mul sin 50 mul} /wiggle]
    }](10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[drawcontours,linewidth=0.2,
    actions={
    10 -1 1
    {
	/rad exch sqrt 50 mul def
    [  0  0 rad background [0.22 0.27 0.4]  /drop]
    [  0  0 rad background [0.49 0.75 0.79] /drop]
    [  0  0 rad background [0.9 0.8 0.47]   /drop]
    [  0  0 rad background [0.98 0.27 0.317]/drop]
    } for
    [ 0 {1.8 mul sin 50 mul} /wiggle]
    }](10,10)
 \end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 2:}

For a sinusoidal undulation parallel to the axis $Ox$, we set $\alpha=90$. In that case $(u_x=0,u_y=1)$, the function becomes $f(x,y)=50\sin(5x)$ and is coded like that: \texttt{\{5 mul sin 50 mul\}}, thus:

$x'=x;\ y'=y+50\sin(5x)$.
\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[drawcontours,linewidth=0.2,
    actions={
    10 -1 1
    {
	/rad exch sqrt 50 mul def
    [  0  0 rad background [0.22 0.27 0.4]  /drop]
    [  0  0 rad background [0.49 0.75 0.79] /drop]
    [  0  0 rad background [0.9 0.8 0.47]   /drop]
    [  0  0 rad background [0.98 0.27 0.317]/drop]
    } for
    [ 90 {1.8 mul sin 50 mul} /wiggle]
    }](10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[drawcontours,linewidth=0.2,
    actions={
    10 -1 1
    {
	/rad exch sqrt 50 mul def
    [  0  0 rad background [0.22 0.27 0.4]  /drop]
    [  0  0 rad background [0.49 0.75 0.79] /drop]
    [  0  0 rad background [0.9 0.8 0.47]   /drop]
    [  0  0 rad background [0.98 0.27 0.317]/drop]
    } for
    [ 90 {1.8 mul sin 50 mul} /wiggle]
    }](10,10)
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 3:}

For a sinusoidal undulation in direction of the line $y=x$, we set $\alpha=45^\mathrm{o}$ :
\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[
    actions={
    10 -1 1
    {
	/rad exch sqrt 50 mul def
    [  0  0 rad background [0.22 0.27 0.4]  /drop]
    [  0  0 rad background [0.49 0.75 0.79] /drop]
    [  0  0 rad background [0.9 0.8 0.47]   /drop]
    [  0  0 rad background [0.98 0.27 0.317]/drop]
    } for
    [ 45 {2.5 mul sin 50 mul} /wiggle]
%    [ -45 {2.5 mul sin 50 mul} /wiggle]
    }](10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[
    actions={
    10 -1 1
    {
	/rad exch sqrt 50 mul def
    [  0  0 rad background [0.22 0.27 0.4]  /drop]
    [  0  0 rad background [0.49 0.75 0.79] /drop]
    [  0  0 rad background [0.9 0.8 0.47]   /drop]
    [  0  0 rad background [0.98 0.27 0.317]/drop]
    } for
    [ 45 {2.5 mul sin 50 mul} /wiggle]
%    [ -45 {2.5 mul sin 50 mul} /wiggle]
    }](10,10)
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 4:}

\textbf{Note:} These transformations can be combined and also be reversed, example:
\begin{center}
\begin{pspicture}(-4,-4)(4,4)
\psMarble[
      colors={
             [0.134 0.647 1.0  ]
             [0.977 0.855 0.549]
             [0.684 0.638 0.702]
             [0.73 0.965 0.942 ]
             [0.04 0.236 0.424 ]
         },
     actions={%
         0   0   50     5  concentric-bands
        [0 {3 mul sin 30 mul } /wiggle ]
        [0 {3 mul sin -30 mul } /wiggle ] % reverse action
             }](8,8)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-4,-4)(4,4)
\psMarble[
      colors={
             [0.134 0.647 1.0  ]
             [0.977 0.855 0.549]
             [0.684 0.638 0.702]
             [0.73 0.965 0.942 ]
             [0.04 0.236 0.424 ]
         },
     actions={%
         0   0   50     5  concentric-bands
        [0 {3 mul sin 30 mul } /wiggle ]
        [0 {3 mul sin -30 mul } /wiggle ] % reverse action
             }](8,8)
\end{pspicture}
\end{verbatim}}


\newpage


\subsection{\texttt{/offset}}

\begin{verbatim}
[ dx dy /offset ]

dx   Displacement of the image in x direction
dy   Displacement of the image in y direction
\end{verbatim}
The choice of units was made, so that 100 pts correspond to 1 cm within the image. \texttt{dx}, \texttt{dy} is the translation vector with which the image is shifted.
\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=50,
     actions={%
     0 0 35 6 concentric-bands
%     dx dy
    [100 100 /offset]}]
\pstVerb{/scaleFactor 10 1000 div def
         /xS1 100 scaleFactor mul def
         /yS1 100 scaleFactor mul def
         }%
\rput(!xS1 yS1){\psline(0.5,0)(-0.5,0)\psline(0,0.5)(0,-0.5)}
\psline[linestyle=dashed](-5,0)(5,0)
\psline[linestyle=dashed](0,-5)(0,5)
\psline[linecolor=red]{->}(0,0)(1,1)
\end{pspicture}
\end{center}
The displacement vector is given by \texttt{dx} and \texttt{dy} in pts.
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=50,
     actions={%
          0 0 35 6 concentric-bands
%          dx dy
         [100 100 /offset]}]
\pstVerb{/scaleFactor 10 1000 div def
         /xS1 100 scaleFactor mul def
         /yS1 100 scaleFactor mul def
         }%
\rput(!xS1 yS1){\psline(0.5,0)(-0.5,0)\psline(0,0.5)(0,-0.5)}
\psline[linestyle=dashed](-5,0)(5,0)
\psline[linestyle=dashed](0,-5)(0,5)
\psline[linecolor=red]{->}(0,0)(1,1)
\end{pspicture}
\end{verbatim}}


\newpage


\section{Combined actions -- Gallery}

\textbf{Example 1:}

\begin{center}
\begin{pspicture*}(-4,-1)(4,12)
\psMarble[viscosity=1000, background=0.9 0.9 0.9,
     actions={%
  0 0 45 6  concentric-bands
  [200 -100 /offset]
  -100 20 140
  { /idx exch def
    [-270 idx sub -30 idx 2 mul add [ -270 idx 3 mul sub ]  10 -90 50 /stir ]
    } for
   [90 {2 mul sin 10 mul} /wiggle ]
    }](12,24)
\end{pspicture*}
\end{center}
{\small\begin{verbatim}
\begin{pspicture*}(-4,-1)(4,12)
\psMarble[viscosity=1000, background=0.9 0.9 0.9,
     actions={%
  0 0 45 6  concentric-bands
  [200 -100 /offset]
  -100 20 140
  { /idx exch def
    [-270 idx sub -30 idx 2 mul add [ -270 idx 3 mul sub ]  10 -90 50 /stir ]
    } for
   [90 {2 mul sin 10 mul} /wiggle ]
    }](12,24)
\end{pspicture*}
\end{verbatim}}


\newpage


\textbf{Example 2:}

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
    background=0.9 0.9 0.9,
     actions={
    -400 200 400 {/cy exch def
    -400 200 400 {/cx exch def
    [  cx  cy  75 background [0.22 0.27 0.4] /drop]
        } for
        } for
    -400 200 400 {/cy exch def
    -400 200 400 {/cx exch def
    [  cx  cy  75 background [0.49 0.75 0.79] /drop]
        } for
        } for
    -400 200 400 {/cy exch def
    -400 200 400 {/cx exch def
    [  cx  cy  75 background [0.9 0.8 0.47] /drop]
        } for
        } for
    -400 200 400 {/cy exch def
    -400 200 400 {/cx exch def
    [  cx  cy  50 background [0.98 0.27 0.317] /drop]
        } for
        } for
[ 180 [-500 100 500 {} for] 50 100 30 /rake]
    }](10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
    background=0.9 0.9 0.9,
     actions={
    -400 200 400 {/cy exch def
    -400 200 400 {/cx exch def
    [  cx  cy  75 background [0.22 0.27 0.4] /drop]
        } for
        } for
    -400 200 400 {/cy exch def
    -400 200 400 {/cx exch def
    [  cx  cy  75 background [0.49 0.75 0.79] /drop]
        } for
        } for
    -400 200 400 {/cy exch def
    -400 200 400 {/cx exch def
    [  cx  cy  75 background [0.9 0.8 0.47] /drop]
        } for
        } for
    -400 200 400 {/cy exch def
    -400 200 400 {/cx exch def
    [  cx  cy  50 background [0.98 0.27 0.317] /drop]
        } for
        } for
[ 180 [-500 100 500 {} for] 50 100 30 /rake]
    }](10,10)
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 3:}

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[
  actions= {
    0 0 40 colors length concentric-bands
    [ 0 [ 0 ] 40 200 31 /rake ]
    [ 0 0 -32e3 750 /vortex ]
    }](10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[
  actions= {
    0 0 40 colors length concentric-bands
    [ 0 [ 0 ] 40 200 31 /rake ]
    [ 0 0 -32e3 750 /vortex ]
    }](10,10)
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 4:}

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=500,
  actions= {
    -500 100 500
    {
	/idy exch def
	-500 100 500
	{
   	    /idx exch def
   	    [ idx idy 55 [] [0.040 0.236 0.424] /drop ]
	} for
    } for
        250 {
     [rand 1000 mod 500 sub  % -800<x<800
      rand 1000 mod 500 sub  % -400<y<400
      rand 15 mod 10 add     % 10<r<20
      background [0.134 0.647 1 ] /drop]
      } repeat
    [ 45 [ -400 200 600 {} for ] 40 200 31 /rake]
    [ 100 0 [ -350 ] 30 30 15 /stir ]
    [-90 [ -500 200 600 {} for ] 40 200 31 /rake]
    [ 0 0 [ -150 ] 60 30 15 /stir ]
    }](10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=500,
  actions= {
    -500 100 500
    {
	/idy exch def
	-500 100 500
	{
   	    /idx exch def
   	    [ idx idy 55 [] [0.040 0.236 0.424] /drop ]
	} for
    } for
        250 {
     [rand 1000 mod 500 sub  % -800<x<800
      rand 1000 mod 500 sub  % -400<y<400
      rand 15 mod 10 add     % 10<r<20
      background [0.134 0.647 1 ] /drop]
      } repeat
    [ 45 [ -400 200 600 {} for ] 40 200 31 /rake]
    [ 100 0 [ -350 ] 30 30 15 /stir ]
    [-90 [ -500 200 600 {} for ] 40 200 31 /rake]
    [ 0 0 [ -150 ] 60 30 15 /stir ]
    }](10,10)
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 5:}

\begin{center}
\newpsstyle{YellowGlass}{linecolor=gray,linewidth=0.1}
\newpsstyle{LensStyleHandle}{%
fillstyle=gradient,framearc=0.6,linewidth=0.5\pslinewidth,
gradmidpoint=0.5,gradangle=45,gradbegin=white,gradend=gray}
\begin{pspicture}(-5,-5)(5,5)
\psset{viscosity=500,background=1 1 1,
   actions={
    3
    {
	/rad 100 def
    [  0  0    rad background [0.27 0.01 0.02] /drop]
    [  0  0    rad background [0.78 0.02 0.1]  /drop]
    [  0  0    rad background [0.77 0.92 0.47] /drop]
    [  0  0    rad background [0.11 0.18 0.07] /drop]
    [  0  0    rad background [0.96 0.85 0.1]  /drop]
    } repeat
    [ 0  0    100 background [0.78 0.02 0.1]  /drop]
    [ 0  0    50 background [0.77 0.92 0.47]  /drop]
    [ 0  0    20 background [00.11 0.18 0.0]  /drop]
     0 72 359
   {
       /a exch 2 mul def
       [ a sin 400 mul a cos 400 mul a sin 100 mul a cos 100 mul 10 50 /stroke ]
    } for
    }}%
\psMarble(10,10)
\PstLens[LensMagnification=2,LensRotation=50,LensSize=2,LensShadow=false,%
LensStyleGlass=YellowGlass](1,-1){%
\psMarble(10,10)}
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\newpsstyle{YellowGlass}{linecolor=gray,linewidth=0.1}
\newpsstyle{LensStyleHandle}{%
fillstyle=gradient,framearc=0.6,linewidth=0.5\pslinewidth,
gradmidpoint=0.5,gradangle=45,gradbegin=white,gradend=gray}
\begin{pspicture}(-5,-5)(5,5)
\psset{viscosity=500,background=1 1 1,
   actions={
    3
    {
	/rad 100 def
    [  0  0    rad background [0.27 0.01 0.02] /drop]
    [  0  0    rad background [0.78 0.02 0.1]  /drop]
    [  0  0    rad background [0.77 0.92 0.47] /drop]
    [  0  0    rad background [0.11 0.18 0.07] /drop]
    [  0  0    rad background [0.96 0.85 0.1]  /drop]
    } repeat
    [ 0  0    100 background [0.78 0.02 0.1]  /drop]
    [ 0  0    50 background [0.77 0.92 0.47]  /drop]
    [ 0  0    20 background [00.11 0.18 0.0]  /drop]
     0 72 359
   {
   /a exch 2 mul def
   [ a sin 400 mul a cos 400 mul a sin 100 mul a cos 100 mul 10 50 /stroke]
    } for
    }}%
\psMarble(10,10)
\PstLens[LensMagnification=2,LensRotation=50,LensSize=2,LensShadow=false,LensStyleGlass=YellowGlass](1,-1){%
\psMarble(10,10)}
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 6:}

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
    background=0.64 0.70 0.79,
        actions={%
   11 -1 1
    {
    /rad exch sqrt 50 mul def
    [  0  0    rad background [0.64 0.70 0.79] /drop]
    [  0  0    rad background [0.14 0.75 0.87] /drop]
    [  0  0    rad background [0.95 0.74 0   ] /drop]
    [  0  0    rad background [1 0.043 0.086 ] /drop]
    } for
-500 100 0 {/xpos exch def
     [xpos -500 xpos 0 50 20 /stroke]
     } for
0 100 500 {/xpos exch def
     [xpos 500 xpos 0 50 20 /stroke]
     } for
-500 100 0 {/ypos exch def
     [500 ypos 0 ypos 50 20 /stroke]
     } for
0 100 500 {/ypos exch def
     [-500 ypos 0 ypos 50 20 /stroke]
     } for
   }](10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
    background=0.64 0.70 0.79,
        actions={%
   11 -1 1
    {
    /rad exch sqrt 50 mul def
    [  0  0    rad background [0.64 0.70 0.79] /drop]
    [  0  0    rad background [0.14 0.75 0.87] /drop]
    [  0  0    rad background [0.95 0.74 0] /drop]
    [  0  0    rad background [1 0.043 0.086] /drop]
    } for
-500 100 0 {/xpos exch def
     [xpos -500 xpos 0 50 20 /stroke]
     } for
0 100 500 {/xpos exch def
     [xpos 500 xpos 0 50 20 /stroke]
     } for
-500 100 0 {/ypos exch def
     [500 ypos 0 ypos 50 20 /stroke]
     } for
0 100 500 {/ypos exch def
     [-500 ypos 0 ypos 50 20 /stroke]
     } for
   }](10,10)
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 7:}

\begin{center}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
          background=0.87 0.73 0.58,
  actions= {
    -500 84 500
    {
    /idy exch def
    -500 100 600
    {
           /idx exch def
           [ idx idy 45 background [0.298 0.370 0.247] /drop ]
    } for
    } for
    [ 90 [ -400 200 600 {} for ] 40 200 31 /rake]
    [-90 [ -500 200 600 {} for ] 40 200 31 /rake]
    [ 0 0 [ -350 ] 30 30 15 /stir ]
    [ 0 0 [ -150 ] 60 30 15 /stir ]
    }](10,10)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
          background=0.87 0.73 0.58,
  actions= {
    -500 84 500
    {
    /idy exch def
    -500 100 600
    {
           /idx exch def
           [ idx idy 45 background [0.298 0.370 0.247] /drop ]
    } for
    } for
    [ 90 [ -400 200 600 {} for ] 40 200 31 /rake]
    [-90 [ -500 200 600 {} for ] 40 200 31 /rake]
    [ 0 0 [ -350 ] 30 30 15 /stir ]
    [ 0 0 [ -150 ] 60 30 15 /stir ]
    }](10,10)
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 8:}

\begin{center}
\begin{pspicture}(-7.5,-8)(7.5,8)
\pstVerb{/ripple 75 def
/riplim ripple 6 mul def}%
\psMarble[
     actions={
     0 0 40 colors length concentric-bands
    [ 0 50 /offset]
    [  0 0 [ ripple ripple riplim {} for ] 10 180 30 /stir ]
    }](15,16)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-7.5,-8)(7.5,8)
\pstVerb{/ripple 75 def
/riplim ripple 6 mul def}%
\psMarble[
     actions={
     0 0 40 colors length concentric-bands
    [ 0 50 /offset]
    [  0 0 [ ripple ripple riplim {} for ] 10 180 30 /stir ]
    }](15,16)
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 9: Blendmodes}

In case one want to overlap various marblings one can use the following blendmodes:

\texttt{/Lighten}, \texttt{/Darken}, \texttt{/Normal}, \texttt{/Multiply}, \texttt{/Screen}, \texttt{/Overlay}, \texttt{/ColorDodge}, \texttt{/ColorBurn}, \texttt{/HardLight}, \texttt{/SoftLight}, \texttt{/Difference}, \texttt{/Exclusion}, \texttt{/Saturation}, \texttt{/Color}, \texttt{/Luminosity}.

The blendmode is setup right after \texttt{actions=\{} like: \texttt{/Darken .setblendmode} or some other of the blendmodes.

\medskip

\begin{center}
\begin{pspicture}(-4,-4)(4,4)
\psMarble[viscosity=1000,
    actions={
    50 [1 0 0 ] 10 random-drops
    20 [0 0 1 ] 50 random-drops
    15 [0 1 0 ] 100 random-drops
   }](8,8)
\psMarble[viscosity=1000,bckg=false,
  actions={
  /Darken .setblendmode
    -500 84 500
    {
	/idy exch def
	-500 100 600
	{
   	    /idx exch def
   	    [ idx idy 45 background [0.898 0.670 0.747] /drop ]
	} for
    } for
    [ 90 [ -400 200 600 {} for ] 40 200 31 /rake]
    [-90 [ -500 200 600 {} for ] 40 200 31 /rake]
    [ 0 0 [ -350 ] 30 30 15 /stir ]
    [ 0 0 [ -150 ] 60 30 15 /stir ]
    }](8,8)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-5,-5)(5,5)
\psMarble[viscosity=1000,
    actions={
    50 [1 0 0 ] 10 random-drops
    20 [0 0 1 ] 50 random-drops
    15 [0 1 0 ] 100 random-drops
   }](10,10)
\psMarble[viscosity=1000,bckg=false,
  actions={
  /Darken .setblendmode
    -500 84 500
    {
	/idy exch def
	-500 100 600
	{
   	    /idx exch def
   	    [ idx idy 45 background [0.898 0.670 0.747] /drop ]
	} for
    } for
    [ 90 [ -400 200 600 {} for ] 40 200 31 /rake]
    [-90 [ -500 200 600 {} for ] 40 200 31 /rake]
    [ 0 0 [ -350 ] 30 30 15 /stir ]
    [ 0 0 [ -150 ] 60 30 15 /stir ]
    }](10,10)
\end{pspicture}
\end{verbatim}}


\newpage


\textbf{Example 10: Transparency}

In case one want to overlap various marblings one can also use transparency:

The transparency is setup right after \texttt{actions=\{} like: \texttt{0.45 .setopacityalpha} or some other value between 0 and 1.

\medskip

\begin{center}
\begin{pspicture}(-4,-4)(4,4)
\psMarble[viscosity=1000,
    actions={
    50 [1 0 0 ] 10 random-drops
    20 [0 0 1 ] 50 random-drops
    15 [0 1 0 ] 100 random-drops
   }](8,8)
\psMarble[viscosity=1000,bckg=false,
  actions={
  0.45 .setopacityalpha
    -500 84 500
    {
	/idy exch def
	-500 100 600
	{
   	    /idx exch def
   	    [ idx idy 45 background [0.898 0.670 0.747] /drop ]
	} for
    } for
    [ 90 [ -400 200 600 {} for ] 40 200 31 /rake]
    [-90 [ -500 200 600 {} for ] 40 200 31 /rake]
    [ 0 0 [ -350 ] 30 30 15 /stir ]
    [ 0 0 [ -150 ] 60 30 15 /stir ]
    }](8,8)
\end{pspicture}
\end{center}
{\small\begin{verbatim}
\begin{pspicture}(-4,-4)(4,4)
\psMarble[viscosity=1000,
    actions={
    50 [1 0 0 ] 10 random-drops
    20 [0 0 1 ] 50 random-drops
    15 [0 1 0 ] 100 random-drops
   }](8,8)
\psMarble[viscosity=1000,bckg=false,
  actions={
  0.45 .setopacityalpha
    -500 84 500
    {
	/idy exch def
	-500 100 600
	{
   	    /idx exch def
   	    [ idx idy 45 background [0.898 0.670 0.747] /drop ]
	} for
    } for
    [ 90 [ -400 200 600 {} for ] 40 200 31 /rake]
    [-90 [ -500 200 600 {} for ] 40 200 31 /rake]
    [ 0 0 [ -350 ] 30 30 15 /stir ]
    [ 0 0 [ -150 ] 60 30 15 /stir ]
    }](8,8)
\end{pspicture}
\end{verbatim}}


\newpage


\section{List of all optional arguments for \texttt{pst-marble}}

\xkvview{family=pst-marble,columns={key,type,default}}

\clearpage

\nocite{*}
\bgroup
\RaggedRight
\printbibliography
\egroup

\printindex
\end{document}