Customize PCB file generation for PCB manufacturing service
Use the PCBServices
object to customize printed circuit
board (PCB) file generation for a PCB manufacturing service.
creates a Gerber file based on the type of service specified in
w
= PCBServices.servicetype
servicetype
.
servicetype
— Type of service from PCB services packageType of service from PCB services package, specified as one of the following:
AdvancedCircuitsWriter – Configure Gerber file generation for Advanced Circuits manufacturing.
CircuitPeopleWriter – Configure Gerber file generation for CircuitPeople online viewer.
DirtyPCBsWriter – Configure Gerber file generation for Dirty PCBs manufacturing.
EuroCircuitsWriter – Configure Gerber file generation for EuroCircuits online viewer.
GerberLookWriter – Configure Gerber file generation for GerbLook online viewer.
GerberViewerWriter – Configure Gerber file generation for GerberViewer online viewer.
MayhewWriter – Configure Gerber file generation for Mayhew Labs online 3-D viewer.
OSHParkWriter – Configure Gerber file generation for OSH Park PCB manufacturing.
PCBWayWriter – Configure Gerber file generation for PCBWay PCB manufacturing.
ParagonWriter – Configure Gerber file generation for Paragon Robotics online viewer.
SeeedWriter – Configure Gerber file generation for Seeed Fusion PCB manufacturing.
SunstoneWriter – Configure Gerber file generation for Sunstone PCB manufacturing.
ZofzWriter – Configure Gerber file generation for Zofz 3-D viewer.
Example: w = PCBServices.SunstoneWriter
creates
Gerber files configured to use Sunstone PCB manufacturing
service.
w
— PCB manufacturing servicePCB manufacturing service, returned as an object.
BoardProfileFile
— File type for board profile'legend'
| 'profile'
File type for board profile, specified as 'legend'
or
'profile'
.
Example: w = PCBServices.SunstoneWriter
;
w.BoardProfileFile = 'profile'
.
Data Types: char
| string
BoardProfileLineWidth
— Width of line1
| positive scalarWidth of line, specified as a positive scalar in mils.
PCB manufacturers vary on board profile. The most common line width is zero of a fraction width in the chosen unit, for example, 0.1 mil.
Example: w = PCBServices.SunstoneWriter
;
w.BoardProfileLineWidth = 0.1
Data Types: double
CoordPrecision
— Precision of X and Y coordinates written to file[2 6]
| 1-by-2 vectorPrecision of X and Y coordinates written to file, specified as a 1-by2 vector [I F], where,
I – Number of digits in the integer part, 0<=I<=6.
F – Number of digits in the fractional part, 4<=F<=6.
Example: w = PCBServices.SunstoneWriter
;
w.CoordPrecision = [1 3]
Data Types: double
CoordUnits
— Units of X and Y coordinate'in'
| 'mm'
Units of X and Y coordinates, specified as inches or millimeters.
Example: w = PCBServices.SunstoneWriter
;
w.CoordUnits = 'mm'
Data Types: char
| string
CreateArchiveFile
— Creates single archive file with all Gerber files1
(default) | 0
Creates single archive file with all Gerber files, specified as
1
or 0
.
Example: w = PCBServices.SunstoneWriter
;
w.CreateArchiveFile = 0
Data Types: logical
DefaultViaDiameter
— Via drill diameter3.0000e-04
| positive scalarVia drill diameter, specified as a positive scalar in meters. PCB manufacturers also call it minimum drilling hole diameter.
Example: w = PCBServices.SunstoneWriter
;
w.DefaultViaDiameter = 0.1
Data Types: double
DrawArcsUsingLines
— Force arcs to be drawn using lines0
| 1
Force arcs to be drawn using lines, specified as 1
or
0
.
Example: w = PCBServices.SunstoneWriter
;
w.DrawArcsUsingLines = 0
Data Types: logical
ExtensionLevel
— Feature content for Gerber file format1
(default) | 2
Feature content for Gerber file format, specified as:
1
- Extension 1 is the most compatible
setting for downstream PCB manufacturing tools.
2
- Extension 2 adds file attributes
%TF.<attr>*%"
to the header and footer
of Gerber files.
Example: w = PCBServices.SunstoneWriter
;
w.ExtensionLevel = 2
Data Types: double
Filename
— Name of all files containing Gerber design'untitled'
(default) | character vectorName of all files containing Gerber design, specified as a character vector.
Example: w = PCBServices.SunstoneWriter
;
w.Filename = 'antenna_design'
.
Data Types: char
| string
Files
— Define stack of PCB filesDefine stack of PCB files, specified as a character vector. This definition includes:
Multiples files describing one PCB.
A "file" as a memory object containing buffers that describe or hold the file content before the file is written.
Cell vector of Gerber.FileFunction
objects,
one per file.
Data Types: cell
| char
| string
IncludeRootFolderInZip
— Include top-level folder in zip archive1
| 0
Include top-level folder in zip archive, specified as 1
or 0
.
Example: w = PCBServices.SunstoneWriter
;
w.IncludeRootFolderInZip = 0
Data Types: logical
PostWriteFcn
— Function to invoke after a successful write operationFunction to invoke after a successful write operation, specified as a
function handle. In this case, it is the sendTo
function. This property makes sure that the location of the Gerber files and
the website of the manufacturing service is open after a successful write
function.
Example: w = PCBServices.SunstoneWriter
;
w.PostWriteFcn = @(obj)sendTo(obj)
Data Types: function_handle
SameExtensionForGerberFiles
— Use .gbr
to be file extension for all Gerber files0
| 1
Use .gbr
to be file extension for all Gerber files,
specified as 0
or 1
.
Example: w = PCBServices.SunstoneWriter
;
w.SameExtensionForGerberFiles = 1
Data Types: logical
UseExcellon
— Generate Excellon drill files1
| 0
Generate Excellon drill files, specified as 0
or
1
.
Example: w = PCBServices.SunstoneWriter
;
w.UseExcellon = 1
, generates Gerber format drill
files with 'x2'
extension.
Data Types: logical
Create a coplanar inverted F antenna.
fco = invertedFcoplanar('Height',14e-3,'GroundPlaneLength', 100e-3, ... 'GroundPlaneWidth', 100e-3);
Use this antenna in creating a PCB stack object.
p = pcbStack(fco); figure; show(p)
Use a Mayhew Writer with a profile
board for viewing the PCB in 3D.
s = PCBServices.MayhewWriter;
s.BoardProfileFile = 'profile'
s = MayhewWriter with properties: BoardProfileFile: 'profile' BoardProfileLineWidth: 1 CoordPrecision: [2 6] CoordUnits: 'in' CreateArchiveFile: 0 DefaultViaDiam: 3.0000e-04 DrawArcsUsingLines: 1 ExtensionLevel: 1 Filename: 'untitled' Files: {} IncludeRootFolderInZip: 0 PostWriteFcn: @(obj)sendTo(obj) SameExtensionForGerberFiles: 0 UseExcellon: 1
Create an antenna design file using PCBWriter
.
PW = PCBWriter(p,s);
Use the gerberWrite
method to create Gerber files from the antenna design files.
gerberWrite(PW)
The location of the folder and the Mayhew labs website opens automatically.
To view the board, drag and drop the files. Click Done.
You have a modified version of this example. Do you want to open this example with your edits?