Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nemoandrea/gerber-parser
Simple gerber parser meant to be used in conjuction with the gerber-types crate
https://github.com/nemoandrea/gerber-parser
gerber gerber-files parser
Last synced: 28 days ago
JSON representation
Simple gerber parser meant to be used in conjuction with the gerber-types crate
- Host: GitHub
- URL: https://github.com/nemoandrea/gerber-parser
- Owner: NemoAndrea
- License: agpl-3.0
- Created: 2022-06-27T18:56:51.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-07-19T20:55:05.000Z (over 2 years ago)
- Last Synced: 2024-03-15T09:07:48.838Z (9 months ago)
- Topics: gerber, gerber-files, parser
- Language: Rust
- Homepage: https://docs.rs/gerber_parser/latest/gerber_parser/
- Size: 50.8 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gerber-parser
A simple `gerber` parser written in rust to be used with the `gerber-types` crate.
```rust
use std::fs::File;
use std::io::{BufRead, BufReader};
use gerber_parser::parser::parse_gerber;// open a .gbr file from system
let file = File::open(path).unwrap();
let reader = BufReader::new(file);// Now we parse the file to a GerberDoc
let gerber_doc: GerberDoc = parse_gerber(reader);// it is possible to convert to an 'atomic' representation purely
// in terms of Vec of the gerber-types crate
let commands:Vec = gerber_doc.to_commands();
```### Current State
⚠️ Note: this package is still in development and does not cover the full Gerber spec
Currently missing
* All `AM` commands
* `LM`, `LR`, `LS`, `IP` commands (note: these are deprecated in the spec)
* `AB` commandsPartial:
* The `TF` and `TA` commands only support a limited range of arguments; custom attributes will result in an error
### General to-do
* Do proper coordinate check (compatibility with `format specification`)
* Test with output from more programs (I use f360 and that seems to work)