| Crates.io | gerber-types |
| lib.rs | gerber-types |
| version | 0.6.0 |
| created_at | 2017-06-09 23:54:28.22566+00 |
| updated_at | 2025-07-11 11:29:33.68945+00 |
| description | Types and code generation for Gerber files (RS-274X). |
| homepage | https://github.com/MakerPnP/gerber-types |
| repository | https://github.com/MakerPnP/gerber-types |
| max_upload_size | |
| id | 18394 |
| size | 246,230 |
This crate implements the basic building blocks of Gerber X2 (compatible with Gerber RS-274X) code. It focuses on the low-level types (to be used like an AST) and code generation and does not do any semantic checking.
For example, you can use an aperture without defining it. This will generate syntactically valid but semantically invalid Gerber code, but this module won't complain.
Current Gerber X2 spec: gerber-layer-format-specification-revision-2024-05_en.pdf
You can find an example in the examples directory.
This library has a low-level focus and is quite verbose. Other external crates can provide a high-level API.
To generate Gerber code for that example:
$ cargo run --example polarities-apertures
A rust crate for parsing gerber files that uses this crate as a dependency:
Crates.io: https://crates.io/crates/gerber-parser Github: https://github.com/MakerPnP/gerber-parser
A rust crate for rendering gerber layers, also uses this crate as a dependency:
Github: https://github.com/MakerPnP/gerber-viewer
For a list of other projects that use this crate you can check the github 'dependents' page.
https://github.com/MakerPnP/gerber-types/network/dependents
See the contributors page on github for full list.
Licensed under either of the following licenses, at your option.