summaryrefslogtreecommitdiff
path: root/graphics/pstricks/contrib/pst-fill/pst-fill.dtx
blob: 43961608a21ae7c3e030c8d39ed6387a5470f84e (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
% \iffalse meta-comment, etc.
%%
%% Package `pst-fill.dtx'
%%
%% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr>
%% Herbert Voss <voss@pstricks.de>
%%
%% This program can be redistributed and/or modified under the terms
%% of the LaTeX Project Public License Distributed from CTAN archives
%% in directory macros/latex/base/lppl.txt.
%%
%% DESCRIPTION:
%%   `pst-fill' is a PSTricks package for filling and tiling areas 
%%
% \fi
% \changes{v1.01}{2007/03/10}{bugfix for incomplete ifx (hv)}
% \changes{v1.00}{2006/11/06}{use pst-xkey for extend keys (hv)}
% \changes{v0.99}{2004/08/17}{merge the VTeX and TeX versions (patch 4) (hv)}
% \changes{v0.98}{2004/06/22}{delete the Pst@Debug option and use the
%   the one from pstricks to prevent a clash with pst-gr3d (hv)}
% \changes{v0.97}{2001/10/09}{make it work with VTeX (mv)}
% \changes{v0.94}{1997/04/08}{With a \PstTiling macro defined (or "tiling" optional parameter
%   on \textbackslash usepackage[tiling]{pst-fill}), this file run exactly as
%   the original boxfill.tex file from Timothy, version 0.94,
%   except a correction in \textbackslash pst@ManualFillCycle to avoid a division by 0.
%   It's the default.}
% \changes{v0.93}{1997/04/07}{With a \textbackslash PstTiling macro defined (or "tiling" optional parameter
%   on \textbackslash usepackage[tiling]{pst-fill}) there are several add-ons
%   and changes to do `tiling' rather than `filling' in "automatic" mode :
%     - we fix the position of the beginning of tiling,
%     - we allow normally the framing of the area as expected, using
%       the line.... parameters
%     - we define move parameters fillmovex, fillmovey and fillmove,
%     - we define fillcyclex as previous fillcycle parameter, and add the
%       fillcycley and fillcycle (both fillcyclex and fillcycley) ones
%     - we can extend the tiling area using fillloopaddx, fillloopaddy and
%       fillloopadd parameters,
%     - we can debug and see the whole tiling area without clipping using
%       PstDebug parameter,
%     - for names consistancy, we can use fillangle in place of boxfillangle
%       and fillsize in place of boxfillsize,
%     - default value for fillsep is 0 and for fillsize is auto.}
%
% \DoNotIndex{\!,\",\#,\$,\%,\&,\',\(,\+,\*,\,,\-,\.,\/,\:,\;,\<,\=,\>,\?}
% \DoNotIndex{\@,\@B,\@K,\@cTq,\@f,\@fPl,\@ifnextchar,\@nameuse,\@oVk}
% \DoNotIndex{\[,\\,\],\^,\_,\ }
% \DoNotIndex{\^,\\^,\\\^,$\^$,$\\^$,$\\^$}
% \DoNotIndex{\0,\2,\4,\5,\6,\7,\8,}
% \DoNotIndex{\A,\a}
% \DoNotIndex{\B,\b,\Bc,\begin,\Bq,\Bqc}
% \DoNotIndex{\C,\c,\catcode,\cJA,\CodelineIndex,\csname}
% \DoNotIndex{\D,\def,\define@key,\Df,\divide,\DocInput,\documentclass,\pst@addfams}
% \DoNotIndex{\eCN,\edef,\else,\eHd,\eMcj,\EnableCrossrefs,\end,\endcsname}
% \DoNotIndex{\endCenterExample,\endExample,\endinput,\endpsclip}
% \DoNotIndex{\PrintIndex,\PrintChanges,\ProvidesFile}
% \DoNotIndex{\endpspicture,\endSideBySideExample,\Example}
% \DoNotIndex{\F,\f,\FdUrr,\fi,\filedate,\fileversion,\FV@Environment}
% \DoNotIndex{\FV@UseKeyValues,\FV@XRightMargin,\FVB@Example,\fvset}
% \DoNotIndex{\G,\g,\GetFileInfo,\gr,\GradientLoaded,\gsFKrbK@o,\gsj,\gsOX}
% \DoNotIndex{\hbadness,\hfuzz,\HLEmphasize,\HLMacro,\HLMacro@i}
% \DoNotIndex{\HLReverse,\HLReverse@i,\hqcu,\HqY}
% \DoNotIndex{\I,\i,\ifx,\input,\Ir,\IU}
% \DoNotIndex{\j,\jl,\JT,\JVodH}
% \DoNotIndex{\K,\k,\kfSlL}
% \DoNotIndex{\L,\let}
% \DoNotIndex{\message,\mHNa,\mIU}
% \DoNotIndex{\N,\nB,\newcmykcolor,\newdimen,\newif,\nW}
% \DoNotIndex{\O,\oCDJDo,\ocQhVI,\OnlyDescription,\oRKJ}
% \DoNotIndex{\P,\p,\ProvidesPackage,\psframe,\pslinewidth,\psset}
% \DoNotIndex{\PstAtCode,\PSTricksLoaded}
% \DoNotIndex{\q,\Qr,\qssRXq,\qu,\qXjFQp,\qYL}
% \DoNotIndex{\R,\r,\RecordChanges,\relax,\RlaYI,\rN,\Rp,\rp,\RPDXNn,\rput}
% \DoNotIndex{\S,\scalebox,\SgY,\SideBySide@Example,\SideBySideExample}
% \DoNotIndex{\SgY,\sk,\Sp,\space,\sZb}
% \DoNotIndex{\T,\the,\tw@}
% \DoNotIndex{\u,\UiSWGEf@,\uJi,\usepackage,\uVQdMM,\UYj}
% \DoNotIndex{\VerbatimEnvironment,\VerbatimInput,\VrC@}
% \DoNotIndex{\WhZ,\WjKCYb,\WNs}
% \DoNotIndex{\XkN,\XW}
% \DoNotIndex{\Z,\ZCM,\Ze}
% \DoNotIndex{\addtocounter,\advance,\alph,\arabic,\AtBeginDocument,\AtEndDocument}
% \DoNotIndex{\AtEndOfPackage,\begingroup,\bfseries,\bgroup,\box,\csname}
% \DoNotIndex{\else,\endcsname,\endgroup,\endinput,\expandafter,\fi}
% \DoNotIndex{\TeX,\z@,\p@,\@one,\xdef,\thr@@,\string,\sixt@@n,\reset,\or,\multiply,\repeat,\RequirePackage}
% \DoNotIndex{\@cclvi,\@ne,\@ehpa,\@nil,\copy,\dp,\global,\hbox,\hss,\ht,\ifodd,\ifdim,\ifcase,\kern}
% \DoNotIndex{\chardef,\loop,\leavevmode,\ifnum,\lower}
% \setcounter{IndexColumns}{2}
%
% ^^A To extend the height used for the text
%
% ^^A  Aligned labels in a description environment
%\newenvironment{Description}[1]{%
%\begin{list}{nothing}{\setlength{\leftmargin}{#1}
%\setlength{\labelwidth}{\leftmargin}\setlength{\labelsep}{1mm}}}
%{\end{list}}
%
% ^^A For macro names
%\DeclareRobustCommand\cs[1]{\texttt{\char`\\#1}}
%
%
% ^^A From ltugboat.cls
% ^^A For references
%\makeatletter
%\newcommand\acro[1]{\textsc{#1}\@}
%\def\CTAN{\acro{CTAN}}
%\let\texttub\textsl              % ^^A redefined in other situations
%\def\TUB{\texttub{TUGboat}}
%\def\TUG{\TeX\ \UG}
%\def\tug{\acro{TUG}}
%\def\UG{Users Group}
% ^^A For the bibliography 
%\let\@internalcite\cite
%\def\cite{\def\@citeseppen{-1000}%
%    \def\@cite##1##2{(##1\if@tempswa , ##2\fi)}%
%    \def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
%\def\etal{et\,al.\@}
%\newcommand\CTANdirectory[1]{\expandafter\urldef
%  \csname CTAN@#1\endcsname\path}
%\newcommand\CTANfile[1]{\expandafter\urldef
%  \csname CTAN@#1\endcsname\path}
%\newcommand\CTANref[1]{\expandafter\@setref\csname CTAN@#1\endcsname
%  \relax{#1}}
%\makeatother
% ^^A Define CTAN addresses 
%\CTANdirectory{mpattern}{graphics/metapost/macros/mpattern}
%\CTANdirectory{pstricks}{graphics/pstricks}
%\CTANdirectory{pst-fill.sty}{graphics/pstricks/latex/pst-fill.sty}
%\CTANdirectory{pst-fill}{graphics/pstricks/generic/pst-fill.tex}
%\CTANdirectory{Roegel}{graphics/metapost/contrib/macros/truchet}
%\CTANdirectory{xypic}{macros/generic/diagrams/xypic}
%
% ^^A Personal macros (D.G.)
% ^^A ----------------------
%
% ^^A Some colors used
%\definecolor{LemonChiffon}{rgb}{1.,0.98,0.8}
%\definecolor{LightBlue}   {rgb}{0.8,0.85,0.95}
%\definecolor{PaleGreen}   {rgb}{0.88,1,0.88}
%\definecolor{PeachPuff}   {rgb}{1.0,0.85,0.73}
%
% ^^A To define a unique string for TeX and LaTeX
%\newcommand{\AllTeX}{%
%{\rm(L\kern-.36em\raise.3ex\hbox{\sc a}\kern-.15em)%
%T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
%
% ^^A Bibliography style
%\bibliographystyle{ltugbib}
%
% ^^A Name macros
%\newcommand{\FillPackage}{\textsf{`pst-fill'}}
%\newcommand{\XYpic}{%
%\leavevmode\hbox{\kern-.1em X\kern-.3em\lower.4ex\hbox{Y\kern-.15em}-pic}}
%
%\makeatletter
%
% ^^A Example environments
% ^^A (do not use in them the four JXYZ characters, that we will use
% ^^A as escape characters!)
%
% ^^A Default PSTricks parameters
%  \psset{dimen=middle}
%
% ^^A Translation in PSTricks from the one drawn by Emmanuel Chailloux and
% ^^A Guy Cousineau for the MLgraph system
% ^^A (see /ftp.ens.fr:/pub/unix/lang/MLgraph/version-2.1/MLgraph-refman.ps.gz)
% ^^A The kangaroo itself is reproduce from an original picture from Raoul Raba
% \newcommand{\DimX}{2.47}
% \newcommand{\DimY}{4.8}
% \newcommand{\DimXDivTwo}{1.235}
%
% \newcommand{\KangarooItself}[1]{%
% ^^A Body
% \pspolygon[fillstyle=solid,fillcolor=#1]%
%  (52.5,68)(55,72.5)(55.8,76.5)(56.8,79.8)(58.2,83)(60,85.8)(61.5,86.5)
% (64,87)(66,87.5)(67.8,87.3)(70,87)(71.5,87.3)(73,88)(74.7,88.5)
% (76,90.3)(77,91.5)(72.8,93.8)(69,96)(64.5,99)(59.4,103)(56.2,106.3)
% (53,110.5)(49.5,115.5)(47.2,119.9)(45.7,126)(43.2,123)(41.5,121)(37.5,125)
% (37,122.5)(36.8,120)(37,117)(37.6,113.5)(38.6,110)(40,106.3)(42,102.3)
%  (43.5,99.5)(45,97)(46.2,94)(46.8,91.7)(47.2,88)(47,83.5)(46.3,80.8)
%  (45.3,78.5)(42.5,76.5)(39.5,75.8)(36,75.9)(33,75.9)(29,76.2)(26,77)
%  (22.3,77.5)(18,78.4)(12.8,79.3)(8.6,80)(5.5,80.3)(3,80.5)(0,80)
%  (-5.2,78.5)(-9,76.3)(-11.2,74.8)(-13,72.5)(-16.5,68)(-16.5,68)(-19.5,62.5)
%  (-22,58)(-25.5,53)(-29,48.5)(-32.5,45)(-36,42)(-39,39.5)(-44,37)
%  (-49,35)(-51,34)(-53.5,34.5)(-55.5,36)(-56.5,38)(-56.5,40.5)(-55,41.5)
%  (-53.5,41)(-51.5,41)(-50.5,43)(-50.5,44.5)(-51,47)(-51.5,47.2)(-56.5,47)
%  (-58.5,46.5)(-60,44.7)(-62,42.3)(-63,39.5)(-63.5,36.3)(-63.5,33)(-63.1,29.5)
%  (-61.5,26)(-58,23.6)(-54,22.2)(-50.7,22)(-47.5,22)(-44.5,22.3)(-41,23.5)
%  (-36.8,25.8)(-33,28)(-28.5,31)(-23.4,35)(-20.2,38.3)(-17,42.5)(-13.5,47.5)
%  (-11.2,51.9)(-9.7,58)(-7.2,55)(-5.5,53)(-1.5,57)(-1,54.5)(-0.8,52)
%  (-1,49)(-1.6,45.5)(-2.6,42)(-4,38.3)(-6,34.3)(-7.5,31.5)(-9,29)
%  (-10.2,26)(-10.8,23.7)(-11.2,20)(-11,15.5)(-10.3,12.8)(-9.3,10.5)(-6.5,8.5)
%  (-3.5,7.8)(0,7.9)(3,7.9)(7,8.2)(10,9)(13.7,9.5)(18,10.4)
%  (23.2,11.3)(27.4,12)(30.5,12.3)(33,12.5)(36,12)(41.2,10.5)(45,8.3)
%  (47.2,6.8)(49,4.5)(52.5,0)(50,4.5)(49.2,8.5)(48.2,11.8)(46.8,15)
%  (45,17.8)(43.5,18.5)(41,19)(39,19.5)(37.2,19.3)(35,19)(33.5,19.3)
%  (32,20)(30.3,20.5)(29,22.3)(28,23.5)(28,23.5)(24.5,22.3)(21.5,22)
%  (18.3,22)(15,22.2)(11,23.6)(7.5,26)(5.9,29.5)(5.5,33)(5.5,36.3)
%  (6,39.5)(7,42.3)(9,44.7)(10.5,46.5)(12.5,47)(17.5,47.2)(18,47)
%  (18.5,44.5)(18.5,43)(17.5,41)(15.5,41)(14,41.5)(12.5,40.5)(12.5,38)
%  (13.5,36)(15.5,34.5)(18,34)(20,35)(25,37)(30,39.5)(33,42)
%  (36.5,45)(40,48.5)(43.5,53)(47,58)(49.5,62.5)(52.5,68)
% ^^A Eye
% \pscircle*[linecolor=white](58.2,98.3){2\psxunit}
% \pscircle*(58.2,97.3){\psxunit}
% ^^A Mouth
% \psline(71.5,88)(70,89.3)(68.5,90.3)(67,91.9)
% ^^A Tear
% \psline(42,121)(45,118)(47,115.3)(48.5,112.7)(50,110)(51.8,106.5)
%       (52.5,103.7)(53,100.5)
% \pspolygon(41.2,115.8)(43.2,114.7)(45,112.5)(47,109.8)(48,107)(49.5,104.2)%
%       (50.5,101.6)(51,98.5)(47.7,100.6)(46,102.2)(44.8,104)(43.5,106)
%       (42.5,108)(41.7,110.5)(41,113.2)}
%
% \newcommand{\Kangaroo}[1]{%
%   \begin{pspicture}(\DimX,\DimY)
%   \psset{unit=0.035278}
%   \KangarooItself{#1}
%   \end{pspicture}}
%
% \newcommand{\KangarooPstChart}[1]{{%
%   \psset{xunit=0.006784,yunit=0.00735,linewidth=0.01}
%   \begin{pspicture}(-65.5,0)(82,126)
%     \KangarooItself{#1}
%   \end{pspicture}}}
%
%
% ^^A For the possible index and changes log
% \setlength{\columnseprule}{0.6pt}
%
% ^^A Beginning of the documentation itself
%\title{\texttt{pst-fill}\\A PSTricks package for filling and tiling areas}
%\author{Timothy Van Zandt\thanks{\protect\url{tvz@econ.insead.fr}. (documentation by
% Denis Girou (\protect\url{Denis.Girou@idris.fr}) and Herbert Vo\ss (\protect\url{hvoss@tug.org}).}}
%
%\date{\shortstack{\today --- Version 1.00\\
%                  {\small Documentation revised \today}}}
% \maketitle
% \tableofcontents
%
%\begin{abstract}
%  \FillPackage{} is a PSTricks \cite{vanZandt93},\cite{Girou94},\cite{vanZandtGirou94}, 
%\cite{Hoenig97},\cite{LGC97} package to draw easily
%  various kinds of filling and tiling of areas. It is also a good example of
%  the great power and flexibility of PSTricks, as in fact it is a very short
%  program (it body is around 200~lines long) but nevertheless really powerful.
%
%  \hspace{5mm} It was written in 1994 by Timothy \textsc{van Zandt} but
%  publicly available only in PSTricks 97 and without any documentation.
%  We describe here the version \emph{97 patch 2} of December 12, 1997, which
%  is the original one modified by myself to manage \emph{tilings} in the
%  so-called \emph{automatic} mode. This article would like to serve both of
%  reference manual and of user's guide.
%
%This package is available on \CTAN{} in the
%  \texttt{graphics/pstricks} directory (files \texttt{latex/pst-fill.sty} and
%  \texttt{generic/pst-fill.tex}).
%\end{abstract}
%
%\section{Introduction}
%
%  Here we will refer as \emph{filling} as the operation which consist to fill
%a defined area by a pattern (or a composition of patterns). We will refer as
%\emph{tiling} as the operation which consist to do the same thing, but with
%the control of the starting point, which is here the upper left corner.
%The pattern is positioned relatively to this point. This make an essential
%difference between the two modes, as without control of the starting point we
%can't draw \emph{tilings} (sometimes  called \emph{tesselations}) as used in
%many fields of Art and Science%
%\footnote{For an extensive presentation of tilings, in their history and usage
%in many fields, see the reference book \cite{GS87}.
%
%  In the \TeX{} world, few work was done on tilings. You can look at the
%\emph{tile} extension of the \XYpic{} package \cite{XYpic}, at the articles of
%Kees \textsc{van der Laan} \cite[paragraph 7]{LAAN96} (the tiling was in
%fact directly done in PostScript) and \cite{LAAN97}, at the \MP{} program
%(available on \CTANref{Roegel}) by Denis \textsc{Roegel} for the
%\textsc{Truchet} contest in 1995 \cite{EsperetGirou98} and at the \MP{}
%package \cite{Bolek98} to draw patterns, which have a strong connection with
%tilings.}.
%
%  Nevertheless, as tilings are a wide and difficult field in mathematics, this
%package is limited to simple ones, mainly \emph{monohedral} tilings with one
%prototile (which can be composite, see section \ref{sec:KindTiles}). With some
%experience and wiliness we can do more and obtained easily rather
%sophisticated results, but obviously hyperbolic tilings like the famous
%\textsc{Escher} ones or aperiodic tilings like the \textsc{Penrose} ones are
%not in the capabilities of this package. For more complex needs, we must used
%low level and more painfull technics, with the basic \cs{multido}
%and \cs{multirput} macros.
%
%\section{Package history and description of it two different modes}
%
%  As already said, this package was written in 1994 by Timothy \textsc{van
%Zandt}. Two modes were defined, called respectively \emph{manual} and
%\emph{automatic}. For both, the pattern is generated on contiguous positions in
%a rather large area which include the region to fill, later cut to the
%required dimensions by clipping mechanism. In the first mode, the pattern is
%explicitely inserted in the PostScript file each time. In the second one, the
%result is the same but with an unique explicit insertion of the pattern and a
%repetition done by PostScript. Nevertheless, in this method, the control of
%the starting point was loosed, so it allowed only to \emph{fill} a region and
%not to \emph{tile} it.
%
%  See the difference between the two modes, \emph{tiling}:
% {\psset{unit=0.5cm}%
% \psboxfill{\begin{pspicture}(1,1)\psframe[dimen=middle](1,1)\end{pspicture}}
% \begin{pspicture}(3,3.3)
%   \psframe[fillstyle=boxfill](3,3)
% \end{pspicture}}
% and \emph{filling}:
%{%
% \makeatletter
%\pst@def{BoxFill}<
%  gsave
%    gsave \tx@STV CM grestore dtransform CM idtransform
%    abs /h ED abs /w ED
%    pathbbox
%    h div round 2 add cvi /y2 ED
%    w div round 2 add cvi /x2 ED
%    h div round 2 sub cvi /y1 ED
%    w div round 2 sub cvi /x1 ED
%    /y2 y2 y1 sub def
%    /x2 x2 x1 sub def
%    CP
%    y1 h mul sub neg /y1 ED
%    x1 w mul sub neg /x1 ED
%    clip
%    y2 {
%      /x x1 def
%      x2 {
%        save CP x y1 T moveto Box restore
%        /x x w add def
%      } repeat
%      /y1 y1 h add def
%    } repeat
% currentpoint currentfont grestore setfont moveto>
% \makeatother
%
% \psset{unit=0.5}
% \psboxfill{\begin{pspicture}(1,1)\psframe[dimen=middle](1,1)\end{pspicture}}
% \begin{pspicture}(3,3.3)
%   \psframe[fillstyle=boxfill](3,3)
% \end{pspicture}
% or
% \begin{pspicture}(3,3.3)
%   \psframe[fillstyle=boxfill](3,3)
% \end{pspicture}
%}
%as we can see that initial position is arbitrary and dependent of
%the current point.
%
%
% It's clear that usage of filling is very restrictive comparing to tiling,
%as desired effects required very often the possibility to control the starting 
%point. So, this mode was of limited interest, but unfortunately the
%\emph{manual} one has the very big disadvantage to require very huge amounts
%of ressources, mainly in disk space and consequently in printing time.
%A small tiling can require sometimes several megabytes in \emph{manual} mode!
%So, it was very often not really usable in practice.
%
%It is why I modified the code, to allow tilings in \emph{automatic} mode,
%controlling in this mode too the starting point. And most of the time, that is
%to say if some special options are not used, the tiling is done exactly in the
%region described, which make it faster. So there is no more reason to use the
%\emph{manual} mode, apart very special cases where \emph{automatic} one cannot
%work, as explained later -- currently, I know only one case.
%
%  To load this modified \emph{automatic} mode, with \LaTeX{} use
%simply:\newline 
%\verb+\usepackage[tiling]{pst-fill}+\newline
%and in plain \TeX{} after:\newline
%\verb+\input{pst-fill}+\newline
%add the following definition:\newline
%\verb+\def\PstTiling{true}+
%
%  To obtain the original behaviour, just don't use the \emph{tiling} optional
%keyword at loading.
%
%  Take care than in \emph{tiling} mode, I introduce also some other changes.
%First I define aliases on some parameter names for consistancy (all specific
%parameters will begin by the \texttt{fill} prefix in this case) and I change
%some default values, which were not well adapted for tilings (\texttt{fillsep}
%is set to 0 and as explained \texttt{fillsize} set to \texttt{auto}). I rename 
%\texttt{fillcycle} to \texttt{fillcyclex}. I also restore normal way so that
%the frame of the area is drawn and all line (\texttt{linestyle},
%\texttt{linecolor}, \texttt{doubleline}, etc.) parameters are now active (but
%there are not in non \emph{tiling} mode). And I also introduce new parameters
%to control the tilings (see below).
%
%  \textbf{In all the following examples, we will consider only the
% \emph{tiling} mode.}
%
%  To do a tiling, we have just to define the pattern with the
% \verb+\psboxfill+ macro and to use the new \texttt{fillstyle}
% \verb+boxfill+.
%
%  Note that tilings are drawn from left to right and top to bottom, which can
%have an importance in some circonstances.
%
%  PostScript programmers can be also interested to know that, even in the
%\emph{automatic} mode, the iterations of the pattern are managed directly by
%the PostScript code of the package which used only PostScript Level 1
%operators. The special ones introduced in Level 2 for drawing of patterns
%\cite[section 4.9]{PostScript95} are not used.
%
%  And first, for conveniance, we define a simple \cs{Tiling} macro, which
%will simplify our examples:
%
%\begin{verbatim}
%  \newcommand{\Tiling}[2][]{%
%    \edef\Temp{#1}%
%    \begin{pspicture}#2
%      \ifx\Temp\empty
%        \psframe[fillstyle=boxfill]#2
%      \else
%        \psframe[fillstyle=boxfill,#1]#2
%      \fi
%    \end{pspicture}}
%\end{verbatim}
%
%
%\newcommand{\Tiling}[2][]{%
%  \edef\Temp{#1}%
%  \begin{pspicture}#2
%    \ifx\Temp\empty
%      \psframe[fillstyle=boxfill]#2
%    \else
%      \psframe[fillstyle=boxfill,#1]#2
%    \fi
% \end{pspicture}}
%
%\subsection{Parameters}
%
%  There are \textbf{14} specific parameters available to change the way the
% filling/tiling is defined, and one debugging option.
%
% \begin{Description}{2cm}
%  \item [fillangle (real)\hfill :] the value of the rotation
%  applied to the patterns (\emph{Default:~0}).
% \end{Description}
%
%
%   In this case, we must force the tiling area to be notably larger than the
% area to cover, to be sure that the defined area will be covered after rotation.
% \lstset{gobble=2}
% \begin{LTXexample}
% \newcommand{\Square}{%
%   \begin{pspicture}(1,1)
%     \psframe[dimen=middle](1,1)
%   \end{pspicture}}
% \psset{unit=0.5}
% \psboxfill{\Square}
% \Tiling[fillangle=45]{(3,3)}\quad
% \Tiling[fillangle=-60]{(3,3)}
% \end{LTXexample}
% 
% \newcommand{\Square}{\begin{pspicture}(1,1)\psframe[dimen=middle](1,1)\end{pspicture}}
% 
% \begin{Description}{2cm}
%   \setcounter{footnote}{1}
%   \item[\texttt{fillsepx} (real$\|$dim) :] value of the horizontal
%   separation between consecutive patterns (\emph{Default:~0 for
%   tilings\footnotemark, 2pt otherwise}).  \footnotetext{This option was added
%   by me, is not part of the original package and is available only if the
%   \texttt{tiling} keyword is used when loading the package.}
%   \setcounter{footnote}{1}
%   \item [\texttt{fillsepy} (real$\|$dim)\hfill :] value of the vertical
%   separation between consecutive patterns (\emph{Default:~0 for
%   ti\-lings\footnotemark, 2pt otherwise}).
%   \setcounter{footnote}{1}
%   \item [\texttt{fillsep} (real$\|$dim)\hfill :] value of horizontal and
%   vertical separations between consecutive patterns (\emph{Default:~0 for
%   tilings\footnotemark, 2pt otherwise}).
% \end{Description}
% 
%   These values can be negative, which allow the tiles to overlap.
% 
% \begin{LTXexample}
% \psset{unit=0.5}
% \psboxfill{\Square}
% \Tiling[fillsepx=2mm]{(3,3)} 
% \Tiling[fillsepy=1mm]{(3,3)}\\
% \Tiling[fillsep=0.5]{(3,3)} 
% \Tiling[fillsep=-0.5]{(3,3)}
% \end{LTXexample}
% 
% \begin{Description}{2cm}
%   \item [\texttt{fillcyclex}\footnotemark\ (integer)\hfill :] Shift
%   coefficient applied to each row (\emph{Default:~0}).
%   \footnotetext{It was \texttt{fillcycle} in the original version.}
%   \setcounter{footnote}{1}
%   \item [\texttt{fillcycley}\footnotemark\ (integer)\hfill :] Same thing for
%   columns (\emph{Default:~0}).
%   \setcounter{footnote}{1}
%   \item [\texttt{fillcycle}\footnotemark\ (integer)\hfill :] Allow to fix
%   both \texttt{fillcyclex} and \texttt{fillcycley} directly to the same value
%   (\emph{Default:~0}).
% \end{Description}
% 
%   For instance, if \texttt{fillcyclex} is 2, the second row of patterns will
% be horizontally shifted by a factor of $\frac{1}{2}=0.5$, and by a factor of
% 0.333 if \texttt{fillcyclex} is 3, etc.). These values can be negative.
% 
% \begin{LTXexample}[width=0.35\linewidth]
% \psset{unit=0.5}
% \psboxfill{\Square}
% \newcommand{\TilingA}[1]{\Tiling[fillcyclex=#1]{(3,3)}}
% \TilingA{0} \TilingA{1}\\
% \TilingA{2} \TilingA{3}\\[3mm]
% \TilingA{4} \TilingA{5}\\
% \TilingA{6} \TilingA{-3}\\[3mm]
% \Tiling[fillcycley=2]{(3,3)}
% \Tiling[fillcycley=3]{(3,3)}\\
% \Tiling[fillcycley=-3]{(3,3)}
% \Tiling[fillcycle=2]{(3,3)}
% \end{LTXexample}
% 
% \begin{Description}{2cm}
%   \setcounter{footnote}{1}
%   \item [\texttt{fillmovex}\footnotemark\ (real$\|$dim)\hfill :] value of the
%   horizontal moves between consecutive patterns (\emph{Default:~0}).
%   \setcounter{footnote}{1}
%   \item [\texttt{fillmovey}\footnotemark\ (real$\|$dim)\hfill :] value of the
%   vertical moves between consecutive patterns (\emph{Default:~0}).
%   \setcounter{footnote}{1}
%   \item [\texttt{fillmove}\footnotemark\ (real$\|$dim)\hfill :] value of
%   horizontal and vertical moves between consecutive patterns
%   (\emph{Default:~0}).
% \end{Description}
% 
%   These parameters allow the patterns to overlap and to draw some special
% kinds of tilings. They are implemented only for the \emph{automatic} and
% \emph{tiling} modes and their values can be negative.
% 
%   In some cases, the effect of these parameters will be the same that with the 
% \texttt{fillcycle?} ones, but you can see that it is not true for some other
% values.
% 
% \begin{LTXexample}
% \psset{unit=0.5}
% \psboxfill{\Square}
% \Tiling[fillmovex=0.5]{(3,3)} 
% \Tiling[fillmovey=0.5]{(3,3)}\\
% \Tiling[fillmove=0.5]{(3,3)}
% \Tiling[fillmove=-0.5]{(3,3)}
% \end{LTXexample}
% 
% \begin{Description}{2cm}
%   \item [\texttt{fillsize}
%   (auto$\|$\{(real$\|$dim,real$\|$dim)(real$\|$dim,real$\|$dim)\}) :] The
%   choice of \emph{automatic} mode or the size of the area in \emph{manual}
%   mode. If first pair values are not given, (0,0) is used. (\emph{Default:
%   auto when \emph{tiling} mode is used, {(-15cm,-15cm)(15cm,15cm)}
%   otherwise}).
% \end{Description}
% 
%   As explained in the introduction, the \emph{manual} mode can require very
% huge amount of computer ressources. So, it usage is to discourage in front off
% the \emph{automatic} mode. It seems only useful in special circonstances, in
% fact when the \emph{automatic} mode failed, which is known only in one case,
% for some kinds of EPS files, as the ones produce by dump of portions of
% screens (see \ref{sec:GraphicFiles}).
% 
% \begin{Description}{2cm}
%   \setcounter{footnote}{1}
%   \item [\texttt{fillloopaddx}\footnotemark\ (integer)\hfill :] number of
%   times the pattern is added on left and right positions (\emph{Default:~0}).
%   \setcounter{footnote}{1}
%   \item [\texttt{fillloopaddy}\footnotemark\ (integer)\hfill :] number of
%   times the pattern is added on top and bottom positions (\emph{Default:~0}).
%   \setcounter{footnote}{1}
%   \item [\texttt{fillloopadd}\footnotemark\ (integer)\hfill :] number of
%   times the pattern is added on left, right, top and bottom positions
%   (\emph{Default:~0}).
% \end{Description}
% 
%   These parameters are only useful in special circonstances, as for complex
% patterns when the size of the rectangular box used to tile the area doesn't 
% correspond to the pattern itself (see an example in Figure~\ref{fig:Sheeps})
% and also sometimes when the size of the pattern is not a divisor of the size
% of the area to fill and that the number of loop repeats is not properly
% computed, which can occur.
% 
%   They are implemented only for the \emph{tiling} mode.
% 
% \begin{Description}{2cm}
%   \setcounter{footnote}{1}
%   \item [\texttt{PstDebug}\footnotemark\ (integer, 0 or 1)\hfill :] to
%   require to see the exact tiling done, without clipping (\emph{Default:~0}).
% \end{Description}
% 
%   It's mainly useful for debugging or to understand better how the tilings
% are done. It is implemented only for the \emph{tiling} mode.
% 
% \begin{LTXexample}
% \psset{unit=0.3,PstDebug=1}
% \psboxfill{\Square}
% \psset{linewidth=1mm}
% \Tiling{(2,2)}\\[5mm]
% \Tiling[fillcyclex=2]{(2,2)}\\[1cm]
% \Tiling[fillmove=0.5]{(2,2)}
% \end{LTXexample}
% 
% \vspace{3cm}
% \section{Examples}
% 
%   In fact this unique \cs{psboxfill} macro allow a lot a variations and
% different usages. We will try here to demonstrate this.
% 
% \subsection{Kind of tiles}
% \label{sec:KindTiles}
% 
%   Of course, we can access to all the power of PSTricks macros to define the
% \emph{tiles} (\emph{patterns}) used. So, we can define complicated ones.
% 
%   Here we give four other Archimedian tilings (those built with only some
% regular polygons) among the twelve existing, first discovered completely by
% Johanes \textsc{Kepler} at the beginning of 17th century \cite{GS87}, the two
% other \emph{regular} ones with the tiling by squares, formed by a unique
% regular polygon, and two other formed by two different regular polygons.
% 
% \begin{LTXexample}[pos=t]
%   \newcommand{\Triangle}{%
%     \begin{pspicture}(1,1)
%       \pstriangle[dimen=middle](0.5,0)(1,1)
%     \end{pspicture}}
%   \newcommand{\Hexagon}{
% ^^A sin(60)=0.866
%     \begin{pspicture}(0.866,0.75)
%       \SpecialCoor
% ^^A  Hexagon  
%       \pspolygon[dimen=middle]%
%         (0.5;30)(0.5;90)(0.5;150)(0.5;210)(0.5;270)(0.5;330)
%     \end{pspicture}}
% 
%   \psset{unit=0.5}
%   \psboxfill{\Triangle}
%   \Tiling{(4,4)}\hfill
% ^^A The two other regular tilings
%   \Tiling[fillcyclex=2]{(4,4)}\hfill
%   \psboxfill{\Hexagon}
%   \Tiling[fillcyclex=2,fillloopaddy=1]{(5,5)}
% \end{LTXexample}
% 
% \begin{LTXexample}[pos=t]
%   \newcommand{\ArchimedianA}{%
%      ^^A Archimedian tiling 3^2.4.3.4
%     \psset{dimen=middle}
%      ^^A sin(60)=0.866
%     \begin{pspicture}(1.866,1.866)
%       \psframe(1,1)
%       \psline(1,0)(1.866,0.5)(1,1)(0.5,1.866)(0,1)(-0.866,0.5)
%       \psline(0,0)(0.5,-0.866)
%     \end{pspicture}}
%   \newcommand{\ArchimedianB}{%
%      ^^A Archimedian tiling 4.8^2
%     \psset{dimen=middle,unit=1.5}
%      ^^A sin(22.5)=0.3827 ; cos(22.5)=0.9239
%     \begin{pspicture}(1.3066,0.6533)
%       \SpecialCoor
%      ^^A Octogon
%       \pspolygon(0.5;22.5)(0.5;67.5)(0.5;112.5)(0.5;157.5)
%                 (0.5;202.5)(0.5;247.5)(0.5;292.5)(0.5;337.5)
%     \end{pspicture}}
% 
%   \psset{unit=0.5}
%   \psboxfill{\ArchimedianA}
%   \Tiling[fillmove=0.5]{(7,7)}\hfill
%   \psboxfill{\ArchimedianB}
%   \Tiling[fillcyclex=2,fillloopaddy=1]{(7,7)}
% \end{LTXexample}
% 
%   \setcounter{footnote}{3}
%   We can of course tile an area arbitrarily defined. And with the
% \texttt{addfillstyle} parameter\footnote{Introduced in PSTricks 97.}, we can
% easily mix the \texttt{boxfill} style with another one.
% 
% \begin{LTXexample}[width=6cm]
%   \psset{unit=0.5,dimen=middle}
%   \psboxfill{%
%     \begin{pspicture}(1,1)
%       \psframe(1,1)
%       \pscircle(0.5,0.5){0.25}
%     \end{pspicture}}
%   \begin{pspicture}(4,6)
%     \pspolygon[fillstyle=boxfill,fillsep=0.25](0,1)(1,4)(4,6)(4,0)(2,1)
%   \end{pspicture}\hspace{1em}
%   \begin{pspicture}(4,4)
%%     \pscircle[linestyle=none,fillstyle=solid,fillcolor=yellow,fillsep=0.5,
%%               addfillstyle=boxfill](2,2){2}
%   \end{pspicture}
% \end{LTXexample}
%
%   Various effects can be obtained, sometimes complicated ones very easily, as
% in this example reproduced from one shown by Slavik \textsc{Jablan} in the
% field of \emph{OpTiles}, inspired by the \emph{Op-art}:
% 
% \begin{LTXexample}[pos=t]
% \newcommand{\ProtoTile}{%
%  \begin{pspicture}(1,1)%%% 1/12=0.08333
%   \psset{linestyle=none,linewidth=0,
%     hatchwidth=0.08333\psunit,hatchsep=0.08333\psunit}
%   \psframe[fillstyle=solid,fillcolor=black,addfillstyle=hlines,hatchcolor=white](1,1)
%   \pswedge[fillstyle=solid,fillcolor=white,addfillstyle=hlines]{1}{0}{90}
%  \end{pspicture}}
% \newcommand{\BasicTile}{%
%  \begin{pspicture}(2,1)
%    \rput[lb](0,0){\ProtoTile}\rput[lb](1,0){\psrotateleft{\ProtoTile}}
%  \end{pspicture}}
% \ProtoTile\hfill\BasicTile\hfill
% \psboxfill{\BasicTile}
% \Tiling[fillcyclex=2]{(4,4)}
% \end{LTXexample}
% 
%   It is also directly possible to surimpose several different tilings. Here is
% the splendid visual proof of the \textsc{Pytha\-gore} theorem done by the arab
% mathematician \textsc{Annairizi} around the year 900, given by superposition
% of two tilings by squares of different sizes.
% 
% \begin{LTXexample}[pos=t]
% \psset{unit=1.5,dimen=middle}
% \begin{pspicture*}(3,3)
%   \psboxfill{\begin{pspicture}(1,1)
%     \psframe(1,1)\end{pspicture}}
%   \psframe[fillstyle=boxfill](3,3)
%   \psboxfill{\begin{pspicture}(1,1)
%     \rput{-37}{\psframe[linecolor=red](0.8,0.8)}
%   \end{pspicture}}
%   \psframe[fillstyle=boxfill](3,4)
%   \pspolygon[fillstyle=hlines,hatchangle=90](1,2)(1.64,1.53)(2,2)
% \end{pspicture*}
% \end{LTXexample}
% 
%   In a same way, it is possible to build tilings based on figurative patterns,
% in the style of the famous \textsc{Escher} ones. Following an example of
% Andr\'e \textsc{Deledicq} \cite{Deledicq97}, we first show a simple tiling of
% the \emph{p1} category (according to the international classification of the
% 17~symmetry groups of the plane first discovered by the russian
% crystalographer Jevgraf \textsc{Fedorov} at the end of the 19th century):
% 
% \begin{LTXexample}[pos=t]
%  \newcommand{\SheepHead}[1]{%
%    \begin{pspicture}(3,1.5)
%      \pscustom[liftpen=2,fillstyle=solid,fillcolor=#1]{%
%        \pscurve(0.5,-0.2)(0.6,0.5)(0.2,1.3)(0,1.5)(0,1.5)
%          (0.4,1.3)(0.8,1.5)(2.2,1.9)(3,1.5)(3,1.5)(3.2,1.3)
%          (3.6,0.5)(3.4,-0.3)(3,0)(2.2,0.4)(0.5,-0.2)}
%      \pscircle*(2.65,1.25){0.12\psunit} % Eye
%      \psccurve*(3.5,0.3)(3.35,0.45)(3.5,0.6)(3.6,0.4)% Muzzle
%     ^^A   % Mouth
%       \pscurve(3,0.35)(3.3,0.1)(3.6,0.05)
%     ^^A   % Ear
%       \pscurve(2.3,1.3)(2.1,1.5)(2.15,1.7)\pscurve(2.1,1.7)(2.35,1.6)(2.45,1.4)
%   \end{pspicture}}
%  \psboxfill{\psset{unit=0.5}\SheepHead{yellow}\SheepHead{cyan}}
%  \Tiling[fillcyclex=2,fillloopadd=1]{(10,5)}
% \end{LTXexample}
% \label{fig:Sheeps}
% 
%   Now a tiling of the \emph{pg} category (the code for the kangaroo itself is
% too long to be shown here, but has no difficulties ; the kangaroo is reproduce
% from an original picture from Raoul \textsc{Raba} and here is a translation in
% PSTricks from the one drawn by Emmanuel \textsc{Chailloux} and Guy
% \textsc{Cousineau} for their MLgraph system \cite{MLgraphTSI}):
% 
% \begin{LTXexample}[pos=t]
% \psboxfill{\psset{unit=0.4}
%   \Kangaroo{yellow}\Kangaroo{red}\Kangaroo{cyan}\Kangaroo{green}%
%   \psscalebox{-1 1}{%
%     \rput(1.235,4.8){\Kangaroo{green}\Kangaroo{cyan}\Kangaroo{red}\Kangaroo{yellow}}}}
%   \Tiling[fillloopadd=1]{(10,6)}
% \end{LTXexample}
% 
%   And here a \textsc{Wang} tiling \cite{Wang65}, \cite[chapter
% 11]{GS87}, based on very simple tiles of the form of a square and composed
% of four colored triangles. Such tilings are built with only a matching color
% constraint. Despite of it simplicity, it is an important kind of tilings, as
% \textsc{Wang} and others used them to study the special class of
% \emph{aperiodic} tilings, and also because it was shown that surprisingly this 
% tiling is similar to a \textsc{Turing} machine.
% 
% \begin{LTXexample}[pos=t]
%   \newcommand{\WangTile}[4]{%
%     \begin{pspicture}(1,1)
%       \pspolygon*[linecolor=#1](0,0)(0,1)(0.5,0.5)
%       \pspolygon*[linecolor=#2](0,1)(1,1)(0.5,0.5)
%       \pspolygon*[linecolor=#3](1,1)(1,0)(0.5,0.5)
%       \pspolygon*[linecolor=#4](1,0)(0,0)(0.5,0.5)
%     \end{pspicture}}
%   \newcommand{\WangTileA}{\WangTile{cyan}{yellow}{cyan}{cyan}}
%   \newcommand{\WangTileB}{\WangTile{yellow}{cyan}{cyan}{red}}
%   \newcommand{\WangTileC}{\WangTile{cyan}{red}{yellow}{yellow}}
%   \newcommand{\WangTiles}[1][]{%
%     \begin{pspicture}(3,3) \psset{ref=lb}
%       \rput(0,2){\WangTileB}  \rput(1,2){\WangTileA}%
%       \rput(2,2){\WangTileC}  \rput(0,1){\WangTileC}%
%       \rput(1,1){\WangTileB}  \rput(2,1){\WangTileA}
%       \rput(0,0){\WangTileA}  \rput(1,0){\WangTileC}%
%       \rput(2,0){\WangTileB}
%       #1
%     \end{pspicture}}
%   \WangTileA\hfill\WangTileB\hfill\WangTileC\hfill
%   \WangTiles[{\psgrid[subgriddiv=0,gridlabels=0](3,3)}]\hfill
%   \psset{unit=0.4} \psboxfill{\WangTiles} \Tiling{(12,12)}
% \end{LTXexample}
% 
% \subsection{External graphic files}
% \label{sec:GraphicFiles}
% 
%   We can also fill an arbitrary area with an external image. We have only, 
% as usual, to matter of the \emph{BoundingBox} definition if there is no one
% provided or if it is not the accurate one, as for the well known
% \texttt{tiger} picture part of the \texttt{ghostscript} distribution.
% 
% \begin{LTXexample}[pos=t]
%   \psboxfill{%% Strangely require x1=x2...
%     \begin{pspicture}(0,1)(0,4.1)
%       \includegraphics[bb=17 176 560 74,width=3cm]{tiger}
%     \end{pspicture}}
%   \Tiling{(6,6.2)}
% \end{LTXexample}
% 
%   Nevertheless, there are some special files for which the \emph{automatic}
% mode doesn't work, specially for some files obtained by a screen dump, as in
% the next example, where a picture was reduced before it conversion in the
% \emph{Encapsulated PostScript} format by a screen dump utility. In this case,
% usage of the \emph{manual} mode is the only alternative, at the price of the
% real multiple inclusion of the EPS file. We must take care to specify the
% correct \texttt{fillsize} parameter, because otherwise the default values are
% large and will load the file many times, perhaps just really using few
% occurrences as the other ones would be clipped...
% 
% \begin{LTXexample}[pos=t]
%   \psboxfill{\includegraphics{flowers}}
%   \begin{pspicture}(8,4)
%     \psellipse[fillstyle=boxfill,fillsize={(8,4)}](4,2)(4,2)
%   \end{pspicture}
% \end{LTXexample}
% 
% \subsection{Tiling of characters}
% 
%   We can also use the \cs{psboxfill} macro to fill the interior of characters
% for special effects like these ones:
% 
% \begin{LTXexample}[pos=t]
%   \DeclareFixedFont{\bigsf}{T1}{phv}{b}{n}{4.5cm}
%   \DeclareFixedFont{\smallrm}{T1}{ptm}{m}{n}{3mm}
%   \psboxfill{\smallrm Since 182 days...}
%   \begin{pspicture*}(8,4)
%     \centerline{%
%       \pscharpath[fillstyle=gradient,gradangle=-45,
%                   gradmidpoint=0.5,addfillstyle=boxfill,
%                   fillangle=45,fillsep=0.7mm]
%                  {\rput[b](0,0.1){\bigsf 2000}}}
%   \end{pspicture*}
% \end{LTXexample}
% 
% \begin{LTXexample}[pos=t]
%   \DeclareFixedFont{\mediumrm}{T1}{ptm}{m}{n}{2cm}
%   \psboxfill{%
%     \psset{unit=0.1,linewidth=0.2pt}
%     \Kangaroo{PeachPuff}\Kangaroo{PaleGreen}%
%       \Kangaroo{LightBlue}\Kangaroo{LemonChiffon}%
%     \psscalebox{-1 1}{%
%       \rput(1.235,4.8){%
%         \Kangaroo{LemonChiffon}\Kangaroo{LightBlue}%
%           \Kangaroo{PaleGreen}\Kangaroo{PeachPuff}}}}
% ^^A   % A kangaroo of kangaroos...
%   \begin{pspicture}(8,2)
%     \pscharpath[linestyle=none,fillstyle=boxfill,fillloopadd=1]
%                {\rput[b](4,0){\mediumrm Kangaroo}}
%   \end{pspicture}
% \end{LTXexample}
% 
% \subsection{Other kinds of usage}
% 
%   Other kinds of usage can be imagined. For instance, we can use tilings in a
% sort of degenerated way to draw some special lines made by a unique or
% multiple repeating patterns. But it can be only a special dashed line, as here
% with three different dashes:
% 
% \begin{LTXexample}[pos=t]
%   \newcommand{\Dashes}{%
%     \psset{dimen=middle}
%     \begin{pspicture}(0,-0.5\pslinewidth)(1,0.5\pslinewidth)
%       \rput(0,0){\psline(0.4,0)}%
%         \rput(0.5,0){\psline(0.2,0)}%
%         \rput(0.8,0){\psline(0.1,0)}
%     \end{pspicture}}
% 
%   \newcommand{\SpecialDashedLine}[3]{%
%     \psboxfill{#3}
%     \Tiling[linestyle=none]
%            {(#1,-0.5\pslinewidth)(#2,0.5\pslinewidth)}}
% 
%   \SpecialDashedLine{0}{7}{\Dashes}
% 
%   \psset{unit=0.5,linewidth=1mm,linecolor=red}
%   \SpecialDashedLine{0}{10}{\Dashes}
% \end{LTXexample}
% 
%   It allow also to use special patterns in business graphics, as in the
% following example generated by \texttt{PstChart}\footnote{A personal
% development to draw business charts with PSTricks, not distributed.}.
% 
% \vspace{3mm}
% \begin{figure}[!ht]
% \centering
% \psset{unit=0.75}
% ^^A % Generated by pstchart.sh version 0.21 (11/28/97)
% {\psset{dimen=middle}
% \psset{xunit=2,yunit=0.005}
% \begin{pspicture}(-0.6,-200)(6.6,2300)
% ^^A   % Title
%   \rput(3,2200){\shortstack{Fantaisist repartition of kangaroos\\
%                             in the world (in thousands)}}
% ^^A   % Frame background
%   \psframe[fillstyle=solid,fillcolor=LemonChiffon](0,0)(6,2000)
% ^^A   % Graduations
%   \multido{\n=0+500}{5}{\rput[r](-0.12,\n){\psscalebox{0.8}{\n}}}
% ^^A   % Minor ticks
%   \multips(0,100)(0,100){19}{\psline[unit=4.8pt](1,0)}
%   \multips(6,100)(0,100){19}{\psline[unit=4.8pt](-1,0)}
% ^^A   % Major ticks
%   \multips(0,500)(0,500){3}{\psline[unit=9.6pt](1,0)}
%   \multips(6,500)(0,500){3}{\psline[unit=9.6pt](-1,0)}
% ^^A   % Lines from major ticks marks
%   \multips(0,500)(0,500){3}{\psline[linestyle=dotted,linewidth=0.6pt](6,0)}
% ^^A   % Drawing for the data
%   \psboxfill{\psset{unit=0.78\psxunit}\KangarooPstChart{red}}
%   \psframe[linestyle=none,fillstyle=boxfill,fillloopaddy=1](0.61,0)(1.39,1800)
%   \psboxfill{\psset{unit=0.78\psxunit}\KangarooPstChart{yellow}}
%   \psframe[linestyle=none,fillstyle=boxfill,fillloopaddy=1](1.61,0)(2.39,800)
%   \psboxfill{\psset{unit=0.78\psxunit}\KangarooPstChart{cyan}}
%   \psframe[linestyle=none,fillstyle=boxfill,fillloopaddy=1](2.61,0)(3.39,550)
%   \psboxfill{\psset{unit=0.78\psxunit}\KangarooPstChart{magenta}}
%   \psframe[linestyle=none,fillstyle=boxfill,fillloopaddy=1](3.61,0)(4.39,500)
%   \psboxfill{\psset{unit=0.78\psxunit}\KangarooPstChart{green}}
%   \psframe[linestyle=none,fillstyle=boxfill,fillloopaddy=1](4.61,0)(5.39,200)
% ^^A   % Bottom labels
%   \uput{0.2}[270]{0}(1,0){\psscalebox{0.7}{Oceania}}
%   \uput{0.2}[270]{0}(2,0){\psscalebox{0.7}{Africa}}
%   \uput{0.2}[270]{0}(3,0){\psscalebox{0.7}{Asia}}
%   \uput{0.2}[270]{0}(4,0){\psscalebox{0.7}{America}}
%   \uput{0.2}[270]{0}(5,0){\psscalebox{0.7}{Europe}}
% ^^A   % Frame box around the chart
%   \psframe[linestyle=solid](0,0)(6,2000)
% \end{pspicture}}
%   \caption{Bar chart generated by PstChart, with bars filled by patterns}
%   \label{fig:PstChart}
% \end{figure}
% 
% \section{``Dynamic'' tilings}
% 
%   In some cases, tilings used non \emph{static} tiles, that is to say that the 
% \emph{prototile(s)}, even if unique, can have several forms, by instance
% specified by different colors or rotations, not fixed before generation or
% varying each time.
% 
% \subsection{Lewthwaite-Pickover-Truchet tiling}
% 
%   We give here for example the so-called \emph{Truchet} tiling, which much be
% in fact better called \emph{Lewthwaite-Pick\-over-Truchet (LPT)} tiling%
% \footnote{For description of the context, history and references about
% S\'ebastien \textsc{Truchet} and this tiling, see \cite{EsperetGirou98}.}.
% 
%   The unique prototile is only a square with two opposite circle arcs.
% This tile has obviously two positions, if we rotate it from 90 degrees (see
% the two tiles on the next figure). A \emph{LPT tiling} is a tiling with
% randomly oriented LPT tiles. We can see that even if it is very simple in it
% principle, it draw sophisticated curves with strange properties.
% 
%   Nevertheless, in the straightforward way \FillPackage{} does not work,
% because the \cs{psboxfill} macro store the content of the tile used in a
% \TeX{} box, which is static. So the calling to the random function is done
% only one time, which explain that only one rotation of the tile is used for
% all the tiling. It's only the one of the two rotations which could differ from
% one drawing to the next one...
% 
% ^^A % Truchet (Lewthwaite-Pickover-Truchet) tiling
% ^^A % --------------------------------------------
% 
% \begin{LTXexample}[pos=t]
% ^^A   % LPT prototile
%   \newcommand{\ProtoTileLPT}{%
%     \psset{dimen=middle}
%     \begin{pspicture}(1,1)
%       \psframe(1,1)
%       \psarc(0,0){0.5}{0}{90}
%       \psarc(1,1){0.5}{-180}{-90}
%     \end{pspicture}}
% 
% ^^A   % LPT tile
%   \newcount\Boolean
%   \newcommand{\BasicTileLPT}{%
% ^^A     % From random.tex by Donald Arseneau
%     \setrannum{\Boolean}{0}{1}%
%     \ifnum\Boolean=0
%       \ProtoTileLPT%
%     \else
%       \psrotateleft{\ProtoTileLPT}%
%     \fi}
% 
%   \ProtoTileLPT\hfill\psrotateleft{\ProtoTileLPT}\hfill
%   \psset{unit=0.5}
%   \psboxfill{\BasicTileLPT}
%   \Tiling{(5,5)}
% \end{LTXexample}
% 
%   But, for simple cases, there is a solution to this problem using a mixture
% of PSTricks and PostScript programming. Here the PSTricks
% construction \verb+\pscustom{\code{...}}+ allow to insert PostScript code
% inside the \LaTeX{} + PSTricks one.
% 
%   Programmation is less straightforward, but it has also the advantage to be
% notably faster, as all the tilings operations are done in PostScript, and
% mainly to not be limited by \TeX{} memory (the \TeX{} + PSTricks solution
% I wrote in 1995 for the colored problem was limited to small sizes for this
% reason). Just note also that \cs{pslbrace} and \cs{psrbrace} are two
% PSTricks macros to define and be able to insert the \verb+{+ and \verb+}+
% characters.
% 
% \begin{LTXexample}[pos=t]
% ^^A   % LPT prototile
%   \newcommand{\ProtoTileLPT}{%
%     \psset{dimen=middle}
%     \psframe(1,1)
%     \psarc(0,0){0.5}{0}{90}
%     \psarc(1,1){0.5}{-180}{-90}}
% 
% ^^A   % Counter to change the random seed
%   \newcount\InitCounter
% ^^A   % LPT tile
%   \newcommand{\BasicTileLPT}{%
%     \InitCounter=\the\time
%     \pscustom{\code{%
%       rand \the\InitCounter\space sub 2 mod 0 eq \pslbrace}}
%     \begin{pspicture}(1,1)
%       \ProtoTileLPT
%     \end{pspicture}%
%     \pscustom{\code{\psrbrace \pslbrace}}
%     \psrotateleft{\ProtoTileLPT}%
%     \pscustom{\code{\psrbrace ifelse}}}
% 
%   \psset{unit=0.4,linewidth=0.4pt}
%   \psboxfill{\BasicTileLPT}
%   \Tiling{(15,15)}
% \end{LTXexample}
% 
%   Using the very surprising fact (see \cite{EsperetGirou98}) that
% coloration of these tiles do not depend of their neighbors (even if it is
% difficult to believe as the opposite seems obvious!) but only of the parity of
% the value of row and column positions, we can directly program in the same way
% a colored version of the LPT tiling.
% 
% \setcounter{footnote}{1}
%   We have also introduce in the \FillPackage{} code for \emph{tiling} mode two
% new accessible Post\-Script variables, \texttt{row} and
% \texttt{column}\footnotemark, which can be useful in some circonstances, like
% this one.
% 
% \begin{LTXexample}[pos=t]
% ^^A   % LPT prototile
%   \newcommand{\ProtoTileLPT}[2]{%
%     \psset{dimen=middle,linestyle=none,fillstyle=solid}
%     \psframe[fillcolor=#1](1,1)
%     \psset{fillcolor=#2}
%     \pswedge(0,0){0.5}{0}{90} \pswedge(1,1){0.5}{-180}{-90}}
% ^^A   % Counter to change the random seed
%   \newcount\InitCounter
% ^^A   % LPT tile
%   \newcommand{\BasicTileLPT}[2]{%
%     \InitCounter=\the\time
%     \pscustom{\code{%
%       rand \the\InitCounter\space sub 2 mod 0 eq \pslbrace
%       row column add 2 mod 0 eq \pslbrace}}
%     \begin{pspicture}(1,1)\ProtoTileLPT{#1}{#2}\end{pspicture}%
%     \pscustom{\code{\psrbrace \pslbrace}}
%     \ProtoTileLPT{#2}{#1}%
%     \pscustom{\code{%
%       \psrbrace ifelse \psrbrace \pslbrace row column add 2 mod 0 eq \pslbrace}}
%     \psrotateleft{\ProtoTileLPT{#2}{#1}}\pscustom{\code{\psrbrace \pslbrace}}
%     \psrotateleft{\ProtoTileLPT{#1}{#2}}\pscustom{\code{\psrbrace ifelse \psrbrace ifelse}}}
%   \psboxfill{\BasicTileLPT{red}{yellow}}
%   \Tiling{(4,4)}\hfill
%   \psset{unit=0.4}\psboxfill{\BasicTileLPT{blue}{cyan}}
%   \Tiling{(15,15)}
% \end{LTXexample}
% 
%   Another classic example is to generate coordinates and numerotation for a
% grid. Of course, it is possible to do it directly in PSTricks using nested
% \cs{multido} commands. It would be clearly easy to program, but, nevertheless, 
% for users who have a little knowledge of PostScript programming, this offer
% an alternative which is useful for large cases, because on this way it will
% be notably faster and less computer ressources consuming.
% 
%   Remember here that the tiling is drawn from left to right, and top to
% bottom, and note that the PostScript variable \texttt{x2} give the total
% number of columns.
% 
% \begin{LTXexample}[pos=t]
% ^^A   % \Escape will be the \ character
%   {\catcode`\!=0\catcode`\\=11!gdef!Escape{\}}
%   \newcommand{\ProtoTile}{%
%     \Square\pscustom{%
%       \moveto(-0.9,0.75) % In PSTricks units
%       \code{ /Times-Italic findfont 8 scalefont setfont
%         (\Escape() show row 3 string cvs show (,) show 
%         column 3 string cvs show (\Escape)) show}
%       \moveto(-0.5,0.25) % In PSTricks units
%       \code{ /Times-Bold findfont 18 scalefont setfont
%         1 0 0 setrgbcolor % Red color
%         /center {dup stringwidth pop 2 div neg 0 rmoveto} def
%         row 1 sub x2 mul column add 3 string cvs center show}}}
%   \psboxfill{\ProtoTile}
%   \Tiling{(6,4)}
% \end{LTXexample}
% 
% \subsection{A complete example: the Poisson equation}
% 
%   To finish, we will show a complete real example, a drawing to explain the
% method used to solve the \textsc{Poisson} equation by a domain
% decomposition method, adapted to distributed memory computers. The
% objective is to show the communications required between processes and the
% position of the data to exchange. This code also show some useful and powerful
% technics for PSTricks programming (look specially at the way some higher level
% macros are defined, and how the same object is used to draw the four
% neighbors).
%
%\psset{unit=1cm}
%\newcommand{\Pattern}[1]{%
%   \begin{pspicture}(-0.25,-0.25)(0.25,0.25)\rput{*0}{\psdot[dotstyle=#1]}
%   \end{pspicture}}
%\newcommand{\West}{\Pattern{o}}   \newcommand{\South}{\Pattern{x}}
%\newcommand{\Central}{\Pattern{+}}\newcommand{\North}{\Pattern{square}}
%\newcommand{\East}{\Pattern{triangle}}
%\newcommand{\Cross}{%
%  \pspolygon[unit=0.5,linewidth=0.2,linecolor=red](0,0)(0,1)(1,1)(1,2)(2,2)(2,1)%
%              (3,1)(3,0)(2,0)(2,-1)(1,-1)(1,0)}
%\newcommand{\StylePosition}[1]{\LARGE\textcolor{red}{\textbf{#1}}}
%\newcommand{\SubDomain}[4]{%
%    \psboxfill{#4}\begin{psclip}{\psframe[linestyle=none]#1}%
%      \psframe[linestyle=#3](5,5)\psframe[fillstyle=boxfill]#2%
%    \end{psclip}}
%\newcommand{\SendArea}[1]{\psframe[fillstyle=solid,fillcolor=cyan]#1}
%\newcommand{\ReceiveData}[2]{%
%  \psboxfill{#2}\psframe[fillstyle=solid,fillcolor=yellow,addfillstyle=boxfill]#1}%
%\newcommand{\Neighbor}[2]{%
%    \begin{pspicture}(5,5)
%      \rput{*0}(2.5,2.5){\StylePosition{#1}}
%      \ReceiveData{(0.5,0)(4.5,0.5)}{\Central}\SendArea{(0.5,0.5)(4.5,1)}%
%      \SubDomain{(5,2)}{(0.5,0.5)(4.5,3)}{dashed}{#2}%
%      \pcarc[arcangle=45,arrows=->](0.5,-1.25)(0.5,0.25)%
%      \pcarc[arcangle=45,arrows=->,linestyle=dotted,dotsep=2pt](4.5,0.75)(4.5,-0.75)%
%    \end{pspicture}}%
%  \psset{dimen=middle,dotscale=2,fillloopadd=2}
%\begin{pspicture}(-5.7,-5.7)(5.7,5.7)
%  \rput(0,0){%
%      \begin{pspicture}(5,5)
%        \ReceiveData{(0,0.5)(0.5,4.5)}{\West} \ReceiveData{(4.5,0.5)(5,4.5)}{\East}
%        \ReceiveData{(0.5,4.5)(4.5,5)}{\North}\ReceiveData{(0.5,0)(4.5,0.5)}{\South}
%        \SendArea{(0.5,0.5)(1,4.5)}\SendArea{(4,0.5)(4.5,4.5)}
%        \SendArea{(0.5,0.5)(4.5,1)}\SendArea{(0.5,4)(4.5,4.5)}
%        \SubDomain{(5,5)}{(0.5,0.5)(4.5,4.5)}{solid}{\Central}
%        \psline(1,0.5)(1,4.5)\psline(4,0.5)(4,4.5)%
%        \rput(1.5,4){\Cross}\rput(2,2){\Cross}%
%      \end{pspicture}}%
%  \rput(0,5.5){\Neighbor{N}{\North}}\rput{-90}(5.5,0){\Neighbor{E}{\East}}%
%  \rput{90}(-5.5,0){\Neighbor{W}{\West}}\rput{180}(0,-5.5){\Neighbor{S}{\South}}%
%\end{pspicture}
%
% \begin{lstlisting}
%   \newcommand{\Pattern}[1]{%
%     \begin{pspicture}(-0.25,-0.25)(0.25,0.25)\rput{*0}{\psdot[dotstyle=#1]}
%     \end{pspicture}}
%   \newcommand{\West}{\Pattern{o}}   \newcommand{\South}{\Pattern{x}}
%   \newcommand{\Central}{\Pattern{+}}\newcommand{\North}{\Pattern{square}}
%   \newcommand{\East}{\Pattern{triangle}}
%   \newcommand{\Cross}{%
%     \pspolygon[unit=0.5,linewidth=0.2,linecolor=red](0,0)(0,1)(1,1)(1,2)(2,2)(2,1)
%               (3,1)(3,0)(2,0)(2,-1)(1,-1)(1,0)}
%   \newcommand{\StylePosition}[1]{\LARGE\textcolor{red}{\textbf{#1}}}
%   \newcommand{\SubDomain}[4]{%
%     \psboxfill{#4}
%     \begin{psclip}{\psframe[linestyle=none]#1}
%       \psframe[linestyle=#3](5,5)\psframe[fillstyle=boxfill]#2
%     \end{psclip}}
%   \newcommand{\SendArea}[1]{\psframe[fillstyle=solid,fillcolor=cyan]#1}
%   \newcommand{\ReceiveData}[2]{%
%     \psboxfill{#2}
%     \psframe[fillstyle=solid,fillcolor=yellow,addfillstyle=boxfill]#1}
%   \newcommand{\Neighbor}[2]{%
%     \begin{pspicture}(5,5)
%       \rput{*0}(2.5,2.5){\StylePosition{#1}}
%       \ReceiveData{(0.5,0)(4.5,0.5)}{\Central}\SendArea{(0.5,0.5)(4.5,1)}
%       \SubDomain{(5,2)}{(0.5,0.5)(4.5,3)}{dashed}{#2}%
% ^^A       % Receive and send arrows
%       \pcarc[arcangle=45,arrows=->](0.5,-1.25)(0.5,0.25)
%       \pcarc[arcangle=45,arrows=->,linestyle=dotted,dotsep=2pt](4.5,0.75)(4.5,-0.75)
%     \end{pspicture}}
%   \psset{dimen=middle,dotscale=2,fillloopadd=2}
%   \begin{pspicture}(-5.7,-5.7)(5.7,5.7)
% ^^A     % Central domain
%     \rput(0,0){%
%       \begin{pspicture}(5,5)
% ^^A         % Receive from West, East, North and South
%         \ReceiveData{(0,0.5)(0.5,4.5)}{\West} \ReceiveData{(4.5,0.5)(5,4.5)}{\East}
%         \ReceiveData{(0.5,4.5)(4.5,5)}{\North}\ReceiveData{(0.5,0)(4.5,0.5)}{\South}
% ^^A         % send area for West, East, North and South
%         \SendArea{(0.5,0.5)(1,4.5)} \SendArea{(4,0.5)(4.5,4.5)}
%         \SendArea{(0.5,0.5)(4.5,1)} \SendArea{(0.5,4)(4.5,4.5)}
% ^^A         % Central domain
%         \SubDomain{(5,5)}{(0.5,0.5)(4.5,4.5)}{solid}{\Central}
% ^^A         % Redraw overlapped linesY
%         \psline(1,0.5)(1,4.5)  \psline(4,0.5)(4,4.5)
% ^^A         % Two crossesY
%         \rput(1.5,4){\Cross}  \rput(2,2){\Cross}
%       \end{pspicture}}
% ^^A     % The four neighborsY
%     \rput(0,5.5){\Neighbor{N}{\North}}     \rput{-90}(5.5,0){\Neighbor{E}{\East}}
%     \rput{90}(-5.5,0){\Neighbor{W}{\West}} \rput{180}(0,-5.5){\Neighbor{S}{\South}}
%   \end{pspicture}
% \end{lstlisting}
%
%
%
% Bibliography
% \begin{thebibliography}{99}
% \bibitem{PostScript95} Adobe, Systems~Incorporated, \emph{PostScript Language
% Reference Manual}, Addison-Wesley, 2~edition, 1995.
%
% \bibitem{Bolek98} Piotr Bolek, \MP{} and patterns, \emph{\TUB}, Volume~19,
% Number~3, pages 276--283, September 1998, \CTANref{mpattern}.
%
% \bibitem{MLgraphTSI} Emmanuel Chailloux, Guy Cousineau and Asc\'ander
% Su\'arez, Programmation fonctionnelle de graphismes pour la production
% d'illustrations techniques, \emph{Technique et science informatique},
% Volume~15, Number~7, pages 977--1007, 1996 (in french).
%
% \bibitem{Deledicq97} Andr\'e Deledicq, \emph{Le monde des pavages}, ACL
% \'Editions, 1997 (in french).
%
% \bibitem{EsperetGirou98} Philippe Esperet and Denis Girou,
% Coloriage du pavage dit de Truchet, Cahiers GUTenberg, Number~31,
% pages 5--18, December~1998  (in french).
%
% \bibitem{Girou94} Denis Girou, Pr\'esentation de PSTricks, \emph{Cahiers
% GUTenberg}, Number~16, pages 21--70, February~1994 (in french).
%
% \bibitem{LGC97} Michel Goossens, Sebastian Rahtz and Frank Mittelbach,
% \emph{The \LaTeX{} Graphics Companion}, Addison-Wesley, 2005.
%
% \bibitem{GS87} Branko Gr\"unbaum and Geoffrey Shephard, \emph{Tilings and
% Patterns}, Freeman and Company, 1987.
%
% \bibitem{Hoenig97} Alan Hoenig, \emph{\TeX{} Unbound: \LaTeX{} \& \TeX{}
% Strategies, Fonts, Graphics, and More}, Oxford University Press, 1997.
%
% \bibitem{XYpic} Kristoffer~H. Rose and Ross Moore, \XYpic. Pattern and Tile
% extension, available from \CTAN, 1991-1998, \CTANref{xypic}.
%
% \bibitem{LAAN96} Kees van der Laan, Paradigms: Just a little bit of PostScript,
% \emph{MAPS}, Volume~17, pages 137--150, 1996.
%
% \bibitem{LAAN97} Kees van der Laan, Tiling in PostScript and \MF{} -- Escher's
% wink, \emph{MAPS}, Volume~19, Number~2, pages 39--67, 1997.
%
% \bibitem{vanZandt93} Timothy Van Zandt, PSTricks. PostScript macros for
% Generic \TeX, available from \CTAN, 1993, \CTANref{pstricks}.
%
% \bibitem{vanZandtGirou94} Timothy Van Zandt and Denis Girou, Inside PSTricks,
% \emph{\TUB}, Volume~15, Number~3, pages 239--246, September 1994.
%
%
% \bibitem{voss07} Herbert Vo\ss, PSTricks -- Graphics for \TeX\ and \LaTeX, DANTE/Lehmanns, 4th ed., 2007.
% \bibitem{Wang65} Hao Wang, Games, Logic and Computers, \emph{Scientific
% American}, pages 98--106, November 1965.
% \end{thebibliography}
%
%
% \StopEventually{}
%
% ^^A .................... End of the documentation part ....................
%
% \section{Driver file}
%
%   The next bit of code contains the documentation driver file for \TeX{},
% i.e., the file that will produce the documentation you are currently
% reading. It will be extracted from this file by the \texttt{docstrip}
% program.
%
%    \begin{macrocode}
%<*driver>
\documentclass{ltxdoc}
\GetFileInfo{pst-fill.dtx}
%
\usepackage[T1]{fontenc}
\usepackage{lmodern}               % For PDF
\usepackage{graphicx}              % `graphicx' LaTeX standard package
\usepackage{showexpl}
\usepackage{mflogo}                % For the MetaFont and MetaPost logos
\input{random.tex}                 % Random macros from Donald Arseneau
\usepackage{url}                   % URLs convenient typesetting
\usepackage{multido}               % General loop macro
\usepackage[dvipsnames]{pstricks}  % PSTricks with the `color' extension
\usepackage{pst-text}              % PSTricks package for character path
\usepackage{pst-grad}              % PSTricks package for gradient filling
\usepackage{pst-node}              % PSTricks package for nodes
\usepackage[tiling]{pst-fill}      % PSTricks package for filling/tiling
%
\AtBeginDocument{%
%  \OnlyDescription % comment out for implementation details
  \EnableCrossrefs
  \CodelineIndex
  \RecordChanges}
\AtEndDocument{%
  \PrintIndex
  \setcounter{IndexColumns}{1}
  \PrintChanges}
\hbadness=7000            % Over and under full box warnings
\hfuzz=3pt
\begin{document}
  \DocInput{pst-fill.dtx}
\end{document}
%</driver>
%    \end{macrocode}
%
% \section{\texttt{pst-fill} \LaTeX{} wrapper}
%
%    \begin{macrocode}
%<*latex-wrapper>
\RequirePackage{pstricks}
\ProvidesPackage{pst-fill}[2005/09/13 package wrapper for 
  pst-fill.tex (hv)]
\DeclareOption{tiling}{\def\PstTiling{true}}
\ProcessOptions\relax
\input{pst-fill.tex}
\ProvidesFile{pst-fill.tex}
  [\filedate\space v\fileversion\space `PST-fill' (tvz,dg)]
%</latex-wrapper>
%    \end{macrocode}
%
%
% \section{Pst-Fill Package{} code}
%
%    \begin{macrocode}
%<*pst-fill>
%    \end{macrocode}
%
% \subsection{Preamble}
%
%   Who we are.
%
%    \begin{macrocode}
\def\fileversion{1.01}
\def\filedate{2007/03/10}
\message{`PST-Fill' v\fileversion, \filedate\space (tvz,dg,hv)}
\csname PSTboxfillLoaded\endcsname
\let\PSTboxfillLoaded\endinput
%    \end{macrocode}
%
%   Require the main PSTricks package.
%
%    \begin{macrocode}
\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
%    \end{macrocode}
%
%   interface to the extended `\textsf{keyval}' package.
%
%    \begin{macrocode}
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey\fi
%
%    \end{macrocode}
%
%   Catcodes changes and defining the family name for xkeyval.
%
%    \begin{macrocode}
\edef\PstAtCode{\the\catcode`\@}\catcode`\@=11\relax

\pst@addfams{pst-fill}
%
%    \end{macrocode}
%
%
% \subsection{The size of the box}
% \begin{macro}{pst@@boxfillsize}
%    \begin{macrocode}
%
\def\pst@@boxfillsize#1(#2,#3)#4(#5,#6)#7(#8\@nil{%
  \begingroup
    \ifx\@empty#7\relax
      \pst@dima\z@
      \pst@dimb\z@
      \pssetxlength\pst@dimc{#2}%
      \pssetylength\pst@dimd{#3}%
    \else
      \pssetxlength\pst@dima{#2}%
      \pssetylength\pst@dimb{#3}%
      \pssetxlength\pst@dimc{#5}%
      \pssetylength\pst@dimd{#6}%
    \fi
    \xdef\pst@tempg{%
      \pst@dima=\number\pst@dima sp
      \pst@dimb=\number\pst@dimb sp
      \pst@dimc=\number\pst@dimc sp
      \pst@dimd=\number\pst@dimd sp }%
  \endgroup
  \let\psk@boxfillsize\pst@tempg}
%    \end{macrocode}
% \end{macro}
%

% \subsection{Definition of the parameters}
%
%    \begin{macrocode}
\define@key[psset]{pst-fill}{boxfillsize}{%
  \def\pst@tempg{#1}\def\pst@temph{auto}%
  \ifx\pst@tempg\pst@temph
    \let\psk@boxfillsize\relax
  \else
    \pst@@boxfillsize#1(\z@,\z@)\@empty(\z@,\z@)(\@nil
  \fi}
\psset{boxfillsize={(-15cm,-15cm)(15cm,15cm)}}
\define@key[psset]{pst-fill}{boxfillcolor}{\pst@getcolor{#1}\psboxfillcolor}
\psset{boxfillcolor=black}% hv
\define@key[psset]{pst-fill}{boxfillangle}{\pst@getangle{#1}\psk@boxfillangle}
\psset{boxfillangle=0}
\define@key[psset]{pst-fill}{fillsepx}{%
  \pst@getlength{#1}\psk@fillsepx}
\define@key[psset]{pst-fill}{fillsepy}{%
  \pst@getlength{#1}\psk@fillsepy}
\define@key[psset]{pst-fill}{fillsep}{%
  \pst@getlength{#1}\psk@fillsepx%
  \let\psk@fillsepy\psk@fillsepx}
\psset{fillsep=2pt}

\ifx\PstTiling\@undefined
  \define@key[psset]{pst-fill}{fillcycle}{\pst@getint{#1}\psk@fillcycle}
  \psset{fillcycle=0}
\else
  \define@key[psset]{pst-fill}{fillangle}{\pst@getangle{#1}\psk@boxfillangle}
  \define@key[psset]{pst-fill}{fillsize}{%
      \def\pst@tempg{#1}\def\pst@temph{auto}%
      \ifx\pst@tempg\pst@temph\let\psk@boxfillsize\relax
      \else\pst@@boxfillsize#1(\z@,\z@)\@empty(\z@,\z@)(\@nil\fi}
  \psset{fillsep=0,fillsize=auto}
  \define@key[psset]{pst-fill}{fillcyclex}{\pst@getint{#1}\psk@fillcyclex}
  \define@key[psset]{pst-fill}{fillcycley}{\pst@getint{#1}\psk@fillcycley}
  \define@key[psset]{pst-fill}{fillcycle}{%
    \pst@getint{#1}\psk@fillcyclex\let\psk@fillcycley\psk@fillcyclex}
  \psset{fillcycle=0}
  \define@key[psset]{pst-fill}{fillmovex}{\pst@getlength{#1}\psk@fillmovex}
  \define@key[psset]{pst-fill}{fillmovey}{\pst@getlength{#1}\psk@fillmovey}
  \define@key[psset]{pst-fill}{fillmove}{%
      \pst@getlength{#1}\psk@fillmovex\let\psk@fillmovey\psk@fillmovex}
  \psset{fillmove=0pt}
  \define@key[psset]{pst-fill}{fillloopaddx}{\pst@getint{#1}\psk@fillloopaddx}
  \define@key[psset]{pst-fill}{fillloopaddy}{\pst@getint{#1}\psk@fillloopaddy}
  \define@key[psset]{pst-fill}{fillloopadd}{%
    \pst@getint{#1}\psk@fillloopaddx\let\psk@fillloopaddy\psk@fillloopaddx}
  \psset{fillloopadd=0}
%    \end{macrocode}
%
%    \begin{macrocode}
% For debugging (to debug, set PstDebug=1)
% we now use the one from pstricks to prevent a clash with package
% pstricks                        2004-06-22
%%    \define@key[psset]{pst-fill}{PstDebug}{\pst@getint{#1}\psk@PstDebug}
    \psset{PstDebug=0}
\fi
% DG addition end
%    \end{macrocode}

% \subsection{Definition of the fill box}
% \begin{macro}{psboxfill}
%    \begin{macrocode}
\newbox\pst@fillbox
\def\psboxfill{\pst@killglue\pst@makebox\psboxfill@i}
\def\psboxfill@i{\setbox\pst@fillbox\box\pst@hbox\ignorespaces}
%    \end{macrocode}
% \end{macro}
% \subsection{The main macros}
%
% \begin{macro}{psfs@boxfill}
%    \begin{macrocode}
\def\psfs@boxfill{%
  \ifvoid\pst@fillbox
    \@pstrickserr{Fill box is empty. Use \string\psboxfill\space first.}\@ehpa
  \else
    \ifx\psk@boxfillsize\relax \pst@AutoBoxFill
    \else\pst@ManualBoxFill\fi
  \fi}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{pst@ManualBoxFill}
%    \begin{macrocode}
\def\pst@ManualBoxFill{%
  \leavevmode
  \begingroup
    \pst@FlushCode
    \begin@psclip
    \pstVerb{clip}%
    \expandafter\pst@AddFillBox\psk@boxfillsize
    \end@psclip
  \endgroup}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{pst@FlushCode}
%    \begin{macrocode}
\def\pst@FlushCode{%
  \pst@Verb{%
    /mtrxc CM def
    CP CP T
    \tx@STV
    \psk@origin
    \psk@swapaxes
    \pst@newpath
    \pst@code
    mtrxc setmatrix
    moveto
    0 setgray}%
  \gdef\pst@code{}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{pst@AddFillBox}
%    \begin{macrocode}
\def\pst@AddFillBox#1 #2 #3 #4 {%
  \begingroup
    \setbox\pst@fillbox=\vbox{%
      \hbox{\unhcopy\pst@fillbox\kern\psk@fillsepx\p@}%
      \vskip\psk@fillsepy\p@}%
    \psk@boxfillsize
    \pst@cnta=\pst@dimc
    \advance\pst@cnta-\pst@dima
    \divide\pst@cnta\wd\pst@fillbox
    \pst@cntb=\pst@dimd
    \advance\pst@cntb-\pst@dimb
    \pst@dimd=\ht\pst@fillbox
    \divide\pst@cntb\pst@dimd
    \def\pst@tempa{%
      \pst@tempg
      \copy\pst@fillbox
      \advance\pst@cntc\@ne
      \ifnum\pst@cntc<\pst@cntd\expandafter\pst@tempa\fi}%
    \let\pst@tempg\relax
    \pst@cntc-\tw@
    \pst@cntd\pst@cnta
    \setbox\pst@fillbox=\hbox to \z@{%
      \kern\pst@dima
      \kern-\wd\pst@fillbox
      \pst@tempa
      \hss}%
    \pst@cntd\pst@cntb
%% DG modification begin - Dec. 11, 1997 - Patch 2
    \ifx\PstTiling\@undefined
      \ifnum\psk@fillcycle=\z@\pst@ManualFillCycle\fi
    \else
      \ifnum\psk@fillcyclex=\z@\pst@ManualFillCycle\fi
    \fi
%% DG modification end
    \global\setbox\pst@boxg=\vbox to\z@{%
      \offinterlineskip
      \vss
      \pst@tempa
      \vskip\pst@dimb}%
  \endgroup
  \setbox\pst@fillbox\box\pst@boxg
  \pst@rotate\psk@boxfillangle\pst@fillbox
  \box\pst@fillbox}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{pst@ManualFillCycle}
%    \begin{macrocode}
\def\pst@ManualFillCycle{%
  \ifx\PstTiling\@undefined
    \pst@cntg=\psk@fillcycle
  \else
    \pst@cntg=\psk@fillcyclex
  \fi
  \pst@dimg=\wd\pst@fillbox
  \ifnum\pst@cntg=\z@
  \else
  \divide\pst@dimg\pst@cntg
  \fi
  \ifnum\pst@cntg<\z@\pst@cntg=-\pst@cntg\fi
  \advance\pst@cntg\m@ne
  \pst@cnth=\pst@cntg
  \def\pst@tempg{%
    \ifnum\pst@cnth<\pst@cntg\advance\pst@cnth\@ne\else\pst@cnth\z@\fi
    \moveright\pst@cnth\pst@dimg}}
%    \end{macrocode}
% \end{macro}
%
%% Auto box fill:        !! Fix dictionary
%
% \subsection{The PostScript subroutines}
%
%    \begin{macrocode}
%% DG addition begin - Apr. 8, 1997 and Dec. 1997 - Patch 2
\ifx\PstTiling\@undefined
\pst@def{AutoFillCycle}<%
  /c ED
  /n 0 def
  /s {
    /x x w c div n mul add def
    /n n c abs 1 sub lt { n 1 add } { 0 } ifelse def
  } def>

\pst@def{BoxFill}<%
  gsave
    gsave \tx@STV CM grestore dtransform CM idtransform
    abs /h ED abs /w ED
    pathbbox
    h div round 2 add cvi /y2 ED
    w div round 2 add cvi /x2 ED
    h div round 2 sub cvi /y1 ED
    w div round 2 sub cvi /x1 ED
    /y2 y2 y1 sub def
    /x2 x2 x1 sub def
    CP
    y1 h mul sub neg /y1 ED
    x1 w mul sub neg /x1 ED
    clip
    y2 {
      /x x1 def
      s
      x2 {
        save CP x y1
%% patch 4   hv --------------
        \ifx\VTeXversion\undefined
        \else
%%============ mv: 09-10-01 ??? this is likely to be a right change
        neg
%%============
        \fi
%% end patch 4
T moveto Box restore
        /x x w add def
      } repeat
      /y1 y1 h add def
    } repeat
    % Next line not useful... To see that, suppress clipping (DG)
    CP x y1 T moveto Box
  currentpoint currentfont grestore setfont moveto>
\else
%% DG modification begin - Apr. 8, 1997 and Nov. / Dec. 1997 - Patch 2
\pst@def{AutoFillCycleX}<%
  /cX ED
  /nX 0 def
  /CycleX {
    /x x w cX div nX mul add def
    /nX nX cX abs 1 sub lt { nX 1 add } { 0 } ifelse def
  } def>
\pst@def{AutoFillCycleY}<%
  /cY ED
  /mY 0 def
  /nY 0 def
  /CycleY {
    /y1 y1 h cY div mY mul sub def
    nY cY abs 1 sub lt { /nY nY 1 add def /mY 1 def }
                       { /nY 0 def        /mY cY abs 1 sub neg def } ifelse
  } def>

\pst@def{BoxFill}<%
  gsave
    gsave \tx@STV CM grestore dtransform CM idtransform
    abs /h ED abs /w ED
    pathbbox
    h div round 2 add cvi /y2 ED
    w div round 2 add cvi /x2 ED
    h div round 2 sub cvi /y1 ED
    w div round 2 sub cvi /x1 ED
    /CoefLoopX 0 def
    /CoefLoopY 0 def
    /CoefMoveX 0 def
    /CoefMoveY 0 def
    \psk@boxfillangle\space 0 ne {/CoefLoopX 8 def /CoefLoopY 8 def} if
    \psk@fillcyclex\space 0 ne {/CoefLoopX CoefLoopX 1 add def} if
    \psk@fillcycley\space 0 ne {/CoefLoopY CoefLoopY 1 add def} if
    \psk@fillmovex\space 0 ne
      {/CoefLoopX CoefLoopX 2 add def
       \psk@fillmovex\space 0 gt {/CoefMoveX CoefLoopX def}
                           {/CoefMoveX CoefLoopX neg def} ifelse} if
    \psk@fillmovey\space 0 ne
      {/CoefLoopY CoefLoopY 2 add def
       \psk@fillmovey\space 0 gt {/CoefMoveY CoefLoopY def}
                           {/CoefMoveY CoefLoopY neg def} ifelse} if
    \psk@fillsepx\space 0 ne {/CoefLoopX CoefLoopX 1 add def} if
    \psk@fillsepy\space 0 ne {/CoefLoopY CoefLoopY 1 add def} if
    /CoefLoopX CoefLoopX \psk@fillloopaddx\space add def
    /CoefLoopY CoefLoopY \psk@fillloopaddy\space add def
    /x2 x2 x1 sub 4 sub CoefLoopX 2 mul add def
    /y2 y2 y1 sub 4 sub CoefLoopY 2 mul add def
%% We must fix the origin of tiling, as it must not vary according other stuff
%% in the page!
    w x1 CoefLoopX add CoefMoveX add mul
      h y1 y2 add 1 sub CoefLoopY sub CoefMoveY sub mul moveto
    CP
    y1 h mul sub neg /y1 ED
    x1 w mul sub neg /x1 ED
%%  hv 2004-06-22   to prevent clash with pst-gr3d
%%    \psk@PstDebug 0 eq {clip} if
    \Pst@Debug 0 eq {clip} if
%% end hv
    \psk@fillmovex\space \psk@fillmovey
    gsave \tx@STV CM grestore dtransform CM idtransform
    /hmove ED /wmove ED
    /row 0 def
   y2 {
       /row row 1 add def
       /column 0 def
       /x x1 def
       CycleX
       save
       x2 {
          /column column 1 add def
          CycleY
          save CP x y1
%% patch 4   hv --------------
          \ifx\VTeXversion\undefined
          \else
%%============ mv: 09-10-01 ??? this is likely to be a right change
          neg
%%============
          \fi
  T moveto Box restore
          /x x w add def
          0 hmove translate
          } repeat
       restore
       /y1 y1 h add def
       wmove 0 translate
       } repeat
  currentpoint currentfont grestore setfont moveto>
\fi
%    \end{macrocode}

%    \begin{macrocode}
\def\pst@AutoBoxFill{%
  \leavevmode
  \begingroup
    \pst@stroke
    \pst@FlushCode
    \pst@Verb{\psk@boxfillangle\space \tx@RotBegin}%
    \pstVerb{\pst@dict /Box \pslbrace end}%
    \ifx\PstTiling\@undefined
    \else
      \ifx\pst@tempa\@undefined % Undefined for instance for \pscharpath
      \else\ifx\pst@tempa\@empty\else
        \def\pst@temph{0}%
        \ifx\pst@tempa\pst@temph
        \else
          \pstVerb{/TR {pop pop currentpoint translate \pst@tempa\space translate } def}%
        \fi
      \fi\fi
    \fi
    \hbox to \z@{\vbox to\z@{\vss\copy\pst@fillbox\vskip-\dp\pst@fillbox}\hss}%
    \ifx\PstTiling\@undefined
      \pstVerb{%
        tx@Dict begin \psrbrace def
        \ifnum\psk@fillcycle=\z@
          /s {} def
        \else
          \psk@fillcycle \tx@AutoFillCycle
        \fi
        \pst@number{\wd\pst@fillbox}%
        \psk@fillsepx\space add
        \pst@number{\ht\pst@fillbox}%
        \pst@number{\dp\pst@fillbox}%
        \psk@fillsepy\space add add
        \tx@BoxFill
        end}%
      \else
      \pstVerb{%
        tx@Dict begin \psrbrace def
        \ifnum\psk@fillcyclex=\z@
          /CycleX {} def
        \else
          \psk@fillcyclex\space \tx@AutoFillCycleX
        \fi
        \ifnum\psk@fillcycley=\z@
          /CycleY {} def
        \else
          \psk@fillcycley\space \tx@AutoFillCycleY
        \fi
        \pst@number{\wd\pst@fillbox}%
        \psk@fillsepx\space add
        \pst@number{\ht\pst@fillbox}%
        \pst@number{\dp\pst@fillbox}%
        \psk@fillsepy\space add add
        \tx@BoxFill
        end}%
    \fi
    \pst@Verb{\tx@RotEnd}%
  \endgroup}
%    \end{macrocode}
% \subsection{Closing}
%
%   Catcodes restoration.
%
%    \begin{macrocode}
\catcode`\@=\PstAtCode\relax
%    \end{macrocode}
%
%    \begin{macrocode}
%</pst-fill>
%    \end{macrocode}
%
% \Finale
%
\endinput
%%
%% End of file `pst-fill.dtx'