component
XL-1606UYC
Public Made by Adomby adom
XINGLIGHT LED Indication - Discrete, SMD,1.7x1.1mm. KiCad symbol, footprint and 3D as used on Adom boards.
main
#!/usr/bin/env python3
"""assemble_xl1606.py <MPN> <inlay.step> <out_dir>: write <slug>.step (the mounted XL-1606 model, named for the MPN) and
<slug>-etched.step (the same parts under Adom.Chip plus the Adom.LaserEtch mark). The mark is adom-chip-laser 0.2.0's
`inlay` (surface=top) computed on the model without its lens, so it lands on the white base region of the up-facing
side wall instead of the clear lens; adom-chip-laser `etch` with surface=side fails on this part (no side face of the body
fits the text) and surface=top puts the text on the lens. The mark geometry is used as the service returned it."""
import sys, importlib.util, os
import cadquery as cq
mpn, inlay, out = sys.argv[1], sys.argv[2], sys.argv[3]
spec = importlib.util.spec_from_file_location('b', os.path.join(os.path.dirname(os.path.abspath(__file__)), 'build_xl1606.py'))
b = importlib.util.module_from_spec(spec); spec.loader.exec_module(b)
slug = mpn.lower()
parts = b.build()
plain = cq.Assembly(name=mpn)
chip = cq.Assembly(name='Adom.Chip')
for name, (wp, col) in parts.items():
plain.add(b.mounted(wp), name=name, color=cq.Color(*col))
chip.add(b.mounted(wp), name=name, color=cq.Color(*col))
plain.export(f'{out}/{slug}.step')
mark = cq.importers.importStep(inlay).vals()[0]
et = cq.Assembly(name=mpn)
et.add(chip, name='Adom.Chip')
et.add(mark, name='Adom.LaserEtch', color=cq.Color(0.112074939959, 0.112074939959, 0.112074939959))
et.export(f'{out}/{slug}-etched.step')
print(f'{out}/{slug}.step', f'{out}/{slug}-etched.step')