PCB2GCODE(1)
π pcb2gcode π
okay so bestie, welcome to the pcb2gcode manual page β that's section 1 of the General Commands Manual, the one for actual commands you type, not the weird kernel ones π
β¨ NAME β¨
pcb2gcode β a command-line tool for engraving PCBs using CNCs π
πΈ SYNOPSIS πΈ
pcb2gcode [options]
like... that's it. that's the whole vibe. options and go β¨
π¦ DESCRIPTION π¦
okay so this manual page documents briefly the pcb2gcode command. brief. cute. efficient. we love her π«Ά
pcb2gcode is a program that takes the files typically produced by PCB (printed circuit board) designing tools β specifically Gerber (RS-274X) and Excellon (an RS-274C variant) files, as parsed by gerbv β and produces files that can be used to control a CNC (computer numerical control) milling machine. those output files are in G code format (RS-274D/NGC), which can be read by, for example, the linuxcnc EMC2 system. no cap π₯
so when these files get executed, an engraving bit is used to remove the surface from a copper covered circuit board, thus creating isolated areas. iconic. then, in another step, holes are drilled into the board at the appropriate positions, and in yet another step it can be cut out. and bestie, listen: for each step, a separate output file is created π
π OPTIONS π
these programs follow the usual GNU command line syntax, with long options starting with two dashes (`-`). a summary of options is included below. slay.
okay so instead of passing all options on the command line, nearly all options can be stored in a file named millproject. there, options are given one per line as option=value pairs (without the two dashes), and can be separated by blank lines and commented (everything after a # character is treated as a comment). options that don't take an argument (like --metric) are entered as option=1 there. yes really. that's the move π
unless configured otherwise, numeric values are in units of inch and inch/minute. when the --metric option is given, they are in mm and mm/minute. pick a lane bestie π
--front filename.gbrβ engrave the front side according to the given file (typically used in two-sided boards).--back filename.gbrβ engrave the back side according to the given file.--outline filename.gbrβ cut out the board to the shape exposed in the given file. typically, there is only a polygon in this gerber file. alternatively, this file can contain a closed line chain (see--fill-outline).--drill filename.cncβ convert the given file (containing drill sizes and positions) to G-code.
for every option --x that takes a filename, there is an --x-output option that specifies where the resulting G-code is saved, defaulting to x.gbr. instead of giving each output file name, the --basename option can be used; the base name will be used as a prefix to the default output file names. okay queen, shortcuts π
π₯ the parameters that define engraving π₯
--zwork unitβ Z-coordinate at which engraving happens.--zsafe unitβ Z-coordinate for movements between engraving steps.--mill-feed unit/minuteβ feed rate at which engraving takes place (horizontal speed).--mill-speed rpmβ spindle speed during engraving (rounds per minute).--offset unitβ distance by which the tool movement will be outset from the contours in the gerber file to be engraved.
if this distance can't be satisfied because copper areas are too close, a warning will be printed and the line will be drawn between the areas. this behavior can be used to get voronoi-style (flood-filling) areas; simply set the offset to a large value (like 1 inch). it's giving hack, and we respect it π
--extra-passes numberβ number of additional isolation passes.
for each extra pass, engraving is repeated with the offset width increased by half its original value, creating wider isolation areas. more passes, more isolation, more β¨
πΈ the parameters that define outline cutting πΈ
--cutter-diameter unitβ amount by half of which the tool path is outset from the shape in the outline file.--zcut unitβ Z-coordinate indicating where the outline cutting ends.--cut-feed unit/minuteβ feed rate at which outline cutting takes place (horizontal speed).--cut-speed rpmβ spindle speed during outline cutting (rounds per minute).--cut-infeed unitβ maximum Z distance that is cut away in a single pass (positive value; if less thenzcut's value, there will be more than one pass).--fill-outlineβ if--fill-outlineis given, it is assumed that the outline file contains not a polygon but a closed chain of lines. the board will be cut along the centres of these lines.--outline-width unitβ thickness of the lines that form the outline (if--fill-outlineis given).
π drilling takes another set of options π
--zdrill unitβ Z value down to which will be drilled.--zchange unitβ Z-coordinate for movements with the drill head.--drill-feed unit/minuteβ feed rate for drilling (vertical speed).--drill-speed rpmβ spindle speed during drilling (rounds per minute).--milldrillβ if--milldrillis given, the milling head will be used to drill the holes in the PCB. holes up to the size of the milling head will be drilled regularly (possibly creating a bigger hole than intended), the other holes are created by moving the head in circles using the feed and infeed parameters used in cutting. lowkey unhinged but it works π--drill-frontβ use the coordinates of the front side for drilling instead of the coordinates of the back side.
π these options govern the general behavior of pcb2gcode π
--dpi dpiβ resolution used internally (defaults to1000).--mirror-absoluteβ mirror operations on the back side along the Y axis instead of the board center, which is the default.--svg filenameβ export the resulting contours to an SVG (scalable vector graphics) file. cute AND useful, we stan π¦
π the common ones (the only options that can't be used in the millproject file) π
-?,--helpβ show summary of options.-v,--versionβ show version of program.
fr fr, those two are the only ones that refuse to live in your millproject file. they're built different. main character energy only π
β SEE ALSO β
for further information about pcb2gcode, see the project wiki β¨http://sourceforge.net/apps/mediawiki/pcb2gcode/β©.
π AUTHOR π
pcb2gcode was written by Patrick Birnzain, loosely based on an earlier program of the same name by Jeff Prothero (Cynbe ru Taren), which in term was based even more loosely on Matthew Sager's gerber_to_gcode. a whole lineage of legends honestly π«Ά
this manual page was written by chrysn <chrysn@fsfe.org> for the Debian project (and may be used by others).
and that's the whole page bestie π this version dropped 2010-11-10, and it's the PCB2GCODE(1) page from the General Commands Manual β go engrave something iconic, no cap πβ¨
π¦ where this page comes from
- ubuntu jammy: pcb2gcode 1.1.4-git20120902-1.1build5 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms