src/scene/build.ts// Authoring helpers — build the typed `Scene` from intuitive, EDGE/BOUNDS-based// inputs instead of center+size. The renderer consumes the same `Scene` types,// so these only change how scenes are *written*, never how they *draw*.//// Everything is in INCHES. Origin at the interior NW corner; +x east, +y south,// +z up. See sample.ts for the layout and a worked authoring guide.import type { Fixture, Opening, Room, Scene, Vec2, Wall } from './schema';/** Inclusive [edge, edge] extent on one axis. Order doesn't matter. */export type Span = [number, number];const lo = (s: Span) => Math.min(s[0], s[1]);const hi = (s: Span) => Math.max(s[0], s[1]);const mid = (s: Span) => (s[0] + s[1]) / 2;const len = (s: Span) => Math.abs(s[1] - s[0]);// ── Scene assembler ──────────────────────────────────────────────────────────/** Assemble a full Scene from its parts (fills units + wraps the single level). */export function scene(opts: {
Showing the first 20 lines.
Get full code