Contenido principal

gerberRead

R2026b

Create PCBReader object with specified Gerber files and drill files

Description

P = gerberRead(T) creates a PCBReader object with the top layer Gerber file specified in T.

Note

The PCBReader object reads RS-274X Gerber files. It does not support RS-274D Gerber files.

example

P = gerberRead([],B) creates a PCBReader object with the bottom layer Gerber file specified in B.

P = gerberRead(T,B) creates a PCBReader object with the specified top and bottom layer Gerber file names.

P = gerberRead(T,B,D) creates a PCBReader object with the specified top and bottom layer Gerber files and the drill file specified in D.

P = gerberRead({M1,...,MN}) creates a PCBReader object with N metal layers. Each MN specifies a Gerber file for a metal layer with layers ordered based on their position in the cell array.

P = gerberRead({M1,...,MN},{D1,[fromLayer1,toLayer1];...;DN,[fromLayerN,toLayerN]}) creates a PCBReader object with metal layers and drill files. Each DN specifies a drill file (.drl or.txt). [fromLayer, toLayer] defines the connectivity of each drill. This syntax supports multiple vias and layer connectivity definitions.

Examples

collapse all

Use the gerberRead function to import a top layer Gerber file.

P = gerberRead('interdigital_Capacitor.gtl');

Extract the metal layer from the file using the shapes function.

s = shapes(P);

View the top metal layer.

show(s)

Figure contains an axes object. The axes object with xlabel x (mm), ylabel y (mm) contains 2 objects of type patch. These objects represent PEC, mypolygon.

Input Arguments

collapse all

Top layer Gerber file, specified as a character vector or string scalar. The file must be saved as a GTL file.

Example: gerberRead('Filetop.gtl');

Bottom layer Gerber file, specified as a character vector or string scalar. The file must be saved as a GBL file.

Example: gerberRead([],'FileBottom.gbl');

Drill file, specified a character vector or string scalar. You can specify either a DRL or a TXT file.

Example: gerberRead('Filetop.gtl','FileBottom.gbl','FileDrill.txt');

Gerber files for metal layers, specified as a cell array.

Example: {"Layer1.gbr","Layer2.gbr","Layer3.gbr"}

Data Types: cell

Drill files and their corresponding layer connections, specified as a cell array. Each [fromLayer,toLayer] pair specifies the metal layers the drill connects, using metal-layer indices.

Example: {"through_hole.drl",[1,6];...;"blind_via.drl",[2,3]}

Data Types: cell

Output Arguments

collapse all

Gerber and drill files read, returned as a PCBReader object.

Limitations

Limitations of the gerberRead function while reading a .gtl or .gbl file are:

CommandDescriptionComments
TFFile AttributesCommand is ignored and no error is thrown
TAAperture AttributesCommand is ignored and no error is thrown
TOObject AttributesCommand is ignored and no error is thrown
TDDelete AttributesCommand is ignored and no error is thrown

Cut-ins are not supported.

Version History

Introduced in R2021b

expand all