inkstitch / inkstitch

Ink/Stitch: an Inkscape extension for machine embroidery design
https://inkstitch.org
GNU General Public License v3.0
979 stars 172 forks source link

Division by Zero in lib\stiches\fill.py intersect_region_with_grating #1907

Closed kressbach closed 1 year ago

kressbach commented 1 year ago

path943: error: Error during autofill! This means that there is a problem with Ink/Stitch.

If you'd like to help us make Ink/Stitch better, please paste this whole message into a new issue at: https://github.com/inkstitch/inkstitch/issues/new

Ink/Stitch Version: v2.2.0 (windows)

Traceback (most recent call last): File "lib\elements\fill_stitch.py", line 556, in to_stitch_groups File "lib\elements\fill_stitch.py", line 590, in do_underlay File "lib\debug.py", line 133, in decorated File "lib\stitches\auto_fill.py", line 62, in auto_fill File "lib\stitches\fill.py", line 163, in intersect_region_with_grating ZeroDivisionError: float division by zero

-------------- extract from svg file - uppercase S of Algerian Font ' \<g inkscape:label="S" id="g2302" style="display:inline;overflow:hidden" transform="matrix(1.68972,0,0,1.5397699,1182.6979,-2018.154)"> \<g inkscape:label="S" id="g945" style="display:inline"> \<path d="m 70,1799.13 q -3.64,4.9 -5.81,10.22 -4.27,10.5 -5.67,12.88 l -0.35,0.42 q -0.28,-0.77 -0.42,-1.19 -1.96,-6.3 -3.22,-8.75 -1.26,-2.45 -3.78,-4.69 -6.37,-5.67 -14.49,-5.67 -7.49,0 -12.46,4.17 -4.97,4.16 -4.97,10.46 0,11.76 17.71,16.03 l 11.83,2.87 q 25.27,6.09 25.27,26.67 0,11.48 -8.645,19.29 -8.645,7.8 -21.385,7.8 -7.98,0 -17.85,-2.45 l -8.19,-2.03 q -4.97,-1.19 -8.19,-1.19 -4.27,0 -8.82,2.73 L 0,1885.72 q 8.68,-13.09 12.18,-24.92 l 1.26,0.35 q 1.47,10.99 8.82,17.08 7.35,6.09 19.25,6.09 9.38,0 14.91,-4.34 5.53,-4.34 5.53,-11.69 0,-8.47 -7.7,-14 -5.53,-3.92 -22.68,-7.28 -13.23,-2.59 -19.18,-8.61 -5.95,-6.02 -5.95,-16.73 0,-11.06 7.945,-17.95 7.945,-6.9 20.685,-6.9 8.19,0 19.11,2.94 5.11,1.4 7.56,1.4 3.43,0 7.49,-2.38 z m 4.34,2.94 -0.63,1.05 q -2.87,4.83 -4.9,9.24 -4.9,10.29 -5.53,11.48 l -0.35,0.49 -1.68,-0.7 0.28,-0.63 q 2.03,-4.62 5.88,-12.04 l 4.76,-9.24 0.35,-0.56 z M 53.9,1816 q -7.7,-8.19 -16.52,-8.19 -5.32,0 -8.82,3.08 -3.5,3.08 -3.5,7.84 0,5.18 7.07,10.64 l 0.56,0.35 -0.35,0.56 q -9.24,-4.13 -9.24,-11.97 0,-5.46 3.92,-8.89 3.92,-3.43 10.22,-3.43 6.02,0 10.535,2.56 4.515,2.55 6.615,7.17 z m 16.1,27.79 q 9.52,7.21 9.52,19.74 0,13.37 -10.36,22.65 -10.36,9.27 -25.2,9.27 -7.56,0 -13.65,-1.54 l -11.2,-2.73 q -3.92,-0.98 -8.4,-0.98 -3.99,0 -7.35,1.61 l -0.84,-2.03 q 3.64,-1.68 7.42,-1.68 4.2,0 9.59,1.26 l 10.78,2.59 q 6.44,1.54 13.58,1.54 14,0 23.835,-8.92 9.835,-8.93 9.835,-21.6 0,-10.71 -7.56,-18.76 z m -49.84,20.16 q 2.59,12.6 13.86,17.85 v 0.56 Q 21,1878.58 18.27,1864.3 Z m -8.75,-22.68 2.38,1.33 q 2.31,4.13 13.51,6.86 l 11.27,2.8 q 11.48,2.87 15.295,4.94 3.815,2.06 5.425,6.26 l -0.49,0.28 q -3.15,-3.64 -6.825,-5.32 -3.675,-1.68 -14.105,-4.13 -15.12,-3.5 -20.3,-6.05 -5.18,-2.56 -6.16,-6.97 z" id="path943" /> \ '

kressbach commented 1 year ago

Workaround? I get the error when opening 'parameters' for that glyph. But, the forms are accessible and I can enter values.

If I ignore the error message and just set the fill direction to 40 (the only value I tried) then I can continue and save the values. Next time there is no error when opening the parameter window.

kaalleen commented 1 year ago

Thank you for your error report. This error has been worked on and will not show up in the next Ink/Stitch release.