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.22
11 files changed
+115−21
.insiders-stage/fusion-bridge/version.json+4−4@@ -1,10 +1,10 @@ { "manifest_version": 1, "name": "fusion360",- "version": "1.11.21",- "url": "https://wiki.adom.inc/download/adom/fusion-bridge/1.11.21/adom-bridge-fusion-v1.11.21.zip",- "sha256": "5575ac9c81dc26ca68698bba0aa88afbdd7b043c4ecb49cd88bb63f22503bf91",- "size": 6555825,+ "version": "1.11.22",+ "url": "https://wiki.adom.inc/download/adom/fusion-bridge/1.11.22/adom-bridge-fusion-v1.11.22.zip",+ "sha256": "4f94eec4cc1ececaf92062a72ee3ca7cef4ca52a00b61cb2ed993d9a9ef1c626",+ "size": 6557505, "verbPrefixes": [ "fusion_" ],
.release-page-head+1−1@@ -1 +1 @@-cc522c23fc7a2e77f96f86bd2d67d31a279b0ca2+4901ad22b44556474e1382c1e608af533018bff4
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.21"+version = "1.11.22" dependencies = [ "base64", "chrono",@@ -273,7 +273,7 @@ dependencies = [ [[package]] name = "fusion-core"-version = "1.11.21"+version = "1.11.22" dependencies = [ "serde", "serde_json",@@ -283,7 +283,7 @@ dependencies = [ [[package]] name = "fusion-lbr"-version = "1.11.21"+version = "1.11.22" dependencies = [ "regex", "roxmltree",@@ -295,14 +295,14 @@ dependencies = [ [[package]] name = "fusion-os-mac"-version = "1.11.21"+version = "1.11.22" dependencies = [ "fusion-core", ] [[package]] name = "fusion-os-win"-version = "1.11.21"+version = "1.11.22" dependencies = [ "fusion-core", "windows-sys 0.59.0",
rust/bridge/src/routing_script.py+78@@ -394,9 +394,87 @@ def copper_signature(items): return result,sorted(vs) +# ---- schematic: complete, non-interactive EAGLE commands only, each its own step ----+_PT = r"\(\s*-?[0-9.]+mm\s+-?[0-9.]+mm\s*\)"+SCH_FORMS = [+ ('ADD', re.compile(r"^ADD '([^'@]+)@([A-Za-z0-9_.-]+)' '([A-Za-z0-9_$+-]+)' (?:M?R(?:0|90|180|270)) " + _PT + r";$")),+ ('VALUE', re.compile(r"^VALUE '[A-Za-z0-9_$+-]+' '[^';]{1,40}';$")),+ ('NET', re.compile(r"^NET '[A-Za-z0-9_+./:$-]+'(?: " + _PT + r"){2,32};$")),+ ('LABEL', re.compile(r"^LABEL " + _PT + " " + _PT + r";$")),+ ('WIRE', re.compile(r"^WIRE [0-9.]+(?: " + _PT + r"){2,32};$")),+ ('TEXT', re.compile(r"^TEXT '[^';]{1,80}' (?:R0|R90) " + _PT + r";$")),+ ('LAYER', re.compile(r"^LAYER [0-9]{1,3};$")),+ ('CHANGE', re.compile(r"^CHANGE (?:STYLE (?:Continuous|LongDash|ShortDash|DashDot)|SIZE [0-9.]+|WIDTH [0-9.]+|RATIO [0-9]{1,2});$")),+ ('WINDOW', re.compile(r"^WINDOW FIT;$")),+]+++def sch_snapshot(app):+ doc = app.activeDocument+ if not doc or app.activeProduct.productType != 'SchematicProductType':+ fail('wrong_document', 'Activate the schematic (fusion_schematic {action:"show"}) before building it')+ with tempfile.TemporaryDirectory(prefix='adom-sch-') as d:+ p = Path(d) / 'snapshot.fsch'+ app.executeTextCommand('Document.CopyToDesktop ' + p.as_posix())+ with zipfile.ZipFile(p) as z:+ entries = [n for n in z.namelist() if n.endswith('.sch')]+ if len(entries) != 1: fail('ambiguous_export', 'Expected exactly one schematic XML in the fresh Fusion export')+ root = ET.fromstring(z.read(entries[0]))+ sch = root.find('drawing/schematic')+ parts = sorted(p.get('name') for p in sch.iter('part'))+ nets = {}+ for n in sch.iter('net'):+ nets.setdefault(n.get('name'), set()).update('%s.%s' % (r.get('part'), r.get('pin')) for r in n.iter('pinref'))+ return doc.name, parts, {k: sorted(v) for k, v in nets.items()}+++def sch_run(app, args):+ """Run a list of schematic commands. ADD is proven against the .lbr on disk first (the+ device must exist there), so the component picker can never open."""+ import time+ name, before, _ = sch_snapshot(app)+ if args.get('expectDocument') not in (None, name): fail('wrong_document', 'expectDocument must match the active schematic name exactly')+ cmds = args.get('commands')+ if not isinstance(cmds, list) or not 1 <= len(cmds) <= 400: fail('invalid_args', 'commands must be a list of 1..400 schematic commands')+ lbr = args.get('libraryPath')+ devices = set()+ if lbr:+ if not Path(lbr).is_file(): fail('library_missing', 'libraryPath is not a file on this machine: ' + str(lbr))+ lroot = ET.parse(lbr).getroot()+ devices = {d.get('name').upper() for d in lroot.iter('deviceset')}+ libname = Path(lbr).stem+ for c in cmds:+ form = next((f for f, rx in SCH_FORMS if isinstance(c, str) and rx.match(c.strip())), None)+ if not form: fail('command_not_allowed', 'Not a complete, non-interactive schematic command: %r' % (c,))+ if form == 'ADD':+ m = SCH_FORMS[0][1].match(c.strip())+ if not lbr: fail('library_required', 'ADD needs libraryPath so the device is proven to exist before ADD runs')+ if m.group(2) != libname: fail('library_mismatch', 'ADD names library %s but libraryPath is %s' % (m.group(2), libname))+ if m.group(1).upper() not in devices: fail('unknown_device', 'No deviceset %s in %s' % (m.group(1), lbr))+ done = []+ if lbr: app.executeTextCommand("Electron.run USE '%s';" % Path(lbr).as_posix())+ pause = min(max(float(args.get('pauseMs', 0)), 0), 3000) / 1000.0+ for c in cmds:+ app.executeTextCommand('Electron.run ' + c.strip())+ done.append(c)+ if pause:+ app.executeTextCommand('Electron.ImmediateRepaint /full')+ import adsk; adsk.doEvents(); time.sleep(pause)+ app.executeTextCommand('Electron.run WINDOW FIT;')+ app.executeTextCommand('Electron.ImmediateRepaint /full')+ _, after, nets = sch_snapshot(app)+ want = sorted({SCH_FORMS[0][1].match(c.strip()).group(3) for c in cmds if c.strip().startswith('ADD ')})+ missing = [p for p in want if p not in after]+ ok = not missing+ return {'success': ok, 'mutated': True, 'verified': ok, 'errorCode': None if ok else 'readback_mismatch',+ 'error': None if ok else 'parts not on the sheet after ADD: %s' % missing, 'documentName': name,+ 'parts': after, 'added': [p for p in after if p not in before], 'nets': nets, 'commands': len(done)}++ def handle(app,args,action): attempted=False; commands=[] try:+ if action=='schematic_run': return sch_run(app,args) 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)}
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"]:+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"]: 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": "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_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