Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/birkenfeld/ngc
G-code/CNC library in Rust
https://github.com/birkenfeld/ngc
Last synced: 3 months ago
JSON representation
G-code/CNC library in Rust
- Host: GitHub
- URL: https://github.com/birkenfeld/ngc
- Owner: birkenfeld
- License: apache-2.0
- Created: 2019-04-10T05:15:15.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-03-04T19:20:40.000Z (almost 3 years ago)
- Last Synced: 2024-10-10T16:09:43.031Z (3 months ago)
- Language: Rust
- Size: 92.8 KB
- Stars: 6
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
Awesome Lists containing this project
README
# ngc - G-Code parser/evaluator for Rust
[![Build Status](https://travis-ci.org/birkenfeld/ngc.svg?branch=master)](https://travis-ci.org/birkenfeld/ngc)
[![Build Status](https://docs.rs/ngc/badge.svg)](https://docs.rs/ngc)
[![crates.io](http://meritbadge.herokuapp.com/ngc)](https://crates.io/crates/ngc)**Work in progress!**
Currently, only the parser is functional.
## Documentation
[Module documentation](https://docs.rs/ngc) 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.```rust
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),
}
}
```