printhive/test
dlawler489 7b018aefdb Match slots by colour, not just material
Counting slots fixed one half of the problem; this fixes the other. A slot is
now filled by a spool of the same material whose colour is close to what the
slot asks for, one spool per slot, best matches assigned first. So four PLA
slots in black, blue-grey, grey and white are not satisfied by four spools of
white — only the white slot is.

Closeness is redmean distance with a tolerance of 50, which treats genuinely
near shades as the same colour while keeping #000000 and #161616 (about 66
apart) distinct. Slot colours arrive as #RRGGBB and #RRGGBBAA — the alpha
channel is parsed off rather than making the colour unreadable.

The model page now lists every slot: its colour, which spool fills it, and the
nearest thing on the shelf when nothing does.

Two things this fixes in code I wrote an hour ago: renderDetailPrintable still
called a function the rewrite removed, so opening any model would have thrown;
and the README claimed colours weren't matched.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-17 12:47:18 +10:00
..
fixtures Show 3MF projects plate by plate in their filament colours 2026-09-15 07:49:58 +10:00
ai.test.js Sturdier AI replies: format example, more retries, and errors that show the reply 2026-09-15 20:26:42 +10:00
archives.test.js Browse archives, preview companion files, and view FBX/STEP/3DM/OBJ+MTL 2026-09-15 07:36:47 +10:00
autotag.test.js AI tags and descriptions, search by meaning, and automatic tags 2026-09-15 11:12:58 +10:00
duplicates.test.js Add duplicate finder, trash, notes, and library search/filters 2026-09-14 23:06:09 +10:00
filaments.test.js Match slots by colour, not just material 2026-09-17 12:47:18 +10:00
geometry.test.js Stream-parse 3MF files so Bambu projects don't exhaust memory 2026-09-15 07:02:00 +10:00
handoff.test.js Open models in your slicer and drag files out 2026-09-15 09:15:37 +10:00
makerworld.test.js Retry MakerWorld's anti-bot check, and flag imports that got no files 2026-09-16 12:34:04 +10:00
project.test.js Open models in your slicer and drag files out 2026-09-15 09:15:37 +10:00
thumbnail.test.js Make thumbnails on the server in the background 2026-09-15 07:54:26 +10:00