diff options
Diffstat (limited to 'share/extensions/other/gcodetools/tests')
9 files changed, 622 insertions, 0 deletions
diff --git a/share/extensions/other/gcodetools/tests/data/refs/gcodetools__--active-tab__orientation__--Zsurface__0__00000000000001e-5__--Zdepth__-9__71445146547012e-17__--orientation-points-count__3.out b/share/extensions/other/gcodetools/tests/data/refs/gcodetools__--active-tab__orientation__--Zsurface__0__00000000000001e-5__--Zdepth__-9__71445146547012e-17__--orientation-points-count__3.out new file mode 100644 index 0000000..61a62cc --- /dev/null +++ b/share/extensions/other/gcodetools/tests/data/refs/gcodetools__--active-tab__orientation__--Zsurface__0__00000000000001e-5__--Zdepth__-9__71445146547012e-17__--orientation-points-count__3.out @@ -0,0 +1,41 @@ +<!-- Created with Inkscape (http://www.inkscape.org/) --><svg xmlns:ns1="https://launchpad.net/jessyink" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:cc="http://creativecommons.org/ns#" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" width="1000" height="1000" viewBox="0 0 1000 1000" version="1.1" id="svg8" inkscape:version="0.92.4 5da689c313, 2019-01-14" sodipodi:docname="test.svg"> + <defs id="defs33"> + <marker inkscape:stockid="Arrow2Lstart" orient="auto" refY="0.0" refX="0.0" id="Arrow2Lstart" style="overflow:visible" inkscape:isstock="true"> + <path id="path859" style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1" d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " transform="scale(1.1) translate(1,0)"/> + </marker> + </defs> + <sodipodi:namedview pagecolor="#ffffff" bordercolor="#666666" borderopacity="1" objecttolerance="10" gridtolerance="10" guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" inkscape:window-width="1920" inkscape:window-height="1017" id="base" showgrid="true" inkscape:snap-text-baseline="true" inkscape:zoom="0.6675088" inkscape:cx="202.7349" inkscape:cy="481.16986" inkscape:window-x="0" inkscape:window-y="0" inkscape:window-maximized="1" inkscape:current-layer="webslicer-layer"> + <inkscape:grid type="xygrid" id="grid27" spacingx="10" spacingy="10" empspacing="10" color="#8080ff" opacity="0.25098039" empcolor="#0000ff" empopacity="0.25098039"/> + </sodipodi:namedview> + <g inkscape:groupmode="layer" id="webslicer-layer" inkscape:label="Slide3" style="display:inline"> + <rect height="201.49811" width="248.69112" y="353.92661" x="651.3089" id="slicerect1" style="opacity:0.5;fill:#ff0000;stroke-width:1.11927199"> + <desc id="desc51">format: png +dpi: 96 +layout-disposition: bg-el-norepeat +layout-position-anchor: tl</desc> + </rect> + <svg:g gcodetools="Gcodetools orientation group"><g gcodetools="Gcodetools orientation point (3 points)"><svg:path style="stroke:none;fill:#000000;" gcodetools="Gcodetools orientation point arrow" d="m 0 1000 l 2.9375 -6.34375 l 0.8125 1.90625 l 6.84375 -6.84375 l 0 0 l 0.6875 0.6875 l -6.84375 6.84375 l 1.90625 0.8125 z"/><svg:text x="10.0" y="990.0" style="font-family:DejaVu Sans;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:DejaVu Sans;fill:#000000;fill-opacity:1;stroke:none;font-size:10.000000px;" gcodetools="Gcodetools orientation point text" xml:space="preserve"><tspan x="10.0" y="990.0" sodipodi:role="line">(0.0; 0.0; 0.00000)</tspan></svg:text></g><g gcodetools="Gcodetools orientation point (3 points)"><svg:path style="stroke:none;fill:#000000;" gcodetools="Gcodetools orientation point arrow" d="m 100 1000 l 2.9375 -6.34375 l 0.8125 1.90625 l 6.84375 -6.84375 l 0 0 l 0.6875 0.6875 l -6.84375 6.84375 l 1.90625 0.8125 z"/><svg:text x="110.0" y="990.0" style="font-family:DejaVu Sans;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:DejaVu Sans;fill:#000000;fill-opacity:1;stroke:none;font-size:10.000000px;" gcodetools="Gcodetools orientation point text" xml:space="preserve"><tspan x="110.0" y="990.0" sodipodi:role="line">(100.0; 0.0; -0.00000)</tspan></svg:text></g><g gcodetools="Gcodetools orientation point (3 points)"><svg:path style="stroke:none;fill:#000000;" gcodetools="Gcodetools orientation point arrow" d="m 0 900 l 2.9375 -6.34375 l 0.8125 1.90625 l 6.84375 -6.84375 l 0 0 l 0.6875 0.6875 l -6.84375 6.84375 l 1.90625 0.8125 z"/><svg:text x="10.0" y="890.0" style="font-family:DejaVu Sans;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:DejaVu Sans;fill:#000000;fill-opacity:1;stroke:none;font-size:10.000000px;" gcodetools="Gcodetools orientation point text" xml:space="preserve"><tspan x="10.0" y="890.0" sodipodi:role="line">(0.0; 100.0; 0.0)</tspan></svg:text></g></svg:g></g> + <g inkscape:groupmode="layer" id="layer2" inkscape:label="Slide2" style="display:inline"> + <circle style="display:inline;fill:#000080;stroke:none" id="c1" cx="150" cy="450" r="50" inkscape:label="#path3736"/> + <ellipse style="display:inline;fill:none;stroke:#ff0000;stroke-width:16" id="c2" cx="400" cy="450" rx="100" ry="50" inkscape:label="#path3738"/> + <path style="display:inline;fill:#ffff00;stroke:#008000;stroke-width:16" id="c3" sodipodi:type="arc" sodipodi:cx="700" sodipodi:cy="450" sodipodi:rx="100" sodipodi:ry="50" sodipodi:start="0.59013865" sodipodi:end="5.6484511" d="m 783.08635,477.82381 a 100,50 0 0 1 -111.09848,20.17442 100,50 0 0 1 -71.96301,-46.88343 100,50 0 0 1 67.71127,-48.44091 100,50 0 0 1 112.7868,17.67793 L 700,450 Z" inkscape:label="#path3740"/> + <path style="display:inline;fill:none;stroke:#000000;stroke-width:10;marker-start:url(#Arrow2Lstart)" d="M 100,600 200,700 300,600 400,700" id="p1" inkscape:connector-curvature="0" inkscape:label="#path3746"/> + <path style="display:inline;fill:none;stroke:#000000;stroke-width:10" d="m 500,600 c 0,0 0,100 100,100 100,0 0,-100 100,-100 100,0 100,100 100,100" id="p2" inkscape:connector-curvature="0" inkscape:label="#path3748"/> + <path sodipodi:type="star" style="display:inline;fill:#ffff00;stroke:#008000;stroke-width:10" id="s1" sodipodi:sides="5" sodipodi:cx="189.03001" sodipodi:cy="847.93945" sodipodi:r1="69.364868" sodipodi:r2="34.682434" sodipodi:arg1="0.63598373" sodipodi:arg2="1.2643023" inkscape:flatsided="false" inkscape:rounded="0" inkscape:randomized="0" d="m 244.8332,889.14005 -45.33887,-8.13446 -32.40428,32.73753 -6.27415,-45.63352 -41.14872,-20.70184 41.46124,-20.06861 6.97297,-45.53197 31.89861,33.23044 45.45824,-7.43847 -21.74681,40.60615 z" inkscape:transform-center-x="6.4673011" inkscape:transform-center-y="-0.16430137"/> + <use style="display:inline" x="0" y="0" xlink:href="#s1" inkscape:transform-center-x="6.4673011" inkscape:transform-center-y="-0.16430137" id="u1" transform="translate(200,2.9962152)" width="100%" height="100%" inkscape:label="#use3808"/> + </g> + <g inkscape:label="Slide1" inkscape:groupmode="layer" id="layer1" style="display:inline"> + <text xml:space="preserve" style="font-size:14.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke:none" x="100" y="100" id="t1" inkscape:label="#text12"><tspan sodipodi:role="line" id="tspan10" x="100" y="100">Hello World</tspan></text> + <flowRoot xml:space="preserve" id="t4" style="font-size:40px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke:none" transform="matrix(0.26458333,0,0,0.26458333,372.02961,28.904505)" inkscape:label="#flowRoot14"><flowRegion id="flowRegion16"><rect id="rect18" width="264.5675" height="262.16187" x="105.71429" y="219.66254"/></flowRegion><flowPara id="flowPara20" style="font-size:55.43307114px">flow text which wraps</flowPara></flowRoot> <text xml:space="preserve" style="font-size:14.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke:none" x="200" y="100" id="t2" inkscape:label="#text3727"><tspan sodipodi:role="line" id="tspan3725" x="200" y="100" style="font-size:14.66666698px">UPPER</tspan></text> + <text xml:space="preserve" style="font-size:10.58333302px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke:none" x="300" y="100" id="t3" inkscape:label="#text3735"><tspan sodipodi:role="line" id="tspan3733" x="300" y="100" style="font-size:14.66666698px">Multi line</tspan><tspan sodipodi:role="line" x="300" y="118.33334" id="tspan3737" style="font-size:14.66666698px">text</tspan><tspan sodipodi:role="line" x="300" y="136.66667" id="tspan3739" style="font-size:14.66666698px">FOO</tspan></text> + <g id="t5" transform="translate(445.71038,-129.64807)" inkscape:label="#g3772"> + <text id="text3762" y="229.64807" x="54.289616" style="font-size:10.58333302px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke:none" xml:space="preserve"><tspan y="229.64807" x="54.289616" id="tspan3760" sodipodi:role="line" style="font-size:14.66666698px">Grouped</tspan></text> + <text id="text3766" y="259.64807" x="54.289619" style="font-size:14.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke:none" xml:space="preserve"><tspan y="259.64807" x="54.289619" id="tspan3764" sodipodi:role="line" style="font-size:14.66666698px">text</tspan></text> + </g> + <rect style="fill:#000080;stroke:none" id="r1" width="100" height="100" x="100" y="200" inkscape:label="#rect3732"/> + <rect style="fill:none;stroke:#ff0000;stroke-width:16" id="r2" width="200" height="100" x="300" y="200" inkscape:label="#rect3734"/> + <rect style="fill:#ffff00;stroke:#008000;stroke-width:16" id="r3" width="200" height="100" x="600" y="200" ry="38.950798" rx="44.943226" inkscape:label="#rect3744"/> + </g> + <script ns1:version="1.5.5" id="JessyInk">// dummy +</script> +</svg>
\ No newline at end of file diff --git a/share/extensions/other/gcodetools/tests/data/refs/gcodetools__06eec9617e749f35cb949d850415f68d.out b/share/extensions/other/gcodetools/tests/data/refs/gcodetools__06eec9617e749f35cb949d850415f68d.out new file mode 100644 index 0000000..e2ae9a3 --- /dev/null +++ b/share/extensions/other/gcodetools/tests/data/refs/gcodetools__06eec9617e749f35cb949d850415f68d.out @@ -0,0 +1,30 @@ +% +(Header) +(Generated by gcodetools from Inkscape.) +(Using default header. To add your own header create file "header" in the output dir.) +M3 +(Header end.) +G21 (All units in mm) + +(Start cutting path id: p1) +(Change tool to Default tool) + +G00 Z5.000000 +G00 X100.000000 Y400.000000 + +G01 Z-0.125000 F100.0(Penetrate) +G01 X200.000000 Y300.000000 Z-0.125000 F400.000000 +G01 X300.000000 Y400.000000 Z-0.125000 +G01 X400.000000 Y300.000000 Z-0.125000 +G00 Z5.000000 + +(End cutting path id: p1) + + +(Footer) +M5 +G00 X0.0000 Y0.0000 +M2 +(Using default footer. To add your own footer create file "footer" in the output dir.) +(end) +%
\ No newline at end of file diff --git a/share/extensions/other/gcodetools/tests/data/refs/gcodetools__2bf3b298fa730dafb8c6fd51921078f0.out b/share/extensions/other/gcodetools/tests/data/refs/gcodetools__2bf3b298fa730dafb8c6fd51921078f0.out new file mode 100644 index 0000000..8694e43 --- /dev/null +++ b/share/extensions/other/gcodetools/tests/data/refs/gcodetools__2bf3b298fa730dafb8c6fd51921078f0.out @@ -0,0 +1,40 @@ +% +(Header) +(Generated by gcodetools from Inkscape.) +(Using default header. To add your own header create file "header" in the output dir.) +M3 +(Header end.) +G21 (All units in mm) +(Change tool to Default tool) + +G01 Z 16.000000 F 800.000000 +G01 X 100.000000 Z 16.000000 F 800.000000 +G01 X 100.000000 Z 16.000000 F 800.000000 +G01 X 100.000000 Z 401.000000 F 800.000000 +G01 X 200.000000 Z 301.000000 F 800.000000 +G01 X 300.000000 Z 401.000000 F 800.000000 +G01 X 400.000000 Z 301.000000 F 800.000000 +G01 X 400.000000 Z 16.000000 F 800.000000 +G01 X 100.000000 Z 16.000000 F 800.000000 + +(Fine cutting start) +(Calculating fine cut using Move path) + +(Fine cut 1-th cicle start) +G01 X 100.000000 Z 16.000000 F 800.000000 +G01 X 100.000000 Z 401.000000 F 800.000000 +G01 X 100.000000 Z 400.000000 F 800.000000 +G01 X 100.000000 Z 400.000000 F 800.000000 +G01 X 200.000000 Z 300.000000 F 800.000000 +G01 X 300.000000 Z 400.000000 F 800.000000 +G01 X 400.000000 Z 300.000000 F 800.000000 +G01 Z 16.000000 F 800.000000 +G01 X 100.000000 Z 16.000000 F 800.000000 + +(Footer) +M5 +G00 X0.0000 Y0.0000 +M2 +(Using default footer. To add your own footer create file "footer" in the output dir.) +(end) +%
\ No newline at end of file diff --git a/share/extensions/other/gcodetools/tests/data/refs/gcodetools__4a9fb751baf0533eadd4d394957c966d.out b/share/extensions/other/gcodetools/tests/data/refs/gcodetools__4a9fb751baf0533eadd4d394957c966d.out new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/share/extensions/other/gcodetools/tests/data/refs/gcodetools__4a9fb751baf0533eadd4d394957c966d.out diff --git a/share/extensions/other/gcodetools/tests/data/svg/default-inkscape-SVG.svg b/share/extensions/other/gcodetools/tests/data/svg/default-inkscape-SVG.svg new file mode 100644 index 0000000..259e13c --- /dev/null +++ b/share/extensions/other/gcodetools/tests/data/svg/default-inkscape-SVG.svg @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:cc="http://web.resource.org/cc/" + xmlns:dc="http://purl.org/dc/elements/1.1/" + width="793.7007874" + height="1122.519685"> + <defs /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.35" + inkscape:cx="375" + inkscape:cy="520" + inkscape:document-units="px" + inkscape:current-layer="layer1" /> + <metadata> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + </cc:Work> + </rdf:RDF> + </metadata> + <g inkscape:label="Layer 1" inkscape:groupmode="layer" id="layer1" /> +</svg> diff --git a/share/extensions/other/gcodetools/tests/data/svg/shapes.svg b/share/extensions/other/gcodetools/tests/data/svg/shapes.svg new file mode 100644 index 0000000..eb9caed --- /dev/null +++ b/share/extensions/other/gcodetools/tests/data/svg/shapes.svg @@ -0,0 +1,284 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:ns1="https://launchpad.net/jessyink" + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="1000" + height="1000" + viewBox="0 0 1000 1000" + version="1.1" + id="svg8" + inkscape:version="0.92.4 5da689c313, 2019-01-14" + sodipodi:docname="test.svg"> + <defs + id="defs33"> + <marker + inkscape:stockid="Arrow2Lstart" + orient="auto" + refY="0.0" + refX="0.0" + id="Arrow2Lstart" + style="overflow:visible" + inkscape:isstock="true"> + <path + id="path859" + style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1" + d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z " + transform="scale(1.1) translate(1,0)" /> + </marker> + </defs> + <sodipodi:namedview + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1" + objecttolerance="10" + gridtolerance="10" + guidetolerance="10" + inkscape:pageopacity="0" + inkscape:pageshadow="2" + inkscape:window-width="1920" + inkscape:window-height="1017" + id="base" + showgrid="true" + inkscape:snap-text-baseline="true" + inkscape:zoom="0.6675088" + inkscape:cx="202.7349" + inkscape:cy="481.16986" + inkscape:window-x="0" + inkscape:window-y="0" + inkscape:window-maximized="1" + inkscape:current-layer="webslicer-layer"> + <inkscape:grid + type="xygrid" + id="grid27" + spacingx="10" + spacingy="10" + empspacing="10" + color="#8080ff" + opacity="0.25098039" + empcolor="#0000ff" + empopacity="0.25098039" /> + </sodipodi:namedview> + <g + inkscape:groupmode="layer" + id="webslicer-layer" + inkscape:label="Slide3" + style="display:inline"> + <rect + height="201.49811" + width="248.69112" + y="353.92661" + x="651.3089" + id="slicerect1" + style="opacity:0.5;fill:#ff0000;stroke-width:1.11927199"> + <desc + id="desc51">format: png +dpi: 96 +layout-disposition: bg-el-norepeat +layout-position-anchor: tl</desc> + </rect> + </g> + <g + inkscape:groupmode="layer" + id="layer2" + inkscape:label="Slide2" + style="display:inline"> + <circle + style="display:inline;fill:#000080;stroke:none" + id="c1" + cx="150" + cy="450" + r="50" + inkscape:label="#path3736" /> + <ellipse + style="display:inline;fill:none;stroke:#ff0000;stroke-width:16" + id="c2" + cx="400" + cy="450" + rx="100" + ry="50" + inkscape:label="#path3738" /> + <path + style="display:inline;fill:#ffff00;stroke:#008000;stroke-width:16" + id="c3" + sodipodi:type="arc" + sodipodi:cx="700" + sodipodi:cy="450" + sodipodi:rx="100" + sodipodi:ry="50" + sodipodi:start="0.59013865" + sodipodi:end="5.6484511" + d="m 783.08635,477.82381 a 100,50 0 0 1 -111.09848,20.17442 100,50 0 0 1 -71.96301,-46.88343 100,50 0 0 1 67.71127,-48.44091 100,50 0 0 1 112.7868,17.67793 L 700,450 Z" + inkscape:label="#path3740" /> + <path + style="display:inline;fill:none;stroke:#000000;stroke-width:10;marker-start:url(#Arrow2Lstart)" + d="M 100,600 200,700 300,600 400,700" + id="p1" + inkscape:connector-curvature="0" + inkscape:label="#path3746" /> + <path + style="display:inline;fill:none;stroke:#000000;stroke-width:10" + d="m 500,600 c 0,0 0,100 100,100 100,0 0,-100 100,-100 100,0 100,100 100,100" + id="p2" + inkscape:connector-curvature="0" + inkscape:label="#path3748" /> + <path + sodipodi:type="star" + style="display:inline;fill:#ffff00;stroke:#008000;stroke-width:10" + id="s1" + sodipodi:sides="5" + sodipodi:cx="189.03001" + sodipodi:cy="847.93945" + sodipodi:r1="69.364868" + sodipodi:r2="34.682434" + sodipodi:arg1="0.63598373" + sodipodi:arg2="1.2643023" + inkscape:flatsided="false" + inkscape:rounded="0" + inkscape:randomized="0" + d="m 244.8332,889.14005 -45.33887,-8.13446 -32.40428,32.73753 -6.27415,-45.63352 -41.14872,-20.70184 41.46124,-20.06861 6.97297,-45.53197 31.89861,33.23044 45.45824,-7.43847 -21.74681,40.60615 z" + inkscape:transform-center-x="6.4673011" + inkscape:transform-center-y="-0.16430137" /> + <use + style="display:inline" + x="0" + y="0" + xlink:href="#s1" + inkscape:transform-center-x="6.4673011" + inkscape:transform-center-y="-0.16430137" + id="u1" + transform="translate(200,2.9962152)" + width="100%" + height="100%" + inkscape:label="#use3808" /> + </g> + <g + inkscape:label="Slide1" + inkscape:groupmode="layer" + id="layer1" + style="display:inline"> + <text + xml:space="preserve" + style="font-size:14.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke:none" + x="100" + y="100" + id="t1" + inkscape:label="#text12"><tspan + sodipodi:role="line" + id="tspan10" + x="100" + y="100">Hello World</tspan></text> + <flowRoot + xml:space="preserve" + id="t4" + style="font-size:40px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke:none" + transform="matrix(0.26458333,0,0,0.26458333,372.02961,28.904505)" + inkscape:label="#flowRoot14"><flowRegion + id="flowRegion16"><rect + id="rect18" + width="264.5675" + height="262.16187" + x="105.71429" + y="219.66254" /></flowRegion><flowPara + id="flowPara20" + style="font-size:55.43307114px">flow text which wraps</flowPara></flowRoot> <text + xml:space="preserve" + style="font-size:14.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke:none" + x="200" + y="100" + id="t2" + inkscape:label="#text3727"><tspan + sodipodi:role="line" + id="tspan3725" + x="200" + y="100" + style="font-size:14.66666698px">UPPER</tspan></text> + <text + xml:space="preserve" + style="font-size:10.58333302px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke:none" + x="300" + y="100" + id="t3" + inkscape:label="#text3735"><tspan + sodipodi:role="line" + id="tspan3733" + x="300" + y="100" + style="font-size:14.66666698px">Multi line</tspan><tspan + sodipodi:role="line" + x="300" + y="118.33334" + id="tspan3737" + style="font-size:14.66666698px">text</tspan><tspan + sodipodi:role="line" + x="300" + y="136.66667" + id="tspan3739" + style="font-size:14.66666698px">FOO</tspan></text> + <g + id="t5" + transform="translate(445.71038,-129.64807)" + inkscape:label="#g3772"> + <text + id="text3762" + y="229.64807" + x="54.289616" + style="font-size:10.58333302px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke:none" + xml:space="preserve"><tspan + y="229.64807" + x="54.289616" + id="tspan3760" + sodipodi:role="line" + style="font-size:14.66666698px">Grouped</tspan></text> + <text + id="text3766" + y="259.64807" + x="54.289619" + style="font-size:14.66666698px;line-height:1.25;font-family:sans-serif;fill:#000000;stroke:none" + xml:space="preserve"><tspan + y="259.64807" + x="54.289619" + id="tspan3764" + sodipodi:role="line" + style="font-size:14.66666698px">text</tspan></text> + </g> + <rect + style="fill:#000080;stroke:none" + id="r1" + width="100" + height="100" + x="100" + y="200" + inkscape:label="#rect3732" /> + <rect + style="fill:none;stroke:#ff0000;stroke-width:16" + id="r2" + width="200" + height="100" + x="300" + y="200" + inkscape:label="#rect3734" /> + <rect + style="fill:#ffff00;stroke:#008000;stroke-width:16" + id="r3" + width="200" + height="100" + x="600" + y="200" + ry="38.950798" + rx="44.943226" + inkscape:label="#rect3744" /> + </g> + <script + ns1:version="1.5.5" + id="JessyInk">// dummy +</script> +</svg> diff --git a/share/extensions/other/gcodetools/tests/dev_requirements.txt b/share/extensions/other/gcodetools/tests/dev_requirements.txt new file mode 100644 index 0000000..0e358d9 --- /dev/null +++ b/share/extensions/other/gcodetools/tests/dev_requirements.txt @@ -0,0 +1,11 @@ +# Dev Requirements +pytest +pytest-cov + +# Code requirements +typing +lxml +numpy +scour +pyserial +cssselect
\ No newline at end of file diff --git a/share/extensions/other/gcodetools/tests/test_gcodetools.py b/share/extensions/other/gcodetools/tests/test_gcodetools.py new file mode 100644 index 0000000..0575729 --- /dev/null +++ b/share/extensions/other/gcodetools/tests/test_gcodetools.py @@ -0,0 +1,65 @@ +# coding=utf-8 + +import sys +import os + +from gcodetools import Gcodetools +from inkex.tester import ComparisonMixin, InkscapeExtensionTestMixin, TestCase +from inkex.tester.filters import CompareOrderIndependentBytes + +SETTINGS = ( + '--id=p1', '--max-area-curves=100', + '--area-inkscape-radius=-10', '--area-tool-overlap=0', + '--area-fill-angle=0', '--area-fill-shift=0', '--area-fill-method=0', + '--area-fill-method=0', '--area-find-artefacts-diameter=5', + '--area-find-artefacts-action=mark with an arrow', + '--biarc-tolerance=1', '--biarc-max-split-depth=4', + '--path-to-gcode-order=subpath by subpath', + '--path-to-gcode-depth-function=d', + '--path-to-gcode-sort-paths=false', '--Zscale=1', '--Zoffset=0', + '--auto_select_paths=true', '--min-arc-radius=0.05000000074505806', + '--comment-gcode-from-properties=false', '--create-log=false', + '--add-numeric-suffix-to-filename=false', '--Zsafe=5', + '--unit=G21 (All units in mm)', '--postprocessor= ', +) +FILESET = SETTINGS + ('--directory=/home', '--filename=output.ngc',) + +class TestGcodetoolsBasic(ComparisonMixin, InkscapeExtensionTestMixin, TestCase): + stderr_protect = False + effect_class = Gcodetools + comparisons = [ + FILESET + ('--active-tab="area_fill"',), + FILESET + ('--active-tab="area"',), + FILESET + ('--active-tab="area_artefacts"',), + FILESET + ('--active-tab="dxfpoints"',), + FILESET + ('--active-tab="orientation"',), + FILESET + ('--active-tab="tools_library"',), + FILESET + ('--active-tab="lathe_modify_path"',), + FILESET + ('--active-tab="offset"',), + FILESET + ('--active-tab="plasma-prepare-path"',), + ] + compare_filters = [CompareOrderIndependentBytes()] + compare_file_extension = 'dxf' + + def test_all_comparisons(self): + """ + gcodetools tries to write to a folder and filename specified + on the command line, this needs to be handled carefully. + """ + for tab in ( + ('--active-tab="path-to-gcode"',), + #('--active-tab="engraving"',), + #('--active-tab="graffiti"',), + ('--active-tab="lathe"',), + ): + args = SETTINGS + tab + ( + '--directory={}'.format(self.tempdir), + '--filename=output.ngc', + ) + outfile = os.path.join(self.tempdir, 'output.ngc') + self.assertCompare(self.compare_file, None, args, 'output.ngc') + +class TestGcodeToolsOrientationScientific(ComparisonMixin, TestCase): + effect_class = Gcodetools + compare_file = "svg/shapes.svg" + comparisons = [("--active-tab=orientation", "--Zsurface=0.00000000000001e-5", "--Zdepth=-9.71445146547012e-17", "--orientation-points-count=3")] diff --git a/share/extensions/other/gcodetools/tests/test_inkex_inx.py b/share/extensions/other/gcodetools/tests/test_inkex_inx.py new file mode 100644 index 0000000..211b746 --- /dev/null +++ b/share/extensions/other/gcodetools/tests/test_inkex_inx.py @@ -0,0 +1,114 @@ +#!/usr/bin/env python +# coding=utf-8 +""" +Test elements extra logic from svg xml lxml custom classes. +""" + +import os +from glob import glob + +from inkex.utils import PY3 +from inkex.tester import TestCase +from inkex.tester.inx import InxMixin +from inkex.inx import InxFile + +class InxTestCase(InxMixin, TestCase): + """Test INX files""" + def test_inx_effect(self): + inx = InxFile(""" +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <name>TestOne</name> + <id>org.inkscape.test.inx_one</id> + <effect needs-live-preview="false"> + <object-type>all</object-type> + <effects-menu> + <submenu name="Banana"> + <submenu name="Ice Cream"/> + </submenu> + </effects-menu> + </effect> + <script> + <command location="inx" interpreter="python">inx_test.py</command> + </script> +</inkscape-extension>""") + self.assertEqual(inx.name, 'TestOne') + self.assertEqual(inx.ident, 'org.inkscape.test.inx_one') + self.assertEqual(inx.slug, 'InxOne') + self.assertEqual(inx.metadata, {'type': 'effect', 'preview': False, 'objects': 'all'}) + self.assertEqual(inx.menu, ['Banana', 'Ice Cream', 'TestOne']) + self.assertEqual(inx.warnings, []) + + def test_inx_output(self): + inx = InxFile(""" +<inkscape-extension xmlns="http://www.inkscape.org/namespace/inkscape/extension"> + <_name>TestTwo</_name> + <id>org.inkscape.test.inx_two</id> + <output> + <extension>.inx</extension> + <mimetype>text/xml+inx</mimetype> + <filetypename>Extension (*.inx)</filetypename> + <_filetypetooltip>The extension extension repention suspension.</_filetypetooltip> + <dataloss>true</dataloss> + </output> +</inkscape-extension>""") + self.assertEqual(inx.name, 'TestTwo') + self.assertEqual(inx.ident, 'org.inkscape.test.inx_two') + self.assertEqual(inx.metadata, { + 'dataloss': True, + 'extension': '.inx', + 'mimetype': 'text/xml+inx', + 'name': 'Extension (*.inx)', + 'tooltip': 'The extension extension repention suspension.', + 'type': 'output'}) + self.assertEqual(inx.warnings, [ + 'Use of old translation scheme: <_filetypetooltip...>', + 'Use of old translation scheme: <_name...>']) + + def test_inx_input(self): + inx = InxFile("""<inkscape-extension> + <name>TestThree</name> + <id>org.inkscape.test.inx_three</id> + <input> + <extension>.inx</extension> + <mimetype>text/xml+inx</mimetype> + <filetypename>Extension (*.inx)</filetypename> + <filetypetooltip>The extension extension repention suspension.</filetypetooltip> + </input> +</inkscape-extension>""") + self.assertEqual(inx.name, 'TestThree') + self.assertEqual(inx.metadata, { + 'extension': '.inx', + 'mimetype': 'text/xml+inx', + 'name': 'Extension (*.inx)', + 'tooltip': 'The extension extension repention suspension.', + 'type': 'input'}) + self.assertEqual(inx.warnings, ['No inx xml prefix.']) + + def test_inx_template(self): + inx = InxFile("""<inkscape-extension xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"> + <name>TestFour</name> + <id>org.inkscape.test.inx_four</id> + <effect needs-live-preview="false"> + <object-type>all</object-type> + <effects-menu hidden="true" /> + </effect> + <inkscape:templateinfo> + <inkscape:name>Magic Number</inkscape:name> + <inkscape:author>Donky Oaty</inkscape:author> + <inkscape:shortdesc>Something might happen.</inkscape:shortdesc> + <inkscape:date>2070-01-01</inkscape:date> + <inkscape:keywords>word food strawberry</inkscape:keywords> + </inkscape:templateinfo> +</inkscape-extension>""") + self.assertEqual(inx.name, 'TestFour') + self.assertEqual(inx.metadata, {'author': 'Donky Oaty', 'desc': 'Something might happen.', 'type': 'template'}) + self.assertEqual(inx.warnings, ['No inx xml prefix.']) + + + def test_inx_files(self): + """Get all inx files and test each of them""" + if not PY3: + self.skipTest("No INX testing in python2") + return + for inx_file in glob(os.path.join(self._testdir(), '..', '*.inx')): + self.assertInxIsGood(inx_file) |