Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

68 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gerb4j - A Gerber X2 & X3 library for Java

A standards-compliant library for interacting with Gerber (RS-274X) X2 and X3 format files, written in Java.

CI

📖 API Javadoc

Usage

gerb4j is published to GitHub Packages. You will need to configure your build tool to use the GitHub Packages Maven registry.

Maven

Add the repository to your pom.xml (or your ~/.m2/settings.xml):

<repositories>
  <repository>
    <id>github</id>
    <url>https://maven.pkg.github.com/bvarner/gerb4j</url>
  </repository>
</repositories>

Then add the dependency:

<dependency>
  <groupId>com.varnernet</groupId>
  <artifactId>gerb4j</artifactId>
  <version>0.0.1-SNAPSHOT</version>
</dependency>

Gradle

Add the repository to your build.gradle:

repositories {
    maven {
        url = uri("https://maven.pkg.github.com/bvarner/gerb4j")
        credentials {
            username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
            password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
        }
    }
}

Then add the dependency:

implementation 'com.varnernet:gerb4j:0.0.1-SNAPSHOT'

Note: GitHub Packages requires authentication even for public packages. You will need a personal access token with read:packages scope.

Project History

In my efforts to excel in at-home PCB fabrication with a home-built CNC mill I have had the overwhelming feeling that the majority of the F/OSS software which exists in this space is of sub-par quality.

My Analysis of this predicament is based upon several projects. My observations are as follows:

  • Nearly all of the software in this space seems to be written in Python. This is not an indictment of the language.
  • The projects live in an eternal state of 'beta', some bragging about that.
  • You cannot obtain a pre-built package of the software and expect it to work.
  • Most of them do not have automated build / test systems in their source repositories.
  • Platform requirements are fragile at best while best practices for software development seem to be no consideration at all. It's amateur hour out there.

Ultimately, my conclusion can be summed up thusly: I do not want to fight someone else's poorly engineered hobby project in order to produce my own hobby project. :-)

After attempting to make several pull requests and improvements to 'swiss army chain-saw' style projects that try to be 'everything in one place' and manage to be almost as good as mediocre at nearly everything, I decided it was time to apply some disciplined best practices to the problem space with my own sense of flair.

Being most familiar with GUI / Graphics programming in a cross-platform setting with Java, and knowing the toolsets and ways to apply best practices to the development process in that ecosystem, I set to solve my problems one functionality domain at a time.

The first problem for any software in the PCB space is being able to read / render / and interact with a Gerber file. So here we start.

After reading through the Ucamco specs, it was apparent the easiest way to go about this was going to be using a PEG parser and porting the TatSu (a Python toolset) PEG format over to something that would work well with Java. I found Parboiled to be a fantastic candidate for that. After settling on a tool and process, I was able to get the PEG ported over and passing basic parse tests within a few hours.

License

This project is licensed under the MIT License.

About

A library for interacting with Gerber X2 files in Java

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages