fix race condition by Michael J Gruber
[PyX/mjg.git] / manual / pattern.tex
blob540a6aa646bfa1360ba8b1c10ff51e97b7d7dc21
1 \chapter{Module \module{pattern}}
2 \label{pattern}
4 \sectionauthor{J\"org Lehmann}{joergl@users.sourceforge.net}
6 This module contains the \class{pattern} class, whichs allows the definition of PostScript Tiling
7 patterns (cf.\ Sect.~4.9 of the PostScript Language Reference Manual)
8 which may then be used to fill paths. In addition, a number of
9 predefined hatch patterns are included.
12 \declaremodule{}{pattern}
14 \section{Class \class{pattern}}
16 The classes \class{pattern} and \class{canvas} differ only in their
17 constructor and in the absence of a \method{writeEPSfile()} method in
18 the former. The \class{pattern} constructor accepts the following
19 keyword arguments:
21 \medskip
22 \begin{tabularx}{\linewidth}{l>{\raggedright\arraybackslash}X}
23 keyword&description\\
24 \hline
25 \texttt{painttype}&\texttt{1} (default) for coloured patterns or
26 \texttt{2} for uncoloured patterns\\
27 \texttt{tilingtype}&\texttt{1} (default) for constant spacing tilings
28 (patterns are spaced constantly by a multiple of a device pixel),
29 \texttt{2} for undistorted pattern cell, whereby the spacing may vary
30 by as much as one device pixel, or \texttt{3} for constant spacing and
31 faster tiling which behaves as tiling type \texttt{1} but with
32 additional distortion allowed to permit a more efficient
33 implementation.\\
34 \texttt{xstep}&desired horizontal spacing between pattern cells, use
35 \texttt{None} (default) for automatic calculation from pattern
36 bounding box.\\
37 \texttt{ystep}&desired vertical spacing between pattern cells, use
38 \texttt{None} (default) for automatic calculation from pattern
39 bounding box.\\
40 \texttt{bbox}&bounding box of pattern. Use \texttt{None} for an
41 automatic determination of the bounding box (including an
42 enlargement by \texttt{bboxenlarge} pts on each side.)\\
43 \texttt{trafo}&additional transformation applied to pattern or
44 \texttt{None} (default). This may be used to rotate the pattern or to
45 shift its phase (by a translation).\\
46 \texttt{bboxenlarge}&enlargement when using the automatic bounding box
47 determination; default is 5 pts.
48 \end{tabularx}
49 \medskip
51 After you have created a pattern instance, you define the pattern
52 shape by drawing in it like in an ordinary canvas. To use the pattern,
53 you simply pass the pattern instance to a \method{stroke()},
54 \method{fill()}, \method{draw()} or \method{set()} method of the
55 canvas, just like you would do with a colour, etc.
59 %%% Local Variables:
60 %%% mode: latex
61 %%% TeX-master: "manual.tex"
62 %%% End: