@kruschdev/pascal-mep-kernel 0.1.0 → 0.1.1
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/README.md +66 -9
- package/dist/anatomy/footprint.d.ts +4 -0
- package/dist/anatomy/index.d.ts +8 -2
- package/dist/anatomy/index.js +2 -2
- package/dist/anatomy/levels.d.ts +6 -2
- package/dist/anatomy/roof.d.ts +6 -2
- package/dist/{chunk-sab5aaa6.js → chunk-92mknkfa.js} +149 -97
- package/dist/{chunk-2e23cyn0.js → chunk-kmtew7g8.js} +411 -164
- package/dist/{chunk-0w98adg9.js → chunk-q8cxxynd.js} +367 -120
- package/dist/{chunk-jfzqztgh.js → chunk-yd3hcm7n.js} +20 -3
- package/dist/index.js +4 -4
- package/dist/router/cavity-graph.d.ts +1 -1
- package/dist/router/index.js +3 -3
- package/dist/rules/index.js +2 -2
- package/dist/rules/schema.d.ts +6 -1
- package/dist/types.js +1 -1
- package/package.json +1 -1
|
@@ -43,6 +43,8 @@ function aabb3Intersects2(a, b) {
|
|
|
43
43
|
return a.minX <= b.maxX && a.maxX >= b.minX && a.minY <= b.maxY && a.maxY >= b.minY && a.minZ <= b.maxZ && a.maxZ >= b.minZ;
|
|
44
44
|
}
|
|
45
45
|
function segmentIntersectsAabb32(a, b, box, margin = 0, eps = 0.000001) {
|
|
46
|
+
if (!isVec32(a) || !isVec32(b) || !Number.isFinite(eps))
|
|
47
|
+
return false;
|
|
46
48
|
const [mx, my, mz] = typeof margin === "number" ? [margin, margin, margin] : margin;
|
|
47
49
|
const minX = box.minX - mx;
|
|
48
50
|
const maxX = box.maxX + mx;
|
|
@@ -50,6 +52,9 @@ function segmentIntersectsAabb32(a, b, box, margin = 0, eps = 0.000001) {
|
|
|
50
52
|
const maxY = box.maxY + my;
|
|
51
53
|
const minZ = box.minZ - mz;
|
|
52
54
|
const maxZ = box.maxZ + mz;
|
|
55
|
+
if (!Number.isFinite(minX) || !Number.isFinite(maxX) || !Number.isFinite(minY) || !Number.isFinite(maxY) || !Number.isFinite(minZ) || !Number.isFinite(maxZ) || minX > maxX || minY > maxY || minZ > maxZ) {
|
|
56
|
+
return false;
|
|
57
|
+
}
|
|
53
58
|
let tMin = 0;
|
|
54
59
|
let tMax = 1;
|
|
55
60
|
const axes = [
|
|
@@ -78,7 +83,18 @@ function segmentIntersectsAabb32(a, b, box, margin = 0, eps = 0.000001) {
|
|
|
78
83
|
return tMax >= -eps && tMin <= 1 + eps;
|
|
79
84
|
}
|
|
80
85
|
function createOrientedPrismY2(params) {
|
|
81
|
-
const { centerX, centerZ
|
|
86
|
+
const { centerX, centerZ } = params;
|
|
87
|
+
const lxMin = Math.min(params.lxMin, params.lxMax);
|
|
88
|
+
const lxMax = Math.max(params.lxMin, params.lxMax);
|
|
89
|
+
const lzMin = Math.min(params.lzMin, params.lzMax);
|
|
90
|
+
const lzMax = Math.max(params.lzMin, params.lzMax);
|
|
91
|
+
const yMin = Math.min(params.yMin, params.yMax);
|
|
92
|
+
const yMax = Math.max(params.yMin, params.yMax);
|
|
93
|
+
const rawCos = Number.isFinite(params.cos) ? params.cos : 1;
|
|
94
|
+
const rawSin = Number.isFinite(params.sin) ? params.sin : 0;
|
|
95
|
+
const rotLen = Math.hypot(rawCos, rawSin);
|
|
96
|
+
const cos = rotLen > 0.000000001 ? rawCos / rotLen : 1;
|
|
97
|
+
const sin = rotLen > 0.000000001 ? rawSin / rotLen : 0;
|
|
82
98
|
let minX = Number.POSITIVE_INFINITY;
|
|
83
99
|
let maxX = Number.NEGATIVE_INFINITY;
|
|
84
100
|
let minZ = Number.POSITIVE_INFINITY;
|
|
@@ -198,6 +214,7 @@ function polylineHorizontalLengthM2(path) {
|
|
|
198
214
|
}
|
|
199
215
|
return total;
|
|
200
216
|
}
|
|
217
|
+
var MIN_PATH_SEGMENT_LEN_M = 0.0001;
|
|
201
218
|
function countPathBendDegrees2(path) {
|
|
202
219
|
let total = 0;
|
|
203
220
|
let prevDir = null;
|
|
@@ -208,7 +225,7 @@ function countPathBendDegrees2(path) {
|
|
|
208
225
|
const dy = b[1] - a[1];
|
|
209
226
|
const dz = b[2] - a[2];
|
|
210
227
|
const len = Math.hypot(dx, dy, dz);
|
|
211
|
-
if (len <
|
|
228
|
+
if (len < MIN_PATH_SEGMENT_LEN_M)
|
|
212
229
|
continue;
|
|
213
230
|
const dir = [dx / len, dy / len, dz / len];
|
|
214
231
|
if (prevDir) {
|
|
@@ -232,7 +249,7 @@ function countPathElbows2(path) {
|
|
|
232
249
|
const dy = b[1] - a[1];
|
|
233
250
|
const dz = b[2] - a[2];
|
|
234
251
|
const len = Math.hypot(dx, dy, dz);
|
|
235
|
-
if (len <
|
|
252
|
+
if (len < MIN_PATH_SEGMENT_LEN_M)
|
|
236
253
|
continue;
|
|
237
254
|
const dir = [dx / len, dy / len, dz / len];
|
|
238
255
|
if (prevDir) {
|
package/dist/index.js
CHANGED
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
round22,
|
|
22
22
|
round32,
|
|
23
23
|
round42
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-yd3hcm7n.js";
|
|
25
25
|
import {
|
|
26
26
|
resolveNodeLevelId2,
|
|
27
27
|
belongsToLevel2,
|
|
@@ -81,19 +81,19 @@ import {
|
|
|
81
81
|
extractCanonicalRoofSegments2,
|
|
82
82
|
compileLevelRoofShell2,
|
|
83
83
|
compileBuildingAnatomy2
|
|
84
|
-
} from "./chunk-
|
|
84
|
+
} from "./chunk-kmtew7g8.js";
|
|
85
85
|
import {
|
|
86
86
|
compileLegalCavityGraph2,
|
|
87
87
|
findLegalWallRiserPier2,
|
|
88
88
|
routeInLegalCavities2
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-q8cxxynd.js";
|
|
90
90
|
import {
|
|
91
91
|
effectivePlacementThreshold2,
|
|
92
92
|
evaluatePlacementCandidate2,
|
|
93
93
|
filterLegalCandidates2,
|
|
94
94
|
evaluateDeclarativeRules2,
|
|
95
95
|
validateRuleTable2
|
|
96
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-92mknkfa.js";
|
|
97
97
|
export {
|
|
98
98
|
ELECTRICAL_CONDUIT_HALF_OD_M2 as ELECTRICAL_CONDUIT_HALF_OD_M,
|
|
99
99
|
FEET_TO_METERS2 as FEET_TO_METERS,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* `footprint` (`precedence: 'room-first'`) and strictly beneath `roofShell.roofEnvelopeY`.
|
|
17
17
|
* - Connects orthogonal neighbors (plus attic diagonals) ONLY when both `footprint.isSegmentInside`
|
|
18
18
|
* and `roofShell.isPathClearOfRoof` pass, eliminating courtyard bridging and roof pokes.
|
|
19
|
-
* 3. Under-Slab / Crawlspace Trench Layer (`under-slab`):
|
|
19
|
+
* 3. Under-Slab / Crawlspace Trench Layer (`under-slab` / `crawlspace`):
|
|
20
20
|
* - Emits interior-footprint vertices and orthogonal edges at `subFloorElevationM` (default `-0.35 m`),
|
|
21
21
|
* connected downward from solid wall riser piers.
|
|
22
22
|
*
|
package/dist/router/index.js
CHANGED
|
@@ -2,9 +2,9 @@ import {
|
|
|
2
2
|
compileLegalCavityGraph2,
|
|
3
3
|
findLegalWallRiserPier2,
|
|
4
4
|
routeInLegalCavities2
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import"../chunk-
|
|
7
|
-
import"../chunk-
|
|
5
|
+
} from "../chunk-q8cxxynd.js";
|
|
6
|
+
import"../chunk-kmtew7g8.js";
|
|
7
|
+
import"../chunk-yd3hcm7n.js";
|
|
8
8
|
export {
|
|
9
9
|
compileLegalCavityGraph2 as compileLegalCavityGraph,
|
|
10
10
|
findLegalWallRiserPier2 as findLegalWallRiserPier,
|
package/dist/rules/index.js
CHANGED
|
@@ -4,8 +4,8 @@ import {
|
|
|
4
4
|
filterLegalCandidates2,
|
|
5
5
|
evaluateDeclarativeRules2,
|
|
6
6
|
validateRuleTable2
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import"../chunk-
|
|
7
|
+
} from "../chunk-92mknkfa.js";
|
|
8
|
+
import"../chunk-yd3hcm7n.js";
|
|
9
9
|
export {
|
|
10
10
|
effectivePlacementThreshold2 as effectivePlacementThreshold,
|
|
11
11
|
evaluateDeclarativeRules2 as evaluateDeclarativeRules,
|
package/dist/rules/schema.d.ts
CHANGED
|
@@ -64,6 +64,11 @@ export type ElevationBandParams = {
|
|
|
64
64
|
readonly maxYM?: number;
|
|
65
65
|
readonly minAboveFloodRimM?: number;
|
|
66
66
|
readonly maxHandleHeightM?: number;
|
|
67
|
+
/**
|
|
68
|
+
* Signed vertical clearance below `roofSurfaceYM` (`y <= roofSurfaceYM - effRoofMargin`).
|
|
69
|
+
* Positive values require clearance below the roof surface; negative values express an
|
|
70
|
+
* audit tolerance above the roof plane (paired with `placementMarginM >= 0` for stricter placement).
|
|
71
|
+
*/
|
|
67
72
|
readonly roofMarginM?: number;
|
|
68
73
|
readonly atticThresholdOffsetM?: number;
|
|
69
74
|
};
|
|
@@ -223,5 +228,5 @@ export type RuleEvaluationSummary = {
|
|
|
223
228
|
};
|
|
224
229
|
export type RuleTableValidationResult = {
|
|
225
230
|
readonly valid: boolean;
|
|
226
|
-
readonly errors: string[];
|
|
231
|
+
readonly errors: readonly string[];
|
|
227
232
|
};
|
package/dist/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kruschdev/pascal-mep-kernel",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Shared zero-dependency 3-layer spatial anatomy, legal-cavity MEP routing graph, and single-source declarative code constraint engine for Pascal Editor plugins.",
|
|
5
5
|
"author": "Kevin Ruschman <kruschdev@users.noreply.github.com>",
|
|
6
6
|
"license": "MIT",
|