Closed general

step-export runs on the run's board copy, so project-library and PCM 3D models are all missing

noah · ·closed by John Lauer

Version: adom-aiflow 0.2.56 (local build 0.2.56+noah.1), kicad-cli 10.0.6 in the container.

What I ran: step-export on a board whose footprints take their 3D models from the project's own library (${KIPRJMOD}/lib/...) and from the board page's PCM package (${KICAD10_3RD_PARTY}/3dmodels/inc_adom_wiki_<owner>_<slug>/..., mirrored under kicad/3rdparty beside the project).

What happened: the export runs kicad-cli pcb export step ... <run>/board-29.kicad_pcb on the run's copy of the board, where ${KIPRJMOD} is the run folder and KICAD10_3RD_PARTY is unset, so every model is missing (modelWarnings: 252: Could not add 3D model for D16. File not found: ${KICAD10_3RD_PARTY}/3dmodels/..., File not found: ${KIPRJMOD}/lib/rgbcct-extra.3dshapes/...). The command reports only the one geometry warning as the open issue; a bare board with no parts would then go to board-glb copper and the page.

Expected: export from the source board's project folder (or set KIPRJMOD and KICAD10_3RD_PARTY to the project's), and treat missing models as an open issue, the way models does.

Workaround: run the same kicad-cli command from the project folder with KICAD10_3RD_PARTY set, then step-export --log <its output> --out <its STEP>.

1 Reply

John Lauer ·

Thanks Noah, the diagnosis was spot on: the export ran on the run's copy of the board, and the STEP came out with no parts while the command only talked about the one geometry warning.

What was wrong: KiCad sets ${KIPRJMOD} to the folder of the board it opens. step-export handed kicad-cli <run>/board-N.kicad_pcb, so ${KIPRJMOD} was the run folder, where the project library does not exist, and KICAD10_3RD_PARTY was unset in the container. Every model was missing. On top of that, model warnings were counted (modelWarnings: 252) but never treated as an open issue, so board-glb copper and the page could go ahead with a bare board.

What changed, in adom-aiflow 0.2.58:

  • step-export exports from the source board's project folder: it puts a temporary copy of the run's board there (removed right after the export), so ${KIPRJMOD} is your project and lib/... resolves. When the board is already in the project folder it is exported as it is.
  • A ${KICAD<N>_3RD_PARTY} the environment leaves unset is pointed at a kicad/3rdparty or 3rdparty folder that holds 3dmodels, in the project folder or its parent (your mirror), else KiCad's own Linux user folder. If you set the variable yourself, yours is used.
  • The record keeps what it chose (projectDir, exportContext), and the command line in the record shows the variable it set.
  • Missing 3D models are now an open issue, the way models treats them: step-export reports them as findings with the first few messages and what to do, and board-glb copper and deliver report the same open issue. If some parts have no model on purpose, step-export --ack --why "..." now covers model warnings as well as geometry warnings, bound to that STEP file.
  • These are findings and warnings, not refusals: AI Flow never refuses, so board-glb copper and deliver now warn about an unreviewed STEP and carry on, instead of stopping.

How it was verified: a new unit test exports a board from proj/aiflow/run/ with a fake kicad-cli that records where it was run: the board it got sits in proj/, KICAD10_3RD_PARTY is proj/kicad/3rdparty, the temporary copy is gone afterwards, the record still names the run's board, and the missing model is an open issue until acknowledged for that STEP. All suites pass.

Still open: when kicad-cli is the container shim that runs on the desktop or on service-kicad, only the board file travels, so the project library still is not there. For that case the hint says to export on the desktop from the project folder and pass step-export --log <its output> --out <its STEP>, as in your workaround.

Upgrade: tell your AI "give me the latest adom-aiflow" (or adom-wiki pkg install adom/adom-aiflow); adom-aiflow --version says 0.2.58.

John Lauer closed this ·

Log in to reply.