From 9d6cbc452c0a147052eee407b14e9b2c9540dbb9 Mon Sep 17 00:00:00 2001 From: Ryan Malloy Date: Thu, 5 Mar 2026 08:21:43 -0700 Subject: [PATCH] Document power symbol direct-connection behavior in tool docstrings Power symbols at a pin coordinate create a direct electrical connection without a wire. Note this in audit_wiring (explains wire_count: 0 for connected pins) and add_power_symbol (explains why it draws a stub). --- src/mckicad/tools/power_symbols.py | 5 +++++ src/mckicad/tools/schematic_analysis.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/src/mckicad/tools/power_symbols.py b/src/mckicad/tools/power_symbols.py index 766efc5..4febcfe 100644 --- a/src/mckicad/tools/power_symbols.py +++ b/src/mckicad/tools/power_symbols.py @@ -71,6 +71,11 @@ def add_power_symbol( name, assigns a ``#PWR`` reference, places the symbol above (supply) or below (ground) the pin, and draws a connecting wire stub. + KiCad's connectivity engine treats a power symbol at a pin coordinate + as a direct electrical connection — no wire is required. This tool + places the symbol *offset* from the pin for visual clarity and draws + an explicit wire stub bridging the gap. + This is the recommended way to connect power rails to component pins -- it handles direction, grid alignment, and reference numbering for you. diff --git a/src/mckicad/tools/schematic_analysis.py b/src/mckicad/tools/schematic_analysis.py index 44054b9..e354601 100644 --- a/src/mckicad/tools/schematic_analysis.py +++ b/src/mckicad/tools/schematic_analysis.py @@ -1152,6 +1152,12 @@ def audit_wiring( ICs. Each net entry lists which pins of the component belong to it, how many wire segments exist, and what other components are connected. + Note: a pin can be connected to a net with ``wire_count: 0`` when a power + symbol sits directly on the pin coordinate. KiCad treats a power symbol + at a pin position as a direct electrical connection — no wire is needed. + The ``add_power_symbol`` tool draws an explicit wire stub for visual + clarity, but manually-placed power symbols may not have one. + By default, wire segment coordinates are omitted to keep the response compact. Pass ``include_wires=True`` to get full ``{start, end, uuid}`` data for each wire (offloaded to a sidecar file when large).