gcode-simulator icon indicating copy to clipboard operation
gcode-simulator copied to clipboard

Where can I obtain svgmill.js?

Open ruswerner opened this issue 12 years ago • 3 comments

I see this file referenced in your example, but I can't find it. Am I missing something obvious?

Cheers

ruswerner avatar Jun 06 '13 01:06 ruswerner

Am I missing something obvious?

No no, this is my fault!

I've been working on tool width compensation (really tricky problem!) so be warned that this code will probably break or not work as expected. https://github.com/tmpvar/svgmill

new usage after npm install -g svgmill is curl http://www.clker.com/cliparts/O/H/c/W/A/o/plane.svg | svgmill -i -z 110 --scale=1 | gcode-simulator -i

Thank you for the push, I've been meaning to publish that for a while now! I've been avoiding publishing until the polygon offsetting code is solid, but I'm a bit stuck on implementing some algorithm in a research paper.

tmpvar avatar Jun 06 '13 01:06 tmpvar

No problem. I have quite a bit of experience implementing vector based design tools using SVG and html5 canvas. I wrote the design suite UI that powers this product: http://www.ceros.com/. Maybe I can help.

I have been thinking about using an annotated extension of SVG to generate gcode. I tried to use inkscape+gcodetools, but it's too clunky. However, SVG is a perfect technology to describe vector paths and primitives; we just need to add the tool info and gcode/machine hints at the right places. I was thinking of building a web-based UI to accomplish this so you could use any SVG authoring tool, then annotate and preview/simulate in a web based tool; and then also stream it to the arduino, etc.

I know a lot of people use python, but I prefer JavaScript, and I think CNC machining, in general, needs to be brought more into the web era. We need to be able to control a machine from the multitude of very capable touch devices available (and nearly everyone has one).

I have some primitive nodejs code that talks directly to grbl and has a web front-end (as noted in my other issue over at grbl repo). My next step is uploading a gcode file and streaming it to the arduino. Now that I know about your nodejs wrapper for the grbl sim; I'm going to hook that up first in my dev env so I don't break my machine.

If you are interested in any of this stuff, let me know. There might be some opportunity to combine efforts.

ruswerner avatar Jun 06 '13 02:06 ruswerner

you may want to take a peek at node-grbl

Also, I just decided to take a peek at the latest polyoffset code I was working last and guess what.. it has a svgmill.js in the bin directory which works way better than the svgmill project (go figure). I think there's a point at which I'll be satisfied with this code and properly DRY up the code, but as long as this crazy offsetting issue lives I'll be haunted by my failed attempts.

BTW, the code for the latest offsetting code lives here: https://github.com/tmpvar/polyoffset/tree/brute-force -- it passes many of the tests but fails on a few convex shapes (http://imgur.com/a/6v6YL). Using that code the command line looks like:

curl http://www.clker.com/cliparts/O/H/c/W/A/o/plane.svg | node bin/svgmill.js | gcode-simulator -i

I live and breath this stuff for months at a time, hopefully I can get back into the flow of things after life stuff settles a bit.

svgmill project: screen shot 2013-06-05 at 7 13 24 pm

polyoffset/bin/svgmill.js screen shot 2013-06-05 at 7 14 47 pm

tmpvar avatar Jun 06 '13 02:06 tmpvar