Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
NotificationsYou must be signed in to change notification settings

MakerPnP/gerber-parser

Repository files navigation

Build statusCrates.ioMakerPnP Discord

This crate implements agerber parser written in rust to be used with thegerber-types crate.

Example

See theexamples 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

SupportedFeatureNotes
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 attributesFull support, including .N, .P, .C, .CXxxx, etc
User defined attributes
Comment attributesSee spec 2024.5 - 5.1.1, 'G04 #@! ...*
Image Transformations (IP, MI, SF, OF, IR, AS)Yes, see below for details
Legacy/deprecated attributesPartial

Contributions to improve support welcomed!

Image Transformations

Image transformations have been deprecated since December 2012 (I1 revision).The intention of these commands is not entirely clear when it comes to rendering, since the spec talks aboutstep and repeat distances not being coordinate data; However, it doesn't make any sense to have a command calledMirror Image (MI) where the intention /appears/ to be to mirror the /entire/ image, which cannot be achieved unless youalso mirror step and repeat distances and apertures. Thus it is advised for downstream crates to apply imagetransformations to step and repeat distances and apertures when applying image transformations via (MI, SF, OF, IR).

The related crate 'gerber-viewer' (see below), creates an image transform matrix based on the image transformationcommands and applies them before rendering, but after primitive processing, resulting in a perfectly transformed imagewhich is always consistent. However, depending on the intention of the author of the gerber file and the tools they wereusing at the time that might not be "correct". Thus, as per the spec, it's best to avoid these commands entirely toavoid misinterpretation and/or manufacturing issues.

Refer to gerber spec 2024.05 sections 8.1.5 (IR), 8.1.7 (MI), 8.1.8 (OF), 8.1.9 (SF)

Related crates

Gerber Types

A rust crate for definition of gerber types in test.

Crates.io:https://crates.io/crates/gerber-typesGithub: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 non-deprecated gerber commands are now supported. License changed to MIT or APACHE.
  • 2025/07/11 - Support for deprecated commands added.

Authors

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

License

Available under APACHEor MIT licenses, the same as the gerber-types crate.

About

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

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp