Open davidwachs opened 8 years ago
Does this still happen? update: yes it does:
Traceback (most recent call last):
File "svg2gcode.py", line 60, in <module>
generate_gcode()
File "svg2gcode.py", line 51, in generate_gcode
for x,y in p:
File "/home/harvie/Temp/svg3gcode/shapes.py", line 184, in point_generator
cspsubdiv.subdiv( sp, flatness)
File "/home/harvie/Temp/svg3gcode/cspsubdiv.py", line 22, in subdiv
p2 = sp[i][0]
IndexError: list index out of range
It happens with your SVG, but not with mine SVGs... There's probably something that triggers it.
I've used inkscape to break your svg into subpaths and one of the paths it created was empty:
<path
d="M 7.984375,7.15625"
id="path2"
inkscape:connector-curvature="0" />
probably svg2gcode should detect this and avoid processing such zero length shape?
I don’t use the code anymore so I can’t say. Thanks for asking though.
David Wachs
Chief Robot Mechanic, Handwrytten
T: 602.792.7221
On Jul 13, 2018, at 7:18 PM, Tomas Mudrunka notifications@github.com<mailto:notifications@github.com> wrote:
Does this still happen?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vishpat/svg2gcode/issues/2#issuecomment-404991849, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALnLJ5NAZqTmtOCt3ooQYA0Faus56Ytyks5uGVT1gaJpZM4J5Udp.
Oh gotcha. Thank you!
David Wachs
Chief Robot Mechanic, Handwrytten
T: 602.792.7221
On Jul 13, 2018, at 7:24 PM, Tomas Mudrunka notifications@github.com<mailto:notifications@github.com> wrote:
I've used inkscape to break your svg into subpaths and one of the paths it created was empty:
<path d="M 7.984375,7.15625" id="path2" inkscape:connector-curvature="0" />
probably svg2gcode should detect this and avoid processing such zero length shape?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/vishpat/svg2gcode/issues/2#issuecomment-404992160, or mute the threadhttps://github.com/notifications/unsubscribe-auth/ALnLJ8VIcv9IcOm-W-BL71I8ZJbYGzB4ks5uGVZYgaJpZM4J5Udp.
I also met this problem when running svg
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="50px" height="50px" viewBox="0 0 50 50" version="1.1" fill="#000000">
<g id="surface279232">
<path style=" stroke:none;fill-rule:nonzero;fill:#000000;fill-opacity:1;" d="M 7.8125 7.8125 L 7.8125 42.1875 L 42.1875 42.1875 L 42.1875 7.8125 Z M 10.9375 10.9375 L 39.0625 10.9375 L 39.0625 39.0625 L 10.9375 39.0625 Z M 25 17.1875 C 21.546875 17.1875 18.75 19.984375 18.75 23.4375 L 18.75 26.5625 C 18.75 30.015625 21.546875 32.8125 25 32.8125 C 28.453125 32.8125 31.25 30.015625 31.25 26.5625 L 31.25 23.4375 C 31.25 19.984375 28.453125 17.1875 25 17.1875 Z M 25 20.3125 C 26.863281 20.3125 28.125 21.574219 28.125 23.4375 L 28.125 26.5625 C 28.125 28.425781 26.863281 29.6875 25 29.6875 C 23.136719 29.6875 21.875 28.425781 21.875 26.5625 L 21.875 23.4375 C 21.875 21.574219 23.136719 20.3125 25 20.3125 Z M 25 20.3125 "/>
</g>
</svg>
and I delete the last Z M 25 20.3125
in d and generate successfully but loss some stroke
How to fix this problem?
Please help me >< Thanks a lot
Hey, AWESOME code, but I have an issue...
when it parses my svgs, I keep getting index out of range... any idea what I can do to fix this?
I get this even with simple SVGs:
I've been struggling with this... any help you can lend would be amazing... thanks so much in advance.