prevent double call of _cleanup, which harms usefiles (and is a bad idea in general)
[PyX.git] / examples / drawing / pathitem.py
blob21ae47cee8a0e35bfc9352111bce2f7910292046
1 from pyx import *
3 c = canvas.canvas()
5 rect1 = path.path(path.moveto(0, 0), path.lineto(1, 0),
6 path.moveto(1, 0), path.lineto(1, 1),
7 path.moveto(1, 1), path.lineto(0, 1),
8 path.moveto(0, 1), path.lineto(0, 0))
9 rect2 = path.path(path.moveto(2, 0), path.lineto(3, 0),
10 path.lineto(3, 1), path.lineto(2, 1),
11 path.lineto(2, 0))
12 rect3 = path.path(path.moveto(4, 0), path.lineto(5, 0),
13 path.lineto(5, 1), path.lineto(4, 1),
14 path.closepath())
16 c.stroke(rect1, [style.linewidth.THICK])
17 c.stroke(rect2, [style.linewidth.THICK])
18 c.stroke(rect3, [style.linewidth.THICK])
20 c.writeEPSfile("pathitem")
21 c.writePDFfile("pathitem")
22 c.writeSVGfile("pathitem")