summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/latex/pst-poly/pst-poly.dtx
blob: 5b3d427240b34aec0009fd0a1cb3a70244e0cd99 (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
% \iffalse meta-comment, etc.
%%
%% Package `pst-poly.dtx'
%%
%% Denis Girou (CNRS/IDRIS - France) <Denis.Girou@idris.fr>
%% Herbert Voss <voss _at_ pstricks.de>
%%
%% Novermber 20, 2004
%%
%% 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-poly' is a PSTricks package to draw easily various kinds of regular
%%   or non regular polygons, with various customizations.
%%
% \fi
%
% \changes{v1.60}{2004/11/20}{new macro pspolygonbox, 
%                             using pst-xkey}
% \changes{v1.50}{2001/02/08}{Standard packaging (.ins + .dtx files).}
% \changes{v1.40}{1998/07/09}{Define `PolyRotation' parameter as a real number
%                            and not as an angle, to allow to use the macro
%                            `degrees' before to draw a polygon.}
% \changes{v1.30}{1998/02/06}{Rename `PsPicture' parameter to `PstPicture' for
%                            consistancy.}
% \changes{v1.20}{1997/06/27}{First public release.}
%
% \DoNotIndex{\\,\%,\@}
% \DoNotIndex{\@eha,\@empty,\@ifnextchar,\@nameuse,\@nil,\@pstrickserr}
% \DoNotIndex{\@tempdimb,\@undefined}
% \DoNotIndex{\advance,\Alph,\begin,\begingroup,\Below@Example,\BS}
% \DoNotIndex{\catcode,\CenterExample,\changes,\clearpage,\CodelineIndex}
% \DoNotIndex{\colorbox,\csname}
% \DoNotIndex{\def,\define@key,\degrees,\divide,\DocInput,\documentclass}
% \DoNotIndex{\edef,\else,\EnableCrossrefs,\end,\endCenterExample}
% \DoNotIndex{\endcsname,\endExample,\endgroup,\endinput,\endpspicture}
% \DoNotIndex{\endSideBySideExample,\Example}
% \DoNotIndex{\fboxsep,\fi,\filedate,\fileversion,\FV@Environment}
% \DoNotIndex{\FV@UseKeyValues,\FV@XRightMargin,\FVB@Example,\fvset}
% \DoNotIndex{\GetFileInfo}
% \DoNotIndex{\hbadness,\hfuzz,\HLEmphasize,\HLMacro,\HLMacro@i}
% \DoNotIndex{\HLReverse,\HLReverse@i,\hspace}
% \DoNotIndex{\i,\if@star,\ifnum,\ifodd,\ifx,\input,\jobname}
% \DoNotIndex{\let,\lineto,\makeatletter,\makeatother,\message,\moveto}
% \DoNotIndex{\multido,\multidocount,\MultidoLoaded,\multiply}
% \DoNotIndex{\n,\newbox,\newcommand,\newcounter,\newdimen,\newif}
% \DoNotIndex{\OnlyDescription}
% \DoNotIndex{\par,\parindent,\pnode,\providecommand,\ProvidesPackage}
% \DoNotIndex{\pscurve,\pscustom,\psdots,\psline,\pspicture,\pspolygon}
% \DoNotIndex{\psset,\pssetlength,\pst@cnta,\pst@getint,\pst@ifstar}
% \DoNotIndex{\PstAtCode,\PSTricksLoaded,\psxunit,\psyunit}
% \DoNotIndex{\RecordChanges,\relax,\rput}
% \DoNotIndex{\savebox,\setcounter,\setlength,\shortstack}
% \DoNotIndex{\SideBySide@Example,\SideBySideExample,\small,\solid@star}
% \DoNotIndex{\space,\SpecialCoor,\Star,\symbol}
% \DoNotIndex{\textbf,\textcolor,\textit,\texttt,\textwidth,\the,\topsep,\tw@}
% \DoNotIndex{\usebox,\usepackage}
% \DoNotIndex{\VerbatimEnvironment,\VerbatimInput,\vskip,\Z}
%
% \setcounter{IndexColumns}{2}
%
% \newcommand{\KeyValPackage}{`\textsf{keyval}'}
% \newcommand{\PstPolygonPackage}{`\textsf{pst-poly}'}
% \newcommand{\PstPolygonMacro}{\cs{PstPolygon}}
% \newcommand{\PstPolygonNodeMacro}{\cs{PstPolygonNode}}
% \newcommand{\XYpic}{%
% \leavevmode\hbox{\kern-.1em X\kern-.3em\lower.4ex\hbox{Y\kern-.15em}-pic}}
%
% ^^A From ltugboat.cls
%
% ^^A Typeset the name of an environment
% \providecommand\env[1]{\textsf{#1}}
% \providecommand\clsname[1]{\textsf{#1}}
% \providecommand\pkgname[1]{\textsf{#1}}
% \providecommand\optname[1]{\textsf{#1}}
% \providecommand\progname[1]{\textsf{#1}}
%
% ^^A A list of options for a package/class
% \newenvironment{optlist}{\begin{description}%
%   \renewcommand\makelabel[1]{%
%     \descriptionlabel{\mdseries\optname{##1}}}%
%   \itemsep0.25\itemsep}%
%  {\end{description}}
%
% \makeatletter
%
% ^^A For the references
% \newcommand\acro[1]{\textsc{#1}\@}
% \def\CTAN{\acro{CTAN}}
% \let\texttub\textsl
% \def\TUB{\texttub{TUGboat}}
%
% ^^A From the `ctandir' package from the `ltugboat' package
% ^^A (`ltubguid' on 1997/06/12)
% ^^A Experimental CTAN location information macros for use with Donald
% ^^A Arseneau's |url.sty|
%
% \newcommand\CTANdirectory[1]{\expandafter\urldef
%   \csname CTAN@#1\endcsname\path}
%
% ^^A Use the standard label-referencing mechanism to get the warning for
% ^^A an undefined label
% \newcommand\CTANref[1]{\expandafter\@setref\csname CTAN@#1\endcsname
%   \relax{#1}}
%
% ^^A Utility macros
%
% ^^A Example macros - adapted from the `fvrb-ex' package
% ^^A ---------------------------------------------------
%
% ^^A Take care that we use here the four /?_Z characters as escape
% ^^A characters, so we can't use these characters in the examples!
%
% ^^A To highlight some verbatim sequences (comments, macro names, etc.)
% \def\HLEmphasize#1{\textit{#1}}
% \newcommand{\BS}{\texttt{\symbol{`\\}}}
% \def\HLMacro#1{\BS{}def\HLMacro@i#1\@nil}
% \def\HLMacro@i#1def#2\@nil{\HLReverse{#2}}
% \def\HLReverse#1{{\setlength{\fboxsep}{1pt}\HLReverse@i{#1}}}
% \def\HLReverse@i#1{\colorbox{black}{\textcolor{white}{\textbf{#1}}}}
%
% \def\Example{\FV@Environment{}{Example}}
% \def\endExample{%
% \end{VerbatimOut}
% \Below@Example{\input{\jobname.tmp}}
% \endgroup}
%
% \def\CenterExample{\FV@Environment{}{Example}}
% \def\endCenterExample{%
% \end{VerbatimOut}
% \begin{center}
%   \Below@Example{\input{\jobname.tmp}}
% \end{center}
% \endgroup}
%
% \def\SideBySideExample{\FV@Environment{}{Example}}
% \def\endSideBySideExample{%
% \end{VerbatimOut}
% \SideBySide@Example{\input{\jobname.tmp}}
% \endgroup}
%
% \def\FVB@Example{%
% \begingroup
% \FV@UseKeyValues
% \parindent=0pt
% \multiply\topsep by 2
% \VerbatimEnvironment
% \begin{VerbatimOut}[gobble=4,codes={\catcode`\Z=12}]{\jobname.tmp}}
%
% \def\Below@Example#1{%
% \VerbatimInput[gobble=0,commentchar=Z,commandchars=/?_,frame=single,
%                numbers=left,numbersep=3pt]{\jobname.tmp}
% \catcode`\%=14\relax
% \catcode`\Z=9\relax
% ^^A We suppress the effect of the highlighting macros
% \catcode`/=0\relax
% \catcode`?=1\relax
% \catcode`_=2\relax
% \def\HLEmphasize##1{##1}%
% \def\HLMacro##1{##1}%
% \def\HLReverse##1{##1}%
% #1
% \par}
%
% \def\SideBySide@Example#1{%
% \vskip 1mm
% \@tempdimb=\FV@XRightMargin
% \advance\@tempdimb -5mm
% \begin{minipage}[c]{\@tempdimb}
%   \fvset{xrightmargin=0pt}
%   \catcode`\%=14\relax
%   \catcode`\Z=9\relax
%   ^^A We suppress the effect of the highlighting macros
%   \catcode`/=0\relax
%   \catcode`?=1\relax
%   \catcode`_=2\relax
%   \def\HLEmphasize##1{##1}%
%   \def\HLMacro##1{##1}%
%   \def\HLReverse##1{##1}%
%   #1
% \end{minipage}%
% \@tempdimb=\textwidth
% \advance\@tempdimb -\FV@XRightMargin
% \advance\@tempdimb 5mm
% \begin{minipage}[c]{\@tempdimb}
%   \VerbatimInput[gobble=0,commentchar=Z,commandchars=/?_,
%                  frame=single,numbers=left,numbersep=3pt,
%                  xleftmargin=5mm,xrightmargin=0pt]{\jobname.tmp}
% \end{minipage}
% \vskip 1mm}
%
% \makeatother
%
% ^^A End of example macros from `fvrb-ex'
%
% ^^A Define CTAN addresses using the commands of the |ctandir| package
% \CTANdirectory{pstricks}{graphics/pstricks}
% \CTANdirectory{xypic}{macros/generic/diagrams/xypic}
%
% ^^A For the possible index and changes log
% \setlength{\columnseprule}{0.6pt}
%
% ^^A Beginning of the documentation itself
%
% \title{The \PstPolygonPackage{} package\\A PSTricks package for polygons}
% \author{Denis \textsc{Girou}\thanks{CNRS/IDRIS ---
%         Centre National de la Recherche Scientifique /
%         Institut du D\'eveloppement et des Ressources en Informatique
%         Scientifique --- Orsay --- France ---
%         \mbox{\texttt{<Denis.Girou@idris.fr>}}.}}
% \date{\today\\
%       {\small Documentation revised November 20, 2004\\
%        by Herbert Voss}}
%
% \maketitle
%
% \begin{abstract}
%     This package allow to draw easily various kinds of regular or non
%   regular polygons, using the unique macro \PstPolygonMacro, with various
%   customization parameters.
%
%     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 only 100~lines
%   long) but nevertheless really powerful.
%
%     And last, it is also a good pedagogical example of how to design and
%   program \emph{high level graphic objects} above PSTricks own ones.
% \end{abstract}
%
% \tableofcontents
%
% \section{Introduction}
%
%   \PstPolygonPackage{} offer a unique macro (plus some aliases to define
% some often used polygons) with few parameters to interact on it. But we can
% also use all the relevant PSTricks parameters to change the size, the
% characteristics of lines, to add filling, etc.
%
%   The polygons are always drawn counter clockwise.
%
% \vspace{1mm}
%   The syntax is simply:
% \fbox{\PstPolygonMacro\texttt{*[optional\_parameters]}}
%
% \vspace{1mm}
%   As for PSTricks closed objects, the \texttt{*} version use a solid style
% to fill the polygon, use the line color for fill color and set the linewidth
% to 0.
%
%   A preliminary version, limited to \emph{regular} polygons, was shown at
% TUG'95 conference, St Petersburg, Florida, as part of my talk
% \emph{Building high level objects in PSTricks} \cite{Girou95}.
%
%   \emph{Note}: You can take advantage to look also at the polygon feature of
% the \XYpic{} package \cite{XYpic}, \cite{LGC97}.
%
% \section{Usage}
%
% \subsection{Parameters}
%
%   There are \textbf{eight} specific parameters defined to change the way the
% polygons are defined:
%
% \begin{optlist}
%   \item [PstPicture (boolean)]: to define or not a \texttt{pspicture}
%   environment for the polygon. We have to define this parameter to
%   \emph{false} if we want to mix the polygon with other PSTricks objects
%   --- see examples later
%   (\emph{Default:~true} --- which is not the case for basic PSTricks
%   objects).
% \end{optlist}
%
% \begin{optlist}
%   \item [PolyRotation (real)]: rotation angle applied to the polygon
%   (\emph{Default:~0} --- no rotation).
% \end{optlist}
%
% \begin{CenterExample}
%   \PstPolygon\hfill
%   \PstPolygon[/HLEmphasize?PolyRotation_=/HLReverse?18_]\hfill
%   \PstPolygon[/HLEmphasize?PolyRotation_=/HLReverse?36_]\hfill
%   \PstPolygon[/HLEmphasize?PolyRotation_=/HLReverse?45_]
% \end{CenterExample}
%
% \begin{optlist}
%   \item [PolyNbSides (integer)]: number of sides of the polygon
%   (\emph{Default:~5}).
% \end{optlist}
%
% \begin{CenterExample}
%   \PstPolygon
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?3_]
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?4_]
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?5_]
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?8_]
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?50_]
% \end{CenterExample}
%
% \begin{optlist}
%   \item [PolyOffset (integer)]: number of nodes to bypass to obtain each
%   time the next one
%   (\emph{Default:~1} --- no node bypassed).
% \end{optlist}
%
% \begin{CenterExample}
%   \PstPolygon
%   \PstPolygon[/HLEmphasize?PolyOffset_=/HLReverse?2_]
%   \PstPolygon[/HLEmphasize?PolyOffset_=/HLReverse?3_]
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?7_,/HLEmphasize?PolyOffset_=/HLReverse?2_]
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?9_,/HLEmphasize?PolyOffset_=/HLReverse?4_]
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?17_,/HLEmphasize?PolyOffset_=/HLReverse?6_]
% \end{CenterExample}
%
% \begin{optlist}
%   \item [PolyIntermediatePoint (real)]: position of the intermediate point
%   used to join each time the next node
%   (\emph{Default:~empty} --- not used).
% \end{optlist}
%
% \begin{CenterExample}
%   \PstPolygon
%   \PstPolygon[/HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.38_]
%   \PstPolygon[/HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.2_]
%   \PstPolygon[/HLEmphasize?PolyIntermediatePoint_=/HLReverse?1.2_]
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?7_,/HLEmphasize?PolyOffset_=/HLReverse?2_,
%               /HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.38_]
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?21_,/HLEmphasize?PolyOffset_=/HLReverse?2_,
%               /HLEmphasize?PolyIntermediatePoint_=/HLReverse?-1.25_]
% \end{CenterExample}
%
% \begin{optlist}
%   \item [PolyCurves (boolean)]: boolean value to choose between straight
%   line and curve to join each time the next node
%   (\emph{Default:~false} --- straight lines).
% \end{optlist}
%
% \begin{CenterExample}
%   \psset{/HLEmphasize?PolyCurves_=/HLReverse?true_}
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?7_,/HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.38_]\hfill
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?11_,/HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.6_]\hfill
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?7_,/HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.2_,
%               /HLEmphasize?PolyOffset_=/HLReverse?2_]\hfill
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?9_,/HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.1_]\hfill
%   \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?15_,/HLEmphasize?PolyIntermediatePoint_=/HLReverse?1.2_]
% \end{CenterExample}
%
% \begin{optlist}
%   \item [PolyEpicycloid (boolean)]: boolean value to choose between
%   polygon and epicycloid
%   (\emph{Default:~false} --- polygon).
% \end{optlist}
%
% \begin{CenterExample}
%   \psset{linewidth=0.001,/HLEmphasize?PolyNbSides_=/HLReverse?72_,/HLEmphasize?PolyEpicycloid_=/HLReverse?true_}
%   % /HLEmphasize?Epicycloid of factor 1 is cardioid and of factor 2 nephroid_
%   \multido{\i=2+1}{4}{\PstPolygon[/HLEmphasize?PolyOffset_=/HLReverse?\i_]\hfill}
%   \PstPolygon[/HLEmphasize?PolyOffset_=/HLReverse?72_]\hfill % /HLEmphasize?Epicycloid of factor 71_
%   \PstPolygon[/HLEmphasize?PolyOffset_=/HLReverse?73_]       % /HLEmphasize?Epicycloid of factor 72_
% \end{CenterExample}
%
% \begin{optlist}
%   \item [PolyName (string)]: name of the polygon, useful to have different
%   names for the nodes of different polygons
%   (\emph{Default:~empty} --- no name).
% \end{optlist}
%
%   The center of the polygon has name \texttt{PolyName0} and the nodes
% (vertices) have names \texttt{PolyName1} to \texttt{PolyNameN}.
%
%   With this parameter, we can connect as we want nodes of different polygons:
%
% \begin{SideBySideExample}[xrightmargin=3cm]
%   \psset{PstPicture=false}
%   \begin{pspicture}(-1,-1)(1,1)
%     \PstPolygon[unit=0.8,/HLEmphasize?PolyName_=/HLReverse?A_,/HLEmphasize?PolyNbSides_=/HLReverse?6_]
%     \PstPolygon[unit=1.2,/HLEmphasize?PolyName_=/HLReverse?B_,/HLEmphasize?PolyNbSides_=/HLReverse?12_]
%   \end{pspicture}
%   \multido{\i=1+2}{6}{%
%     \ncline{A\the\multidocount}{B\i}}
% \end{SideBySideExample}
%
%   It is also a way (limited in fact...) to define three dimensional objects
% in perspective (this was used first in \cite{XYpic}):
%
% \begin{SideBySideExample}[xrightmargin=3cm]
%   \psset{unit=0.8}
%   \begin{pspicture}(3,2.5)
%     % /HLEmphasize?\PstSquare is described later_
%     \rput[lb](0,0){\PstSquare[/HLEmphasize?PolyName_=/HLReverse?A_]}
%     \rput[lb](2.5,2){\PstSquare[unit=0.5,
%                                 /HLEmphasize?PolyName_=/HLReverse?B_]}
%     \multido{\i=1+1}{4}{\ncline{A\i}{B\i}}
%   \end{pspicture}
% \end{SideBySideExample}
%
%   Of course, we can mix specific \PstPolygonPackage{} parameters with
% relevant PSTricks ones and combine it with other generic macros
% (for repetitions, projection in the 3d space, etc.)
%
% \begin{CenterExample}
%   \PstPolygon[unit=/HLReverse?1.5_,linestyle=/HLReverse?dashed_]
%   \PstPolygon[linewidth=/HLReverse?1mm_]
%   \PstPolygon[fillstyle=/HLReverse?crosshatch_,/HLEmphasize?PolyNbSides_=/HLReverse?6_]
%   \PstPolygon[linecolor=/HLReverse?red_,fillstyle=/HLReverse?solid_,fillcolor=/HLReverse?yellow_,
%               /HLEmphasize?PolyRotation_=/HLReverse?18_,/HLEmphasize?PolyOffset_=/HLReverse?2_]
%   \PstPolygon*[linecolor=/HLReverse?cyan_,/HLEmphasize?PolyNbSides_=/HLReverse?7_,/HLEmphasize?PolyOffset_=/HLReverse?2_]
% \end{CenterExample}
%
% \begin{CenterExample}
%   \multido{\i=5+2}{6}{%
%     \PstPolygon[/HLEmphasize?PolyNbSides_=/HLReverse?\i_,/HLEmphasize?PolyCurves_=/HLReverse?true_,
%                 /HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.1_,/HLEmphasize?PolyOffset_=/HLReverse?3_]}
% \end{CenterExample}
%
% \subsection{Pre-defined polygons}
%
%   Some often used polygons and other related geometric objects are
% pre-defined, for immediate usage :
%
% \begin{CenterExample}
%   \PstTriangle
%   \PstSquare
%   \PstPentagon[unit=0.5,linestyle=dotted]
%   \PstHexagon[fillstyle=hlines,hatchangle=90]
%   \PstHeptagon[fillstyle=vlines]
%   \PstOctogon*[unit=0.8,linecolor=red]
%   \PstNonagon[unit=0.5]
%   \PstDecagon
%   \PstDodecagon[linecolor=green]
%   \PstStarFiveLines
%   \PstStarFive
% \end{CenterExample}
%
% \subsection{Non regular polygons}
%
%   Until now, we have described only the so-called \emph{regular} polygons,
% which are from far the most useful ones (all of them have equal edges and
% angles). Nevertheless, it is not so difficult to extend these polygon to
% \emph{non regular} ones, using a different value for horizontal and vertical
% units (nevertheless, the code is more tricky, as we must do all the
% trigonometry explicitely...)
%
% \begin{CenterExample}
%   \PstPentagon[xunit=/HLReverse?0.5_]\hfill
%   \PstHexagon[yunit=/HLReverse?0.5_]\hfill
%   \PstStarFive[xunit=/HLReverse?0.5_,yunit=/HLReverse?1.5_]\hfill
%   \PstPolygon[xunit=/HLReverse?0.8_,yunit=/HLReverse?1.5_,/HLEmphasize?PolyNbSides_=/HLReverse?9_,/HLEmphasize?PolyOffset_=/HLReverse?2_,
%               /HLEmphasize?PolyIntermediatePoint_=/HLReverse?0.1_,/HLEmphasize?PolyCurves_=/HLReverse?true_]
% \end{CenterExample}
%
% \subsection{Nodes (vertices)}
%
%   And another powerful possibility is to define a command
% \PstPolygonNodeMacro{} which will be excuted at each node
% (\emph{Default:~empty} --- nothing executed). The counter name for nodes is
% \cs{INode}, starting from 0. The \cs{multidocount} counter, from the
% \cs{multido} command, start itself from 1.
%
% \begin{SideBySideExample}[xrightmargin=3cm]
%   \providecommand{\PstPolygonNode}{%
%     /HLReverse?\psdots[dotsize=0.2,linecolor=cyan](1;\INode)_}
%   \PstPentagon
% \end{SideBySideExample}
%
% \begin{SideBySideExample}[xrightmargin=3cm]
%   \newcounter{Letter}
%   \providecommand{\PstPolygonNode}{%
%     /HLReverse?\setcounter{Letter}{\the\multidocount}_%
%     /HLReverse?\rput*{*0}(1;\INode){\small\Alph{Letter}}_}
%   \PstHeptagon[PolyOffset=3]
% \end{SideBySideExample}
%
% \begin{SideBySideExample}[xrightmargin=3cm]
%   \providecommand{\PstPolygonNode}{%
%     /HLReverse?\psdots[dotstyle=o,dotsize=0.2](1;\INode)_
%     /HLReverse?\psline[linecolor=red]{->}(0.9;\INode)_}
%   \PstPolygon[PolyNbSides=8]
% \end{SideBySideExample}
%
% \vspace{3mm}
%   It is also a way to nest polygons:
% \vspace{3mm}
%
% \begin{SideBySideExample}[xrightmargin=3cm]
%   \newbox{\Star}
%   \savebox{\Star}{%
%     \PstStarFive*[unit=0.15,linecolor=red]}
%   \providecommand{\PstPolygonNode}{%
%     /HLReverse?\rput{*0}(1;\INode){\usebox{\Star}}_}
%   \shortstack{\PstNonagon\\[5mm]
%               \PstDodecagon[linestyle=none]}
% \end{SideBySideExample}
%
% \vspace{3mm}
%   Here we redraw one of the polygon examples built with the \XYpic{} package
% in \cite[example 5-5-34, page 203]{LGC97}:
%
% \begin{CenterExample}
%   \psset{unit=2,PstPicture=false}
%   \begin{pspicture}(-1.6,-1.6)(1.6,1.6)
%     % /HLEmphasize?Just to name the nodes, to be able to join some of them._
%     % /HLEmphasize?by solid curves. We can't draw the polygons now,_
%     % /HLEmphasize?as the node numbers must erase the solid curves..._
%     \PstHexagon[unit=0.8,linestyle=none,PolyName=H]
%     \PstDodecagon[unit=1.2,linestyle=none,PolyName=D]
%     {\SpecialCoor
%      \psset{linewidth=0.4pt,border=2pt,nodesep=0.45}
%      \psccurve(H1)(H4)(D8)([angle=-30]D9)(D11)
%      \psccurve(D3)(H3)(H6)(D12)([angle=90]D1)
%      \psccurve(D4)(H2)(H5)(D7)([angle=90]D6)}
%     \psset{linestyle=dotted,framesep=1pt}
%     \PstTriangle[unit=0.23]
%     \providecommand{\PstPolygonNode}{%
%       \rput*{*0}(1;\INode){\small\the\multidocount}}
%     \PstHexagon[unit=0.8]
%     \PstDodecagon[unit=1.2]
%     \PstDodecagon[unit=1.6]
%   \end{pspicture}
% \end{CenterExample}
%
% \section[Polygonbox]{Polygonbox\protect\footnote{written by Herbert Vo\ss.}}
% The valid options with the predefined values are
% \begin{verbatim}
%  PolyNbSides =3
%  PolyRotation=0
% \end{verbatim}
%
% \begin{itemize}
% \item There are some problems with linearcs and rounding errors, which are seen in the
% following examples for \verb+PolyNbSides=7+. 
% \item To rotate the text inside the box, one can use the \verb+\rotatebox+ macro from
%       the \verb+rotating+ package (see examples).
% \end{itemize}
%
% \begin{CenterExample}
%   \multido{\nA=3+1}{8}{%
%      \pspolygonbox[PolyNbSides=\nA,framesep=3mm]{Text}~}
% \end{CenterExample}
%
% \begin{CenterExample}
%    \multido{\nA=3+1}{8}{\pspolygonbox[PolyNbSides=\nA,%
%         framesep=2mm,doubleline=true]{Text}~}
% \end{CenterExample}
%
%
% \begin{CenterExample}
%   \psset{PolyNbSides=4}
%   \multido{\nA=0+60}{8}{\pspolygonbox[PolyRotation=\nA,%
%       framesep=2mm,doubleline=true,%
%       linecolor=red,doublecolor=blue]{\magenta Text}~}
% \end{CenterExample}
%
% \begin{CenterExample}
%   \multido{\nA=0+60,\nB=45+60}{8}{\pspolygonbox%
%      [PolyRotation=\nA,framesep=2mm,doubleline=true,%
%        linecolor=red,doublecolor=blue,linearc=0.4]%
%        {\rotatebox{\nB}{\blue Text}}~}\\[1cm]
% \end{CenterExample}
%
% \begin{CenterExample}
%   \multido{\nA=3+1}{8}{%
%     \pspolygonbox[PolyNbSides=\nA,rot=60,framesep=2pt,%
%       doubleline=true,linearc=0.2]{Text}~}
% \end{CenterExample}
%
% \begin{CenterExample}
%   \multido{\nA=3+1}{8}{%
%      \pspolygonbox[PolyNbSides=\nA,framesep=10pt,%
%      fillstyle=solid,fillcolor=cyan,linearc=0.2]{Text}~}
% \end{CenterExample}
%
% \begin{CenterExample}
%   \multido{\nA=-5+5}{8}{\pspolygonbox[framesep=\nA pt,%
%      PolyRotation=90]{\Huge\red T}~}
% \end{CenterExample}
%
%
% \begin{CenterExample}
%   \multido{\nA=-5+5}{8}{\pspolygonbox[framesep=\nA pt,%
%      PolyRotation=90,boxsep=false]{\Huge\red T}~}
% \end{CenterExample}
%
%
% ^^A Bibliography
% \begin{thebibliography}{9}
% \bibitem{Girou94} Denis Girou, Pr\'esentation de PSTricks,
%                   \emph{Cahiers GUTenberg}, Number~16, pages 21--70,
%                   February~1994 (in french).
%
% \bibitem{Girou95} Denis Girou, Building high level objects in PSTricks,
%                   TUG'95, St Petersburg, Florida, 1995. Available at
% {\url{http://www.tug.org/applications/PSTricks/TUG95-PSTricks_4.ps.gz}}
%
% \bibitem{LGC97} Michel Goossens, Sebastian Rahtz and Frank Mittelbach,
%                 \emph{The \LaTeX{} Graphics Companion}, Addison-Wesley, 1997.
%
% \bibitem{Hoenig98} Alan Hoenig, \emph{\TeX{} Unbound: \LaTeX{} \& \TeX{}
%                    Strategies, Fonts, Graphics, and More},
%                    Oxford University Press, 1998.
%
% \bibitem{voss04} Herbert Vo\ss, PSTricks -- Grafik mit {P}ost{S}cript f\"ur \TeX{}
%                    und \LaTeX{}, Lehmanns, July 2004 (in german).
%		    
% \bibitem{XYpic} Kristoffer~H. Rose and Ross Moore, \XYpic. Polygon feature,
%                 available from \CTAN, 1991-1998, \CTANref{xypic}.
%
% \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.
% \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-poly.dtx}
\usepackage{fancyvrb}
\usepackage{pstricks}
\usepackage{pst-poly}
\usepackage{rotating}
\usepackage{url}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\OnlyDescription          % Comment it for implementation details
\hbadness=7000            % Over and under full box warnings
\hfuzz=3pt
\begin{document}
  \DocInput{pst-poly.dtx}
\end{document}
%</driver>
%    \end{macrocode}
%
% \section{\PstPolygonPackage{} \LaTeX{} wrapper}
%
%    \begin{macrocode}
%<*latex-wrapper>
\RequirePackage{pstricks}
\ProvidesPackage{pst-poly}[2004/11/20 package wrapper for 
  pst-poly.tex (hv)]
\input{pst-poly.tex}
\ProvidesFile{pst-poly.tex}
  [\filedate\space v\fileversion\space `PST-poly' (DG)]
%</latex-wrapper>
%    \end{macrocode}
%
% \section{\PstPolygonPackage{} code}
%
%   As it is a general and very powerful way to build \emph{high level graphic
% objects} above PSTricks own ones, we will comment precisely the code,
% focusing these comments on the case of \emph{regular} polygons, which is
% enough to show all useful major technics. In fact, all real difficulties
% in the code of \PstPolygonPackage{} are for the \emph{non regular} case,
% which involve some trigonometry.
%
%    \begin{macrocode}
%<*pst-poly>
%    \end{macrocode}
%
% \subsection{Preambule}
%
%   Who we are.
%
%    \begin{macrocode}
%
\def\fileversion{1.60}
\def\filedate{2004/11/20}
\message{`PST-Polygon' v\fileversion, \filedate\space (DG/hv)}
\csname PSTPolygonLoaded\endcsname
\let\PSTPolygonLoaded\endinput
%
%    \end{macrocode}
%
%   Require the PSTricks, `\textsf{pst-node}' and `\textsf{multido}' packages.
%
%    \begin{macrocode}
%
\ifx\PSTricksLoaded\endinput\else\input pstricks.tex\fi
\ifx\PSTnodesLoaded\endinput\else\input pst-node.tex\fi
\ifx\MultidoLoaded\endinput\else\input multido.tex\fi
%
%    \end{macrocode}
%
%    \begin{macrocode}
\ifx\PSTXKeyLoaded\endinput\else\input pst-xkey \fi
%    \end{macrocode}
%
%   Catcodes changes.
%
%    \begin{macrocode}
%
\edef\PstAtCode{\the\catcode`\@}
\catcode`\@=11\relax
\pst@addfams{pst-poly}
%
%    \end{macrocode}
%
% \subsection{Definition of the parameters}
%
%   \texttt{PstPicture} will define if the polygon must be set inside a
% \texttt{pspicture} environment or not. It is a \emph{boolean} value, so we
% define a new \cs{if} \TeX{} variable. The \texttt{true} value specified
% will give the default to used when no value is affected to this parameter
% (so \texttt{PstPicture} will be equivalent to \texttt{PstPicture=true}).
% Take care that it is not the default value for the parameter itself (we
% will see later that here we choose \texttt{false} as default value...).
% We don't prefix this parameter name by \texttt{Poly} because it is not
% specific to polygons. Note also that \texttt{psset} is for the
% \KeyValPackage{} package the generic name for all PSTricks parameters.
%
%    \begin{macrocode}
\newif\ifPst@PstPicture
\define@key[psset]{pst-poly}{PstPicture}[true]{\@nameuse{Pst@PstPicture#1}}
%    \end{macrocode}
%
%   \texttt{PolyRotation} will be the rotation angle to apply to the
% polygon. It is a \emph{real} value used as an \emph{angle}.
%
%    \begin{macrocode}
\define@key[psset]{pst-poly}{PolyRotation}{\edef\PstPoly@Rotation{#1}}
%    \end{macrocode}
%
%   \texttt{PolyNbSides} will be the number of sides (edges) of the polygon.
% It is an \emph{integer} value and we store it into a \TeX{} macro (in this
% way, we can define a lot of integer parameters without having the risk to
% exhaust \TeX{} limitations of numbers of counters).
%
%    \begin{macrocode}
\define@key[psset]{pst-poly}{PolyNbSides}{\pst@getint{#1}{\PstPoly@NbSides}}
%    \end{macrocode}
%
%   \texttt{PolyOffset} will be the offset to obtain the next vertice to
% connect, for each one of the polygon. It is an \emph{integer} value.
%
%    \begin{macrocode}
\define@key[psset]{pst-poly}{PolyOffset}{\pst@getint{#1}{\PstPoly@Offset}}
%    \end{macrocode}
%
%   \texttt{PolyIntermediatePoint} will be the position of an intermediate
% point to used between the current vertice and the next one, for each edge.
% It will defined a \emph{relative} position, which will be the same for
% each edge. As it is a \emph{real} value on which we will have to make some
% computations, we use here a dimension register.
%
%    \begin{macrocode}
\newdimen\PstPoly@IntermediatePointDim
\define@key[psset]{pst-poly}{PolyIntermediatePoint}{\edef\PstPoly@IntermediatePoint{#1}}
%    \end{macrocode}
%
%   \texttt{PolyName} will be the name assigned to the polygon, which will be
% useful if we would like to connect edges of different polygons. It is a
% \texttt{string} that we store in a macro.
%
%    \begin{macrocode}
\define@key[psset]{pst-poly}{PolyName}{\edef\PstPoly@Name{#1}}
%    \end{macrocode}
%
%   \texttt{PolyCurves} will define if the edges are lines or curves. It is a
% \emph{boolean value}. And logically, there will be no effect of it if there
% is no intermediate point defined.
%
%    \begin{macrocode}
\newif\ifPstPoly@Curves
\define@key[psset]{pst-poly}{PolyCurves}[true]{\@nameuse{PstPoly@Curves#1}}
%    \end{macrocode}
%
%   \texttt{PolyEpicycloid} will define if we will draw a polygon or an
% epicycloid (which is of course not a polygon, but this was a functionality
% very easy to add to this package!) It is a \emph{boolean} value.
%
%    \begin{macrocode}
\newif\ifPstPoly@Epicycloid
\define@key[psset]{pst-poly}{PolyEpicycloid}[true]{\@nameuse{PstPoly@Epicycloid#1}}
%    \end{macrocode}
%
%   Next, we set the default values for all these new parameters.
% We choose to have no rotation, five sides, no offset (so a value of 1),
% no intermediate point, no name, connections by lines (so no curved ones)
% and polygons (so no epicycloids).
%
%    \begin{macrocode}
\psset{%
  PstPicture=true,PolyRotation=0,PolyNbSides=5,PolyOffset=1,
  PolyIntermediatePoint=,PolyName=,PolyCurves=false,PolyEpicycloid=false}
%
%    \end{macrocode}
%
% \subsection{Main macro}
%
%   The general \cs{PstPolygon} macro to draw polygons.
%
%    First we look if the \texttt{*} convention is used, as for many PSTricks
% macros, to fill the graphic object using the current color of the line.
%
% \begin{macro}{\PstPolygon}
%    \begin{macrocode}
%
\def\PstPolygon{\pst@ifstar{\@ifnextchar[{\PstPolygon@i}{\PstPolygon@i[]}}}
%    \end{macrocode}
% \end{macro}
%
%   Then we define the auxiliary macro which will handle the parameters if
% some are used. Note also the usage of the double \verb+{{+ to have only
% changes of parameter values for this specific object, as redefinitions
% of them must be local.
%
% \begin{macro}{\PstPolygon@i}
%    \begin{macrocode}
\def\PstPolygon@i[#1]{{%
%    \end{macrocode}
%
%   After that, we can set the values of local parameters if defined and
% take account of the \texttt{*} convention if used.
%
%    \begin{macrocode}
\psset{#1}%
\if@star\solid@star\fi
%    \end{macrocode}
%
%   For security, we make some checks on the validity of the parameters.
%
%    \begin{macrocode}
\ifnum\PstPoly@NbSides<3
  \@pstrickserr{PolyNbSides must be greater than 2
                (and not `\PstPoly@NbSides')}{\@eha}%
\fi
\ifnum\PstPoly@NbSides>200
  \@pstrickserr{PolyNbSides must be less than 201
                (and not `\PstPoly@NbSides')}{\@eha}%
\fi
\ifnum\PstPoly@Offset<1
  \@pstrickserr{PolyOffset must be greater than 0
                (and not `\PstPoly@Offset')}{\@eha}%
\fi
%    \end{macrocode}
%
%   And now, we can start the \emph{real} code. First we affect a special
% value for the case where an offset will be used. There are only two cases,
% as the offset can be \emph{odd} or \emph{even}.
%
%    \begin{macrocode}
\ifodd\PstPoly@Offset
  \def\PstPoly@Decimal{.5}%
\else
  \def\PstPoly@Decimal{}%
\fi
%    \end{macrocode}
%
%   We must say to use non cartesian coordinates (we will used polar ones
% --- and special ones computed by trigonometry and defined in PostScript
% for \emph{non} regular polygons).
%
%    \begin{macrocode}
%
\SpecialCoor
%    \end{macrocode}
%
%   We look at the definition of a ``\texttt{pspicture}'' environment or not.
%
%    \begin{macrocode}
\ifPst@PstPicture\pspicture(-1,-1)(1,1)\fi
%    \end{macrocode}
%
%   We rotate the polygon if necessary (if not, we will use a rotation of
% angle 0, which will have of course no effect).
%
%    \begin{macrocode}
\rput{\PstPoly@Rotation}(0,0){%
%    \end{macrocode}
%
%   We will used polar coordinates, with a unit given by the number of sides
% of the polygon.
%
%    \begin{macrocode}
  \degrees[\PstPoly@NbSides]
%    \end{macrocode}
%
%   We must recompute it here if the unit has changed after assignation
% (for instance \verb+\psset{PolyIntermediatePoint=0.38}\PstPolygon[unit=2]+)
%
%    \begin{macrocode}
  \pssetlength{\PstPoly@IntermediatePointDim}{\PstPoly@IntermediatePoint}
%    \end{macrocode}
%
%   If there is a name for this polygon, we assign this name followed by 0
% to the center of it, and different names to all vertices, indexed by the
% number of the vertice.
%
%    \begin{macrocode}
  \ifx\PstPoly@Name\@empty
  \else
    \pnode(0,0){\PstPoly@Name 0}
    \ifnum\psxunit=\psyunit
      \def\PstPoly@Node{\pnode(1;\i)}%
    \else
      \def\PstPoly@Node{%
        \pnode(! \i\space 360 \PstPoly@NbSides\space div mul cos
                 \i\space 360 \PstPoly@NbSides\space div mul sin)}%
    \fi
    \multido{\i=0+1}{\PstPoly@NbSides}{%
      \PstPoly@Node{\PstPoly@Name\the\multidocount}}
  \fi
%    \end{macrocode}
%
%   Now we are ready to draw the polygon. We use a \cs{pscustom} environment.
%
%    \begin{macrocode}
  \pscustom{%
%    \end{macrocode}
%
%   First, the case of epicycloids. We must only join each vertice to the
% opposite one, using the defined offset as gap.
%
%    \begin{macrocode}
    \ifPstPoly@Epicycloid
      \pst@cnta=\PstPoly@NbSides
      \divide\pst@cnta\tw@
      \multido{\i=0+1}{\PstPoly@NbSides}{%
        \moveto(1;\i)
        \lineto(1;\the\pst@cnta)
        \advance\pst@cnta\PstPoly@Offset}
%    \end{macrocode}
%
%   Now, we can see the case of polygons. First, we move to the starting point.
%
%    \begin{macrocode}
    \else
      \ifnum\psxunit=\psyunit
        \moveto(1,0)
      \else
        \moveto(! 1 0)
      \fi
%    \end{macrocode}
%
%   If there is no intermediate point, we must only have a loop to join all
% vertices, according to the number of edges. And we use each time the
% defined value of the offset to obtain the next vertice.
%
%    \begin{macrocode}
      \ifx\PstPoly@IntermediatePoint\@empty
        \ifnum\psxunit=\psyunit
          \def\PstPoly@Junction{\lineto(1;\i)}%
        \else
          \def\PstPoly@Junction{\lineto%
            (! \i\space 360 \PstPoly@NbSides\space div mul cos
               \i\space 360 \PstPoly@NbSides\space div mul sin)}%
        \fi
        \multido{\i=\PstPoly@Offset+\PstPoly@Offset}{\PstPoly@NbSides}{%
          \PstPoly@Junction}
%    \end{macrocode}
%
%   If there is an intermediate point, first we see if vertices will be joined
% by lines or curves.
%
%    \begin{macrocode}
      \else
        \ifPstPoly@Curves
          \let\PstPoly@JunctionType\pscurve
        \else
          \let\PstPoly@JunctionType\psline
        \fi
        \ifnum\psxunit=\psyunit
          \def\PstPoly@Junction{\PstPoly@JunctionType%
            (\PstPoly@IntermediatePointDim;\the\pst@cnta\PstPoly@Decimal)
            (1;\i)}%
        \else
          \def\PstPoly@Junction{\PstPoly@JunctionType%
            (! \PstPoly@IntermediatePoint\space
                 \the\pst@cnta\PstPoly@Decimal\space 360
                   \PstPoly@NbSides\space div mul cos mul
               \PstPoly@IntermediatePoint\space
                 \the\pst@cnta\PstPoly@Decimal\space 360
                   \PstPoly@NbSides\space div mul sin mul)
            (! \i\space 360 \PstPoly@NbSides\space div mul cos
               \i\space 360 \PstPoly@NbSides\space div mul sin)}%
        \fi
%    \end{macrocode}
%
%   We compute half of the value of the offset. We use a counter for that,
% which is an integer, so we will add the value of the \cs{PstPoly@Decimal}
% macro defined above, which has value 0.5 if the offset is an odd number.
%
%    \begin{macrocode}
        \pst@cnta=\PstPoly@Offset
        \divide\pst@cnta\tw@
%    \end{macrocode}
%
%   Now, we can execute the main loop: for each vertice we join the current
% one to the next, using each time the intermediate point defined.
%
%    \begin{macrocode}
        \multido{\i=\PstPoly@Offset+\PstPoly@Offset}{\PstPoly@NbSides}{%
          \PstPoly@Junction
          \advance\pst@cnta\PstPoly@Offset}
%    \end{macrocode}
%
%   Now, we can close the opened \emph{if} structures and the
% \texttt{pscustom} environment.
%
%    \begin{macrocode}
      \fi
    \fi}
%    \end{macrocode}
%
%   In the case where there is a special macro of name \cs{PstPolygonNode}
% defined, we execute it at each node, and we close the rotation command.
% The counter used is \cs{INode}.
%
%    \begin{macrocode}
  \ifx\PstPolygonNode\@undefined
  \else
    \multido{\INode=\z@+\PstPoly@Offset}{\PstPoly@NbSides}{%
      \PstPolygonNode}
  \fi}
%    \end{macrocode}
%
%   Then we close the ``\texttt{pspicture}'' environment, if defined,
% and the \cs{PstPolygon@i} macro.
%
%    \begin{macrocode}
\ifPst@PstPicture
  \endpspicture
\fi}}
%    \end{macrocode}
% \end{macro}
%
% \subsection{Pre-defined polygons}
%
%   Triangle (three sides).
%
% \begin{macro}{\PstTriangle}
%    \begin{macrocode}
\def\PstTriangle{%
\pst@ifstar{\@ifnextchar[{\PstTriangle@i}{\PstTriangle@i[]}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PstTriangle@i}
%    \begin{macrocode}
\def\PstTriangle@i[#1]{{%
\psset{PolyNbSides=3,PolyRotation=90}% For triangle (360/3*(3/4))
\psset{#1}%
\if@star\solid@star\fi
\PstPolygon}}
%    \end{macrocode}
% \end{macro}
%
%   Square (four sides).
%
% \begin{macro}{\PstSquare}
%    \begin{macrocode}
\def\PstSquare{%
\pst@ifstar{\@ifnextchar[{\PstSquare@i}{\PstSquare@i[]}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PstSquare@i}
%    \begin{macrocode}
\def\PstSquare@i[#1]{{%
\psset{PolyNbSides=4,PolyRotation=45}% For square (360/4/2)
\psset{#1}%
\if@star\solid@star\fi
\PstPolygon}}
%    \end{macrocode}
% \end{macro}
%
%   Pentagon (five sides).
%
% \begin{macro}{\PstPentagon}
%    \begin{macrocode}
\def\PstPentagon{%
\pst@ifstar{\@ifnextchar[{\PstPentagon@i}{\PstPentagon@i[]}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PstPentagon@i}
%    \begin{macrocode}
\def\PstPentagon@i[#1]{{%
\psset{PolyNbSides=5,PolyRotation=18}% For pentagon (360/5/4)
\psset{#1}%
\if@star\solid@star\fi
\PstPolygon}}
%    \end{macrocode}
% \end{macro}
%
%   Hexagon (six sides).
%
% \begin{macro}{\PstHexagon}
%    \begin{macrocode}
\def\PstHexagon{%
\pst@ifstar{\@ifnextchar[{\PstHexagon@i}{\PstHexagon@i[]}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PstHexagon@i}
%    \begin{macrocode}
\def\PstHexagon@i[#1]{{%
\psset{PolyNbSides=6}%
\psset{#1}%
\if@star\solid@star\fi
\PstPolygon}}
%    \end{macrocode}
% \end{macro}
%
%   Heptagon (seven sides).
%
% \begin{macro}{\PstHeptagon}
%    \begin{macrocode}
\def\PstHeptagon{%
\pst@ifstar{\@ifnextchar[{\PstHeptagon@i}{\PstHeptagon@i[]}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PstHeptagon@i}
%    \begin{macrocode}
\def\PstHeptagon@i[#1]{{%
\psset{PolyNbSides=7,PolyRotation=38.57}% For heptagon (360/7*(3/4))
\psset{#1}%
\if@star\solid@star\fi
\PstPolygon}}
%    \end{macrocode}
% \end{macro}
%
%   Octogon (height sides).
%
% \begin{macro}{\PstOctogon}
%    \begin{macrocode}
\def\PstOctogon{%
\pst@ifstar{\@ifnextchar[{\PstOctogon@i}{\PstOctogon@i[]}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PstOctogon@i}
%    \begin{macrocode}
\def\PstOctogon@i[#1]{{%
\psset{PolyNbSides=8,PolyRotation=22.5}% For octogon (360/8/2)
\psset{#1}%
\if@star\solid@star\fi
\PstPolygon}}
%    \end{macrocode}
% \end{macro}
%
%   Nonagon (nine sides).
%
% \begin{macro}{\PstNonagon}
%    \begin{macrocode}
\def\PstNonagon{%
\pst@ifstar{\@ifnextchar[{\PstNonagon@i}{\PstNonagon@i[]}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PstNonagon@i}
%    \begin{macrocode}
\def\PstNonagon@i[#1]{{%
\psset{PolyNbSides=9,PolyRotation=10}% For nonagon (360/9/4)
\psset{#1}%
\if@star\solid@star\fi
\PstPolygon}}
%    \end{macrocode}
% \end{macro}
%
%   Decagon (ten sides).
%
% \begin{macro}{\PstDecagon}
%    \begin{macrocode}
\def\PstDecagon{%
\pst@ifstar{\@ifnextchar[{\PstDecagon@i}{\PstDecagon@i[]}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PstDecagon@i}
%    \begin{macrocode}
\def\PstDecagon@i[#1]{{%
\psset{PolyNbSides=10}%
\psset{#1}%
\if@star\solid@star\fi
\PstPolygon}}
%    \end{macrocode}
% \end{macro}
%
%   Dodecagon (twelve sides).
%
% \begin{macro}{\PstDodecagon}
%    \begin{macrocode}
\def\PstDodecagon{%
\pst@ifstar{\@ifnextchar[{\PstDodecagon@i}{\PstDodecagon@i[]}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PstDodecagon@i}
%    \begin{macrocode}
\def\PstDodecagon@i[#1]{{%
\psset{PolyNbSides=12,PolyRotation=15}% For dodecagon (360/12/2)
\psset{#1}%
\if@star\solid@star\fi
\PstPolygon}}
%    \end{macrocode}
% \end{macro}
%
%   Star with five leaves, with internal lines.
%
% \begin{macro}{\PstStarFiveLines}
%    \begin{macrocode}
\def\PstStarFiveLines{%
\pst@ifstar{\@ifnextchar[{\PstStarFiveLines@i}{\PstStarFiveLines@i[]}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PstStarFiveLines@i}
%    \begin{macrocode}
\def\PstStarFiveLines@i[#1]{{%
\psset{PolyOffset=2,PolyRotation=18}%
\psset{#1}%
\if@star\solid@star\fi
\PstPolygon}}
%    \end{macrocode}
% \end{macro}
%
%   Star with five leaves.
%
% \begin{macro}{\PstStarFive}
%    \begin{macrocode}
\def\PstStarFive{%
\pst@ifstar{\@ifnextchar[{\PstStarFive@i}{\PstStarFive@i[]}}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\PstStarFive@i}
%    \begin{macrocode}
\def\PstStarFive@i[#1]{{%
\psset{PolyIntermediatePoint=0.38,PolyRotation=18}%
\psset{#1}%
\if@star\solid@star\fi
\PstPolygon}}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pspolygonbox}
%    \begin{macrocode}
\newdimen\pst@dimm
\newdimen\pst@dimn
\newdimen\pst@dimo
\newdimen\pst@dimp
\def\pspolygonbox{\pst@object{pspolygonbox}}%   voss 2004-11-20
%    \end{macrocode}
% \end{macro}
%
%
% \begin{macro}{\pspolygonbox@i}
%    \begin{macrocode}
\def\pspolygonbox@i{\pst@makebox\pspolygonbox@ii}
%    \end{macrocode}
% \end{macro}
%
% \begin{macro}{\pspolygonbox@ii}
%    \begin{macrocode}
%
\def\pspolygonbox@ii{{%
   \begingroup%
   \pst@useboxpar%
   \pst@dima=\pslinewidth%
   \ifpsdoubleline%
     \advance\pst@dima by \psdoublesep\pslinewidth%
     \advance\pst@dima by \pslinewidth%
   \fi%
   \advance\pst@dima by \psframesep%
   \pst@dimc=\wd\pst@hbox%
   \pst@dimp=\pst@dimc\advance\pst@dimp by 2\pst@dima%
   \pst@dimb=\dp\pst@hbox\pst@dimo=\pst@dimb%
   \pst@dimd=\ht\pst@hbox\advance\pst@dimo by \pst@dimd% totalheight
   \pst@pyth\pst@dimp\pst@dimo\pst@dimm%
   \divide\pst@dimm by 2% Radius
   \setbox\pst@hbox=\hbox{%
     \ifpsboxsep\kern\pst@dima\fi% left side  
     \begin@ClosedObj%
       \addto@pscode{%
         /framesep \pst@number\pst@dima def 
	 /boxdepth \pst@number\pst@dimb framesep add def
         /boxheight0 \pst@number\pst@dimd def
         /boxheight boxheight0 framesep add def
         /boxwidth \pst@number\pst@dimc def
         /radius \pst@number\pst@dimm def
         /order \PstPoly@NbSides\space def
         /dAlpha 360 order div def
	 /alpha \PstPoly@Rotation\space def
         \pst@cp
	 \tx@polygonB
	 \psline@iii
%%	 \tx@Line
	 \tx@Polygon
       }%
       \def\pst@linetype{1}%
       \showpointsfalse%
     \end@ClosedObj%
     \box\pst@hbox%
     \ifpsboxsep\kern\pst@dima\fi%% right side
   }%
   \ifpsboxsep%
     \pst@dimn=-.5\pst@dimo\advance\pst@dimn by \pst@dimb%
     \advance\pst@dimn by 0.809\pst@dimm%
     \dp\pst@hbox=\pst@dimn%
     \pst@dimn=\pst@dimm\advance\pst@dimn by 0.5\pst@dimo%
     \advance\pst@dimn by -\pst@dimb%
     \ht\pst@hbox=\pst@dimn\fi%
   \leavevmode%
   \box\pst@hbox%
   \endgroup%
}\ignorespaces}
%
%
% \begin{macro}{polygonB}
%    \begin{macrocode}
%
\pst@def{polygonB}<{%
  /x1 framesep neg def
  /x2 boxwidth framesep add def
  /y1 boxdepth framesep add neg def
  /y2 boxheight framesep add def
  x2 x1 add 2 div y2 y1 add 2 div translate
  [
  alpha cos radius mul 
  alpha sin radius mul 
  order { /alpha alpha dAlpha add def
    radius alpha cos mul
    radius alpha sin mul
  } repeat
}>
%    \end{macrocode}
% \end{macro}
%
%    \end{macrocode}
% \end{macro}
%
% \subsection{Closing}
%
%   Catcodes restoration.
%
%    \begin{macrocode}
\catcode`\@=\PstAtCode\relax
%    \end{macrocode}
%
%    \begin{macrocode}
%</pst-poly>
%    \end{macrocode}
%
% \section{\PstPolygonPackage{} test file}
%
%    \begin{macrocode}
%<*tst-poly>
%% `pst-poly' test file.
%%
\documentclass{article}

\usepackage{fancyvrb}
\usepackage[width=18cm]{geometry}
\usepackage{pstricks}
\usepackage{pst-poly}

% Example macros - adapted from the `fvrb-ex' package
% ---------------------------------------------------

\makeatletter

% Take care that we use here the four /?_Z characters as escape
% characters, so we can't use these characters in the examples!

% To highlight some verbatim sequences (comments, macro names, etc.)
\def\HLEmphasize#1{\textit{#1}}
\newcommand{\BS}{\texttt{\symbol{`\\}}}
\def\HLMacro#1{\BS{}def\HLMacro@i#1\@nil}
\def\HLMacro@i#1def#2\@nil{\HLReverse{#2}}
\def\HLReverse#1{{\setlength{\fboxsep}{1pt}\HLReverse@i{#1}}}
\def\HLReverse@i#1{\colorbox{black}{\textcolor{white}{\textbf{#1}}}}

\def\Example{\FV@Environment{}{Example}}
\def\endExample{%
\end{VerbatimOut}
\Below@Example{\jobname.tmp}
\endgroup}

\def\CenterExample{\FV@Environment{}{Example}}
\def\endCenterExample{%
\end{VerbatimOut}
\begin{center}
\Below@Example{\jobname.tmp}
\end{center}
\endgroup}

\def\SideBySideExample{\FV@Environment{}{Example}}
\def\endSideBySideExample{%
\end{VerbatimOut}
\SideBySide@Example{\jobname.tmp}
\endgroup}

\def\FVB@Example{%
\begingroup
\FV@UseKeyValues
\parindent=0pt
\multiply\topsep by 2
\VerbatimEnvironment
\begin{VerbatimOut}[gobble=2,codes={\catcode`\Z=12}]{\jobname.tmp}}

\def\Below@Example#1{%
\VerbatimInput[commentchar=Z,commandchars=/?_,frame=single,
               numbers=left,numbersep=3pt]{#1}
\catcode`\%=14\relax
\catcode`\Z=9\relax
% We suppress the effect of the highlighting macros
\catcode`/=0\relax
\catcode`?=1\relax
\catcode`_=2\relax
\def\HLEmphasize##1{##1}%
\def\HLMacro##1{##1}%
\def\HLReverse##1{##1}%
\input{#1}\par}

\def\SideBySide@Example#1{%
\vskip 1mm
\@tempdimb=\FV@XRightMargin
\advance\@tempdimb -5mm
\begin{minipage}[c]{\@tempdimb}
  \fvset{xrightmargin=0pt}
  \catcode`\%=14\relax
  \catcode`\Z=9\relax
  % We suppress the effect of the highlighting macros
  \catcode`/=0\relax
  \catcode`?=1\relax
  \catcode`_=2\relax
  \def\HLEmphasize##1{##1}%
  \def\HLMacro##1{##1}%
  \def\HLReverse##1{##1}%
  \input{#1}
\end{minipage}%
\@tempdimb=\textwidth
\advance\@tempdimb -\FV@XRightMargin
\advance\@tempdimb 5mm
\begin{minipage}[c]{\@tempdimb}
  \VerbatimInput[commentchar=Z,commandchars=/?_,
                 frame=single,numbers=left,numbersep=3pt,
                 xleftmargin=5mm,xrightmargin=0pt]{#1}
\end{minipage}
\vskip 1mm}

\makeatother

% End of example macros from `fvrb-ex'

\begin{document}

% First serie

\begin{CenterExample}
  \multido{\i=3+1}{6}{%
    \PstPolygon[PolyNbSides=\i]\hspace{5mm}}
  \PstPolygon[PolyNbSides=30]
\end{CenterExample}

\begin{CenterExample}
  \multido{\i=3+2}{6}{%
    \PstPolygon[PolyOffset=2,PolyNbSides=\i]\hspace{5mm}}
  \PstPolygon[PolyOffset=2,PolyNbSides=31]
\end{CenterExample}

\begin{CenterExample}
  \multido{\i=3+1}{7}{%
    \PstPolygon[PolyOffset=3,PolyNbSides=\i]\hspace{5mm}}
\end{CenterExample}

\begin{CenterExample}
  \multido{\i=5+1}{7}{%
    \PstPolygon[PolyOffset=4,PolyNbSides=\i]\hspace{5mm}}
\end{CenterExample}

\begin{CenterExample}
  \multido{\i=5+2}{7}{%
    \PstPolygon[PolyOffset=5,PolyNbSides=\i]\hspace{5mm}}
\end{CenterExample}

\clearpage
\begin{CenterExample}
  \multido{\i=5+2}{7}{%
    \PstPolygon[PolyOffset=7,PolyNbSides=\i]\hspace{5mm}}
\end{CenterExample}

\begin{CenterExample}
  \multido{\i=5+2}{7}{%
    \PstPolygon[PolyOffset=8,PolyNbSides=\i]\hspace{5mm}}
\end{CenterExample}

\begin{CenterExample}
  \multido{\i=1+1}{7}{%
    \PstPolygon[PolyOffset=\i,PolyNbSides=5]\hspace{5mm}}
\end{CenterExample}

\begin{CenterExample}
  \multido{\i=1+1}{7}{%
    \PstPolygon[PolyOffset=\i,PolyNbSides=7]\hspace{5mm}}
\end{CenterExample}

\begin{CenterExample}
  \multido{\i=5+1}{7}{%
    \PstPolygon[PolyCurves,PolyIntermediatePoint=0.1,PolyNbSides=\i]
    \hspace{5mm}}
\end{CenterExample}

\clearpage
\begin{CenterExample}
  \multido{\i=5+1}{7}{%
    \PstPolygon[PolyCurves,PolyIntermediatePoint=0.2,
                PolyOffset=2,PolyNbSides=\i]\hspace{5mm}}
\end{CenterExample}

\begin{CenterExample}
  \multido{\i=5+2}{7}{%
    \PstPolygon[PolyCurves,PolyIntermediatePoint=0.1,
                PolyOffset=3,PolyNbSides=\i]\hspace{5mm}}
\end{CenterExample}

% Second serie

\begin{CenterExample}
  \multido{\n=-1.4+0.5}{7}{%
    \PstPolygon[PolyNbSides=3,PolyOffset=2,PolyIntermediatePoint=\n]
    \hspace{5mm}}
\end{CenterExample}

\begin{CenterExample}
  \multido{\n=-1.4+0.5}{7}{%
    \PstPolygon[PolyNbSides=5,PolyOffset=2,PolyIntermediatePoint=\n]
    \hspace{5mm}}
\end{CenterExample}

\begin{CenterExample}
  \multido{\n=-1.4+0.5}{7}{%
    \PstPolygon[PolyNbSides=13,PolyOffset=2,PolyIntermediatePoint=\n]
    \hspace{5mm}}
\end{CenterExample}

\begin{CenterExample}
  \multido{\n=-1.4+0.5}{7}{%
    \PstPolygon[PolyNbSides=21,PolyOffset=2,PolyIntermediatePoint=\n]
    \hspace{5mm}}
\end{CenterExample}

% Third serie

\begin{CenterExample}
  \psset{unit=1.4,linewidth=0.001,PolyNbSides=72,PolyEpicycloid}
  \multido{\i=2+1}{4}{%
    % Epicycloid of factor 1 is cardioid and of factor 2 nephroid
    \PstPolygon[PolyOffset=\i]\hspace{5mm}}
\end{CenterExample}

\begin{SideBySideExample}[xrightmargin=5cm]
  % Epicycloid of factor 10
  \PstPolygon[unit=2,linewidth=0.003,
              PolyEpicycloid,PolyNbSides=72,PolyOffset=11]
\end{SideBySideExample}

\begin{SideBySideExample}[xrightmargin=5cm]
  % Epicycloid of factor 22
  \PstPolygon[unit=2,linewidth=0.003,
              PolyEpicycloid,PolyNbSides=72,PolyOffset=23]
\end{SideBySideExample}

\clearpage
\begin{CenterExample}
  \psset{unit=1.9,linewidth=0.001,PolyNbSides=72,PolyEpicycloid}
  \multido{\i=71+1}{3}{%
    \PstPolygon[PolyOffset=\i]\hspace{5mm}}
\end{CenterExample}

\fvset{xrightmargin=5cm}	% 5cm reserved for the graphic

\begin{SideBySideExample}
  % Epicycloid of factor 100
  \PstPolygon[unit=2,linewidth=0.003,
              PolyEpicycloid,PolyNbSides=72,PolyOffset=101]
\end{SideBySideExample}

\begin{SideBySideExample}[xrightmargin=5cm]
  % Epicycloid of factor 153
  \PstPolygon[unit=2,linewidth=0.003,
              PolyEpicycloid,PolyNbSides=72,PolyOffset=154]
\end{SideBySideExample}

\clearpage

% Fourth serie

\begin{SideBySideExample}
  \providecommand{\PstPolygonNode}{%
    \psdots[dotsize=0.2,linecolor=cyan](1;\INode)}
  \PstPentagon[unit=2]
\end{SideBySideExample}

\begin{SideBySideExample}
  \providecommand{\PstPolygonNode}{%
    \rput{*0}(1.2;\INode){\small\the\multidocount}}
  \PstPolygon[unit=2,PolyNbSides=7,PolyOffset=2]
\end{SideBySideExample}

\begin{SideBySideExample}
  \providecommand{\PstPolygonNode}{%
    \rput*{*0}(1;\INode){\small\the\multidocount}}
  \PstHeptagon[unit=2,PolyOffset=2]
\end{SideBySideExample}

\begin{SideBySideExample}
  \newcounter{Letter}
  \providecommand{\PstPolygonNode}{%
    \setcounter{Letter}{\the\multidocount}%
    \rput*{*0}(1;\INode){\small\Alph{Letter}}}
  \PstHeptagon[unit=2,PolyOffset=3]
\end{SideBySideExample}

\begin{SideBySideExample}
  \providecommand{\PstPolygonNode}{%
    \SpecialCoor
    \degrees[3]
    \rput{0.5}(0.5;\INode){%
      \pspolygon*(0.5;0.5)(0.5;1.5)(0.5;2.5)}}
  \PstTriangle
\end{SideBySideExample}

\begin{SideBySideExample}
  \providecommand{\PstPolygonNode}{%
    \psdots[dotstyle=o,dotsize=0.2](1;\INode)
    \psline[linecolor=red]{->}(0.9;\INode)}
  \PstPolygon[unit=2,PolyNbSides=8]
\end{SideBySideExample}

\begin{SideBySideExample}
  \providecommand{\PstPolygonNode}{%
    \psline[linewidth=0.1mm,doubleline=true,
            linecolor=green]{<->}(0;0)(1;\INode)}
  \PstHexagon[unit=2]
\end{SideBySideExample}

\begin{SideBySideExample}
  \newbox{\Star}
  \savebox{\Star}{%
    \PstStarFive*[unit=0.15,linecolor=red]}
  \providecommand{\PstPolygonNode}{%
    \rput{*0}(1;\INode){\usebox{\Star}}}
  \shortstack{%
    \PstNonagon\\[5mm]
    \PstDodecagon[linestyle=none]}
\end{SideBySideExample}

\end{document}
%</tst-poly>
%    \end{macrocode}
%
%
% \Finale
% \PrintIndex
% \PrintChanges
%
\endinput
%%
%% End of file `pst-poly.dtx'