The purpose of the CAM support is to provide an unified interface to export a a board in different file formats using different exporter plugins. The interface consists of a CLI layer (each export plugin's "cam" option) and an optional GUI (the CAM plugin).
Each CAM-plugin-compatible exporter plugin offers an option called "cam". The syntax and capabilities are the same for all exporter's cam option.
The syntax is:
outfile=layergrp[,layergrp,...]
where:
When supplements are specified, it's a comma separated list of key=value pairs. Available supplements are:
Examples:
directive | explanation |
---|---|
bot.gbr=@bottom_copper,@bottom_silk | export layer groups called bottom_copper and bottom_silk (by group name) |
asm=top-assy | export the top assembly group, by type |
fabrication.ps=fab | export any fab layer group, by type |
gnd=copper:2 | export the second copper layer group from the top (the first internal copper layer group under the top copper layer group, if it is a multilayer board; for 2 layer boards this will be the bottom copper layer group) |
gnd=intern-copper:1 | similar to the above, but addresses the first internal copper layer group explicitly so it can not end up being the bottom copper layer group |
pwr=copper:-2 | export the second copper layer group from the bottom (the first internal copper layer group above the bottom copper layer group, if it is a multilayer board; for 2 layer boards this will be the top copper layer group) |
gnd=intern-copper:-1 | similar to the above, but addresses the last internal copper layer group explicitly so it can not end up being the top copper layer group |
pst.gbr=top-paste(bloat=0.1mm),bottom-paste(bloat=0.1mm) | export the top and bottom paste groups in the same file with all objects bloated up by 0.1mm |
plated_drills.cnc=virtual(purpose=pdrill) | export plated drilled holes (padstack side effects, but no slots) |
unplated_drills.cnc=virtual(purpose=udrill) | export unplated drilled holes (padstack side effects, but no slots) |
If multiple layer groups match a layergrp specification, all matching layer groups are exported. If the file name is a static string, they are all merged. If the file name is templated, it is possible to export the layer groups in multiple files. For example:
directive | explanation |
---|---|
copper.gbr=copper | export all copper layers to copper.gbr |
copper-%top_offs%.gbr=copper | export all copper layers to numbered copper-N.gbr files where N is the offset from the top side, starting from 0 (for top copper) |
copper-%name%.gbr=copper | export all copper layers to numbered copper-N.gbr files where N is the full name of the group being exported |
The CAM plugin is a way to manage output "jobs": collections of cam export settings for reproducing export packages in various formats.
...
A job is a script that contains zero or more export directives, separated by semicolons or newlines. An export directive is one of these:
desc text plugin name [--option value] [--option value] ... write outfile=layergrp[,layergrp,...]
desc is a free form one-liner that describes what the job is for. Multiple desc directives may be present (to bypass the limitation that the text can not contain newlines).
The plugin directive selects a plugin and sets plugin specific options. The plugin and options are active until the next plugin directive or the end of the script. The first outfile directive must be preceeded by a plugin directive.
The write directive argument has the same syntax as the cam argument for each cam-capable exporter, see above. Each write is a call to an exporter the same way as if pcb-rnd was called with --cam and -x with the exporter and options taken from the last plugin directive.
For example, the following config tree defines a job called doc_png that generates two 600 DPI images from the sides of the board, copper and silk combined, all in the doc/ dir (that is created if necessary):
li:pcb-rnd-conf-v1 { ha:overwrite { ha:plugins { ha:cam { li:jobs { doc_png { desc export top and bottom copper and silk in 600 DPI pngs plugin png --dpi 600 write top.png=top-copper,top-silk write bottom.png=bottom-copper,bottom-silk } } } } } }
Once the above subtree is loaded in the config, the following action triggers the export:
cam(call, doc_png)
When exporting to ps, consider using the --no-show-toc. It is possible to combine multiple layers (e.g. top silk and top copper, which may be useful for a single-layer board) using the --single-page option.
The plugin field has the same values command line -x has. The list of currently available exporter names can be acquired by running
pcb-rnd -xNote: this list contains all exporter plugins currently available (depends on your configure time options and plugin availability). Some export plugins can not do per layer exporting and those will not support CAM exporting either.