An open API service indexing awesome lists of open source software.

https://github.com/makerpnp/gerber-parser

Simple gerber parser meant to be used in conjuction with the gerber-types crate
https://github.com/makerpnp/gerber-parser

gerber gerber-files parser

Last synced: 7 months ago
JSON representation

Simple gerber parser meant to be used in conjuction with the gerber-types crate

Awesome Lists containing this project

README

          

# Rust Gerber Parser
[![Build status][build-status-badge]][build-status]
[![Crates.io][crates-io-badge]][crates-io]
[![MakerPnP Discord][discord-badge]][discord]

- [Docs (released)](https://docs.rs/gerber-parser/)

This crate implements a `gerber` parser written in rust to be used with the `gerber-types` crate.

## Example

See the `examples` folder of the repository, run it as follows:

$ cargo run --example example1

## Spec compliance

The gerber specification 2024.05 is the latest version of the Gerber file format that is used for reference.

### Supported gerber features

| Supported | Feature | Notes |
|-----------|----------------------------------|-------------------------------------------------|
| ✅ | Comments (G04) | |
| ✅ | Units (MO) | |
| ✅ | Format specification (FS) | |
| ✅ | Aperture definition (AD) | |
| ✅ | Standard aperture templates | |
| ✅ | Aperture macros (AM) | |
| ✅ | Select aperture (Dnn) | |
| ✅ | Plot state (G01, G02, G03, G75) | |
| ✅ | Operations (D01, D02, D03) | |
| ✅ | Transformations (LP, LM, LR, LS) | |
| ✅ | Regions (G36/G37) | |
| ✅ | Block aperture (AB) | |
| ✅ | Step repeat (SR) | |
| ✅ | End-of-file (M02) | |
| ✅ | File attributes (TF) | |
| ✅ | Aperture attributes (TA) | |
| ✅ | Object attributes (TO) | |
| ✅ | Delete attribute (TD) | |
| ✅ | Standard attributes | Full support, including .N, .P, .C, .CXxxx, etc |
| ✅ | User defined attributes | |
| ❌ | Comment attributes | See spec 2024.5 - 5.1.1, 'G04 #@! ...* |
| ✅ | Legacy/deprecated attributes | Partial |

Contributions to improve support welcomed!

## Related crates

### Gerber Types

A rust crate for definition of gerber types in test.

Crates.io: https://crates.io/crates/gerber-types
Github: https://github.com/MakerPnP/gerber-types

### Gerber Viewer

A rust crate for rendering gerber layers, also uses this crate as a dependency:

Github: https://github.com/MakerPnP/gerber-viewer

## Related projects

For a list of other projects that use this crate you can check the github 'dependents' page.

https://github.com/MakerPnP/gerber-parser/network/dependents

## Timeline

- 2022/06/27 - Initial version by Nemo Adrea, licensed on AGPL.
The original author used f360, the initial implementation was written to support files it generated.
- 2024/04/23 - Crate went under heavy development to broaden the support for Gerber files, e.g. ones generated by KiCad, DipTrace,
LibrePcb, etc.
- 2025/05/05 - gerber-types crate transferred to the MakerPnP organization, primary maintainer is now Dominic Clifton
- 2025/06/04 - gerber-parser crate transferred the repository to the MakerPnP organization, primary maintainer is now Dominic Clifton.
- 2025/06/13 - All gerber commands are now supported. License changed to MIT or APACHE.

## Authors

* Nemo Andrea (Original author)
* Dominic Clifton (Current maintainer)

## License

Available under APACHE *or* MIT licenses, the same as the gerber-types crate.

* [APACHE](LICENSE-APACHE)
* [MIT](LICENSE-MIT)

[build-status]: https://github.com/makerpnp/gerber-parser/actions/workflows/ci.yml
[build-status-badge]: https://github.com/makerpnp/gerber-parser/workflows/CI/badge.svg
[crates-io]: https://crates.io/crates/gerber-parser
[crates-io-badge]: https://img.shields.io/crates/v/gerber-parser.svg
[discord]: https://discord.gg/ffwj5rKZuf
[discord-badge]: https://img.shields.io/discord/1255867192503832688?label=MakerPnP%20discord&color=%2332c955