@pascal-app/core 0.5.1 → 0.7.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/dist/events/bus.d.ts +74 -4
- package/dist/events/bus.d.ts.map +1 -1
- package/dist/events/bus.js +1 -1
- package/dist/hooks/scene-registry/scene-registry.d.ts +2 -0
- package/dist/hooks/scene-registry/scene-registry.d.ts.map +1 -1
- package/dist/hooks/scene-registry/scene-registry.js +2 -0
- package/dist/hooks/spatial-grid/spatial-grid-manager.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/spatial-grid-manager.js +164 -6
- package/dist/hooks/spatial-grid/spatial-grid.d.ts +2 -0
- package/dist/hooks/spatial-grid/spatial-grid.d.ts.map +1 -1
- package/dist/hooks/spatial-grid/spatial-grid.js +43 -20
- package/dist/index.d.ts +9 -13
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -11
- package/dist/lib/door-operation.d.ts +7 -0
- package/dist/lib/door-operation.d.ts.map +1 -0
- package/dist/lib/door-operation.js +25 -0
- package/dist/lib/polygon-geometry.d.ts +3 -0
- package/dist/lib/polygon-geometry.d.ts.map +1 -0
- package/dist/lib/polygon-geometry.js +90 -0
- package/dist/lib/slab-polygon.d.ts +3 -0
- package/dist/lib/slab-polygon.d.ts.map +1 -0
- package/dist/lib/slab-polygon.js +58 -0
- package/dist/lib/space-detection.d.ts +10 -17
- package/dist/lib/space-detection.d.ts.map +1 -1
- package/dist/lib/space-detection.js +666 -453
- package/dist/material-library.d.ts +20 -0
- package/dist/material-library.d.ts.map +1 -0
- package/dist/material-library.js +580 -0
- package/dist/schema/asset-url.d.ts +34 -0
- package/dist/schema/asset-url.d.ts.map +1 -0
- package/dist/schema/asset-url.js +79 -0
- package/dist/schema/asset-url.test.d.ts +2 -0
- package/dist/schema/asset-url.test.d.ts.map +1 -0
- package/dist/schema/asset-url.test.js +138 -0
- package/dist/schema/index.d.ts +14 -7
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +10 -7
- package/dist/schema/material.d.ts +112 -2
- package/dist/schema/material.d.ts.map +1 -1
- package/dist/schema/material.js +55 -1
- package/dist/schema/nodes/ceiling.d.ts +11 -1
- package/dist/schema/nodes/ceiling.d.ts.map +1 -1
- package/dist/schema/nodes/ceiling.js +6 -0
- package/dist/schema/nodes/column.d.ts +520 -0
- package/dist/schema/nodes/column.d.ts.map +1 -0
- package/dist/schema/nodes/column.js +385 -0
- package/dist/schema/nodes/door.d.ts +74 -1
- package/dist/schema/nodes/door.d.ts.map +1 -1
- package/dist/schema/nodes/door.js +39 -2
- package/dist/schema/nodes/fence.d.ts +34 -0
- package/dist/schema/nodes/fence.d.ts.map +1 -1
- package/dist/schema/nodes/fence.js +5 -0
- package/dist/schema/nodes/guide.d.ts +17 -0
- package/dist/schema/nodes/guide.d.ts.map +1 -1
- package/dist/schema/nodes/guide.js +11 -1
- package/dist/schema/nodes/item.d.ts +10 -2
- package/dist/schema/nodes/item.d.ts.map +1 -1
- package/dist/schema/nodes/item.js +18 -1
- package/dist/schema/nodes/level.d.ts +1 -1
- package/dist/schema/nodes/level.d.ts.map +1 -1
- package/dist/schema/nodes/level.js +6 -0
- package/dist/schema/nodes/roof-segment.d.ts +3 -1
- package/dist/schema/nodes/roof-segment.d.ts.map +1 -1
- package/dist/schema/nodes/roof-segment.js +1 -0
- package/dist/schema/nodes/roof.d.ts +108 -0
- package/dist/schema/nodes/roof.d.ts.map +1 -1
- package/dist/schema/nodes/roof.js +58 -2
- package/dist/schema/nodes/scan.d.ts.map +1 -1
- package/dist/schema/nodes/scan.js +2 -1
- package/dist/schema/nodes/site.d.ts +2 -1
- package/dist/schema/nodes/site.d.ts.map +1 -1
- package/dist/schema/nodes/slab.d.ts +11 -1
- package/dist/schema/nodes/slab.d.ts.map +1 -1
- package/dist/schema/nodes/slab.js +7 -0
- package/dist/schema/nodes/spawn.d.ts +24 -0
- package/dist/schema/nodes/spawn.d.ts.map +1 -0
- package/dist/schema/nodes/spawn.js +8 -0
- package/dist/schema/nodes/stair-segment.d.ts +3 -1
- package/dist/schema/nodes/stair-segment.d.ts.map +1 -1
- package/dist/schema/nodes/stair-segment.js +1 -0
- package/dist/schema/nodes/stair.d.ts +122 -2
- package/dist/schema/nodes/stair.d.ts.map +1 -1
- package/dist/schema/nodes/stair.js +72 -2
- package/dist/schema/nodes/surface-hole-metadata.d.ts +10 -0
- package/dist/schema/nodes/surface-hole-metadata.d.ts.map +1 -0
- package/dist/schema/nodes/surface-hole-metadata.js +5 -0
- package/dist/schema/nodes/wall.d.ts +87 -1
- package/dist/schema/nodes/wall.d.ts.map +1 -1
- package/dist/schema/nodes/wall.js +45 -4
- package/dist/schema/nodes/window.d.ts +57 -1
- package/dist/schema/nodes/window.d.ts.map +1 -1
- package/dist/schema/nodes/window.js +29 -0
- package/dist/schema/types.d.ts +653 -12
- package/dist/schema/types.d.ts.map +1 -1
- package/dist/schema/types.js +4 -0
- package/dist/store/actions/node-actions.d.ts +1 -1
- package/dist/store/actions/node-actions.d.ts.map +1 -1
- package/dist/store/actions/node-actions.js +181 -5
- package/dist/store/history-control.d.ts +14 -0
- package/dist/store/history-control.d.ts.map +1 -0
- package/dist/store/history-control.js +22 -0
- package/dist/store/use-interactive.d.ts +43 -0
- package/dist/store/use-interactive.d.ts.map +1 -1
- package/dist/store/use-interactive.js +66 -0
- package/dist/store/use-scene.d.ts.map +1 -1
- package/dist/store/use-scene.js +307 -3
- package/dist/systems/ceiling/ceiling-system.d.ts.map +1 -1
- package/dist/systems/ceiling/ceiling-system.js +7 -0
- package/dist/systems/fence/fence-system.d.ts.map +1 -1
- package/dist/systems/fence/fence-system.js +106 -39
- package/dist/systems/roof/roof-system.d.ts.map +1 -1
- package/dist/systems/roof/roof-system.js +31 -1
- package/dist/systems/slab/slab-system.d.ts.map +1 -1
- package/dist/systems/slab/slab-system.js +45 -8
- package/dist/systems/stair/stair-opening-sync.d.ts +6 -0
- package/dist/systems/stair/stair-opening-sync.d.ts.map +1 -0
- package/dist/systems/stair/stair-opening-sync.js +576 -0
- package/dist/systems/stair/stair-opening-sync.test.d.ts +2 -0
- package/dist/systems/stair/stair-opening-sync.test.d.ts.map +1 -0
- package/dist/systems/stair/stair-opening-sync.test.js +65 -0
- package/dist/systems/stair/stair-system.d.ts.map +1 -1
- package/dist/systems/stair/stair-system.js +119 -2
- package/dist/systems/wall/wall-curve.d.ts +43 -0
- package/dist/systems/wall/wall-curve.d.ts.map +1 -0
- package/dist/systems/wall/wall-curve.js +176 -0
- package/dist/systems/wall/wall-footprint.d.ts.map +1 -1
- package/dist/systems/wall/wall-footprint.js +16 -2
- package/dist/systems/wall/wall-mitering.d.ts +7 -0
- package/dist/systems/wall/wall-mitering.d.ts.map +1 -1
- package/dist/systems/wall/wall-mitering.js +76 -3
- package/dist/systems/wall/wall-system.d.ts.map +1 -1
- package/dist/systems/wall/wall-system.js +202 -2
- package/package.json +33 -5
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DoorNode, DoorType } from '../schema/nodes/door';
|
|
2
|
+
export declare const SECTIONAL_GARAGE_RENDER_OPEN_SCALE = 0.88;
|
|
3
|
+
export declare function clampDoorOperationState(value: number | undefined): number;
|
|
4
|
+
export declare function isOperationDoorType(doorType: DoorType | DoorNode['doorType'] | string | undefined): doorType is "folding" | "pocket" | "barn" | "sliding" | "garage-sectional" | "garage-rollup" | "garage-tiltup";
|
|
5
|
+
export declare function getDoorRenderOpenAmount(doorType: DoorType | DoorNode['doorType'], operationState: number | undefined): number;
|
|
6
|
+
export declare function getGarageVisibleOpeningRatio(doorType: DoorType | DoorNode['doorType'], operationState: number | undefined): number;
|
|
7
|
+
//# sourceMappingURL=door-operation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"door-operation.d.ts","sourceRoot":"","sources":["../../src/lib/door-operation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE9D,eAAO,MAAM,kCAAkC,OAAO,CAAA;AAEtD,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,UAEhE;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,SAAS,kHAW/D;AAED,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,EACzC,cAAc,EAAE,MAAM,GAAG,SAAS,UAMnC;AAED,wBAAgB,4BAA4B,CAC1C,QAAQ,EAAE,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,EACzC,cAAc,EAAE,MAAM,GAAG,SAAS,UAOnC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const SECTIONAL_GARAGE_RENDER_OPEN_SCALE = 0.88;
|
|
2
|
+
export function clampDoorOperationState(value) {
|
|
3
|
+
return Math.max(0, Math.min(1, value ?? 0));
|
|
4
|
+
}
|
|
5
|
+
export function isOperationDoorType(doorType) {
|
|
6
|
+
return (doorType === 'folding' ||
|
|
7
|
+
doorType === 'pocket' ||
|
|
8
|
+
doorType === 'barn' ||
|
|
9
|
+
doorType === 'sliding' ||
|
|
10
|
+
doorType === 'garage-sectional' ||
|
|
11
|
+
doorType === 'garage-rollup' ||
|
|
12
|
+
doorType === 'garage-tiltup');
|
|
13
|
+
}
|
|
14
|
+
export function getDoorRenderOpenAmount(doorType, operationState) {
|
|
15
|
+
const openAmount = clampDoorOperationState(operationState);
|
|
16
|
+
return doorType === 'garage-sectional'
|
|
17
|
+
? openAmount * SECTIONAL_GARAGE_RENDER_OPEN_SCALE
|
|
18
|
+
: openAmount;
|
|
19
|
+
}
|
|
20
|
+
export function getGarageVisibleOpeningRatio(doorType, operationState) {
|
|
21
|
+
if (doorType === 'garage-sectional') {
|
|
22
|
+
return Math.min(1, clampDoorOperationState(operationState) / SECTIONAL_GARAGE_RENDER_OPEN_SCALE);
|
|
23
|
+
}
|
|
24
|
+
return clampDoorOperationState(operationState);
|
|
25
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare function insetPolygonFromCentroid(polygon: Array<[number, number]>, inset: number): Array<[number, number]>;
|
|
2
|
+
export declare function simplifyClosedPolygon(polygon: Array<[number, number]>, tolerance: number): Array<[number, number]>;
|
|
3
|
+
//# sourceMappingURL=polygon-geometry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polygon-geometry.d.ts","sourceRoot":"","sources":["../../src/lib/polygon-geometry.ts"],"names":[],"mappings":"AAAA,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAChC,KAAK,EAAE,MAAM,GACZ,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAuBzB;AAuED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,EAChC,SAAS,EAAE,MAAM,GAChB,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAiCzB"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
export function insetPolygonFromCentroid(polygon, inset) {
|
|
2
|
+
if (inset <= 0) {
|
|
3
|
+
return polygon.map(([x, z]) => [x, z]);
|
|
4
|
+
}
|
|
5
|
+
const centroid = polygon.reduce((acc, [x, z]) => ({ x: acc.x + x, z: acc.z + z }), { x: 0, z: 0 });
|
|
6
|
+
centroid.x /= Math.max(polygon.length, 1);
|
|
7
|
+
centroid.z /= Math.max(polygon.length, 1);
|
|
8
|
+
return polygon.map(([x, z]) => {
|
|
9
|
+
const dx = x - centroid.x;
|
|
10
|
+
const dz = z - centroid.z;
|
|
11
|
+
const length = Math.hypot(dx, dz);
|
|
12
|
+
if (length <= inset + 1e-6) {
|
|
13
|
+
return [x, z];
|
|
14
|
+
}
|
|
15
|
+
const scale = (length - inset) / length;
|
|
16
|
+
return [centroid.x + dx * scale, centroid.z + dz * scale];
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function pointLineDistance(point, start, end) {
|
|
20
|
+
const dx = end[0] - start[0];
|
|
21
|
+
const dz = end[1] - start[1];
|
|
22
|
+
const lengthSquared = dx * dx + dz * dz;
|
|
23
|
+
if (lengthSquared < 1e-9) {
|
|
24
|
+
return Math.hypot(point[0] - start[0], point[1] - start[1]);
|
|
25
|
+
}
|
|
26
|
+
const cross = (point[0] - start[0]) * dz - (point[1] - start[1]) * dx;
|
|
27
|
+
return Math.abs(cross) / Math.sqrt(lengthSquared);
|
|
28
|
+
}
|
|
29
|
+
function dedupePolygonPoints(polygon, tolerance = 1e-6) {
|
|
30
|
+
const deduped = [];
|
|
31
|
+
for (const point of polygon) {
|
|
32
|
+
const previous = deduped[deduped.length - 1];
|
|
33
|
+
if (previous && Math.hypot(point[0] - previous[0], point[1] - previous[1]) <= tolerance) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
deduped.push(point);
|
|
37
|
+
}
|
|
38
|
+
if (deduped.length > 2 &&
|
|
39
|
+
Math.hypot(deduped[0][0] - deduped[deduped.length - 1][0], deduped[0][1] - deduped[deduped.length - 1][1]) <= tolerance) {
|
|
40
|
+
deduped.pop();
|
|
41
|
+
}
|
|
42
|
+
return deduped;
|
|
43
|
+
}
|
|
44
|
+
function simplifyPolyline(points, tolerance) {
|
|
45
|
+
if (points.length <= 2) {
|
|
46
|
+
return points.map(([x, z]) => [x, z]);
|
|
47
|
+
}
|
|
48
|
+
let maxDistance = -1;
|
|
49
|
+
let splitIndex = -1;
|
|
50
|
+
for (let index = 1; index < points.length - 1; index += 1) {
|
|
51
|
+
const distance = pointLineDistance(points[index], points[0], points[points.length - 1]);
|
|
52
|
+
if (distance > maxDistance) {
|
|
53
|
+
maxDistance = distance;
|
|
54
|
+
splitIndex = index;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
if (maxDistance <= tolerance || splitIndex === -1) {
|
|
58
|
+
return [points[0], points[points.length - 1]];
|
|
59
|
+
}
|
|
60
|
+
const left = simplifyPolyline(points.slice(0, splitIndex + 1), tolerance);
|
|
61
|
+
const right = simplifyPolyline(points.slice(splitIndex), tolerance);
|
|
62
|
+
return [...left.slice(0, -1), ...right];
|
|
63
|
+
}
|
|
64
|
+
export function simplifyClosedPolygon(polygon, tolerance) {
|
|
65
|
+
const cleanPolygon = dedupePolygonPoints(polygon);
|
|
66
|
+
if (cleanPolygon.length <= 3 || tolerance <= 0) {
|
|
67
|
+
return cleanPolygon;
|
|
68
|
+
}
|
|
69
|
+
let anchorA = 0;
|
|
70
|
+
let anchorB = Math.floor(cleanPolygon.length / 2);
|
|
71
|
+
let maxDistanceSquared = -1;
|
|
72
|
+
for (let i = 0; i < cleanPolygon.length; i += 1) {
|
|
73
|
+
for (let j = i + 1; j < cleanPolygon.length; j += 1) {
|
|
74
|
+
const dx = cleanPolygon[j][0] - cleanPolygon[i][0];
|
|
75
|
+
const dz = cleanPolygon[j][1] - cleanPolygon[i][1];
|
|
76
|
+
const distanceSquared = dx * dx + dz * dz;
|
|
77
|
+
if (distanceSquared > maxDistanceSquared) {
|
|
78
|
+
maxDistanceSquared = distanceSquared;
|
|
79
|
+
anchorA = i;
|
|
80
|
+
anchorB = j;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
const forward = cleanPolygon.slice(anchorA, anchorB + 1);
|
|
85
|
+
const wrapped = [...cleanPolygon.slice(anchorB), ...cleanPolygon.slice(0, anchorA + 1)];
|
|
86
|
+
const simplifiedForward = simplifyPolyline(forward, tolerance);
|
|
87
|
+
const simplifiedWrapped = simplifyPolyline(wrapped, tolerance);
|
|
88
|
+
const simplified = dedupePolygonPoints([...simplifiedForward.slice(0, -1), ...simplifiedWrapped.slice(0, -1)], tolerance * 0.25);
|
|
89
|
+
return simplified.length >= 3 ? simplified : cleanPolygon;
|
|
90
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"slab-polygon.d.ts","sourceRoot":"","sources":["../../src/lib/slab-polygon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAA;AAQzC,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,QAAQ,GAAG,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAOpF"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { insetPolygonFromCentroid, simplifyClosedPolygon } from './polygon-geometry';
|
|
2
|
+
/** Half of default wall thickness — used to extend slab geometry under walls */
|
|
3
|
+
const SLAB_OUTSET = 0.05;
|
|
4
|
+
const AUTO_SLAB_INSET = 0.02;
|
|
5
|
+
const AUTO_SLAB_SIMPLIFY_TOLERANCE = 0.08;
|
|
6
|
+
export function getRenderableSlabPolygon(slabNode) {
|
|
7
|
+
return slabNode.autoFromWalls
|
|
8
|
+
? simplifyClosedPolygon(insetPolygonFromCentroid(slabNode.polygon, AUTO_SLAB_INSET), AUTO_SLAB_SIMPLIFY_TOLERANCE)
|
|
9
|
+
: outsetPolygon(slabNode.polygon, SLAB_OUTSET);
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Expand a polygon outward by a uniform distance.
|
|
13
|
+
* Offsets each edge outward then intersects consecutive offset edges.
|
|
14
|
+
*/
|
|
15
|
+
function outsetPolygon(polygon, amount) {
|
|
16
|
+
const n = polygon.length;
|
|
17
|
+
if (n < 3)
|
|
18
|
+
return polygon;
|
|
19
|
+
// Determine winding via signed area
|
|
20
|
+
let area2 = 0;
|
|
21
|
+
for (let i = 0; i < n; i++) {
|
|
22
|
+
const j = (i + 1) % n;
|
|
23
|
+
area2 += polygon[i][0] * polygon[j][1] - polygon[j][0] * polygon[i][1];
|
|
24
|
+
}
|
|
25
|
+
const s = area2 >= 0 ? 1 : -1;
|
|
26
|
+
// Offset each edge outward by amount
|
|
27
|
+
const offEdges = [];
|
|
28
|
+
for (let i = 0; i < n; i++) {
|
|
29
|
+
const j = (i + 1) % n;
|
|
30
|
+
const dx = polygon[j][0] - polygon[i][0];
|
|
31
|
+
const dz = polygon[j][1] - polygon[i][1];
|
|
32
|
+
const len = Math.sqrt(dx * dx + dz * dz);
|
|
33
|
+
if (len < 1e-9) {
|
|
34
|
+
offEdges.push([polygon[i][0], polygon[i][1], dx, dz]);
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
const nx = ((s * dz) / len) * amount;
|
|
38
|
+
const nz = ((s * -dx) / len) * amount;
|
|
39
|
+
offEdges.push([polygon[i][0] + nx, polygon[i][1] + nz, dx, dz]);
|
|
40
|
+
}
|
|
41
|
+
// Intersect consecutive offset edges to get new vertices
|
|
42
|
+
const result = [];
|
|
43
|
+
for (let i = 0; i < n; i++) {
|
|
44
|
+
const j = (i + 1) % n;
|
|
45
|
+
const [ax, az, adx, adz] = offEdges[i];
|
|
46
|
+
const [bx, bz, bdx, bdz] = offEdges[j];
|
|
47
|
+
const denom = adx * bdz - adz * bdx;
|
|
48
|
+
if (Math.abs(denom) < 1e-9) {
|
|
49
|
+
// Parallel edges — use offset endpoint
|
|
50
|
+
result.push([ax + adx, az + adz]);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
const t = ((bx - ax) * bdz - (bz - az) * bdx) / denom;
|
|
54
|
+
result.push([ax + t * adx, az + t * adz]);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return result;
|
|
58
|
+
}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type WallNode } from '../schema';
|
|
2
|
+
type Point2D = {
|
|
3
|
+
x: number;
|
|
4
|
+
y: number;
|
|
5
|
+
};
|
|
2
6
|
export type Space = {
|
|
3
7
|
id: string;
|
|
4
8
|
levelId: string;
|
|
@@ -6,29 +10,18 @@ export type Space = {
|
|
|
6
10
|
wallIds: string[];
|
|
7
11
|
isExterior: boolean;
|
|
8
12
|
};
|
|
9
|
-
/**
|
|
10
|
-
* Initializes space detection sync with scene and editor stores
|
|
11
|
-
* Call this once during app initialization
|
|
12
|
-
*/
|
|
13
|
-
export declare function initSpaceDetectionSync(sceneStore: any, // useScene store
|
|
14
|
-
editorStore: any): () => void;
|
|
15
13
|
type WallSideUpdate = {
|
|
16
14
|
wallId: string;
|
|
17
15
|
frontSide: 'interior' | 'exterior' | 'unknown';
|
|
18
16
|
backSide: 'interior' | 'exterior' | 'unknown';
|
|
19
17
|
};
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
*/
|
|
24
|
-
export declare function detectSpacesForLevel(levelId: string, walls: WallNode[], gridResolution?: number): {
|
|
25
|
-
wallUpdates: WallSideUpdate[];
|
|
18
|
+
export declare function resolveWallSurfaceSides(wall: Pick<WallNode, 'start' | 'end' | 'thickness' | 'frontSide' | 'backSide'>, roomPolygons: Point2D[][]): Pick<WallSideUpdate, 'frontSide' | 'backSide'>;
|
|
19
|
+
export declare function detectSpacesForLevel(levelId: string, walls: WallNode[]): {
|
|
20
|
+
roomPolygons: Point2D[][];
|
|
26
21
|
spaces: Space[];
|
|
22
|
+
wallUpdates: WallSideUpdate[];
|
|
27
23
|
};
|
|
28
|
-
|
|
29
|
-
* Checks if a wall touches any other walls
|
|
30
|
-
* Used to determine if space detection should run
|
|
31
|
-
*/
|
|
24
|
+
export declare function initSpaceDetectionSync(sceneStore: any, editorStore: any): () => void;
|
|
32
25
|
export declare function wallTouchesOthers(wall: WallNode, otherWalls: WallNode[]): boolean;
|
|
33
26
|
export {};
|
|
34
27
|
//# sourceMappingURL=space-detection.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"space-detection.d.ts","sourceRoot":"","sources":["../../src/lib/space-detection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"space-detection.d.ts","sourceRoot":"","sources":["../../src/lib/space-detection.ts"],"names":[],"mappings":"AAKA,OAAO,EAA6F,KAAK,QAAQ,EAAE,MAAM,WAAW,CAAA;AAQpI,KAAK,OAAO,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,CAAA;AAEvC,MAAM,MAAM,KAAK,GAAG;IAClB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAA;IAChC,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED,KAAK,cAAc,GAAG;IACpB,MAAM,EAAE,MAAM,CAAA;IACd,SAAS,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,CAAA;IAC9C,QAAQ,EAAE,UAAU,GAAG,UAAU,GAAG,SAAS,CAAA;CAC9C,CAAA;AA4VD,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE,OAAO,GAAG,KAAK,GAAG,WAAW,GAAG,WAAW,GAAG,UAAU,CAAC,EAC9E,YAAY,EAAE,OAAO,EAAE,EAAE,GACxB,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,UAAU,CAAC,CA4ChD;AA0WD,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE;;;;EAEtE;AAsED,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,GAAG,EAAE,WAAW,EAAE,GAAG,GAAG,MAAM,IAAI,CAuDpF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,OAAO,CAiBjF"}
|