use the same coordinate space for the origin point, even though this is irrelevant...
[PyX.git] / examples / path / intersect.py
blobb4424824622968cc2de160cae5d63089eb1e5f7f
1 from pyx import *
3 p1 = path.curve(0, 0, 1, 0, 1, 1, 2, 1)
4 p2 = path.circle(1, 0.5, 0.5)
6 (a1, a2), (b1, b2) = p1.intersect(p2)
8 x1, y1 = p1.at(a1)
9 x2, y2 = p1.at(a2)
11 c = canvas.canvas()
12 c.fill(path.circle(x1, y1, 0.1), [color.rgb.blue])
13 c.fill(path.circle(x2, y2, 0.1), [color.rgb.blue])
14 c.stroke(p1, [color.rgb.red])
15 c.stroke(p2, [color.rgb.green])
16 c.writeEPSfile("intersect")
17 c.writePDFfile("intersect")
18 c.writeSVGfile("intersect")