@adatechnology/game-floorplan-structure 2.1.0 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,18 +1,8 @@
1
- import { FloorplanEngine, ViewerLayer, RoomDef, DoorDef, WindowDef, FloorDef, PlanAxis } from '@adatechnology/game-floorplan';
1
+ import { PlanAxis, ResultItem, FindsQuery, FindStack, Plan, FurnitureDef, FloorplanResult, FloorplanEngine, ViewerLayer, RoomDef, DoorDef, WindowDef, FloorDef } from '@adatechnology/game-floorplan';
2
2
  export { LotPath } from '@adatechnology/game-floorplan';
3
3
  import { MaterialId, JointKind, StructureRole, SoilProfile, PileSpec, DestructibleSpec, WindExposure } from '@adatechnology/game-contracts';
4
4
  import { SoilDef, FrameOptions, WindOptions, SizeStructureOptions } from '@adatechnology/game-destruction';
5
5
 
6
- interface StructurePackOptions {
7
- /** Litres of the tank by template id or style id. */
8
- tankCapacities?: Record<string, number>;
9
- }
10
- /**
11
- * Registers the structure into the engine: `result.construction`, `result.structureExtras`, `result.waterTank`, `result.structure` and `result.roof` of every plan,
12
- * and the structure layer of the 2D viewer. Register the content packs first.
13
- */
14
- declare function register(engine: FloorplanEngine, options?: StructurePackOptions): void;
15
-
16
6
  /** Axis-aligned rectangle `[u0, v0, u1, v1]` in the plan (metres). */
17
7
  type Rect = [number, number, number, number];
18
8
  type ConstructionSystem = 'masonry' | 'wood_frame' | 'log' | 'improvised' | 'canvas';
@@ -113,6 +103,8 @@ interface Structure {
113
103
  /** A reinforced concrete frame carries the building (apartments, commercial buildings, three storeys or more); the walls are infill. */
114
104
  framed: boolean;
115
105
  }
106
+ /** The structure as a `generate` result carries it: the roof goes out apart, in `result.roof`. */
107
+ type PlanStructure = Omit<Structure, 'roof'>;
116
108
  interface WallMaterials {
117
109
  material: MaterialId;
118
110
  interior?: MaterialId;
@@ -355,6 +347,353 @@ interface PlanContext {
355
347
  };
356
348
  }
357
349
 
