Module pattern
¶
This module contains the pattern.pattern
class, whichs allows the definition of
PostScript Tiling patterns (cf. Sect. 4.9 of the PostScript Language Reference
Manual) which may then be used to fill paths. In addition, a number of
predefined hatch patterns are included.
Class pattern
¶
The classes pattern.pattern
and canvas.canvas
differ only in their
constructor and in the absence of a writeEPSfile()
method in the former.
The pattern
constructor accepts the following keyword arguments:
keyword |
description |
---|---|
|
|
|
|
|
desired horizontal spacing between pattern
cells, use |
|
desired vertical spacing between pattern
cells, use |
|
bounding box of pattern. Use |
|
additional transformation applied to pattern
or |
|
enlargement when using the automatic bounding box determination; default is 5 pts. |
After you have created a pattern instance, you define the pattern shape by
drawing in it like in an ordinary canvas. To use the pattern, you simply pass
the pattern instance to a stroke()
, fill()
, draw()
or
set()
method of the canvas, just like you would do with a colour, etc.