File: at.py

package info (click to toggle)
pyx3 0.17-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,328 kB
  • sloc: python: 27,656; makefile: 225; ansic: 130; sh: 17
file content (21 lines) | stat: -rw-r--r-- 426 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from pyx import *

def mark(x, y):
    return path.circle(x, y, 0.1)

c = canvas.canvas()

p1 = path.curve(0, 0, 1, 0, 1, 1, 2, 1)
c.stroke(p1)
c.fill(mark(*p1.atbegin()))
c.fill(mark(*p1.at(0.5*p1.arclen())))
c.fill(mark(*p1.atend()))

p2 = path.curve(3, 0, 4, 0, 4, 1, 5, 1)
c.stroke(p2)
c.fill(mark(*p2.at(p2.begin()+0.5)))
c.fill(mark(*p2.at(p2.end()-0.5)))

c.writeEPSfile("at")
c.writePDFfile("at")
c.writeSVGfile("at")