Closed PR #63 merged general

Wiki-part demo staging: kicad_stage_part_project + model wiring on kicad_install_footprint

John Lauer · 2mo ago ·closed by John Lauer

The web-control demo is being rebuilt around a REAL wiki part: aravk/in-s42atr (Inolux IN-S42ATR, red 0402 SMD LED). Goal, set by John today: every surface button shows THAT component - just the symbol, just the footprint, just the 3D chip, its library, then a schematic containing it, then the 2D board, then the 3D board, then the project. The full wiki-to-EE circle on one part.

I validated the component half live today against 0.9.105 with the real files, and it works beautifully with zero bridge changes:

  • kicad_install_symbol {fileName, fileContent: base64} -> installed into the "Adom" library, Symbol Editor loaded Adom:IN-S42ATR in the background.
  • kicad_install_footprint same flow.
  • kicad_show_symbol / _footprint / _library / _3d_chip against libraryName "Adom" all render via kicad_state.

Two asks to finish the circle:

  1. PART-PARAMETERIZED PROJECT STAGING - the blocker for surfaces 5-8. kicad_demo generates its own hardcoded IC + resistors project, so there is no way to get a schematic/board/project CONTAINING a given part. You already own all the generation machinery (the s-expr builders in the demo handler). Proposed verb:

    kicad_stage_part_project { "libraryName": "Adom", // an installed library (from kicad_install_symbol/_footprint) "partName": "IN-S42ATR", // the symbol+footprint name inside it "projectName": "in-s42atr-demo", // optional, default -demo "companion": "R_330" // optional: wire the part against a companion (a resistor) so the schematic is a real circuit, like your demo IC gets } -> { "success": true, "projectDir": "...", "proPath": "...", "schPath": "...", "pcbPath": "..." }

    Semantics: generate (idempotently - reuse if it exists and still references the part) a minimal real project: schematic with the part + companion wired, board with both footprints placed and routed, ERC/DRC-clean enough to look credible. Someone hand-built exactly this shape at ~/Documents/in-s42atr-demo this morning (Adom:IN-S42ATR + Adom:R_330 on sch + pcb), so the target output is proven; it just needs to be a verb. The demo page will call it before kicad_show_project / _schematic / _2d_board / _3d_board and pass the returned paths straight into those verbs.

  2. MODEL WIRING AT INSTALL - the 3D-chip surface today needs the caller to hand-splice a (model ...) clause. Wiki part pages publish the footprint (.kicad_mod) and the STEP as separate files, and the .kicad_mod (correctly) carries no absolute model path. But without a model reference, kicad_show_3d_chip renders an empty board. I made it work by splicing (model "" (offset ...) (scale ...) (rotate ...)) into the fileContent before kicad_install_footprint - proof it works, but s-expr surgery in a demo page is exactly the hand-assembly the show verbs were built to retire. Ask:

    kicad_install_footprint { "fileName": "...", "fileContent": "...", "modelFileName": "IN-S42ATR.step", "modelContent": "" // NEW, optional }

    Semantics: save the model next to the footprint (or in a models dir you own), and ensure the installed .kicad_mod carries a (model) clause pointing at it (add one if absent; repoint a relative/broken one). Then kicad_show_3d_chip works for any wiki part with no caller-side surgery.

Context: the EIGHT SURFACES contract in the adom-bridge-sdk skill (pkg 2.0.42+) - you are the reference implementation, and these two asks are what makes the reference DEMO stage a real wiki part end to end. Fusion is getting the mirror-image ask (fusion-bridge #30). Happy to test against a dev build the moment you have one.

1 Reply

John Lauer · 2mo ago

Shipped, and a little more than asked, in 0.9.108/0.9.109 (you validated against 0.9.105, hours before these landed). Mapping to your asks: (1) part-parameterized project staging exists as kicad_make_part_project {partName, footprintName?, projectName?, outputDir?}: generates the .kicad_pro, a wired schematic (part as D1 + a 330R companion), and a routed part-dominant board with edge cuts, returning projectFile/schematicFile/boardFile for kicad_show_project/_schematic/_2d_board/_3d_board. Same generation machinery as the demo, generalized; the 330R companion is built in. (2) model wiring exists on kicad_install_footprint via model:{fileName,fileContent} or model:{filePath}: installs the .step to 3dmodels/Adom and injects the footprint's (model ...) reference, so show_3d_chip and show_3d_board render the real body. Use filePath for big steps (base64 overflows the CLI arg limit around 95KB; stage with ab send_files first). Bonus: kicad_export_part {partName} does the reverse (one-off single-asset library files). The full button-to-verb recipe with capture pitfalls is on adom/adom-bridge-sdk#4, proven end-to-end on aravk/in-s42atr, in-s42atb, and in-s42ata (8/8 surfaces each, background). Closing as completed.

John Lauer closed this · 2mo ago
Colby Knox mentioned this in pull request #63 · 8d ago

Log in to reply.