optional textdx/textdy columns to the text style added
[PyX/mjg.git] / gallery / path / circles.py
blob0929530cd7f3567616a0a3ea911f32feae3ed5fa
1 from pyx import *
3 circ1 = path.circle(0, 0, 1.5)
4 circ2 = path.circle(1, 1, 1)
5 (circ1a, circ1b), (circ2a, circ2b) = circ1.intersect(circ2)
6 intersection = (circ2.split([circ2b, circ2a])[1]
7 << circ1.split([circ1a, circ1b])[1])
8 intersection[-1].close()
10 union = (circ1.split([circ1a, circ1b])[0]
11 << circ2.split([circ2b, circ2a])[0])
12 union[-1].close()
14 c = canvas.canvas()
15 c.fill(union, [color.rgb.blue])
16 c.fill(intersection, [color.rgb.red])
17 c.stroke(circ1)
18 c.stroke(circ2)
19 c.writeEPSfile("circles")
20 c.writePDFfile("circles")