binarygcode 0.0.3

A Rust implementation of libbgcode to serialise and deserialise binary gcode.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::{env, fs};

use binarygcode::ascii_to_binary;

fn main() {
    // Create the path to the gcode file
    let mut path = env::current_dir().unwrap();
    path.push("test_files");
    path.push("mini_cube_b.gcode");

    let gcode = fs::read_to_string(path).unwrap();
    let binary = ascii_to_binary(&gcode).unwrap();
    println!("gcode: {}, binary: {}", gcode.len(), binary.len());

    fs::write("tmp/mini_cube_b.bgcode", binary.as_ref()).unwrap();
}