1 \chapter{Module
\module{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
22 \begin{tableii
}{l|l
}{textrm
}{keyword
}{description
}
23 \lineii{\texttt{painttype
}}{\texttt{1} (default) for coloured patterns or
\texttt{2} for uncoloured patterns
}
24 \lineii{\texttt{tilingtype
}}{\texttt{1} (default) for constant spacing tilings (patterns are spaced constantly by a multiple of a device pixel),
\texttt{2} for undistorted pattern cell, whereby the spacing may vary by as much as one device pixel, or
\texttt{3} for constant spacing and faster tiling which behaves as tiling type
\texttt{1} but with additional distortion allowed to permit a more efficient implementation.
}
25 \lineii{\texttt{xstep
}}{desired horizontal spacing between pattern cells, use
\texttt{None
} (default) for automatic calculation from pattern bounding box.
}
26 \lineii{\texttt{ystep
}}{desired vertical spacing between pattern cells, use
\texttt{None
} (default) for automatic calculation from pattern bounding box.
}
27 \lineii{\texttt{bbox
}}{bounding box of pattern. Use
\texttt{None
} for an automatic determination of the bounding box (including an enlargement by
\texttt{bboxenlarge
} pts on each side.)
}
28 \lineii{\texttt{trafo
}}{additional transformation applied to pattern or
\texttt{None
} (default). This may be used to rotate the pattern or to shift its phase (by a translation).
}
29 \lineii{\texttt{bboxenlarge
}}{enlargement when using the automatic bounding box determination; default is
5 pts.
}
33 After you have created a pattern instance, you define the pattern
34 shape by drawing in it like in an ordinary canvas. To use the pattern,
35 you simply pass the pattern instance to a
\method{stroke()
},
36 \method{fill()
},
\method{draw()
} or
\method{set()
} method of the
37 canvas, just like you would do with a colour, etc.
43 %%% TeX-master: "manual.tex"