← Back to team overview

kicad-developers team mailing list archive

OT: Extracting board dimension from a Gerber board outline file.

 

Hi,
I need to produce a small application that can examine the contents of a board outline gerber file produced by PCBNEW.
The application needs to read the gerber file and extract the X and Y co-ordinates and spit out the actual board size.
Is it possible to extract a board size from the following Gerber file syntax for example?


G04 (created by PCBNEW-RS274X (2011-07-08 BZR 3044)-stable) date 01/11/2011 11:39:11*

G01*

G70*

G90*

%MOIN*%

G04 Gerber Fmt 3.4, Leading zero omitted, Abs format*

%FSLAX34Y34*%

G04 APERTURE LIST*

%ADD10C,0.006000*%

%ADD11C,0.015000*%

G04 APERTURE END LIST*

G54D10*

G54D11*

X46170Y-34610D02*

X46170Y-22790D01*

X63890Y-34610D02*

X46170Y-34610D01*

X63890Y-22790D02*

X63890Y-34610D01*

X46170Y-22790D02*

X63890Y-22790D01*

M02*



Which lines describe the actual top-left,top-right, bottom-left and bottom-right X and Y co-ordinates. All I need to end up with is a set of numbers from which I can calculate the actual length and width of a PCB (in inches (MILS) or mm). Can someone point me in the right direction? I would be very grateful for any assistance offered.Thanks.



David.







Follow ups