fusion-export-molecule
Public Made by Adomby adom
Ship a Fusion 360 Electronics design to the Adom wiki as a molecule: bridge-driven export (BRD/SCH/F3D/STEP/USDZ, Gerbers and drill), <slug>-fab.zip and export.json, a sources-only publish through molecule-publish (the wiki's model registry builds the GLB, footprint and symbol), and adom-wiki model import into Hydrogen.
Complete Fusion fabrication export and publishing handoff #2
Build on the skill corrections in existing PR #1 and require fabrication sources on every molecule export. Use the released fusion_export_gerbers verb with outputDir and its returned zipPath, then create/check the slug-named zip and export.json for the complete source set. Include them in the pull and publisher handoff; BOM and CPL remain additional outputs.
This draft overlaps PR #1 and should be reviewed as its expanded replacement, not merged independently after applying the old full-file version. It does not merge or release fusion-bridge PR #17.
Validation: arguments checked against the current bridge catalog; package lint reports no errors. Shared checker regression/corpus checks pass. No new live Fusion export was run.
Diff Skip to comments
@@ -1,54 +1,55 @@ { "slug": "fusion-export-molecule",- "version": "1.2.2",+ "version": "1.3.0", "type": "skill", "description": "Export a Fusion 360 Electronics design as an Adom molecule \u2014 orchestrates AdomBridge primitives to produce the BRD, SCH, F3D, STEP, USDZ, and silkscreen PNG source bundle the molecule pipeline (wiki, OCCT, Hydrogen) consumes. Successor to fusion-export-for-hydrogen.", "tags": [⋯ 4 unchanged lines ⋯ "skill" ], "dependencies": {- "adom/molecule-publish": "^2.0.0",+ "adom/molecule-publish": "^2.11.0", "adom/adom-bridge": "^2.0.0" }, "scripts": {⋯ 34 unchanged lines ⋯ } ] }+@@ -1,61 +1,61 @@⋯ 35 unchanged lines ⋯ "brief": "Ship a Fusion 360 Electronics design to the Adom wiki as a molecule: bridge-driven export (BRD/SCH/F3D/STEP/USDZ/silk), OCCT molecule conversion (anchored GLB + footprint + symbol), component publish, and adom-molecule-import handoff to Hydrogen.", "description": "Export a Fusion 360 Electronics design as an Adom molecule — orchestrates AdomBridge primitives to produce the BRD, SCH, F3D, STEP, USDZ, and silkscreen PNG source bundle the molecule pipeline (wiki, OCCT, Hydrogen) consumes. Successor to fusion-export-for-hydrogen.", "slug": "fusion-export-molecule",- "version": "1.2.2",+ "version": "1.3.0", "type": "skill", "tags": [ "molecule",⋯ 3 unchanged lines ⋯ "skill" ], "dependencies": {- "adom/molecule-publish": "^2.0.0",+ "adom/molecule-publish": "^2.11.0", "adom/adom-bridge": "^2.0.0" }, "scripts": {⋯ 9 unchanged lines ⋯@@ -1,44 +1,47 @@ # fusion-export-molecule +Every molecule export includes `<slug>-fab.zip` (both sides' fabrication layers and drill) and `export.json` (producer versions and source hashes). The exporter hands both to molecule-publish, which checks them before and after the page push. See [SKILL.md](SKILL.md) for the tool-specific steps.+ Export a Fusion 360 Electronics design as an **Adom molecule** — the source bundle the molecule pipeline (wiki → OCCT → Hydrogen viewer) consumes — by orchestrating `adom-desktop` AdomBridge primitives from the container. No⋯ 36 unchanged lines ⋯ - `adom/adom-molecule` — create/import molecules from the exported bundle - `adom/fusion-export-for-hydrogen` — the predecessor page this one replaces - `kicad-export-molecule` — planned KiCad sibling producing the same bundle+@@ -1,257 +1,304 @@⋯ 6 unchanged lines ⋯ Export a Fusion 360 Electronics design as an Adom molecule — the STEP + board + silkscreen bundle the wiki/OCCT pipeline and the Hydrogen viewer consume — by orchestrating AdomBridge CLI primitives from the container. -**Prerequisite:** `adom-desktop` must be connected (`adom-desktop ping`) and Fusion must be running with the design open.+**Prerequisite:** Adom Bridge must be connected (`adom-bridge ping`) and Fusion must be running with the design open. ## EasyEDA logo: remove it during creation (always) ⋯ 6 unchanged lines ⋯ ## Architecture -The export is **orchestrated from the container** using existing `adom-desktop fusion_*` primitives. No custom add-in commands or HelperJoe buttons are needed — each step calls a standard AdomBridge verb.+The export is **orchestrated from the container** using existing `adom-bridge fusion_*` primitives. No custom add-in commands or HelperJoe buttons are needed — each step calls a standard AdomBridge verb. ``` Container (skill orchestration)⋯ 4 unchanged lines ⋯ ├── fusion_export_f3d → Fusion archive ├── fusion_export_step → STEP 3D model ├── fusion_export_usdz → AR/Hydrogen 3D model- ├── fusion_take_silkscreen_screenshot → top silkscreen PNG- ├── fusion_take_silkscreen_screenshot → bottom silkscreen PNG+ ├── fusion_export_optimized_glb → silk PNGs (top + bottom), OCCT molecule GLB,+ │ .brd, footprint/symbol JSON, publish gates └── pull_file → copy all files to container ``` ⋯ 9 unchanged lines ⋯ entirely and lands straight in PCB Editor (live-confirmed): ```bash-adom-desktop fusion_open_cloud_file '{"projectName":"Main","folderPath":"Molecules/COSMIIC","fileName":"PG4 FRAME MOL","fileExtension":"fbrd","recovery":"discard"}'+adom-bridge fusion_open_cloud_file '{"projectName":"Main","folderPath":"Molecules/COSMIIC","fileName":"PG4 FRAME MOL","fileExtension":"fbrd","recovery":"discard"}' # → doc opens in PCB Editor, NO picker. (Omitting fileExtension may hit the multi-design picker.) ``` Then verify: ```bash-adom-desktop fusion_get_app_state '{}'+adom-bridge fusion_get_app_state '{}' ``` Ensure: Fusion running, `activeWorkspace` is `PCB Editor`, `isElectronics: true`. ⋯ 3 unchanged lines ⋯ If already open but not in PCB Editor: ```bash-adom-desktop fusion_electron_run '{"command":"EDIT .brd"}'+adom-bridge fusion_electron_run '{"command":"EDIT .brd"}' ``` ### Step 1: Export BRD ```bash-adom-desktop fusion_export_eagle_source '{"outputPath":"C:/tmp/export/<name>.brd","format":"brd"}'+adom-bridge fusion_export_eagle_source '{"outputPath":"C:/tmp/export/<name>.brd","format":"brd"}' ``` ### Step 2: Export SCH Switch to schematic, then export: ```bash-adom-desktop fusion_electron_run '{"command":"EDIT .s1"}'+adom-bridge fusion_electron_run '{"command":"EDIT .s1"}' sleep 2-adom-desktop fusion_export_eagle_source '{"outputPath":"C:/tmp/export/<name>.sch","format":"sch"}'+adom-bridge fusion_export_eagle_source '{"outputPath":"C:/tmp/export/<name>.sch","format":"sch"}' ``` Switch back to board after: ```bash-adom-desktop fusion_electron_run '{"command":"EDIT .brd"}'+adom-bridge fusion_electron_run '{"command":"EDIT .brd"}' ``` ### Step 3: Switch to 3D view ```bash-adom-desktop fusion_show_3d_board '{}'+adom-bridge fusion_show_3d_board '{}' ``` Wait for workspace to switch (5-10s). Verify: ```bash-adom-desktop fusion_get_app_state '{}'+adom-bridge fusion_get_app_state '{}' # Expected: activeWorkspace: "Design" or "3D PCB" ``` ### Step 4: Export F3D ```bash-adom-desktop fusion_export_f3d '{"outputPath":"C:/tmp/export/<name>.f3d"}'+adom-bridge fusion_export_f3d '{"outputPath":"C:/tmp/export/<name>.f3d"}' ``` ### Step 5: Export STEP ```bash-adom-desktop fusion_export_step '{"outputPath":"C:/tmp/export/<name>.step"}'+adom-bridge fusion_export_step '{"outputPath":"C:/tmp/export/<name>.step"}' ``` ### Step 6: Export USDZ ```bash-adom-desktop fusion_export_usdz '{"outputPath":"C:/tmp/export/<name>.usdz"}'+adom-bridge fusion_export_usdz '{"outputPath":"C:/tmp/export/<name>.usdz"}' ``` -### Step 7: Capture silkscreen PNGs+### Step 7: Silkscreen PNGs (and the OCCT molecule GLB) +There is no standalone silkscreen verb: `fusion_take_silkscreen_screenshot` is internal to the+bridge and answers Unknown command. The silk capture runs inside `fusion_export_optimized_glb`,+which writes `<name>_silk_top.png` and `<name>_silk_bottom.png` beside its output, then sends+them with the STEP (and, from the fusion-bridge release after 1.11.39, the `.brd`) to the OCCT+molecule converter:+ ```bash-adom-desktop fusion_take_silkscreen_screenshot '{"outputPath":"C:/tmp/export/<name>_silkscreen_top.png","layer":"top"}'-adom-desktop fusion_take_silkscreen_screenshot '{"outputPath":"C:/tmp/export/<name>_silkscreen_bottom.png","layer":"bottom"}'+adom-bridge fusion_export_optimized_glb '{"outputPath":"C:/tmp/export/<name>.glb","async":true}'+# poll until done:+adom-bridge fusion_fetch_optimized_glb '{"exportId":"<exportId from the reply>"}' ``` -These produce 2048x2048 transparent-background PNGs. Requires the 3D Design view (done in Step 3). Each capture takes ~3s (includes 1s render sleep).+Besides the silk PNGs, this leaves `<name>.glb` (OCCT molecule mode) and its STEP in the folder.+On a bridge with board support (adom/fusion-bridge PR #17) it also writes `<name>.brd`,+`<name>_footprint.json`, `<name>_symbol.json`, `<name>-fab.zip` (Gerber + drill from the+bridge's own CAM job, on every export) and `export.json` (Fusion version, every source file+with its sha256 and role, the stackup), and the reply carries `gates` (footprintApplied,+footprintPins, pinSize, warnings). Push the fab zip and export.json with the other sources:+board-look builds the board from them. If those gates pass, `molecule-publish` can reuse the GLB and JSON instead of+converting again. -### Step 8: Pull files to container+### Step 8: Fabrication sources (required for every molecule) +Use a fresh export folder. A released bridge without PR #17's fab/record+support still exports the files through the existing manufacturing verb:+ ```bash-adom-desktop pull_file '{"filePaths":["C:/tmp/export/<name>.brd","C:/tmp/export/<name>.sch","C:/tmp/export/<name>.f3d","C:/tmp/export/<name>.step","C:/tmp/export/<name>.usdz","C:/tmp/export/<name>_silkscreen_top.png","C:/tmp/export/<name>_silkscreen_bottom.png"],"saveTo":"/tmp/export"}'+adom-bridge fusion_electron_run '{"command":"EDIT .brd"}'+adom-bridge fusion_export_gerbers '{"outputDir":"C:/tmp/export/fab"}' ``` +Use `zipPath` from the response; the argument is `outputDir`, not `outputPath`.+The bundled CAM job exports both sides' copper, mask and silk, outline and+mixed Excellon drill. Verify every layer and the drill before continuing.+Keep the current silk PNGs while the converter uses them.++With the `molecule-publish` package's `scripts/fab_bundle.py`, pack that zip+as `<slug>-fab.zip` in the final bundle and write `export.json`. Follow its+`docs/fabrication.md`: record the Fusion version from the Gerber job file,+the actual bridge/exporter version, STEP, BRD, SCH, F3D, USDZ, silk PNGs and+any BOM/CPL exported. Record known stackup fields from the job; unknown+colours and finish stay absent. Mixed drill files remain labelled mixed.++If PR #17 already produced a record, check it and complete the handoff against+the final set of sources; that verb alone does not record the separate SCH,+F3D and USDZ exports. Use the page slug for the zip name. Run+`fab_bundle.py check <bundle-dir> --slug <slug>` after naming and packaging.+A missing or stale fabrication set stops publishing.++### Step 9: Pull files to container++```bash+adom-bridge pull_file '{"filePaths":["C:/tmp/export/<name>.brd","C:/tmp/export/<name>.sch","C:/tmp/export/<name>.f3d","C:/tmp/export/<name>.step","C:/tmp/export/<name>.usdz","C:/tmp/export/<name>_silk_top.png","C:/tmp/export/<name>_silk_bottom.png","C:/tmp/export/<slug>-fab.zip","C:/tmp/export/export.json"],"saveTo":"/tmp/export"}'+```+ ### Output files | File | Format | Description |⋯ 3 unchanged lines ⋯ | `<name>.f3d` | Fusion archive | Full parametric 3D model | | `<name>.step` | STEP | CAD interchange 3D model | | `<name>.usdz` | USDZ | AR/Hydrogen 3D viewer |-| `<name>_silkscreen_top.png` | PNG | Top silkscreen render (transparent bg) |-| `<name>_silkscreen_bottom.png` | PNG | Bottom silkscreen render (transparent bg) |+| `<slug>-fab.zip` | ZIP | Required Gerbers and drill files from the same saved design |+| `export.json` | JSON | Required producer versions and source/member hashes |+| `<name>_silk_top.png` | PNG | Top silkscreen render (transparent bg) |+| `<name>_silk_bottom.png` | PNG | Bottom silkscreen render (transparent bg) | ## Kitchen Sink Export -For manufacturing files in addition to the Hydrogen export, add these steps after Step 7:+Gerbers and drill are already required in Step 8. BOM and CPL are additional+outputs; if exported, include them in the record before checking the bundle. ### Gerbers Switch back to 2D board first: ```bash-adom-desktop fusion_electron_run '{"command":"EDIT .brd"}'+adom-bridge fusion_electron_run '{"command":"EDIT .brd"}' sleep 3-adom-desktop fusion_export_gerbers '{"outputPath":"C:/tmp/export/gerbers.zip"}'+adom-bridge fusion_export_gerbers '{"outputDir":"C:/tmp/export/fab"}' ``` ### BOM ```bash-adom-desktop fusion_export_bom '{"outputPath":"C:/tmp/export/bom.csv"}'+adom-bridge fusion_export_bom '{"outputPath":"C:/tmp/export/bom.csv"}' ``` ### CPL ```bash-adom-desktop fusion_export_cpl '{"outputPath":"C:/tmp/export/cpl.csv"}'+adom-bridge fusion_export_cpl '{"outputPath":"C:/tmp/export/cpl.csv"}' ``` ## Saving Designs The cloud save command: ```bash-adom-desktop fusion_execute_text_command '{"command":"Commands.Start PLM360SaveCommand"}'+adom-bridge fusion_execute_text_command '{"command":"Commands.Start PLM360SaveCommand"}' ``` This opens a Save dialog. Find and confirm it:⋯ 1 unchanged line ⋯ # Wait for dialog sleep 5 # Press Enter to confirm (finds Save dialog automatically)-adom-desktop fusion_send_key '{"key":"enter"}'+adom-bridge fusion_send_key '{"key":"enter"}' ``` ## Caching Bug Workaround After saving, exports may produce stale files. Workaround:-1. Close all project tabs: `adom-desktop fusion_close_document '{"save":false}'` (repeat)-2. Reopen the **board** (`.fbrd`, NOT `.fprj` — the project file triggers the multi-design picker): `adom-desktop fusion_open_cloud_file '{"projectName":"Main","fileName":"<name>","fileExtension":"fbrd","folderPath":"<path>"}'`-3. Switch to board view if needed: `adom-desktop fusion_electron_run '{"command":"EDIT .brd"}'`+1. Close all project tabs: `adom-bridge fusion_close_document '{"save":false}'` (repeat)+2. Reopen the **board** (`.fbrd`, NOT `.fprj` — the project file triggers the multi-design picker): `adom-bridge fusion_open_cloud_file '{"projectName":"Main","fileName":"<name>","fileExtension":"fbrd","folderPath":"<path>"}'`+3. Switch to board view if needed: `adom-bridge fusion_electron_run '{"command":"EDIT .brd"}'` 4. Run the export steps above ## After Export — Hand off to molecule-publish⋯ 3 unchanged lines ⋯ (EDA-agnostic; shared with the KiCad and Altium flows). Hand it the bundle: - `<name>.step` + `<name>.brd` (board) + `<name>.sch` (schematic) + silk PNGs+- `<slug>-fab.zip` + `export.json`, checked against the complete source set - extras worth carrying: `<name>.f3d` (irreplaceable native archive),- `<name>.usdz`, Kitchen Sink outputs (gerbers/BOM/CPL)+ `<name>.usdz`, Kitchen Sink outputs (BOM/CPL) - `pin` size (medium|large) and the target slug/org It runs the OCCT molecule-mode conversion with stats gates (`anchored`,⋯ 36 unchanged lines ⋯ ## Important Notes -- **Focus stealing:** Steps 3 and 7 switch Fusion workspaces, which steals desktop focus. Warn the user.+- **Background:** the view switches in Steps 3 and 7 go through the add-in API and do not raise Fusion or take focus (see the fusion-driving skill). - **3D view required for Steps 4-7.** If `fusion_show_3d_board` fails, the user may need to run "Push to 3D PCB" manually from the Design tab. - **Silkscreen capture** requires the 3D Design view, not PCB Editor. Always do Steps 4-7 after Step 3. - **pull_file from Google Drive paths** may produce empty files. Use shell_execute + base64 as a workaround if the output folder is on Google Drive.⋯ 5 unchanged lines ⋯ - `kicad-export-molecule` — same job from KiCad - `altium-export-molecule` — same job from Altium (via KiCad's importer) - `adom-molecule-import` — the Hydrogen import half (this skill's final stage)+
Comments
Log in to comment.
No comments yet.