Electronics Design
Altium Designer - schematic capture, physical board layout, routing, design rule checks, and manufacturing file export.
NEW PCB BOARD SIZE 40,30 LAYERS 4 UNIT "mm" SET ?board
(* Copper. A trace is placed, not guessed - see the note below. *)
AFTER PCB ?board TRACE FROM 5,5 TO 35,5 WIDTH 0.25 LAYER "top" SET ?n
AFTER PCB ?board TRACE FROM 35,5 TO 35,25 WIDTH 0.25 LAYER "top" SET ?n
AFTER PCB ?board VIA AT 35,25 WIDTH 0.8 DRILL 0.4 SET ?vias
(* A part from any installed footprint library *)
AFTER PCB ?board PLACE "R_0805_2012Metric"
FROM LIBRARY "/usr/share/kicad/footprints/Resistor_SMD.pretty"
AT 12,18 REFERENCE "R1" VALUE "10k" ROTATION 90 SET ?r1
AFTER PCB ?board LIST SET ?parts
AFTER PCB ?board EXPORT BOM SET ?bom
AFTER PCB ?board EXPORT GERBER SET ?files
AFTER EMIT ?files("folder")
AFTER EMIT ?files("files")
EXPORT GERBER writes every layer a fabricator asks for - top and bottom copper, both silkscreens, both solder masks, the board outline - plus the two drill files, plated and non-plated. Nine files, straight to a fab house.
Schematic Capture
Board layout is complete: outline, layers, copper, vias, footprints, and manufacturing output. Schematic capture - symbols, nets and netlist import - is not part of it yet. A board built here is built by placement and routing rather than by importing a netlist from a drawn schematic.
PCB ?board EXPORT BOM SET ?bom
AFTER FOREACH ?bom SET ?part
OPEN
EMIT ?part("reference") & " " & ?part("value") & " - " & ?part("footprint") & "<br>"
CLOSE
PCB OPEN
The same for a board: an existing PCB document becomes a handle the PCB verbs accept. Use it to add tracks to a layout from a previous run rather than starting again.
PCB OPEN "/root/pcb/driver.kicad_pcb" SET ?board
AFTER PCB ?board TRACE FROM 10,10 TO 40,10 WIDTH 0.4 LAYER "F.Cu"
AFTER PCB ?board EXPORT AS "gerber" INTO "/root/pcb/out/"