import { type NodeDefinition, RoofSegmentNode as RoofSegmentNodeSchema } from '@pascal-app/core' import { buildRoofSegmentFloorplan } from './floorplan' import { roofSegmentParametrics } from './parametrics' import { RoofSegmentNode } from './schema' /** * Roof segment — Stage A. Child of a roof node, owns the per-segment * polygon + pitch. Geometry is generated by `RoofSystem` (registered * under the parent roof's `def.system`), so the segment kind itself * only needs a renderer wrap. */ export const roofSegmentDefinition: NodeDefinition = { kind: 'roof-segment', schemaVersion: 1, schema: RoofSegmentNode, category: 'structure', surfaceRole: 'roof', defaults: () => { const stub = RoofSegmentNodeSchema.parse({ id: 'roof-segment_default' as never, type: 'roof-segment', }) const { id: _id, type: _type, ...rest } = stub return rest }, capabilities: { selectable: { hitVolume: 'bbox' }, duplicable: false, deletable: true, }, parametrics: roofSegmentParametrics, renderer: { kind: 'parametric', module: () => import('./renderer'), }, floorplan: buildRoofSegmentFloorplan, presentation: { label: 'Roof Segment', description: 'A single pitched plane of a parent roof.', icon: { kind: 'url', src: '/icons/roof.png' }, paletteSection: 'structure', paletteOrder: 101, }, mcp: { description: 'A single roof segment with polygon footprint + pitch.', }, }