#pcb #cad #cam #gerber #rs274x


Types and code generation for Gerber files (RS-274X)

4 releases (2 breaking)

0.3.0 Jul 5, 2022
0.2.0 Jan 6, 2021
0.1.1 Jun 10, 2017
0.1.0 Jun 9, 2017

#1 in #pcb

Download history 22/week @ 2022-11-27 20/week @ 2022-12-04 22/week @ 2022-12-11 16/week @ 2022-12-18 18/week @ 2022-12-25 17/week @ 2023-01-01 17/week @ 2023-01-08 16/week @ 2023-01-15 24/week @ 2023-01-22 34/week @ 2023-01-29 25/week @ 2023-02-05 24/week @ 2023-02-12 23/week @ 2023-02-19 14/week @ 2023-02-26 19/week @ 2023-03-05 24/week @ 2023-03-12

84 downloads per month
Used in 2 crates


2.5K SLoC

Rust Gerber Library

Build status Crates.io

This crate implements the basic building blocks of Gerber X2 (compatible with Gerber RS-274X) code. It focusses 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 semantially invalid Gerber code, but this module won't complain.

The plan is to write a high-level wrapper library on top of this. Early drafts are in progress but the design isn't fixed yet.

Current Gerber X2 spec: https://www.ucamco.com/files/downloads/file/81/the_gerber_file_format_specification.pdf


You can find an example in the examples directory. It's still quite verbose, the goal is to make the API a bit more ergonomic in the future. (This library has a low-level focus though, so it will never get a high-level API. That is the task of other libraries.)

To generate Gerber code for that example:

$ cargo run --example polarities-apertures


Licensed under either of

at your option.


~50K SLoC