350
+ /** What a wall system is made of and how its parts are tied. Timber systems sit on joists, carry the roof on timber plates and have wooden porch posts. */
351
+ interface ConstructionSystemDef {
352
+ /** Wall assembly of `game-destruction` (`registerAssembly`) the detailed wall is built from. Empty: no walls (a tent). */
353
+ walls: string;
354
+ joints: Record<'wall' | 'slab' | 'beam' | 'column' | 'truss', JointKind>;
355
+ /** Thickness of the structural floor under each storey (m). */
356
+ slabThickness: number;
357
+ /** Height of the top plate or bond beam (m). */
358
+ plateThickness: number;
359
+ timber: boolean;
360
+ /** `rules`: bearing when external, under another wall or beside a porch; `bearing`: every wall (logs); `partition`: none (posts carry the roof). */
361
+ wallRole: 'rules' | 'bearing' | 'partition';
362
+ /** Solid fraction of a bearing wall in the structure weight (studs and air). */
363
+ wallFill: number;
364
+ studs?: {
365
+ spacing: number;
366
+ section: string;
367
+ };
368
+ }
369
+ declare const CONSTRUCTION_SYSTEMS: Map<string, ConstructionSystemDef>;
370
+ /** Adds or replaces a construction system (`id` is a `ConstructionSystem` or any name a construction refers to). */
371
+ declare function registerConstructionSystem(id: ConstructionSystem | string, def: ConstructionSystemDef): void;
372
+ interface RoofCoveringDef {
373
+ material: string;
374
+ /** How the covering is fixed to the trusses. */
375
+ joint: JointKind;
376
+ }
377
+ declare const ROOF_COVERINGS: Map<string, RoofCoveringDef>;
378
+ declare function registerRoofCovering(id: string, def: RoofCoveringDef): void;
379
+ interface ConstructionBuild {
380
+ construction: Construction;
381
+ extras?: StructureExtras;
382
+ }
383
+ type ConstructionBuilder = (context: PlanContext) => ConstructionBuild;
384
+ declare const CONSTRUCTIONS: Map<string, ConstructionBuilder>;
385
+ /** Registers how a template's building is made: `TemplateDef.construction` names it. A template without one gets the masonry default. */
386
+ declare function registerConstruction(id: string, builder: ConstructionBuilder): void;
387
+
388
+ type Rng$1 = () => number;
389
+
390
+ /** A point in the world: `[u, v, y]` (y is the absolute height). */
391
+ type Point3 = [number, number, number];
392
+ /** Something fixed to the inner face of a wall of a room: a socket, a switch, the panel. */
393
+ interface WallFixture {
394
+ id: string;
395
+ room: string;
396
+ floor: number;
397
+ u: number;
398
+ v: number;
399
+ /** Height above the storey floor. */
400
+ y: number;
401
+ /** Position along the wall. */
402
+ c: number;
403
+ axis: PlanAxis;
404
+ pos: number;
405
+ frontU: number;
406
+ frontV: number;
407
+ }
408
+ interface Outlet extends WallFixture {
409
+ type: string;
410
+ voltage: number;
411
+ }
412
+ interface LightSwitch extends WallFixture {
413
+ door: string;
414
+ /** On the latch side of the door. */
415
+ latchSide: boolean;
416
+ /** Lamp ids it turns on. */
417
+ controls: string[];
418
+ }
419
+ interface ElectricalPanel extends WallFixture {
420
+ w: number;
421
+ h: number;
422
+ breakers: number;
423
+ }
424
+ interface ElectricMeter {
425
+ id: string;
426
+ place: string;
427
+ u: number;
428
+ v: number;
429
+ y: number;
430
+ side: string;
431
+ w: number;
432
+ d: number;
433
+ h: number;
434
+ }
435
+ /** Pole, drop, meter, descent and the run to the panel; a tap has no meter and a bare connection instead. */
436
+ interface ServiceEntrance {
437
+ pole: {
438
+ u: number;
439
+ v: number;
440
+ h: number;
441
+ };
442
+ drop: Point3[];
443
+ meter: ElectricMeter | null;
444
+ descent: Point3[];
445
+ internalRun: Point3[] | null;
446
+ tap?: boolean;
447
+ connection?: {
448
+ u: number;
449
+ v: number;
450
+ y: number;
451
+ };
452
+ }
453
+ interface Circuit {
454
+ id: string;
455
+ room: string;
456
+ floor: number;
457
+ outlets: string[];
458
+ switches: string[];
459
+ lamps: string[];
460
+ exposed: boolean;
461
+ gauge_mm2: number;
462
+ }
463
+ interface Conduit {
464
+ id: string;
465
+ circuit: string;
466
+ from: string;
467
+ to: string;
468
+ exposed: boolean;
469
+ diameter: number;
470
+ points: Point3[];
471
+ }
472
+ interface OutdoorLamp {
473
+ id: string;
474
+ u: number;
475
+ v: number;
476
+ y: number;
477
+ door: string;
478
+ switch: string | null;
479
+ }
480
+ interface PlumbingPoint {
481
+ id: string;
482
+ kind: string;
483
+ item: string;
484
+ room: string | null;
485
+ floor: number;
486
+ u: number;
487
+ v: number;
488
+ y: number;
489
+ flowLpm: number | undefined;
490
+ run: string | null;
491
+ }
492
+ interface PlumbingRun {
493
+ id: string;
494
+ from: string;
495
+ /** A point, a room, or `ceiling`. */
496
+ to: string | null;
497
+ points: Point3[];
498
+ diameter: number;
499
+ exposed: string;
500
+ }
501
+ interface Plumbing {
502
+ tank: 'water_tank' | null;
503
+ capacityL: number;
504
+ points: PlumbingPoint[];
505
+ visibleRuns: PlumbingRun[];
506
+ }
507
+ interface SolarPanel {
508
+ id: string;
509
+ u: number;
510
+ v: number;
511
+ w: number;
512
+ d: number;
513
+ length: number;
514
+ }
515
+ interface Inverter {
516
+ id: string;
517
+ u: number;
518
+ v: number;
519
+ y: number;
520
+ side: string;
521
+ w: number;
522
+ d: number;
523
+ h: number;
524
+ outdoor: boolean;
525
+ link: string;
526
+ }
527
+ interface Solar {
528
+ type: 'slab_rack' | 'roof';
529
+ orientation: string;
530
+ north: 'front' | 'back';
531
+ slopeSide: 'front' | 'back' | null;
532
+ tilt: number;
533
+ area: number[];
534
+ areaM2: number;
535
+ count: number;
536
+ floor: number;
537
+ y: number;
538
+ panels: SolarPanel[];
539
+ inverter: Inverter | null;
540
+ }
541
+ /** A door or a window in the wall of an outbuilding. */
542
+ interface OutbuildingOpening {
543
+ id: string;
544
+ axis: PlanAxis;
545
+ pos: number;
546
+ at: number;
547
+ u: number;
548
+ v: number;
549
+ width: number;
550
+ side: string;
551
+ height?: number;
552
+ exterior?: boolean;
553
+ y0?: number;
554
+ y1?: number;
555
+ /** Swing area of a door. */
556
+ zone?: Rect;
557
+ }
558
+ interface OutbuildingWall {
559
+ axis: PlanAxis;
560
+ u0: number;
561
+ v0: number;
562
+ u1: number;
563
+ v1: number;
564
+ thickness: number;
565
+ h: number;
566
+ side: string;
567
+ }
568
+ interface OutbuildingItem {
569
+ type: string;
570
+ category: string;
571
+ u: number;
572
+ v: number;
573
+ w: number;
574
+ d: number;
575
+ h: number;
576
+ ry: number;
577
+ frontU: number;
578
+ frontV: number;
579
+ aabb: Rect;
580
+ }
581
+ interface Outbuilding {
582
+ id: string;
583
+ type: 'outbuilding';
584
+ use: string;
585
+ floor: number;
586
+ aabb: Rect;
587
+ interior: Rect[];
588
+ ceiling: number;
589
+ thickness: number;
590
+ front: [number, number];
591
+ walls: OutbuildingWall[];
592
+ doors: OutbuildingOpening[];
593
+ windows: OutbuildingOpening[];
594
+ items: OutbuildingItem[];
595
+ }
596
+
597
+ type EnergyMode = 'grid' | 'tap' | 'offgrid';
598
+ /** What a template says about its energy (a shack taps the grid without a meter, a cabin may run off-grid on solar). */
599
+ interface EnergyConfig {
600
+ mode: EnergyMode;
601
+ solar?: boolean;
602
+ }
603
+ interface Electrical {
604
+ mode: EnergyMode;
605
+ serviceEntrance: ServiceEntrance | null;
606
+ panel: ElectricalPanel | null;
607
+ outlets: Outlet[];
608
+ switches: LightSwitch[];
609
+ circuits: Circuit[];
610
+ conduits: Conduit[];
611
+ exposed: boolean;
612
+ outdoorLamps: OutdoorLamp[];
613
+ source?: 'solar' | 'lamp';
614
+ }
615
+
616
+ interface GasMeter {
617
+ id: 'gas.meter';
618
+ u: number;
619
+ v: number;
620
+ y: number;
621
+ side: string;
622
+ w: number;
623
+ d: number;
624
+ h: number;
625
+ }
626
+ interface Gas {
627
+ type: 'piped' | 'cylinder';
628
+ meter: GasMeter | null;
629
+ }
630
+
631
+ interface Utilities {
632
+ gas: Gas | null;
633
+ electrical: Electrical;
634
+ solar: Solar | null;
635
+ plumbing: Plumbing;
636
+ }
637
+ interface UtilitiesContext {
638
+ plan: Plan;
639
+ items: ResultItem[];
640
+ stateItems: ResultItem[];
641
+ tank: WaterTank | null;
642
+ energy?: EnergyConfig;
643
+ /** Seeded stream by name: `gas`, `electrical`, `solar`. */
644
+ rngFor(key: string): Rng$1;
645
+ }
646
+ /** Gas, electricity, solar panels and plumbing of a house, in the order that lets the later ones see the cylinders the first adds to `items`. */
647
+ declare function planUtilities(context: UtilitiesContext): Utilities;
648
+ interface ContentsContext {
649
+ items: ResultItem[];
650
+ state: string;
651
+ place: string;
652
+ /** Outbreak days and region of the world, passed to the finds provider. */
653
+ day?: number;
654
+ region?: string;
655
+ rngFor(key: string): Rng$1;
656
+ findsFor(query: FindsQuery): readonly FindStack[];
657
+ }
658
+ /** What every container holds, asked of the registered finds provider: by item id, and `<id>#overhead` for the wall cabinet over a sink. */
659
+ declare function planContents(context: ContentsContext): Record<string, readonly FindStack[]>;
660
+
661
+ interface OutbuildingContext {
662
+ plan: Plan;
663
+ items: ResultItem[];
664
+ catalog: Record<string, FurnitureDef>;
665
+ rngFor(key: string): Rng$1;
666
+ }
667
+ /**
668
+ * The outbuilding at the back of the yard is a small building of its own: walls with a gap for the door, a door of 0.85 m facing the yard, two windows and the
669
+ * furniture of a drawn use (guest room, office, storage, gourmet space).
670
+ */
671
+ declare function planOutbuildings(context: OutbuildingContext): Outbuilding[];
672
+
673
+ /**
674
+ * A `generate` result once the structure pack is registered: the plan of `game-floorplan` with what the pack's extensions add (the construction and its extras,
675
+ * the water tank, the structure and its roof, the contents of the furniture, the outbuildings and the utilities).
676
+ */
677
+ type StructuredResult = FloorplanResult & {
678
+ construction: ConstructionBuild['construction'];
679
+ structureExtras: NonNullable<ConstructionBuild['extras']>;
680
+ waterTank: WaterTank | null;
681
+ structure: PlanStructure;
682
+ roof: Roof | null;
683
+ contents: ReturnType<typeof planContents>;
684
+ outbuildings: ReturnType<typeof planOutbuildings>;
685
+ utilities: ReturnType<typeof planUtilities>;
686
+ };
687
+ interface StructurePackOptions {
688
+ /** Litres of the tank by template id or style id. */
689
+ tankCapacities?: Record<string, number>;
690
+ }
691
+ /**
692
+ * Registers the structure into the engine: `result.construction`, `result.structureExtras`, `result.waterTank`, `result.structure` and `result.roof` of every plan,
693
+ * and the structure layer of the 2D viewer. Register the content packs first.
694
+ */
695
+ declare function register(engine: FloorplanEngine, options?: StructurePackOptions): void;
696
+
358
697
  /**
359
698
  * The structure of a generated plan: every part that carries load (foundation, floors, walls, plates and bond beams, pillars, porch posts, trusses,
360
699
  * roof, stairs, tank) with what each rests on. The plan itself is not modified.
@@ -429,18 +768,18 @@ declare const beamDepthFor: (span: number, options: SlabPanelOptions, minimum?:
429
768
  * The slabs of concrete cut into panels with beams (`SlabPanelOptions`): see `T10-estrutura-real.md` §12. `input` is the structure as
430
769
  * `toDestructibleSpec` has it (walls with their roles), and the result has the panels, the beams, the pillars they need and the supports re-pointed.
431
770
  */
