File: parallel.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 (14 lines) | stat: -rw-r--r-- 482 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
from pyx import *

c = canvas.canvas()

p = path.path(path.moveto(0, 0), path.arc(0, 0, 1, 210, 150), path.closepath())
c.stroke(p, [style.linewidth(0.4)])

pp = deformer.parallel(-0.2, sharpoutercorners=1).deform(p) + deformer.parallel( 0.2, sharpoutercorners=1).deform(p).reversed()
c.stroke(pp, [trafo.translate(2.5, 0), deco.filled([color.rgb.red])])

# PyX gets the bounding box wrong, which leads to the clipping on the left
c.writeEPSfile()
c.writePDFfile()
c.writeSVGfile()