Main Content

gerberRead

Create PCBReader object with specified Gerber and drill files

Since R2020b

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.

example

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

example

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.

Examples

collapse all

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

P = gerberRead("antenna_design_file.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.

Import a bottom layer Gerber file to layer 4 of the stack.

P = gerberRead([],"UWBVivaldi.gbl");
P.StackUp
ans = 
  stackUp with properties:

    NumLayers: 5
       Layer1: [1x1 dielectric]
       Layer2: []
       Layer3: [1x1 dielectric]
       Layer4: "UWBVivaldi.gbl"
       Layer5: [1x1 dielectric]

Use the gerberRead function to import top and bottom layer Gerber files.

P = gerberRead("antenna_design_file.gtl","antenna_design_file.gbl");

Display the stack.

P.StackUp
ans = 
  stackUp with properties:

    NumLayers: 5
       Layer1: [1x1 dielectric]
       Layer2: "antenna_design_file.gtl"
       Layer3: [1x1 dielectric]
       Layer4: "antenna_design_file.gbl"
       Layer5: [1x1 dielectric]

Modify the third layer in the stack, which is the dielectric layer between the top and bottom metal layers.

S = P.StackUp;
S.Layer3 = dielectric(Name="FR4", EpsilonR=4.4, Thickness=0.8e-3);
P.StackUp = S;

Create the antenna model by calling the pcbStack object on the PCB reader.

pb2 = pcbStack(P);
figure
show(pb2)

Figure contains an axes object. The axes object with title pcbStack antenna element, xlabel x (mm), ylabel y (mm) contains 8 objects of type patch, surface. These objects represent PEC, feed, FR4.

Input Arguments

collapse all

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

Example: gerberRead("Filetop.gtl");

Bottom layer Gerber file, specified as a character vector or string scalar. The file should 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");

Output Arguments

collapse all

Read Gerber and drill files, 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 R2020b