432
- declare function applySlabPanels(input: PartsAndSupports, structure: Structure, options: SlabPanelOptions): PartsAndSupports;
771
+ declare function applySlabPanels(input: PartsAndSupports, structure: PlanStructure, options: SlabPanelOptions): PartsAndSupports;
433
772
  /**
434
773
  * The panels `toDestructibleSpec` makes of the slabs of a structure (named as it names them), for a renderer that draws the floor of each room apart:
435
774
  * `panels` (each with `slab`, the id of the slab it was cut from), `replaced` (those slabs, which the spec no longer has) and the `supports` that touch the panels.
436
775
  */
437
- declare function slabPanelView(structure: Structure, options: SlabPanelOptions): {
776
+ declare function slabPanelView(structure: PlanStructure, options: SlabPanelOptions): {
438
777
  panels: StructurePart[];
439
778
  replaced: string[];
440
779
  supports: Support[];
441
780
  };
442
781
  /** The panels of `slabPanelView`, alone. */
443
- declare const slabPanelsOf: (structure: Structure, options: SlabPanelOptions) => StructurePart[];
782
+ declare const slabPanelsOf: (structure: PlanStructure, options: SlabPanelOptions) => StructurePart[];
444
783
 
445
784
  interface DestructibleSpecOptions {
446
785
  /** Fraction of its capacity a pillar or bearing wall uses at rest (default 0.65). */
@@ -513,53 +852,15 @@ declare const MEMBER_CAGE: {
513
852
  */
514
853
  declare function cageResidualCapacity(size: readonly number[], reinforcement: {
515
854
  material: string;
516
- spacing: number;
517
- diameter: number;
518
- }, capacity: number | undefined): number;
519
- /**
520
- * The structure as a `DestructibleSpec` in the space of the house (x = u, y = height, z = v; the ground is y = 0), one box per part and a terrain slab
521
- * that anchors it. Capacities are sized from the loads at rest, as a designer would: a house stands whole, holds the loss of one pillar or bearing wall
522
- * and falls with two.
523
- */
524
- declare function toDestructibleSpec(structure: Structure, options?: DestructibleSpecOptions): DestructibleSpec;
525
-
526
- /** What a wall system is made of and how its parts are tied. Timber systems sit on joists, carry the roof on timber plates and have wooden porch posts. */
527
- interface ConstructionSystemDef {
528
- /** Wall assembly of `game-destruction` (`registerAssembly`) the detailed wall is built from. Empty: no walls (a tent). */
529
- walls: string;
530
- joints: Record<'wall' | 'slab' | 'beam' | 'column' | 'truss', JointKind>;
531
- /** Thickness of the structural floor under each storey (m). */
532
- slabThickness: number;
533
- /** Height of the top plate or bond beam (m). */
534
- plateThickness: number;
535
- timber: boolean;
536
- /** `rules`: bearing when external, under another wall or beside a porch; `bearing`: every wall (logs); `partition`: none (posts carry the roof). */
537
- wallRole: 'rules' | 'bearing' | 'partition';
538
- /** Solid fraction of a bearing wall in the structure weight (studs and air). */
539
- wallFill: number;
540
- studs?: {
541
- spacing: number;
542
- section: string;
543
- };
544
- }
545
- declare const CONSTRUCTION_SYSTEMS: Map<string, ConstructionSystemDef>;
546
- /** Adds or replaces a construction system (`id` is a `ConstructionSystem` or any name a construction refers to). */
547
- declare function registerConstructionSystem(id: ConstructionSystem | string, def: ConstructionSystemDef): void;
548
- interface RoofCoveringDef {
549
- material: string;
550
- /** How the covering is fixed to the trusses. */
551
- joint: JointKind;
552
- }
553
- declare const ROOF_COVERINGS: Map<string, RoofCoveringDef>;
554
- declare function registerRoofCovering(id: string, def: RoofCoveringDef): void;
555
- interface ConstructionBuild {
556
- construction: Construction;
557
- extras?: StructureExtras;
558
- }
559
- type ConstructionBuilder = (context: PlanContext) => ConstructionBuild;
560
- declare const CONSTRUCTIONS: Map<string, ConstructionBuilder>;
561
- /** Registers how a template's building is made: `TemplateDef.construction` names it. A template without one gets the masonry default. */
562
- declare function registerConstruction(id: string, builder: ConstructionBuilder): void;
855
+ spacing: number;
856
+ diameter: number;
857
+ }, capacity: number | undefined): number;
858
+ /**
859
+ * The structure as a `DestructibleSpec` in the space of the house (x = u, y = height, z = v; the ground is y = 0), one box per part and a terrain slab
860
+ * that anchors it. Capacities are sized from the loads at rest, as a designer would: a house stands whole, holds the loss of one pillar or bearing wall
861
+ * and falls with two.
862
+ */
863
+ declare function toDestructibleSpec(structure: PlanStructure, options?: DestructibleSpecOptions): DestructibleSpec;
563
864
 
564
865
  /**
565
866
  * Most a masonry wall runs between two of its concrete pillars, metres. Confined masonry (alvenaria confinada / de vedação with a concrete frame) puts a pillar
@@ -662,7 +963,7 @@ interface ValidateStructureOptions {
662
963
  * 6118 sections, steel, beam depth) and, in masonry, confined masonry (ground beam, pillars at ends, corners, junctions and every 4 m up to the bond beam,
663
964
  * lintels and sill beams, bonded and plastered bricks). An empty list is a structure that a structural engineer would sign.
664
965
  */
665
- declare function validateStructure(structure: Structure, options?: ValidateStructureOptions): StructuralViolation[];
966
+ declare function validateStructure(structure: PlanStructure, options?: ValidateStructureOptions): StructuralViolation[];
666
967
  /** What a destructible spec built straight as one (towers, skyscrapers) gets wrong: load paths and concrete sections. */
667
968
  declare function validateSpec(spec: DestructibleSpec): StructuralViolation[];
668
969
  /** The violations counted by code (for reports and tests). */
@@ -1278,254 +1579,6 @@ declare const towerLocales: {
1278
1579
  };
1279
1580
  };
