@srnd-group/fabricwalls-core
v0.3.1
Published
Headless geometry kernel, constraint engine and auto-layout for the FabricWalls configurator.
Readme
@srnd-group/fabricwalls-core
Portable geometry kernel, config model, constraint engine and auto-layout. Headless and framework-free — pure TypeScript over the contract types. Must not import Engine, any UI framework, or an app. Engine data (catalogue/policy) is injected as arguments, never imported.
Modules (Phase 0)
geometry— pure polygon math (area, perimeter, bounding box, centroid, interior angles, min angle) over{ x, y }points.policy— the injectedPolicyshape + amockPolicywith flagged §12 placeholder values. Swap for resolved Engine policy at call time.validate—validateConfig(config, policy)→Diagnostic[]for the rules zod can't express (triangle ≥30°, 150mm framed floor, fixture depth vs cavity, Starlight ceiling-only, fabric width).layout—autoLayoutSurface(surface, policy, opts): deterministic, lock-aware single-surface auto-layout within the usable fabric width.
Scaffolded by Task 10 (
tasks/10-core.md). See../../CLAUDE.mdand../../docs/configurator-brief.md§5, §7, §8.
