Skip to content

copper_edge_clearance DRC violations don't distinguish footprint-owned Edge.Cuts (e.g. mounting-peg cutouts) from the board's real outline #413

Description

@ncolomer

Summary

run_drc's copper_edge_clearance violations describe the offending Edge.Cuts geometry only as e.g. "Circle of J1 on Edge.Cuts" — this reads identically whether that geometry is the board's actual outer boundary or a small cutout owned by a footprint's own mechanical artwork (a connector's locking-peg hole, in this case). The fix for each is completely different — move the component, vs. edit the footprint — and the violation text gives no structured way to tell which one you're looking at.

Environment

  • Konnect 0.10.0
  • KiCad 10.0.5, macOS 26.6.2 arm64

Repro

run_drc(board="...", severity="error")
→ {"description":"Board edge clearance violation (board setup constraints edge clearance 0.5000 mm; actual 0.1000 mm)",
   "items":[{"description":"Circle of J1 on Edge.Cuts","pos":{"x":138.73,"y":93.375}, ...},
            {"description":"Pad 2 [VCC] of J1 on F.Cu", ...}],
   "rule":"copper_edge_clearance","severity":"error"}

Confirming ownership required a separate call:

list_board_footprint_graphics(board="...", reference="J1", layer="Edge.Cuts")
→ {"graphics":[{"kind":"circle","layer":"Edge.Cuts","points":[{"x":0.0,"y":-3.81},{"x":0.5,"y":-3.81}], ...}, ...4 total]}

All four circles are footprint-local coordinates owned by J1 itself (a "Connector_PinSocket…SMD_low_profile" part) — almost certainly locking-peg cutouts molded into the connector's shroud, not board material.

By contrast, score_placement on the same board correctly distinguishes true board-outline containment in its own separate check:

score_placement(board="...")
→ {"hard_failures":[{"detail":"J1 courtyard bbox (134.3, 90.775)..(145.7, 95.975) is not fully inside the board outline (120, 56.5)..(155.35, 95.9)", "kind":"outside_outline", ...}]}

That check clearly names the board outline extents vs. the courtyard. The DRC violation above has no equivalent — nothing in its output distinguishes "this is close to the board's actual edge" from "this is close to a small hole this footprint itself owns."

Expected

The violation's items carry a structured indication of ownership — e.g. owner: "board" | "footprint:J1" — so a caller (human or agent) doesn't have to cross-reference list_board_footprint_graphics against every footprint on the board to find out whether a copper_edge_clearance hit is fixable by repositioning a component or requires editing that component's own footprint file.

Actual

No such distinction exists. This specific violation was misdiagnosed across several turns as "move J1 to fix it" before the footprint-ownership was caught by manual cross-referencing — repositioning J1 anywhere on the board would never have changed this violation, since the pad and its offending hole move together.

Impact

Wasted diagnosis time and produced incorrect fix guidance downstream (to a human, in this case) before the actual root cause — footprint-owned geometry, not board placement — was identified.

Related

Related to #351 (lossless promotion of footprint-owned Edge.Cuts to board graphics on import) but distinct: #351 is about import fidelity for mechanical footprints; this is about DRC's violation reporting failing to label ownership regardless of whether the geometry stays footprint-owned (the normal, correct state for something like a connector's own mounting cutout) or gets promoted to board-level graphics.

Affected versions

Confirmed on Konnect 0.10.0 / KiCad 10.0.5.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High-value workflow reliabilityarea:pcbBoard editing, export, manufacturingbugSomething isn't workingclaimedSomeone has claimed this; check the assignee before startingstatus:in-progressNext actor: the assignee

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions