← Commit history

0.1.42: flat mark keeps its colour; dark mark is linear 0.012

John Lauer ·66a462ef0d ·6d ago ·parent 330880a
8 files changed +25−16
Cargo.lock+10−10
@@ -4,7 +4,7 @@ version = 4  [[package]] name = "adom-aiflow"-version = "0.1.41"+version = "0.1.42" dependencies = [  "aiflow-analyze",  "aiflow-board",@@ -24,7 +24,7 @@ dependencies = [  [[package]] name = "aiflow-analyze"-version = "0.1.41"+version = "0.1.42" dependencies = [  "serde",  "serde_json",@@ -33,7 +33,7 @@ dependencies = [  [[package]] name = "aiflow-board"-version = "0.1.41"+version = "0.1.42" dependencies = [  "serde",  "serde_json",@@ -41,7 +41,7 @@ dependencies = [  [[package]] name = "aiflow-bridge"-version = "0.1.41"+version = "0.1.42" dependencies = [  "aiflow-board",  "serde",@@ -50,7 +50,7 @@ dependencies = [  [[package]] name = "aiflow-copper"-version = "0.1.41"+version = "0.1.42" dependencies = [  "aiflow-board",  "aiflow-grid",@@ -60,7 +60,7 @@ dependencies = [  [[package]] name = "aiflow-grid"-version = "0.1.41"+version = "0.1.42" dependencies = [  "aiflow-board",  "serde",@@ -69,7 +69,7 @@ dependencies = [  [[package]] name = "aiflow-place"-version = "0.1.41"+version = "0.1.42" dependencies = [  "aiflow-board",  "serde",@@ -78,7 +78,7 @@ dependencies = [  [[package]] name = "aiflow-pours"-version = "0.1.41"+version = "0.1.42" dependencies = [  "aiflow-board",  "aiflow-copper",@@ -88,7 +88,7 @@ dependencies = [  [[package]] name = "aiflow-router"-version = "0.1.41"+version = "0.1.42" dependencies = [  "aiflow-board",  "aiflow-grid",@@ -98,7 +98,7 @@ dependencies = [  [[package]] name = "aiflow-run"-version = "0.1.41"+version = "0.1.42" dependencies = [  "serde",  "serde_json",
Cargo.toml+1−1
@@ -14,7 +14,7 @@ members = [ ]  [workspace.package]-version = "0.1.41"+version = "0.1.42" edition = "2021" license = "MIT" repository = "https://wiki.adom.inc/adom/adom-aiflow"
bin/adom-aiflow
⋯ 1 unchanged line ⋯
docs/release-0.1.42.mdadded+3
@@ -0,0 +1,3 @@+# AI Flow 0.1.42++- **The flat MPN mark keeps its colour in the STEP.** 0.1.41 lifted the mark with a located transform, and OCCT's STEP writer drops the colour of a located shape, so viewers fell back to their default colour. The lift is now baked into the geometry and the colour set on the part (general and surface). Mark colours are linear RGB as OCCT stores them: `--mark dark` is now 0.012 (0.08 already renders as a mid grey).
package.json+1−1
@@ -1,7 +1,7 @@ {   "slug": "adom-aiflow",   "type": "app",-  "version": "0.1.41",+  "version": "0.1.42",   "title": "AI Flow",   "description": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. One Rust binary with a crate per step (placement helpers, a grid router with Kelvin taps, pours with keepouts, KiCad's DRC gate, live landing through the KiCad Bridge, copper measurement, current and thermal analysis) and a finish line that refuses an unfinished board. Every command answers with hints for the AI; every turn, its thinking time and every rework loop go into run.jsonl, so Claude, Codex and any other engine are compared on the same flow. KiCad today; Altium, Fusion and Adom's own web apps next.",   "summary": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. The AI thinks its way from placement through routing, pours, current and thermal analysis to a delivered video; the binary does the fast, deterministic parts of every step, hands back hints, and keeps a ledger of every turn, every return to an earlier step, and the clock from the prompt to done.",
page.json+1−1
@@ -1,7 +1,7 @@ {   "slug": "adom-aiflow",   "type": "app",-  "version": "0.1.41",+  "version": "0.1.42",   "title": "AI Flow",   "description": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. One Rust binary with a crate per step (placement helpers, a grid router with Kelvin taps, pours with keepouts, KiCad's DRC gate, live landing through the KiCad Bridge, copper measurement, current and thermal analysis) and a finish line that refuses an unfinished board. Every command answers with hints for the AI; every turn, its thinking time and every rework loop go into run.jsonl, so Claude, Codex and any other engine are compared on the same flow. KiCad today; Altium, Fusion and Adom's own web apps next.",   "summary": "Adom's AI Flow: a tool to help the AI follow all of the steps it takes to build a board. The AI thinks its way from placement through routing, pours, current and thermal analysis to a delivered video; the binary does the fast, deterministic parts of every step, hands back hints, and keeps a ledger of every turn, every return to an earlier step, and the clock from the prompt to done.",
tools/laser-etch/etch_part.py+1−1
@@ -37,7 +37,7 @@ if dy > dx * 1.02:                                  # long axis along Y: turn it req = urllib.request.Request(f"{a.service.rstrip('/')}/etch?mpn={urllib.request.quote(a.mpn)}&frac={a.frac}", data=open(cur, "rb").read(), method="POST") with urllib.request.urlopen(req, timeout=300) as resp:     open(f"{tmp}/etched.step", "wb").write(resp.read()); size = resp.headers.get("X-Etch-Fontsize-Mm")-rgb = {"light": "0.78,0.78,0.76", "dark": "0.08,0.08,0.08"}.get(a.mark, a.mark)+rgb = {"light": "0.78,0.78,0.76", "dark": "0.012,0.012,0.012"}.get(a.mark, a.mark) run(os.path.join(HERE, "merge_etch.py"), cur, f"{tmp}/etched.step", f"{tmp}/merged.step", "0.01", rgb); cur = f"{tmp}/merged.step" for i, (deg, ax) in enumerate(reversed(undo)):     nxt = f"{tmp}/undo{i}.step"; run(os.path.join(HERE, "rotate_step_xcaf.py"), cur, nxt, deg, ax); cur = nxt
tools/laser-etch/merge_etch.py+8−2
@@ -3,7 +3,8 @@ drops the model's own colours. Keep the ORIGINAL coloured model untouched and add only the service's inlay solids (the thin solids at the top of the etched part) as one light-grey 'laser_etch' part, lifted a hair so it never z-fights with the top face.-Usage: merge_etch.py <original.step> <etched.step> <out.step> [lift_mm=0.01] [r,g,b of the mark, default light grey]"""+Usage: merge_etch.py <original.step> <etched.step> <out.step> [lift_mm=0.01] [r,g,b of the mark, default light grey]+r,g,b are LINEAR RGB as OCCT stores them (the STEP file gets sRGB): 0.012 renders near-black, 0.04 is already a mid grey (0.22 sRGB).""" import os, sys from OCP.STEPControl import STEPControl_Reader, STEPControl_AsIs from OCP.STEPCAFControl import STEPCAFControl_Reader, STEPCAFControl_Writer@@ -47,13 +48,18 @@ for s in inlay:         if ad.GetType() != GeomAbs_Plane: continue         n = ad.Plane().Axis().Direction()         if abs(n.Z()) > 0.99 and abs(box(f)[5] - z1s) < 1e-4: bb.Add(comp, f); nfaces += 1-t = gp_Trsf(); t.SetTranslation(gp_Vec(0, 0, lift)); comp2 = comp.Moved(TopLoc_Location(t))+t = gp_Trsf(); t.SetTranslation(gp_Vec(0, 0, lift))+from OCP.BRepBuilderAPI import BRepBuilderAPI_Transform+comp2 = BRepBuilderAPI_Transform(comp, t, True).Shape()   # baked (no TopLoc): a located shape becomes an XCAF reference whose colour the STEP writer drops doc = TDocStd_Document(TCollection_ExtendedString("d")) cr = STEPCAFControl_Reader(); cr.SetColorMode(True); cr.SetNameMode(True); cr.SetLayerMode(True); cr.ReadFile(orig); cr.Transfer(doc) st = XCAFDoc_DocumentTool.ShapeTool_s(doc.Main()); ct = XCAFDoc_DocumentTool.ColorTool_s(doc.Main()) lab = st.AddShape(comp2, False) TDataStd_Name.Set_s(lab, TCollection_ExtendedString("laser_etch")) ct.SetColor(lab, Quantity_Color(rgb[0], rgb[1], rgb[2], Quantity_TOC_RGB), XCAFDoc_ColorType.XCAFDoc_ColorSurf)+ct.SetColor(lab, Quantity_Color(rgb[0], rgb[1], rgb[2], Quantity_TOC_RGB), XCAFDoc_ColorType.XCAFDoc_ColorGen) w = STEPCAFControl_Writer(); w.SetColorMode(True); w.SetNameMode(True); w.SetLayerMode(True) w.Transfer(doc, STEPControl_AsIs); w.Write(out)+ib = box(comp2) if inlay else None+print(f"mark bbox " + (" ".join(f"{v:.3f}" for v in ib) if ib else "none")) print(f"inlay solids {len(inlay)}; {'flat top faces ' + str(nfaces) if flat else 'solid glyphs'}; etched top z {top:.3f}")