/** * Floorplan stage: translate CircuitIR physical constraints into a * `planComponentGroupPlacement`-compatible plan. * * CircuitIR devices are deliberately abstract (no physical footprint dimensions — * see `src/circuit/circuit-ir.ts`), so this module requires the caller to supply * each device's width/height alongside the CircuitIR itself; it does not guess * dimensions from a package name string. * * Devices are grouped into up to three placement passes, each a separate call to * `planComponentGroupPlacement` (which only accepts one `layer` per call): * - `connector` — devices with role "connector" (see `component-planning.ts`), * hugging one board edge (mechanical/cable-access requirement). * - `bottom` — devices whose CircuitIR physical constraint requests * `PlacementSide.Bottom`, placed on `bottomLayer`. * - `top` — everything else, placed on `topLayer`. * Top and bottom passes intentionally share the same board area (a real board has * both sides available at the same X/Y) — collision checks are per-pass only, so * top/bottom overlaps are not flagged; see `floorplanNotes` for this and other * simplifications made explicit rather than silently assumed. * * @module */ import type { CircuitIR } from '../circuit/circuit-ir.js'; import type { BoardBox, ComponentGroupPlacementPlan, LayoutExecutionMode, PointMm } from './types.js'; export type FloorplanEdge = 'top' | 'bottom' | 'left' | 'right'; export interface FloorplanDeviceInput { /** Must match a `Device.id` in the supplied CircuitIR. */ deviceId: string; ref: string; widthMm: number; heightMm: number; rotation?: number; primitiveId?: string; footprint?: string; } export interface FloorplanInput { circuitIR: CircuitIR; /** Physical dimensions for each device to place — CircuitIR itself carries none. */ devices: FloorplanDeviceInput[]; projectId?: string; mode?: LayoutExecutionMode; board: BoardBox; anchor: PointMm; columns?: number; spacingMm?: number; minSpacingMm?: number; topLayer?: number; bottomLayer?: number; connectorEdge?: FloorplanEdge; connectorEdgeMarginMm?: number; /** Extra minimum spacing applied to a pass containing a "hot" device. */ thermalSpacingBoostMm?: number; /** A device at or above this estimated dissipation is treated as "hot". */ thermalDissipationThresholdWatts?: number; } export interface FloorplanPlan extends ComponentGroupPlacementPlan { /** Notes on constraint interpretation and known simplifications for this plan. */ floorplanNotes: string[]; } /** Build a floorplan-aware component group placement plan from a CircuitIR. */ export declare function planFloorplan(input: FloorplanInput): FloorplanPlan;