Rust 2021 Edition.
A library containing a full set of nom parsers for decoding gcode files.
Based on this library the workspace contains a series of visualization tools
- gcode2obj - Generates "WaveFront Obj" files.
- gcode2svg - Generates SVG files.
- gcodeExtractThumbs - Extracts the images embedded in a binary-gcode file.
- bgcodeViewer - Generates a report by turning on all the logging and them attempts to parse the file.
I intend the parsers to be as strictly compliant as possible. This is under-going rapid development. Please create issues here, or send me gcode files which expose unimplemented sections.
For "binary gcode files" ['.bgcode' extension] the parser are streaming parsers.
See nom - "A byte-oriented, zero-copy, parser combinators library"
Generates obj files.
Pass the gcode file into StdIn - the obj file is sent to StdOut :-
cd gcode2obj
cargo run --release -- < ./assets/bency.gcode > bench.obj
Which for example can be imported into blender for visualization.
- This obj has been "Imported".
- Converted into a "Curve".
- Finally a circular bevel object has been applied to make the object solid [ A circle to represent a 0.1mm fibre].
Generate svg files
Pass the gcode file into StdIn - the SVG file is sent to StdOut :-
cd gcode2svg
cargo run --release -- < ./assets/benchy.gcode > benchy.svg
Extracts
Strict checking of binaries. validates blocks checksums, ensures 'block' parameters values are within valid ranges.
Pass the gcode file into StdIn - A summary file is written to StdOut
cd bgcodeViewer
cargo run --release < ../assets/both\ parts.bgcode > summary.txt
see TODO
A Bevy app?