11 unstable releases (3 breaking)

0.3.3 Oct 29, 2021
0.3.2 Oct 29, 2021
0.3.1 Aug 15, 2021
0.2.6 Aug 13, 2021
0.0.1 Feb 14, 2021

#352 in Parser implementations

Download history 14/week @ 2022-01-25 6/week @ 2022-02-01 3/week @ 2022-02-08 7/week @ 2022-02-15 20/week @ 2022-02-22 8/week @ 2022-03-01 12/week @ 2022-03-08 74/week @ 2022-03-15 47/week @ 2022-03-22 5/week @ 2022-03-29 10/week @ 2022-04-05 6/week @ 2022-04-12 7/week @ 2022-04-19 74/week @ 2022-04-26 57/week @ 2022-05-03 170/week @ 2022-05-10

309 downloads per month
Used in svg2gcode

MIT/Apache

62KB
1.5K SLoC

g-code

crates.io g-code g-code codecov

A joint crate for g-code parsing and emission.

Parsing

The parser is written in Rust using peg.

Demo

cargo run --example parse ./tests/vandy_commodores_logo.gcode

Output: https://gist.github.com/sameer/5fe20dad6faa6329926df48b82e68581

Emission

Basic primitives for g-code emission.

Supports formatting, checksum and line number generation.

Demo

See svg2gcode.

TODOs

Parse

  • g-code parameters
  • g-code infix notation

Emit

  • Remaining commonly-used commands (open an issue or create a PR if you need one that's missing)

References

Dependencies

~0.6–1MB
~18K SLoC