@pascal-app/core 1.0.0-beta.4 → 1.0.0
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/LICENSE +21 -0
- package/README.md +23 -0
- package/dist/capture/index.d.ts +3 -0
- package/dist/capture/index.d.ts.map +1 -0
- package/dist/capture/index.js +2 -0
- package/dist/capture/schema.d.ts +417 -0
- package/dist/capture/schema.d.ts.map +1 -0
- package/dist/capture/schema.js +348 -0
- package/dist/capture/source.d.ts +60 -0
- package/dist/capture/source.d.ts.map +1 -0
- package/dist/capture/source.js +254 -0
- package/dist/events/bus.d.ts +55 -7
- package/dist/events/bus.d.ts.map +1 -1
- package/dist/events/hidden-wall-pointer-hold.d.ts +28 -0
- package/dist/events/hidden-wall-pointer-hold.d.ts.map +1 -0
- package/dist/events/hidden-wall-pointer-hold.js +37 -0
- package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts +12 -0
- package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/spatial-grid-manager.js +39 -1
- package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts +2785 -1
- package/dist/hooks/spatial-grid/spatial-grid-sync.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/spatial-grid-sync.js +132 -19
- package/dist/hooks/spatial-grid/support-host-patch.d.ts +45 -1
- package/dist/hooks/spatial-grid/support-host-patch.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/support-host-patch.js +171 -6
- package/dist/index.d.ts +15 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -5
- package/dist/lib/asset-storage.d.ts.map +1 -1
- package/dist/lib/asset-storage.js +4 -1
- package/dist/lib/polygon-union.d.ts +4 -0
- package/dist/lib/polygon-union.d.ts.map +1 -0
- package/dist/lib/polygon-union.js +306 -0
- package/dist/lib/roof-overlap.d.ts +32 -0
- package/dist/lib/roof-overlap.d.ts.map +1 -0
- package/dist/lib/roof-overlap.js +72 -0
- package/dist/lib/room-topology-index.d.ts +50 -0
- package/dist/lib/room-topology-index.d.ts.map +1 -0
- package/dist/lib/room-topology-index.js +237 -0
- package/dist/lib/slab-polygon.d.ts +35 -2
- package/dist/lib/slab-polygon.d.ts.map +1 -1
- package/dist/lib/slab-polygon.js +133 -27
- package/dist/lib/space-detection.d.ts +40 -3
- package/dist/lib/space-detection.d.ts.map +1 -1
- package/dist/lib/space-detection.js +890 -246
- package/dist/registry/handles.d.ts +24 -3
- package/dist/registry/handles.d.ts.map +1 -1
- package/dist/registry/index.d.ts +3 -3
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +1 -1
- package/dist/registry/registry.d.ts +29 -6
- package/dist/registry/registry.d.ts.map +1 -1
- package/dist/registry/registry.js +111 -4
- package/dist/registry/scene-api.d.ts +16 -0
- package/dist/registry/scene-api.d.ts.map +1 -1
- package/dist/registry/scene-api.js +49 -1
- package/dist/registry/types.d.ts +261 -13
- package/dist/registry/types.d.ts.map +1 -1
- package/dist/registry/use-registry-version.d.ts +11 -0
- package/dist/registry/use-registry-version.d.ts.map +1 -0
- package/dist/registry/use-registry-version.js +15 -0
- package/dist/schema/__bench__/node-parsers.bench.d.ts +24 -0
- package/dist/schema/__bench__/node-parsers.bench.d.ts.map +1 -0
- package/dist/schema/__bench__/node-parsers.bench.js +314 -0
- package/dist/schema/__fixtures__/node-fixtures.d.ts +28 -0
- package/dist/schema/__fixtures__/node-fixtures.d.ts.map +1 -0
- package/dist/schema/__fixtures__/node-fixtures.js +125 -0
- package/dist/schema/base.d.ts +1 -1
- package/dist/schema/base.d.ts.map +1 -1
- package/dist/schema/base.js +8 -1
- package/dist/schema/compiled-node-parsers.d.ts +40 -0
- package/dist/schema/compiled-node-parsers.d.ts.map +1 -0
- package/dist/schema/compiled-node-parsers.js +95 -0
- package/dist/schema/index.d.ts +20 -15
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +19 -12
- package/dist/schema/material.d.ts +2 -1
- package/dist/schema/material.d.ts.map +1 -1
- package/dist/schema/material.js +1 -0
- package/dist/schema/nodes/automatic-downspout.d.ts +17 -0
- package/dist/schema/nodes/automatic-downspout.d.ts.map +1 -0
- package/dist/schema/nodes/automatic-downspout.js +237 -0
- package/dist/schema/nodes/block.d.ts +107 -0
- package/dist/schema/nodes/block.d.ts.map +1 -0
- package/dist/schema/nodes/block.js +207 -0
- package/dist/schema/nodes/box-vent.d.ts +8 -2
- package/dist/schema/nodes/box-vent.d.ts.map +1 -1
- package/dist/schema/nodes/box-vent.js +2 -0
- package/dist/schema/nodes/building.d.ts +1 -1
- package/dist/schema/nodes/cabinet.d.ts +25 -3
- package/dist/schema/nodes/cabinet.d.ts.map +1 -1
- package/dist/schema/nodes/cabinet.js +26 -5
- package/dist/schema/nodes/ceiling.d.ts +1 -1
- package/dist/schema/nodes/chimney.d.ts +2 -2
- package/dist/schema/nodes/column.d.ts +6 -6
- package/dist/schema/nodes/construction-dimension.d.ts +4 -4
- package/dist/schema/nodes/cupola.d.ts +9 -1
- package/dist/schema/nodes/cupola.d.ts.map +1 -1
- package/dist/schema/nodes/cupola.js +2 -0
- package/dist/schema/nodes/door.d.ts +1 -1
- package/dist/schema/nodes/dormer.d.ts +44 -1
- package/dist/schema/nodes/dormer.d.ts.map +1 -1
- package/dist/schema/nodes/dormer.js +131 -7
- package/dist/schema/nodes/downspout.d.ts +11 -1
- package/dist/schema/nodes/downspout.d.ts.map +1 -1
- package/dist/schema/nodes/downspout.js +24 -0
- package/dist/schema/nodes/duct-fitting.d.ts +18 -1
- package/dist/schema/nodes/duct-fitting.d.ts.map +1 -1
- package/dist/schema/nodes/duct-fitting.js +25 -4
- package/dist/schema/nodes/duct-segment.d.ts +23 -1
- package/dist/schema/nodes/duct-segment.d.ts.map +1 -1
- package/dist/schema/nodes/duct-segment.js +20 -0
- package/dist/schema/nodes/duct-terminal.d.ts +1 -1
- package/dist/schema/nodes/elevator.d.ts +1 -1
- package/dist/schema/nodes/eyebrow-vent.d.ts +8 -2
- package/dist/schema/nodes/eyebrow-vent.d.ts.map +1 -1
- package/dist/schema/nodes/eyebrow-vent.js +2 -0
- package/dist/schema/nodes/fence.d.ts +1 -1
- package/dist/schema/nodes/guide.d.ts +1 -1
- package/dist/schema/nodes/gutter.d.ts +36 -2
- package/dist/schema/nodes/gutter.d.ts.map +1 -1
- package/dist/schema/nodes/gutter.js +308 -1
- package/dist/schema/nodes/hanger-overrides.d.ts +7 -0
- package/dist/schema/nodes/hanger-overrides.d.ts.map +1 -0
- package/dist/schema/nodes/hanger-overrides.js +6 -0
- package/dist/schema/nodes/hvac-equipment.d.ts +1 -1
- package/dist/schema/nodes/item.d.ts +4 -3
- package/dist/schema/nodes/item.d.ts.map +1 -1
- package/dist/schema/nodes/item.js +5 -0
- package/dist/schema/nodes/lean-to-extension.d.ts +212 -0
- package/dist/schema/nodes/lean-to-extension.d.ts.map +1 -0
- package/dist/schema/nodes/lean-to-extension.js +114 -0
- package/dist/schema/nodes/level.d.ts +5 -2
- package/dist/schema/nodes/level.d.ts.map +1 -1
- package/dist/schema/nodes/level.js +9 -0
- package/dist/schema/nodes/lineset.d.ts +1 -1
- package/dist/schema/nodes/liquid-line.d.ts +1 -1
- package/dist/schema/nodes/measurement.d.ts +1 -1
- package/dist/schema/nodes/pipe-fitting.d.ts +9 -1
- package/dist/schema/nodes/pipe-fitting.d.ts.map +1 -1
- package/dist/schema/nodes/pipe-fitting.js +6 -2
- package/dist/schema/nodes/pipe-segment.d.ts +23 -1
- package/dist/schema/nodes/pipe-segment.d.ts.map +1 -1
- package/dist/schema/nodes/pipe-segment.js +20 -0
- package/dist/schema/nodes/pipe-trap.d.ts +1 -1
- package/dist/schema/nodes/ridge-vent.d.ts +1 -1
- package/dist/schema/nodes/ridge-vent.d.ts.map +1 -1
- package/dist/schema/nodes/ridge-vent.js +4 -1
- package/dist/schema/nodes/roof-segment-shape.d.ts +4 -0
- package/dist/schema/nodes/roof-segment-shape.d.ts.map +1 -1
- package/dist/schema/nodes/roof-segment-shape.js +64 -1
- package/dist/schema/nodes/roof-segment-walls.d.ts +3 -1
- package/dist/schema/nodes/roof-segment-walls.d.ts.map +1 -1
- package/dist/schema/nodes/roof-segment-walls.js +1 -1
- package/dist/schema/nodes/roof-segment.d.ts +41 -1
- package/dist/schema/nodes/roof-segment.d.ts.map +1 -1
- package/dist/schema/nodes/roof-segment.js +79 -2
- package/dist/schema/nodes/roof.d.ts +22 -1
- package/dist/schema/nodes/roof.d.ts.map +1 -1
- package/dist/schema/nodes/roof.js +14 -0
- package/dist/schema/nodes/scan.d.ts +19 -2
- package/dist/schema/nodes/scan.d.ts.map +1 -1
- package/dist/schema/nodes/scan.js +11 -1
- package/dist/schema/nodes/shelf.d.ts +2 -2
- package/dist/schema/nodes/site.d.ts +1 -1
- package/dist/schema/nodes/skylight.d.ts +1 -1
- package/dist/schema/nodes/slab.d.ts +1 -1
- package/dist/schema/nodes/solar-panel.d.ts +1 -1
- package/dist/schema/nodes/spawn.d.ts +1 -1
- package/dist/schema/nodes/stair-segment.d.ts +1 -1
- package/dist/schema/nodes/stair.d.ts +1 -1
- package/dist/schema/nodes/structural-grid.d.ts +1 -1
- package/dist/schema/nodes/turbine-vent.d.ts +7 -1
- package/dist/schema/nodes/turbine-vent.d.ts.map +1 -1
- package/dist/schema/nodes/turbine-vent.js +2 -0
- package/dist/schema/nodes/wall.d.ts +4 -4
- package/dist/schema/nodes/wall.d.ts.map +1 -1
- package/dist/schema/nodes/wall.js +7 -1
- package/dist/schema/nodes/window.d.ts +10 -3
- package/dist/schema/nodes/window.d.ts.map +1 -1
- package/dist/schema/nodes/window.js +4 -0
- package/dist/schema/nodes/zone.d.ts +2 -2
- package/dist/schema/nodes/zone.js +1 -1
- package/dist/schema/types.d.ts +485 -109
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/types.js +27 -1
- package/dist/services/hosting.d.ts +2 -2
- package/dist/services/hosting.d.ts.map +1 -1
- package/dist/services/hosting.js +4 -4
- package/dist/services/index.d.ts +2 -2
- package/dist/services/index.d.ts.map +1 -1
- package/dist/services/index.js +2 -2
- package/dist/services/storey.d.ts +3 -10
- package/dist/services/storey.d.ts.map +1 -1
- package/dist/services/storey.js +45 -15
- package/dist/services/system-graph.d.ts +11 -0
- package/dist/services/system-graph.d.ts.map +1 -1
- package/dist/services/system-graph.js +35 -5
- package/dist/store/actions/node-actions.d.ts +15 -4
- package/dist/store/actions/node-actions.d.ts.map +1 -1
- package/dist/store/actions/node-actions.js +458 -19
- package/dist/store/history-control.d.ts +5 -0
- package/dist/store/history-control.d.ts.map +1 -1
- package/dist/store/history-control.js +68 -6
- package/dist/store/history-invalidation.d.ts +3 -0
- package/dist/store/history-invalidation.d.ts.map +1 -0
- package/dist/store/history-invalidation.js +72 -0
- package/dist/store/scene-hydration.d.ts +5 -0
- package/dist/store/scene-hydration.d.ts.map +1 -0
- package/dist/store/scene-hydration.js +57 -0
- package/dist/store/use-scene.d.ts +3 -0
- package/dist/store/use-scene.d.ts.map +1 -1
- package/dist/store/use-scene.js +407 -227
- package/dist/systems/elevator/elevator-service.d.ts.map +1 -1
- package/dist/systems/elevator/elevator-service.js +16 -11
- package/dist/systems/roof/roof-elevation-system.d.ts +3 -0
- package/dist/systems/roof/roof-elevation-system.d.ts.map +1 -0
- package/dist/systems/roof/roof-elevation-system.js +94 -0
- package/dist/systems/roof/roof-elevation.d.ts +4 -0
- package/dist/systems/roof/roof-elevation.d.ts.map +1 -0
- package/dist/systems/roof/roof-elevation.js +95 -0
- package/dist/systems/roof/roof-footprint.d.ts +17 -0
- package/dist/systems/roof/roof-footprint.d.ts.map +1 -0
- package/dist/systems/roof/roof-footprint.js +83 -0
- package/dist/systems/slab/slab-support.d.ts +0 -31
- package/dist/systems/slab/slab-support.d.ts.map +1 -1
- package/dist/systems/slab/slab-support.js +26 -4
- package/dist/systems/stair/stair-flight.d.ts +17 -0
- package/dist/systems/stair/stair-flight.d.ts.map +1 -0
- package/dist/systems/stair/stair-flight.js +27 -0
- package/dist/systems/stair/stair-opening-preview.d.ts +1556 -1328
- package/dist/systems/stair/stair-opening-preview.d.ts.map +1 -1
- package/dist/systems/stair/stair-opening-system.d.ts +1 -0
- package/dist/systems/stair/stair-opening-system.d.ts.map +1 -1
- package/dist/systems/stair/stair-opening-system.js +93 -96
- package/dist/systems/stair/stair-rise.js +21 -20
- package/dist/systems/wall/wall-curve.d.ts +1 -0
- package/dist/systems/wall/wall-curve.d.ts.map +1 -1
- package/dist/systems/wall/wall-curve.js +73 -0
- package/dist/systems/wall/wall-footprint.d.ts +1 -0
- package/dist/systems/wall/wall-footprint.d.ts.map +1 -1
- package/dist/systems/wall/wall-footprint.js +1 -0
- package/dist/systems/wall/wall-mitering.d.ts.map +1 -1
- package/dist/systems/wall/wall-mitering.js +88 -9
- package/dist/systems/wall/wall-topology.d.ts +53 -0
- package/dist/systems/wall/wall-topology.d.ts.map +1 -0
- package/dist/systems/wall/wall-topology.js +414 -0
- package/dist/utils/clone-scene-graph.d.ts +2 -0
- package/dist/utils/clone-scene-graph.d.ts.map +1 -1
- package/dist/utils/clone-scene-graph.js +39 -2
- package/dist/utils/scene-migrations.d.ts +1 -0
- package/dist/utils/scene-migrations.d.ts.map +1 -1
- package/dist/utils/scene-migrations.js +1 -0
- package/dist/utils/vertical-scene-migration.d.ts +13 -0
- package/dist/utils/vertical-scene-migration.d.ts.map +1 -0
- package/dist/utils/vertical-scene-migration.js +179 -0
- package/dist/validation/validate-build-json.d.ts +3 -0
- package/dist/validation/validate-build-json.d.ts.map +1 -1
- package/dist/validation/validate-build-json.js +49 -2
- package/package.json +10 -3
- package/dist/systems/elevator/elevator-runtime-system.d.ts +0 -2
- package/dist/systems/elevator/elevator-runtime-system.d.ts.map +0 -1
- package/dist/systems/elevator/elevator-runtime-system.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/schema/types.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAA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MAAM,MAAM,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AACzC,MAAM,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAErC,yFAAyF;AACzF,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,CAAA;AAE/D,qFAAqF;AACrF,eAAO,MAAM,UAAU,GAAI,QAAQ,aAAa,KAAG,WAAsC,CAAA"}
|
package/dist/schema/types.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
|
+
import { BlockNode } from './nodes/block';
|
|
2
3
|
import { BoxVentNode } from './nodes/box-vent';
|
|
3
4
|
import { BuildingNode } from './nodes/building';
|
|
4
5
|
import { CabinetModuleNode, CabinetNode } from './nodes/cabinet';
|
|
@@ -20,6 +21,7 @@ import { GuideNode } from './nodes/guide';
|
|
|
20
21
|
import { GutterNode } from './nodes/gutter';
|
|
21
22
|
import { HvacEquipmentNode } from './nodes/hvac-equipment';
|
|
22
23
|
import { ItemNode } from './nodes/item';
|
|
24
|
+
import { LeanToExtensionNode } from './nodes/lean-to-extension';
|
|
23
25
|
import { LevelNode } from './nodes/level';
|
|
24
26
|
import { LinesetNode } from './nodes/lineset';
|
|
25
27
|
import { LiquidLineNode } from './nodes/liquid-line';
|
|
@@ -44,13 +46,35 @@ import { TurbineVentNode } from './nodes/turbine-vent';
|
|
|
44
46
|
import { WallNode } from './nodes/wall';
|
|
45
47
|
import { WindowNode } from './nodes/window';
|
|
46
48
|
import { ZoneNode } from './nodes/zone';
|
|
47
|
-
|
|
49
|
+
/**
|
|
50
|
+
* Assembles the node union on discriminators that claim exactly one value.
|
|
51
|
+
*
|
|
52
|
+
* `nodeType()` defaults the literal so a per-kind schema can fill `type` in
|
|
53
|
+
* (`WallNode.parse({ start, end })`), but a `.default()`-wrapped discriminator
|
|
54
|
+
* also claims `undefined` from zod 4.5 on (upstream #6432). With 48 members
|
|
55
|
+
* doing it, the union's lazily-built discriminator map collides on
|
|
56
|
+
* `undefined` and throws `Duplicate discriminator value` — as a plain Error,
|
|
57
|
+
* so it escapes `safeParse` and surfaces as a crash at the first parse.
|
|
58
|
+
*
|
|
59
|
+
* Each member is therefore projected to a clone whose `type` is the bare
|
|
60
|
+
* literal. Per-kind schemas keep their default; only the union's view of the
|
|
61
|
+
* discriminator narrows. Metadata lives in zod's global registry keyed by
|
|
62
|
+
* instance, so `.describe()` text has to be carried over to the clone by hand.
|
|
63
|
+
*/
|
|
64
|
+
export const nodeUnion = (members) => z.discriminatedUnion('type', members.map((member) => {
|
|
65
|
+
const projected = member.extend({ type: member.shape.type.unwrap() });
|
|
66
|
+
const meta = z.globalRegistry.get(member);
|
|
67
|
+
return meta ? projected.meta(meta) : projected;
|
|
68
|
+
}));
|
|
69
|
+
export const AnyNode = nodeUnion([
|
|
48
70
|
SiteNode,
|
|
49
71
|
BuildingNode,
|
|
50
72
|
ElevatorNode,
|
|
51
73
|
LevelNode,
|
|
74
|
+
LeanToExtensionNode,
|
|
52
75
|
ColumnNode,
|
|
53
76
|
ConstructionDimensionNode,
|
|
77
|
+
BlockNode,
|
|
54
78
|
StructuralGridNode,
|
|
55
79
|
WallNode,
|
|
56
80
|
FenceNode,
|
|
@@ -92,3 +116,5 @@ export const AnyNode = z.discriminatedUnion('type', [
|
|
|
92
116
|
PipeFittingNode,
|
|
93
117
|
PipeTrapNode,
|
|
94
118
|
]);
|
|
119
|
+
/** The node kind a union member accepts, read off its bare-literal discriminator. */
|
|
120
|
+
export const nodeKindOf = (option) => option.shape.type.value;
|
|
@@ -58,7 +58,7 @@ export declare function getSurface(host: AnyNode): SurfacesConfig | null;
|
|
|
58
58
|
* Resolves the stackable top height of a host (e.g. table surface, slab top,
|
|
59
59
|
* stair landing). Returns `null` when the host has no `surfaces.top`.
|
|
60
60
|
*/
|
|
61
|
-
export declare function getTopSurfaceHeight(host: AnyNode): number | null;
|
|
61
|
+
export declare function getTopSurfaceHeight(host: AnyNode, nodes?: Record<string, AnyNode>): number | null;
|
|
62
62
|
/**
|
|
63
63
|
* Whether `host` can receive a surface-resting (top-stacked) child. A
|
|
64
64
|
* ceiling-mounted item hangs from the ceiling, so its visible "top" is not a
|
|
@@ -84,5 +84,5 @@ export declare function pickHost(args: {
|
|
|
84
84
|
* Convenience: clamps a Y coordinate to the top of a host surface, when one
|
|
85
85
|
* is declared. Returns the original Y if the host has no top surface.
|
|
86
86
|
*/
|
|
87
|
-
export declare function clampYToHostTop(host: AnyNode, originalY: number): number;
|
|
87
|
+
export declare function clampYToHostTop(host: AnyNode, originalY: number, nodes?: Record<string, AnyNode>): number;
|
|
88
88
|
//# sourceMappingURL=hosting.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hosting.d.ts","sourceRoot":"","sources":["../../src/services/hosting.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAEzD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,IAAI,CAAA;AAE/B,MAAM,MAAM,IAAI,GAAG,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAA;AAEpD,MAAM,MAAM,WAAW,GACnB;IAAE,IAAI,EAAE,WAAW,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GACxC;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GACvD;IAAE,IAAI,EAAE,gBAAgB,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GACtD;IAAE,IAAI,EAAE,cAAc,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,GAC3C;IAAE,IAAI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 +82,12 @@ export function getSurface(host) {
|
|
|
82
82
|
* Resolves the stackable top height of a host (e.g. table surface, slab top,
|
|
83
83
|
* stair landing). Returns `null` when the host has no `surfaces.top`.
|
|
84
84
|
*/
|
|
85
|
-
export function getTopSurfaceHeight(host) {
|
|
85
|
+
export function getTopSurfaceHeight(host, nodes = { [host.id]: host }) {
|
|
86
86
|
const surfaces = getSurface(host);
|
|
87
87
|
if (!surfaces?.top)
|
|
88
88
|
return null;
|
|
89
89
|
const { height } = surfaces.top;
|
|
90
|
-
return typeof height === 'function' ? height(host) : height;
|
|
90
|
+
return typeof height === 'function' ? height(host, { nodes }) : height;
|
|
91
91
|
}
|
|
92
92
|
/**
|
|
93
93
|
* Whether `host` can receive a surface-resting (top-stacked) child. A
|
|
@@ -125,7 +125,7 @@ export function pickHost(args) {
|
|
|
125
125
|
* Convenience: clamps a Y coordinate to the top of a host surface, when one
|
|
126
126
|
* is declared. Returns the original Y if the host has no top surface.
|
|
127
127
|
*/
|
|
128
|
-
export function clampYToHostTop(host, originalY) {
|
|
129
|
-
const top = getTopSurfaceHeight(host);
|
|
128
|
+
export function clampYToHostTop(host, originalY, nodes) {
|
|
129
|
+
const top = getTopSurfaceHeight(host, nodes);
|
|
130
130
|
return top == null ? originalY : top;
|
|
131
131
|
}
|
package/dist/services/index.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { type AlongWallAlignment, type AlongWallFeature, computeEdgeGaps, comput
|
|
|
8
8
|
export { analyzePortConnectivity, type PortConnection, type PortConnectivity, resolveConnectivityUpdates, } from './port-connectivity';
|
|
9
9
|
export { buildRiserDiagram, projectIso, type RiserDiagram, type RiserLine, type RiserMarker, } from './riser-diagram';
|
|
10
10
|
export { DEFAULT_ANGLE_STEP, DEFAULT_GRID_STEP, type SnapServices, snapAngleToList, snapPointAlongAngleRay, snapPointToAngle, snapPointToGrid, snapScalar, snapServices, snapVec3ToGrid, snapWorldXZToBuildingLocal, } from './snap';
|
|
11
|
-
export { CEILING_CLAMP_MARGIN, findLevelAboveId, findLevelBelowId, getCeilingClampBound, getCoveringSlabUndersideAt, getLevelAbove, getLevelBelow, getLevelElevations, getStoredLevelHeight, getWallPlaneTop, type LevelElevation, } from './storey';
|
|
12
|
-
export { buildPortComponents, type SystemSummary, summarizeSystemFor, } from './system-graph';
|
|
11
|
+
export { CEILING_CLAMP_MARGIN, findLevelAboveId, findLevelBelowId, getCeilingClampBound, getCoveringSlabUndersideAt, getLevelAbove, getLevelBelow, getLevelElevations, getLevelFloorToFloorHeight, getStoredLevelHeight, getWallPlaneTop, type LevelElevation, } from './storey';
|
|
12
|
+
export { buildPortComponents, collectSystemPorts, distributionPointToWorld, type SystemSummary, summarizeSystemFor, } from './system-graph';
|
|
13
13
|
export { type DwvFinding, type DwvSeverity, validateDwv, } from './validate-dwv';
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,WAAW,EACX,iBAAiB,EACjB,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,gBAAgB,EAChB,+BAA+B,GAChC,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,uBAAuB,EACvB,KAAK,aAAa,EAClB,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,GACnB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,SAAS,EACT,YAA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UAAU,CAAA;AACjB,OAAO,EACL,mBAAmB,EACnB,KAAK,aAAa,EAClB,kBAAkB,GACnB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,WAAW,GACZ,MAAM,gBAAgB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/services/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACvB,KAAK,UAAU,EACf,KAAK,YAAY,EACjB,WAAW,EACX,iBAAiB,EACjB,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,gBAAgB,EAChB,+BAA+B,GAChC,MAAM,aAAa,CAAA;AACpB,OAAO,EACL,uBAAuB,EACvB,KAAK,aAAa,EAClB,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,oBAAoB,EACpB,cAAc,EACd,kBAAkB,GACnB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,iBAAiB,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,SAAS,EACT,YAAY,EACZ,eAAe,EACf,UAAU,EACV,mBAAmB,EACnB,cAAc,EACd,QAAQ,EACR,KAAK,IAAI,GACV,MAAM,WAAW,CAAA;AAClB,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,KAAK,QAAQ,EACb,aAAa,EACb,SAAS,EACT,cAAc,EACd,UAAU,EACV,cAAc,GACf,MAAM,YAAY,CAAA;AACnB,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,eAAe,EACf,oBAAoB,EACpB,gCAAgC,EAChC,wBAAwB,EACxB,kBAAkB,EAClB,uBAAuB,EACvB,KAAK,OAAO,EACZ,KAAK,eAAe,EACpB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,iBAAiB,EACtB,KAAK,eAAe,EACpB,KAAK,UAAU,GAChB,MAAM,kBAAkB,CAAA;AACzB,OAAO,EACL,uBAAuB,EACvB,KAAK,cAAc,EACnB,KAAK,gBAAgB,EACrB,0BAA0B,GAC3B,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EACL,iBAAiB,EACjB,UAAU,EACV,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,WAAW,GACjB,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,YAAY,EACjB,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,cAAc,EACd,0BAA0B,GAC3B,MAAM,QAAQ,CAAA;AACf,OAAO,EACL,oBAAoB,EACpB,gBAAgB,EAChB,gBAAgB,EAChB,oBAAoB,EACpB,0BAA0B,EAC1B,aAAa,EACb,aAAa,EACb,kBAAkB,EAClB,0BAA0B,EAC1B,oBAAoB,EACpB,eAAe,EACf,KAAK,cAAc,GACpB,MAAM,UAAU,CAAA;AACjB,OAAO,EACL,mBAAmB,EACnB,kBAAkB,EAClB,wBAAwB,EACxB,KAAK,aAAa,EAClB,kBAAkB,GACnB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,WAAW,GACZ,MAAM,gBAAgB,CAAA"}
|
package/dist/services/index.js
CHANGED
|
@@ -8,6 +8,6 @@ export { computeEdgeGaps, computeOpeningGuides, DEFAULT_OPENING_GUIDE_TOLERANCES
|
|
|
8
8
|
export { analyzePortConnectivity, resolveConnectivityUpdates, } from './port-connectivity';
|
|
9
9
|
export { buildRiserDiagram, projectIso, } from './riser-diagram';
|
|
10
10
|
export { DEFAULT_ANGLE_STEP, DEFAULT_GRID_STEP, snapAngleToList, snapPointAlongAngleRay, snapPointToAngle, snapPointToGrid, snapScalar, snapServices, snapVec3ToGrid, snapWorldXZToBuildingLocal, } from './snap';
|
|
11
|
-
export { CEILING_CLAMP_MARGIN, findLevelAboveId, findLevelBelowId, getCeilingClampBound, getCoveringSlabUndersideAt, getLevelAbove, getLevelBelow, getLevelElevations, getStoredLevelHeight, getWallPlaneTop, } from './storey';
|
|
12
|
-
export { buildPortComponents, summarizeSystemFor, } from './system-graph';
|
|
11
|
+
export { CEILING_CLAMP_MARGIN, findLevelAboveId, findLevelBelowId, getCeilingClampBound, getCoveringSlabUndersideAt, getLevelAbove, getLevelBelow, getLevelElevations, getLevelFloorToFloorHeight, getStoredLevelHeight, getWallPlaneTop, } from './storey';
|
|
12
|
+
export { buildPortComponents, collectSystemPorts, distributionPointToWorld, summarizeSystemFor, } from './system-graph';
|
|
13
13
|
export { validateDwv, } from './validate-dwv';
|
|
@@ -13,22 +13,15 @@ export declare const CEILING_CLAMP_MARGIN = 0.01;
|
|
|
13
13
|
*/
|
|
14
14
|
export declare function getStoredLevelHeight(level: Pick<LevelNode, 'height'>): number;
|
|
15
15
|
export type LevelElevation = {
|
|
16
|
-
/** World Y of the level's floor:
|
|
16
|
+
/** World Y of the level's floor: cumulative heights and level offsets through this level. */
|
|
17
17
|
baseY: number;
|
|
18
18
|
/** Stored storey height of this level (fallback applied). */
|
|
19
19
|
height: number;
|
|
20
20
|
buildingId: string | null;
|
|
21
21
|
ordinal: number;
|
|
22
22
|
};
|
|
23
|
-
/**
|
|
24
|
-
* Per-building stacked elevations from stored storey heights: levels are
|
|
25
|
-
* sorted by ordinal ascending within each building, the lowest level's floor
|
|
26
|
-
* sits at 0, and each next floor sits on top of the previous storey height.
|
|
27
|
-
* Levels with no resolvable building share one legacy stack from 0.
|
|
28
|
-
*
|
|
29
|
-
* Pure — operates on the serialized nodes record only.
|
|
30
|
-
*/
|
|
31
23
|
export declare function getLevelElevations(nodes: Record<AnyNodeId, AnyNode>): Map<string, LevelElevation>;
|
|
24
|
+
export declare function getLevelFloorToFloorHeight(levelId: string, nodes: Record<AnyNodeId, AnyNode>): number;
|
|
32
25
|
/**
|
|
33
26
|
* The id of the level directly above `levelId` in its own stack (same
|
|
34
27
|
* resolved building, or the shared legacy stack for building-less levels):
|
|
@@ -55,7 +48,7 @@ export declare function getLevelBelow(levelId: string, nodes: Record<AnyNodeId,
|
|
|
55
48
|
/**
|
|
56
49
|
* Underside of the LOWEST slab from the level above that covers
|
|
57
50
|
* level-local point `[x, z]`, expressed in the queried level's local Y:
|
|
58
|
-
* `
|
|
51
|
+
* `floorToFloorHeight + (slab.elevation - slab.thickness)`. `recessed` slabs
|
|
59
52
|
* (pools) never cover. `null` when no covering slab (or no level above).
|
|
60
53
|
*
|
|
61
54
|
* Coordinate spaces: levels stack in Y only (`LevelNode` carries no XZ
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"storey.d.ts","sourceRoot":"","sources":["../../src/services/storey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,SAAS,EAAY,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAQzD;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,OAAO,CAAA;AAExC;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,IAAI,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,MAAM,CAE7E;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B
|
|
1
|
+
{"version":3,"file":"storey.d.ts","sourceRoot":"","sources":["../../src/services/storey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAgB,SAAS,EAAY,QAAQ,EAAE,MAAM,WAAW,CAAA;AAC5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GAAG,IAAI,CAKlB;AA+FD;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,EACjC,CAAC,EAAE,MAAM,EACT,CAAC,EAAE,MAAM,GACR,MAAM,GAAG,IAAI,CAIf;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,KAAK,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,WAAW,GAAG,aAAa,CAAC,CAAC,EAC5F,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,GAChC,MAAM,CAYR;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,EACjC,OAAO,EAAE,aAAa,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GACvC,MAAM,CAuBR"}
|
package/dist/services/storey.js
CHANGED
|
@@ -26,14 +26,22 @@ function resolveLevelBuildingId(levelId, parentId, buildings) {
|
|
|
26
26
|
return buildings.find((building) => building.children.includes(levelId))?.id ?? null;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* Per-building stacked elevations from stored storey heights
|
|
30
|
-
* sorted by ordinal ascending within each
|
|
31
|
-
*
|
|
32
|
-
* Levels with no resolvable building share one legacy stack
|
|
29
|
+
* Per-building stacked elevations from stored storey heights and additive
|
|
30
|
+
* base-elevation offsets: levels are sorted by ordinal ascending within each
|
|
31
|
+
* building, and each offset shifts its level plus every higher level in the
|
|
32
|
+
* same stack. Levels with no resolvable building share one legacy stack.
|
|
33
33
|
*
|
|
34
34
|
* Pure — operates on the serialized nodes record only.
|
|
35
35
|
*/
|
|
36
|
+
// Identity-keyed memo. `nodes` is an immutable store slice, so a hit means the
|
|
37
|
+
// scene has not changed since the last call. Hot callers ask once per wall per
|
|
38
|
+
// frame (WallCutout), which rebuilt an identical Map 1000+ times a frame. Weakly
|
|
39
|
+
// keyed so a closed project's node graph is not pinned by the memo.
|
|
40
|
+
const elevationMemo = new WeakMap();
|
|
36
41
|
export function getLevelElevations(nodes) {
|
|
42
|
+
const memoized = elevationMemo.get(nodes);
|
|
43
|
+
if (memoized)
|
|
44
|
+
return memoized;
|
|
37
45
|
const buildings = Object.values(nodes).filter((node) => node?.type === 'building');
|
|
38
46
|
const entries = [];
|
|
39
47
|
for (const node of Object.values(nodes)) {
|
|
@@ -42,6 +50,7 @@ export function getLevelElevations(nodes) {
|
|
|
42
50
|
const level = node;
|
|
43
51
|
entries.push({
|
|
44
52
|
levelId: level.id,
|
|
53
|
+
baseElevation: level.baseElevation ?? 0,
|
|
45
54
|
baseY: 0,
|
|
46
55
|
height: getStoredLevelHeight(level),
|
|
47
56
|
buildingId: resolveLevelBuildingId(level.id, level.parentId, buildings),
|
|
@@ -51,7 +60,7 @@ export function getLevelElevations(nodes) {
|
|
|
51
60
|
const elevations = new Map();
|
|
52
61
|
const cumulativeYByBuilding = new Map();
|
|
53
62
|
for (const entry of entries.sort((a, b) => a.ordinal - b.ordinal)) {
|
|
54
|
-
const baseY = cumulativeYByBuilding.get(entry.buildingId) ?? 0;
|
|
63
|
+
const baseY = (cumulativeYByBuilding.get(entry.buildingId) ?? 0) + entry.baseElevation;
|
|
55
64
|
elevations.set(entry.levelId, {
|
|
56
65
|
baseY,
|
|
57
66
|
height: entry.height,
|
|
@@ -60,8 +69,22 @@ export function getLevelElevations(nodes) {
|
|
|
60
69
|
});
|
|
61
70
|
cumulativeYByBuilding.set(entry.buildingId, baseY + entry.height);
|
|
62
71
|
}
|
|
72
|
+
elevationMemo.set(nodes, elevations);
|
|
63
73
|
return elevations;
|
|
64
74
|
}
|
|
75
|
+
function resolveLevelFloorToFloorHeight(levelId, elevations) {
|
|
76
|
+
const current = elevations.get(levelId);
|
|
77
|
+
if (!current)
|
|
78
|
+
return null;
|
|
79
|
+
const aboveId = findLevelAboveId(levelId, elevations);
|
|
80
|
+
if (!aboveId)
|
|
81
|
+
return current.height;
|
|
82
|
+
const above = elevations.get(aboveId);
|
|
83
|
+
return above ? above.baseY - current.baseY : current.height;
|
|
84
|
+
}
|
|
85
|
+
export function getLevelFloorToFloorHeight(levelId, nodes) {
|
|
86
|
+
return resolveLevelFloorToFloorHeight(levelId, getLevelElevations(nodes)) ?? DEFAULT_LEVEL_HEIGHT;
|
|
87
|
+
}
|
|
65
88
|
/**
|
|
66
89
|
* The id of the level directly above `levelId` in its own stack (same
|
|
67
90
|
* resolved building, or the shared legacy stack for building-less levels):
|
|
@@ -141,7 +164,10 @@ function resolveCoveringSlabContext(levelId, nodes) {
|
|
|
141
164
|
const level = nodes[levelId];
|
|
142
165
|
if (level?.type !== 'level')
|
|
143
166
|
return null;
|
|
144
|
-
const
|
|
167
|
+
const elevations = getLevelElevations(nodes);
|
|
168
|
+
const aboveId = findLevelAboveId(levelId, elevations);
|
|
169
|
+
const aboveNode = aboveId ? nodes[aboveId] : null;
|
|
170
|
+
const above = aboveNode?.type === 'level' ? aboveNode : null;
|
|
145
171
|
const slabs = [];
|
|
146
172
|
for (const childId of above?.children ?? []) {
|
|
147
173
|
const child = nodes[childId];
|
|
@@ -155,15 +181,19 @@ function resolveCoveringSlabContext(levelId, nodes) {
|
|
|
155
181
|
continue;
|
|
156
182
|
slabs.push(slab);
|
|
157
183
|
}
|
|
158
|
-
return {
|
|
184
|
+
return {
|
|
185
|
+
floorToFloorHeight: resolveLevelFloorToFloorHeight(levelId, elevations) ??
|
|
186
|
+
getStoredLevelHeight(level),
|
|
187
|
+
slabs,
|
|
188
|
+
};
|
|
159
189
|
}
|
|
160
190
|
/**
|
|
161
191
|
* Underside of `slab`'s solid in the QUERIED level's local Y. The solid
|
|
162
192
|
* occupies `[elevation - thickness, elevation]` in ITS level's local Y,
|
|
163
|
-
* which sits `
|
|
193
|
+
* which sits `floorToFloorHeight` above the queried level's floor.
|
|
164
194
|
*/
|
|
165
|
-
function coveringUndersideY(
|
|
166
|
-
return
|
|
195
|
+
function coveringUndersideY(floorToFloorHeight, slab) {
|
|
196
|
+
return floorToFloorHeight + ((slab.elevation ?? 0.05) - (slab.thickness ?? 0.05));
|
|
167
197
|
}
|
|
168
198
|
/**
|
|
169
199
|
* Whether `slab`'s stored footprint (polygon minus holes) covers `[x, z]`.
|
|
@@ -198,7 +228,7 @@ function lowestCoveringUndersideAt(context, x, z) {
|
|
|
198
228
|
for (const slab of context.slabs) {
|
|
199
229
|
if (!slabCoversPoint(slab, x, z))
|
|
200
230
|
continue;
|
|
201
|
-
const underside = coveringUndersideY(context.
|
|
231
|
+
const underside = coveringUndersideY(context.floorToFloorHeight, slab);
|
|
202
232
|
if (lowest === null || underside < lowest)
|
|
203
233
|
lowest = underside;
|
|
204
234
|
}
|
|
@@ -207,7 +237,7 @@ function lowestCoveringUndersideAt(context, x, z) {
|
|
|
207
237
|
/**
|
|
208
238
|
* Underside of the LOWEST slab from the level above that covers
|
|
209
239
|
* level-local point `[x, z]`, expressed in the queried level's local Y:
|
|
210
|
-
* `
|
|
240
|
+
* `floorToFloorHeight + (slab.elevation - slab.thickness)`. `recessed` slabs
|
|
211
241
|
* (pools) never cover. `null` when no covering slab (or no level above).
|
|
212
242
|
*
|
|
213
243
|
* Coordinate spaces: levels stack in Y only (`LevelNode` carries no XZ
|
|
@@ -245,9 +275,9 @@ export function getWallPlaneTop(wall, levelId, nodes) {
|
|
|
245
275
|
const context = resolveCoveringSlabContext(levelId, nodes);
|
|
246
276
|
if (!context)
|
|
247
277
|
return DEFAULT_LEVEL_HEIGHT;
|
|
248
|
-
let plane = context.
|
|
278
|
+
let plane = context.floorToFloorHeight;
|
|
249
279
|
for (const slab of context.slabs) {
|
|
250
|
-
const underside = coveringUndersideY(context.
|
|
280
|
+
const underside = coveringUndersideY(context.floorToFloorHeight, slab);
|
|
251
281
|
if (underside >= plane)
|
|
252
282
|
continue;
|
|
253
283
|
if (!wallOverlapsSlabFootprint(wall, slab.polygon, slab.holes))
|
|
@@ -274,7 +304,7 @@ export function getCeilingClampBound(levelId, nodes, polygon) {
|
|
|
274
304
|
const context = resolveCoveringSlabContext(levelId, nodes);
|
|
275
305
|
if (!context)
|
|
276
306
|
return Number.POSITIVE_INFINITY;
|
|
277
|
-
let bound = context.
|
|
307
|
+
let bound = context.floorToFloorHeight;
|
|
278
308
|
if (polygon.length > 0) {
|
|
279
309
|
let cx = 0;
|
|
280
310
|
let cz = 0;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type NodePort } from '../registry';
|
|
1
2
|
import type { AnyNode, AnyNodeId } from '../schema';
|
|
2
3
|
export type SystemSummary = {
|
|
3
4
|
/** Every node in this connected component. */
|
|
@@ -14,6 +15,16 @@ export type SystemSummary = {
|
|
|
14
15
|
* handler / condenser anywhere in the component). */
|
|
15
16
|
connectedToEquipment: boolean;
|
|
16
17
|
};
|
|
18
|
+
export type SystemPort = {
|
|
19
|
+
port: NodePort;
|
|
20
|
+
nodeId: AnyNodeId;
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
z: number;
|
|
24
|
+
system: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
export declare function collectSystemPorts(nodes: Readonly<Record<AnyNodeId, AnyNode>>): SystemPort[];
|
|
27
|
+
export declare function distributionPointToWorld(node: AnyNode, point: readonly [number, number, number], nodes: Readonly<Record<AnyNodeId, AnyNode>>): [number, number, number];
|
|
17
28
|
/**
|
|
18
29
|
* Group every port-bearing node into connected components via coinciding
|
|
19
30
|
* ports. Nodes with ports but no joints form singleton components; nodes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"system-graph.d.ts","sourceRoot":"","sources":["../../src/services/system-graph.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"system-graph.d.ts","sour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AC,GAAG,SAAS,EAAE,EAAE,CA6B9F;AAkDD;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,GAC1C,aAAa,GAAG,IAAI,CAStB"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { nodeRegistry } from '../registry';
|
|
2
|
+
import { getLevelElevations } from './storey';
|
|
2
3
|
/**
|
|
3
4
|
* The "System" primitive: connected components over the port graph.
|
|
4
5
|
*
|
|
@@ -15,7 +16,7 @@ import { nodeRegistry } from '../registry';
|
|
|
15
16
|
/** Distance (meters) under which two ports count as the same joint —
|
|
16
17
|
* matches port-connectivity's tolerance for hand-placed joints. */
|
|
17
18
|
const COINCIDENT_EPS_M = 0.05;
|
|
18
|
-
function
|
|
19
|
+
export function collectSystemPorts(nodes) {
|
|
19
20
|
const result = [];
|
|
20
21
|
for (const node of Object.values(nodes)) {
|
|
21
22
|
if (!node)
|
|
@@ -24,17 +25,44 @@ function collectPorts(nodes) {
|
|
|
24
25
|
if (!ports)
|
|
25
26
|
continue;
|
|
26
27
|
for (const port of ports) {
|
|
28
|
+
const [x, y, z] = distributionPointToWorld(node, port.position, nodes);
|
|
27
29
|
result.push({
|
|
30
|
+
port,
|
|
28
31
|
nodeId: node.id,
|
|
29
|
-
x
|
|
30
|
-
y
|
|
31
|
-
z
|
|
32
|
+
x,
|
|
33
|
+
y,
|
|
34
|
+
z,
|
|
32
35
|
system: port.system,
|
|
33
36
|
});
|
|
34
37
|
}
|
|
35
38
|
}
|
|
36
39
|
return result;
|
|
37
40
|
}
|
|
41
|
+
export function distributionPointToWorld(node, point, nodes) {
|
|
42
|
+
const elevations = getLevelElevations(nodes);
|
|
43
|
+
let ancestor = node;
|
|
44
|
+
const visited = new Set();
|
|
45
|
+
while (ancestor && ancestor.type !== 'level' && !visited.has(ancestor.id)) {
|
|
46
|
+
visited.add(ancestor.id);
|
|
47
|
+
ancestor = ancestor.parentId ? nodes[ancestor.parentId] : undefined;
|
|
48
|
+
}
|
|
49
|
+
const elevation = ancestor?.type === 'level' ? elevations.get(ancestor.id) : undefined;
|
|
50
|
+
const building = elevation?.buildingId ? nodes[elevation.buildingId] : undefined;
|
|
51
|
+
let [x, y, z] = point;
|
|
52
|
+
y += elevation?.baseY ?? 0;
|
|
53
|
+
if (building?.type === 'building') {
|
|
54
|
+
const { position, rotation } = building;
|
|
55
|
+
const [rx, ry, rz] = rotation;
|
|
56
|
+
const zx = Math.cos(rz) * x - Math.sin(rz) * y;
|
|
57
|
+
const zy = Math.sin(rz) * x + Math.cos(rz) * y;
|
|
58
|
+
const yx = Math.cos(ry) * zx + Math.sin(ry) * z;
|
|
59
|
+
const yz = -Math.sin(ry) * zx + Math.cos(ry) * z;
|
|
60
|
+
x = yx + position[0];
|
|
61
|
+
y = Math.cos(rx) * zy - Math.sin(rx) * yz + position[1];
|
|
62
|
+
z = Math.sin(rx) * zy + Math.cos(rx) * yz + position[2];
|
|
63
|
+
}
|
|
64
|
+
return [x, y, z];
|
|
65
|
+
}
|
|
38
66
|
/** Union-find over node ids. */
|
|
39
67
|
class Components {
|
|
40
68
|
parent = new Map();
|
|
@@ -68,7 +96,7 @@ function pathLength(path) {
|
|
|
68
96
|
* without `def.ports` don't participate at all.
|
|
69
97
|
*/
|
|
70
98
|
export function buildPortComponents(nodes) {
|
|
71
|
-
const ports =
|
|
99
|
+
const ports = collectSystemPorts(nodes);
|
|
72
100
|
const components = new Components();
|
|
73
101
|
const epsSq = COINCIDENT_EPS_M * COINCIDENT_EPS_M;
|
|
74
102
|
for (let i = 0; i < ports.length; i++) {
|
|
@@ -77,6 +105,8 @@ export function buildPortComponents(nodes) {
|
|
|
77
105
|
const b = ports[j];
|
|
78
106
|
if (a.nodeId === b.nodeId)
|
|
79
107
|
continue;
|
|
108
|
+
if (a.system && b.system && a.system !== b.system)
|
|
109
|
+
continue;
|
|
80
110
|
const dx = a.x - b.x;
|
|
81
111
|
const dy = a.y - b.y;
|
|
82
112
|
const dz = a.z - b.z;
|
|
@@ -9,16 +9,27 @@ type NodeUpdateOp = {
|
|
|
9
9
|
data: Partial<AnyNode>;
|
|
10
10
|
};
|
|
11
11
|
type NodeDeleteOp = AnyNodeId;
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
type NumericSanitizeIssue = {
|
|
13
|
+
path: PropertyKey[];
|
|
14
|
+
from: number;
|
|
15
|
+
to?: number;
|
|
16
|
+
action: 'clamped' | 'dropped' | 'rounded';
|
|
17
|
+
};
|
|
18
|
+
export declare function numericSanitizeIssuesToMessage(issues: NumericSanitizeIssue[] | null | undefined): string;
|
|
19
|
+
declare const createNodesActionImpl: (set: (fn: (state: SceneState) => Partial<SceneState>) => void, get: () => SceneState, ops: NodeCreateOp[]) => void;
|
|
20
|
+
declare const applyNodeChangesActionImpl: (set: (fn: (state: SceneState) => Partial<SceneState>) => void, get: () => SceneState, changes: {
|
|
14
21
|
create?: NodeCreateOp[];
|
|
15
22
|
update?: NodeUpdateOp[];
|
|
16
23
|
delete?: NodeDeleteOp[];
|
|
17
24
|
}) => void;
|
|
18
|
-
|
|
25
|
+
declare const updateNodesActionImpl: (set: (fn: (state: SceneState) => Partial<SceneState>) => void, get: () => SceneState, updates: {
|
|
19
26
|
id: AnyNodeId;
|
|
20
27
|
data: Partial<AnyNode>;
|
|
21
28
|
}[]) => void;
|
|
22
|
-
|
|
29
|
+
declare const deleteNodesActionImpl: (set: (fn: (state: SceneState) => Partial<SceneState>) => void, get: () => SceneState, ids: AnyNodeId[]) => void;
|
|
30
|
+
export declare const createNodesAction: (set: Parameters<typeof createNodesActionImpl>[0], get: Parameters<typeof createNodesActionImpl>[1], ops: NodeCreateOp[]) => void;
|
|
31
|
+
export declare const applyNodeChangesAction: (set: Parameters<typeof applyNodeChangesActionImpl>[0], get: Parameters<typeof applyNodeChangesActionImpl>[1], changes: Parameters<typeof applyNodeChangesActionImpl>[2]) => void;
|
|
32
|
+
export declare const updateNodesAction: (set: Parameters<typeof updateNodesActionImpl>[0], get: Parameters<typeof updateNodesActionImpl>[1], updates: Parameters<typeof updateNodesActionImpl>[2]) => void;
|
|
33
|
+
export declare const deleteNodesAction: (set: Parameters<typeof deleteNodesActionImpl>[0], get: Parameters<typeof deleteNodesActionImpl>[1], ids: AnyNodeId[]) => void;
|
|
23
34
|
export {};
|
|
24
35
|
//# sourceMappingURL=node-actions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node-actions.d.ts","sourceRoot":"","sources":["../../../src/store/actions/node-actions.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"node-actions.d.ts","sourceRoot":"","sources":["../../../src/store/actions/node-actions.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,OAAO,EACZ,KAAK,SAAS,EAwBf,MAAM,cAAc,CAAA;AAIrB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAG9C,KAAK,YAAY,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,SAAS,CAAA;CAAE,CAAA;AAC3D,KAAK,YAAY,GAAG;IAAE,EAAE,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;CAAE,CAAA;AAC7D,KAAK,YAAY,GAAG,SAAS,CAAA;AA4F7B,KAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,WAAW,EAAE,CAAA;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;CAC1C,CAAA;AAsWD,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,oBAAoB,EAAE,GAAG,IAAI,GAAG,SAAS,GAChD,MAAM,CAgBR;AAmrBD,QAAA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