Crates.io | binarygcode |
lib.rs | binarygcode |
version | 0.0.3 |
created_at | 2025-03-30 09:18:10.209203+00 |
updated_at | 2025-05-09 07:53:54.152994+00 |
description | A Rust implementation of libbgcode to serialise and deserialise binary gcode. |
homepage | |
repository | https://github.com/jamesgopsill/binarygcode |
max_upload_size | |
id | 1612202 |
size | 65,690 |
A no_std
+ alloc
rust library and binary (CLI) to deserialise and serialise binary gcode (.bgcode
) files. The binary gcode specification can be found here.
Please consider supporting the crate by:
Examples can be found in the examples
folder. Below is an example of reading the headers
use std::{env, fs};
use binarygcode::binary_to_ascii;
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.bgcode");
let binary = fs::read(path).unwrap();
let gcode = binary_to_ascii(&binary, true).unwrap();
println!(
"Binary Length: {}, ASCII Lenght: {}",
binary.len(),
gcode.len()
);
fs::write("tmp/ascii.gcode", gcode.as_ref()).unwrap();
}