%% Generate Antenna Gerber Files from PCB Stack
% Create a patch antenna with FR4 as a dielectric material using pcbStack object.

p = pcbStack;
d = dielectric('FR4');
p.Layers = {p.Layers{1},d,p.Layers{2}};
p.FeedLocations(3:4) = [1 3];
show(p)

%
% Use a Cinch SMA for feeding the antenna. Use the Mayhew Labs PCB viewer as the 3-D viewer. Change the file name of the Mayhew Writer services to antenna_design_file.

C = PCBConnectors.SMA_Cinch;
W = PCBServices.MayhewWriter;
W.Filename = 'antenna_design_file';

%
% Generate the Gerber-format files.

[A,g] = gerberWrite(p,W,C)

% Copyright 2020 The MathWorks, Inc.