gcode-parser
Install
npm install --save gcode-parser
Usage
var fs = ;var parser = ; // parseLineparser;// => { line: 'G0 X0 Y0', words: [ [ 'G', 0 ], [ 'X', 0 ], [ 'Y', 0 ] ] } // parseLine (flatten mode)parser;// => { line: 'G0 X0 Y0', words: [ 'G0', 'X0', 'Y0' ] } // parseFilevar file = 'example.nc';parser; // Synchronous version of parseFile.results = parser; // parseStreamvar stream = fs;parser; // parseStringvar str = fs;parser; // Synchronous version of parseString.results = parser;
Advanced Usage
var _ = ;var parser = ; parser
Options
batchSize
Type: Number
Default: 1000
The batch size.
flatten
Type: Boolean
Default: false
True to flatten the array, false otherwise.
parser;// => { line: 'G0 X0 Y0', words: [ [ 'G', 0 ], [ 'X', 0 ], [ 'Y', 0 ] ] } parser;// => { line: 'G0 X0 Y0', words: [ 'G0', 'X0', 'Y0' ] }
noParseLine
Type: Boolean
Default: false
True to not parse line, false otherwise.
parser;
G-code Interpreter
https://github.com/cncjs/gcode-interpreter
G-code Toolpath
https://github.com/cncjs/gcode-toolpath
G-code Toolpath Visualizer
Check out the source code at https://github.com/cncjs/cncjs/blob/master/src/web/widgets/Visualizer/GCodeVisualizer.js
License
MIT