em / svg2gcode

Convert SVG to Gcode
54 stars 15 forks source link

Gcode generated for simple shapes is being filled and not only the boundary #7

Open Tarun-Karthik opened 5 years ago

Tarun-Karthik commented 5 years ago

The gcode generated for simple shapes is being filled. I just wanted to get the gcode for the boundry .

crlgn commented 5 years ago

I found that if I don't specify stroke style and fill:none to the svg, the parser considers the inside as filled.

J-Dunn commented 4 years ago

I just installed it and ran a test on a simple svg with two lines, not forming any closed shape.

~/.npm-packages/lib/node_modules/svg2gcode/node_modules/gcanvas/lib/gcanvas.js:407
      throw 'You must set context.toolDiameter to use fill()'
      ^
You must set context.toolDiameter to use fill()

set fill:none as suggested above now it runs but just sits there doing nothing. need to cntl-c to end it.

This does not look very useful. What is it supposed to do.

The svg has two lines, why does it try to do more than create two simple gcode paths. No proper explanation of what this tool is supposed to do or not do. Needs some basic documentation; ie more that just the command name itself !

crlgn commented 4 years ago

@J-Dunn How did you implement the stroke and fill style? Once I understood the limitations the code worked fine for me, but I had to edit my svg.

J-Dunn commented 4 years ago

Thanks, I did get a little bit further but it seems that inkscape is not respecting the first line which gives the python interpreter. The script line1 points to a python2.7 executable but inkscape is apparently calling "python" which default path provides python3 . I found some patches somewhere which rearranges things for py3 syntax but there were still issues, I get error reported from the script and I gave up at that point. Yet another chase down a warren full of rabbit holes which leads no where. Things seem to get broken quicker than anyone can keep up these days.

ram4nd commented 4 years ago

@carolinex Can you explain the limitations?

crlgn commented 4 years ago

It's been some time since I last used it, but I do remember that I had to convert certain shapes to paths and remove most properties from the root element. If you use a software like illustrator to create your paths, make sure to convert the shapes into paths on the software. I will take a look at my past code here and update this answer if I remember anything else.