pyx-project / pyx

Repository of PyX, a Python package for the creation of PostScript, PDF, and SVG files.
https://pyx-project.org/
GNU General Public License v2.0
109 stars 18 forks source link

Parallel deformation of closed loops #48

Open NicolasW1 opened 11 months ago

NicolasW1 commented 11 months ago

When trying to create a parallel circle, the parallel deformer fails for when the radius should be decreased.

import pyx

# works
arcargs = (0.0, 0.0, 1.0, 90, 449)
# does not work
arcargs = (0.0, 0.0, 1.0, 90, 450)

og_path = pyx.path.path(pyx.path.arc(*arcargs))
defo_path = pyx.deformer.parallel(0.1).deform(og_path)

c = pyx.canvas.canvas()
c.stroke(og_path)
c.stroke(defo_path, [pyx.color.rgb.red])
c.writePDFfile()