PCBServices
Description
Use the PCBServices
object to customize printed circuit board
(PCB) file generation for a PCB manufacturing service.
Creation
Description
creates a Gerber file based on the type of service specified in
w
= PCBServices.serviceType
serviceType
.
Input Arguments
serviceType
— Type of service from PCB services package
character vector
Type 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.
Output Arguments
w
— PCB manufacturing service
object
PCB manufacturing service, returned as an object.
Properties
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 line
1
| positive scalar
Width 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 vector
Precision 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 files
1
(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 diameter
3.0000e-04
| positive scalar
Via 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 lines
0
| 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 format
1
(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 vector
Name of all files containing Gerber design, specified as a character vector.
Example: w = PCBServices.SunstoneWriter
;
w.Filename = 'pcb_design'
.
Data Types: char
| string
Files
— Define stack of PCB files
character vector
Define 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 archive
1
| 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 operation
function handle (default)
Function 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 files
0
| 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 files
1
| 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
Examples
Generate Gerber Format Files for PCB Component
Create a PCB component with default values.
p = pcbComponent;
Use 2 Cinch SMA connectors and the Mayhew Labs PCB viewer.
W = PCBServices.MayhewWriter; C1 = PCBConnectors.SMA_Cinch; C2 = PCBConnectors.SMA_Cinch;
Generate the Gerber-format files.
[A,g] = gerberWrite(p,W,{C1,C2})
A = PCBWriter with properties: Design: [1x1 struct] Writer: [1x1 PCBServices.MayhewWriter] Connector: {[1x1 PCBConnectors.SMA_Cinch] [1x1 PCBConnectors.SMA_Cinch]} UseDefaultConnector: 0 ComponentBoundaryLineWidth: 8 ComponentNameFontSize: [] DesignInfoFontSize: [] Font: 'Arial' PCBMargin: 5.0000e-04 Soldermask: 'both' Solderpaste: 1 See info for details
g = '/tmp/Bdoc24b_2725827_2091970/tpda353a1d/rfpcb-ex06685827/untitled'
Version History
Introduced in R2021b
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)