pcb_render_svg
Render the active PCB to a per-layer SVG for visual placement, silkscreen, and spacing review or for sharing a board image; use board data for electrical checks.
Instructions
Render the active PcbDoc to an SVG file (in-house renderer).
SCOPE: a VISUAL artifact for when an image is genuinely needed
(placement / silkscreen / spacing review, sharing a picture).
It is NOT an input to a design review's electrical findings.
NEVER judge connectivity, net assignment, or clearance from this
render -- read those from the board data (pcb_get_nets,
pcb_get_unrouted_nets, pcb_get_clearance_violations,
pcb_run_drc, proj_compare_sch_pcb). The render shows
geometry; the netlist shows connection.
Pulls the board outline, every track, arc, pad, via, and text
primitive from the active PCB via the bridge, then emits a
per-layer SVG. Layers are grouped in render order (KeepOut at
bottom, then bottom copper, top copper, overlays, outline on
top, drills last) and every track / arc / pad / via group
carries data-net, data-layer, data-shape so a
downstream dashboard or LLM tool can cross-probe or net-
highlight without re-parsing.
v1 surface: board outline + tracks + arcs + pads (round / rect / octagonal / rounded-rect) + vias + texts on overlays. Regions (polygon fills / copper pours) and component-body silkscreen outlines are deferred to v1.1.
Args:
output_path: Where to write the SVG. Defaults to the
transient <workspace>/renders/ dir (kept out of the
workspace root so renders don't pile up in your folder).
layers: Restrict to these Altium layer names (e.g.
["TopLayer", "TopOverlay", "KeepOutLayer"]). When
None (default) every known layer is rendered.
MultiLayer (vias) and the outline are always drawn.
margin_mils: Padding around the board bbox in mils.
flip_y: When True (default) flip Y so the SVG reads in
Altium's bottom-left-origin space.
show_drills: Punch hole circles through pads / vias.
show_texts: Render text primitives on overlay layers.
show_designators: Draw component designators on the overlay.
interactive_legend: Emit a clickable per-layer legend group
in the SVG (for the dashboard / cross-probe consumers).
background: Board-background fill (defaults to a slate
review colour; pass "none" for transparent).
Returns:
Dict with ok, svg_path, counts (per primitive
kind), bbox (in mils), bytes.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| flip_y | No | ||
| layers | No | ||
| background | No | #1f2937 | |
| show_texts | No | ||
| margin_mils | No | ||
| output_path | No | ||
| show_drills | No | ||
| show_designators | No | ||
| interactive_legend | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||