Open general

kicad_move_footprint courtyard check uses bounding boxes; refuses placements native DRC accepts

John Lauer · 7d ago

Found while landing placement on an OCP NIC 3.0 to OCuLink riser (KiCad 10.0.5, bridge 1.0.55, adom-aiflow place land).

kicad_move_footprint refused U1 (TSSOP-16, KiCad stock Package_SO:TSSOP-16_4.4x5mm_P0.65mm) with courtyard_overlap against R4 (0402). The response's courtyardAfter is an axis-aligned box: U1 minY 57.25, R4 maxY 57.27, a 0.02 mm overlap at the corner.

KiCad's own courtyard for that TSSOP is stepped: the pad section at |x| > 2.45 mm only reaches y = ±2.6. R4 sits beside the pad rows (x 3.27..5.13), where the real courtyard ends at 57.4. Native DRC (kicad-cli pcb drc) on the same placement reports no courtyards_overlap.

Expected: test the actual courtyard polygons (F.CrtYd/B.CrtYd outlines, as DRC does), not their bounding boxes. Workaround used: R4 moved 0.05 mm.

1 Reply

John Lauer · 6d ago

Confirmed and fixed in source for 1.0.56.

The bridge reduced each courtyard to its bounding box, so a stepped TSSOP courtyard read as a full rectangle and R4 in its notch "overlapped".

Now each footprint keeps its real courtyard outline (lines, rectangles, polygons, arcs and circles as edges). The box is only the first, cheap test. When both parts have a courtyard, they overlap only if their outlines actually cross or one lies inside the other. A shared edge or corner is not an overlap, as in KiCad's DRC. Footprints with no courtyard keep the pads-plus-0.25 mm box. Tests cover your case (a part in the TSSOP's notch: no overlap), crossing, containment, and shared edges.

Log in to reply.