| 1 |
\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings |
| 2 |
headexclude,footexclude,oneside]{pst-doc} |
| 3 |
\usepackage[utf8]{inputenc} |
| 4 |
\usepackage{pst-poly} |
| 5 |
\let\pstDocFV\fileversion |
| 6 |
|
| 7 |
\def\bgImage{\PstPolygon[unit=3,linecolor=red,PolyOffset=2,linewidth=0.001, |
| 8 |
PolyNbSides=72,PolyEpicycloid]} |
| 9 |
|
| 10 |
\lstset{explpreset={pos=t,width=-99pt,overhang=0pt,hsep=\columnsep,vsep=\bigskipamount,rframe={}}} |
| 11 |
\begin{document} |
| 12 |
|
| 13 |
\title{\texttt{pst-poly}} |
| 14 |
\subtitle{A PSTricks package for drawing polygons; v.\pstDocFV} |
| 15 |
\author{Denis Girou\\Herbert Vo\ss} |
| 16 |
%\docauthor{Herbert Vo\ss} |
| 17 |
\date{\today} |
| 18 |
\maketitle |
| 19 |
|
| 20 |
\tableofcontents |
| 21 |
|
| 22 |
\clearpage |
| 23 |
|
| 24 |
\begin{abstract} |
| 25 |
\noindent |
| 26 |
\LPack{pst-poly} allows to draw easily various kinds of regular or non regular |
| 27 |
polygons, using the unique macro \Lcs{PstPolygon}, with various customization |
| 28 |
parameters. |
| 29 |
It is also a good example of the great power and flexibility of PSTricks, |
| 30 |
as in fact it is a very short program (it body is only 100 lines long) but |
| 31 |
nevertheless really powerful. |
| 32 |
And last, it is also a good pedagogical example of how to design and |
| 33 |
program high level graphic objects above PSTricks own ones. |
| 34 |
\end{abstract} |
| 35 |
|
| 36 |
\clearpage |
| 37 |
|
| 38 |
\section{Introduction} |
| 39 |
% |
| 40 |
\LPack{pst-poly} offers a unique macro (plus some aliases to define |
| 41 |
some often used polygons) with few parameters to interact on it. But we can |
| 42 |
also use all the relevant PSTricks parameters to change the size, the |
| 43 |
characteristics of lines, to add filling, etc. |
| 44 |
The polygons are always drawn counter clockwise. |
| 45 |
% |
| 46 |
The syntax is simply: |
| 47 |
\begin{BDef} |
| 48 |
\LcsStar{PstPolygon}\OptArgs\\ |
| 49 |
\Lcs{PstTriangle}\OptArgs\\ |
| 50 |
\Lcs{PstSquare}\OptArgs\\ |
| 51 |
\Lcs{PstPentagon}\OptArgs\\ |
| 52 |
\Lcs{PstHexagon}\OptArgs\\ |
| 53 |
\Lcs{PstHeptagon}\OptArgs\\ |
| 54 |
\Lcs{PstOctogon}\OptArgs\\ |
| 55 |
\Lcs{PstNonagon}\OptArgs\\ |
| 56 |
\Lcs{PstDecagon}\OptArgs\\ |
| 57 |
\Lcs{PstDodecagon}\OptArgs\\% |
| 58 |
\Lcs{PstStarFiveLines}\OptArgs\\ |
| 59 |
\Lcs{PstStarFive}\OptArgs\\ |
| 60 |
\Lcs{pspolygonbox}\OptArgs\Largb{Text}\\ |
| 61 |
\end{BDef} |
| 62 |
|
| 63 |
As for PSTricks closed objects, the \texttt{*} version uses a solid style |
| 64 |
to fill the polygon, use the line color for fill color and set the linewidth |
| 65 |
to 0. |
| 66 |
|
| 67 |
By default the polygons are set with a radius of 1 unit for the outer circle. |
| 68 |
|
| 69 |
\bigskip |
| 70 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 71 |
\begin{pspicture}[showgrid=true](-1,-1)(1,1) |
| 72 |
\PstPolygon[PstPicture=false] |
| 73 |
\pscircle[linestyle=dashed]{1} |
| 74 |
\end{pspicture} |
| 75 |
\end{LTXexample} |
| 76 |
|
| 77 |
There is no special optional argument for this radius, the polygon can |
| 78 |
be scaled by using the key \Lkeyword{unit}. With \Lkeyword{unit}=1.5, the outer |
| 79 |
radius will be of 1.5cm when the current unit is set to 1cm. |
| 80 |
|
| 81 |
|
| 82 |
\section{Optional arguments} |
| 83 |
% |
| 84 |
There are eight specific optional arguments defined to change the way the |
| 85 |
polygons are defined: |
| 86 |
|
| 87 |
\begin{compactdesc} |
| 88 |
\item [\Lkeyword{PstPicture}] (boolean): to define or not a \Lenv{pspicture} |
| 89 |
environment for the polygon. We have to define this parameter to |
| 90 |
\false\ if we want to mix the polygon with other PSTricks objects |
| 91 |
--- see examples later |
| 92 |
(\emph{Default:~\true} --- which is not the case for basic PSTricks |
| 93 |
objects). With \Lkeyset{PstPicture=false} the image doesn't reserve |
| 94 |
any space, it overwrites the text. The resulting box has a width and a height of 0pt. |
| 95 |
|
| 96 |
\bigskip |
| 97 |
\begin{LTXexample}[pos=t] |
| 98 |
foo\PstPolygon bar\hfill foo\PstPolygon[PstPicture=false] bar |
| 99 |
\end{LTXexample} |
| 100 |
|
| 101 |
\bigskip |
| 102 |
\item [\Lkeyword{PolyRotation}] (real): rotation angle applied to the polygon |
| 103 |
(\emph{Default:~0} --- no rotation). |
| 104 |
|
| 105 |
\bigskip |
| 106 |
\begin{LTXexample}[pos=t] |
| 107 |
\PstPolygon\hfill |
| 108 |
\PstPolygon[PolyRotation=18]\hfill |
| 109 |
\PstPolygon[PolyRotation=36]\hfill |
| 110 |
\PstPolygon[PolyRotation=45] |
| 111 |
\end{LTXexample} |
| 112 |
|
| 113 |
\bigskip |
| 114 |
\item [\Lkeyword{PolyNbSides}] (integer): number of sides of the polygon |
| 115 |
(\emph{Default:~5}). |
| 116 |
|
| 117 |
\bigskip |
| 118 |
\begin{LTXexample}[pos=t] |
| 119 |
\PstPolygon\hfill |
| 120 |
\PstPolygon[PolyNbSides=3]\hfill |
| 121 |
\PstPolygon[PolyNbSides=4]\hfill |
| 122 |
\PstPolygon[PolyNbSides=5]\hfill |
| 123 |
\PstPolygon[PolyNbSides=8]\hfill |
| 124 |
\PstPolygon[PolyNbSides=50] |
| 125 |
\end{LTXexample} |
| 126 |
|
| 127 |
\bigskip |
| 128 |
\item [\Lkeyword{PolyOffset}] (integer): number of nodes to bypass to obtain each |
| 129 |
time the next one (\emph{Default:~1} --- no node bypassed). |
| 130 |
|
| 131 |
\bigskip |
| 132 |
\begin{LTXexample}[pos=t] |
| 133 |
\PstPolygon |
| 134 |
\PstPolygon[PolyOffset=2] |
| 135 |
\PstPolygon[PolyOffset=3] |
| 136 |
\PstPolygon[PolyNbSides=7,PolyOffset=2] |
| 137 |
\PstPolygon[PolyNbSides=9,PolyOffset=4] |
| 138 |
\PstPolygon[PolyNbSides=17,PolyOffset=6] |
| 139 |
\end{LTXexample} |
| 140 |
|
| 141 |
\bigskip |
| 142 |
\item [\Lkeyword{PolyIntermediatePoint}] (real): position of the intermediate point |
| 143 |
used to join each time the next node (\emph{Default:~empty} --- not used). |
| 144 |
|
| 145 |
\bigskip |
| 146 |
\begin{LTXexample}[pos=t] |
| 147 |
\PstPolygon |
| 148 |
\PstPolygon[PolyIntermediatePoint=0.38] |
| 149 |
\PstPolygon[PolyIntermediatePoint=0.2] |
| 150 |
\PstPolygon[PolyIntermediatePoint=1.2] |
| 151 |
\PstPolygon[PolyNbSides=7,PolyOffset=2, |
| 152 |
PolyIntermediatePoint=0.38] |
| 153 |
\PstPolygon[PolyNbSides=21,PolyOffset=2, |
| 154 |
PolyIntermediatePoint=-1.25] |
| 155 |
\end{LTXexample} |
| 156 |
|
| 157 |
\bigskip |
| 158 |
\item [\Lkeyword{PolyCurves}] (boolean): boolean value to choose between straight |
| 159 |
line and curve to join each time the next node (\emph{Default:~\false} --- straight lines). |
| 160 |
|
| 161 |
\bigskip |
| 162 |
\begin{LTXexample}[pos=t] |
| 163 |
\psset{PolyCurves=true} |
| 164 |
\PstPolygon[PolyNbSides=7,PolyIntermediatePoint=0.38]\hfill |
| 165 |
\PstPolygon[PolyNbSides=11,PolyIntermediatePoint=0.6]\hfill |
| 166 |
\PstPolygon[PolyNbSides=7,PolyIntermediatePoint=0.2, |
| 167 |
PolyOffset=2]\hfill |
| 168 |
\PstPolygon[PolyNbSides=9,PolyIntermediatePoint=0.1]\hfill |
| 169 |
\PstPolygon[PolyNbSides=15,PolyIntermediatePoint=1.2] |
| 170 |
\end{LTXexample} |
| 171 |
|
| 172 |
\bigskip |
| 173 |
\item [\Lkeyword{PolyEpicycloid}] (boolean): boolean value to choose between |
| 174 |
polygon and epicycloid (\emph{Default:~\false} --- polygon). |
| 175 |
|
| 176 |
\bigskip |
| 177 |
\begin{LTXexample}[pos=t] |
| 178 |
\psset{linewidth=0.001,PolyNbSides=72,PolyEpicycloid=true} |
| 179 |
% Epicycloid of factor 1 is cardioid and of factor 2 nephroid |
| 180 |
\multido{\i=2+1}{4}{\PstPolygon[PolyOffset=\i]\hfill} |
| 181 |
\PstPolygon[PolyOffset=72]\hfill% Epicycloid of factor 71 |
| 182 |
\PstPolygon[PolyOffset=73] % Epicycloid of factor 72 |
| 183 |
\end{LTXexample} |
| 184 |
|
| 185 |
\bigskip |
| 186 |
\item [\Lkeyword{PolyName}] (string): name of the polygon, useful to have different |
| 187 |
names for the nodes of different polygons (\emph{Default:~empty} --- no name). |
| 188 |
|
| 189 |
The center of the polygon has name \texttt{PolyName0} and the nodes |
| 190 |
(vertices) have names \texttt{PolyName1} to \texttt{PolyNameN}. |
| 191 |
With this parameter, we can connect as we want nodes of different polygons: |
| 192 |
|
| 193 |
\bigskip |
| 194 |
\begin{LTXexample}[pos=l,width=0.3\linewidth,pos=l] |
| 195 |
\psset{PstPicture=false} |
| 196 |
\begin{pspicture}(-1,-1)(1,1) |
| 197 |
\PstPolygon[unit=0.8,PolyName=A,PolyNbSides=6] |
| 198 |
\PstPolygon[unit=1.2,PolyName=B,PolyNbSides=12] |
| 199 |
\end{pspicture} |
| 200 |
\multido{\i=1+2}{6}{% |
| 201 |
\ncline{A\the\multidocount}{B\i}} |
| 202 |
\end{LTXexample} |
| 203 |
|
| 204 |
It is also a way (limited in fact...) to define three dimensional objects in perspective: |
| 205 |
|
| 206 |
\bigskip |
| 207 |
\begin{LTXexample}[pos=l,width=0.3\linewidth,pos=l] |
| 208 |
\psset{unit=0.8} |
| 209 |
\begin{pspicture}(3,2.5) |
| 210 |
% \PstSquare is described later |
| 211 |
\rput[lb](0,0){\PstSquare[PolyName=A]} |
| 212 |
\rput[lb](2.5,2){\PstSquare[unit=0.5,PolyName=B]} |
| 213 |
\multido{\i=1+1}{4}{\ncline{A\i}{B\i}} |
| 214 |
\end{pspicture} |
| 215 |
\end{LTXexample} |
| 216 |
|
| 217 |
\end{compactdesc} |
| 218 |
|
| 219 |
\bigskip |
| 220 |
Of course, we can mix specific parameters of \LPack{pst-poly} with |
| 221 |
relevant PSTricks ones and combine it with other generic macros |
| 222 |
(for repetitions, projection in the 3d space, etc.) |
| 223 |
|
| 224 |
|
| 225 |
\begin{LTXexample}[pos=t] |
| 226 |
\PstPolygon[unit=1.5] |
| 227 |
\PstPolygon[linewidth=1mm] |
| 228 |
\PstPolygon[fillstyle=crosshatch,PolyNbSides=6] |
| 229 |
\PstPolygon[linecolor=red,fillstyle=solid,fillcolor=yellow, |
| 230 |
PolyRotation=18,PolyOffset=2] |
| 231 |
\PstPolygon*[linecolor=cyan,PolyNbSides=7,PolyOffset=2] |
| 232 |
\end{LTXexample} |
| 233 |
|
| 234 |
\begin{LTXexample}[pos=t] |
| 235 |
\multido{\i=5+2}{6}{% |
| 236 |
\PstPolygon[PolyNbSides=\i,PolyCurves=true, |
| 237 |
PolyIntermediatePoint=0.1,PolyOffset=3]} |
| 238 |
\end{LTXexample} |
| 239 |
|
| 240 |
|
| 241 |
\section{Pre-defined polygons} |
| 242 |
% |
| 243 |
Some often used polygons and other related geometric objects are |
| 244 |
pre-defined, for immediate usage : |
| 245 |
|
| 246 |
\begin{LTXexample}[pos=t] |
| 247 |
\PstTriangle |
| 248 |
\PstSquare |
| 249 |
\PstPentagon[unit=0.5,linestyle=dotted] |
| 250 |
\PstHexagon[fillstyle=hlines,hatchangle=90] |
| 251 |
\PstHeptagon[fillstyle=vlines] |
| 252 |
\PstOctogon*[unit=0.8,linecolor=red] |
| 253 |
\PstNonagon[unit=0.5] |
| 254 |
\PstDecagon |
| 255 |
\PstDodecagon[linecolor=green] \par |
| 256 |
\PstStarFiveLines |
| 257 |
\PstStarFive |
| 258 |
\end{LTXexample} |
| 259 |
|
| 260 |
|
| 261 |
\section{Non regular polygons} |
| 262 |
|
| 263 |
Until now, we have described only the so-called \emph{regular} polygons, |
| 264 |
which are from far the most useful ones (all of them have equal edges and |
| 265 |
angles). Nevertheless, it is not so difficult to extend these polygon to |
| 266 |
\emph{non regular} ones, using a different value for horizontal and vertical |
| 267 |
units (nevertheless, the code is more tricky, as we must do all the |
| 268 |
trigonometry explicitely...) |
| 269 |
% |
| 270 |
\begin{LTXexample}[pos=t] |
| 271 |
\PstPentagon[xunit=0.5]\hfill |
| 272 |
\PstHexagon[yunit=0.5]\hfill |
| 273 |
\PstStarFive[xunit=0.5,yunit=1.5]\hfill |
| 274 |
\PstPolygon[xunit=0.8,yunit=1.5,PolyNbSides=9,PolyOffset=2, |
| 275 |
PolyIntermediatePoint=0.1,PolyCurves=true] |
| 276 |
\end{LTXexample} |
| 277 |
% |
| 278 |
\section{Nodes (vertices)} |
| 279 |
% |
| 280 |
And another powerful possibility is to define a command |
| 281 |
\Lcs{PstPolygonNode} which will be excuted at each node (\emph{Default:~empty} --- nothing executed). |
| 282 |
The counter name for nodes is \Lctr{INode}, starting from 0. The \Lcs{multidocount} counter, from the |
| 283 |
\Lcs{multido} command, start itself from 1. |
| 284 |
|
| 285 |
\begin{LTXexample}[width=0.3\linewidth,pos=l] |
| 286 |
\providecommand{\PstPolygonNode}{% |
| 287 |
\psdots[dotsize=0.2,linecolor=cyan](1;\INode)} |
| 288 |
\PstPentagon |
| 289 |
\end{LTXexample} |
| 290 |
% |
| 291 |
\begin{LTXexample}[width=0.3\linewidth,pos=l] |
| 292 |
\newcounter{Letter} |
| 293 |
\providecommand{\PstPolygonNode}{% |
| 294 |
\setcounter{Letter}{\the\multidocount}% |
| 295 |
\rput*{*0}(1;\INode){\small\Alph{Letter}}} |
| 296 |
\PstHeptagon[PolyOffset=3] |
| 297 |
\end{LTXexample} |
| 298 |
% |
| 299 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 300 |
\providecommand{\PstPolygonNode}{% |
| 301 |
\psdots[dotstyle=o,dotsize=0.2](1;\INode) |
| 302 |
\psline[linecolor=red]{->}(0.9;\INode)} |
| 303 |
\PstPolygon[PolyNbSides=8] |
| 304 |
\end{LTXexample} |
| 305 |
% |
| 306 |
\vspace{3mm} |
| 307 |
It is also a way to nest polygons: |
| 308 |
\vspace{3mm} |
| 309 |
% |
| 310 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 311 |
\newbox{\Star} |
| 312 |
\savebox{\Star}{% |
| 313 |
\PstStarFive*[unit=0.15,linecolor=red]} |
| 314 |
\providecommand{\PstPolygonNode}{% |
| 315 |
\rput{*0}(1;\INode){\usebox{\Star}}} |
| 316 |
\shortstack{\PstNonagon\\[5mm] |
| 317 |
\PstDodecagon[linestyle=none]} |
| 318 |
\end{LTXexample} |
| 319 |
|
| 320 |
\begin{LTXexample}[pos=t] |
| 321 |
\psset{unit=2,PstPicture=false} |
| 322 |
\begin{pspicture}(-1.6,-1.6)(1.6,1.6) |
| 323 |
% Just to name the nodes, to be able to join some of them. |
| 324 |
% by solid curves. We can't draw the polygons now, |
| 325 |
% as the node numbers must erase the solid curves... |
| 326 |
\PstHexagon[unit=0.8,linestyle=none,PolyName=H]\PstDodecagon[unit=1.2,linestyle=none,PolyName=D] |
| 327 |
{\SpecialCoor |
| 328 |
\psset{linewidth=0.4pt,border=2pt,nodesep=0.45} |
| 329 |
\psccurve(H1)(H4)(D8)([angle=-30]D9)(D11)\psccurve(D3)(H3)(H6)(D12)([angle=90]D1) |
| 330 |
\psccurve(D4)(H2)(H5)(D7)([angle=90]D6)} |
| 331 |
\psset{linestyle=dotted,framesep=1pt} |
| 332 |
\PstTriangle[unit=0.23] |
| 333 |
\providecommand{\PstPolygonNode}{\rput*{*0}(1;\INode){\small\the\multidocount}} |
| 334 |
\PstHexagon[unit=0.8] \PstDodecagon[unit=1.2] \PstDodecagon[unit=1.6] |
| 335 |
\end{pspicture} |
| 336 |
\end{LTXexample} |
| 337 |
% |
| 338 |
\section{Polygonbox} |
| 339 |
|
| 340 |
The valid options with the predefined values are \Lkeyword{PolyNbSides}=3 and \Lkeyword{PolyRotation}=0 |
| 341 |
|
| 342 |
\begin{compactitem} |
| 343 |
\item There maybe some problems with linearcs and rounding errors. |
| 344 |
\item To rotate the text inside the box, one can use the \Lcs{rotatebox} macro from |
| 345 |
the \LPack{rotating} package (see examples). |
| 346 |
\end{compactitem} |
| 347 |
|
| 348 |
\begin{LTXexample}[pos=t] |
| 349 |
\multido{\nA=3+1}{8}{% |
| 350 |
\pspolygonbox[PolyNbSides=\nA,framesep=3mm]{Text}~} |
| 351 |
\end{LTXexample} |
| 352 |
|
| 353 |
\begin{LTXexample}[pos=t] |
| 354 |
\multido{\nA=3+1}{8}{\pspolygonbox[PolyNbSides=\nA,% |
| 355 |
framesep=2mm,doubleline=true]{Text}~} |
| 356 |
\end{LTXexample} |
| 357 |
|
| 358 |
|
| 359 |
\begin{LTXexample}[pos=t] |
| 360 |
\psset{PolyNbSides=4} |
| 361 |
\multido{\nA=0+60}{8}{\pspolygonbox[PolyRotation=\nA,% |
| 362 |
framesep=2mm,doubleline=true,% |
| 363 |
linecolor=red,doublecolor=blue]{\magenta Text}~} |
| 364 |
\end{LTXexample} |
| 365 |
|
| 366 |
\begin{LTXexample}[pos=t] |
| 367 |
\multido{\nA=0+60,\nB=45+60}{8}{\pspolygonbox% |
| 368 |
[PolyRotation=\nA,framesep=2mm,doubleline=true,% |
| 369 |
linecolor=red,doublecolor=blue,linearc=0.4]% |
| 370 |
{\rotatebox{\nB}{\blue Text}}~}\\[1cm] |
| 371 |
\end{LTXexample} |
| 372 |
|
| 373 |
\begin{LTXexample}[pos=t] |
| 374 |
\multido{\nA=3+1}{8}{% |
| 375 |
\pspolygonbox[PolyNbSides=\nA,rot=60,framesep=2pt,% |
| 376 |
doubleline=true,linearc=0.2]{Text}~} |
| 377 |
\end{LTXexample} |
| 378 |
|
| 379 |
\begin{LTXexample}[pos=t] |
| 380 |
\multido{\nA=3+1}{8}{% |
| 381 |
\pspolygonbox[PolyNbSides=\nA,framesep=10pt,% |
| 382 |
fillstyle=solid,fillcolor=cyan,linearc=0.2]{Text}~} |
| 383 |
\end{LTXexample} |
| 384 |
|
| 385 |
\begin{LTXexample}[pos=t] |
| 386 |
\multido{\nA=-5+5}{8}{\pspolygonbox[framesep=\nA pt,% |
| 387 |
PolyRotation=90]{\Huge\red T}~} |
| 388 |
\end{LTXexample} |
| 389 |
|
| 390 |
\vspace{1cm} |
| 391 |
\begin{LTXexample}[pos=t] |
| 392 |
\multido{\nA=-5+5}{7}{\pspolygonbox[framesep=\nA pt,% |
| 393 |
PolyRotation=90,boxsep=false]{\Huge\red T}~}\par |
| 394 |
\rule{0pt}{1cm} |
| 395 |
\end{LTXexample} |
| 396 |
|
| 397 |
\section{Some more examples} |
| 398 |
|
| 399 |
\begin{LTXexample}[pos=t] |
| 400 |
\multido{\i=3+1}{6}{% |
| 401 |
\PstPolygon[PolyNbSides=\i]\hspace{5mm}} |
| 402 |
\end{LTXexample} |
| 403 |
|
| 404 |
\begin{LTXexample}[pos=t] |
| 405 |
\multido{\i=3+2}{6}{% |
| 406 |
\PstPolygon[PolyOffset=2,PolyNbSides=\i]\hspace{5mm}} |
| 407 |
\end{LTXexample} |
| 408 |
|
| 409 |
\begin{LTXexample}[pos=t] |
| 410 |
\multido{\i=3+1}{10}{% |
| 411 |
\PstPolygon[PolyOffset=3,PolyNbSides=\i]\hspace{5mm}} |
| 412 |
\end{LTXexample} |
| 413 |
|
| 414 |
\begin{LTXexample}[pos=t] |
| 415 |
\multido{\i=5+1}{10}{% |
| 416 |
\PstPolygon[PolyOffset=4,PolyNbSides=\i]\hspace{5mm}} |
| 417 |
\end{LTXexample} |
| 418 |
|
| 419 |
\begin{LTXexample}[pos=t] |
| 420 |
\multido{\i=5+2}{10}{% |
| 421 |
\PstPolygon[PolyOffset=5,PolyNbSides=\i]\hspace{5mm}} |
| 422 |
\end{LTXexample} |
| 423 |
|
| 424 |
\begin{LTXexample}[pos=t] |
| 425 |
\multido{\i=5+2}{10}{% |
| 426 |
\PstPolygon[PolyOffset=7,PolyNbSides=\i]\hspace{5mm}} |
| 427 |
\end{LTXexample} |
| 428 |
|
| 429 |
\begin{LTXexample}[pos=t] |
| 430 |
\multido{\i=5+2}{10}{% |
| 431 |
\PstPolygon[PolyOffset=8,PolyNbSides=\i]\hspace{5mm}} |
| 432 |
\end{LTXexample} |
| 433 |
|
| 434 |
\begin{LTXexample}[pos=t] |
| 435 |
\multido{\i=1+1}{10}{% |
| 436 |
\PstPolygon[PolyOffset=\i,PolyNbSides=5]\hspace{5mm}} |
| 437 |
\end{LTXexample} |
| 438 |
|
| 439 |
\begin{LTXexample}[pos=t] |
| 440 |
\multido{\i=1+1}{10}{% |
| 441 |
\PstPolygon[PolyOffset=\i,PolyNbSides=7]\hspace{5mm}} |
| 442 |
\end{LTXexample} |
| 443 |
|
| 444 |
\begin{LTXexample}[pos=t] |
| 445 |
\multido{\i=5+1}{10}{% |
| 446 |
\PstPolygon[PolyCurves,PolyIntermediatePoint=0.1,PolyNbSides=\i] |
| 447 |
\hspace{5mm}} |
| 448 |
\end{LTXexample} |
| 449 |
|
| 450 |
\begin{LTXexample}[pos=t] |
| 451 |
\multido{\i=5+1}{10}{% |
| 452 |
\PstPolygon[PolyCurves,PolyIntermediatePoint=0.2, |
| 453 |
PolyOffset=2,PolyNbSides=\i]\hspace{5mm}} |
| 454 |
\end{LTXexample} |
| 455 |
|
| 456 |
\begin{LTXexample}[pos=t] |
| 457 |
\multido{\i=5+2}{10}{% |
| 458 |
\PstPolygon[PolyCurves,PolyIntermediatePoint=0.1, |
| 459 |
PolyOffset=3,PolyNbSides=\i]\hspace{5mm}} |
| 460 |
\end{LTXexample} |
| 461 |
|
| 462 |
% Second serie |
| 463 |
|
| 464 |
\begin{LTXexample}[pos=t] |
| 465 |
\multido{\n=-1.4+0.5}{10}{% |
| 466 |
\PstPolygon[PolyNbSides=3,PolyOffset=2,PolyIntermediatePoint=\n] |
| 467 |
\hspace{5mm}}\par |
| 468 |
\vspace{0pt}{2cm} |
| 469 |
\end{LTXexample} |
| 470 |
|
| 471 |
\begin{LTXexample}[pos=t] |
| 472 |
\multido{\n=-1.4+0.5}{6}{% |
| 473 |
\PstPolygon[PolyNbSides=5,PolyOffset=2,PolyIntermediatePoint=\n] |
| 474 |
\hspace{5mm}} |
| 475 |
\end{LTXexample} |
| 476 |
|
| 477 |
\begin{LTXexample}[pos=t] |
| 478 |
\multido{\n=-1.4+0.5}{6}{% |
| 479 |
\PstPolygon[PolyNbSides=13,PolyOffset=2,PolyIntermediatePoint=\n] |
| 480 |
\hspace{5mm}} |
| 481 |
\end{LTXexample} |
| 482 |
|
| 483 |
\begin{LTXexample}[pos=t] |
| 484 |
\multido{\n=-1.4+0.5}{6}{% |
| 485 |
\PstPolygon[PolyNbSides=21,PolyOffset=2,PolyIntermediatePoint=\n] |
| 486 |
\hspace{5mm}} |
| 487 |
\end{LTXexample} |
| 488 |
|
| 489 |
% Third serie |
| 490 |
|
| 491 |
\begin{LTXexample}[pos=t] |
| 492 |
\psset{unit=1.4,linewidth=0.001,PolyNbSides=72,PolyEpicycloid} |
| 493 |
\multido{\i=2+1}{4}{% |
| 494 |
% Epicycloid of factor 1 is cardioid and of factor 2 nephroid |
| 495 |
\PstPolygon[PolyOffset=\i]\hspace{5mm}} |
| 496 |
\end{LTXexample} |
| 497 |
|
| 498 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 499 |
% Epicycloid of factor 10 |
| 500 |
\PstPolygon[unit=2,linewidth=0.003, |
| 501 |
PolyEpicycloid,PolyNbSides=72,PolyOffset=11] |
| 502 |
\end{LTXexample} |
| 503 |
|
| 504 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 505 |
% Epicycloid of factor 22 |
| 506 |
\PstPolygon[unit=2,linewidth=0.003, |
| 507 |
PolyEpicycloid,PolyNbSides=72,PolyOffset=23] |
| 508 |
\end{LTXexample} |
| 509 |
|
| 510 |
\begin{LTXexample}[pos=t] |
| 511 |
\psset{unit=1.9,linewidth=0.001,PolyNbSides=72,PolyEpicycloid} |
| 512 |
\multido{\i=71+1}{3}{% |
| 513 |
\PstPolygon[PolyOffset=\i]\hspace{5mm}} |
| 514 |
\end{LTXexample} |
| 515 |
|
| 516 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 517 |
% Epicycloid of factor 100 |
| 518 |
\PstPolygon[unit=2,linewidth=0.003, |
| 519 |
PolyEpicycloid,PolyNbSides=72,PolyOffset=101] |
| 520 |
\end{LTXexample} |
| 521 |
|
| 522 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 523 |
% Epicycloid of factor 153 |
| 524 |
\PstPolygon[unit=2,linewidth=0.003, |
| 525 |
PolyEpicycloid,PolyNbSides=72,PolyOffset=154] |
| 526 |
\end{LTXexample} |
| 527 |
|
| 528 |
% Fourth serie |
| 529 |
|
| 530 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 531 |
\providecommand{\PstPolygonNode}{% |
| 532 |
\psdots[dotsize=0.2,linecolor=cyan](1;\INode)} |
| 533 |
\PstPentagon[unit=2] |
| 534 |
\end{LTXexample} |
| 535 |
|
| 536 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 537 |
\providecommand{\PstPolygonNode}{% |
| 538 |
\rput{*0}(1.2;\INode){\small\the\multidocount}} |
| 539 |
\PstPolygon[unit=2,PolyNbSides=7,PolyOffset=2] |
| 540 |
\end{LTXexample} |
| 541 |
|
| 542 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 543 |
\providecommand{\PstPolygonNode}{% |
| 544 |
\rput*{*0}(1;\INode){\small\the\multidocount}} |
| 545 |
\PstHeptagon[unit=2,PolyOffset=2] |
| 546 |
\end{LTXexample} |
| 547 |
|
| 548 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 549 |
% \newcounter{Letter} |
| 550 |
\providecommand{\PstPolygonNode}{% |
| 551 |
\setcounter{Letter}{\the\multidocount}% |
| 552 |
\rput*{*0}(1;\INode){\small\Alph{Letter}}} |
| 553 |
\PstHeptagon[unit=2,PolyOffset=3] |
| 554 |
\end{LTXexample} |
| 555 |
|
| 556 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 557 |
\providecommand{\PstPolygonNode}{% |
| 558 |
\SpecialCoor |
| 559 |
\degrees[3] |
| 560 |
\rput{0.5}(0.5;\INode){% |
| 561 |
\pspolygon*(0.5;0.5)(0.5;1.5)(0.5;2.5)}} |
| 562 |
\PstTriangle |
| 563 |
\end{LTXexample} |
| 564 |
|
| 565 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 566 |
\providecommand{\PstPolygonNode}{% |
| 567 |
\psdots[dotstyle=o,dotsize=0.2](1;\INode) |
| 568 |
\psline[linecolor=red]{->}(0.9;\INode)} |
| 569 |
\PstPolygon[unit=2,PolyNbSides=8] |
| 570 |
\end{LTXexample} |
| 571 |
|
| 572 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 573 |
\providecommand{\PstPolygonNode}{% |
| 574 |
\psline[linewidth=0.1mm,doubleline=true, |
| 575 |
linecolor=green]{<->}(0;0)(1;\INode)} |
| 576 |
\PstHexagon[unit=2] |
| 577 |
\end{LTXexample} |
| 578 |
|
| 579 |
\begin{LTXexample}[pos=l,width=0.3\linewidth] |
| 580 |
\newbox{\Star} |
| 581 |
\savebox{\Star}{% |
| 582 |
\PstStarFive*[unit=0.15,linecolor=red]} |
| 583 |
\providecommand{\PstPolygonNode}{% |
| 584 |
\rput{*0}(1;\INode){\usebox{\Star}}} |
| 585 |
\shortstack{% |
| 586 |
\PstNonagon\\[5mm] |
| 587 |
\PstDodecagon[linestyle=none]} |
| 588 |
\end{LTXexample} |
| 589 |
|
| 590 |
\begin{LTXexample}[pos=l,width=5cm] |
| 591 |
%\newcounter{Letter}% if not defined |
| 592 |
\setcounter{Letter}{\the\multidocount}% |
| 593 |
\begin{pspicture}(-2.5,-2.5)(2.5,2.5) |
| 594 |
\PstPolygon[PolyName=A,fillstyle=solid,fillcolor=lightgray,linewidth=2pt,PolyNbSides=5,unit=0.5,PstPicture=false] |
| 595 |
\PstPolygon[PolyName=B,PolyNbSides=5,linewidth=2pt,PstPicture=false,unit=2.5] |
| 596 |
\multido{\iA=1+1,\iB=2+1}{5}{% |
| 597 |
\setcounter{Letter}{\the\multidocount}% |
| 598 |
\ncline{A\iA}{B\iA}\ncput*{\bf\alph{Letter}}% |
| 599 |
\ifnum\iB>5 \def\iB{1}\fi% |
| 600 |
\pcline[linestyle=none](B\iA)(B\iB)\ncput*{\bf\iA}} |
| 601 |
\end{pspicture} |
| 602 |
\end{LTXexample} |
| 603 |
|
| 604 |
\clearpage |
| 605 |
\section{List of all optional arguments for \texttt{pst-poly}} |
| 606 |
|
| 607 |
\xkvview{family=pst-poly,columns={key,type,default}} |
| 608 |
|
| 609 |
|
| 610 |
\nocite{*} |
| 611 |
\bgroup |
| 612 |
\RaggedRight |
| 613 |
\bibliographystyle{plain} |
| 614 |
\bibliography{pst-poly-doc} |
| 615 |
\egroup |
| 616 |
|
| 617 |
\printindex |
| 618 |
|
| 619 |
\end{document} |
| 620 |
|
| 621 |
|