Fixture positions for the calculation
64-bitEach fixture's position in millimeters, its height and its aim, as the engine reads them.
p = (x ÷ k, y ÷ k, height)
One division per coordinate by the fixture's own scale; a scale that is missing or not above zero is taken as 1. Every fixture is aimed straight down.
export function luminairesOf(fixtures, photos, { mountMm = 6000 } = {}) {
const luminaires = [], skipped = [];
for (const f of fixtures.slice(0, LIMITS.fixtures)) {
const photo = photos[f.d?.type];
if (!photo) { skipped.push({ id: f.id, why: 'nofile' }); continue; }
const k = f.d.k > 0 ? f.d.k : 1;
const h = Number.isFinite(f.d.height) && f.d.height > 0 ? f.d.height : mountMm;
luminaires.push({ photo, p: [f.x / k, f.y / k, h], aim: [0, 0, -1], rot: Number.isFinite(f.d.aim) ? f.d.aim : 0, id: f.id });
}
return { luminaires, skipped };
}