← Commit history

Publish 0.2.0

Ray ·35be75e96e ·7d ago ·parent df6a9bd
5 files changed +128−60
README.md+37−22
@@ -5,32 +5,44 @@ downloadable STEP, a Fusion 360 import, and the derived 3D model all carry the part number on the die. Not a viewer-only texture: it's real geometry in the STEP.  Why STEP-layer: Fusion imports a library via the **STEP**, not a GLB. And a laser-mark on black epoxy is a **color change**, not a groove — so the mark is a shallow-recess filled with a light-grey `laser_etch` inlay body, which reads on every-surface (a bare recess is invisible in a flat-shaded render).+mark on black epoxy is a **color change**, not a groove, so the mark is a flat+light sheet just off the face, in its own `Adom.LaserEtch` part you can hide.  ## Call it (HTTP service) -Live at `https://laserchip-6dn1tl7vjz5u.adom.cloud` — POST a STEP, get an etched STEP:+Since **0.2.0** the service hands the STEP to service-occt `/laser-etch`, the same etch the+component pages use: the part comes back **untouched, every colour kept**, with the mark as its own+`Adom.LaserEtch` part, a flat light (or dark) sheet 5 µm off the face. The 0.1.0 CadQuery path+(recess + grey inlay, part repainted) is still there as `engine=legacy`.  ```bash curl -X POST "https://laserchip-6dn1tl7vjz5u.adom.cloud/etch?mpn=STM32F103C8T6" \      --data-binary @chip.step -o etched.step ``` -- `mpn` (required) — the part number to etch.-- `frac` (default `0.55`) — mark width as a fraction of the die; smaller = subtler.-- Response is `application/step`; the `X-Etch-Fontsize-Mm` header reports the size.-- `GET /health` → `{"ok":true,"version":"…"}`.+- `mpn` (required): the part number to etch.+- `surface=auto|top|side|side:-y|side:+y|side:-x|side:+x` (default `auto`): `auto` marks an LED, or+  a part whose top is busy (2+ openings in the top face and recessed faces covering 15 %+ of the+  footprint: ToF windows, lenses), on the side wall that fits the largest text; everything else on top.+- `style=flat|recessed` (default flat), `color=auto|light|dark` (default auto: contrasts with the+  marked face), `fit=adom|compact`, `rot=0|90|180|270`, `pin1_xy=x,y`, `upright=auto|off`,+  `busy_top=on|off`. `frac` is accepted and ignored (legacy only).+- A Y-up model (a vendor can lying along Y) is stood up for the fit; the mark is put back in the+  model's own frame.+- Response is `application/step`. Headers: `X-Etch-Fontsize-Mm`, `X-Etch-Face`,+  `X-Etch-Face-Reason` (why auto chose it), `X-Etch-Stood-Up`, `X-Etch-Job` (the service-occt job,+  whose `/jobs/<id>` has the full fit report). A part the text cannot fit is a 422 with the reason.+- `POST /inlay?mpn=…`: the mark alone, as its own STEP, to merge onto a published GLB.+- `GET /health` → `{"ok":true,"version":"…","engine":"service-occt"}`.  No cadquery needed on your end — any Adom app can call the service.  ## Marking checklist (read before you etch) -The raw `/etch` endpoint writes the MPN across **X** at the size `frac` gives it and repaints the-whole part black and grey. It does not know the part's long axis, its end caps, pin 1 or the-standard pose, so on its own it often puts the text across the short side, upside down, or onto the-terminations. For a component model, use the planner that wraps the shared STEP service:+Since 0.2.0 `/etch` keeps the part's own colours, runs the mark along the long axis of the top+face, stands Y-up models up and marks a busy top on a side. It does not know the part's end caps or+the page's standard pose, and it reads from pin 1 only when it finds a pin-1 dot (or gets `pin1_xy`+/ `rot`). For a component model, use the planner that wraps the shared STEP service:  ```bash adom-aiflow-etch --in part.step --mpn <MPN> --out part-etched.step --footprint part.kicad_mod@@ -56,26 +68,29 @@ The rule it enforces: 6. **Look at the result at widget size before you report** (the gate reports the cap height in    pixels at 320 px and prints `Hint:` lines saying what to rerun when it fails). -Use `/etch` directly only for a quick look at a simple Z-up IC whose long axis is already X.+Use `/etch` directly for a quick mark, or when the planner's footprint inputs are not at hand. -## CLI+## Client CLI (installed by this package)  ```bash-adom-chip-laser etch  --in chip.step --mpn STM32F103C8T6 --out etched.step-adom-chip-laser board --in chip.step --mpn STM32F103C8T6 --name stm32f103c8t6 \-      --out-dir OUT --kicad-mod fp.kicad_mod+adom-chip-laser etch  <chip.step> <MPN> [out.step] [key=value ...]   # the part + its mark+adom-chip-laser inlay <chip.step> <MPN> [out.step] [key=value ...]   # the mark alone+adom-chip-laser etch vl53l7cx.step VL53L7CX out.step surface=side:-y color=light+adom-chip-laser health | url | version ``` -- **`etch`** — the core: chip STEP + MPN → etched STEP.-- **`board`** — full 3D deliverables: etched chip STEP + chip GLB (real materials +-  etch) + animated board GLB (chip on FR4/copper/solder/silk, toggleable-  `laser_etch` layer, pick-and-place animation).+`key=value` arguments go on the query (`surface`, `style`, `color`, `fit`, `rot`, `pin1_xy`,+`upright`, `busy_top`); the client prints the face, the reason and the font size. Override the+service with `ADOM_CHIP_LASER_URL`.++The source repo `adom-inc/adom-chip-laser` also has a Python `board` command (etched chip GLB ++animated board GLB); it still uses the legacy CadQuery etch.  ## What you get  - A **downloadable STEP** whose die carries the MPN — survives into Fusion. - A **3D model** with the mark and a toggleable `laser_etch` layer.-- Auto-fit, single subtle line, MPN-only. Proven across **LQFP / QFN / TQFP / LGA**.+- Auto-fit along the long axis, as large as fits, MPN-only; every colour of the source kept.  First live on the component page [`adom/stm32f103c8t6`](https://wiki.adom.inc/adom/stm32f103c8t6). 
SKILL.md+36−17
@@ -14,34 +14,54 @@ Fusion / STEP export", "etch the die".  **HTTP service** (no local cadquery needed — any container can call it): +Since **0.2.0** the service hands the STEP to service-occt `/laser-etch`, the same etch the+component pages use: the part comes back **untouched, every colour kept**, with the mark as its own+`Adom.LaserEtch` part, a flat light (or dark) sheet 5 µm off the face. The 0.1.0 CadQuery path+(recess + grey inlay, part repainted) is still there as `engine=legacy`.+ ```bash-curl -X POST "https://laserchip-6dn1tl7vjz5u.adom.cloud/etch?mpn=<MPN>" \+curl -X POST "https://laserchip-6dn1tl7vjz5u.adom.cloud/etch?mpn=STM32F103C8T6" \      --data-binary @chip.step -o etched.step ``` -**Client CLI** (installed by this package — a thin wrapper over the service):+- `mpn` (required): the part number to etch.+- `surface=auto|top|side|side:-y|side:+y|side:-x|side:+x` (default `auto`): `auto` marks an LED, or+  a part whose top is busy (2+ openings in the top face and recessed faces covering 15 %+ of the+  footprint: ToF windows, lenses), on the side wall that fits the largest text; everything else on top.+- `style=flat|recessed` (default flat), `color=auto|light|dark` (default auto: contrasts with the+  marked face), `fit=adom|compact`, `rot=0|90|180|270`, `pin1_xy=x,y`, `upright=auto|off`,+  `busy_top=on|off`. `frac` is accepted and ignored (legacy only).+- A Y-up model (a vendor can lying along Y) is stood up for the fit; the mark is put back in the+  model's own frame.+- Response is `application/step`. Headers: `X-Etch-Fontsize-Mm`, `X-Etch-Face`,+  `X-Etch-Face-Reason` (why auto chose it), `X-Etch-Stood-Up`, `X-Etch-Job` (the service-occt job,+  whose `/jobs/<id>` has the full fit report). A part the text cannot fit is a 422 with the reason.+- `POST /inlay?mpn=…`: the mark alone, as its own STEP, to merge onto a published GLB.+- `GET /health` → `{"ok":true,"version":"…","engine":"service-occt"}`.++**Client CLI** (installed by this package):  ```bash-adom-chip-laser etch <chip.step> <MPN> [out.step] [frac]-adom-chip-laser health+adom-chip-laser etch  <chip.step> <MPN> [out.step] [key=value ...]   # the part + its mark+adom-chip-laser inlay <chip.step> <MPN> [out.step] [key=value ...]   # the mark alone+adom-chip-laser etch vl53l7cx.step VL53L7CX out.step surface=side:-y color=light+adom-chip-laser health | url | version ``` -- **Input:** a component's chip STEP + its MPN. **Output:** an etched STEP (Fusion-ready).-- `frac` (default `0.55`) = mark size as a fraction of the die; smaller = subtler.-  Single subtle line, MPN-only, auto-fit to the package.-- `GET /health` → `{"ok":true,"version":"…"}`. Override the service with-  `ADOM_CHIP_LASER_URL`.+`key=value` arguments go on the query (`surface`, `style`, `color`, `fit`, `rot`, `pin1_xy`,+`upright`, `busy_top`); the client prints the face, the reason and the font size. Override the+service with `ADOM_CHIP_LASER_URL`.  For the **full 3D deliverables** (etched chip GLB with real materials + animated board GLB with a toggleable `laser_etch` layer), use the Python `board` command in-the source repo `adom-inc/adom-chip-laser` (needs cadquery + the `step2glb` service).+the source repo `adom-inc/adom-chip-laser` (needs cadquery + the `step2glb` service; still the legacy etch).  ## Marking checklist (read before you etch) -The raw `/etch` endpoint writes the MPN across **X** at the size `frac` gives it and repaints the-whole part black and grey. It does not know the part's long axis, its end caps, pin 1 or the-standard pose, so on its own it often puts the text across the short side, upside down, or onto the-terminations. For a component model, use the planner that wraps the shared STEP service:+Since 0.2.0 `/etch` keeps the part's own colours, runs the mark along the long axis of the top+face, stands Y-up models up and marks a busy top on a side. It does not know the part's end caps or+the page's standard pose, and it reads from pin 1 only when it finds a pin-1 dot (or gets `pin1_xy`+/ `rot`). For a component model, use the planner that wraps the shared STEP service:  ```bash adom-aiflow-etch --in part.step --mpn <MPN> --out part-etched.step --footprint part.kicad_mod@@ -67,11 +87,10 @@ The rule it enforces: 6. **Look at the result at widget size before you report** (the gate reports the cap height in    pixels at 320 px and prints `Hint:` lines saying what to rerun when it fails). -Use `/etch` directly only for a quick look at a simple Z-up IC whose long axis is already X.+Use `/etch` directly for a quick mark, or when the planner's footprint inputs are not at hand.  ## Why STEP-layer  Fusion imports a library via the **STEP**, not a GLB — and a laser mark on black epoxy is a **color change** (a light-grey inlay body), not a groove. So the mark-rides into the STEP download, the Fusion import, *and* the derived 3D model. Proven-across LQFP / QFN / TQFP / LGA packages. First live on `adom/stm32f103c8t6`.+rides into the STEP download, the Fusion import, *and* the derived 3D model. First live on `adom/stm32f103c8t6`.
client/adom-chip-laser+34−13
@@ -1,28 +1,49 @@ #!/usr/bin/env bash # adom-chip-laser — lightweight client for the Adom Chip Laser service. # Etches a component's MPN into its STEP at the STEP layer. No cadquery needed-# locally; this just calls the shared service.+# locally; this just calls the shared service. Since 0.2.0 the service passes the+# etch to service-occt /laser-etch: the part comes back untouched, every colour+# kept, with the mark as its own Adom.LaserEtch sheet. set -uo pipefail SVC="${ADOM_CHIP_LASER_URL:-https://laserchip-6dn1tl7vjz5u.adom.cloud}"-VERSION="0.1.0"+VERSION="0.2.0"++# etch|inlay <chip.step> <MPN> [out.step] [frac | key=value ...]+#   key=value goes on the query: surface=auto|top|side|side:-y|side:+y|side:-x|side:+x,+#   style=flat|recessed, color=auto|light|dark, fit=adom|compact, rot=0|90|180|270,+#   pin1_xy=x,y, upright=auto|off, busy_top=on|off. A bare number is the old frac (ignored since 0.2.0).+run() {+  kind="$1"; step="${2:-}"; mpn="${3:-}"; out="${4:-$1.step}"; shift 4 2>/dev/null || shift $#+  [ -f "$step" ] && [ -n "$mpn" ] || { echo "usage: adom-chip-laser $kind <chip.step> <MPN> [out.step] [key=value ...]"; exit 1; }+  q="mpn=$mpn"+  for a in "$@"; do+    case "$a" in *=*) q="$q&$a" ;; *) q="$q&frac=$a" ;; esac+  done+  hdr="$(mktemp)"+  code="$(curl -s -X POST "$SVC/$kind?$q" --data-binary @"$step" -o "$out" -D "$hdr" -w '%{http_code}')"+  if [ "$code" = "200" ]; then+    face="$(grep -i '^x-etch-face:' "$hdr" | cut -d' ' -f2- | tr -d '\r')"+    why="$(grep -i '^x-etch-face-reason:' "$hdr" | cut -d' ' -f2- | tr -d '\r')"+    up="$(grep -i '^x-etch-stood-up:' "$hdr" | cut -d' ' -f2- | tr -d '\r')"+    fs="$(grep -i '^x-etch-fontsize-mm:' "$hdr" | cut -d' ' -f2- | tr -d '\r')"+    echo "$kind $mpn -> $out  (font ${fs:-?} mm, face ${face:-top}${up:+, stood up $up}${why:+; $why})"+    rm -f "$hdr"+  else+    echo "$kind failed (HTTP $code, service: $SVC): $(cat "$out" 2>/dev/null | head -c 400)"; rm -f "$out" "$hdr"; exit 1+  fi+}  case "${1:-}" in-  etch)   # adom-chip-laser etch <chip.step> <MPN> [out.step] [frac]-    step="${2:-}"; mpn="${3:-}"; out="${4:-etched.step}"; frac="${5:-0.55}"-    [ -f "$step" ] && [ -n "$mpn" ] || { echo "usage: adom-chip-laser etch <chip.step> <MPN> [out.step] [frac]"; exit 1; }-    if curl -sf -X POST "$SVC/etch?mpn=$mpn&frac=$frac" --data-binary @"$step" -o "$out"; then-      echo "etched $mpn -> $out"-      echo "Hint: /etch writes across X at frac $frac and repaints the part; it does not know the long axis, end caps or pin 1."-      echo "Hint: for a component model use: adom-aiflow-etch --in $step --mpn $mpn --out <part-etched.step> --footprint <part.kicad_mod>, then adom-aiflow-etch check (Marking checklist in this skill)"-    else-      echo "etch failed (service: $SVC)"; exit 1-    fi ;;+  etch)   shift; run etch "$@" ;;+  inlay)  shift; run inlay "$@" ;;   # the mark alone, to merge onto a published GLB   health)  curl -s "$SVC/health"; echo ;;   url)     echo "$SVC" ;;   version|--version) echo "adom-chip-laser $VERSION" ;;   *) echo "adom-chip-laser $VERSION — laser-etch an MPN into a component's STEP"      echo "usage:"-     echo "  adom-chip-laser etch <chip.step> <MPN> [out.step] [frac]"+     echo "  adom-chip-laser etch  <chip.step> <MPN> [out.step] [key=value ...]   # the part + its mark"+     echo "  adom-chip-laser inlay <chip.step> <MPN> [out.step] [key=value ...]   # the mark alone"+     echo "     surface=auto|top|side|side:-y|...  style=flat|recessed  color=auto|light|dark"      echo "  adom-chip-laser health | url | version"      echo "  (override the service with ADOM_CHIP_LASER_URL)"; exit 1 ;; esac
package.json+2−3
@@ -1,13 +1,12 @@ {   "slug": "adom-chip-laser",-  "version": "0.1.0",+  "version": "0.2.0",   "type": "app",   "description": "Laser-etch a component's MPN into its CAD at the STEP layer \u2014 a callable HTTP service with STEP output, so the download, the Fusion import, and the 3D model all carry the part number on the die.",   "dependencies": {},   "license": "MIT",   "needs_sudo": false,   "files": [-    "page.json",     "README.md",     "screenshots/**",     "client/**",@@ -61,4 +60,4 @@   "hero": {     "path": "screenshots/hero.png"   }-}\ No newline at end of file+}
page.json+19−5
@@ -3,8 +3,8 @@   "type": "app",   "slug": "adom-chip-laser",   "title": "Adom Chip Laser",-  "brief": "Laser-etch a component's MPN into its CAD at the STEP layer \u2014 so the downloadable STEP, a Fusion import, and the 3D model all carry the part number on the die. A callable HTTP service; output is a STEP file.",-  "version": "0.1.0",+  "brief": "Laser-etch a component's MPN into its CAD at the STEP layer — so the downloadable STEP, a Fusion import, and the 3D model all carry the part number on the die. A callable HTTP service; output is a STEP file.",+  "version": "0.2.0",   "install": {     "binary_name": "adom-chip-laser",     "install_dir": "",@@ -60,12 +60,26 @@     "step laser etch",     "die marking"   ],-  "discovery_pitch": "Laser-etch a component's MPN into its CAD at the STEP layer \u2014 a callable HTTP service with STEP output, so the download, the Fusion import, and the 3D model all carry the part number on the die.",+  "discovery_pitch": "Laser-etch a component's MPN into its CAD at the STEP layer — a callable HTTP service with STEP output, so the download, the Fusion import, and the 3D model all carry the part number on the die.",   "metadata": {     "platform": "linux",     "service_url": "https://laserchip-6dn1tl7vjz5u.adom.cloud"   },-  "description": "Laser-etch a component's MPN into its CAD at the STEP layer \u2014 not a viewer-only texture, so the downloadable STEP, a Fusion 360 import, and the derived 3D model all carry the part number on the die. Callable by other Adom apps as an HTTP service (POST a STEP, get an etched STEP) or a CLI. Proven across LQFP / QFN / TQFP / LGA packages.",+  "description": "Laser-etch a component's MPN into its CAD at the STEP layer — a callable HTTP service with STEP output, so the download, the Fusion import, and the 3D model all carry the part number on the die.",   "dependencies": {},-  "needs_sudo": false+  "needs_sudo": false,+  "files": [+    "README.md",+    "screenshots/**",+    "client/**",+    "install.sh",+    "uninstall.sh",+    "package.json",+    "SKILL.md"+  ],+  "scripts": {+    "install": "./install.sh",+    "uninstall": "./uninstall.sh"+  },+  "org": "adom" }\ No newline at end of file