"""Printable / cuttable consumables: GS-24 copper rail band, BN-20 sticker sheet, troubleshooting card.
ASSUMPTIONS (see docs assumptions page): GS-24 can feed a 50 mm wide conductive copper roll; thin rails can be weeded."""
import os, math
OUT = os.environ.get('OUT', './out/')
CUT = '#FF0000'
MAG = '#FF00FF'
HDR = '\n'
# ---------- 1) GS-24 copper band: 50 mm roll, 3 kit sets (6 rails 54x5, 24+4 patches 6x6) per band
W, H = 50, 88
s = HDR + f'\n'
open(OUT + 'v1_copper_rails_gs24_cut.svg', 'w').write(s)
# ---------- 2) BN-20 sticker sheet (print + cut), one student sheet 130 x 100 mm
def star(cx, cy, r):
pts = []
for i in range(10):
a = math.radians(-90 + i * 36)
rr = r if i % 2 == 0 else r * 0.45
pts.append(f'{cx + rr*math.cos(a):.2f},{cy + rr*math.sin(a):.2f}')
return ' '.join(pts)
W, H = 130, 100
pr, cu = '', ''
def both(print_svg, cut_svg):
global pr, cu
pr += print_svg; cu += cut_svg
# windows (3) diameter 20
for cx, ring in ((16, '#185FA5'), (40, '#EF9F27'), (64, '#7F77DD')):
both(f'',
f'')
# planets (3)
for cx, r, col in ((94, 7, '#1D9E75'), (112, 5, '#EF9F27'), (124, 3.5, '#7F77DD')):
both(f'',
f'')
# stars (5)
for cx in (12, 28, 44, 60, 76):
both(f'', f'')
# wing patterns (3): 28 x 40
for i, x in enumerate((8, 42, 76)):
base = f''
if i == 0: base += ''.join(f'' for j in range(4))
if i == 1: base += ''.join(f'' for j in range(6))
if i == 2: base += ''.join(f'' for j in range(3))
both(base, f'')
# stripes (2)
for y, col in ((48, '#E24B4A'), (59, '#EF9F27')):
both(f'', f'')
# blank name label (optional)
both('',
f'')
# bug hunter badge
both('BUGHUNTER',
f'')
s = HDR + f'\n'
open(OUT + 'v1_sticker_sheet_print_cut.svg', 'w').write(s)
# ---------- 3) troubleshooting card A6 landscape 148 x 105
W, H = 148, 105
rows = [('Battery', 'Is the cell in, with the + side up? Is it fresh?'),
('Switch', 'Is the switch ON?'),
('LED direction', 'Long leg to the + rail, short leg to the - rail.'),
('Copper tape', 'Is the tape flat and touching at both ends?'),
('LED legs', 'Does each leg touch the tape under its patch?')]
s = HDR + f'\n'
open(OUT + 'v1_troubleshooting_card.svg', 'w').write(s)
print('ok')