← Commit history

v1.6.20: measured margin enforcement

John Lauer ·4e257b6300 ·3mo ago ·parent 191917b
5 files changed +46−8
BRIDGE_VERSION+1−1
@@ -1 +1 @@-1.6.19\ No newline at end of file+1.6.20\ No newline at end of file
CHANGELOG.md+7
@@ -3,6 +3,13 @@ All notable changes to the Adom Desktop Fusion 360 bridge, newest first. Canonical: https://wiki.adom.inc/adom/adom-desktop-fusion-bridge ยท GitHub backup: `adom-inc/adom-desktop-fusion-bridge` +## 1.6.20 - 2026-07-04++- **The 10% marking margin is now ENFORCED by measurement, not estimated.** Fusion's text font runs+  wider than the 0.75h glyph estimate ('ADOM-A' rendered edge-to-edge - John caught it), so after+  placing the text the verb measures its REAL sketch bbox and shrink-to-fits if it busts the margin+  box (both axes; up to 2 passes). The manifest records `textWidthMeasuredMm` + `fitIterations`.+ ## 1.6.19 - 2026-07-04  - **Markings run along the LONGEST axis of the top face** (auto-rotated 90 deg when the long axis is
adom-bridge-fusion-manifest.json+5−5
@@ -1,13 +1,13 @@ {   "manifest_version": 1,   "name": "fusion360",-  "version": "1.6.19",-  "url": "https://wiki.adom.inc/download/adom/adom-desktop-fusion-bridge/1.6.19/adom-bridge-fusion-v1.6.19.zip",-  "sha256": "6bb2970739a8a5733b7c6e557b9da4e0c111dc1f2cc6271b2a1e1ffd2fbf1692",-  "size": 312585,+  "version": "1.6.20",+  "url": "https://wiki.adom.inc/download/adom/adom-desktop-fusion-bridge/1.6.20/adom-bridge-fusion-v1.6.20.zip",+  "sha256": "62a5eed13ea0438d4c88a845f13d761eecf0bd581adccf3caff38c3e0e83ec40",+  "size": 313296,   "verbPrefixes": [     "fusion_"   ],   "healthEndpoint": "/status",-  "released_at": "2026-07-04T18:00:00Z"+  "released_at": "2026-07-04T18:45:00Z" }\ No newline at end of file
bridge.json+1−1
@@ -2,7 +2,7 @@   "manifest_version": 1,   "name": "fusion360",   "displayName": "Autodesk Fusion 360",-  "version": "1.6.19",+  "version": "1.6.20",   "description": "Drive Autodesk Fusion 360 from the cloud: launch Fusion, electronics board layout, design rules, exports (STEP/IGES/STL/3MF/USDZ/OBJ/DXF/DWG/Gerbers/BOM/CPL), fast APS server-indexed cloud search plus browse/recent/file-info/versions, cloud file download/upload and folder creation, and in-app parametric modeling (fusion_run_modeling_script). Never-charge: APS calls are capped to the free tier.",   "homepage": "https://wiki.adom.inc/adom/adom-desktop-fusion-bridge",   "author": "Adom Inc.",
server.py+32−1
@@ -2108,6 +2108,34 @@ if {etch!r}:         except Exception:             rot_deg = 0  # older API without angle - fall back to unrotated     txt = sk.sketchTexts.add(ti)+    # MEASURE-AND-CORRECT (the margin is a CONTRACT): font metrics vary, so the+    # 0.75h glyph estimate can under-shoot ('ADOM-A' rendered edge-to-edge). After+    # placing, measure the text's real bbox; if it busts the 10%-margin box,+    # recreate at the scaled-down height. Never trust an estimate you can measure.+    fit_iterations = 0+    measured_w = None+    for _pass in range(2):+        tb = txt.boundingBox+        t_ext_x = abs(tb.maxPoint.x - tb.minPoint.x)+        t_ext_y = abs(tb.maxPoint.y - tb.minPoint.y)+        measured_w = max(t_ext_x, t_ext_y)   # the baseline-axis extent+        measured_c = min(t_ext_x, t_ext_y)   # the cross-axis extent (line stack)+        if measured_w <= w and measured_c <= box_h_cap:+            break+        scale = min(w / max(measured_w, 1e-6), box_h_cap / max(measured_c, 1e-6)) * 0.95+        h = max(0.008, h * scale)+        txt.deleteMe()+        ti = sk.sketchTexts.createInput2({etch!r}, h)+        ti.setAsMultiLine(c1, c2,+                          adsk.core.HorizontalAlignments.CenterHorizontalAlignment,+                          adsk.core.VerticalAlignments.MiddleVerticalAlignment, 0)+        if rot_deg:+            try:+                ti.angle = _math.pi / 2.0+            except Exception:+                pass+        txt = sk.sketchTexts.add(ti)+        fit_iterations += 1     marking_geom = {{         'chipBBox': {{'min': [round(gmin,5), 0, 0], 'maxZ': round(gmax,5)}},         'chipBBoxZ': {{'min': round(gmin,5), 'max': round(gmax,5)}},@@ -2121,6 +2149,8 @@ if {etch!r}:                     'marginPct': 10}},         'textHeightMm': round(h*10,4), 'lines': n_lines, 'maxLineChars': max_chars,         'heightAuto': not bool({etch_height_mm!r}),+        'textWidthMeasuredMm': round(measured_w*10,4) if measured_w else None,+        'fitIterations': fit_iterations,         'why': {{'band': 'top 5% of whole-chip bbox excludes terminal tops that tie the body',                 'largestArea': 'molded body top beats small terminal faces in the band',                 'longAxis': 'text runs along the longest face axis for maximum room',@@ -2226,7 +2256,8 @@ result = {{'type': {pkg_type!r}, 'bodies': inv, 'etched': etched, 'stepPath': st                     "(override with etchHeightMm). Default style is raised+white for CONTRAST (humans "                     "can't read a dark-on-dark emboss); pass etchStyle:'engraved' for a sunken laser cut. "                     "The text ALWAYS runs along the LONGEST axis of the top face (rotated 90deg when "-                    "needed) for maximum room, and multi-line markings work - join lines with a newline "+                    "needed) for maximum room; the 10% margin is ENFORCED by measuring the placed text bbox "+                    "and shrink-to-fitting (see fitIterations in the manifest). Multi-line markings work - join lines with a newline "                     "(e.g. 'LM358' + newline + 'ADOM-A' for MPN + variant; per-line auto-fit). "                     "SIDECAR MANIFEST: when outputStep is set, <step>.manifest.json records every "                     "setting picked + WHY + the calculated bboxes (chip bbox, top band, face extents, "