Skip to content
/ ngc Public
forked from birkenfeld/ngc

G-code/CNC library in Rust

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

kcalden/ngc

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ngc - G-Code parser/evaluator for Rust

Build Status Build Status crates.io

Work in progress!

Currently, only the parser is functional.

Documentation

Module documentation is hosted on docs.rs.

Examples

The following code (the same as the "ngc-parse" demo binary) takes a file as an argument, parses it and outputs the display form, which is the same G-code, but in a consistent format and cleaned of comments.

use std::{env, fs};
use ngc::parse::parse;

fn main() {
    let filename = env::args().nth(1).unwrap();
    let input = fs::read_to_string(&filename).unwrap();

    match parse(&filename, &input) {
        Err(e) => eprintln!("Parse error: {}", e),
        Ok(prog) => println!("{}", prog),
    }
}

About

G-code/CNC library in Rust

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%