diff options
author | bnewbold <bnewbold@robocracy.org> | 2016-02-21 18:08:55 -0800 |
---|---|---|
committer | bnewbold <bnewbold@robocracy.org> | 2016-02-21 18:08:55 -0800 |
commit | b24f282bca4af63982937c10835063d3e6e9eb74 (patch) | |
tree | fd8c58601beb3964ccecf4709f7b28944fc1c36b /examples/drawing/pathitem.jl | |
parent | 84572be10cdfc852530787a5dc78ddef3e0f23cd (diff) | |
download | PyX.jl-b24f282bca4af63982937c10835063d3e6e9eb74.tar.gz PyX.jl-b24f282bca4af63982937c10835063d3e6e9eb74.zip |
add many, many more example conversions. still not complete
Diffstat (limited to 'examples/drawing/pathitem.jl')
-rw-r--r-- | examples/drawing/pathitem.jl | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/examples/drawing/pathitem.jl b/examples/drawing/pathitem.jl new file mode 100644 index 0000000..2835313 --- /dev/null +++ b/examples/drawing/pathitem.jl @@ -0,0 +1,46 @@ + +# Original Python: +# from pyx import * + +# c = canvas.canvas() + +# rect1 = path.path(path.moveto(0, 0), path.lineto(1, 0), +# path.moveto(1, 0), path.lineto(1, 1), +# path.moveto(1, 1), path.lineto(0, 1), +# path.moveto(0, 1), path.lineto(0, 0)) +# rect2 = path.path(path.moveto(2, 0), path.lineto(3, 0), +# path.lineto(3, 1), path.lineto(2, 1), +# path.lineto(2, 0)) +# rect3 = path.path(path.moveto(4, 0), path.lineto(5, 0), +# path.lineto(5, 1), path.lineto(4, 1), +# path.closepath()) + +# c.stroke(rect1, [style.linewidth.THICK]) +# c.stroke(rect2, [style.linewidth.THICK]) +# c.stroke(rect3, [style.linewidth.THICK]) + +# c.writeEPSfile("pathitem") +# c.writePDFfile("pathitem") +# c.writeSVGfile("pathitem") + +using PyX + +c = canvas.canvas() + +rect1 = path.path(path.moveto(0, 0), path.lineto(1, 0), + path.moveto(1, 0), path.lineto(1, 1), + path.moveto(1, 1), path.lineto(0, 1), + path.moveto(0, 1), path.lineto(0, 0)) +rect2 = path.path(path.moveto(2, 0), path.lineto(3, 0), + path.lineto(3, 1), path.lineto(2, 1), + path.lineto(2, 0)) +rect3 = path.path(path.moveto(4, 0), path.lineto(5, 0), + path.lineto(5, 1), path.lineto(4, 1), + path.closepath()) + +stroke(c, rect1, [style_linewidth.THICK]) +stroke(c, rect2, [style_linewidth.THICK]) +stroke(c, rect3, [style_linewidth.THICK]) + +writeEPSfile(c, "pathitem") +writePDFfile(c, "pathitem") |