svg2gcode icon indicating copy to clipboard operation
svg2gcode copied to clipboard

Straight lines not being converted to gcode

Open ln0a opened this issue 3 years ago • 3 comments

First off I just want to say your tool is brilliant. Thanks so much for developing it! I'm having one small problem though, that if the svg path does not contain any curves, no gcode will be created. I have tried this as both open and closed paths and get the same result, and on the web and cli releases.

Any thoughts on why this might be?

ln0a avatar Oct 08 '22 21:10 ln0a

Hi, glad to hear it's been helpful so far!

Do you mind sharing the SVG you used or a similar example so I can look into this further?

sameer avatar Oct 10 '22 02:10 sameer

Of course, thanks for having a look at this! I have found a solution, 'making compound paths' in the illustrator allows the gcode to be generated, but when trying to automate 100s of svgs this feels only a temporary solution. test2

ln0a avatar Oct 10 '22 09:10 ln0a

I think I see the problem, this is related to #15. The SVG you shared contains a polygon object, whereas svg2gcode expects it to be a path:

<polygon class="st0" points="429.7,425.2 221,526.3 429.7,561 "/>

becomes

<path
   id="polygon4"
   class="st0"
   style="fill:none;stroke:#000000;stroke-miterlimit:10"
   d="M 429.7,425.2 221,526.3 429.7,561 Z" />

using Inkscape's Object to Path.

It should be possible to add support for these, they just aren't handled currently. Though they will not be filled until #15 is implemented.

sameer avatar Oct 11 '22 16:10 sameer

Closing in favor of the mega tracker #38

sameer avatar Jun 01 '23 21:06 sameer