@ifc-lite/clash 1.7.0 → 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/analysis.d.ts +10 -1
- package/dist/analysis.d.ts.map +1 -1
- package/dist/analysis.js +20 -0
- package/dist/analysis.js.map +1 -1
- package/dist/contact/narrow-phase.d.ts +3 -2
- package/dist/contact/narrow-phase.d.ts.map +1 -1
- package/dist/contact/narrow-phase.js +32 -14
- package/dist/contact/narrow-phase.js.map +1 -1
- package/dist/contact/tri-tri.d.ts +33 -7
- package/dist/contact/tri-tri.d.ts.map +1 -1
- package/dist/contact/tri-tri.js +37 -14
- package/dist/contact/tri-tri.js.map +1 -1
- package/dist/duplicate-metric.d.ts +26 -8
- package/dist/duplicate-metric.d.ts.map +1 -1
- package/dist/duplicate-metric.js +26 -8
- package/dist/duplicate-metric.js.map +1 -1
- package/dist/duplicates.d.ts +9 -0
- package/dist/duplicates.d.ts.map +1 -1
- package/dist/duplicates.js +53 -18
- 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 +3 -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/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -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/triage.d.ts.map +1 -1
- package/dist/triage.js +11 -3
- package/dist/triage.js.map +1 -1
- package/dist/types.d.ts +39 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +4 -3
package/dist/analysis.d.ts
CHANGED
|
@@ -8,7 +8,16 @@
|
|
|
8
8
|
* beam interpenetration and a shallow one share a severity. These helpers add
|
|
9
9
|
* the geometric dimension (depth) so the two can be combined when prioritising.
|
|
10
10
|
*/
|
|
11
|
-
import type { Clash, ClashResult, ClashRuleCoverage, ClashSeverity } from './types.js';
|
|
11
|
+
import type { Clash, ClashResult, ClashRuleCoverage, ClashSeverity, ClashSummary } from './types.js';
|
|
12
|
+
/**
|
|
13
|
+
* Tally a clash list into a {@link ClashSummary}: totals per rule, per sorted
|
|
14
|
+
* element-type pair, and per severity.
|
|
15
|
+
*
|
|
16
|
+
* Single home for the tally, so a result built by the engine, by the duplicate
|
|
17
|
+
* scan, or by a consumer that filtered a result down (e.g. user exclusions)
|
|
18
|
+
* cannot report buckets that disagree with `clashes`.
|
|
19
|
+
*/
|
|
20
|
+
export declare function summarizeClashes(clashes: readonly Clash[]): ClashSummary;
|
|
12
21
|
/** Severity ordering, most-severe first (lower rank = more severe). */
|
|
13
22
|
export declare const SEVERITY_RANK: Record<ClashSeverity, number>;
|
|
14
23
|
/**
|
package/dist/analysis.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../src/analysis.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"analysis.d.ts","sourceRoot":"","sources":["../src/analysis.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,iBAAiB,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAErG;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,GAAG,YAAY,CAWxE;AAED,uEAAuE;AACvE,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,MAAM,CAKvD,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,KAAK,GAAG,MAAM,CAEjD;AAED;;;;0EAI0E;AAC1E,eAAO,MAAM,gBAAgB,SAAO,CAAC;AA4CrC;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,KAAK,EAAE,GAAG,GAAE,MAA8B,GAAG,OAAO,CAEjF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,iBAAiB,GAAG,OAAO,CAEnE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,MAAM,mBAAmB,GAAG,OAAO,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;AAE/E,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,mBAAmB,CAOnG;AAED,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,OAAO,GAAG,UAAU,CAAC;AAM5D;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,SAAS,KAAK,EAAE,EAAE,EAAE,EAAE,WAAW,GAAG,KAAK,EAAE,CAmB/E"}
|
package/dist/analysis.js
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
2
2
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
|
+
/**
|
|
5
|
+
* Tally a clash list into a {@link ClashSummary}: totals per rule, per sorted
|
|
6
|
+
* element-type pair, and per severity.
|
|
7
|
+
*
|
|
8
|
+
* Single home for the tally, so a result built by the engine, by the duplicate
|
|
9
|
+
* scan, or by a consumer that filtered a result down (e.g. user exclusions)
|
|
10
|
+
* cannot report buckets that disagree with `clashes`.
|
|
11
|
+
*/
|
|
12
|
+
export function summarizeClashes(clashes) {
|
|
13
|
+
const byRule = {};
|
|
14
|
+
const byTypePair = {};
|
|
15
|
+
const bySeverity = { critical: 0, major: 0, minor: 0, info: 0 };
|
|
16
|
+
for (const c of clashes) {
|
|
17
|
+
byRule[c.rule] = (byRule[c.rule] ?? 0) + 1;
|
|
18
|
+
const pair = [c.a.tag, c.b.tag].sort().join(' vs ');
|
|
19
|
+
byTypePair[pair] = (byTypePair[pair] ?? 0) + 1;
|
|
20
|
+
bySeverity[c.severity] += 1;
|
|
21
|
+
}
|
|
22
|
+
return { total: clashes.length, byRule, byTypePair, bySeverity };
|
|
23
|
+
}
|
|
4
24
|
/** Severity ordering, most-severe first (lower rank = more severe). */
|
|
5
25
|
export const SEVERITY_RANK = {
|
|
6
26
|
critical: 0,
|
package/dist/analysis.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analysis.js","sourceRoot":"","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EAAE,EAAe;IACpE,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;IAC5B,QAAQ,EAAE,EAAE,CAAC;QACX,KAAK,UAAU;YACb,GAAG,CAAC,IAAI,CACN,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CACP,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,QAAQ,CAAC;gBACrD,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC;gBACzC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CACd,CAAC;YACF,MAAM;QACR,KAAK,OAAO;YACV,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC7E,MAAM;QACR,KAAK,UAAU;YACb,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,GAAG,CAAC,CAAC,QAAQ,IAAI,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;YAC3D,MAAM;IACV,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -21,8 +21,9 @@ export interface NarrowPhaseOptions {
|
|
|
21
21
|
readonly epsilon?: number;
|
|
22
22
|
/**
|
|
23
23
|
* Plane-distance tolerance for coplanarity and Möller sign tests. Defaults
|
|
24
|
-
* to {@link scaledPlaneEps}'s f32-ULP
|
|
25
|
-
*
|
|
24
|
+
* to {@link scaledPlaneEps}'s per-axis f32-ULP noise, projected onto each
|
|
25
|
+
* tested plane's own normal, not a fixed constant nor a single max over
|
|
26
|
+
* all axes; see that function's doc.
|
|
26
27
|
*/
|
|
27
28
|
readonly planeEps?: number;
|
|
28
29
|
/** BVH leaf size for per-mesh triangle BVHs. Default 8. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"narrow-phase.d.ts","sourceRoot":"","sources":["../../src/contact/narrow-phase.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAQ,IAAI,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"narrow-phase.d.ts","sourceRoot":"","sources":["../../src/contact/narrow-phase.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAQ,IAAI,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AA+DnD,MAAM,MAAM,YAAY,GACpB;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC;IACrB,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;CAC3B,GACD;IACE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC;IACrB,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAClB,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;CACnB,CAAC;AAEN,MAAM,WAAW,kBAAkB;IACjC,0DAA0D;IAC1D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B;;;;;OAKG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,2DAA2D;IAC3D,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,GAAE,kBAAuB,GAAG,YAAY,EAAE,CAsC3F"}
|
|
@@ -8,7 +8,7 @@ import { triangleAt, triangleCount } from "./triangle.js";
|
|
|
8
8
|
* f32-ULP scale factor for a "worst-case" single-precision coordinate: for a
|
|
9
9
|
* value with magnitude in `[2, 4)` the true float32 ULP is `2^-22`, and for
|
|
10
10
|
* larger magnitudes the ULP only grows. Same `2^-22` term (and reasoning) as
|
|
11
|
-
* `near_band_from_extent` in `rust/geometry/src/kernel/
|
|
11
|
+
* `near_band_from_extent` in `rust/geometry/src/kernel/near_band.rs` and
|
|
12
12
|
* `precisionFloor` in `engine-ts/narrow.ts` — kept local rather than shared
|
|
13
13
|
* because plane-distance tolerance and penetration-depth tolerance are
|
|
14
14
|
* different jobs, even though both derive from the same f32 ingestion floor.
|
|
@@ -25,26 +25,44 @@ const F32_ULP_SCALE = 1 / 4_194_304; // 2^-22
|
|
|
25
25
|
* bit-identical — f32 values, and a too-tight fixed epsilon then reads that
|
|
26
26
|
* rounding noise as a genuine non-coplanar separation, discarding the
|
|
27
27
|
* shared-face contact entirely rather than reporting it as
|
|
28
|
-
* `touch`/`coplanar`.
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
28
|
+
* `touch`/`coplanar`.
|
|
29
|
+
*
|
|
30
|
+
* Crucially, the extent must be taken PER AXIS and projected onto each
|
|
31
|
+
* plane's own normal (`epsForPlane` in `./tri-tri.js`), not collapsed to a
|
|
32
|
+
* single max over all three axes of both AABBs. The tolerance is compared
|
|
33
|
+
* against a signed distance measured along ONE plane normal, and each
|
|
34
|
+
* coordinate's rounding noise enters that distance weighted by its axis's
|
|
35
|
+
* normal component; an axis orthogonal to the normal contributes nothing.
|
|
36
|
+
* A max-over-axes scalar instead scales the tolerance to the meshes'
|
|
37
|
+
* DISTANCE FROM THE WORLD ORIGIN along whichever axis happens to be
|
|
38
|
+
* largest, even when that axis is irrelevant to the plane being tested:
|
|
39
|
+
* two horizontal faces (normal Z) with a genuine 2.0 mm Z-clearance
|
|
40
|
+
* authored 10 km along X got planeEps = 10000 * 2^-22 = 2.384 mm, inflated
|
|
41
|
+
* entirely by the irrelevant X axis, and were fabricated as coplanar
|
|
42
|
+
* contact (above ~8.4 km extent every near-parallel candidate pair reads
|
|
43
|
+
* as coplanar). Same reasoning as the LOCAL-vs-world tolerance sizing in
|
|
44
|
+
* `section-cutter.ts` (#2622): size the tolerance off the quantity the
|
|
45
|
+
* noise actually scales with, never off an unrelated world magnitude.
|
|
46
|
+
*
|
|
47
|
+
* The projected result is floored at the old fixed `1e-6`
|
|
48
|
+
* (`ProjectedPlaneEps.floor`): scaling must only ever *widen* the tolerance
|
|
49
|
+
* relative to the constant it replaces, never narrow it: a bare
|
|
50
|
+
* `extent * F32_ULP_SCALE` is far tighter than `1e-6` for any extent under
|
|
51
|
+
* ~4.19 m, which reintroduces the exact dropped-shared-face bug this
|
|
52
|
+
* function exists to fix.
|
|
35
53
|
*/
|
|
36
54
|
function scaledPlaneEps(aabbA, aabbB) {
|
|
37
|
-
|
|
55
|
+
const axisNoise = [0, 0, 0];
|
|
38
56
|
for (const aabb of [aabbA, aabbB]) {
|
|
39
57
|
for (const v of [aabb.min, aabb.max]) {
|
|
40
|
-
for (
|
|
41
|
-
const a = Math.abs(
|
|
42
|
-
if (a >
|
|
43
|
-
|
|
58
|
+
for (let i = 0; i < 3; i++) {
|
|
59
|
+
const a = Math.abs(v[i]) * F32_ULP_SCALE;
|
|
60
|
+
if (a > axisNoise[i])
|
|
61
|
+
axisNoise[i] = a;
|
|
44
62
|
}
|
|
45
63
|
}
|
|
46
64
|
}
|
|
47
|
-
return
|
|
65
|
+
return { axisNoise, floor: 1e-6 };
|
|
48
66
|
}
|
|
49
67
|
/**
|
|
50
68
|
* For two meshes A and B, return every triangle pair whose triangles
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"narrow-phase.js","sourceRoot":"","sources":["../../src/contact/narrow-phase.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"narrow-phase.js","sourceRoot":"","sources":["../../src/contact/narrow-phase.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,eAAe,EAA0B,MAAM,cAAc,CAAC;AAEvE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG1D;;;;;;;;GAQG;AACH,MAAM,aAAa,GAAG,CAAC,GAAG,SAAS,CAAC,CAAC,QAAQ;AAE7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,SAAS,cAAc,CAAC,KAAW,EAAE,KAAW;IAC9C,MAAM,SAAS,GAA6B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IACtD,KAAK,MAAM,IAAI,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,EAAE,CAAC;QAClC,KAAK,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;YACrC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC3B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAW,CAAC,GAAG,aAAa,CAAC;gBACnD,IAAI,CAAC,GAAI,SAAS,CAAC,CA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AM,IAAI,GAAG,UAAU,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/B,MAAM,GAAG,GAAG,eAAe,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;QAClD,IAAI,GAAG,CAAC,IAAI,KAAK,MAAM;YAAE,SAAS;QAClC,IAAI,GAAG,CAAC,IAAI,KAAK,UAAU,EAAE,CAAC;YAC5B,GAAG,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QACvE,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,IAAI,CAAC;gBACP,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,EAAE;gBACR,CAAC,EAAE,IAAI;gBACP,CAAC,EAAE,IAAI;gBACP,IAAI,EAAE,OAAO;gBACb,EAAE,EAAE,GAAG,CAAC,EAAE;gBACV,EAAE,EAAE,GAAG,CAAC,EAAE;aACX,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -16,17 +16,43 @@ export type TriTriResult = {
|
|
|
16
16
|
} | {
|
|
17
17
|
readonly kind: "coplanar";
|
|
18
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* Direction-aware plane-distance tolerance: per-axis absolute rounding-noise
|
|
21
|
+
* amplitudes (world units), resolved into a scalar tolerance per plane by
|
|
22
|
+
* projecting them onto that plane's own unit normal:
|
|
23
|
+
*
|
|
24
|
+
* eps(n) = max(floor, |n_x| * axisNoise_x + |n_y| * axisNoise_y + |n_z| * axisNoise_z)
|
|
25
|
+
*
|
|
26
|
+
* A signed plane distance is `dot(n, v) + d` for a unit normal `n`, so each
|
|
27
|
+
* coordinate's rounding noise enters it weighted by that axis's normal
|
|
28
|
+
* component; an axis orthogonal to the normal contributes nothing. A single
|
|
29
|
+
* scalar built from the max coordinate over ALL axes (the pre-fix
|
|
30
|
+
* `scaledPlaneEps`) is compared against a quantity it was not derived from:
|
|
31
|
+
* it lets one large-magnitude axis inflate the tolerance for planes whose
|
|
32
|
+
* normal has no component on that axis at all, fabricating coplanar verdicts
|
|
33
|
+
* across genuine clearances (see `scaledPlaneEps` in `./narrow-phase.js`).
|
|
34
|
+
*/
|
|
35
|
+
export interface ProjectedPlaneEps {
|
|
36
|
+
/** Per-axis absolute rounding-noise amplitude (world units). */
|
|
37
|
+
readonly axisNoise: Vec3;
|
|
38
|
+
/** Minimum tolerance, applied after projection. */
|
|
39
|
+
readonly floor: number;
|
|
40
|
+
}
|
|
41
|
+
export type PlaneEps = number | ProjectedPlaneEps;
|
|
19
42
|
/**
|
|
20
43
|
* Full Möller test.
|
|
21
44
|
*
|
|
22
|
-
* `planeEps` is the
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
45
|
+
* `planeEps` is the tolerance on signed plane distance: distances with
|
|
46
|
+
* |d| / |N| <= eps are treated as zero (on-plane). A scalar is used as-is; a
|
|
47
|
+
* {@link ProjectedPlaneEps} is resolved per plane against that plane's own
|
|
48
|
+
* normal, so each of the two plane tests gets its own direction-correct
|
|
49
|
+
* tolerance. Defaults to 1e-6 in model-native units, which is only valid
|
|
50
|
+
* near the origin (see `scaledPlaneEps` in `./narrow-phase.js`); the
|
|
51
|
+
* production call path (`narrowPhase`) always supplies an explicit,
|
|
52
|
+
* coordinate-scaled value, so this default only applies to
|
|
53
|
+
* direct/standalone callers.
|
|
28
54
|
*/
|
|
29
|
-
export declare function triTriIntersect(a: Triangle, b: Triangle, planeEps?:
|
|
55
|
+
export declare function triTriIntersect(a: Triangle, b: Triangle, planeEps?: PlaneEps): TriTriResult;
|
|
30
56
|
/**
|
|
31
57
|
* True when triangles lie in the same plane within `planeEps`.
|
|
32
58
|
* Both triangles must be non-degenerate.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tri-tri.d.ts","sourceRoot":"","sources":["../../src/contact/tri-tri.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAA;CAAE,GAChE;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAElC
|
|
1
|
+
{"version":3,"file":"tri-tri.d.ts","sourceRoot":"","sources":["../../src/contact/tri-tri.ts"],"names":[],"mappings":"AAIA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAE9C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGvC,MAAM,MAAM,YAAY,GACpB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC;IAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAA;CAAE,GAChE;IAAE,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAA;CAAE,CAAC;AAElC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,iBAAiB;IAChC,gEAAgE;IAChE,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,mDAAmD;IACnD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,MAAM,QAAQ,GAAG,MAAM,GAAG,iBAAiB,CAAC;AAelD;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,GAAE,QAAe,GAAG,YAAY,CAiEjG;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,EAAE,QAAQ,SAAO,GAAG,OAAO,CAmBpF;AAED,4EAA4E;AAC5E,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAMlE"}
|
package/dist/contact/tri-tri.js
CHANGED
|
@@ -3,15 +3,30 @@
|
|
|
3
3
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
4
4
|
import { isDegenerate, triangleNormalRaw } from "./triangle.js";
|
|
5
5
|
import { cross3, dot3, length3, lerp3, sub3 } from "./vec3.js";
|
|
6
|
+
/** Resolve a {@link PlaneEps} into a scalar tolerance for the plane with
|
|
7
|
+
* (unnormalised) normal `n` of length `ln`. */
|
|
8
|
+
function epsForPlane(planeEps, n, ln) {
|
|
9
|
+
if (typeof planeEps === "number")
|
|
10
|
+
return planeEps;
|
|
11
|
+
const { axisNoise, floor } = planeEps;
|
|
12
|
+
const projected = (Math.abs(n[0]) * axisNoise[0] +
|
|
13
|
+
Math.abs(n[1]) * axisNoise[1] +
|
|
14
|
+
Math.abs(n[2]) * axisNoise[2]) /
|
|
15
|
+
ln;
|
|
16
|
+
return Math.max(floor, projected);
|
|
17
|
+
}
|
|
6
18
|
/**
|
|
7
19
|
* Full Möller test.
|
|
8
20
|
*
|
|
9
|
-
* `planeEps` is the
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
21
|
+
* `planeEps` is the tolerance on signed plane distance: distances with
|
|
22
|
+
* |d| / |N| <= eps are treated as zero (on-plane). A scalar is used as-is; a
|
|
23
|
+
* {@link ProjectedPlaneEps} is resolved per plane against that plane's own
|
|
24
|
+
* normal, so each of the two plane tests gets its own direction-correct
|
|
25
|
+
* tolerance. Defaults to 1e-6 in model-native units, which is only valid
|
|
26
|
+
* near the origin (see `scaledPlaneEps` in `./narrow-phase.js`); the
|
|
27
|
+
* production call path (`narrowPhase`) always supplies an explicit,
|
|
28
|
+
* coordinate-scaled value, so this default only applies to
|
|
29
|
+
* direct/standalone callers.
|
|
15
30
|
*/
|
|
16
31
|
export function triTriIntersect(a, b, planeEps = 1e-6) {
|
|
17
32
|
if (isDegenerate(a) || isDegenerate(b))
|
|
@@ -20,24 +35,26 @@ export function triTriIntersect(a, b, planeEps = 1e-6) {
|
|
|
20
35
|
const N2 = triangleNormalRaw(b);
|
|
21
36
|
const ln2 = length3(N2);
|
|
22
37
|
const d2 = -dot3(N2, b.v0);
|
|
38
|
+
const epsB = epsForPlane(planeEps, N2, ln2);
|
|
23
39
|
const dA0 = (dot3(N2, a.v0) + d2) / ln2;
|
|
24
40
|
const dA1 = (dot3(N2, a.v1) + d2) / ln2;
|
|
25
41
|
const dA2 = (dot3(N2, a.v2) + d2) / ln2;
|
|
26
|
-
const sA0 = signOf(dA0,
|
|
27
|
-
const sA1 = signOf(dA1,
|
|
28
|
-
const sA2 = signOf(dA2,
|
|
42
|
+
const sA0 = signOf(dA0, epsB);
|
|
43
|
+
const sA1 = signOf(dA1, epsB);
|
|
44
|
+
const sA2 = signOf(dA2, epsB);
|
|
29
45
|
if (sA0 === sA1 && sA1 === sA2 && sA0 !== 0)
|
|
30
46
|
return { kind: "none" };
|
|
31
47
|
// Plane of A
|
|
32
48
|
const N1 = triangleNormalRaw(a);
|
|
33
49
|
const ln1 = length3(N1);
|
|
34
50
|
const d1 = -dot3(N1, a.v0);
|
|
51
|
+
const epsA = epsForPlane(planeEps, N1, ln1);
|
|
35
52
|
const dB0 = (dot3(N1, b.v0) + d1) / ln1;
|
|
36
53
|
const dB1 = (dot3(N1, b.v1) + d1) / ln1;
|
|
37
54
|
const dB2 = (dot3(N1, b.v2) + d1) / ln1;
|
|
38
|
-
const sB0 = signOf(dB0,
|
|
39
|
-
const sB1 = signOf(dB1,
|
|
40
|
-
const sB2 = signOf(dB2,
|
|
55
|
+
const sB0 = signOf(dB0, epsA);
|
|
56
|
+
const sB1 = signOf(dB1, epsA);
|
|
57
|
+
const sB2 = signOf(dB2, epsA);
|
|
41
58
|
if (sB0 === sB1 && sB1 === sB2 && sB0 !== 0)
|
|
42
59
|
return { kind: "none" };
|
|
43
60
|
// All-zero on either side → coplanar
|
|
@@ -50,9 +67,15 @@ export function triTriIntersect(a, b, planeEps = 1e-6) {
|
|
|
50
67
|
const chordB = triChord(b, dB0, dB1, dB2);
|
|
51
68
|
if (!chordA || !chordB)
|
|
52
69
|
return { kind: "none" };
|
|
53
|
-
// Overlap along the common intersection line.
|
|
70
|
+
// Overlap along the common intersection line. The slop here compares
|
|
71
|
+
// coordinates along one world axis (`dAxis`), so a ProjectedPlaneEps
|
|
72
|
+
// resolves to that axis's own noise amplitude (the projection of
|
|
73
|
+
// `axisNoise` onto the axis unit vector), floored the same way.
|
|
54
74
|
const D = cross3(N1, N2);
|
|
55
75
|
const dAxis = dominantAxis(D);
|
|
76
|
+
const lineEps = typeof planeEps === "number"
|
|
77
|
+
? planeEps
|
|
78
|
+
: Math.max(planeEps.floor, planeEps.axisNoise[dAxis]);
|
|
56
79
|
const ta0 = chordA[0][dAxis];
|
|
57
80
|
const ta1 = chordA[1][dAxis];
|
|
58
81
|
const tb0 = chordB[0][dAxis];
|
|
@@ -63,7 +86,7 @@ export function triTriIntersect(a, b, planeEps = 1e-6) {
|
|
|
63
86
|
const bMax = Math.max(tb0, tb1);
|
|
64
87
|
const oMin = Math.max(aMin, bMin);
|
|
65
88
|
const oMax = Math.min(aMax, bMax);
|
|
66
|
-
if (oMax < oMin -
|
|
89
|
+
if (oMax < oMin - lineEps)
|
|
67
90
|
return { kind: "none" };
|
|
68
91
|
// Reconstruct 3D endpoints of the overlap on the intersection line by
|
|
69
92
|
// picking the chord whose parameter interval matches the overlap.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tri-tri.js","sourceRoot":"","sources":["../../src/contact/tri-tri.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAW/D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"tri-tri.js","sourceRoot":"","sources":["../../src/contact/tri-tri.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAW/D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEhE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAgC/D;+CAC+C;AAC/C,SAAS,WAAW,CAAC,QAAkB,EAAE,CAAO,EAAE,EAAU;IAC1D,IAAI,OAAO,QAAQ,KAAK,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAClD,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IACtC,MAAM,SAAS,GACb,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC;QAC7B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;QAChC,EAAE,CAAC;IACL,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;AACpC,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,eA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AI,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC/D,OAAO,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AAClF,CAAC;AAED,SAAS,SAAS,CAAC,KAA4B,EAAE,IAAe,EAAE,CAAS;IACzE,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAW,CAAC;IACnC,MAAM,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAW,CAAC;IACnC,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,CAAC;IACpB,IAAI,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK;QAAE,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC;IAC7C,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC;IAC1B,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACtC,CAAC;AAED,2EAA2E;AAC3E,0CAA0C;AAC1C,KAAK,IAAI,CAAC"}
|
|
@@ -18,7 +18,11 @@ import type { AABB } from '@ifc-lite/spatial';
|
|
|
18
18
|
* Two properties make it the tolerance a user can reason about:
|
|
19
19
|
* - **Pure translation gives exactly the translation length.** Every corner
|
|
20
20
|
* moves by `d`, so the result is `|d|`, whatever the shape and whatever the
|
|
21
|
-
* direction. That is what makes
|
|
21
|
+
* direction. That is what makes *this metric* isotropic, where IoU was not.
|
|
22
|
+
* The gate around it is not: `findDuplicates` preconditions on
|
|
23
|
+
* {@link boxesTouch}, so the effective tolerance per axis is
|
|
24
|
+
* `min(positionTolerance, extent on that axis)` and an element thinner than
|
|
25
|
+
* the tolerance gets less than the full tolerance along its thin axis.
|
|
22
26
|
* - **A size difference counts too.** Concentric boxes whose faces differ by δ
|
|
23
27
|
* are δ apart, so this is centre distance *and* a shape check in one number,
|
|
24
28
|
* with no second, dimensionless knob.
|
|
@@ -40,13 +44,27 @@ export declare function boxDistance(a: AABB, b: AABB): number;
|
|
|
40
44
|
* neighbour it never intersects. Touching (zero gap) counts, so coincident
|
|
41
45
|
* planar and point geometry still qualifies.
|
|
42
46
|
*
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* `
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
47
|
+
* Being a precondition, this — not `positionTolerance` alone — sets the
|
|
48
|
+
* EFFECTIVE tolerance: two copies separate once the offset exceeds the
|
|
49
|
+
* element's own extent on the offset axis, so the pass matches within
|
|
50
|
+
* `min(positionTolerance, extent on that axis)` per axis. Only elements
|
|
51
|
+
* thicker than the tolerance get the full tolerance on every axis; a 2 mm
|
|
52
|
+
* plate gets 10 mm in its plane and 2 mm along its normal at the 10 mm
|
|
53
|
+
* default. The zero-thickness sheet is the limiting case, not the only one.
|
|
54
|
+
* The same touch condition is enforced a second time, independently, by the
|
|
55
|
+
* sweep's eviction on whichever axis it sweeps (`duplicates.ts`), so widening
|
|
56
|
+
* only this test would not make the pass isotropic.
|
|
57
|
+
*
|
|
58
|
+
* That excludes pairs the legacy IoU fallback reported: sheets offset a few
|
|
59
|
+
* millimetres ALONG THEIR OWN NORMAL are disjoint (any gap on that axis fails
|
|
60
|
+
* this test), where the old `aabbApproxEqual` fallback called boxes within
|
|
61
|
+
* `positionTolerance` per axis the same place. Same reasoning as the 5 mm
|
|
62
|
+
* fixing: geometry with clear air between the surfaces is two objects, not one
|
|
63
|
+
* modelled twice. Inflating this test by the tolerance to make the pass
|
|
64
|
+
* isotropic would reopen exactly that case — it breaks both the "does not pair
|
|
65
|
+
* two small elements that do not even touch" and "does not pair two disjoint
|
|
66
|
+
* sheets offset along their own normal" tests, which is why the anisotropy is
|
|
67
|
+
* documented rather than removed. */
|
|
50
68
|
export declare function boxesTouch(a: AABB, b: AABB): boolean;
|
|
51
69
|
/** Legacy IoU similarity in `[0,1]`, falling back to box-equality for degenerate
|
|
52
70
|
* (zero-volume / planar) elements where IoU is undefined. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"duplicate-metric.d.ts","sourceRoot":"","sources":["../src/duplicate-metric.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AA4B9C
|
|
1
|
+
{"version":3,"file":"duplicate-metric.d.ts","sourceRoot":"","sources":["../src/duplicate-metric.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AA4B9C;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,MAAM,CAOpD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;sCA0BsC;AACtC,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CAKpD;AAED;8DAC8D;AAC9D,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,GAAG,MAAM,CAQhE;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAEzC"}
|
package/dist/duplicate-metric.js
CHANGED
|
@@ -37,7 +37,11 @@ function aabbApproxEqual(a, b, tol) {
|
|
|
37
37
|
* Two properties make it the tolerance a user can reason about:
|
|
38
38
|
* - **Pure translation gives exactly the translation length.** Every corner
|
|
39
39
|
* moves by `d`, so the result is `|d|`, whatever the shape and whatever the
|
|
40
|
-
* direction. That is what makes
|
|
40
|
+
* direction. That is what makes *this metric* isotropic, where IoU was not.
|
|
41
|
+
* The gate around it is not: `findDuplicates` preconditions on
|
|
42
|
+
* {@link boxesTouch}, so the effective tolerance per axis is
|
|
43
|
+
* `min(positionTolerance, extent on that axis)` and an element thinner than
|
|
44
|
+
* the tolerance gets less than the full tolerance along its thin axis.
|
|
41
45
|
* - **A size difference counts too.** Concentric boxes whose faces differ by δ
|
|
42
46
|
* are δ apart, so this is centre distance *and* a shape check in one number,
|
|
43
47
|
* with no second, dimensionless knob.
|
|
@@ -66,13 +70,27 @@ export function boxDistance(a, b) {
|
|
|
66
70
|
* neighbour it never intersects. Touching (zero gap) counts, so coincident
|
|
67
71
|
* planar and point geometry still qualifies.
|
|
68
72
|
*
|
|
69
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
* `
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
73
|
+
* Being a precondition, this — not `positionTolerance` alone — sets the
|
|
74
|
+
* EFFECTIVE tolerance: two copies separate once the offset exceeds the
|
|
75
|
+
* element's own extent on the offset axis, so the pass matches within
|
|
76
|
+
* `min(positionTolerance, extent on that axis)` per axis. Only elements
|
|
77
|
+
* thicker than the tolerance get the full tolerance on every axis; a 2 mm
|
|
78
|
+
* plate gets 10 mm in its plane and 2 mm along its normal at the 10 mm
|
|
79
|
+
* default. The zero-thickness sheet is the limiting case, not the only one.
|
|
80
|
+
* The same touch condition is enforced a second time, independently, by the
|
|
81
|
+
* sweep's eviction on whichever axis it sweeps (`duplicates.ts`), so widening
|
|
82
|
+
* only this test would not make the pass isotropic.
|
|
83
|
+
*
|
|
84
|
+
* That excludes pairs the legacy IoU fallback reported: sheets offset a few
|
|
85
|
+
* millimetres ALONG THEIR OWN NORMAL are disjoint (any gap on that axis fails
|
|
86
|
+
* this test), where the old `aabbApproxEqual` fallback called boxes within
|
|
87
|
+
* `positionTolerance` per axis the same place. Same reasoning as the 5 mm
|
|
88
|
+
* fixing: geometry with clear air between the surfaces is two objects, not one
|
|
89
|
+
* modelled twice. Inflating this test by the tolerance to make the pass
|
|
90
|
+
* isotropic would reopen exactly that case — it breaks both the "does not pair
|
|
91
|
+
* two small elements that do not even touch" and "does not pair two disjoint
|
|
92
|
+
* sheets offset along their own normal" tests, which is why the anisotropy is
|
|
93
|
+
* documented rather than removed. */
|
|
76
94
|
export function boxesTouch(a, b) {
|
|
77
95
|
for (let i = 0; i < 3; i += 1) {
|
|
78
96
|
if (Math.min(a.max[i], b.max[i]) < Math.max(a.min[i], b.min[i]))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"duplicate-metric.js","sourceRoot":"","sources":["../src/duplicate-metric.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAc/D,SAAS,UAAU,CAAC,CAAO;IACzB,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC;AACtB,CAAC;AAED,8DAA8D;AAC9D,SAAS,OAAO,CAAC,CAAO,EAAE,CAAO;IAC/B,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,IAA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D,OAAO,IAAI,CAAC;AACd,CAAC;AAED;8DAC8D;AAC9D,MAAM,UAAU,UAAU,CAAC,CAAO,EAAE,CAAO,EAAE,GAAW;IACtD,MAAM,GAAG,GAAG,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1B,IAAI,GAAG,GAAG,CAAC;QAAE,OAAO,GAAG,CAAC;IACxB,uEAAuE;IACvE,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QAC7C,OAAO,eAAe,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC5C,CAAC;IACD,OAAO,CAAC,CAAC;AACX,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,SAAS,CAAC,CAAO;IAC/B,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AACjF,CAAC"}
|
package/dist/duplicates.d.ts
CHANGED
|
@@ -6,6 +6,15 @@ export interface DuplicateOptions {
|
|
|
6
6
|
* `ClashResult.settings.tolerance`. It bounds {@link boxDistance}: for two
|
|
7
7
|
* equally-sized boxes that is exactly the distance between their centres, and
|
|
8
8
|
* a difference in size adds to it. Default 10 mm.
|
|
9
|
+
*
|
|
10
|
+
* It is an upper bound, not the whole gate. {@link boxesTouch} is applied
|
|
11
|
+
* first, and two copies stop touching once the offset exceeds the element's
|
|
12
|
+
* own extent on the offset axis, so the EFFECTIVE tolerance per axis is
|
|
13
|
+
* `min(positionTolerance, extent on that axis)`. A 200 mm wall gets the full
|
|
14
|
+
* 10 mm on all three axes; a 2 mm plate gets 10 mm in its plane and 2 mm
|
|
15
|
+
* along its normal. That is deliberate — see {@link boxesTouch} for why
|
|
16
|
+
* clear air between two surfaces makes them two objects — and it is pinned by
|
|
17
|
+
* the "effective tolerance is min(positionTolerance, extent) per axis" test.
|
|
9
18
|
*/
|
|
10
19
|
positionTolerance?: number;
|
|
11
20
|
/** Distance (m) at/below which a same-shape pair is treated as an EXACT
|
package/dist/duplicates.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"duplicates.d.ts","sourceRoot":"","sources":["../src/duplicates.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"duplicates.d.ts","sourceRoot":"","sources":["../src/duplicates.ts"],"names":[],"mappings":"AAuCA,OAAO,KAAK,EAEV,YAAY,EAEZ,WAAW,EACX,SAAS,EAET,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,MAAM,WAAW,gBAAgB;IAC/B;;;;;;;;;;;;;;;OAeG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;wBAEoB;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;;;;;;;OAcG;IAIH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;4DACwD;IACxD,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,iFAAiF;IACjF,UAAU,CAAC,EAAE,YAAY,CAAC;CAC3B;AAWD,eAAO,MAAM,eAAe,EAAE,SAK7B,CAAC;AAOF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,YAAY,EAAE,EAAE,OAAO,GAAE,gBAAqB,GAAG,WAAW,CAwPpG"}
|