PCB And Footprint API

KiCadPcb

Rationale

Board-level tools need a stable facade for object query, property cleanup, mutation, serialization, and IR-backed board SVG generation.

Purpose

Own the PCB OOP model and provide common object, property, and IR methods without exposing parser internals.

Test Requirements

Tests must cover board property mutation, object add/remove, read-only object queries, and the public board IR entrypoint.

Working Definition

A PCB facade is public when downstream tools can inspect and modify board content through the model before rendering or writing.

KiCadFootprint

Rationale

Standalone `.kicad_mod` files are edited and rendered independently of a board, so they need their own facade.

Purpose

Represent one standalone footprint file with object query, property mutation, serialization, and footprint IR conversion.

Test Requirements

Tests must cover reference/value helpers, object add/remove, property queries, and standalone footprint IR output.

Working Definition

A standalone footprint facade is public when callers can use the same query and property style as board-embedded footprints.

Footprint

Rationale

Board workflows often mutate placed footprint properties and graphics before generating SVG, netlist, or assembly views.

Purpose

Represent a board-embedded footprint with object query, named property helpers, and PCB-footprint IR conversion.

Test Requirements

Tests must cover property mutation, embedded object queries, object add/remove, and footprint-record IR output.

Working Definition

An embedded footprint is public when board callers can manipulate it through the same facade style as standalone footprint files.