@ifc-lite/clash 1.6.8 → 1.8.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/adapters/step.d.ts.map +1 -1
- package/dist/adapters/step.js +19 -2
- package/dist/adapters/step.js.map +1 -1
- package/dist/analysis.d.ts +37 -1
- package/dist/analysis.d.ts.map +1 -1
- package/dist/analysis.js +39 -0
- package/dist/analysis.js.map +1 -1
- package/dist/contact/narrow-phase.d.ts +6 -1
- package/dist/contact/narrow-phase.d.ts.map +1 -1
- package/dist/contact/narrow-phase.js +65 -1
- package/dist/contact/narrow-phase.js.map +1 -1
- package/dist/contact/shared-faces.d.ts +5 -1
- package/dist/contact/shared-faces.d.ts.map +1 -1
- package/dist/contact/shared-faces.js +49 -1
- package/dist/contact/shared-faces.js.map +1 -1
- package/dist/contact/tri-tri.d.ts +33 -4
- package/dist/contact/tri-tri.d.ts.map +1 -1
- package/dist/contact/tri-tri.js +37 -11
- package/dist/contact/tri-tri.js.map +1 -1
- package/dist/duplicate-metric.d.ts +74 -0
- package/dist/duplicate-metric.d.ts.map +1 -0
- package/dist/duplicate-metric.js +117 -0
- package/dist/duplicate-metric.js.map +1 -0
- package/dist/duplicate-sets.d.ts +47 -0
- package/dist/duplicate-sets.d.ts.map +1 -0
- package/dist/duplicate-sets.js +124 -0
- package/dist/duplicate-sets.js.map +1 -0
- package/dist/duplicates.d.ts +99 -11
- package/dist/duplicates.d.ts.map +1 -1
- package/dist/duplicates.js +270 -76
- package/dist/duplicates.js.map +1 -1
- package/dist/engine-ts/depth.d.ts +99 -0
- package/dist/engine-ts/depth.d.ts.map +1 -0
- package/dist/engine-ts/depth.js +172 -0
- package/dist/engine-ts/depth.js.map +1 -0
- package/dist/engine-ts/kernel.d.ts +3 -1
- package/dist/engine-ts/kernel.d.ts.map +1 -1
- package/dist/engine-ts/narrow.d.ts +7 -1
- package/dist/engine-ts/narrow.d.ts.map +1 -1
- package/dist/engine-ts/narrow.js +53 -95
- package/dist/engine-ts/narrow.js.map +1 -1
- package/dist/engine-ts/obb.d.ts +116 -0
- package/dist/engine-ts/obb.d.ts.map +1 -0
- package/dist/engine-ts/obb.js +331 -0
- package/dist/engine-ts/obb.js.map +1 -0
- package/dist/engine-ts/orchestrator.d.ts.map +1 -1
- package/dist/engine-ts/orchestrator.js +10 -13
- package/dist/engine-ts/orchestrator.js.map +1 -1
- package/dist/engine-ts/tri-mesh.d.ts +84 -22
- package/dist/engine-ts/tri-mesh.d.ts.map +1 -1
- package/dist/engine-ts/tri-mesh.js +151 -48
- package/dist/engine-ts/tri-mesh.js.map +1 -1
- package/dist/engine-ts/ts-kernel.d.ts.map +1 -1
- package/dist/engine-ts/ts-kernel.js +1 -0
- package/dist/engine-ts/ts-kernel.js.map +1 -1
- package/dist/engine-wasm/wasm-kernel.d.ts.map +1 -1
- package/dist/engine-wasm/wasm-kernel.js +7 -0
- package/dist/engine-wasm/wasm-kernel.js.map +1 -1
- package/dist/grouping.d.ts +4 -0
- package/dist/grouping.d.ts.map +1 -1
- package/dist/grouping.js +18 -43
- package/dist/grouping.js.map +1 -1
- package/dist/index.d.ts +12 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +12 -2
- package/dist/index.js.map +1 -1
- package/dist/math/aabb.d.ts +10 -1
- package/dist/math/aabb.d.ts.map +1 -1
- package/dist/math/aabb.js +33 -13
- package/dist/math/aabb.js.map +1 -1
- package/dist/shape-signature.d.ts +41 -0
- package/dist/shape-signature.d.ts.map +1 -0
- package/dist/shape-signature.js +113 -0
- package/dist/shape-signature.js.map +1 -0
- package/dist/triage.d.ts.map +1 -1
- package/dist/triage.js +11 -3
- package/dist/triage.js.map +1 -1
- package/dist/types.d.ts +60 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/union-find.d.ts +11 -0
- package/dist/union-find.d.ts.map +1 -0
- package/dist/union-find.js +44 -0
- package/dist/union-find.js.map +1 -0
- package/package.json +7 -6
package/dist/index.js
CHANGED
|
@@ -14,11 +14,21 @@ export * from './types.js';
|
|
|
14
14
|
export { matchesSelector } from './selectors.js';
|
|
15
15
|
export { DISCIPLINES, CLASH_RULE_PRESETS, inferClashSeverity, disciplineMatrixRules, rulesFromPresets, } from './disciplines.js';
|
|
16
16
|
export { createClashEngine } from './engine.js';
|
|
17
|
-
export { makeExclusionSet, isExcluded, pairKey } from './exclude.js';
|
|
17
|
+
export { makeExclusionSet, isExcluded, pairKey, qualifiedKey } from './exclude.js';
|
|
18
18
|
export { buildTriageSystemPrompt, buildTriageUserMessage, parseTriageResponse, } from './triage.js';
|
|
19
19
|
export { groupClashes, isClusterGroupingIneffective } from './grouping.js';
|
|
20
|
+
export { groupDuplicateSets } from './duplicate-sets.js';
|
|
20
21
|
export { clashReviewKey, aggregateReviewStatus, reviewStatusToBcfTopicStatus, } from './review.js';
|
|
21
22
|
export { compareClashRuns } from './lifecycle.js';
|
|
22
|
-
export { SEVERITY_RANK, TOUCHING_EPSILON, penetrationDepth, isTouching, sortClashes, } from './analysis.js';
|
|
23
|
+
export { SEVERITY_RANK, TOUCHING_EPSILON, penetrationDepth, isTouching, sortClashes, summarizeClashes, ruleHadNoMatch, classifyRuleCoverage, } from './analysis.js';
|
|
23
24
|
export { findDuplicates, DUPLICATES_RULE, } from './duplicates.js';
|
|
25
|
+
/**
|
|
26
|
+
* Per-triangle mesh analysis, re-exported for consumers outside this package
|
|
27
|
+
* (issue #2199: "mesh analysis reachable from TypeScript"). Previously
|
|
28
|
+
* package-internal — `triangleArea` existed for the clash contact solver but
|
|
29
|
+
* nothing outside `@ifc-lite/clash` could reach it, so the viewer's Measure
|
|
30
|
+
* tool had no path to a triangulated-mesh area even though every `MeshData`
|
|
31
|
+
* already carries the `positions`/`indices` a caller needs to use it.
|
|
32
|
+
*/
|
|
33
|
+
export { triangleArea, } from './contact/triangle.js';
|
|
24
34
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;GAQG;AAEH,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,GAIjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAsE,MAAM,aAAa,CAAC;AACpH,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;GAQG;AAEH,cAAc,YAAY,CAAC;AAC3B,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EACL,WAAW,EACX,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EACrB,gBAAgB,GAIjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,iBAAiB,EAAsE,MAAM,aAAa,CAAC;AACpH,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EACL,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,GAEpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,4BAA4B,EAAqB,MAAM,eAAe,CAAC;AAC9F,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACL,cAAc,EACd,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,gBAAgB,EAA0B,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EACL,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,cAAc,EACd,oBAAoB,GAGrB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,cAAc,EACd,eAAe,GAEhB,MAAM,iBAAiB,CAAC;AACzB;;;;;;;GAOG;AACH,OAAO,EACL,YAAY,GAEb,MAAM,uBAAuB,CAAC"}
|
package/dist/math/aabb.d.ts
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import type { AABB } from '@ifc-lite/spatial';
|
|
2
2
|
import type { Mat4, Vec3 } from '../types.js';
|
|
3
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Axis-aligned bounds of a packed `[x,y,z,...]` position buffer.
|
|
5
|
+
*
|
|
6
|
+
* Non-finite coordinates (NaN and ±Infinity, checked after `transform` is
|
|
7
|
+
* applied) never become bounds: an infinite bound makes `boxDistance` return
|
|
8
|
+
* NaN, and a NaN distance passes every comparison-shaped gate downstream. If
|
|
9
|
+
* NO vertex contributes a finite coordinate on an axis, the box is returned
|
|
10
|
+
* inverted (`min > max`) on that axis, which is rejected by `boxesTouch`
|
|
11
|
+
* rather than silently paired.
|
|
12
|
+
*/
|
|
4
13
|
export declare function fromPositions(positions: Float32Array, transform?: Mat4): AABB;
|
|
5
14
|
/** Expand bounds by `m` on every side. */
|
|
6
15
|
export declare function inflate(b: AABB, m: number): AABB;
|
package/dist/math/aabb.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aabb.d.ts","sourceRoot":"","sources":["../../src/math/aabb.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAY9C
|
|
1
|
+
{"version":3,"file":"aabb.d.ts","sourceRoot":"","sources":["../../src/math/aabb.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAY9C;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,YAAY,EAAE,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,CAoC7E;AAED,0CAA0C;AAC1C,wBAAgB,OAAO,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAEhD;AAED,wBAAgB,MAAM,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,CAEpC;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CAEpD;AAED;;;;;GAKG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAElD;AAED,mFAAmF;AACnF,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAEpD;AAED,mCAAmC;AACnC,wBAAgB,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAErD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,GAAG,OAAO,CAE9D"}
|
package/dist/math/aabb.js
CHANGED
|
@@ -10,7 +10,16 @@ function applyMat4(m, x, y, z) {
|
|
|
10
10
|
m[2] * x + m[6] * y + m[10] * z + m[14],
|
|
11
11
|
];
|
|
12
12
|
}
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* Axis-aligned bounds of a packed `[x,y,z,...]` position buffer.
|
|
15
|
+
*
|
|
16
|
+
* Non-finite coordinates (NaN and ±Infinity, checked after `transform` is
|
|
17
|
+
* applied) never become bounds: an infinite bound makes `boxDistance` return
|
|
18
|
+
* NaN, and a NaN distance passes every comparison-shaped gate downstream. If
|
|
19
|
+
* NO vertex contributes a finite coordinate on an axis, the box is returned
|
|
20
|
+
* inverted (`min > max`) on that axis, which is rejected by `boxesTouch`
|
|
21
|
+
* rather than silently paired.
|
|
22
|
+
*/
|
|
14
23
|
export function fromPositions(positions, transform) {
|
|
15
24
|
if (positions.length < 3) {
|
|
16
25
|
return { min: [0, 0, 0], max: [0, 0, 0] };
|
|
@@ -28,18 +37,29 @@ export function fromPositions(positions, transform) {
|
|
|
28
37
|
if (transform) {
|
|
29
38
|
[x, y, z] = applyMat4(transform, x, y, z);
|
|
30
39
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
// Only finite coordinates may become bounds. NaN was already excluded as a
|
|
41
|
+
// side effect (it fails both `<` and `>`), but ±Infinity propagated, and an
|
|
42
|
+
// infinite bound turns `boxDistance` into NaN — which `boxesTouch` passes.
|
|
43
|
+
// The rule is per coordinate, matching what NaN already got: the finite
|
|
44
|
+
// coordinates of a partly poisoned vertex still count.
|
|
45
|
+
if (Number.isFinite(x)) {
|
|
46
|
+
if (x < minX)
|
|
47
|
+
minX = x;
|
|
48
|
+
if (x > maxX)
|
|
49
|
+
maxX = x;
|
|
50
|
+
}
|
|
51
|
+
if (Number.isFinite(y)) {
|
|
52
|
+
if (y < minY)
|
|
53
|
+
minY = y;
|
|
54
|
+
if (y > maxY)
|
|
55
|
+
maxY = y;
|
|
56
|
+
}
|
|
57
|
+
if (Number.isFinite(z)) {
|
|
58
|
+
if (z < minZ)
|
|
59
|
+
minZ = z;
|
|
60
|
+
if (z > maxZ)
|
|
61
|
+
maxZ = z;
|
|
62
|
+
}
|
|
43
63
|
}
|
|
44
64
|
return { min: [minX, minY, minZ], max: [maxX, maxY, maxZ] };
|
|
45
65
|
}
|
package/dist/math/aabb.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"aabb.js","sourceRoot":"","sources":["../../src/math/aabb.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAa/D,OAAO,KAAK,CAAC,MAAM,wBAAwB,CAAC;AAE5C,sDAAsD;AACtD,SAAS,SAAS,CAAC,CAAO,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IACzD,OAAO;QACL,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QACtC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QACtC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;KACxC,CAAC;AACJ,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"aabb.js","sourceRoot":"","sources":["../../src/math/aabb.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAa/D,OAAO,KAAK,CAAC,MAAM,wBAAwB,CAAC;AAE5C,sDAAsD;AACtD,SAAS,SAAS,CAAC,CAAO,EAAE,CAAS,EAAE,CAAS,EAAE,CAAS;IACzD,OAAO;QACL,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QACtC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,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O,EAAE,CAAO;IACxC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC3B,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,aAAa,CAAC,CAAO,EAAE,CAAO;IAC5C,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/B,CAAC;AAED,mCAAmC;AACnC,MAAM,UAAU,cAAc,CAAC,CAAO,EAAE,CAAO;IAC7C,OAAO,CAAC,CAAC,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAChC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAW,EAAE,KAAW;IACnD,OAAO,CAAC,CAAC,YAAY,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The tessellation-invariant shape signature `findDuplicates` labels severity
|
|
3
|
+
* with: total surface area + enclosed volume of an element's world-space
|
|
4
|
+
* triangle soup, and the 5% agreement rule over the pair. Split out of
|
|
5
|
+
* `duplicates.ts` (which owns the pass itself) to keep both under the
|
|
6
|
+
* ~400-line module limit; not part of the public package surface.
|
|
7
|
+
*/
|
|
8
|
+
import type { ClashElement } from './types.js';
|
|
9
|
+
/** Total surface area (m²) and enclosed volume (m³) of one element's mesh. */
|
|
10
|
+
export interface ShapeSignature {
|
|
11
|
+
area: number;
|
|
12
|
+
volume: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* A tessellation-invariant fingerprint of an element's world-space triangle
|
|
16
|
+
* soup. Both numbers are integrals over the *surface*, so re-triangulating the
|
|
17
|
+
* same surface leaves them unchanged — which the triangle count this replaced
|
|
18
|
+
* did not: a 12- and a 48-triangle box are the same object and read as
|
|
19
|
+
* different, while a round and a square column of equal bounds can share a
|
|
20
|
+
* count and read as the same.
|
|
21
|
+
*
|
|
22
|
+
* Volume is `|Σ v0 · (v1 × v2)| / 6` (the divergence theorem). It is exact for
|
|
23
|
+
* a closed, consistently wound mesh and 0 for a flat sheet; an inconsistently
|
|
24
|
+
* wound mesh yields some other tessellation-dependent number — usually pushing
|
|
25
|
+
* the pair towards `minor`, but with no guarantee: two different open meshes
|
|
26
|
+
* whose volume terms both cancel to ~0 are decided on area alone, and the
|
|
27
|
+
* absolute value deliberately equates opposite windings, so a wholly reversed
|
|
28
|
+
* mesh — the same solid, wound inward — matches the mesh it copies. Area is
|
|
29
|
+
* invariant regardless of winding, so the pair of numbers degrades to an
|
|
30
|
+
* area-only comparison rather than to noise.
|
|
31
|
+
*
|
|
32
|
+
* O(triangles), and computed at most once per element (see `signatureOf` in
|
|
33
|
+
* `duplicates.ts`), only for elements that already reached the exact-duplicate
|
|
34
|
+
* gate — so a model with no coincident pairs pays nothing for it.
|
|
35
|
+
*/
|
|
36
|
+
export declare function shapeSignature(el: ClashElement): ShapeSignature;
|
|
37
|
+
/** Do the two meshes describe the same solid? An element with no measurable
|
|
38
|
+
* surface (no triangles, or geometry the caller did not supply) carries no
|
|
39
|
+
* evidence either way, so it is never promoted to "exact". */
|
|
40
|
+
export declare function sameShape(a: ShapeSignature, b: ShapeSignature): boolean;
|
|
41
|
+
//# sourceMappingURL=shape-signature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape-signature.d.ts","sourceRoot":"","sources":["../src/shape-signature.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAqB/C,8EAA8E;AAC9E,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,YAAY,GAAG,cAAc,CAoD/D;AASD;;+DAE+D;AAC/D,wBAAgB,SAAS,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,EAAE,cAAc,GAAG,OAAO,CAGvE"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/**
|
|
5
|
+
* How far apart (relative) two elements' surface areas / enclosed volumes may be
|
|
6
|
+
* and still count as the same shape. 5% is chosen from the two failure modes it
|
|
7
|
+
* has to separate, both measured on the fixtures in `duplicates.test.ts`:
|
|
8
|
+
* - **Same solid, re-tessellated.** A flat-faced solid — the box that started
|
|
9
|
+
* this — is *exactly* invariant: a 12- and a 48-triangle 1×1×3 box both give
|
|
10
|
+
* area 14 and volume 3. A faceted curved solid is not, because each
|
|
11
|
+
* refinement encloses more: a 12- vs a 36-segment column differs by 4.0% in
|
|
12
|
+
* volume. 5% keeps that pair together.
|
|
13
|
+
* - **Different solids sharing a bounding box.** A round column and a square
|
|
14
|
+
* column of the same bounds differ by 22.7% in area and 25.0% in volume —
|
|
15
|
+
* ~5× the tolerance.
|
|
16
|
+
* Below ~8 segments the two modes genuinely overlap (an 8- vs 36-segment
|
|
17
|
+
* column is 9.5% apart) and no threshold separates them; such a pair reads as
|
|
18
|
+
* `minor`, which is the safe direction: it is still reported, just not labelled
|
|
19
|
+
* exact.
|
|
20
|
+
*/
|
|
21
|
+
const SHAPE_REL_TOL = 0.05;
|
|
22
|
+
/**
|
|
23
|
+
* A tessellation-invariant fingerprint of an element's world-space triangle
|
|
24
|
+
* soup. Both numbers are integrals over the *surface*, so re-triangulating the
|
|
25
|
+
* same surface leaves them unchanged — which the triangle count this replaced
|
|
26
|
+
* did not: a 12- and a 48-triangle box are the same object and read as
|
|
27
|
+
* different, while a round and a square column of equal bounds can share a
|
|
28
|
+
* count and read as the same.
|
|
29
|
+
*
|
|
30
|
+
* Volume is `|Σ v0 · (v1 × v2)| / 6` (the divergence theorem). It is exact for
|
|
31
|
+
* a closed, consistently wound mesh and 0 for a flat sheet; an inconsistently
|
|
32
|
+
* wound mesh yields some other tessellation-dependent number — usually pushing
|
|
33
|
+
* the pair towards `minor`, but with no guarantee: two different open meshes
|
|
34
|
+
* whose volume terms both cancel to ~0 are decided on area alone, and the
|
|
35
|
+
* absolute value deliberately equates opposite windings, so a wholly reversed
|
|
36
|
+
* mesh — the same solid, wound inward — matches the mesh it copies. Area is
|
|
37
|
+
* invariant regardless of winding, so the pair of numbers degrades to an
|
|
38
|
+
* area-only comparison rather than to noise.
|
|
39
|
+
*
|
|
40
|
+
* O(triangles), and computed at most once per element (see `signatureOf` in
|
|
41
|
+
* `duplicates.ts`), only for elements that already reached the exact-duplicate
|
|
42
|
+
* gate — so a model with no coincident pairs pays nothing for it.
|
|
43
|
+
*/
|
|
44
|
+
export function shapeSignature(el) {
|
|
45
|
+
const { positions, indices } = el;
|
|
46
|
+
const m = el.transform;
|
|
47
|
+
const vertexCount = Math.floor(positions.length / 3);
|
|
48
|
+
const triangles = Math.floor(indices.length / 3);
|
|
49
|
+
// Three world-space vertices, held flat to keep the loop allocation-free.
|
|
50
|
+
const v = [0, 0, 0, 0, 0, 0, 0, 0, 0];
|
|
51
|
+
let area = 0;
|
|
52
|
+
let volume = 0;
|
|
53
|
+
for (let t = 0; t < triangles; t += 1) {
|
|
54
|
+
let ok = true;
|
|
55
|
+
for (let k = 0; k < 3; k += 1) {
|
|
56
|
+
const vi = indices[t * 3 + k];
|
|
57
|
+
if (vi >= vertexCount) {
|
|
58
|
+
// An out-of-range index has no position to read; skipping the triangle
|
|
59
|
+
// keeps the signature finite instead of poisoning it with NaN.
|
|
60
|
+
ok = false;
|
|
61
|
+
break;
|
|
62
|
+
}
|
|
63
|
+
const o = vi * 3;
|
|
64
|
+
const x = positions[o];
|
|
65
|
+
const y = positions[o + 1];
|
|
66
|
+
const z = positions[o + 2];
|
|
67
|
+
if (m) {
|
|
68
|
+
// f32-round the transformed coords exactly as `TriMesh.vertex` does, so
|
|
69
|
+
// a signature never disagrees with the narrow phase about where a
|
|
70
|
+
// vertex is.
|
|
71
|
+
v[k * 3] = Math.fround(m[0] * x + m[4] * y + m[8] * z + m[12]);
|
|
72
|
+
v[k * 3 + 1] = Math.fround(m[1] * x + m[5] * y + m[9] * z + m[13]);
|
|
73
|
+
v[k * 3 + 2] = Math.fround(m[2] * x + m[6] * y + m[10] * z + m[14]);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
v[k * 3] = x;
|
|
77
|
+
v[k * 3 + 1] = y;
|
|
78
|
+
v[k * 3 + 2] = z;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
if (!ok)
|
|
82
|
+
continue;
|
|
83
|
+
const e1x = v[3] - v[0];
|
|
84
|
+
const e1y = v[4] - v[1];
|
|
85
|
+
const e1z = v[5] - v[2];
|
|
86
|
+
const e2x = v[6] - v[0];
|
|
87
|
+
const e2y = v[7] - v[1];
|
|
88
|
+
const e2z = v[8] - v[2];
|
|
89
|
+
const nx = e1y * e2z - e1z * e2y;
|
|
90
|
+
const ny = e1z * e2x - e1x * e2z;
|
|
91
|
+
const nz = e1x * e2y - e1y * e2x;
|
|
92
|
+
area += Math.sqrt(nx * nx + ny * ny + nz * nz) / 2;
|
|
93
|
+
volume += (v[0] * (v[4] * v[8] - v[5] * v[7])
|
|
94
|
+
- v[1] * (v[3] * v[8] - v[5] * v[6])
|
|
95
|
+
+ v[2] * (v[3] * v[7] - v[4] * v[6])) / 6;
|
|
96
|
+
}
|
|
97
|
+
return { area, volume: Math.abs(volume) };
|
|
98
|
+
}
|
|
99
|
+
/** Relative agreement, with 0 vs 0 counting as agreement (a flat sheet has no
|
|
100
|
+
* volume, so such a pair is decided on area alone). */
|
|
101
|
+
function relClose(x, y) {
|
|
102
|
+
const scale = Math.max(Math.abs(x), Math.abs(y));
|
|
103
|
+
return Math.abs(x - y) <= SHAPE_REL_TOL * scale;
|
|
104
|
+
}
|
|
105
|
+
/** Do the two meshes describe the same solid? An element with no measurable
|
|
106
|
+
* surface (no triangles, or geometry the caller did not supply) carries no
|
|
107
|
+
* evidence either way, so it is never promoted to "exact". */
|
|
108
|
+
export function sameShape(a, b) {
|
|
109
|
+
if (a.area <= 0 || b.area <= 0)
|
|
110
|
+
return false;
|
|
111
|
+
return relClose(a.area, b.area) && relClose(a.volume, b.volume);
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=shape-signature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape-signature.js","sourceRoot":"","sources":["../src/shape-signature.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAY/D;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,aAAa,GAAG,IAAI,CAAC;AAQ3B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,cAAc,CAAC,EAAgB;IAC7C,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC;IAClC,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC;IACvB,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrD,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACjD,0EAA0E;IAC1E,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACtC,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QACtC,IAAI,EAAE,GAAG,IAAI,CAAC;QACd,KAAK,IAAI,CAA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CAAC,CAAC,MAAM,CAAC,CAAC;AAClE,CAAC"}
|
package/dist/triage.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triage.d.ts","sourceRoot":"","sources":["../src/triage.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"triage.d.ts","sourceRoot":"","sources":["../src/triage.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,KAAK,EAAS,WAAW,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAEpE,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,cAAc,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAAC,CAAC;CAC/C;AAED,iFAAiF;AACjF,wBAAgB,uBAAuB,IAAI,MAAM,CAsBhD;AAUD,qEAAqE;AACrE,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CA4ClE;AAgBD,qEAAqE;AACrE,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,iBAAiB,CAoBxF"}
|
package/dist/triage.js
CHANGED
|
@@ -65,14 +65,22 @@ export function buildTriageUserMessage(result) {
|
|
|
65
65
|
for (const c of important) {
|
|
66
66
|
const aLabel = c.a.name || c.a.key.slice(0, 8);
|
|
67
67
|
const bLabel = c.b.name || c.b.key.slice(0, 8);
|
|
68
|
-
lines.push(`- [${c.severity}] ${c.a.tag} "${aLabel}" vs ${c.b.tag} "${bLabel}" — ${formatDistance(c.distance)} (rule: ${c.rule})`);
|
|
68
|
+
lines.push(`- [${c.severity}] ${c.a.tag} "${aLabel}" vs ${c.b.tag} "${bLabel}" — ${formatDistance(c.distance, c.distanceKind)} (rule: ${c.rule})`);
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
return lines.join('\n');
|
|
72
72
|
}
|
|
73
|
-
|
|
73
|
+
/**
|
|
74
|
+
* Render a signed clash distance for the LLM triage prompt. `distanceKind`
|
|
75
|
+
* absent or `'estimate'` means the value is a box dimension read off the
|
|
76
|
+
* AABBs, not a mesh measurement (see `Clash.distanceKind`) — labelled so the
|
|
77
|
+
* prompt does not hand the LLM a bare number it will report as a precise
|
|
78
|
+
* penetration depth.
|
|
79
|
+
*/
|
|
80
|
+
function formatDistance(distance, distanceKind) {
|
|
81
|
+
const estimated = distanceKind !== 'mesh';
|
|
74
82
|
return distance < 0
|
|
75
|
-
? `penetration ${Math.abs(distance).toFixed(3)} m`
|
|
83
|
+
? `penetration ${estimated ? '~' : ''}${Math.abs(distance).toFixed(3)} m${estimated ? ' (AABB estimate)' : ''}`
|
|
76
84
|
: `gap ${distance.toFixed(3)} m`;
|
|
77
85
|
}
|
|
78
86
|
/** Parse the LLM's JSON response into a structured triage result. */
|
package/dist/triage.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"triage.js","sourceRoot":"","sources":["../src/triage.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAiB/D,iFAAiF;AACjF,MAAM,UAAU,uBAAuB;IACrC,OAAO;;;;;;;;;;;;;;;;;;;;0CAoBiC,CAAC;AAC3C,CAAC;AAED,SAAS,eAAe,CAAC,MAAmB;IAC1C,MAAM,MAAM,GAAkC,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;IAC3F,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACnC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC9B,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,sBAAsB,CAAC,MAAmB;IACxD,MAAM,cAAc,GAAG,eAAe,CAA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
|
|
109
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* How a clash's `distance` was obtained — the two are NOT interchangeable and
|
|
112
|
+
* were indistinguishable in the output before this field existed.
|
|
113
|
+
*
|
|
114
|
+
* - `'mesh'` — measured on the triangle meshes. For `clearance` it is the
|
|
115
|
+
* exact triangle-to-triangle gap. For `touch` it is usually that same exact
|
|
116
|
+
* gap, with one exception: a pair whose every candidate depth falls below
|
|
117
|
+
* the pair's f32 precision floor also reports `touch`, with `distance: 0`
|
|
118
|
+
* and `distanceKind: 'mesh'` — there the 0 is a CLASSIFICATION (the
|
|
119
|
+
* surfaces are flush to within what the f32 source coordinates can
|
|
120
|
+
* represent; nothing is measurably penetrating), not a measured gap.
|
|
121
|
+
* For a hard clash it is the exact
|
|
122
|
+
* box-box penetration depth (minimum translation distance along a
|
|
123
|
+
* separating axis, Gottschalk), certified only when BOTH elements are —
|
|
124
|
+
* within tolerance — rectangular boxes (`obb.ts`); this replaced an
|
|
125
|
+
* earlier "deepest crossing-triangle vertex" probe that was a sampling
|
|
126
|
+
* artifact, converging to 0 as a mesh was retessellated instead of to the
|
|
127
|
+
* true depth (PR #2536).
|
|
128
|
+
* - `'estimate'` — read off the two element AABBs: the smallest overlapping box
|
|
129
|
+
* dimension. Reported for a hard clash whenever the narrow phase could not
|
|
130
|
+
* certify a box-box depth. That happens in four shapes, all common in real
|
|
131
|
+
* models: either element is not (confirmed) a box; surfaces that only
|
|
132
|
+
* coincide (stacked layers sharing a footprint); one solid modelled wholly
|
|
133
|
+
* inside another; and a member piercing clean through the other — even
|
|
134
|
+
* when BOTH are boxes, because the box-box minimum-translation-distance is
|
|
135
|
+
* then dominated by the piercing member's own extent along the shared
|
|
136
|
+
* axis, not by the material it actually crossed, and is withheld from
|
|
137
|
+
* `'mesh'` for exactly that reason. The value is then a property of the two
|
|
138
|
+
* BOXES, not of the solids — it can equal an element's own thickness rather
|
|
139
|
+
* than how far the two actually interpenetrate. Treat it as an indication of
|
|
140
|
+
* scale, not as a measurement.
|
|
141
|
+
*/
|
|
142
|
+
export type ClashDistanceKind = 'mesh' | 'estimate';
|
|
110
143
|
export interface Clash {
|
|
111
144
|
/** Stable id: derived from the two durable keys + rule id. */
|
|
112
145
|
id: string;
|
|
@@ -116,6 +149,12 @@ export interface Clash {
|
|
|
116
149
|
status: ClashStatus;
|
|
117
150
|
/** Signed: `<0` penetration depth, `>0` gap. */
|
|
118
151
|
distance: number;
|
|
152
|
+
/**
|
|
153
|
+
* Provenance of `distance`. The engine always sets it; it is optional only so
|
|
154
|
+
* that a clash rehydrated from a run recorded before this field existed stays
|
|
155
|
+
* assignable — absent means "unknown", never "measured".
|
|
156
|
+
*/
|
|
157
|
+
distanceKind?: ClashDistanceKind;
|
|
119
158
|
/** True contact point (hard) or closest-point midpoint (clearance/touch). */
|
|
120
159
|
point: Vec3;
|
|
121
160
|
/** Overlap region (hard) or closest-segment box (clearance/touch). */
|
|
@@ -150,6 +189,18 @@ export interface ClashSummary {
|
|
|
150
189
|
bySeverity: Record<ClashSeverity, number>;
|
|
151
190
|
byStorey?: Record<string, number>;
|
|
152
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* How many elements a rule's selectors actually matched in THIS model, before
|
|
194
|
+
* any geometry test ran. `matchedB` is `null` for a self-clash rule (no `b`
|
|
195
|
+
* selector). A rule with `matchedA === 0` or `matchedB === 0` never compared a
|
|
196
|
+
* single pair — its selector simply doesn't describe anything in this model
|
|
197
|
+
* (e.g. an MEP selector run against an infrastructure model).
|
|
198
|
+
*/
|
|
199
|
+
export interface ClashRuleCoverage {
|
|
200
|
+
rule: string;
|
|
201
|
+
matchedA: number;
|
|
202
|
+
matchedB: number | null;
|
|
203
|
+
}
|
|
153
204
|
export interface ClashResult {
|
|
154
205
|
clashes: Clash[];
|
|
155
206
|
summary: ClashSummary;
|
|
@@ -159,6 +210,15 @@ export interface ClashResult {
|
|
|
159
210
|
droppedPairs: number;
|
|
160
211
|
};
|
|
161
212
|
rulesRun: ClashRule[];
|
|
213
|
+
/**
|
|
214
|
+
* Selector match coverage for every rule in `rulesRun`, in the same order.
|
|
215
|
+
* This is the raw signal for distinguishing "ran and found nothing" from
|
|
216
|
+
* "no rule matched anything in this model" — see
|
|
217
|
+
* {@link classifyRuleCoverage} for the presentation-facing classification.
|
|
218
|
+
* Populated by every engine-produced result (`runClash`, `findDuplicates`);
|
|
219
|
+
* optional only so hand-built `ClashResult` fixtures in tests don't need it.
|
|
220
|
+
*/
|
|
221
|
+
ruleCoverage?: ClashRuleCoverage[];
|
|
162
222
|
settings: {
|
|
163
223
|
tolerance: number;
|
|
164
224
|
excludeVoidsAndHosts: boolean;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAE9C,YAAY,EAAE,IAAI,EAAE,CAAC;AAErB,wCAAwC;AACxC,MAAM,MAAM,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AAE5C,gDAAgD;AAChD,MAAM,MAAM,IAAI,GAAG,SAAS,MAAM,EAAE,CAAC;AAErC;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,WAAW,CAAC;AAE7C,iFAAiF;AACjF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,WAAW,GAAG,OAAO,CAAC;AAEzD,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAEpE;;;;;;;;;GASG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,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AAM,EAAE,IAAI,CAAC;IACb,mBAAmB,EAAE,IAAI,CAAC;IAC1B,QAAQ,EAAE,aAAa,CAAC;IACxB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,sBAAsB;;;CAGzB,CAAC"}
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;+DAE+D;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AA+L/D,sEAAsE;AACtE,MAAM,CAAC,MAAM,qBAAqB,GAAiC,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,CAAC;AAEpG,iEAAiE;AACjE,MAAM,CAAC,MAAM,2BAA2B,GAAsB,MAAM,CAAC;AA8DrE,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,SAAS,EAAE,KAAK;IAChB,oBAAoB,EAAE,IAAI;CAClB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Union-find over `0..n-1`, shared by the spatial clustering in `grouping.ts`
|
|
3
|
+
* and the coincident-set components in `duplicate-sets.ts`. Roots are always
|
|
4
|
+
* the lowest index in the set, so the partition it produces does not depend on
|
|
5
|
+
* the order of the unions. Not part of the public package surface.
|
|
6
|
+
*/
|
|
7
|
+
export declare function createUnionFind(n: number): {
|
|
8
|
+
find: (i: number) => number;
|
|
9
|
+
union: (i: number, j: number) => void;
|
|
10
|
+
};
|
|
11
|
+
//# sourceMappingURL=union-find.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"union-find.d.ts","sourceRoot":"","sources":["../src/union-find.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;IAAC,KAAK,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,CAgCjH"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
|
+
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
|
+
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/**
|
|
5
|
+
* Union-find over `0..n-1`, shared by the spatial clustering in `grouping.ts`
|
|
6
|
+
* and the coincident-set components in `duplicate-sets.ts`. Roots are always
|
|
7
|
+
* the lowest index in the set, so the partition it produces does not depend on
|
|
8
|
+
* the order of the unions. Not part of the public package surface.
|
|
9
|
+
*/
|
|
10
|
+
export function createUnionFind(n) {
|
|
11
|
+
const parent = new Array(n);
|
|
12
|
+
for (let i = 0; i < n; i += 1) {
|
|
13
|
+
parent[i] = i;
|
|
14
|
+
}
|
|
15
|
+
const find = (i) => {
|
|
16
|
+
let root = i;
|
|
17
|
+
while (parent[root] !== root) {
|
|
18
|
+
root = parent[root];
|
|
19
|
+
}
|
|
20
|
+
// Path compression keeps repeated lookups flat; deterministic.
|
|
21
|
+
let cur = i;
|
|
22
|
+
while (parent[cur] !== root) {
|
|
23
|
+
const next = parent[cur];
|
|
24
|
+
parent[cur] = root;
|
|
25
|
+
cur = next;
|
|
26
|
+
}
|
|
27
|
+
return root;
|
|
28
|
+
};
|
|
29
|
+
const union = (i, j) => {
|
|
30
|
+
const ri = find(i);
|
|
31
|
+
const rj = find(j);
|
|
32
|
+
if (ri !== rj) {
|
|
33
|
+
// Attach the higher-index root under the lower to keep ids stable.
|
|
34
|
+
if (ri < rj) {
|
|
35
|
+
parent[rj] = ri;
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
parent[ri] = rj;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return { find, union };
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=union-find.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"union-find.js","sourceRoot":"","sources":["../src/union-find.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,CAAS;IACvC,MAAM,MAAM,GAAG,IAAI,KAAK,CAAS,CAAC,CAAC,CAAC;IACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC;IACD,MAAM,IAAI,GAAG,CAAC,CAAS,EAAU,EAAE;QACjC,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC;YAC7B,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;QACtB,CAAC;QACD,+DAA+D;QAC/D,IAAI,GAAG,GAAG,CAAC,CAAC;QACZ,OAAO,MAAM,CAAC,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;YAC5B,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;YACzB,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;YACnB,GAAG,GAAG,IAAI,CAAC;QACb,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC,CAAC;IACF,MAAM,KAAK,GAAG,CAAC,CAAS,EAAE,CAAS,EAAQ,EAAE;QAC3C,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACnB,MAAM,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,CAAC;QACnB,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;YACd,mEAAmE;YACnE,IAAI,EAAE,GAAG,EAAE,EAAE,CAAC;gBACZ,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;YAClB,CAAC;iBAAM,CAAC;gBACN,MAAM,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC;YAClB,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IACF,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;AACzB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ifc-lite/clash",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "Clash detection for IFC-Lite — representation-agnostic core engine + source adapters",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -34,16 +34,17 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@ifc-lite/spatial": "^1.14.13",
|
|
37
|
-
"@ifc-lite/geometry": "^3.8.
|
|
38
|
-
"@ifc-lite/parser": "^4.0
|
|
37
|
+
"@ifc-lite/geometry": "^3.8.3",
|
|
38
|
+
"@ifc-lite/parser": "^4.1.0",
|
|
39
39
|
"@ifc-lite/query": "^1.14.16",
|
|
40
40
|
"@ifc-lite/bcf": "^1.18.1",
|
|
41
|
-
"@ifc-lite/ifcx": "^2.3.
|
|
42
|
-
"@ifc-lite/wasm": "^4.
|
|
41
|
+
"@ifc-lite/ifcx": "^2.3.6",
|
|
42
|
+
"@ifc-lite/wasm": "^4.7.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"typescript": "^6.0.3",
|
|
46
|
-
"vitest": "^4.1.10"
|
|
46
|
+
"vitest": "^4.1.10",
|
|
47
|
+
"@ifc-lite/world-frame-fixtures": "^0.1.0"
|
|
47
48
|
},
|
|
48
49
|
"license": "MPL-2.0",
|
|
49
50
|
"author": "Louis True",
|