File: clipping.py

package info (click to toggle)
pyx 0.10-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 2,316 kB
  • ctags: 2,779
  • sloc: python: 16,243; ansic: 131; makefile: 87; sh: 9
file content (15 lines) | stat: -rw-r--r-- 343 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
from pyx import *

clippath = path.circle(0, 0, 1)
drawpath = path.line(-2, -2, 1.2, 2)

cl = canvas.canvas([canvas.clip(clippath)])
cl.stroke(drawpath, [color.rgb.red, style.linewidth(1.0)])

c = canvas.canvas()
c.stroke(drawpath, [style.linewidth(1.0)])
c.insert(cl)
c.stroke(clippath)

c.writeEPSfile("clipping")
c.writePDFfile("clipping")