remove none-existing reference
[PyX.git] / examples / drawing / metapost.py
blob5b091614da85241dfdc9bec8b66a8fb938006cf9
1 from pyx import *
2 from pyx.metapost.path import beginknot, endknot, smoothknot, tensioncurve
4 p1, p2, p3, p4, p5 = (0, 0), (2, 1.33), (1.3, 3), (0.33, 2.33), (1, 1.67)
5 openpath = metapost.path.path([
6 beginknot(*p1), tensioncurve(), smoothknot(*p2), tensioncurve(),
7 smoothknot(*p3), tensioncurve(), smoothknot(*p4), tensioncurve(),
8 endknot(*p5)])
9 closedpath = metapost.path.path([
10 smoothknot(*p1), tensioncurve(), smoothknot(*p2), tensioncurve(),
11 smoothknot(*p3), tensioncurve(), smoothknot(*p4), tensioncurve(),
12 smoothknot(*p5), tensioncurve()])
13 c = canvas.canvas()
14 for p in [p1, p2, p3, p4, p5]:
15 c.fill(path.circle(p[0], p[1], 0.05), [color.rgb.red])
16 c.fill(path.circle(p[0], p[1], 0.05), [color.rgb.red, trafo.translate(2, 0)])
17 c.stroke(openpath)
18 c.stroke(closedpath, [trafo.translate(2, 0)])
20 c.writeEPSfile("metapost")
21 c.writePDFfile("metapost")