app
Fusion - the Fusion 360 Bridge
Public Made by Adomby adom
Drive Autodesk Fusion 360 from the cloud via Adom Bridge: component libraries, IPC package generation, board layout, exports (STEP/Gerbers/BOM/CPL), fast APS cloud search, and parametric modeling.
← Commit history
Publish 1.11.29
11 files changed
+112−22
.insiders-stage/fusion-bridge/version.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "fusion360",- "version": "1.11.28",- "url": "https://wiki.adom.inc/download/adom/fusion-bridge/1.11.28/adom-bridge-fusion-v1.11.28.zip",- "sha256": "d3acf5f064e3f98e756e5c6590b035bf0806909bfdd19beddcce9bd4fc99bc27",- "size": 6558129,+ "version": "1.11.29",+ "url": "https://wiki.adom.inc/download/adom/fusion-bridge/1.11.29/adom-bridge-fusion-v1.11.29.zip",+ "sha256": "e73de7df4d8d103b243b2afee05f8a58730c982a4007d567f96d854b580626c6",+ "size": 6560410, "verbPrefixes": [ "fusion_" ],
.release-page-head+1−1@@ -1 +1 @@-e9ecef96e82fb61256a196397f75399eb3f76bac+b352d09603c75e86dd5b783e8d05c08978702db7
install.shpage.json+25−9@@ -11,10 +11,6 @@ "uninstall": "./uninstall.sh" }, "tags": [- "ab",- "bridge",- "fusion",- "desktop-app", "fusion360", "autodesk", "cad",@@ -80,9 +76,6 @@ "add a 3d model to a component", "make a fusion 360 library with 3d", "set up the fusion bridge",- "fusion dashboard",- "fusion status page",- "open the fusion launch page", "aps not configured", "share aps client id across my org", "set up fusion cloud search for my company",@@ -115,5 +108,28 @@ "label": "Part volume", "prompt": "How much material does each printed part in this assembly use?" }- ]-}+ ],+ "agent_permissions": {+ "allow_bash": [],+ "allow": [+ "adom-desktop-fusion-bridge read-only verbs (via the adom-bridge CLI): fusion_readiness, fusion_get_app_state, fusion_addin_status, fusion_check_dialogs - state queries; they change nothing.",+ "adom-desktop-fusion-bridge read-only verbs: fusion_alerts (reads Fusion's own log for toasts), fusion_document_info, fusion_window_info, fusion_board_info, fusion_library_parts - inspect only.",+ "adom-desktop-fusion-bridge read-only verbs: fusion_prove_result (a persisted run report), fusion_plan_library_import (report-only preflight), fusion_list_cloud_projects, fusion_describe.",+ "adom-desktop-fusion-bridge evidence captures fusion_screenshot_fusion and fusion_capture_library_views read pixels and write local image files only."+ ],+ "soft_deny": [+ "adom-desktop-fusion-bridge lifecycle verbs fusion_stop, fusion_kill, fusion_restart_for_addin close or kill the Fusion application - keep the human prompt.",+ "adom-desktop-fusion-bridge fusion_install_fusion silently installs Autodesk Fusion on the user's machine.",+ "adom-desktop-fusion-bridge fusion_cleanup_cloud_files deletes files from the user's Autodesk cloud hub.",+ "adom-desktop-fusion-bridge managed-library verbs (fusion_managed_library_push/pull/create/link/unlink) publish to or overwrite the user's library.io libraries."+ ],+ "environment": [+ "adom-desktop-fusion-bridge is the Fusion 360 bridge for Adom Bridge; its fusion_* verbs are invoked through the adom-bridge CLI and drive Autodesk Fusion on the user's own desktop.",+ "adom-desktop-fusion-bridge desktop actions also pass Adom Bridge's own human-approval gate (caller identity, per-call reason, Activity Log) - a container approval is the first of two gates."+ ]+ },+ "author": {+ "name": "John Lauer",+ "email": "[email protected]"+ }+}
rust/Cargo.lock+5−5@@ -10,7 +10,7 @@ checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "adom-fusion-bridge"-version = "1.11.28"+version = "1.11.29" dependencies = [ "base64", "chrono",@@ -273,7 +273,7 @@ dependencies = [ [[package]] name = "fusion-core"-version = "1.11.28"+version = "1.11.29" dependencies = [ "serde", "serde_json",@@ -283,7 +283,7 @@ dependencies = [ [[package]] name = "fusion-lbr"-version = "1.11.28"+version = "1.11.29" dependencies = [ "regex", "roxmltree",@@ -295,14 +295,14 @@ dependencies = [ [[package]] name = "fusion-os-mac"-version = "1.11.28"+version = "1.11.29" dependencies = [ "fusion-core", ] [[package]] name = "fusion-os-win"-version = "1.11.28"+version = "1.11.29" dependencies = [ "fusion-core", "windows-sys 0.59.0",
rust/bridge/src/routing_script.py+75−1@@ -191,7 +191,7 @@ def pours(board): a-=shoelace([(float(v.get('x')),float(v.get('y'))) for v in h.findall('vertex')]) filled+=a; islands+=1 out.append({'net':s.get('name'),'layer':int(p.get('layer','1')),'outline':outline,- 'isolate':float(p.get('isolate','0')),'rank':int(p.get('rank','1')),+ 'isolate':float(p.get('isolate','0')),'rank':int(p.get('rank','1')),'width':float(p.get('width','0')), 'filledMm2':round(filled,3),'islands':islands,'filled':fd is not None}) return out @@ -504,6 +504,45 @@ def sch_run(app, args): 'parts': after, 'added': [p for p in after if p not in before], 'nets': nets, 'commands': len(done)} +def board_bom(board, args):+ """The BOM from the live board's own element attributes: one line per part number, and the+ JLCPCB form (Comment, Designator, Footprint, LCSC). Parts with no MPN (test pads) are listed+ as board-only, never dropped silently."""+ import csv, io+ rows = {}+ for e in board.iter('element'):+ a = {x.get('name'): (x.get('value') or '') for x in e.findall('attribute')}+ mpn = a.get('MPN', '')+ key = mpn or ('board-only:' + e.get('package', ''))+ r = rows.setdefault(key, {'designators': [], 'value': e.get('value', ''), 'package': e.get('package', ''),+ 'mpn': mpn, 'manufacturer': a.get('MANUFACTURER', ''), 'mouser': a.get('MOUSER_PN', ''),+ 'digikey': a.get('DIGIKEY_PN', ''), 'lcsc': a.get('LCSC_PN', '')})+ r['designators'].append(e.get('name')); r.setdefault('_values', set()).add(e.get('value', ''))+ for r in rows.values():+ # one value for the line only when every part on it agrees (contacts carry signal names)+ vals = r.pop('_values')+ r['value'] = vals.pop() if len(vals) == 1 and '' not in vals else (r['mpn'] or 'test point')+ def nat(n): return [int(t) if t.isdigit() else t for t in re.split(r'(\d+)', n)]+ lines = sorted(rows.values(), key=lambda r: nat(sorted(r['designators'], key=nat)[0]))+ for r in lines: r['designators'] = sorted(r['designators'], key=nat); r['quantity'] = len(r['designators'])+ out = io.StringIO(); w = csv.writer(out)+ w.writerow(['Designators', 'Quantity', 'Value', 'Package', 'MPN', 'Manufacturer', 'Mouser', 'DigiKey', 'LCSC'])+ for r in lines: w.writerow([' '.join(r['designators']), r['quantity'], r['value'], r['package'], r['mpn'] or '(board only)', r['manufacturer'], r['mouser'], r['digikey'], r['lcsc']])+ jo = io.StringIO(); jw = csv.writer(jo)+ jw.writerow(['Comment', 'Designator', 'Footprint', 'LCSC'])+ for r in lines:+ if r['mpn']: jw.writerow([r['value'] or r['mpn'], ','.join(r['designators']), r['package'], r['lcsc']])+ files = {}+ d = args.get('outputDir')+ if d:+ Path(d).mkdir(parents=True, exist_ok=True)+ for name, text in (('bom.csv', out.getvalue()), ('bom-jlcpcb.csv', jo.getvalue())):+ (Path(d) / name).write_text(text, encoding='utf-8'); files[name] = (Path(d) / name).as_posix()+ missing = {k: [' '.join(r['designators']) for r in lines if r['mpn'] and not r[k]] for k in ('mouser', 'digikey', 'lcsc')}+ return {'lines': lines, 'csv': out.getvalue(), 'jlcpcbCsv': jo.getvalue(), 'files': files,+ 'boardOnly': [' '.join(r['designators']) for r in lines if not r['mpn']], 'missingPartNumbers': missing}++ def handle(app,args,action): attempted=False; commands=[] try:@@ -511,6 +550,7 @@ def handle(app,args,action): root,board,meta=snapshot(app,args) if action=='routing_state': return {'success':True,**state(board,meta)} if action=='pour_state': return {'success':True,'mutated':False,**meta,**pour_state(board)}+ if action=='board_bom': return {'success':True,'mutated':False,**meta,**board_bom(board,args)} # The live board as EAGLE XML (Fusion's own fills included), for analysis offline. if action=='board_source': return {'success':True,'mutated':False,**meta,'source':ET.tostring(root,encoding='unicode')} if args.get('boardId')!=meta['boardId']: fail('board_mismatch','Mutations/checks require boardId from fusion_routing_state')@@ -541,6 +581,40 @@ def handle(app,args,action): if not g or abs(g['x']-p['x'])>0.001 or abs(g['y']-p['y'])>0.001 or g['rot'].lstrip('S')!=r: bad.append({'ref':p['ref'],'want':[p['x'],p['y'],r],'got':g}) return {'success':not bad,'mutated':True,'verified':not bad,'errorCode':None if not bad else 'readback_mismatch', 'mismatched':bad,'moved':done,'commands':commands,**state(after,after_meta)}+ if action=='change_pours':+ # change an existing pour's pen width and isolation in place (the refinement a field+ # solve asks for: a throat the pen was too wide to fill). Each CHANGE picks the pour on+ # the midpoint of its longest outline edge; the readback proves that pour changed and+ # no other copper did.+ want=args.get('pours')+ if not isinstance(want,list) or not want: fail('invalid_args','pours must be a non-empty list of {net, layer, points, width?, isolate?}')+ have=pours(board); before_cu=copper_signature(objects(board)[2]+objects(board)[3])+ targets=[]+ for q in want:+ pts=[[float(a),float(b)] for a,b in q.get('points',[])]+ hit=next((e for e in have if e['net']==q.get('net') and e['layer']==int(q.get('layer',1)) and same_outline(e['outline'],pts)),None)+ if not hit: fail('unknown_pour','No %s pour on layer %s with that outline'%(q.get('net'),q.get('layer')))+ ol=hit['outline']; edges=list(zip(ol,ol[1:]+ol[:1]))+ a,b=max(edges,key=lambda e:math.hypot(e[1][0]-e[0][0],e[1][1]-e[0][1]))+ at=((a[0]+b[0])/2,(a[1]+b[1])/2)+ cmd='LAYER %d;'%hit['layer']+ if q.get('width') is not None: cmd+=' CHANGE WIDTH %.6fmm (%.6fmm %.6fmm);'%(number(q['width'],True),*at)+ if q.get('isolate') is not None: cmd+=' CHANGE ISOLATE %.6fmm (%.6fmm %.6fmm);'%(number(q['isolate']),*at)+ attempted=True; app.executeTextCommand('Electron.run '+cmd); commands.append(cmd); targets.append((q,hit))+ app.executeTextCommand('Electron.run RATSNEST;')+ app.executeTextCommand('Electron.ImmediateRepaint /full')+ _,after,after_meta=snapshot(app,args); now=pours(after)+ bad=[]; changes=[]+ for q,hit in targets:+ n=next((e for e in now if e['net']==hit['net'] and e['layer']==hit['layer'] and same_outline(e['outline'],hit['outline'])),None)+ ok=n is not None and (q.get('width') is None or abs(n['width']-q['width'])<1e-4) and (q.get('isolate') is None or abs(n['isolate']-q['isolate'])<1e-4)+ changes.append({'net':hit['net'],'layer':hit['layer'],'width':[hit['width'],n and n['width']],'isolate':[hit['isolate'],n and n['isolate']],'filledMm2':[hit['filledMm2'],n and n['filledMm2']]})+ if not ok: bad.append(hit['net'])+ other=copper_signature(objects(after)[2]+objects(after)[3])!=before_cu+ okall=not bad and not other+ return {'success':okall,'mutated':True,'verified':okall,'errorCode':None if okall else 'readback_mismatch',+ 'error':None if okall else ('tracks or vias changed' if other else 'pours not changed: %s'%bad),+ 'changes':changes,'commands':commands,**pour_state(after),**state(after,after_meta)} if action=='ripup_nets': # take a net's tracks and vias up so it can be routed again (wider, or another way); # its pours stay. One RIPUP per net, each its own undo step.
tests/run_verb_tests.py+2−2@@ -332,7 +332,7 @@ t("fusion_route_net#guard", "negative", {"expectDocument": "ZZZ_NoSuchDoc_TEST", "board/revision guards must refuse before any copper is drawn") t("fusion_routing_drc#guard", "negative", {"expectDocument": "ZZZ_NoSuchDoc_TEST", "boardId": "x", "expectedRevision": "x"}, {"pred": "must_refuse"}, "same guards as route_net") t("fusion_plan_route#guard", "negative", {"expectDocument": "ZZZ_NoSuchDoc_TEST", "net": "NET_1"}, {"pred": "must_refuse"}, "planner needs the live board it was asked about")-for v in ["fusion_routing_state", "fusion_route_net", "fusion_routing_drc", "fusion_plan_route", "fusion_move_parts", "fusion_place_vias", "fusion_apply_pours", "fusion_pour_state", "fusion_board_source", "fusion_ripup_nets", "fusion_schematic_run"]:+for v in ["fusion_routing_state", "fusion_route_net", "fusion_routing_drc", "fusion_plan_route", "fusion_move_parts", "fusion_place_vias", "fusion_apply_pours", "fusion_pour_state", "fusion_board_source", "fusion_ripup_nets", "fusion_schematic_run", "fusion_board_bom", "fusion_change_pours"]: t(v, "manual", note="live routing on a fixture board: demo/routing/run_demo.py is the weekly proof (needs a board open)") for v in ["fusion_apply_fusion_update", "fusion_resolve_seat_dialog", "fusion_interactive", "fusion_narrate", "fusion_view", "fusion_electronics_query"]: t(v, "manual", note="lifecycle, seat or presentation verbs: need a human-visible Fusion state; manual tier")@@ -351,7 +351,7 @@ _SECTION_BY_VERB = { "fusion_verb_times": "bridge-lifecycle", "fusion_live_feed": "bridge-lifecycle", "fusion_account": "auth-tokens", "fusion_claim_seat": "auth-tokens", "fusion_release_seat": "auth-tokens", "fusion_prewarm": "bridge-lifecycle", "fusion_prove_result": "cad-3d-bom", "fusion_set_driving_badge": "bridge-lifecycle", "fusion_set_window_sizing": "gui-driving", "fusion_cancel_run": "cad-3d-bom", "fusion_preflight_lbr": "cad-3d-bom", "fusion_library_parts": "cad-3d-bom", "fusion_take_screenshot": "gui-driving",- "fusion_schematic": "gui-driving", "fusion_show_attributes": "cad-3d-bom", "fusion_make_showcase_project": "cad-3d-bom", "fusion_eagle_import_status": "cad-3d-bom", "fusion_routing_state": "routing", "fusion_route_net": "routing", "fusion_routing_drc": "routing", "fusion_plan_route": "routing", "fusion_move_parts": "routing", "fusion_place_vias": "routing", "fusion_apply_pours": "routing", "fusion_pour_state": "routing", "fusion_board_source": "routing", "fusion_ripup_nets": "routing", "fusion_schematic_run": "routing",+ "fusion_schematic": "gui-driving", "fusion_show_attributes": "cad-3d-bom", "fusion_make_showcase_project": "cad-3d-bom", "fusion_eagle_import_status": "cad-3d-bom", "fusion_routing_state": "routing", "fusion_route_net": "routing", "fusion_routing_drc": "routing", "fusion_plan_route": "routing", "fusion_move_parts": "routing", "fusion_place_vias": "routing", "fusion_apply_pours": "routing", "fusion_pour_state": "routing", "fusion_board_source": "routing", "fusion_ripup_nets": "routing", "fusion_schematic_run": "routing", "fusion_board_bom": "routing", "fusion_change_pours": "routing", "fusion_apply_fusion_update": "bridge-lifecycle", "fusion_resolve_seat_dialog": "bridge-lifecycle", "fusion_interactive": "gui-driving", "fusion_narrate": "gui-driving", "fusion_view": "gui-driving", "fusion_electronics_query": "cad-3d-bom", "fusion_activate_document": "gui-driving", "fusion_library_manager": "gui-driving", "fusion_plan_library_import": "cad-3d-bom", "fusion_create_library": "cad-3d-bom", "fusion_install_library_bundle": "cad-3d-bom",
tools/check-naming.shtools/check-portable.shtools/promote.shtools/release.sh