Importing Gerber X3 files into OpenPnP

123 views
Skip to first unread message

tonyl...@gmail.com

unread,
Jun 30, 2025, 3:56:41 PM6/30/25
to OpenPnP
I am working on an OpenPnP importer for Gerber X3 files. KiCad already has the ability to export designs in Gerber X3 format and that is what I have been using for testing. I'm about done but would like to test with some files from other ECAD programs is possible. If you use an ECAD package (other than KiCad) that can export in Gerber X3 format, and you don't mind sharing your design files; could you zip up the resulting Gerber files and share them with me? I promise to not share the files with anyone else. Note, it is important that the exported files are really in the X3 format as that is where the placement data is held.

Just FYI, Gerber is an open (and free) published standard used by just about everybody in the PCB business, see the latest Gerber Layer Format Specification.

Thanks,
Tony

JW

unread,
Jul 1, 2025, 12:09:20 PM7/1/25
to OpenPnP
I can't help directly, but it may be worth sending an email to Altium, OrCAD, Allegro etc - I'd be very surprised if they weren't happy to send you sample files.

Jon Elson

unread,
Jul 2, 2025, 10:53:31 AM7/2/25
to OpenPnP

I don't know Altium Designer, but I do use their earlier Protel 99, and it outputs a pick and place file as plain ASCII text.
It contains a bunch of fields, but the important ones are designator (R101) part type (100Ohm0805) and X, Y and rotation.
I wrote converter programs in C to read this file and output placement files in the format required by my old Philips CSM84 and my slightly newer Quad QSA30 machine.
I am pretty sure Altium produces a very similar file.

tonyl...@gmail.com

unread,
Jul 2, 2025, 12:47:57 PM7/2/25
to OpenPnP
Jon,

Thanks for the info, but I'm specifically looking for Gerber X3 files.

Zdenko Stanec

unread,
Jul 2, 2025, 4:52:22 PM7/2/25
to OpenPnP
Hi Tony,

I might be able to convert any standard Gerber data and odb++ data to Gerber X3 with a tool I use on work for DFM, ...if this helps somehow.

Also, I can maybe help with Altium files, will check tomorrow.

Zdenko,

tonyl...@gmail.com

unread,
Jul 2, 2025, 5:16:39 PM7/2/25
to OpenPnP
Hi Zdenko,

Yeah, if you could convert obd++ to Gerber X3 that would be useful. Converting "standard" Gerber probably not so much as anything before X3 wouldn't contain any placement data.

Thanks,
Tony

Zdenko Stanec

unread,
Jul 3, 2025, 2:51:55 AM7/3/25
to OpenPnP
Hi Tony,

Please check the attached Gerber X3 files for a simple 2L PCBA, I converted ODB++ files from Altium Designer export to Gerber X3.

Later I can try directly exporting Gerber X3 from Altium, but you can try this first.

P.S. Some layers are empty as we use them as a "standard place holder".

Zdenko,
Gerber X3_Test.zip

tonyl...@gmail.com

unread,
Jul 3, 2025, 6:11:20 PM7/3/25
to OpenPnP
Hi Zdenko,

I had a few problems but was able to import the Gerber files you provided. Here is a screen shot showing the placements table for the board:

ZdenkoTest1_OpenPnP.png

And here's a screen shot showing it in the Board Viewer:
ZdenkoTest1_BoardViewer.png

Now for the problems (and I believe these are all problems with the SW that wrote the Gerber files not with my reader):
  • The files are missing some of the attributes that are mandatory per chapter 6 of the Gerber Layer Format Specification, Revision 2024.05. All of the files are missing the .FilePolarity and .SameCoordinates attributes. In addition, two of the files are missing the .FileFunction attribute (bottom_surface_finish.gbr and top_surface_finish.gbr). For importing into OpenPnP, the .FilePolarity attribute is not really all that important, so I wasn't even checking for it. However, I was using the .SameCoordinates attribute to verify that all the files belonged to the same design. I added a workaround to ignore the check if the attribute is not specified. The .FileFunction attribute is very important, so I added a workaround to check for it and skip the file if it is not present.
  • Many attribute values are enclosed in double quotation marks. This is unnecessary and erroneous (curiously, early versions of KiCad's Gerber X3 exporter made the same mistake). For instance, the reference designator string for R14 in the Gerber file comp_+_top.gbr is "R14". Since double quotation marks are valid characters in Gerber strings, that means the reference designator actually includes the leading and trailing double quotes, so it consists of the five characters: '"", 'R', '1', '4', and '"' and not just the three characters 'R', '1', and '4'. I worked around this by adding a check for leading and trailing double quotation marks which removes them when found.
  • The component pads on the copper layers should have a .P attribute attached to them identifying the component reference designator and pin for each pad. These are used when automatically generating the footprint for each package. There is no real workaround for this other than to not generate footprints when they are not present
I'd be interested to see if Altium exports in the same way.

Thanks,
Tony

Zdenko Stanec

unread,
Jul 4, 2025, 6:32:19 AM7/4/25
to OpenPnP
Hi Tony,

I checked the Altium Designer export now, and also checked with our EHW Librarians in the company, it seems that even the latest Altium Designer still does not fully support Gerber X3 Export.

Sharing Gerber X2 export directly from the latest Altium Designer, it is the only option currently supported. (if it is of any help or for testing), 

Zdenko,
AltiumDesigner_Gerber_X2_ BMS_Adpt_10kPU-x14.zip

tonyl...@gmail.com

unread,
Jul 4, 2025, 11:43:11 AM7/4/25
to OpenPnP
Hi Zdenko,

I can import the X2 files but since only X3 files contain placement data, the only thing that gets imported is the board outline. I was able to verify that they do include the three mandatory file attributes I mentioned in my previous post so that is good news.

Thanks,
Tony

Reply all
Reply to author
Forward
0 new messages