@ifc-lite/clash 1.9.1 → 1.9.2

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.
@@ -7,7 +7,10 @@
7
7
  * ever consider real building elements. (#1464)
8
8
  *
9
9
  * Spatial containers are handled separately by {@link isSpatialContainerTag},
10
- * which derives them from the schema rather than from a list.
10
+ * and voids by {@link isVoidFeatureTag} both derive from the schema rather
11
+ * than from a list. `IfcOpeningElement` / `IfcOpeningStandardCase` were
12
+ * listed here by hand and are now covered by that walk, which also catches
13
+ * the subtraction classes the list had never heard of.
11
14
  */
12
15
  export declare const NON_CLASHABLE_TAGS: ReadonlySet<string>;
13
16
  /**
@@ -28,6 +31,24 @@ export declare const NON_CLASHABLE_TAGS: ReadonlySet<string>;
28
31
  * that #1464 listed by hand.
29
32
  */
30
33
  export declare function isSpatialContainerTag(tag: string): boolean;
34
+ /**
35
+ * True for SUBTRACTION features — the classes whose geometry describes a hole
36
+ * rather than material: `IfcOpeningElement`, `IfcOpeningStandardCase`,
37
+ * `IfcVoidingFeature` and IFC4.3's `IfcEarthworksCut`. A void is meshed like
38
+ * any other product, so every one that reached the candidate set clashed with
39
+ * the very element it cuts — the phantom-clash symptom of #1464, under a class
40
+ * name the hand-written list did not carry.
41
+ *
42
+ * Derived, not enumerated: `getInheritanceChainAcrossSchemas` walks the
43
+ * bundled IFC2X3 + IFC4 + IFC4X3 union, so a subtraction class added by a
44
+ * later schema is covered the day the bundled schemas learn it.
45
+ *
46
+ * Deliberately the SUBTRACTION branch and not the whole `IfcFeatureElement`
47
+ * tree: `IfcFeatureElementAddition` (`IfcProjectionElement`, a corbel) and
48
+ * `IfcSurfaceFeature` are physical material that occupies space, so a clash
49
+ * against them is a real coordination problem and must keep being reported.
50
+ */
51
+ export declare function isVoidFeatureTag(tag: string): boolean;
31
52
  /**
32
53
  * Whether an element carrying this IFC class `tag` should never become a
33
54
  * clash candidate: non-physical/reference geometry, a spatial container, or
@@ -1 +1 @@
1
- {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/adapters/shared.ts"],"names":[],"mappings":"AA2CA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAUjD,CAAC;AAKH;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAS1D;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAMtD;AAED,iFAAiF;AACjF,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG;IAAE,SAAS,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CA6BrG"}
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/adapters/shared.ts"],"names":[],"mappings":"AA2CA;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,kBAAkB,EAAE,WAAW,CAAC,MAAM,CAQjD,CAAC;AAKH;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAS1D;AAKD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAMrD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAOtD;AAED,iFAAiF;AACjF,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,YAAY,CAAC;IACxB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,EAAE,GAAG;IAAE,SAAS,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,WAAW,CAAA;CAAE,CA6BrG"}
@@ -47,11 +47,12 @@ import { getInheritanceChainAcrossSchemas, isIfcTypeLikeEntity } from '@ifc-lite
47
47
  * ever consider real building elements. (#1464)
48
48
  *
49
49
  * Spatial containers are handled separately by {@link isSpatialContainerTag},
50
- * which derives them from the schema rather than from a list.
50
+ * and voids by {@link isVoidFeatureTag} both derive from the schema rather
51
+ * than from a list. `IfcOpeningElement` / `IfcOpeningStandardCase` were
52
+ * listed here by hand and are now covered by that walk, which also catches
53
+ * the subtraction classes the list had never heard of.
51
54
  */
52
55
  export const NON_CLASHABLE_TAGS = new Set([
53
- 'IfcOpeningElement',
54
- 'IfcOpeningStandardCase',
55
56
  'IfcVirtualElement',
56
57
  'IfcGrid',
57
58
  'IfcGridAxis',
@@ -88,6 +89,33 @@ export function isSpatialContainerTag(tag) {
88
89
  spatialContainerByTag.set(tag, spatial);
89
90
  return spatial;
90
91
  }
92
+ /** Memoizes the void-feature walk below, like `spatialContainerByTag`. */
93
+ const voidFeatureByTag = new Map();
94
+ /**
95
+ * True for SUBTRACTION features — the classes whose geometry describes a hole
96
+ * rather than material: `IfcOpeningElement`, `IfcOpeningStandardCase`,
97
+ * `IfcVoidingFeature` and IFC4.3's `IfcEarthworksCut`. A void is meshed like
98
+ * any other product, so every one that reached the candidate set clashed with
99
+ * the very element it cuts — the phantom-clash symptom of #1464, under a class
100
+ * name the hand-written list did not carry.
101
+ *
102
+ * Derived, not enumerated: `getInheritanceChainAcrossSchemas` walks the
103
+ * bundled IFC2X3 + IFC4 + IFC4X3 union, so a subtraction class added by a
104
+ * later schema is covered the day the bundled schemas learn it.
105
+ *
106
+ * Deliberately the SUBTRACTION branch and not the whole `IfcFeatureElement`
107
+ * tree: `IfcFeatureElementAddition` (`IfcProjectionElement`, a corbel) and
108
+ * `IfcSurfaceFeature` are physical material that occupies space, so a clash
109
+ * against them is a real coordination problem and must keep being reported.
110
+ */
111
+ export function isVoidFeatureTag(tag) {
112
+ const cached = voidFeatureByTag.get(tag);
113
+ if (cached !== undefined)
114
+ return cached;
115
+ const isVoid = getInheritanceChainAcrossSchemas(tag).includes('IfcFeatureElementSubtraction');
116
+ voidFeatureByTag.set(tag, isVoid);
117
+ return isVoid;
118
+ }
91
119
  /**
92
120
  * Whether an element carrying this IFC class `tag` should never become a
93
121
  * clash candidate: non-physical/reference geometry, a spatial container, or
@@ -97,6 +125,7 @@ export function isSpatialContainerTag(tag) {
97
125
  */
98
126
  export function isNonClashableTag(tag) {
99
127
  return (NON_CLASHABLE_TAGS.has(tag) ||
128
+ isVoidFeatureTag(tag) ||
100
129
  isSpatialContainerTag(tag) ||
101
130
  isIfcTypeLikeEntity(tag.toUpperCase()));
102
131
  }
@@ -1 +1 @@
1
- {"version":3,"file":"shared.js","sourceRoot":"","sources":["../../src/adapters/shared.ts"],"names":[],"mappings":"AAAA;;+DAE+D;AAE/D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AAEH,OAAO,EAAE,gCAAgC,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAEzF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC;IAC7D,mBAAmB;IACnB,wBAAwB;IACxB,mBAAmB;IACnB,SAAS;IACT,aAAa;IACb,eAAe;IACf,aAAa;IACb,wBAAwB;IACxB,kBAAkB;CACnB,CAAC,CAAC;AAEH,+EAA+E;AAC/E,MAAM,qBAAqB,GAAG,IAAI,GAAG,EAAmB,CAAC;AAEzD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,MAAM,MAAM,GAAG,qBAAqB,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC9C,IAAI,MAAM,KAAK,SAAS;QAAE,OAAO,MAAM,CAAC;IACxC,MAAM,KAAK,GAAG,gCAAgC,CAAC,GAAG,CAAC,CA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— representation-agnostic core engine + source adapters",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -34,12 +34,12 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@ifc-lite/spatial": "^1.14.15",
37
+ "@ifc-lite/geometry": "^4.1.0",
37
38
  "@ifc-lite/query": "^2.0.0",
38
- "@ifc-lite/parser": "^4.3.0",
39
39
  "@ifc-lite/bcf": "^2.0.0",
40
- "@ifc-lite/ifcx": "^3.0.0",
41
- "@ifc-lite/geometry": "^4.0.0",
42
- "@ifc-lite/wasm": "^6.0.0"
40
+ "@ifc-lite/parser": "^4.3.2",
41
+ "@ifc-lite/ifcx": "^3.0.1",
42
+ "@ifc-lite/wasm": "^6.1.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "typescript": "^6.0.3",