function p = gerberRead(T,B,D)
%GERBERREAD Create a PCBReader with top and bottom layer gerber and drill files
% P = GERBERREAD(T) Creates a PCBReader object with the top-layer(T) gerber
% file populated in the stack up.
%
% P = GERBERREAD(T, B) Creates a PCBReader object with the top-layer(T),and
% bottom-layer(B), gerber files populated in the stack up.
%
% P = GERBERREAD(T,B,D)  Creates a PCBReader object with the top-layer(T),
% bottom-layer(B) gerber file populated in the stack up and the drill
% file(D) specified.

% Copyright 2020 The MathWorks, Inc.

p = PCBReader;
s = p.StackUp;
if ~isempty(T)
    s.Layer2 = T;
end
if nargin>1 && ~isempty(B)
    s.Layer4 = B;
end

if nargin>2 && ~isempty(D)
    p.DrillFile = D;
end

p.StackUp = s;
end

