← Commit history

Fusion files: rebuild the library and board with 3D in your own Fusion (bundle, rebind script, tested recipe)

John Lauer ·920522b4bd · ·parent 5fb124d
5 files changed +94−3
fusion-360/README.md+29−3
@@ -70,7 +70,7 @@ Every part on this board has its own page on the Adom wiki, with its symbol, foo  Everything we used to make this board, exported from the final cloud version (TPS54202_Buck_1007, version 23) on November 18, 2026. Download what you need, or take it all in one zip. -**[Download everything (6 MB zip)](files/TPS54202_Buck_1007_all-files.zip)**+**[Download everything (7 MB zip)](files/TPS54202_Buck_1007_all-files.zip)**  ### To have it made @@ -96,7 +96,7 @@ Notes for whoever builds it: |---|---| | [TPS54202_Buck_1007.sch](files/TPS54202_Buck_1007.sch) | The schematic, as EAGLE XML. | | [TPS54202_Buck_1007.brd](files/TPS54202_Buck_1007.brd) | The routed, poured board, as EAGLE XML. |-| [Buck12V5V_1007.lbr](files/Buck12V5V_1007.lbr) | The project library: all 17 parts with symbols, footprints and part numbers (MPN, manufacturer, Mouser, DigiKey, LCSC). The schematic and board already carry a copy, so you only need this to reuse the parts in your own designs. It has no 3D links, so it opens cleanly in any account; the part STEP models are in [kicad/3d](../kicad/3d). |+| [Buck12V5V_1007.lbr](files/Buck12V5V_1007.lbr) | The project library: all 17 parts with symbols, footprints and part numbers (MPN, manufacturer, Mouser, DigiKey, LCSC). The schematic and board already carry a copy, so you only need this to reuse the parts in your own designs. It has no 3D links, so it opens cleanly in any account. To get it with 3D, see [Rebuild the library and the board](#rebuild-the-library-and-the-board-in-your-own-fusion-with-3d) below. | | [TPS54202_Buck_1007_3D.f3d](files/TPS54202_Buck_1007_3D.f3d) | The assembled board in 3D, as a Fusion archive, with every part model inside it. | | [TPS54202_Buck_1007.step](files/TPS54202_Buck_1007.step) | The same 3D board as STEP, for any mechanical CAD tool. | | [TPS54202_Buck_1007.fsch](files/TPS54202_Buck_1007.fsch) and [.fbrd](files/TPS54202_Buck_1007.fbrd) | The schematic and board in Fusion's own file format, for tools that read it. |@@ -112,7 +112,33 @@ We tested these two files through Fusion's own EAGLE importer into a new design:  **Open the 3D board:** choose **File > Open > Open from my computer** and pick **TPS54202_Buck_1007_3D.f3d**. The part models are inside the archive, so it renders in any Fusion account. -**About the 3D in the electronics design:** each part's 3D model is linked to the Adom team's Fusion cloud. Inside the Adom team it shows in the board's 3D view. Outside the team, the board opens fine but the parts show no 3D bodies. To add them back, use the part STEP models in [kicad/3d](../kicad/3d), or use the .f3d above for the whole assembled board.+### Rebuild the library and the board in your own Fusion, with 3D++Each part's 3D model in the .sch, .brd and library above is linked to the Adom team's Autodesk cloud. In your account the board opens and routes fine, but the parts come in without 3D bodies. These two files fix that: they rebuild the library in your own Fusion with a 3D model for every part, then point the board at your copies.++| file | what it is |+|---|---|+| [Buck12V5V_1007_bundle.zip](files/Buck12V5V_1007_bundle.zip) | The library plus one STEP model per part (17), each named after its package so the importer pairs them by name. |+| [rebind_board_3d.py](files/rebind_board_3d.py) | Rewrites the 3D links in the .sch and .brd to the ones in your rebuilt library, matched by package name. Python 3, nothing to install. |++You need [Adom Hydrogen](https://wiki.adom.inc/adom/hydrogen-bootstrap) with Adom Bridge on the PC that runs Fusion, and the [Fusion 360 Bridge](https://wiki.adom.inc/adom/fusion-bridge) installed there. Then tell your AI:++> Rebuild the Buck12V5V_1007 library and the TPS54202_Buck_1007 board in my Fusion with 3D, using the recipe in the fusion-360 README on john/buck-12v5v-molecule.++![The rebuilt board in Fusion's 3D view: every part rendered from the rebuilt library](img/21-rebuilt-3d.jpg)++**The recipe, for your AI.** Bridge verbs run against the PC that has Fusion (`adom-bridge --target <that PC>`). The Python step runs in your Adom workspace, because most Windows PCs have no Python.++1. **Start clean.** `fusion_readiness` must answer `ready:true`. Close every open document first: the import opens each part's library on its own, and an electronics document left in front can stall it.+2. **Stage the files.** Download `Buck12V5V_1007_bundle.zip`, `rebind_board_3d.py`, `TPS54202_Buck_1007.sch` and `TPS54202_Buck_1007.brd` from this folder into your workspace. `send_files` the zip to the PC (for example `{"filePaths":[...],"dest":"%TEMP%/buck_rebuild","destIsFolder":true}`).+3. **Rebuild the library.** `fusion_install_library_bundle {"zipPath":"<folder>/Buck12V5V_1007_bundle.zip","libraryName":"Buck12V5V_1007"}`. It answers at once with a `runId`, `partsToBind: 17` and an empty `unbound[]`. For each part it imports the STEP onto that part's footprint, saves the result to your Autodesk cloud, and writes the 3D link into the library.+4. **Wait for it, and close error dialogs.** Poll `fusion_prove_result {"runId":"<runId>"}` about every 30 seconds; the fields are under `result`, and it is done when `result.success` is set. On each poll, also run `fusion_check_dialogs`. For every part, Fusion shows an "Error ... `<part>.lbr` has errors and cannot be opened" dialog, and the run waits until it is closed. Close it with `desktop_ui_click {"hwnd":<hwnd>,"name":"OK"}` (a keystroke does not reach it). The part still binds. Our run took 27 minutes.+5. **Check the library.** `result.bind.parts[]` lists each part with `success`. The library is at `result.libraryPath` (`Documents/AdomLibraries/Buck12V5V_1007/Buck12V5V_1007.lbr`) and in Fusion's Library Manager under "Adom Libraries". `pull_file` it to your workspace and count `<package3d name=`: it must be 17. If a part failed, run step 3 again: it keeps every 3D link already made and fills in the rest.+6. **Point the board at your 3D.** In your workspace: `python3 rebind_board_3d.py --lbr Buck12V5V_1007.lbr --sch TPS54202_Buck_1007.sch --brd TPS54202_Buck_1007.brd --out rebound`. Expect `OK:` with 17 packages for each file. It stops with `ERROR:` and names any part that has no 3D link yet. `send_files` the two files in `rebound/` to one folder on the PC.+7. **Import the board.** `fusion_new_electronics_from_eagle {"schPath":"<folder>/TPS54202_Buck_1007.sch","brdPath":"<folder>/TPS54202_Buck_1007.brd"}`, then poll `fusion_eagle_import_status {"runId":...}` until `success`. By hand instead: **File > Open > Open from my computer** and pick the rebound .sch.+8. **Check it.** `fusion_routing_state {"expectDocument":"Untitled"}` should show 37 components, every one with `has3d: true`, and `airwireCount: 0`. Look at the 3D tab, then save the design to your own project.++We ran this recipe end to end on November 18, 2026, on a Windows PC with a clean Fusion. All 17 parts got 3D links in that account's cloud. The rebind rewrote 125 links and left none of the old ones. The import placed 37 of 37 parts with 0 airwires and 3D on all 37, shown above. One part (MACHINECONTACTMEDIUM) failed the first pass and bound on a second try. The one visible difference from the video: the inductor's top is plain, because the STEP here is the manufacturer's unmarked model, while the run's model had the part number printed on it. The test ran in an Adom team account, which can also see our original 3D, so it proves the board renders from the rebuilt links, not yet that it renders in an account outside the team.  ## The tools 
fusion-360/files/Buck12V5V_1007_bundle.zipadded
⋯ 1 unchanged line ⋯
fusion-360/files/TPS54202_Buck_1007_all-files.zip
⋯ 1 unchanged line ⋯
fusion-360/files/rebind_board_3d.pyadded+65
@@ -0,0 +1,65 @@+#!/usr/bin/env python3+"""Point the buck board's 3D models at YOUR rebuilt Fusion library.++The shared TPS54202_Buck_1007.sch/.brd carry one 3D link per package, and those links+live in the Adom team's Autodesk cloud, so in anyone else's Fusion the parts come in+without 3D bodies. After you rebuild the library (fusion_install_library_bundle on+Buck12V5V_1007_bundle.zip), your bound library holds a 3D link in YOUR cloud for every+package. This script swaps each old link for yours, by package name, and writes a new+.sch/.brd pair you import with Fusion's EAGLE importer.++  python rebind_board_3d.py --lbr <your bound Buck12V5V_1007.lbr> \+      --sch TPS54202_Buck_1007.sch --brd TPS54202_Buck_1007.brd --out <folder>++Standard library only. Prints OK: or ERROR: and exits non-zero on any unmapped package.+"""+import argparse, os, re, sys++PKG3D = re.compile(r'<package3d name="([^"]+)"[^>]*?wip_urn="([^"]+)"')+++def links(text):+    return {name: urn for name, urn in PKG3D.findall(text) if urn}+++def main():+    ap = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])+    ap.add_argument("--lbr", required=True, help="your library after the 3D bind")+    ap.add_argument("--sch", required=True)+    ap.add_argument("--brd", required=True)+    ap.add_argument("--out", required=True, help="folder for the rebound .sch/.brd")+    a = ap.parse_args()++    new = links(open(a.lbr, encoding="utf-8").read())+    if not new:+        print("ERROR: no 3D links in %s" % a.lbr)+        print("Hint: pass the library AFTER the bind finished (fusion_prove_result reports done), "+              "from the libraryPath that fusion_install_library_bundle returned.")+        return 2+    os.makedirs(a.out, exist_ok=True)+    total = 0+    for src in (a.sch, a.brd):+        text = open(src, encoding="utf-8").read()+        old = links(text)+        missing = sorted(p for p in old if p not in new)+        if missing:+            print("ERROR: your library has no 3D link for: " + ", ".join(missing))+            print("Hint: check fusion_prove_result for those parts, re-run the bind for them, "+                  "then run this again.")+            return 3+        n = 0+        for pkg, urn in old.items():+            n += text.count(urn)+            text = text.replace(urn, new[pkg])+        dst = os.path.join(a.out, os.path.basename(src))+        with open(dst, "w", encoding="utf-8", newline="") as f:+            f.write(text)+        total += n+        print("OK: %s: %d packages, %d links rewritten -> %s" % (os.path.basename(src), len(old), n, dst))+    print("OK: done (%d links). Import the .sch with the .brd beside it: "+          "fusion_new_electronics_from_eagle, or File > Open > Open from my computer." % total)+    return 0+++if __name__ == "__main__":+    sys.exit(main())
fusion-360/img/21-rebuilt-3d.jpgadded
⋯ 1 unchanged line ⋯