by adom
0603 SMD Blue LED · 2.8 V drop @ 5 mA test · 25 mA max
master
#!/bin/bash
# Rebuild every Inolux LED output (colour, side MPN etch, GLBs, hero) from tools/colours.tsv (serial; run from led-pass/). WS2812B-2020 is held.
set -e
P=~/.local/share/adom-aiflow/occ/bin/python
ETCH=/home/adom/project/aiflow-work/merged/tools/laser-etch/etch_part.py
mkdir -p work/etch
SRC=/tmp/claude-1001/-home-adom-project/0a736c0e-0cd6-4308-915d-67b05c9b563f/scratchpad/leds # read-only clones (original composites)
while IFS=$'\t' read slug mpn fam wl lens; do
[ $slug = ws2812b-2020 ] && continue
case $mpn in *UW) c=white_phosphor;; *A) c=amber;; *B) c=blue;; *G) c=green;; *R) c=red;; esac
extra=""; [ $fam = template ] && extra="--template in-s42ata/IN-S42ATA-uncoloured.step"
$P tools/colour_led.py $slug/$mpn-uncoloured.step work/etch/$mpn.coloured.step --family $fam --lens $lens $extra --report $slug/provenance/$mpn-colour.report.json > /dev/null 2>&1
# MPN laser etch on the -Y side face (lens band), window kept clear (adom-aiflow etch_part.py --face side)
$P $ETCH --in work/etch/$mpn.coloured.step --mpn $mpn --out $slug/$mpn.step --face side 2>/dev/null | grep '^{' | tail -1 > $slug/provenance/$mpn-etch.report.json
step2glb convert $slug/$mpn.step -o work/$mpn.s2g.glb 2>&1 | grep '^OK' | cut -c1-80
step2glb convert $slug/$mpn-uncoloured.step -o work/$mpn-uncoloured.s2g.glb > /dev/null 2>&1
for kind in glb insertion.glb; do
if [ $mpn = IN-S63BT5B ] && [ $kind = glb ]; then cp work/$mpn.s2g.glb $slug/$mpn.glb; continue; fi
python3 tools/rebuild_composite.py $SRC/$slug/$mpn.$kind work/$mpn.s2g.glb $slug/$mpn.$kind --mpn $mpn --colour $c --lens $lens > work/reports/$mpn.$kind.json
done
case $mpn in IN-S42ATR) z=1.0; h=0.45; lh=0.2;; IN-S42*) z=0.9; h=0.45; lh=0.2;; *) z=0.5454545; h=0.6; lh=0.25;; esac
case $mpn in *UW) note="White LED: lens drawn as the pale yellow phosphor (emission CIE x/y $wl)";; *A) note="Amber lens colour (dominant wavelength $wl nm); the real lens is clear";; *B) note="Blue lens colour (dominant wavelength $wl nm); the real lens is clear";; *G) note="Green lens colour (dominant wavelength $wl nm); the real lens is clear";; *R) note="Red lens colour (dominant wavelength $wl nm); the real lens is clear";; esac
python3 tools/build_hero.py $slug $mpn work/$mpn.s2g.glb --lens $lens --zscale $z --height-mm $h --label-height $lh --colour-note "$note"
done < tools/colours.tsv