Git Product home page Git Product logo

gcode-simulator's Introduction

gcode-simulator

Webgl based gcode simulator

Uses

from the command line

First, install npm install -g gcode-simulator

now you can execute the gcode-simulator command at your prompt. If you want to stream gcode to the simulator add a -i.

example: curl http://www.clker.com/cliparts/O/H/c/W/A/o/plane.svg | svgmill -i -z 110 --scale=1 | gcode-simulator -i

where svgmill turns svg into gcode. (npm install -g svgmill)

from the web

open index.html in a webgl capable browser

License

MIT

gcode-simulator's People

Contributors

dylankbuckley avatar tmpvar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gcode-simulator's Issues

Always throws an error when run.

$ gcode-simulator

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:980:11)
    at Process.ChildProcess._handle.onexit (child_process.js:771:34)

IIRC, it used to spin up a server and shell out to open, then you replaced with node-chrome which I've never gotten to work on OSX.

Personally, I'd much prefer the simpler approach for it to just spin up a server and let me access it in a browser. node-chrome seems to add a lot of complication and the end result is not very nice at all.

What would be really cool, is if it simply opened a named fifo pipe at, say, /tmp/gcode. That way I could run it once, and regularly stream gcode to test to the pipe, then focus a browser window I keep open.

Possibly MacOSX related Google Chrome URL on Windows 7

When i try to run gcode-simulator with the following command:

$ curl http://www.clker.com/cliparts/O/H/c/W/A/o/plane.svg | svgmill -i -z 110 --scale=1 | gcode-simulator -i

I've got the following error:

C:\www\gcode-simulator> curl http://www.clker.com/cliparts/O/H/c/W/A/o/plane.svg | svgmill -i -z 110 --scale=1 | gcode-simulator -i
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: spawn /Volumes/Data/Applications/Google Chrome.app/Contents/MacOS/Google Chrome ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
    at child_process.js:1144:20
    at process._tickCallback (node.js:355:11)
    at Function.Module.runMain (module.js:503:11)
    at startup (node.js:129:16)
    at node.js:814:3
100  2323  100  2323    0     0   1136      0  0:00:02  0:00:02 --:--:--  1136
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: write EPIPE
    at exports._errnoException (util.js:746:11)
    at Socket._writeGeneric (net.js:690:26)
    at Socket._write (net.js:709:8)
    at doWrite (_stream_writable.js:301:12)
    at writeOrBuffer (_stream_writable.js:288:5)
    at Socket.Writable.write (_stream_writable.js:217:11)
    at Socket.write (net.js:634:40)
    at Console.log (console.js:55:16)
    at Socket.<anonymous> (C:\Users\Lanti\AppData\Roaming\npm\node_modules\svgmill\bin\run.js:124:13)
    at Socket.emit (events.js:129:20)

In gcode-simulator.js I changed the following line:
runtime: "/Volumes/Data/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome",
To this one:
runtime: "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",

Now the Chrome window with the name of "WebGL Gcode simulator" will start, but I only got an FPS counter and white window.

And now my command line hangs in this state:

C:\www\gcode-simulator> curl http://www.clker.com/cliparts/O/H/c/W/A/o/plane.svg | svgmill -i -z 110 --scale=1 | gcode-simulator -i
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2323  100  2323    0     0   2918      0 --:--:-- --:--:-- --:--:--  2978

After I close the chrome window the cmd will give back the cursor, so I think it's a feature, but my window is still blank white in chrome.

Can be a windows and cURL compatibility issue (cURL is installed and working). If I just type "gcode-simulator", starts without problem. I copy in the svg from the original example, generating the GCODE, but the right side graphical window is still blank grey. This is same using the website also:
http://tmpvar.com/project/gcode-simulator/

Update:
Okay, so the -i flag causing the simulator to hide everything and only showing a white window. Possibly this is a full screen milling area. Removing the -i flag making the window showing everything like on the website, but the svg and gcode windows are empty. CTRL+C in command line causing downloading the svg and closing the chrome window same time.

Maybe the | "pipe" command doesn't work in windows command line?

Camera is hard to control

I find it really difficult to control the camera. I'd really love if there were preset camera positions that I could just switch between, and if it was independent of large and small scales.

Here's a suggestion:

  1. Maintain a bounding box that expands with every new points to encapsulate that point.

  2. Have some pre-set camera /angles/ for top, bottom, etc... (plane centers and corners) that move to those positions on the bounding box.

This approach would give you some really nice perspectives that work with different scales, usually require no messing with the camera at all, and in the case where you need to see a different angle (rarely) it should just be 1 click.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.