by adom
ST VL53L5CX Time-of-Flight 8x8 multizone ranging sensor, 400 cm, 63 deg diagonal FoV, I2C, optical LGA-16 6.4 x 3.0 x 1.5 mm. Pinout extracted from the datasheet, KiCad symbol with chip outline, footprint, Fusion library, manufacturer STEP (Z-up, FoV on/off, side-etched MPN) and provenance.
← Commit history
Family contract: pipeline 1.0.0 that built the three VL53Lx pages
9 files changed
+1737
family.jsonadded+43@@ -0,0 +1,43 @@+{+ "schema": "adom/family@1",+ "family": "VL53Lx multizone Time-of-Flight sensors",+ "anchor": "adom/vl53l5cx",+ "templateRevision": "1.0.0",+ "implementation": "pipeline/derive_all.sh",+ "fixedLayout": "pipeline/build_wiki_pages.py",+ "sources": [+ "pipeline/build_wiki_pages.py",+ "pipeline/derive_all.sh",+ "pipeline/glb_alpha.py",+ "pipeline/hero_step.py",+ "pipeline/merge_symbols.py",+ "pipeline/parts_data.json",+ "pipeline/publish_wiki_pages.sh",+ "pipeline/vendor_step.py"+ ],+ "revisions": [+ {+ "revision": "1.0.0",+ "breaking": false,+ "note": "first pipeline: manufacturer STEP re-posed to Z-up, FoV on/off, side-etched MPN, hero artwork, adom-symbol 1.2.2 outlines, page generator"+ }+ ],+ "members": [+ {+ "page": "adom/vl53l5cx",+ "mpn": "VL53L5CXV0GC/1",+ "role": "parent, 63 deg FoV, 400 cm, I2C"+ },+ {+ "page": "adom/vl53l7cx",+ "mpn": "VL53L7CXV0GC/1",+ "role": "90 deg FoV, 350 cm, I2C, pin-compatible with VL53L5CX"+ },+ {+ "page": "adom/vl53l8cx",+ "mpn": "VL53L8CXV0GC/1",+ "role": "new generation, 65 deg FoV, 400 cm, I2C or SPI, 1.8 V core"+ }+ ],+ "note": "Every member page was produced by the same pipeline (these files) from its own datasheet and manufacturer STEP; a revision bump means the pipeline changed and members should be regenerated."+}
pipeline/build_wiki_pages.pyadded+249@@ -0,0 +1,249 @@+#!/usr/bin/env python3+"""Assemble the three wiki component pages (adom/vl53l5cx, vl53l7cx, vl53l8cx) into wiki/<slug>/.++Reads tools/parts_data.json (specs + pins with datasheet page citations, sourcing snapshot) and+gathers every artifact this project produced: symbol, footprint, .lbr, the manufacturer STEP+(untouched) and its Z-up derivatives (plain / FoV / etched / FoV+etched / hero), GLBs, renders,+chip-outline artwork cache, datasheet, provenance JSON. Writes page.json, package.json, README.md,+LICENSE. Nothing here talks to the wiki; publish with tools/publish_wiki_pages.sh.+"""+import os, sys, json, re, shutil, hashlib, glob, datetime++ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+DATA = json.load(open(os.path.join(ROOT, "tools", "parts_data.json")))+LIB = os.environ.get("CHIP_FETCHER_LIBRARY", os.path.expanduser("~/project/chip-fetcher/library"))+TODAY = datetime.date.today().isoformat()+++def sha(p):+ h = hashlib.sha256()+ with open(p, "rb") as f:+ for c in iter(lambda: f.read(1 << 20), b""):+ h.update(c)+ return h.hexdigest()+++def sexpr_block(text, head):+ i = text.index(head); depth = 0; j = i+ while True:+ c = text[j]+ if c == "(": depth += 1+ elif c == ")":+ depth -= 1+ if depth == 0: return text[i:j + 1]+ j += 1+++def single_symbol_lib(mpn):+ lib = open(os.path.join(ROOT, "libraries", "Adom_ToF.kicad_sym")).read()+ blk = sexpr_block(lib, f'(symbol "{mpn}"')+ head = lib[:lib.index("(symbol ")]+ return head.rstrip() + "\n " + blk.replace("\n", "\n ") + "\n)\n"+++def copy(src, dst):+ os.makedirs(os.path.dirname(dst), exist_ok=True)+ shutil.copyfile(src, dst); return dst+++def build(mpn):+ d = DATA[mpn]; slug = d["slug"]; out = os.path.join(ROOT, "wiki", slug)+ if os.path.isdir(out): shutil.rmtree(out)+ os.makedirs(out)+ files = {}+ def add(rel, src):+ if src and os.path.exists(src):+ copy(src, os.path.join(out, rel)); files[rel] = src+ else:+ print(f" MISSING {rel} <- {src}")+ der = os.path.join(ROOT, "3d-chips", "derived")+ open(os.path.join(out, f"{slug}.kicad_sym"), "w").write(single_symbol_lib(mpn)); files[f"{slug}.kicad_sym"] = "generated"+ add(f"{slug}.kicad_mod", os.path.join(ROOT, "footprints", f"{mpn}.kicad_mod"))+ add(f"{slug}.lbr", os.path.join(ROOT, "libraries", "fusion", f"{mpn}.lbr"))+ for v, rel in (("", f"{slug}.step"), ("-fov", f"{slug}-fov.step"), ("-etched", f"{slug}-etched.step"), ("-fov-etched", f"{slug}-fov-etched.step"), ("-hero", f"{slug}-hero.step")):+ add(rel, os.path.join(der, f"{mpn}{v}.step"))+ if v != "-hero":+ add(f"provenance/{slug}{v}.step.json", os.path.join(der, f"{mpn}{v}.provenance.json"))+ add(f"provenance/{slug}-hero.json", os.path.join(der, f"{mpn}-hero.provenance.json"))+ for v in ("", "-fov", "-etched", "-fov-etched", "-hero"):+ add(f"{slug}{v}.glb", os.path.join(der, f"{mpn}{v}.glb"))+ add(f"vendor/{mpn}-cse-original.step", os.path.join(ROOT, "3d-chips", "vendor", f"{mpn}-cse-yup.step"))+ add(f"{slug}-adom-datasheet-model.step", os.path.join(ROOT, "3d-chips", f"{mpn}.step"))+ add(f"docs/{slug}-datasheet.pdf", os.path.join(ROOT, "datasheets", f"{slug}.pdf"))+ for r in ("etched-iso", "fov-etched-iso", "hero-iso"):+ add(f"renders/{slug}-{r}.png", os.path.join(ROOT, "renders", f"{mpn}-{r}.png"))+ add("docs/hero.png", os.path.join(ROOT, "renders", f"{mpn}-hero-iso.png"))+ # embedded viewers+ os.makedirs(os.path.join(out, "viewers"), exist_ok=True)+ for kind, tool, src in (("symbol", "adom-symbol", os.path.join(out, f"{slug}.kicad_sym")), ("footprint", "adom-footprint", os.path.join(out, f"{slug}.kicad_mod"))):+ dst = os.path.join(out, "viewers", f"{kind}.html")+ rc = os.system(f"timeout 180 {tool} embed --file {src} --out {dst} >/dev/null 2>&1")+ if rc == 0 and os.path.exists(dst): files[f"viewers/{kind}.html"] = tool+ else: print(f" viewer {kind} failed")+ # artwork cache from chip-fetcher (outline SVGs + iso PNG + manifest)+ art = os.path.join(LIB, mpn)+ for f in sorted(glob.glob(os.path.join(art, f"{mpn}-3d-outline-*.svg"))):+ if "-named" in f: continue # name-on-top variants are wrong for optical tops+ add(f"artwork/{os.path.basename(f)}", f)+ for f in (f"{mpn}-3d-iso.png", f"{mpn}-3d-iso-icon.png", f"{mpn}-thumbs.json"):+ add(f"artwork/{f}", os.path.join(art, f))+ # datasheet page crops: the cited pages as images (provenance evidence)+ figs = []+ for label, page in d.get("figures", []):+ rel = f"docs/figures/{slug}-ds-p{page}.png"; dst = os.path.join(out, rel)+ os.makedirs(os.path.dirname(dst), exist_ok=True)+ os.system(f"pdftoppm -f {page} -l {page} -r 70 -png {os.path.join(ROOT, 'datasheets', slug + '.pdf')} {dst[:-4]} >/dev/null 2>&1")+ cand = [f for f in glob.glob(dst[:-4] + "*.png")]+ if cand:+ os.replace(cand[0], dst); files[rel] = "pdftoppm"; figs.append((label, page, rel))+ d["_figs"] = figs+ # footprint verification report+ add("provenance/footprint-vs-samacsys.json", os.path.join(ROOT, "provenance", f"{mpn}-footprint-vs-samacsys.json"))++ hashes = {rel: sha(os.path.join(out, rel)) for rel in files if os.path.exists(os.path.join(out, rel))}+ vendor_sha = hashes.get(f"vendor/{mpn}-cse-original.step", "")+ types = {p["number"]: p["type"] for p in json.load(open(os.path.join(ROOT, "symbols", mpn, f"{mpn}-create.json")))["pins"]}+ pins = [dict(p, type=types.get(p["n"], p.get("type", "passive"))) for p in d["pins"]]+ comp = {+ "mpn": d["order_code"], "manufacturer": "STMicroelectronics", "package": d["package"],+ "pin_count": len(pins), "category": "Sensors", "subcategory": "Time-of-Flight multizone ranging sensor",+ "datasheet": d["datasheet_url"], "product_page": d["product_url"],+ "body_size": d["body_size"],+ "parts": {"symbol": f"{slug}.kicad_sym", "footprint": f"{slug}.kicad_mod", "model_3d": f"{slug}-hero.glb",+ "model_3d_plain": f"{slug}-etched.glb", "model_3d_step": f"{slug}-etched.step", "model_3d_step_plain": f"{slug}.step",+ "step": f"{slug}-etched.step", "lbr": f"{slug}.lbr", "datasheet": f"docs/{slug}-datasheet.pdf"},+ "manufacturer_links": [{"label": a, "url": b, "note": c} for a, b, c in d.get("manufacturer_links", [])],+ "source": {"authority": "STMicroelectronics", "product_page": d["product_url"], "datasheet": d["datasheet_url"], "cad": "st.com CAD Resources tab (SamacSys / Component Search Engine partID " + str(d["cse_part_id"]) + ")"},+ "distributor_links": {+ "mouser": {"part": next(r["sku"] for r in d["sourcing"]["rows"] if r["dist"] == "Mouser"), "url": d["distributor_links"]["mouser"]},+ "digikey": {"part": next(r["sku"] for r in d["sourcing"]["rows"] if r["dist"] == "DigiKey"), "url": d["distributor_links"]["digikey"]},+ "lcsc": False,+ },+ "pins": [{"number": p["n"], "name": p["name"], "type": p["type"], "description": p["desc"], "datasheet_page": d["pin_table_pages"]} for p in pins],+ "models_3d": [+ {"file": f"vendor/{mpn}-cse-original.step", "role": "manufacturer original (SamacSys via st.com CAD tab), bytes untouched", "up_axis": "Y", "sha256": vendor_sha},+ {"file": f"{slug}.step", "role": "manufacturer body, Adom Z-up, seated on z=0, FoV cones removed", "up_axis": "Z"},+ {"file": f"{slug}-fov.step", "role": "same + the manufacturer's field-of-view cones kept as separate solids (toggle them in your viewer)", "up_axis": "Z"},+ {"file": f"{slug}-etched.step", "role": "library model: Z-up + virtual MPN inlay on the +Y side wall (top carries the optics, never mark it)", "up_axis": "Z"},+ {"file": f"{slug}-fov-etched.step", "role": "FoV cones + side etch", "up_axis": "Z"},+ {"file": f"{slug}-hero.glb", "role": "page hero only: etched chip + teal dashed pad outlines (50 %), silkscreen (30 %), pad signal labels (50 %). Not for boards.", "up_axis": "Z"},+ {"file": f"{slug}-adom-datasheet-model.step", "role": "Adom-authored model built from the datasheet outline drawing (coloured, used before the manufacturer STEP was fetched)", "up_axis": "Z"},+ ],+ "provenance": {+ "datasheet": {"id": d["ds_id"], "url": d["datasheet_url"], "pages": d["ds_pages"], "sha256": hashes.get(f"docs/{slug}-datasheet.pdf", "")[:16], "source_tier": "mfr"},+ "pins": {"total": len(pins), "described": len(pins), "cites_pages": True, "source": f"{d['ds_id']} Table 3, page(s) {d['pin_table_pages']}"},+ "footprint": {"source": f"{d['ds_id']} recommended solder pattern, page {d['solder_page']}", "verified_against": "SamacSys/CSE land pattern (pad-by-pad, see provenance/footprint-vs-samacsys.json)"},+ "model_3d": {"source": "st.com CAD Resources tab (SamacSys widget), st.componentsearchengine.com partID " + str(d["cse_part_id"]), "sha256": vendor_sha, "transform": "see provenance/*.step.json"},+ "symbol": {"tool": "adom-symbol 1.2.0", "chip_outline": "chip-thumbnailer 0.6.0 outline of the side-etched Z-up model (un-named variant)"},+ "tools": ["adom-symbol 1.2.0", "adom-chip-thumbnailer 0.6.0", "service-step2glb 1.3.12", "tof-8x8-sensors/tools (vendor_step.py, hero_step.py, glb_alpha.py, build_parts.py)"],+ "sourcing_snapshot": d["sourcing"]["date"],+ },+ "viewers": {"symbol": "viewers/symbol.html", "footprint": "viewers/footprint.html"},+ "artwork_cache": f"artwork/{mpn}-thumbs.json",+ }+ page = {+ "schema_version": 1, "type": "component", "slug": slug, "title": mpn,+ "brief": d["brief"], "version": "0.1.0", "license": "CC-BY-4.0",+ "tags": ["component", "sensor", "time-of-flight", "tof", "multizone", "8x8", "lga-16", "stmicroelectronics", "flightsense", "i2c"] + d.get("extra_tags", []),+ "component": comp,+ "metadata": {"specs": {k: v for k, v, _ in d["specs"]}},+ "sections": ["hero", "viewers", "readme", "breadcrumbs", "info"],+ "discovery_triggers": d["triggers"],+ "discovery_pitch": d["pitch"],+ "author": {"name": "John Lauer", "email": "[email protected]"},+ "dependencies": {},+ "hero": {"type": "image", "path": "docs/hero.png", "chrome": False},+ "files": sorted(files.keys()) + ["page.json", "README.md", "LICENSE"],+ "visibility": {"public": True},+ "variants": [{"mpn": d["order_code"], "kind": "packaging", "note": "tape and reel, 3600 pcs minimum order (datasheet order-code table)"}],+ "related": d["related"],+ }+ json.dump(page, open(os.path.join(out, "page.json"), "w"), indent=2)+ json.dump({"slug": slug, "version": "0.1.0", "type": "component", "description": d["brief"], "tags": page["tags"],+ "dependencies": {}, "hero": page["hero"], "files": page["files"]}, open(os.path.join(out, "package.json"), "w"), indent=2)+ open(os.path.join(out, "README.md"), "w").write(readme(mpn, dict(d, pins=pins, _figs=figs), hashes))+ open(os.path.join(out, "LICENSE"), "w").write(LICENSE.format(year=TODAY[:4]))+ json.dump(hashes, open(os.path.join(out, "provenance", "file-hashes.json"), "w"), indent=1)+ print(f"{slug}: {len(files)} files, {sum(os.path.getsize(os.path.join(out, r)) for r in files if os.path.exists(os.path.join(out, r))) / 1e6:.1f} MB")+++def readme(mpn, d, hashes):+ slug = d["slug"]; ds = d["ds_id"]+ L = [f"# {mpn}", "", f"**STMicroelectronics** · Time-of-Flight 8x8 multizone ranging sensor · {d['package']}", "",+ d["overview"], "",+ f"Order code **{d['order_code']}** (tape and reel, 3600 pcs minimum, {ds} page {d['order_page']}). "+ f"Datasheet: [{ds}]({d['datasheet_url']}) (local copy: `docs/{slug}-datasheet.pdf`). Product page: [st.com]({d['product_url']}).", "",+ "## Manufacturer and resources", "",+ "Everything on this page traces back to STMicroelectronics. Start here for the original documents, software and CAD.", "",+ "| Resource | Link | Why you need it |", "|---|---|---|"]+ for label, url, why in d.get("manufacturer_links", []):+ L.append(f"| {label} | [open]({url}) | {why} |")+ L += ["", "Evaluation-kit and software part numbers are ST's names as listed with this product; the links are st.com searches so they stay valid when ST moves a document. Kept locally: the datasheet in `docs/`, the manufacturer 3D model in `vendor/` (untouched bytes, sha256 in `provenance/file-hashes.json`).", "",+ "## Pinout", "", f"Source: {ds} Table 3, page {d['pin_table_pages']}. Pad A1 is bottom-right in the top view (outline drawing); the footprint marks it with the chamfered corner and dot.", "",+ "| Pad | Name | Type | Function |", "|---|---|---|---|"]+ for p in d["pins"]:+ L.append(f"| {p['n']} | {p['name']} | {p['type']} | {p['desc']} |")+ L += ["", "## Key specifications", "", "| Parameter | Value | Source |", "|---|---|---|"]+ for k, v, src in d["specs"]:+ L.append(f"| {k} | {v} | {ds} {src} |")+ L += ["", "## Sourcing", "", f"Snapshot {d['sourcing']['date']} (single-unit price, stock at that moment; re-check before ordering).", "",+ "| Distributor | Part | Price @1 | Stock | Link |", "|---|---|---|---|---|"]+ for row in d["sourcing"]["rows"]:+ L.append(f"| {row['dist']} | {row['sku']} | {row['price']} | {row['stock']} | [open]({row['url']}) |")+ L += ["", "## Packaging, handling and marking", "",+ f"- Tape and reel, EIA-481 carrier tape; orientation and pocket drawing on {ds} page {d['tape_pages']}.",+ f"- Moisture sensitivity level 3 (IPC/JEDEC J-STD-020), {ds} page {d['msl_page']}. Handle with non-marring ESD-safe tweezers; never touch the optical windows.",+ f"- Device marking and the marking area on the cap: {ds} page {d['marking_pages']}.",+ f"- Recommended solder pattern (the footprint here follows it pad for pad): {ds} page {d['solder_page']}.",+ f"- Reflow and cover-glass guidance: {d['app_notes']}.", "",+ "## CAD", "",+ "Everything below is Adom-authored from the datasheet and the manufacturer CAD, licensed CC-BY-4.0; the manufacturer's own files keep ST's and SamacSys's terms.", "",+ "| File | What it is |", "|---|---|",+ f"| `{slug}.kicad_sym` | KiCad symbol, two-column layout with intelligent pin groups (Power, Ground, I2C, Control, Reserved) and the chip outline of this exact part baked in the body (adom-symbol 1.2.0). The MPN in the outline is on the side wall, the top face carries the emitter and receiver windows. |",+ f"| `{slug}.kicad_mod` | KiCad footprint from the datasheet solder pattern (2 x 7 pads on 0.75 mm pitch, two side pads, thermal pad). Verified pad-by-pad against the SamacSys land pattern: `provenance/footprint-vs-samacsys.json`. |",+ f"| `{slug}.lbr` | Fusion 360 / EAGLE library (symbol + package + device). |",+ f"| `{slug}-etched.step` / `.glb` | **Library model.** Manufacturer body, Adom Z-up, seated on z = 0, field-of-view cones removed, virtual MPN inlay on the +Y side wall. |",+ f"| `{slug}.step` / `.glb` | Same body, no marking. |",+ f"| `{slug}-fov.step` / `.glb`, `{slug}-fov-etched.step` / `.glb` | The manufacturer's field-of-view cones kept as separate solids so you can switch them on when you want to see the coverage and off when you place the part. |",+ f"| `{slug}-hero.glb` | Page hero: the etched chip plus teal dashed copper-pad outlines (50 % opacity), silkscreen (30 %) and pad signal labels (50 %). Reference artwork only, never put it on a board. |",+ f"| `vendor/{mpn}-cse-original.step` | Manufacturer STEP exactly as downloaded from the st.com CAD Resources tab (SamacSys), Y-up, sha256 `{hashes.get(f'vendor/{mpn}-cse-original.step','')[:16]}`. |",+ f"| `{slug}-adom-datasheet-model.step` | Adom-authored coloured model built from the datasheet outline drawing (CadQuery), used before the manufacturer STEP was fetched. |",+ f"| `artwork/` | chip-thumbnailer outline cache (11 styles) and shaded iso render of the etched model; `{mpn}-thumbs.json` is the manifest. |",+ "", "The 3D transforms (Y-up to Z-up rotation, yaw, seating translation, which solids were dropped, etch placement) are recorded per file in `provenance/*.step.json`.", "",+ "## Provenance", "", "| Data | Source | Reference | Evidence |", "|---|---|---|---|",+ f"| Identity, features | {ds} | page 1 | datasheet copy in `docs/` |",+ f"| Pin functions | {ds} Table 3 | page {d['pin_table_pages']} | table above quotes the datasheet |",+ f"| Package size | {ds} outline drawing | page {d['outline_pages']} | body bbox measured on the manufacturer STEP in `provenance/{slug}.step.json` |",+ f"| Land pattern | {ds} recommended solder pattern | page {d['solder_page']} | `provenance/footprint-vs-samacsys.json` |",+ f"| 3D model | st.com CAD Resources tab (SamacSys), CSE partID {d['cse_part_id']} | fetched {d['fetched']} | sha256 in page.json and `provenance/file-hashes.json` |",+ f"| Price and stock | {', '.join(sorted(set(r['dist'] for r in d['sourcing']['rows'])))} | {d['sourcing']['date']} | links above |",]+ if d.get("_figs"):+ L += ["", "### Cited datasheet pages", "", f"Page images rendered from the {ds} copy in `docs/` (click to enlarge).", ""]+ L += ["| Page | What it shows |", "|---|---|"]+ for label, page, rel in d["_figs"]:+ L.append(f"| [page {page}]({rel}) | {label} |")+ if d.get("legacy_figures"):+ L += ["", "### Datasheet figure crops", "", f"Figure crops from {ds} that an earlier revision of this page extracted (kept at the repo root):", ""]+ for f in d["legacy_figures"]:+ L.append(f"- [{f}]({f})")+ L += ["", "## Related", ""]+ for r in d["related"]:+ L.append(f"- [{r['title']}]({r['url']}) - {r['note']}")+ L += ["", "## Chip outline cache", "", f"::adom-chip-thumbnail{{src=\"/adom/{slug}/render/artwork/{mpn}-thumbs.json\" mpn=\"{mpn}\" package=\"{d['package']}\"}}", ""]+ return "\n".join(L)+++LICENSE = """Adom-authored content of this component page (symbol, footprint, Fusion library, derived and+annotated 3D models, renders, README, page metadata) is licensed under the Creative Commons+Attribution 4.0 International License (CC-BY-4.0), https://creativecommons.org/licenses/by/4.0/.+Copyright {year} Adom Inc.++Third-party material keeps its own terms and attribution: the datasheet in docs/ is+STMicroelectronics' document; the file under vendor/ is the manufacturer 3D model as served by+STMicroelectronics' CAD Resources tab (SamacSys / Component Search Engine). Derived models retain+that attribution and record their source hash and transform in provenance/.+"""++if __name__ == "__main__":+ for m in (sys.argv[1:] or ["VL53L5CX", "VL53L7CX", "VL53L8CX"]):+ build(m)
pipeline/derive_all.shadded+23@@ -0,0 +1,23 @@+#!/bin/bash+# Full derived-asset chain for the three ToF parts (run from the project root).+set -u+S=https://step2glb-gmdoncpxdwx0.adom.cloud+D=3d-chips/derived+WALL=${ETCH_WALL:-+y}+conv(){ f=$1; out=$2; R=$(curl -s -m 90 -X POST "$S/convert" -H "X-Client: tof-8x8-sensors" -H "X-Job-Name: convert-$(basename $f)" -H "Content-Type: application/octet-stream" --data-binary @$f); J=$(echo "$R" | python3 -c "import sys,json; print(json.load(sys.stdin).get('job_id',''))" 2>/dev/null); [ -z "$J" ] && { echo "convert $f: submit failed $(echo $R | head -c 200)"; return 1; }; for i in $(seq 1 60); do sleep 3; ST=$(curl -s -m 20 "$S/jobs/$J"); s=$(echo "$ST" | python3 -c "import sys,json; print(json.load(sys.stdin).get('status'))" 2>/dev/null); [ "$s" = complete ] && break; [ "$s" = failed ] && { echo "convert $f FAILED"; return 1; }; done; curl -s -m 120 -o "$out" "$S/jobs/$J/result"; echo "glb $out $(stat -c%s $out)"; }+thumb(){ f=$1; out=$2; pose=${3:-iso}; w=${4:-1200}; h=${5:-900}; R=$(curl -s -m 90 -X POST "$S/thumbnail?width=$w&height=$h&pose=$pose&upAxis=z" -H "X-Client: tof-8x8-sensors" -H "X-Job-Name: thumb-$(basename $f)-$pose" -H "Content-Type: application/octet-stream" --data-binary @$f); J=$(echo "$R" | python3 -c "import sys,json; print(json.load(sys.stdin).get('job_id',''))" 2>/dev/null); [ -z "$J" ] && { echo "thumb $f: submit failed"; return 1; }; for i in $(seq 1 60); do sleep 3; ST=$(curl -s -m 20 "$S/jobs/$J"); s=$(echo "$ST" | python3 -c "import sys,json; print(json.load(sys.stdin).get('status'))" 2>/dev/null); [ "$s" = complete ] && break; [ "$s" = failed ] && { echo "thumb $f $pose FAILED"; return 1; }; done; curl -s -m 60 -o "$out" "$S/jobs/$J/result"; echo "png $out $(stat -c%s $out)"; }+for m in VL53L5CX VL53L7CX VL53L8CX; do+ R=0; [ $m = VL53L7CX ] && R=180+ echo "== $m etched variants $(date +%T)"+ python3 tools/vendor_step.py 3d-chips/vendor/$m-cse-yup.step $D/$m-etched.step --rot-z $R --etch $m --etch-wall $WALL --report $D/$m-etched.provenance.json | cut -c1-90+ python3 tools/vendor_step.py 3d-chips/vendor/$m-cse-yup.step $D/$m-fov-etched.step --rot-z $R --keep-fov --etch $m --etch-wall $WALL --report $D/$m-fov-etched.provenance.json | cut -c1-90+ conv $D/$m-etched.step $D/$m-etched.glb; conv $D/$m-fov-etched.step $D/$m-fov-etched.glb+ cp $D/$m-etched.step ../chip-fetcher/library/$m/$m.step+ echo "== $m hero $(date +%T)"+ python3 tools/hero_step.py $D/$m-etched.step footprints/$m.kicad_mod symbols/$m/$m-create.json $D/$m-hero.step --report $D/$m-hero.provenance.json | cut -c1-120+ conv $D/$m-hero.step $D/$m-hero.raw.glb && python3 tools/glb_alpha.py $D/$m-hero.raw.glb $D/$m-hero.glb && rm -f $D/$m-hero.raw.glb+ mkdir -p renders; thumb $D/$m-etched.step renders/$m-etched-iso.png iso; thumb $D/$m-fov-etched.step renders/$m-fov-etched-iso.png iso; thumb $D/$m-hero.step renders/$m-hero-iso.png iso 1600 1000+done+echo "== thumbnailer $(date +%T)"+cd ../chip-fetcher && for m in VL53L5CX VL53L7CX VL53L8CX; do timeout 400 adom-chip-thumbnailer once $m > /tmp/claude-1001/-home-adom-project/6c659ef6-f0c4-4d2a-bea2-a58eda95d57c/scratchpad/thumb8-$m.log 2>&1; echo "thumbnailer $m exit $?"; done+echo "== done $(date +%T)"
pipeline/glb_alpha.pyadded+41@@ -0,0 +1,41 @@+#!/usr/bin/env python3+"""Post-process a service-step2glb GLB: make the hero artwork materials translucent.+usage: glb_alpha.py in.glb out.glb (teal -> 0.5, white -> 0.3, light grey -> 0.5, all BLEND, double-sided)+"""+import sys, json, struct++def close(c, ref, tol=0.08):+ return all(abs(a - b) < tol for a, b in zip(c[:3], ref))++RULES = [((0.0, 0.72, 0.69), 0.5, "Adom.PadOutlines"), ((0.97, 0.97, 0.97), 0.3, "Adom.Silkscreen"), ((0.86, 0.86, 0.86), 0.5, "Adom.PadLabels")]++def main(src, dst):+ b = open(src, "rb").read()+ magic, ver, length = struct.unpack_from("<4sII", b, 0)+ assert magic == b"glTF"+ off = 12; chunks = []+ while off < len(b):+ clen, ctype = struct.unpack_from("<II", b, off); chunks.append((ctype, b[off + 8: off + 8 + clen])); off += 8 + clen+ js = json.loads(chunks[0][1].decode("utf-8"))+ changed = 0+ for m in js.get("materials", []):+ pbr = m.get("pbrMetallicRoughness", {}); bc = pbr.get("baseColorFactor")+ if not bc:+ continue+ for ref, alpha, name in RULES:+ if close(bc, ref):+ pbr["baseColorFactor"] = [bc[0], bc[1], bc[2], alpha]; m["alphaMode"] = "BLEND"; m["doubleSided"] = True+ m.setdefault("extras", {})["adomArtwork"] = name; changed += 1+ js.setdefault("asset", {}).setdefault("extras", {})["adomHero"] = {"artwork": [r[2] for r in RULES], "note": "hero-only nonphysical layers"}+ data = json.dumps(js, separators=(",", ":")).encode("utf-8")+ data += b" " * ((4 - len(data) % 4) % 4)+ out = struct.pack("<4sII", b"glTF", 2, 0) + struct.pack("<II", len(data), 0x4E4F534A) + data+ for ctype, payload in chunks[1:]:+ payload += b"\0" * ((4 - len(payload) % 4) % 4)+ out += struct.pack("<II", len(payload), ctype) + payload+ out = out[:8] + struct.pack("<I", len(out)) + out[12:]+ open(dst, "wb").write(out)+ print(f"materials adjusted: {changed}, nodes: {len(js.get('nodes', []))}, named: {[n.get('name') for n in js.get('nodes', []) if n.get('name')][:12]}")++if __name__ == "__main__":+ main(sys.argv[1], sys.argv[2])
pipeline/hero_step.pyadded+153@@ -0,0 +1,153 @@+#!/usr/bin/env python3+"""Build the annotated wiki-hero STEP: chip (already Z-up, side-etched) + nonphysical reference+artwork as separately named, coloured solids so the GLB can make them translucent:++ Adom.PadOutlines teal dashed rectangles of every copper pad (footprint frame, z just under the seat)+ Adom.Silkscreen the footprint's F.SilkS contours, white+ Adom.PadLabels signal names per pad, light grey, outside the body, rotated to fit the pitch++usage: hero_step.py <chip.step> <footprint.kicad_mod> <create.json> <out-hero.step> [--report r.json]+The chip bytes are not touched; artwork is added as extra components. Board-use LODs must NOT+include these groups (see wiki-component-lod).+"""+import sys, re, json, math, os+sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))+from vendor_step import read_step, sha256+import cadquery as cq+from OCP.XCAFDoc import XCAFDoc_DocumentTool, XCAFDoc_ColorGen, XCAFDoc_ColorSurf+from OCP.TDF import TDF_LabelSequence+from OCP.TDataStd import TDataStd_Name+from OCP.TCollection import TCollection_ExtendedString+from OCP.Quantity import Quantity_Color, Quantity_TOC_RGB+from OCP.TopLoc import TopLoc_Location+from OCP.STEPCAFControl import STEPCAFControl_Writer+from OCP.STEPControl import STEPControl_AsIs+from OCP.IFSelect import IFSelect_RetDone+from OCP.TopExp import TopExp_Explorer+from OCP.TopAbs import TopAbs_FACE++TEAL = (0.0, 0.72, 0.69)+WHITE = (0.97, 0.97, 0.97)+GREY = (0.86, 0.86, 0.86)+Z_ART = -0.02 # just under the seating plane (board surface), so the chip never z-fights it+T_ART = 0.02+DASH, GAP, LINE = 0.14, 0.08, 0.045+TEXT_H = 0.30+++def parse_mod(path):+ t = open(path).read()+ pads = []+ for m in re.finditer(r'\(pad\s+"?([^"\s]*)"?\s+smd\s+(\w+)\s*\(at ([-0-9.]+) ([-0-9.]+)(?: ([-0-9.]+))?\)\s*\(size ([-0-9.]+) ([-0-9.]+)\)', t):+ pads.append(dict(name=m.group(1), x=float(m.group(3)), y=-float(m.group(4)), w=float(m.group(6)), h=float(m.group(7))))+ silk = []+ for m in re.finditer(r'\(fp_line \(start ([-0-9.]+) ([-0-9.]+)\) \(end ([-0-9.]+) ([-0-9.]+)\) \(stroke \(width ([-0-9.]+)\)[^\n]*?\(layer "F.SilkS"\)', t):+ x1, y1, x2, y2, w = map(float, m.groups()); silk.append(("line", x1, -y1, x2, -y2, w))+ for m in re.finditer(r'\(fp_circle \(center ([-0-9.]+) ([-0-9.]+)\) \(end ([-0-9.]+) ([-0-9.]+)\) \(stroke \(width ([-0-9.]+)\)[^\n]*?\(layer "F.SilkS"\)', t):+ cx, cy, ex, ey, w = map(float, m.groups()); silk.append(("circle", cx, -cy, math.hypot(ex - cx, ey - cy), 0, w))+ return pads, silk+++def dashed_rect(wp, x, y, w, h):+ solids = []+ corners = [(x - w / 2, y - h / 2), (x + w / 2, y - h / 2), (x + w / 2, y + h / 2), (x - w / 2, y + h / 2)]+ for i in range(4):+ (x1, y1), (x2, y2) = corners[i], corners[(i + 1) % 4]+ L = math.hypot(x2 - x1, y2 - y1); ang = math.degrees(math.atan2(y2 - y1, x2 - x1))+ n = max(1, int(L // (DASH + GAP)))+ step = L / n+ for k in range(n):+ s = k * step; d = min(DASH, step * 0.65)+ cx = x1 + (x2 - x1) * (s + d / 2) / L; cy = y1 + (y2 - y1) * (s + d / 2) / L+ solids.append(wp.center(cx, cy).transformed(rotate=(0, 0, ang)).rect(d, LINE).extrude(T_ART).val())+ return solids+++def main(argv):+ chip, mod, cjson, dst = argv[1:5]+ report_path = argv[argv.index("--report") + 1] if "--report" in argv else None+ pads, silk = parse_mod(mod)+ names = {p["number"]: p["name"] for p in json.load(open(cjson))["pins"]}+ wp = lambda: cq.Workplane("XY").workplane(offset=Z_ART)+ # pad outlines+ pad_solids = []+ for p in pads:+ pad_solids += dashed_rect(wp(), p["x"], p["y"], p["w"], p["h"])+ # silkscreen+ silk_solids = []+ for kind, a, b, c, d, w in silk:+ if kind == "line":+ L = math.hypot(c - a, d - b); ang = math.degrees(math.atan2(d - b, c - a))+ silk_solids.append(wp().center((a + c) / 2, (b + d) / 2).transformed(rotate=(0, 0, ang)).rect(L + w, w).extrude(T_ART).val())+ else:+ silk_solids.append(wp().center(a, b).circle(c + w / 2).circle(max(c - w / 2, 0.01)).extrude(T_ART).val())+ # labels: outside the silk box, vertical for the two pad rows, horizontal for the side pads+ xs = [p["x"] for p in pads]; ys = [p["y"] for p in pads]+ ymax_s = max([abs(s[2]) for s in silk] + [abs(s[4]) for s in silk if s[0] == "line"] + [1.7])+ xmax_s = max([abs(s[1]) for s in silk] + [abs(s[3]) for s in silk if s[0] == "line"] + [3.4])+ label_solids = []; placed = []+ def text(txt, x, y, rot, halign):+ w = wp().center(x, y).transformed(rotate=(0, 0, rot))+ s = w.text(txt, TEXT_H, T_ART, combine=False, halign=halign, valign="center", kind="regular")+ label_solids.append(s.val()); placed.append(dict(pad=txt, x=x, y=y, rot=rot))+ for p in pads:+ nm = names.get(p["name"], p["name"])+ if abs(p["y"]) > 0.6 and abs(p["x"]) < 2.5: # the two rows+ if p["y"] < 0:+ text(nm, p["x"], -ymax_s - 0.25, 90, "right") # reads upward, ends at the silk+ else:+ text(nm, p["x"], ymax_s + 0.25, 90, "left")+ elif abs(p["x"]) > 2.5: # side pads+ if p["x"] > 0:+ text(nm, xmax_s + 0.25, p["y"], 0, "left")+ else:+ text(nm, -xmax_s - 0.25, p["y"], 0, "right")+ else: # thermal pad+ text(f"{nm} ({p['name']})", 0, -ymax_s - 0.25 - 3.4, 0, "center")+ # ---- add to the chip doc as coloured, named components+ doc = read_step(chip)+ stool = XCAFDoc_DocumentTool.ShapeTool_s(doc.Main()); ctool = XCAFDoc_DocumentTool.ColorTool_s(doc.Main())+ labels = TDF_LabelSequence(); stool.GetFreeShapes(labels)+ root = stool.NewShape(); TDataStd_Name.Set_s(root, TCollection_ExtendedString("ADOM_HERO"))+ chip_root = stool.NewShape(); TDataStd_Name.Set_s(chip_root, TCollection_ExtendedString("Adom.Chip"))+ for i in range(1, labels.Length() + 1):+ stool.AddComponent(chip_root, labels.Value(i), TopLoc_Location())+ stool.AddComponent(root, chip_root, TopLoc_Location())++ def add_group(name, solids, colour):+ if not solids:+ return+ comp = cq.Compound.makeCompound(solids).wrapped+ lab = stool.AddShape(comp, False, False)+ TDataStd_Name.Set_s(lab, TCollection_ExtendedString(name))+ col = Quantity_Color(*colour, Quantity_TOC_RGB)+ ctool.SetColor(lab, col, XCAFDoc_ColorGen); ctool.SetColor(lab, col, XCAFDoc_ColorSurf)+ ex = TopExp_Explorer(comp, TopAbs_FACE)+ while ex.More():+ fl = stool.AddSubShape(lab, ex.Current())+ if not fl.IsNull():+ ctool.SetColor(fl, col, XCAFDoc_ColorSurf)+ ex.Next()+ stool.AddComponent(root, lab, TopLoc_Location())+ add_group("Adom.PadOutlines", pad_solids, TEAL)+ add_group("Adom.Silkscreen", silk_solids, WHITE)+ add_group("Adom.PadLabels", label_solids, GREY)+ stool.UpdateAssemblies()+ w = STEPCAFControl_Writer(); w.SetColorMode(True); w.SetNameMode(True)+ w.Transfer(doc, STEPControl_AsIs)+ if w.Write(dst) != IFSelect_RetDone:+ raise SystemExit("write failed")+ rep = {"chip": os.path.basename(chip), "chip_sha256": sha256(chip), "footprint": os.path.basename(mod),+ "output": os.path.basename(dst), "output_sha256": sha256(dst),+ "groups": {"Adom.PadOutlines": {"colour": TEAL, "alpha": 0.5, "count": len(pad_solids)},+ "Adom.Silkscreen": {"colour": WHITE, "alpha": 0.3, "count": len(silk_solids)},+ "Adom.PadLabels": {"colour": GREY, "alpha": 0.5, "count": len(label_solids)}},+ "z_art_mm": Z_ART, "labels": placed,+ "note": "nonphysical hero-only artwork; board LODs must exclude these groups"}+ if report_path:+ json.dump(rep, open(report_path, "w"), indent=1)+ print(json.dumps({k: rep[k] for k in ("output", "groups")}))+++if __name__ == "__main__":+ main(sys.argv)
pipeline/merge_symbols.pyadded+40@@ -0,0 +1,40 @@+#!/usr/bin/env python3+"""Merge symbols/<MPN>/<MPN>.kicad_sym into libraries/Adom_ToF.kicad_sym, keeping the sourcing+properties (MPN, Manufacturer, Mouser, DigiKey) the library already carries for each part."""+import os, re, sys+ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))+PARTS = ["VL53L5CX", "VL53L7CX", "VL53L8CX"]+KEEP = ("MPN", "Manufacturer", "Mouser", "DigiKey")++def block(text, head):+ i = text.index(head); depth = 0; j = i+ while True:+ c = text[j]+ if c == "(": depth += 1+ elif c == ")":+ depth -= 1+ if depth == 0: return i, j + 1+ j += 1++def prop_lines(blk, names):+ out = []+ for m in re.finditer(r'\n(\s*\(property "([^"]+)" [^\n]*(?:\n(?!\s*\(property)[^\n]*)*)', blk):+ if m.group(2) in names: out.append(m.group(1))+ return out++lib_path = os.path.join(ROOT, "libraries", "Adom_ToF.kicad_sym")+lib = open(lib_path).read()+for m in PARTS:+ new = open(os.path.join(ROOT, "symbols", m, f"{m}.kicad_sym")).read()+ ni, nj = block(new, f'(symbol "{m}"'); nb = new[ni:nj]+ oi, oj = block(lib, f'(symbol "{m}"'); ob = lib[oi:oj]+ have = set(re.findall(r'\(property "([^"]+)"', nb))+ extra = [p for p in prop_lines(ob, KEEP) if re.search(r'\(property "([^"]+)"', p).group(1) not in have]+ if extra:+ # insert after the last property of the new block+ last = list(re.finditer(r'\n\s*\(property "[^"]+" [^\n]*(?:\n(?!\s*\(property)(?!\s*\(symbol)[^\n]*)*', nb))[-1]+ nb = nb[:last.end()] + "\n" + "\n".join(extra) + nb[last.end():]+ lib = lib[:oi] + nb + lib[oj:]+ print(f"{m}: merged, kept {len(extra)} sourcing properties, outline {re.search(r'Adom_Chip_Outline\" \"([^\"]*)', nb).group(1) if 'Adom_Chip_Outline' in nb else '?'}")+open(lib_path, "w").write(lib)+print("wrote", lib_path)
pipeline/parts_data.jsonadded+891@@ -0,0 +1,891 @@+{+ "VL53L5CX": {+ "slug": "vl53l5cx",+ "order_code": "VL53L5CXV0GC/1",+ "ds_id": "DS13754 Rev 5 (December 2021)",+ "ds_pages": 38,+ "datasheet_url": "https://www.st.com/resource/en/datasheet/vl53l5cx.pdf",+ "product_url": "https://www.st.com/en/imaging-and-photonics-solutions/vl53l5cx.html",+ "package": "Optical LGA-16 with liner, 6.4 x 3.0 x 1.5 mm",+ "body_size": {+ "x_mm": 6.4,+ "y_mm": 3.0,+ "z_mm": 1.5,+ "pitch_mm": 0.75+ },+ "brief": "ST VL53L5CX Time-of-Flight 8x8 multizone ranging sensor, 400 cm, 63 deg diagonal FoV, I2C, optical LGA-16 6.4 x 3.0 x 1.5 mm. Datasheet-verified pinout, KiCad symbol with chip outline, footprint, Fusion library, manufacturer STEP (Z-up, FoV on/off, side-etched MPN) and provenance.",+ "pitch": "ST VL53L5CX 64-zone ToF ranging sensor (400 cm, 63 deg FoV, I2C) with datasheet-verified pinout, KiCad symbol/footprint, Fusion .lbr and the manufacturer 3D model in Z-up, FoV-on/off and MPN-etched variants.",+ "overview": "The VL53L5CX is ST's FlightSense direct Time-of-Flight ranging sensor that returns absolute distance for up to 8 x 8 zones (64 zones, or 4 x 4) across a 63 degree diagonal square field of view, up to 400 cm, at up to 60 Hz. One reflowable module integrates the 940 nm VCSEL emitter with its driver, diffractive optics on both emitter and receiver, the SPAD receiver array and a microcontroller running ST's firmware, so the host only talks I2C. Histogram processing gives multitarget detection per zone and immunity to cover-glass crosstalk beyond 60 cm; an autonomous low-power mode wakes the host on a programmable distance threshold. Runs from a single 2.8 V or 3.3 V supply, or with a separate 1.8 V IOVDD.",+ "pin_table_pages": "6",+ "solder_page": "31",+ "order_page": "32",+ "tape_pages": "32",+ "msl_page": "31",+ "marking_pages": "28 to 29",+ "outline_pages": "24 to 27",+ "app_notes": "AN5657 (module integration, cover glass) and UM2884 (driver and API)",+ "cse_part_id": 15569520,+ "fetched": "2026-09-19",+ "specs": [+ [+ "Zones",+ "4 x 4 or 8 x 8 (64 zones), per-zone multitarget detection and motion indicator",+ "page 1"+ ],+ [+ "Ranging distance",+ "up to 400 cm",+ "page 1"+ ],+ [+ "Field of view",+ "63 degree diagonal, square (diffractive optics on emitter and receiver)",+ "page 1"+ ],+ [+ "Frame rate",+ "up to 60 Hz",+ "page 1"+ ],+ [+ "Emitter",+ "940 nm VCSEL with integrated driver, invisible, eye-safe Class 1",+ "pages 1 to 2"+ ],+ [+ "Interface",+ "I2C, 400 kHz to 1 MHz (Fast mode plus), 7-bit address 0x52 (programmable via LPn)",+ "Table 7, page 13"+ ],+ [+ "AVDD",+ "2.8 V or 3.3 V analog and VCSEL supply (independent of IOVDD)",+ "Table 10, page 15"+ ],+ [+ "IOVDD",+ "1.8 V, 2.8 V or 3.3 V digital core and I/O supply",+ "page 1; Table 10, page 15"+ ],+ [+ "Operating temperature",+ "-30 to 85 degrees C ambient",+ "Table 10, page 15"+ ],+ [+ "Package",+ "Optical LGA-16 with liner, 6.4 x 3.0 x 1.5 mm, single reflowable component",+ "page 1; outline drawing, pages 24 to 27"+ ],+ [+ "Moisture sensitivity",+ "MSL 3 (IPC/JEDEC J-STD-020)",+ "page 31"+ ]+ ],+ "pins": [+ {+ "n": "A1",+ "name": "I2C_RST",+ "desc": "I2C interface reset, active high. Toggle 0 to 1 to 0 to reset the I2C slave (does not reset the sensor, see UM2884). Connect to GND through 47 kOhm."+ },+ {+ "n": "A2",+ "name": "RSVD4",+ "desc": "Reserved. Connect to ground."+ },+ {+ "n": "A3",+ "name": "INT",+ "desc": "Interrupt output, defaults to open-drain (tristate); 47 kOhm pull-up to IOVDD required."+ },+ {+ "n": "A4",+ "name": "IOVDD",+ "desc": "1.8 V, 2.8 V or 3.3 V supply for the digital core and I/O. All digital signals are driven at IOVDD level."+ },+ {+ "n": "A5",+ "name": "LPn",+ "desc": "Comms enable. Logic 0 disables I2C communication in low-power mode, logic 1 enables it; used to change the I2C address in multi-device systems. 47 kOhm pull-up to IOVDD required."+ },+ {+ "n": "A6",+ "name": "RSVD1",+ "desc": "Reserved. Connect to ground."+ },+ {+ "n": "A7",+ "name": "RSVD2",+ "desc": "Reserved. Connect to ground."+ },+ {+ "n": "B1",+ "name": "AVDD",+ "desc": "2.8 V or 3.3 V analog and VCSEL supply."+ },+ {+ "n": "B4",+ "name": "THERMALPAD",+ "desc": "Thermal pad. Connect to a ground plane for thermal conduction (AN5657)."+ },+ {+ "n": "B7",+ "name": "AVDD",+ "desc": "2.8 V or 3.3 V analog and VCSEL supply."+ },+ {+ "n": "C1",+ "name": "GND",+ "desc": "Ground."+ },+ {+ "n": "C2",+ "name": "RSVD6",+ "desc": "Reserved general-purpose I/O, defaults to open-drain (tristate); 47 kOhm pull-up to IOVDD required."+ },+ {+ "n": "C3",+ "name": "SDA",+ "desc": "I2C data (bidirectional); 2.2 kOhm pull-up to IOVDD required."+ },+ {+ "n": "C4",+ "name": "SCL",+ "desc": "I2C clock (input); 2.2 kOhm pull-up to IOVDD required."+ },+ {+ "n": "C5",+ "name": "RSVD5",+ "desc": "Reserved. Do not connect."+ },+ {+ "n": "C6",+ "name": "RSVD3",+ "desc": "Reserved. Connect to ground."+ },+ {+ "n": "C7",+ "name": "GND",+ "desc": "Ground."+ }+ ],+ "sourcing": {+ "date": "2026-09-18",+ "rows": [+ {+ "dist": "Mouser",+ "sku": "511-VL53L5CXV0GC/1",+ "price": "$7.92",+ "stock": "4,672",+ "url": "https://www.mouser.com/c/?q=VL53L5CXV0GC%2F1"+ },+ {+ "dist": "DigiKey",+ "sku": "497-VL53L5CXV0GC/1-ND",+ "price": "see link",+ "stock": "see link",+ "url": "https://www.digikey.com/en/products/result?keywords=VL53L5CXV0GC%2F1"+ }+ ]+ },+ "distributor_links": {+ "mouser": "https://www.mouser.com/c/?q=VL53L5CXV0GC%2F1",+ "digikey": "https://www.digikey.com/en/products/result?keywords=VL53L5CXV0GC%2F1"+ },+ "triggers": [+ "vl53l5cx",+ "vl53l5cxv0gc/1",+ "8x8 tof sensor",+ "multizone time of flight",+ "64 zone tof",+ "flightsense",+ "vl53l5cx kicad symbol",+ "vl53l5cx footprint",+ "vl53l5cx step",+ "tof sensor 400 cm"+ ],+ "extra_tags": [+ "400cm",+ "63deg-fov"+ ],+ "related": [+ {+ "title": "VL53L7CX",+ "url": "https://wiki.adom.inc/adom/vl53l7cx",+ "note": "pin-to-pin and driver compatible sibling with a 90 degree FoV (350 cm)."+ },+ {+ "title": "VL53L8CX",+ "url": "https://wiki.adom.inc/adom/vl53l8cx",+ "note": "newer generation with SPI, 1.8 V core and better ambient-light performance (different pinout)."+ },+ {+ "title": "VL53L5CX molecule (v11)",+ "url": "https://wiki.adom.inc/adom/vl53l5cx-molecule-v11-229000",+ "note": "a reusable sub-circuit built around this sensor."+ }+ ],+ "figures": [+ [+ "Pin description (Table 3)",+ 6+ ],+ [+ "Recommended operating conditions (Table 10)",+ 15+ ],+ [+ "Outline drawing (Figure 21)",+ 24+ ],+ [+ "Recommended solder pattern",+ 31+ ],+ [+ "Tape and reel, order codes",+ 32+ ]+ ],+ "manufacturer_links": [+ [+ "Product page (STMicroelectronics)",+ "https://www.st.com/en/imaging-and-photonics-solutions/vl53l5cx.html",+ "manufacturer authority: lifecycle, documentation, tools and the CAD Resources tab"+ ],+ [+ "Datasheet DS13754",+ "https://www.st.com/resource/en/datasheet/vl53l5cx.pdf",+ "the source of every pin, spec and drawing on this page"+ ],+ [+ "User manual UM2884 (ULD driver and API)",+ "https://www.st.com/content/st_com/en/search.html#q=UM2884-t=resources-page=1",+ "how to talk to the sensor from firmware"+ ],+ [+ "Application note AN5657 (module integration, cover glass, reflow)",+ "https://www.st.com/content/st_com/en/search.html#q=AN5657-t=resources-page=1",+ "mechanical and optical integration rules"+ ],+ [+ "STSW-IMG023 ultra-lite driver (ULD)",+ "https://www.st.com/content/st_com/en/search.html#q=STSW-IMG023-t=resources-page=1",+ "ST's C driver package for this sensor"+ ],+ [+ "Evaluation kits SATEL-VL53L5CX and X-NUCLEO-53L5A1",+ "https://www.st.com/content/st_com/en/search.html#q=SATEL-VL53L5CX-t=resources-page=1",+ "breakout and Nucleo expansion boards from ST"+ ],+ [+ "CAD Resources tab (SamacSys and Ultra Librarian widgets)",+ "https://www.st.com/en/imaging-and-photonics-solutions/vl53l5cx.html#cad-resources",+ "where ST hosts the symbol, footprint and 3D model downloads"+ ],+ [+ "SamacSys entry for this part (Component Search Engine)",+ "https://st.componentsearchengine.com/entry_u_newDesign.php?mna=STMicroelectronics&mpn=VL53L5CXV0GC%2F1&pna=st&vrq=multi&fmt=zip",+ "free CSE account; partID 15569520, 3D download is ga/model.php?fmt3d=stp&partID=15569520"+ ]+ ]+ },+ "VL53L7CX": {+ "slug": "vl53l7cx",+ "order_code": "VL53L7CXV0GC/1",+ "ds_id": "DS13865 Rev 6 (March 2023)",+ "ds_pages": 40,+ "datasheet_url": "https://www.st.com/resource/en/datasheet/vl53l7cx.pdf",+ "product_url": "https://www.st.com/en/imaging-and-photonics-solutions/vl53l7cx.html",+ "package": "Optical LGA-16 with liner, 6.4 x 3.0 x 1.6 mm",+ "body_size": {+ "x_mm": 6.4,+ "y_mm": 3.0,+ "z_mm": 1.6,+ "pitch_mm": 0.75+ },+ "brief": "ST VL53L7CX Time-of-Flight 8x8 multizone ranging sensor with 90 deg diagonal FoV (60 x 60), 350 cm, I2C, pin-compatible with VL53L5CX, optical LGA-16 6.4 x 3.0 x 1.6 mm. Datasheet-verified pinout, KiCad symbol with chip outline, footprint, Fusion library, manufacturer STEP (Z-up, FoV on/off, side-etched MPN) and provenance.",+ "pitch": "ST VL53L7CX 64-zone ToF sensor with an ultrawide 90 deg FoV (350 cm, I2C, VL53L5CX pin-compatible): datasheet-verified pinout, KiCad symbol/footprint, Fusion .lbr and the manufacturer 3D model in Z-up, FoV-on/off and MPN-etched variants.",+ "overview": "The VL53L7CX is the ultrawide field-of-view member of ST's FlightSense multizone family: a metasurface lens on the 940 nm VCSEL projects a 60 x 60 degree square field (90 degree diagonal) and the SPAD receiver returns absolute distance for up to 8 x 8 zones at up to 60 Hz, up to 350 cm. It is derived from the VL53L5CX and shares its pinout and driver, so a VL53L5CX design migrates by swapping the part. Histogram processing gives per-zone multitarget detection and cover-glass crosstalk immunity beyond 60 cm; the autonomous low-power mode wakes the host on a programmable distance threshold. Three modules cover 180 x 60 degrees for smart speakers, vacuum robots (SLAM, wall tracking, cliff detection) and user-presence wake-up.",+ "pin_table_pages": "6",+ "solder_page": "33",+ "order_page": "34",+ "tape_pages": "34",+ "msl_page": "33",+ "marking_pages": "30 to 31",+ "outline_pages": "25 to 28",+ "app_notes": "AN5853 (module integration, cover glass) and UM3038 (driver and API)",+ "cse_part_id": 17168850,+ "fetched": "2026-09-19",+ "specs": [+ [+ "Zones",+ "4 x 4 or 8 x 8 (64 zones), per-zone multitarget detection and motion indicator",+ "page 1"+ ],+ [+ "Ranging distance",+ "up to 350 cm",+ "page 1"+ ],+ [+ "Field of view",+ "90 degree diagonal, 60 x 60 degree square (metasurface DOE on emitter and receiver)",+ "page 1"+ ],+ [+ "Frame rate",+ "up to 60 Hz",+ "page 1"+ ],+ [+ "Emitter",+ "940 nm VCSEL with integrated driver, invisible, eye-safe Class 1",+ "pages 1 to 2"+ ],+ [+ "Interface",+ "I2C, up to 1 MHz (Fast mode plus), 7-bit address 0x52 (programmable via LPn)",+ "Table 7, page 13"+ ],+ [+ "AVDD",+ "2.8 V or 3.3 V analog and VCSEL supply (independent of IOVDD)",+ "Table 10, page 15"+ ],+ [+ "IOVDD",+ "1.8 V, 2.8 V or 3.3 V digital core and I/O supply",+ "page 1; Table 10, page 15"+ ],+ [+ "Operating temperature",+ "-30 to 85 degrees C ambient",+ "Table 10, page 15"+ ],+ [+ "Compatibility",+ "pin-to-pin and driver compatible with VL53L5CX",+ "page 1"+ ],+ [+ "Package",+ "Optical LGA-16 with liner, 6.4 x 3.0 x 1.6 mm, single reflowable component",+ "page 1; outline drawing, pages 25 to 28"+ ],+ [+ "Moisture sensitivity",+ "MSL 3 (IPC/JEDEC J-STD-020)",+ "page 33"+ ]+ ],+ "pins": [+ {+ "n": "A1",+ "name": "I2C_RST",+ "desc": "I2C interface reset, active high. Toggle 0 to 1 to 0 to reset the I2C slave (does not reset the sensor, see UM3038). Connect to GND through 47 kOhm."+ },+ {+ "n": "A2",+ "name": "RSVD4",+ "desc": "Reserved. Connect to ground."+ },+ {+ "n": "A3",+ "name": "INT",+ "desc": "Interrupt output, defaults to open-drain (tristate); 47 kOhm pull-up to IOVDD required."+ },+ {+ "n": "A4",+ "name": "IOVDD",+ "desc": "1.8 V, 2.8 V or 3.3 V supply for the digital core and I/O. All digital signals are driven at IOVDD level."+ },+ {+ "n": "A5",+ "name": "LPn",+ "desc": "Comms enable. Logic 0 disables I2C communication in low-power mode, logic 1 enables it; used to change the I2C address in multi-device systems. 47 kOhm pull-up to IOVDD required."+ },+ {+ "n": "A6",+ "name": "RSVD1",+ "desc": "Reserved. Connect to ground."+ },+ {+ "n": "A7",+ "name": "RSVD2",+ "desc": "Reserved. Connect to ground."+ },+ {+ "n": "B1",+ "name": "AVDD",+ "desc": "2.8 V or 3.3 V analog and VCSEL supply."+ },+ {+ "n": "B4",+ "name": "THERMALPAD",+ "desc": "Thermal pad. Connect to a ground plane for thermal conduction (AN5853)."+ },+ {+ "n": "B7",+ "name": "AVDD",+ "desc": "2.8 V or 3.3 V analog and VCSEL supply."+ },+ {+ "n": "C1",+ "name": "GND",+ "desc": "Ground."+ },+ {+ "n": "C2",+ "name": "RSVD6",+ "desc": "Reserved general-purpose I/O, defaults to open-drain (tristate); 47 kOhm pull-up to IOVDD required."+ },+ {+ "n": "C3",+ "name": "SDA",+ "desc": "I2C data (bidirectional); 2.2 kOhm pull-up to IOVDD required."+ },+ {+ "n": "C4",+ "name": "SCL",+ "desc": "I2C clock (input); 2.2 kOhm pull-up to IOVDD required."+ },+ {+ "n": "C5",+ "name": "RSVD5",+ "desc": "Reserved. Do not connect."+ },+ {+ "n": "C6",+ "name": "RSVD3",+ "desc": "Reserved. Connect to ground."+ },+ {+ "n": "C7",+ "name": "GND",+ "desc": "Ground."+ }+ ],+ "sourcing": {+ "date": "2026-09-18",+ "rows": [+ {+ "dist": "Mouser",+ "sku": "511-VL53L7CXV0GC/1",+ "price": "$7.94",+ "stock": "28",+ "url": "https://www.mouser.com/c/?q=VL53L7CXV0GC%2F1"+ },+ {+ "dist": "DigiKey",+ "sku": "497-VL53L7CXV0GC/1-ND",+ "price": "$8.80",+ "stock": "4,507",+ "url": "https://www.digikey.com/en/products/result?keywords=VL53L7CXV0GC%2F1"+ }+ ]+ },+ "distributor_links": {+ "mouser": "https://www.mouser.com/c/?q=VL53L7CXV0GC%2F1",+ "digikey": "https://www.digikey.com/en/products/result?keywords=VL53L7CXV0GC%2F1"+ },+ "triggers": [+ "vl53l7cx",+ "vl53l7cxv0gc/1",+ "90 degree tof sensor",+ "wide fov time of flight",+ "8x8 tof sensor",+ "flightsense",+ "vl53l7cx kicad symbol",+ "vl53l7cx footprint",+ "vl53l7cx step"+ ],+ "extra_tags": [+ "350cm",+ "90deg-fov"+ ],+ "related": [+ {+ "title": "VL53L5CX",+ "url": "https://wiki.adom.inc/adom/vl53l5cx",+ "note": "the 63 degree FoV, 400 cm sibling this part is derived from (same pinout and driver)."+ },+ {+ "title": "VL53L8CX",+ "url": "https://wiki.adom.inc/adom/vl53l8cx",+ "note": "newer generation with SPI, 1.8 V core and better ambient-light performance (different pinout)."+ }+ ],+ "figures": [+ [+ "Pin description (Table 3)",+ 6+ ],+ [+ "Recommended operating conditions (Table 10)",+ 15+ ],+ [+ "Outline drawing (Figure 21)",+ 25+ ],+ [+ "Recommended solder pattern",+ 33+ ],+ [+ "Tape and reel, order codes",+ 34+ ]+ ],+ "manufacturer_links": [+ [+ "Product page (STMicroelectronics)",+ "https://www.st.com/en/imaging-and-photonics-solutions/vl53l7cx.html",+ "manufacturer authority: lifecycle, documentation, tools and the CAD Resources tab"+ ],+ [+ "Datasheet DS13865",+ "https://www.st.com/resource/en/datasheet/vl53l7cx.pdf",+ "the source of every pin, spec and drawing on this page"+ ],+ [+ "User manual UM3038 (ULD driver and API)",+ "https://www.st.com/content/st_com/en/search.html#q=UM3038-t=resources-page=1",+ "how to talk to the sensor from firmware"+ ],+ [+ "Application note AN5853 (module integration, cover glass, reflow)",+ "https://www.st.com/content/st_com/en/search.html#q=AN5853-t=resources-page=1",+ "mechanical and optical integration rules"+ ],+ [+ "STSW-IMG036 ultra-lite driver (ULD)",+ "https://www.st.com/content/st_com/en/search.html#q=STSW-IMG036-t=resources-page=1",+ "ST's C driver package for this sensor"+ ],+ [+ "Evaluation kits SATEL-VL53L7CX and X-NUCLEO-53L7A1",+ "https://www.st.com/content/st_com/en/search.html#q=SATEL-VL53L7CX-t=resources-page=1",+ "breakout and Nucleo expansion boards from ST"+ ],+ [+ "CAD Resources tab (SamacSys and Ultra Librarian widgets)",+ "https://www.st.com/en/imaging-and-photonics-solutions/vl53l7cx.html#cad-resources",+ "where ST hosts the symbol, footprint and 3D model downloads"+ ],+ [+ "SamacSys entry for this part (Component Search Engine)",+ "https://st.componentsearchengine.com/entry_u_newDesign.php?mna=STMicroelectronics&mpn=VL53L7CXV0GC%2F1&pna=st&vrq=multi&fmt=zip",+ "free CSE account; partID 17168850, 3D download is ga/model.php?fmt3d=stp&partID=17168850"+ ]+ ]+ },+ "VL53L8CX": {+ "slug": "vl53l8cx",+ "order_code": "VL53L8CXV0GC/1",+ "ds_id": "DS14161 Rev 7 (August 2023)",+ "ds_pages": 42,+ "datasheet_url": "https://www.st.com/resource/en/datasheet/vl53l8cx.pdf",+ "product_url": "https://www.st.com/en/imaging-and-photonics-solutions/vl53l8cx.html",+ "package": "Optical LGA-16 with liner, 6.4 x 3.0 x 1.75 mm",+ "body_size": {+ "x_mm": 6.4,+ "y_mm": 3.0,+ "z_mm": 1.75,+ "pitch_mm": 0.75+ },+ "brief": "ST VL53L8CX low-power high-performance 8x8 multizone Time-of-Flight sensor, 400 cm, 65 deg diagonal FoV, I2C up to 1 MHz or SPI up to 3 MHz, 1.8 V core, optical LGA-16 6.4 x 3.0 x 1.75 mm. Datasheet-verified pinout, KiCad symbol with chip outline, footprint, Fusion library, manufacturer STEP (Z-up, FoV on/off, side-etched MPN) and provenance.",+ "pitch": "ST VL53L8CX new-generation 64-zone ToF sensor (400 cm, 65 deg FoV, I2C or SPI, better under ambient light): datasheet-verified pinout, KiCad symbol/footprint, Fusion .lbr and the manufacturer 3D model in Z-up, FoV-on/off and MPN-etched variants.",+ "overview": "The VL53L8CX is the new-generation FlightSense multizone sensor: a higher-power 940 nm VCSEL and two metasurface lenses give up to 400 cm ranging over a 65 degree diagonal square field, with markedly better performance under ambient light and lower power than the VL53L5CX. It returns absolute distance for up to 8 x 8 zones at up to 60 Hz, with per-zone multitarget detection, motion indication and cover-glass crosstalk immunity above 60 cm, and can sit behind a dark cover glass. The host talks I2C (up to 1 MHz) or SPI (up to 3 MHz) for high frame rates and short boot; a 1.8 V core supply plus 3.3 V AVDD are required and IOVDD can be 1.2 V or 1.8 V. The pinout differs from the VL53L5CX/L7CX (SPI pins, SYNC, CORE_1V8), so it is not a drop-in replacement.",+ "pin_table_pages": "6 to 7",+ "solder_page": "35",+ "order_page": "38",+ "tape_pages": "33 to 34",+ "msl_page": "36",+ "marking_pages": "33",+ "outline_pages": "29 to 31",+ "app_notes": "AN5897 (module integration, cover glass) and UM3109 (driver and API)",+ "cse_part_id": 17236813,+ "fetched": "2026-09-19",+ "specs": [+ [+ "Zones",+ "4 x 4 or 8 x 8 (64 zones), per-zone multitarget detection and motion indicator",+ "page 1"+ ],+ [+ "Ranging distance",+ "up to 400 cm, enhanced under ambient light",+ "page 1"+ ],+ [+ "Field of view",+ "65 degree diagonal, square (diffractive optics on emitter and receiver)",+ "page 1"+ ],+ [+ "Frame rate",+ "up to 60 Hz",+ "page 1"+ ],+ [+ "Emitter",+ "new-generation high-power 940 nm VCSEL with integrated driver, eye-safe Class 1",+ "pages 1 to 2"+ ],+ [+ "Interface",+ "I2C up to 1 MHz or SPI up to 3 MHz (SPI_I2C_N selects)",+ "page 1; Table 3, pages 6 to 7"+ ],+ [+ "AVDD",+ "3.3 V (3.13 to 3.47 V) analog and VCSEL supply",+ "Table 10, page 19"+ ],+ [+ "CORE_1V8",+ "1.8 V (1.62 to 1.98 V) analog core supply",+ "Table 10, page 19"+ ],+ [+ "IOVDD",+ "1.2 V (1.08 to 1.32) or 1.8 V (1.62 to 1.98) I/O supply",+ "Table 10, page 19"+ ],+ [+ "Operating temperature",+ "-30 to 85 degrees C ambient",+ "Table 10, page 19"+ ],+ [+ "Package",+ "Optical LGA-16 with liner, 6.4 x 3.0 x 1.75 mm, single reflowable component, can be hidden behind dark cover glass",+ "page 1; outline drawing, pages 29 to 31"+ ],+ [+ "Moisture sensitivity",+ "MSL 3 (IPC/JEDEC J-STD-020)",+ "page 36"+ ]+ ],+ "pins": [+ {+ "n": "A1",+ "name": "INT",+ "desc": "Interrupt output, defaults to open-drain (tristate); 47 kOhm pull-up to IOVDD required."+ },+ {+ "n": "A2",+ "name": "LPn",+ "desc": "Enables communication. Logic 0 disables I2C communication in low-power mode, logic 1 enables it; used to change the I2C address in multi-device systems. If unused, or when using SPI, connect to IOVDD with a 47 kOhm pull-up."+ },+ {+ "n": "A3",+ "name": "IOVDD",+ "desc": "1.2 V or 1.8 V I/O supply. All digital signals are driven at IOVDD level."+ },+ {+ "n": "A4",+ "name": "SDA/MOSI",+ "desc": "I2C: data (bidirectional), 2.2 kOhm pull-up to IOVDD required. SPI: main output, secondary input."+ },+ {+ "n": "A5",+ "name": "SCL/MCLK",+ "desc": "I2C: clock (input), 2.2 kOhm pull-up to IOVDD required. SPI: main clock."+ },+ {+ "n": "A6",+ "name": "RSVD1",+ "desc": "Reserved. Connect to ground."+ },+ {+ "n": "A7",+ "name": "RSVD2",+ "desc": "Reserved. Connect to ground."+ },+ {+ "n": "B1",+ "name": "SYNC",+ "desc": "General-purpose I/O, defaults to open-drain (tristate); 47 kOhm pull-up to IOVDD required."+ },+ {+ "n": "B4",+ "name": "THERMALPAD",+ "desc": "Thermal pad. Connect to a ground plane for thermal conduction (AN5897)."+ },+ {+ "n": "B7",+ "name": "CORE_1V8",+ "desc": "1.8 V analog core supply."+ },+ {+ "n": "C1",+ "name": "SPI_I2C_N",+ "desc": "I2C mode: low selects I2C, connect to GND with a 47 kOhm pull-down; also the I2C interface reset (toggle 0 to 1 to 0 resets the I2C target, not the sensor, see UM3109). SPI mode: connect to IOVDD with a 47 kOhm pull-up."+ },+ {+ "n": "C2",+ "name": "NCS",+ "desc": "I2C: not used, connect to GND with a 47 kOhm pull-down. SPI: active-low chip select, 47 kOhm pull-up to IOVDD required."+ },+ {+ "n": "C3",+ "name": "GND",+ "desc": "Ground."+ },+ {+ "n": "C4",+ "name": "AVDD",+ "desc": "3.3 V analog and VCSEL supply."+ },+ {+ "n": "C5",+ "name": "MISO",+ "desc": "I2C: do not connect. SPI: main input, secondary output, push-pull driven at IOVDD level."+ },+ {+ "n": "C6",+ "name": "RSVD3",+ "desc": "Reserved. Connect to ground."+ },+ {+ "n": "C7",+ "name": "GND",+ "desc": "Ground."+ }+ ],+ "sourcing": {+ "date": "2026-09-18",+ "rows": [+ {+ "dist": "Mouser",+ "sku": "511-VL53L8CXV0GC/1",+ "price": "$7.92",+ "stock": "8,605",+ "url": "https://www.mouser.com/c/?q=VL53L8CXV0GC%2F1"+ },+ {+ "dist": "DigiKey",+ "sku": "497-VL53L8CXV0GC/1-ND",+ "price": "see link",+ "stock": "see link",+ "url": "https://www.digikey.com/en/products/result?keywords=VL53L8CXV0GC%2F1"+ }+ ]+ },+ "distributor_links": {+ "mouser": "https://www.mouser.com/c/?q=VL53L8CXV0GC%2F1",+ "digikey": "https://www.digikey.com/en/products/result?keywords=VL53L8CXV0GC%2F1"+ },+ "triggers": [+ "vl53l8cx",+ "vl53l8cxv0gc/1",+ "8x8 tof sensor spi",+ "low power multizone tof",+ "flightsense",+ "vl53l8cx kicad symbol",+ "vl53l8cx footprint",+ "vl53l8cx step",+ "tof sensor ambient light"+ ],+ "extra_tags": [+ "400cm",+ "65deg-fov",+ "spi"+ ],+ "related": [+ {+ "title": "VL53L5CX",+ "url": "https://wiki.adom.inc/adom/vl53l5cx",+ "note": "previous generation, I2C only, 2.8/3.3 V single supply (different pinout)."+ },+ {+ "title": "VL53L7CX",+ "url": "https://wiki.adom.inc/adom/vl53l7cx",+ "note": "ultrawide 90 degree FoV member of the previous generation."+ }+ ],+ "figures": [+ [+ "Pin description (Table 3, part 1)",+ 6+ ],+ [+ "Pin description (Table 3, part 2)",+ 7+ ],+ [+ "Recommended operating conditions (Table 10)",+ 19+ ],+ [+ "Outline drawing (Figure 26)",+ 29+ ],+ [+ "Recommended solder pattern",+ 35+ ],+ [+ "Order codes",+ 38+ ]+ ],+ "legacy_figures": [+ "pinout.png",+ "outline-drawing-1.png",+ "outline-drawing-2.png",+ "solder-pattern.png",+ "tape-and-reel.png",+ "fov-diagram.png",+ "block-diagram.png",+ "zone-mapping-8x8.png"+ ],+ "manufacturer_links": [+ [+ "Product page (STMicroelectronics)",+ "https://www.st.com/en/imaging-and-photonics-solutions/vl53l8cx.html",+ "manufacturer authority: lifecycle, documentation, tools and the CAD Resources tab"+ ],+ [+ "Datasheet DS14161",+ "https://www.st.com/resource/en/datasheet/vl53l8cx.pdf",+ "the source of every pin, spec and drawing on this page"+ ],+ [+ "User manual UM3109 (ULD driver and API)",+ "https://www.st.com/content/st_com/en/search.html#q=UM3109-t=resources-page=1",+ "how to talk to the sensor from firmware"+ ],+ [+ "Application note AN5897 (module integration, cover glass, reflow)",+ "https://www.st.com/content/st_com/en/search.html#q=AN5897-t=resources-page=1",+ "mechanical and optical integration rules"+ ],+ [+ "STSW-IMG040 ultra-lite driver (ULD)",+ "https://www.st.com/content/st_com/en/search.html#q=STSW-IMG040-t=resources-page=1",+ "ST's C driver package for this sensor"+ ],+ [+ "Evaluation kits SATEL-VL53L8 and X-NUCLEO-53L8A1",+ "https://www.st.com/content/st_com/en/search.html#q=SATEL-VL53L8-t=resources-page=1",+ "breakout and Nucleo expansion boards from ST"+ ],+ [+ "CAD Resources tab (SamacSys and Ultra Librarian widgets)",+ "https://www.st.com/en/imaging-and-photonics-solutions/vl53l8cx.html#cad-resources",+ "where ST hosts the symbol, footprint and 3D model downloads"+ ],+ [+ "SamacSys entry for this part (Component Search Engine)",+ "https://st.componentsearchengine.com/entry_u_newDesign.php?mna=STMicroelectronics&mpn=VL53L8CXV0GC%2F1&pna=st&vrq=multi&fmt=zip",+ "free CSE account; partID 17236813, 3D download is ga/model.php?fmt3d=stp&partID=17236813"+ ]+ ]+ }+}
pipeline/publish_wiki_pages.shadded+37@@ -0,0 +1,37 @@+#!/bin/bash+# Create (once) and push the three component pages from wiki/<slug>/ in size-bounded batches.+set -u+cd "$(dirname "$0")/../wiki" || exit 1+MAXB=$((3500*1024))+declare -A MPN=( [vl53l5cx]="VL53L5CXV0GC/1" [vl53l7cx]="VL53L7CXV0GC/1" [vl53l8cx]="VL53L8CXV0GC/1" )+declare -A TITLE=( [vl53l5cx]="VL53L5CX" [vl53l7cx]="VL53L7CX" [vl53l8cx]="VL53L8CX" )+declare -A SUB=( [vl53l5cx]="8x8 multizone ToF sensor, 400 cm, 63 deg FoV, I2C: symbol, footprint, Fusion .lbr, manufacturer STEP with FoV on/off and side-etched MPN, datasheet, provenance" \+ [vl53l7cx]="8x8 multizone ToF sensor with a 90 deg FoV, 350 cm, I2C, VL53L5CX pin-compatible: symbol, footprint, Fusion .lbr, manufacturer STEP with FoV on/off and side-etched MPN, datasheet, provenance" \+ [vl53l8cx]="Low-power 8x8 multizone ToF sensor, 400 cm, 65 deg FoV, I2C or SPI, 1.8 V core: symbol, footprint, Fusion .lbr, manufacturer STEP with FoV on/off and side-etched MPN, datasheet, provenance" )+for slug in "${@:-vl53l5cx vl53l7cx vl53l8cx}"; do+ cd "$slug" || continue+ brief=$(python3 -c "import json; print(json.load(open('page.json'))['brief'])")+ url=$(python3 -c "import json; print(json.load(open('page.json'))['component']['product_page'])")+ if ! timeout 60 adom-wiki repo show adom/$slug page.json >/dev/null 2>&1; then+ echo "== creating adom/$slug (pages API: the CLI create has no distributor flag)"+ python3 - "$slug" "${TITLE[$slug]}" "${SUB[$slug]}" > /tmp/create-body-$slug.json <<'PY'+import json,sys+slug,title,sub=sys.argv[1:4]; pg=json.load(open("page.json"))+body={"slug":slug,"org":"adom","type":"hardware","kind":"component","title":title,"brief":pg["brief"],"version":"0.1.0",+ "because":"No wiki page exists for this exact STMicroelectronics part number; the three VL53Lx ToF pages hold the reviewed symbol, footprint, Fusion library, manufacturer STEP variants and provenance that every Adom user reproducing the ToF sensor library needs, so they must not live only in one project folder.",+ "hero":{"headline":title,"subhead":sub,"screenshot":"docs/hero.png","chrome":False},+ "source":{"tool":"cse","url":pg["component"]["product_page"]},+ "component":pg["component"],"tags":pg["tags"],"discovery_triggers":pg["discovery_triggers"],"discovery_pitch":pg["discovery_pitch"],"license":"CC-BY-4.0","visibility":{"public":True}}+print(json.dumps(body))+PY+ timeout 120 adom-wiki api -X POST /api/v1/pages --body "$(cat /tmp/create-body-$slug.json)" --json 2>&1 | python3 -c "import sys,json; d=json.load(sys.stdin); p=(d.get('data') or {}).get('page') or {}; print('create:', d.get('status'), p.get('id'), p.get('slug'), str(d.get('data'))[:200] if d.get('status')!='ok' else '')"+ fi+ echo "== pushing adom/$slug"+ # batches by size; page.json goes LAST so the hero/title stay linked+ mapfile -t files < <(find . -type f ! -name page.json -printf '%s %p\n' | sort -k2 | sed 's#^\([0-9]*\) \./#\1 #')+ batch=(); size=0; n=0+ flush(){ [ ${#batch[@]} -eq 0 ] && return; n=$((n+1)); timeout 600 adom-wiki repo push adom/$slug --files "${batch[@]}" -m "ToF component page: batch $n (${#batch[@]} files)" 2>&1 | grep -iE '"commit"|error|413|too large' | head -2; batch=(); size=0; }+ for line in "${files[@]}"; do s=${line%% *}; f=${line#* }; if [ $((size+s)) -gt $MAXB ] && [ ${#batch[@]} -gt 0 ]; then flush; fi; batch+=("$f"); size=$((size+s)); done; flush+ timeout 300 adom-wiki repo push adom/$slug --files page.json -m "ToF component page: page.json (component block, hero, files)" 2>&1 | grep -iE '"commit"|error' | head -2+ cd ..+done
pipeline/vendor_step.pyadded+260@@ -0,0 +1,260 @@+#!/usr/bin/env python3+"""Derive Z-up, colour-preserving STEP variants from a manufacturer (SamacSys/CSE) STEP.++ vendor_step.py <in.step> <out.step> [--keep-fov] [--etch MPN] [--etch-wall -y|+y|-x|+x]+ [--rot-z DEG] [--report out.json]++- Reads with XCAF so per-face colours survive.+- Rotates the source Y-up frame to Adom's Z-up (R_x(+90 deg)), then re-seats the body so the+ package underside sits on z = 0 and the XY bbox is centred on the origin (the footprint frame).+- Solids whose volume is < 1 % of the largest solid are the manufacturer's field-of-view cones+ (nonphysical helpers); they are dropped unless --keep-fov, in which case they are kept as a+ separately named product 'FOV' so a viewer can toggle them.+- --etch MPN adds the part number as a thin light-grey inlay body on the requested side wall+ (a colour change, not a groove, same idea as adom-chip-laser) so it survives STEP -> GLB.+Every transform is written to the --report JSON (source hash, units, up axis, rotation,+translation, dropped solids, etch placement) for the component page's provenance.+"""+import sys, json, math, hashlib, os+import cadquery as cq+from OCP.STEPCAFControl import STEPCAFControl_Reader, STEPCAFControl_Writer+from OCP.TDocStd import TDocStd_Document+from OCP.TCollection import TCollection_ExtendedString+from OCP.XCAFDoc import XCAFDoc_DocumentTool, XCAFDoc_ColorSurf, XCAFDoc_ColorGen+from OCP.XCAFApp import XCAFApp_Application+from OCP.TDF import TDF_LabelSequence, TDF_Label+from OCP.TopoDS import TopoDS_Shape, TopoDS+from OCP.TopExp import TopExp_Explorer+from OCP.TopAbs import TopAbs_FACE, TopAbs_SOLID, TopAbs_SHELL+from OCP.Quantity import Quantity_Color, Quantity_TOC_RGB+from OCP.gp import gp_Trsf, gp_Ax1, gp_Pnt, gp_Dir, gp_Vec+from OCP.BRepBuilderAPI import BRepBuilderAPI_Transform+from OCP.Bnd import Bnd_Box+from OCP.BRepBndLib import BRepBndLib+from OCP.GProp import GProp_GProps+from OCP.BRepGProp import BRepGProp+from OCP.IFSelect import IFSelect_RetDone+from OCP.STEPControl import STEPControl_AsIs+from OCP.TDataStd import TDataStd_Name+from OCP.TopTools import TopTools_ListOfShape+++def sha256(p):+ h = hashlib.sha256()+ with open(p, "rb") as f:+ for chunk in iter(lambda: f.read(1 << 20), b""):+ h.update(chunk)+ return h.hexdigest()+++def new_doc():+ app = XCAFApp_Application.GetApplication_s()+ doc = TDocStd_Document(TCollection_ExtendedString("MDTV-XCAF"))+ app.NewDocument(TCollection_ExtendedString("MDTV-XCAF"), doc)+ return doc+++def read_step(path):+ doc = new_doc()+ rdr = STEPCAFControl_Reader()+ rdr.SetColorMode(True); rdr.SetNameMode(True)+ if rdr.ReadFile(path) != IFSelect_RetDone:+ raise SystemExit(f"cannot read {path}")+ rdr.Transfer(doc)+ return doc+++def bbox(shape):+ b = Bnd_Box(); BRepBndLib.Add_s(shape, b, True)+ return b.Get() # xmin ymin zmin xmax ymax zmax+++def volume(shape):+ g = GProp_GProps(); BRepGProp.VolumeProperties_s(shape, g); return abs(g.Mass())+++def face_colours(ctool, shape):+ """(face -> (r,g,b)) for every face of shape that has a surface or generic colour."""+ out = []+ ex = TopExp_Explorer(shape, TopAbs_FACE)+ while ex.More():+ f = ex.Current(); col = Quantity_Color(); c = None+ if ctool.GetColor(f, XCAFDoc_ColorSurf, col) or ctool.GetColor(f, XCAFDoc_ColorGen, col):+ c = (col.Red(), col.Green(), col.Blue())+ out.append(c); ex.Next()+ return out+++def shape_colour(ctool, shape):+ col = Quantity_Color()+ if ctool.GetColor(shape, XCAFDoc_ColorSurf, col) or ctool.GetColor(shape, XCAFDoc_ColorGen, col):+ return (col.Red(), col.Green(), col.Blue())+ return None+++def main(argv):+ src, dst = argv[1], argv[2]+ keep_fov = "--keep-fov" in argv+ etch = argv[argv.index("--etch") + 1] if "--etch" in argv else None+ wall = argv[argv.index("--etch-wall") + 1] if "--etch-wall" in argv else "-y"+ rot_z = float(argv[argv.index("--rot-z") + 1]) if "--rot-z" in argv else 0.0+ report_path = argv[argv.index("--report") + 1] if "--report" in argv else None+ etch_size = float(argv[argv.index("--etch-size") + 1]) if "--etch-size" in argv else 0.0++ doc = read_step(src)+ stool = XCAFDoc_DocumentTool.ShapeTool_s(doc.Main())+ ctool = XCAFDoc_DocumentTool.ColorTool_s(doc.Main())+ labels = TDF_LabelSequence(); stool.GetFreeShapes(labels)+ # Walk assembly components: colours live on the PROTOTYPE (referred) labels, instances only+ # carry a location. Explore the prototype, read its face colours, then move the piece by the+ # instance location so the geometry matches what the file displays.+ pieces = [] # (located shape, kind, [face colours], shape colour)++ def explore_pieces(proto_shape, loc, ctool):+ found = False+ for kind in (TopAbs_SOLID, TopAbs_SHELL):+ ex = TopExp_Explorer(proto_shape, kind)+ while ex.More():+ s = ex.Current(); found = True+ fc = face_colours(ctool, s); sc = shape_colour(ctool, s)+ pieces.append((s.Moved(loc), kind, fc, sc))+ ex.Next()+ if found:+ break+ if not found:+ pieces.append((proto_shape.Moved(loc), None, face_colours(ctool, proto_shape), shape_colour(ctool, proto_shape)))++ def walk(lab, loc):+ if stool.IsAssembly_s(lab):+ comps = TDF_LabelSequence(); stool.GetComponents_s(lab, comps)+ for j in range(1, comps.Length() + 1):+ c = comps.Value(j)+ cloc = stool.GetLocation_s(c)+ ref = TDF_Label()+ if stool.GetReferredShape_s(c, ref):+ walk(ref, loc.Multiplied(cloc))+ else:+ explore_pieces(stool.GetShape_s(c), loc.Multiplied(cloc), ctool)+ else:+ ref = TDF_Label()+ if stool.IsReference_s(lab) and stool.GetReferredShape_s(lab, ref):+ walk(ref, loc.Multiplied(stool.GetLocation_s(lab)))+ else:+ explore_pieces(stool.GetShape_s(lab), loc, ctool)++ from OCP.TopLoc import TopLoc_Location+ for i in range(1, labels.Length() + 1):+ walk(labels.Value(i), TopLoc_Location())+ vols = [volume(p[0]) if p[1] == TopAbs_SOLID else 0.0 for p in pieces]+ vmax = max(vols) if vols else 0.0+ fov_idx = [i for i, v in enumerate(vols) if pieces[i][1] == TopAbs_SOLID and vmax > 0 and v < 0.01 * vmax]+ body_idx = [i for i in range(len(pieces)) if i not in fov_idx]++ # ---- transform: Y-up -> Z-up, optional yaw, then seat on z=0 centred in XY+ t1 = gp_Trsf(); t1.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(1, 0, 0)), math.radians(90))+ t2 = gp_Trsf(); t2.SetRotation(gp_Ax1(gp_Pnt(0, 0, 0), gp_Dir(0, 0, 1)), math.radians(rot_z))+ T = gp_Trsf(); T.Multiply(t2); T.Multiply(t1) # T = t2 * t1 (t1 first)+ moved = [BRepBuilderAPI_Transform(p[0], T, True).Shape() for p in pieces]+ # seat using the BODY pieces only (the FoV cones must not shift the seating plane)+ bb = Bnd_Box()+ for i in body_idx:+ BRepBndLib.Add_s(moved[i], bb, True)+ xmin, ymin, zmin, xmax, ymax, zmax = bb.Get()+ t3 = gp_Trsf(); t3.SetTranslation(gp_Vec(-(xmin + xmax) / 2, -(ymin + ymax) / 2, -zmin))+ moved = [BRepBuilderAPI_Transform(m, t3, True).Shape() for m in moved]+ body_bb = (round(xmax - xmin, 3), round(ymax - ymin, 3), round(zmax - zmin, 3))++ # ---- optional side-wall etch as a light-grey inlay body+ etch_info = None+ if etch:+ L, W, H = body_bb+ along_x = wall in ("-y", "+y")+ wall_len = L if along_x else W+ size = etch_size or min(H * 0.55, wall_len * 0.8 / (len(etch) * 0.62))+ depth = 0.03+ # text on a workplane whose normal points OUT of the wall, glyph baseline along the wall+ if wall == "-y":+ wp = cq.Workplane("XZ", origin=(0, -W / 2 + depth * 0.5, H / 2)) # XZ normal = -Y (outward)+ txt = wp.text(etch, size, depth, combine=False, halign="center", valign="center")+ elif wall == "+y":+ wp = cq.Workplane("XZ", origin=(0, W / 2 - depth * 0.5, H / 2)).transformed(rotate=(0, 180, 0))+ txt = wp.text(etch, size, depth, combine=False, halign="center", valign="center")+ elif wall == "+x":+ wp = cq.Workplane("YZ", origin=(L / 2 - depth * 0.5, 0, H / 2))+ txt = wp.text(etch, size, depth, combine=False, halign="center", valign="center")+ else: # -x+ wp = cq.Workplane("YZ", origin=(-L / 2 + depth * 0.5, 0, H / 2)).transformed(rotate=(0, 180, 0))+ txt = wp.text(etch, size, depth, combine=False, halign="center", valign="center")+ tshape = txt.val().wrapped+ tb = bbox(tshape)+ etch_info = {"text": etch, "wall": wall, "size_mm": round(size, 3), "inlay_depth_mm": depth,+ "bbox": [round(v, 3) for v in tb], "colour": [0.82, 0.82, 0.80],+ "note": "virtual identification aid, NOT a manufacturer marking"}++ # ---- write IN PLACE: keep the original document (prototypes + their colours untouched),+ # wrap the original free shapes under a new root assembly with the pose as a location,+ # remove the FoV cone instances, and add the etch as one more coloured component.+ from OCP.TopLoc import TopLoc_Location+ Tall = gp_Trsf(); Tall.Multiply(t3); Tall.Multiply(T) # Tall = t3 * T+ pose = TopLoc_Location(Tall)+ root = stool.NewShape()+ TDataStd_Name.Set_s(root, TCollection_ExtendedString("ADOM_ZUP"))+ for i in range(1, labels.Length() + 1):+ stool.AddComponent(root, labels.Value(i), pose)+ # drop the helper-cone instances (components whose solid is a FoV helper)+ removed = 0+ if not keep_fov and fov_idx:+ thresh = 0.01 * vmax+ def prune(lab):+ nonlocal removed+ if not stool.IsAssembly_s(lab):+ return+ comps = TDF_LabelSequence(); stool.GetComponents_s(lab, comps)+ victims = []+ for j in range(1, comps.Length() + 1):+ c = comps.Value(j); ref = TDF_Label()+ if stool.GetReferredShape_s(c, ref):+ if stool.IsAssembly_s(ref):+ prune(ref); continue+ sh = stool.GetShape_s(ref)+ ex = TopExp_Explorer(sh, TopAbs_SOLID); v = 0.0; n = 0+ while ex.More():+ v += volume(ex.Current()); n += 1; ex.Next()+ if n and v < thresh:+ victims.append((c, ref))+ for c, ref in victims:+ stool.RemoveComponent(c); stool.RemoveShape(ref, True); removed += 1+ for i in range(1, labels.Length() + 1):+ prune(labels.Value(i))+ else:+ # name the cone instances so a viewer can toggle them+ pass+ if etch:+ elab = stool.AddShape(tshape, False, False)+ TDataStd_Name.Set_s(elab, TCollection_ExtendedString("MPN_ETCH_VIRTUAL"))+ ctool.SetColor(elab, Quantity_Color(0.82, 0.82, 0.80, Quantity_TOC_RGB), XCAFDoc_ColorGen)+ ctool.SetColor(elab, Quantity_Color(0.82, 0.82, 0.80, Quantity_TOC_RGB), XCAFDoc_ColorSurf)+ stool.AddComponent(root, elab, TopLoc_Location())+ stool.UpdateAssemblies()+ w = STEPCAFControl_Writer(); w.SetColorMode(True); w.SetNameMode(True)+ w.Transfer(doc, STEPControl_AsIs)+ if w.Write(dst) != IFSelect_RetDone:+ raise SystemExit("write failed")+ kept = len(pieces) - removed++ rep = {"source": os.path.basename(src), "source_sha256": sha256(src), "output": os.path.basename(dst),+ "output_sha256": sha256(dst), "source_units": "mm", "source_up_axis": "Y",+ "transform": {"rotate_x_deg": 90, "rotate_z_deg": rot_z,+ "translate_mm": [round(-(xmin + xmax) / 2, 4), round(-(ymin + ymax) / 2, 4), round(-zmin, 4)],+ "result": "Adom Z-up, underside on z=0, XY centred (footprint frame)"},+ "body_bbox_mm": {"x": body_bb[0], "y": body_bb[1], "z": body_bb[2]},+ "pieces_total": len(pieces), "solids_kept": kept,+ "fov_helper_solids": [{"index": i, "volume_mm3": round(vols[i], 4)} for i in fov_idx],+ "fov_kept": keep_fov, "etch": etch_info}+ if report_path:+ json.dump(rep, open(report_path, "w"), indent=1)+ print(json.dumps({k: rep[k] for k in ("output", "body_bbox_mm", "solids_kept", "fov_helper_solids", "fov_kept", "etch")}))+++if __name__ == "__main__":+ main(sys.argv)