1280
1581
 
1281
- /** A point in the world: `[u, v, y]` (y is the absolute height). */
1282
- type Point3 = [number, number, number];
1283
- /** Something fixed to the inner face of a wall of a room: a socket, a switch, the panel. */
1284
- interface WallFixture {
1285
- id: string;
1286
- room: string;
1287
- floor: number;
1288
- u: number;
1289
- v: number;
1290
- /** Height above the storey floor. */
1291
- y: number;
1292
- /** Position along the wall. */
1293
- c: number;
1294
- axis: PlanAxis;
1295
- pos: number;
1296
- frontU: number;
1297
- frontV: number;
1298
- }
1299
- interface Outlet extends WallFixture {
1300
- type: string;
1301
- voltage: number;
1302
- }
1303
- interface LightSwitch extends WallFixture {
1304
- door: string;
1305
- /** On the latch side of the door. */
1306
- latchSide: boolean;
1307
- /** Lamp ids it turns on. */
1308
- controls: string[];
1309
- }
1310
- interface ElectricalPanel extends WallFixture {
1311
- w: number;
1312
- h: number;
1313
- breakers: number;
1314
- }
1315
- interface ElectricMeter {
1316
- id: string;
1317
- place: string;
1318
- u: number;
1319
- v: number;
1320
- y: number;
1321
- side: string;
1322
- w: number;
1323
- d: number;
1324
- h: number;
1325
- }
1326
- /** Pole, drop, meter, descent and the run to the panel; a tap has no meter and a bare connection instead. */
1327
- interface ServiceEntrance {
1328
- pole: {
1329
- u: number;
1330
- v: number;
1331
- h: number;
1332
- };
1333
- drop: Point3[];
1334
- meter: ElectricMeter | null;
1335
- descent: Point3[];
1336
- internalRun: Point3[] | null;
1337
- tap?: boolean;
1338
- connection?: {
1339
- u: number;
1340
- v: number;
1341
- y: number;
1342
- };
1343
- }
1344
- interface Circuit {
1345
- id: string;
1346
- room: string;
1347
- floor: number;
1348
- outlets: string[];
1349
- switches: string[];
1350
- lamps: string[];
1351
- exposed: boolean;
1352
- gauge_mm2: number;
1353
- }
1354
- interface Conduit {
1355
- id: string;
1356
- circuit: string;
1357
- from: string;
1358
- to: string;
1359
- exposed: boolean;
1360
- diameter: number;
1361
- points: Point3[];
1362
- }
1363
- interface OutdoorLamp {
1364
- id: string;
1365
- u: number;
1366
- v: number;
1367
- y: number;
1368
- door: string;
1369
- switch: string | null;
1370
- }
1371
- interface PlumbingPoint {
1372
- id: string;
1373
- kind: string;
1374
- item: string;
1375
- room: string | null;
1376
- floor: number;
1377
- u: number;
1378
- v: number;
1379
- y: number;
1380
- flowLpm: number | undefined;
1381
- run: string | null;
1382
- }
1383
- interface PlumbingRun {
1384
- id: string;
1385
- from: string;
1386
- /** A point, a room, or `ceiling`. */
1387
- to: string | null;
1388
- points: Point3[];
1389
- diameter: number;
1390
- exposed: string;
1391
- }
1392
- interface Plumbing {
1393
- tank: 'water_tank' | null;
1394
- capacityL: number;
1395
- points: PlumbingPoint[];
1396
- visibleRuns: PlumbingRun[];
1397
- }
1398
- interface SolarPanel {
1399
- id: string;
1400
- u: number;
1401
- v: number;
1402
- w: number;
1403
- d: number;
1404
- length: number;
1405
- }
1406
- interface Inverter {
1407
- id: string;
1408
- u: number;
1409
- v: number;
1410
- y: number;
1411
- side: string;
1412
- w: number;
1413
- d: number;
1414
- h: number;
1415
- outdoor: boolean;
1416
- link: string;
1417
- }
1418
- interface Solar {
1419
- type: 'slab_rack' | 'roof';
1420
- orientation: string;
1421
- north: 'front' | 'back';
1422
- slopeSide: 'front' | 'back' | null;
1423
- tilt: number;
1424
- area: number[];
1425
- areaM2: number;
1426
- count: number;
1427
- floor: number;
1428
- y: number;
1429
- panels: SolarPanel[];
1430
- inverter: Inverter | null;
1431
- }
1432
- /** A door or a window in the wall of an outbuilding. */
1433
- interface OutbuildingOpening {
1434
- id: string;
1435
- axis: PlanAxis;
1436
- pos: number;
1437
- at: number;
1438
- u: number;
1439
- v: number;
1440
- width: number;
1441
- side: string;
1442
- height?: number;
1443
- exterior?: boolean;
1444
- y0?: number;
1445
- y1?: number;
1446
- /** Swing area of a door. */
1447
- zone?: Rect;
1448
- }
1449
- interface OutbuildingWall {
1450
- axis: PlanAxis;
1451
- u0: number;
1452
- v0: number;
1453
- u1: number;
1454
- v1: number;
1455
- thickness: number;
1456
- h: number;
1457
- side: string;
1458
- }
1459
- interface OutbuildingItem {
1460
- type: string;
1461
- category: string;
1462
- u: number;
1463
- v: number;
1464
- w: number;
1465
- d: number;
1466
- h: number;
1467
- ry: number;
1468
- frontU: number;
1469
- frontV: number;
1470
- aabb: Rect;
1471
- }
1472
- interface Outbuilding {
1473
- id: string;
1474
- type: 'outbuilding';
1475
- use: string;
1476
- floor: number;
1477
- aabb: Rect;
1478
- interior: Rect[];
1479
- ceiling: number;
1480
- thickness: number;
1481
- front: [number, number];
1482
- walls: OutbuildingWall[];
1483
- doors: OutbuildingOpening[];
1484
- windows: OutbuildingOpening[];
1485
- items: OutbuildingItem[];
1486
- }
1487
-
1488
- type EnergyMode = 'grid' | 'tap' | 'offgrid';
1489
- /** What a template says about its energy (a shack taps the grid without a meter, a cabin may run off-grid on solar). */
1490
- interface EnergyConfig {
1491
- mode: EnergyMode;
1492
- solar?: boolean;
1493
- }
1494
- interface Electrical {
1495
- mode: EnergyMode;
1496
- serviceEntrance: ServiceEntrance | null;
1497
- panel: ElectricalPanel | null;
1498
- outlets: Outlet[];
1499
- switches: LightSwitch[];
1500
- circuits: Circuit[];
1501
- conduits: Conduit[];
1502
- exposed: boolean;
1503
- outdoorLamps: OutdoorLamp[];
1504
- source?: 'solar' | 'lamp';
1505
- }
1506
-
1507
- interface GasMeter {
1508
- id: 'gas.meter';
1509
- u: number;
1510
- v: number;
1511
- y: number;
1512
- side: string;
1513
- w: number;
1514
- d: number;
1515
- h: number;
1516
- }
1517
- interface Gas {
1518
- type: 'piped' | 'cylinder';
1519
- meter: GasMeter | null;
1520
- }
1521
-
1522
- interface Utilities {
1523
- gas: Gas | null;
1524
- electrical: Electrical;
1525
- solar: Solar | null;
1526
- plumbing: Plumbing;
1527
- }
1528
-
1529
1582
  declare const version = "0.1.0";
