16 unstable releases (4 breaking)

0.5.1 Sep 9, 2024
0.4.2 Apr 6, 2024
0.4.1 Mar 9, 2024
0.3.6 Nov 19, 2023
0.0.1 Feb 14, 2021

#516 in Parser implementations

Download history 13/week @ 2024-08-12 4/week @ 2024-08-19 15/week @ 2024-08-26 106/week @ 2024-09-02 287/week @ 2024-09-09 53/week @ 2024-09-16 121/week @ 2024-09-23 27/week @ 2024-09-30 17/week @ 2024-10-07 27/week @ 2024-10-14 11/week @ 2024-11-04 130/week @ 2024-11-11 33/week @ 2024-11-18 15/week @ 2024-11-25

189 downloads per month
Used in 3 crates

MIT/Apache

87KB
2K 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–8MB
~60K SLoC