Skip to content

tscircuit/gerbis

Repository files navigation

Gerbis (Gerber Toolkit)

Simple toolkit for working with PCB Gerber files (and associated drill files).

Gerber Job File Specification Gerber Layer Specification Official Gerber Test Files

Installation

npm install gerbis

Usage

import { parseGerber } from "gerbis"

parseGerber(`
G04 Ucamco ex. 1: Two square boxes*
%MOMM*%
%FSLAX26Y26*%
%TF.Part,Other,example*%
%LPD*%
%ADD10C,0.010*%
D10*
X0Y0D02*
M02*
`)
/*
[
  { command_code: 'G04', comment: ' Ucamco ex. 1: Two square boxes' },
  { command_code: 'MO', unit: 'MM' },
  {
    command_code: 'FS',
    x_integer_digits: 2,
    x_fractional_digits: 2,
    y_integer_digits: 2,
    y_fractional_digits: 6
  },
  { command_code: 'TF', name: '.Part', values: [Array] },
  { command_code: 'LP', setting: 'dark' },
  {
    command_code: 'AD',
    aperture_identifier: 'D10',
    type: 'circle',
    diameter: 0.01
  },
  { command_code: 'Dnn', aperture_identifier: 'D10' },
  { command_code: 'D02', x: 0, y: 0 },
  { command_code: 'M02' }
]
*/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published