1530
1583
 
1531
- export { BEAM_DEPTH_RATIO, CONSTRUCTIONS, CONSTRUCTION_SYSTEMS, CORE_DEFAULTS, CURTAIN_DEFAULTS, type ChaletOptions, type Chimney, type Circuit, type Conduit, type Construction, type ConstructionBuild, type ConstructionBuilder, type ConstructionSystem, type ConstructionSystemDef, type CoreOptions, type CurtainWallOptions, DAMPER_DEFAULTS, DENSITY, type DamperOptions, type DestructibleSpecOptions, type ElectricMeter, type Electrical, type ElectricalPanel, type EnergyConfig, type EnergyMode, FLAT_ROOF_DEFAULTS, type FlatRoofOptions, type FoundationType, GROUND, GROUND_BEAM_DEPTH, type Gas, type GasMeter, type Inverter, type LightSwitch, MAX_LINTEL_ON_MASONRY, MAX_PILLAR_SPACING, MECHANICAL_DEFAULTS, MEMBER_CAGE, MIN_BEAM_WIDTH, MIN_PILLAR_AREA, MIN_PILLAR_SIDE, type MechanicalFloorOptions, type Opening, type Outbuilding, type OutbuildingItem, type OutbuildingOpening, type OutbuildingWall, type OutdoorLamp, type Outlet, PILE_AREA, PILE_DEFAULTS, PLATE_DEFAULTS, PUNCHED_DEFAULTS, type PartRole, type PileDesign, type PlanContext, type PlateOptions, type PlateRect, type PlateStrip, type Plumbing, type PlumbingPoint, type PlumbingRun, type Point3, type PunchedFacadeOptions, RAFT_THICKNESS, REBAR_RATIOS, ROOF_COVERINGS, type Rect, type Roof, type RoofCoveringDef, type RoofPane, type RoofShape, SILL_BEAM_DEPTH, SKYSCRAPER_DEFAULTS, SKYSCRAPER_MAX_STOREYS, SLAB_PANEL_DEFAULTS, STRUCTURAL_VIOLATION, type ServiceEntrance, type ShackOptions, type SkyscraperLayout, type SkyscraperOptions, type SkyscraperPreset, type SlabPanelOptions, type Solar, type SolarPanel, type SourceDoor, type SourceWall, type SourceWindow, type StoreyContext, type StoreyKind, type StripFill, type StripFiller, type StripId, type StructuralViolation, type StructuralViolationCode, type Structure, type StructureExtras, type StructureOptions, type StructurePackOptions, type StructurePart, type StructureSource, type Support, TANK_PILLAR_SIDE, TOWER_DEFAULTS, type TankPlanOptions, type TankPlatform, type Tent, type TowerGeometry, type TowerMechanicalOptions, type TowerOptions, type TowerPlanOptions, type TowerPlate, type Utilities, type ValidateStructureOptions, WALL_PILLAR_SIDE, WALL_PILLAR_SPACING, type WallDetail, type WallFixture, type WallMaterials, type WallSpecimenOptions, type WaterTank, type WoodFrameOptions, addCore, addCurtainWall, addFlatRoof, addMechanicalFloor, addPunchedFacade, addTunedMassDamper, applySlabPanels, beamDepthFor, beamSpan, buildSkyscraper, buildStructure, buildTower, buildWallSpecimen, cageResidualCapacity, campConstruction, chaletConstruction, constructionOfSystem, coreSize, countViolations, damperMass, exteriorWindows, logCabinConstruction, masonryConstruction, mechanicalStoreys, pilesFor, pillarStations, planToSpace, planWaterTank, register, registerConstruction, registerConstructionSystem, registerRoofCovering, resolveSlabPanels, shackConstruction, skyscraperLayout, slabPanelView, slabPanelsOf, splitStrip, storeyKinds, stripDoor, structureLayer, toDestructibleSpec, towerFloors, towerLocales, towerPlate, towerWater, validateSpec, validateStructure, version, windExposureOf, woodFrameConstruction };
1584
+ export { BEAM_DEPTH_RATIO, CONSTRUCTIONS, CONSTRUCTION_SYSTEMS, CORE_DEFAULTS, CURTAIN_DEFAULTS, type ChaletOptions, type Chimney, type Circuit, type Conduit, type Construction, type ConstructionBuild, type ConstructionBuilder, type ConstructionSystem, type ConstructionSystemDef, type CoreOptions, type CurtainWallOptions, DAMPER_DEFAULTS, DENSITY, type DamperOptions, type DestructibleSpecOptions, type ElectricMeter, type Electrical, type ElectricalPanel, type EnergyConfig, type EnergyMode, FLAT_ROOF_DEFAULTS, type FlatRoofOptions, type FoundationType, GROUND, GROUND_BEAM_DEPTH, type Gas, type GasMeter, type Inverter, type LightSwitch, MAX_LINTEL_ON_MASONRY, MAX_PILLAR_SPACING, MECHANICAL_DEFAULTS, MEMBER_CAGE, MIN_BEAM_WIDTH, MIN_PILLAR_AREA, MIN_PILLAR_SIDE, type MechanicalFloorOptions, type Opening, type Outbuilding, type OutbuildingItem, type OutbuildingOpening, type OutbuildingWall, type OutdoorLamp, type Outlet, PILE_AREA, PILE_DEFAULTS, PLATE_DEFAULTS, PUNCHED_DEFAULTS, type PartRole, type PileDesign, type PlanContext, type PlanStructure, type PlateOptions, type PlateRect, type PlateStrip, type Plumbing, type PlumbingPoint, type PlumbingRun, type Point3, type PunchedFacadeOptions, RAFT_THICKNESS, REBAR_RATIOS, ROOF_COVERINGS, type Rect, type Roof, type RoofCoveringDef, type RoofPane, type RoofShape, SILL_BEAM_DEPTH, SKYSCRAPER_DEFAULTS, SKYSCRAPER_MAX_STOREYS, SLAB_PANEL_DEFAULTS, STRUCTURAL_VIOLATION, type ServiceEntrance, type ShackOptions, type SkyscraperLayout, type SkyscraperOptions, type SkyscraperPreset, type SlabPanelOptions, type Solar, type SolarPanel, type SourceDoor, type SourceWall, type SourceWindow, type StoreyContext, type StoreyKind, type StripFill, type StripFiller, type StripId, type StructuralViolation, type StructuralViolationCode, type Structure, type StructureExtras, type StructureOptions, type StructurePackOptions, type StructurePart, type StructureSource, type StructuredResult, type Support, TANK_PILLAR_SIDE, TOWER_DEFAULTS, type TankPlanOptions, type TankPlatform, type Tent, type TowerGeometry, type TowerMechanicalOptions, type TowerOptions, type TowerPlanOptions, type TowerPlate, type Utilities, type ValidateStructureOptions, WALL_PILLAR_SIDE, WALL_PILLAR_SPACING, type WallDetail, type WallFixture, type WallMaterials, type WallSpecimenOptions, type WaterTank, type WoodFrameOptions, addCore, addCurtainWall, addFlatRoof, addMechanicalFloor, addPunchedFacade, addTunedMassDamper, applySlabPanels, beamDepthFor, beamSpan, buildSkyscraper, buildStructure, buildTower, buildWallSpecimen, cageResidualCapacity, campConstruction, chaletConstruction, constructionOfSystem, coreSize, countViolations, damperMass, exteriorWindows, logCabinConstruction, masonryConstruction, mechanicalStoreys, pilesFor, pillarStations, planToSpace, planWaterTank, register, registerConstruction, registerConstructionSystem, registerRoofCovering, resolveSlabPanels, shackConstruction, skyscraperLayout, slabPanelView, slabPanelsOf, splitStrip, storeyKinds, stripDoor, structureLayer, toDestructibleSpec, towerFloors, towerLocales, towerPlate, towerWater, validateSpec, validateStructure, version, windExposureOf, woodFrameConstruction };