KLayout 0.29.8 (2024-11-26 926dac96c) [master]

Import Gerber PCB Files

Gerber PCB import allows creating GDS layout data from Gerber PCB files or to add Gerber files to GDS files as new layers. The import function supports a majority of the RS274X features for artwork files and a couple of different formats for the drill files. The importer will take a set of files and convert them to layout geometry. The importer offers some functionality to adjust the data appropriately, i.e. to define output layers and apply geometrical transformations. Another basic capability is to merge the geometry of a layer to remove overlaps and join paths into larger polygons.

Because of the manifold options, the import specification can become pretty complex. Therefore, it can be saved into a file (suggested suffix is ".pcb") in XML format which contains the importer specifications. Once such a file is created, KLayout can read this file like usual stream files (i.e. it can be specified on the command line) and use it as a recipe to import the associated Gerber files.

The PCB import function is available in the "File" menu ("Import/Gerber PCB"). Different entry points are provided that start a new project, open an existing project or to continue with the last project.

The basic workflow to import PCB data is:

The basic decision is how to specify the layer mapping. In free mode, the specification requires these steps:

In layer stack mode, the specification workflow consists of these steps:

The import dialog

The import dialog is organized in multiple pages that reflect the workflow for the import specification. On every page, the "File" menu button allows saving the current settings as a PCB import project, to open an existing project or to create a new project and to restart from scratch.

The first page offers some basic options:

The layer stack flow

In the layer stack flow, on the first page, a sequence of metal and via layers must be specified. The assignment of metal and via layers is done automatically. The sequence is always a metal layer followed by a via layer. The number of layers must be odd so the last layer is a metal layer again. Via layers will connect the adjacent metal layers only.

Use the "+" button to add new layers. Move layers by selecting them and moving them up or down with the arrow buttons. Use the "X" button to remove all selected layers.

On the next page, the number of artwork and drill files needs to be specified. Later, the actual files need to be entered and assigned to metal or via layers. In addition the chip mounting position needs to be specified. In "top mounting" mode, it is assumed that the chip is placed surface down on the top (first) PCB layer. Thus the first metal above the chip stack will be the top PCB layer. In "bottom mounting" mode, the last PCB metal layer will be the first metal layer above the chip stack.

On the "Artwork Files" page, the artfile file names must be entered. They are automatically assigned to the respective metal layers. The assignment order depends on the mounting mode.

On the "Drill Files" page, the drill file names must be entered. Each drill file describes a certain drill step, which can connect multiple metal layers. On this page, this specification must be made. The first and last metal layer connected by the plated hole must be specified. The corresponding via layers will then be used to create via shapes.

The free layer mapping flow

On the "Files" page, all PCB data files must be specified. This includes artwork and drill files. The order is not important but it is recommended to follow the physical stacking. This simplifies the assignment to GDS layers later. Use the arrow buttons to move the selected entries up or down. Use the "X" button to delete files from the list and use the "+" button to add new files.

On the "Layout Layers" page all target layers must be specified. Provide a list with all layers that are used as target layers for the import. Again, the order is not important but maintaining a technological order will simplify the assignment in the next step. As on the previous page use the arrow buttons to move selected entries and the "+" and "X" button to add new entries and deleted the selected ones.

On the "Layer Mapping" page, each file can be assigned to one or may GDS layers. The assignment is described in form of a matrix where an "x" means that the file or layer given by the row is imported into the layer given by the column. A file can be imported into multiple layers which basically will duplicate the shapes. Click at the boxes to set or reset the mark. Use the "X" button on the left to reset all marks for the rows selected.

General options

The "Coordinate Mapping" page allows specification of the transformation of the PCB data into the GDS space. Since PCB and GDS rarely share the origin, a transformation can be specified which is applied to the shapes when importing them.

A specification can be made in two ways:

Hint: Both specifications can be combined, i.e. one coordinate pair can be given to define the displacement and the rotation can be specified explicitly.

Finally, on the "Options" page, various options can be set: