@bldrs-ai/conway 1.352.1113 → 1.353.1118
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/compiled/examples/browser-bundled.cjs +1 -1
- package/compiled/examples/cli-bundled.cjs +1 -1
- package/compiled/examples/cli-step-bundled.cjs +81 -3
- package/compiled/examples/validator-bundled.cjs +1 -1
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_geometry_extraction.js +28 -1
- package/compiled/src/AP214E3_2010/ap214_occurrence_geometry.test.d.ts +2 -0
- package/compiled/src/AP214E3_2010/ap214_occurrence_geometry.test.d.ts.map +1 -0
- package/compiled/src/AP214E3_2010/ap214_occurrence_geometry.test.js +106 -0
- package/compiled/src/AP214E3_2010/ap214_scene_builder.d.ts +45 -1
- package/compiled/src/AP214E3_2010/ap214_scene_builder.d.ts.map +1 -1
- package/compiled/src/AP214E3_2010/ap214_scene_builder.js +83 -2
- package/compiled/src/compat/web-ifc/ifc_api.d.ts +1 -0
- package/compiled/src/compat/web-ifc/ifc_api.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api.smoke.test.js +33 -0
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.d.ts.map +1 -1
- package/compiled/src/compat/web-ifc/ifc_api_proxy_ap214.js +6 -2
- package/compiled/src/version/version.js +1 -1
- package/compiled/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -69608,7 +69608,7 @@ var IfcStepParser = class extends StepParser {
|
|
|
69608
69608
|
IfcStepParser.Instance = new IfcStepParser();
|
|
69609
69609
|
|
|
69610
69610
|
// compiled/src/version/version.js
|
|
69611
|
-
var versionString = "Conway Web-Ifc Shim v1.
|
|
69611
|
+
var versionString = "Conway Web-Ifc Shim v1.353.1118";
|
|
69612
69612
|
|
|
69613
69613
|
// compiled/src/statistics/statistics.js
|
|
69614
69614
|
var Statistics = class {
|
|
@@ -85869,7 +85869,7 @@ var IfcSceneBuilder = class {
|
|
|
85869
85869
|
};
|
|
85870
85870
|
|
|
85871
85871
|
// compiled/src/version/version.js
|
|
85872
|
-
var versionString = "Conway Web-Ifc Shim v1.
|
|
85872
|
+
var versionString = "Conway Web-Ifc Shim v1.353.1118";
|
|
85873
85873
|
|
|
85874
85874
|
// compiled/src/statistics/statistics.js
|
|
85875
85875
|
var Statistics = class {
|
|
@@ -79320,7 +79320,7 @@ var ExtractResult;
|
|
|
79320
79320
|
})(ExtractResult || (ExtractResult = {}));
|
|
79321
79321
|
|
|
79322
79322
|
// compiled/src/version/version.js
|
|
79323
|
-
var versionString = "Conway Web-Ifc Shim v1.
|
|
79323
|
+
var versionString = "Conway Web-Ifc Shim v1.353.1118";
|
|
79324
79324
|
|
|
79325
79325
|
// compiled/src/statistics/statistics.js
|
|
79326
79326
|
var Statistics = class {
|
|
@@ -79975,13 +79975,14 @@ var AP214SceneGeometry = class {
|
|
|
79975
79975
|
* @param parentIndex
|
|
79976
79976
|
* @param materialOverideLocalID
|
|
79977
79977
|
*/
|
|
79978
|
-
constructor(model, localID, index, relatedElementLocalId, parentIndex, materialOverideLocalID) {
|
|
79978
|
+
constructor(model, localID, index, relatedElementLocalId, parentIndex, materialOverideLocalID, occurrencePath = []) {
|
|
79979
79979
|
this.model = model;
|
|
79980
79980
|
this.localID = localID;
|
|
79981
79981
|
this.index = index;
|
|
79982
79982
|
this.relatedElementLocalId = relatedElementLocalId;
|
|
79983
79983
|
this.parentIndex = parentIndex;
|
|
79984
79984
|
this.materialOverideLocalID = materialOverideLocalID;
|
|
79985
|
+
this.occurrencePath = occurrencePath;
|
|
79985
79986
|
this.type = SceneNodeModelType.GEOMETRY;
|
|
79986
79987
|
}
|
|
79987
79988
|
};
|
|
@@ -80001,6 +80002,7 @@ var AP214SceneBuilder = class {
|
|
|
80001
80002
|
this.sceneLocalIdMap_ = /* @__PURE__ */ new Map();
|
|
80002
80003
|
this.geometrySet_ = /* @__PURE__ */ new Set();
|
|
80003
80004
|
this.sceneStack_ = [];
|
|
80005
|
+
this.occurrenceStack_ = [];
|
|
80004
80006
|
}
|
|
80005
80007
|
get currentParent() {
|
|
80006
80008
|
return this.currentParent_;
|
|
@@ -80101,8 +80103,24 @@ var AP214SceneBuilder = class {
|
|
|
80101
80103
|
*/
|
|
80102
80104
|
clearParentStack() {
|
|
80103
80105
|
this.sceneStack_.length = 0;
|
|
80106
|
+
this.occurrenceStack_.length = 0;
|
|
80104
80107
|
delete this.currentParent_;
|
|
80105
80108
|
}
|
|
80109
|
+
/**
|
|
80110
|
+
* Enter an assembly occurrence: subsequent geometry is stamped as belonging
|
|
80111
|
+
* to this NAUO. Balanced by {@link popOccurrence}.
|
|
80112
|
+
*
|
|
80113
|
+
* @param occurrenceExpressID The NAUO express id of the placement being entered.
|
|
80114
|
+
*/
|
|
80115
|
+
pushOccurrence(occurrenceExpressID) {
|
|
80116
|
+
this.occurrenceStack_.push(occurrenceExpressID);
|
|
80117
|
+
}
|
|
80118
|
+
/**
|
|
80119
|
+
* Leave the most recently entered assembly occurrence.
|
|
80120
|
+
*/
|
|
80121
|
+
popOccurrence() {
|
|
80122
|
+
this.occurrenceStack_.pop();
|
|
80123
|
+
}
|
|
80106
80124
|
/**
|
|
80107
80125
|
*
|
|
80108
80126
|
* @param localID
|
|
@@ -80218,6 +80236,56 @@ var AP214SceneBuilder = class {
|
|
|
80218
80236
|
}
|
|
80219
80237
|
}
|
|
80220
80238
|
}
|
|
80239
|
+
/**
|
|
80240
|
+
* Same as {@link walk}, but also yields each geometry instance's occurrence
|
|
80241
|
+
* path (NAUO express ids) as a 6th element. Kept separate from `walk` (which
|
|
80242
|
+
* satisfies the shared `WalkableScene` contract) so the AP214 shim can attach
|
|
80243
|
+
* per-instance occurrence identity to each emitted PlacedGeometry without
|
|
80244
|
+
* changing the interface every scene builder implements.
|
|
80245
|
+
*
|
|
80246
|
+
* @param includeSpaces Unused; kept for signature parity with `walk`.
|
|
80247
|
+
* @yields walk tuple plus the occurrence path of the geometry instance.
|
|
80248
|
+
*/
|
|
80249
|
+
*walkWithOccurrence(includeSpaces = false) {
|
|
80250
|
+
for (const node of this.scene_) {
|
|
80251
|
+
if (node instanceof AP214SceneGeometry) {
|
|
80252
|
+
const geometry = node.model.geometry?.getByLocalID(node.localID);
|
|
80253
|
+
if (geometry === void 0) {
|
|
80254
|
+
continue;
|
|
80255
|
+
}
|
|
80256
|
+
const parentNode = node.parentIndex !== void 0 ? this.scene_[node.parentIndex] : void 0;
|
|
80257
|
+
const material = this.materials.getMaterialByGeometryID(geometry.localID);
|
|
80258
|
+
yield [
|
|
80259
|
+
parentNode?.absoluteTransform,
|
|
80260
|
+
parentNode?.absoluteNativeTransform,
|
|
80261
|
+
geometry,
|
|
80262
|
+
material !== void 0 ? material[0] : void 0,
|
|
80263
|
+
node.relatedElementLocalId !== void 0 ? this.model.getElementByLocalID(node.relatedElementLocalId) : void 0,
|
|
80264
|
+
node.occurrencePath
|
|
80265
|
+
];
|
|
80266
|
+
}
|
|
80267
|
+
}
|
|
80268
|
+
}
|
|
80269
|
+
/**
|
|
80270
|
+
* Walk every geometry node yielding its owning part-type element (the
|
|
80271
|
+
* `product_definition_shape`, shared across occurrences) alongside the
|
|
80272
|
+
* occurrence path (NAUO express ids) that uniquely places it. This is the
|
|
80273
|
+
* seam that lets a picked mesh resolve to the right product-structure node:
|
|
80274
|
+
* the owner id alone collides across reused parts; the occurrence path does not.
|
|
80275
|
+
*
|
|
80276
|
+
* @yields [owning element, occurrence path] per geometry node.
|
|
80277
|
+
*/
|
|
80278
|
+
*geometryOccurrences() {
|
|
80279
|
+
for (const node of this.scene_) {
|
|
80280
|
+
if (node instanceof AP214SceneGeometry) {
|
|
80281
|
+
if (this.model.geometry?.getByLocalID(node.localID) === void 0) {
|
|
80282
|
+
continue;
|
|
80283
|
+
}
|
|
80284
|
+
const owner = node.relatedElementLocalId !== void 0 ? this.model.getElementByLocalID(node.relatedElementLocalId) : void 0;
|
|
80285
|
+
yield [owner, node.occurrencePath];
|
|
80286
|
+
}
|
|
80287
|
+
}
|
|
80288
|
+
}
|
|
80221
80289
|
/**
|
|
80222
80290
|
*
|
|
80223
80291
|
*/
|
|
@@ -80260,7 +80328,7 @@ var AP214SceneBuilder = class {
|
|
|
80260
80328
|
} else {
|
|
80261
80329
|
this.roots.push(nodeIndex);
|
|
80262
80330
|
}
|
|
80263
|
-
const result = new AP214SceneGeometry(this.model, localID, nodeIndex, owningElementLocalID, parentIndex, materialOverridLocalID);
|
|
80331
|
+
const result = new AP214SceneGeometry(this.model, localID, nodeIndex, owningElementLocalID, parentIndex, materialOverridLocalID, this.occurrenceStack_.slice());
|
|
80264
80332
|
this.scene_.push(result);
|
|
80265
80333
|
const geometryChildren = this.model.geometry?.getChildrenByLocalID(localID);
|
|
80266
80334
|
if (geometryChildren !== void 0) {
|
|
@@ -82856,6 +82924,15 @@ ${error.stack} - expressID: #${face_.expressID}`);
|
|
|
82856
82924
|
const mappedChild = treeMap.get(childLocalID);
|
|
82857
82925
|
const enterChildStackDepth = this.scene.stackLength;
|
|
82858
82926
|
const enterChildParent = this.scene.currentParent;
|
|
82927
|
+
const owningElement = this.model.getElementByLocalID(childOwningLocalID);
|
|
82928
|
+
let occurrenceExpressID;
|
|
82929
|
+
try {
|
|
82930
|
+
occurrenceExpressID = owningElement instanceof property_definition ? owningElement.definition?.expressID : void 0;
|
|
82931
|
+
} catch {
|
|
82932
|
+
occurrenceExpressID = void 0;
|
|
82933
|
+
}
|
|
82934
|
+
occurrenceExpressID ??= this.model.getExpressIDByLocalID(childOwningLocalID);
|
|
82935
|
+
this.scene.pushOccurrence(occurrenceExpressID ?? childOwningLocalID);
|
|
82859
82936
|
try {
|
|
82860
82937
|
mappedChild.thunk(childOwningLocalID, childTransform);
|
|
82861
82938
|
} catch (ex) {
|
|
@@ -82868,6 +82945,7 @@ ${error.stack} - expressID: #${face_.expressID}`);
|
|
|
82868
82945
|
Logger.error(`Unknown exception processing child shape_representation (${ex}) expressID: #${this.model.getExpressIDByLocalID(childLocalID)}`);
|
|
82869
82946
|
}
|
|
82870
82947
|
}
|
|
82948
|
+
this.scene.popOccurrence();
|
|
82871
82949
|
while (this.scene.stackLength > enterChildStackDepth) {
|
|
82872
82950
|
this.scene.popTransform();
|
|
82873
82951
|
}
|
|
@@ -69606,7 +69606,7 @@ var IfcStepParser = class extends StepParser {
|
|
|
69606
69606
|
IfcStepParser.Instance = new IfcStepParser();
|
|
69607
69607
|
|
|
69608
69608
|
// compiled/src/version/version.js
|
|
69609
|
-
var versionString = "Conway Web-Ifc Shim v1.
|
|
69609
|
+
var versionString = "Conway Web-Ifc Shim v1.353.1118";
|
|
69610
69610
|
|
|
69611
69611
|
// compiled/src/statistics/statistics.js
|
|
69612
69612
|
var Statistics = class {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ap214_geometry_extraction.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_geometry_extraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,sBAAsB,EAEtB,OAAO,EACP,WAAW,EAOX,wBAAwB,EAMxB,aAAa,EACb,SAAS,EACT,sBAAsB,EAEtB,cAAc,EACd,iBAAiB,EAOjB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EAItB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAqB,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EAEnB,8BAA8B,EAC9B,mBAAmB,EACnB,mBAAmB,EACnB,gCAAgC,EAChC,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACX,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAExD,OAAO,EAEL,aAAa,EAEb,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,yBAAyB,EACzB,gBAAgB,EAEhB,cAAc,EACd,eAAe,EACf,oCAAoC,EACpC,oCAAoC,EACpC,MAAM,EACN,UAAU,EACV,eAAe,EAEf,eAAe,EACf,kBAAkB,EAGlB,KAAK,EACL,mBAAmB,EACnB,SAAS,EAIT,OAAO,EACP,mBAAmB,EACnB,IAAI,EACJ,wBAAwB,EACxB,YAAY,EAMZ,gBAAgB,EAGhB,WAAW,EACX,IAAI,EACJ,mBAAmB,EACnB,WAAW,EAKX,MAAM,EACN,SAAS,EAAE,KAAK,EAEhB,QAAQ,
|
|
1
|
+
{"version":3,"file":"ap214_geometry_extraction.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_geometry_extraction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,cAAc,EACd,cAAc,EACd,sBAAsB,EAEtB,OAAO,EACP,WAAW,EAOX,wBAAwB,EAMxB,aAAa,EACb,SAAS,EACT,sBAAsB,EAEtB,cAAc,EACd,iBAAiB,EAOjB,kBAAkB,EAClB,kBAAkB,EAClB,qBAAqB,EAItB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAqB,SAAS,EAAE,MAAM,4BAA4B,CAAA;AAEzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAEvD,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,mBAAmB,EAEnB,8BAA8B,EAC9B,mBAAmB,EACnB,mBAAmB,EACnB,gCAAgC,EAChC,mBAAmB,EACnB,mBAAmB,EACnB,UAAU,EACX,MAAM,sBAAsB,CAAA;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AAExD,OAAO,EAEL,aAAa,EAEb,eAAe,EACf,kBAAkB,EAClB,kBAAkB,EAClB,cAA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IAAI,EAAE,SAAS,GAAI,kBAAkB,GAAG,SAAS;IAQrE;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,kBAAkB;IAe1B;;;;;;;;;;;;;;;;OAgBG;IACH,OAAO,CAAC,iBAAiB;IAYzB;;OAEG;IACH,sBAAsB;IAiCtB;;;;OAIG;IACH,aAAa,CAAC,MAAM,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,MAAM;IAyChD,eAAe,CAAE,QAAQ,EAAE,WAAW,GAAI,MAAM,GAAG,SAAS;IAmC5D,yBAAyB,CAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAI,MAAM,GAAG,SAAS;IAe3F;;;;;;OAMG;IACH,wBAAwB,CAAC,OAAO,GAAE,OAAe,GAC/C;QAAC,aAAa;QAAE,iBAAiB;QAAE,oBAAoB;KAAC;IAoW1D;;;;;;;;OAQG;IACH,YAAY,CAAC,iBAAiB,EAAE,iCAAiC,EAAE,WAAW,EAAE,oBAAoB,EAAE,WAAW,EAAE,oBAAoB,EAAE,aAAa,EAAE,MAAM,GAAG,CAAC,kBAAkB,GAAG,SAAS,EAAE,OAAO,CAAC;CAyD3M"}
|
|
@@ -4,7 +4,7 @@ import { ObjectPool } from "../core/native_pool.js";
|
|
|
4
4
|
import { MemoizationCapture, RegressionCaptureState } from "../core/regression_capture_state.js";
|
|
5
5
|
import { ExtractResult } from "../core/shared_constants.js";
|
|
6
6
|
import Logger from "../logging/logger.js";
|
|
7
|
-
import { advanced_brep_shape_representation, advanced_face, annotation_occurrence, axis2_placement_2d, axis2_placement_3d, b_spline_curve, b_spline_curve_with_knots, b_spline_surface, b_spline_surface_with_knots, boolean_result, cartesian_point, cartesian_transformation_operator_3d, circle, colour_rgb, composite_curve, composite_curve_segment, conical_surface, context_dependent_shape_representation, conversion_based_unit, cylindrical_surface, draughting_model, edge_curve, edge_loop, ellipse, extruded_area_solid, face, face_based_surface_model, faceted_brep, fill_area_style_colour, geometric_curve_set, geometrically_bounded_2d_wireframe_representation, geometrically_bounded_wireframe_shape_representation, global_unit_assigned_context, half_space_solid, item_defined_transformation, length_unit, line, manifold_solid_brep, mapped_item, over_riding_styled_item, parameter_value, pcurve, placement, plane, poly_loop, polyline, presentation_layer_assignment, product, rational_b_spline_curve, rational_b_spline_surface, representation_item, representation_relationship_with_transformation, seam_curve, shape_definition_representation, shape_representation, shape_representation_relationship, shell_based_surface_model, si_prefix, si_unit, spherical_surface, styled_item, surface_curve, surface_of_linear_extrusion, surface_of_revolution, surface_side, surface_style_fill_area, surface_style_rendering, surface_style_usage, toroidal_surface, trimmed_curve, trimming_preference, vertex_loop, vertex_point, view_volume, } from "./AP214E3_2010_gen/index.js";
|
|
7
|
+
import { advanced_brep_shape_representation, advanced_face, annotation_occurrence, axis2_placement_2d, axis2_placement_3d, b_spline_curve, b_spline_curve_with_knots, b_spline_surface, b_spline_surface_with_knots, boolean_result, cartesian_point, cartesian_transformation_operator_3d, circle, colour_rgb, composite_curve, composite_curve_segment, conical_surface, context_dependent_shape_representation, conversion_based_unit, cylindrical_surface, draughting_model, edge_curve, edge_loop, ellipse, extruded_area_solid, face, face_based_surface_model, faceted_brep, fill_area_style_colour, geometric_curve_set, geometrically_bounded_2d_wireframe_representation, geometrically_bounded_wireframe_shape_representation, global_unit_assigned_context, half_space_solid, item_defined_transformation, length_unit, line, manifold_solid_brep, mapped_item, over_riding_styled_item, parameter_value, pcurve, placement, plane, poly_loop, polyline, presentation_layer_assignment, product, property_definition, rational_b_spline_curve, rational_b_spline_surface, representation_item, representation_relationship_with_transformation, seam_curve, shape_definition_representation, shape_representation, shape_representation_relationship, shell_based_surface_model, si_prefix, si_unit, spherical_surface, styled_item, surface_curve, surface_of_linear_extrusion, surface_of_revolution, surface_side, surface_style_fill_area, surface_style_rendering, surface_style_usage, toroidal_surface, trimmed_curve, trimming_preference, vertex_loop, vertex_point, view_volume, } from "./AP214E3_2010_gen/index.js";
|
|
8
8
|
import EntityTypesAP214 from "./AP214E3_2010_gen/entity_types_ap214.gen.js";
|
|
9
9
|
import { AP214ProductShapeMap } from "./ap214_product_shape_map.js";
|
|
10
10
|
import { AP214SceneBuilder } from "./ap214_scene_builder.js";
|
|
@@ -2805,6 +2805,32 @@ export class AP214GeometryExtraction {
|
|
|
2805
2805
|
const mappedChild = treeMap.get(childLocalID);
|
|
2806
2806
|
const enterChildStackDepth = this.scene.stackLength;
|
|
2807
2807
|
const enterChildParent = this.scene.currentParent;
|
|
2808
|
+
// A context_dependent_shape_representation places a part via a
|
|
2809
|
+
// product_definition_shape whose `definition` is the NAUO the
|
|
2810
|
+
// product-structure tree keys occurrences on
|
|
2811
|
+
// (represented_product_relation -> PDS -> NAUO). Record that NAUO's
|
|
2812
|
+
// express id so geometry added under this child carries the same
|
|
2813
|
+
// root->leaf occurrence path the tree node does; other placement
|
|
2814
|
+
// kinds fall back to the owning element's own id.
|
|
2815
|
+
const owningElement = this.model.getElementByLocalID(childOwningLocalID);
|
|
2816
|
+
// `.definition` is a getter that THROWS on a malformed/mistyped
|
|
2817
|
+
// reference, and this runs outside the per-child try/catch below —
|
|
2818
|
+
// at the top level it would escape extraction entirely. Before
|
|
2819
|
+
// occurrence stamping a bad placement merely produced no geometry,
|
|
2820
|
+
// so guard it and degrade to the owning element's own express id
|
|
2821
|
+
// rather than failing the whole model load.
|
|
2822
|
+
let occurrenceExpressID;
|
|
2823
|
+
try {
|
|
2824
|
+
occurrenceExpressID =
|
|
2825
|
+
owningElement instanceof property_definition ?
|
|
2826
|
+
owningElement.definition?.expressID : void 0;
|
|
2827
|
+
}
|
|
2828
|
+
catch {
|
|
2829
|
+
// Malformed PDS.definition — fall through to the express-id fallback.
|
|
2830
|
+
occurrenceExpressID = void 0;
|
|
2831
|
+
}
|
|
2832
|
+
occurrenceExpressID ??= this.model.getExpressIDByLocalID(childOwningLocalID);
|
|
2833
|
+
this.scene.pushOccurrence(occurrenceExpressID ?? childOwningLocalID);
|
|
2808
2834
|
try {
|
|
2809
2835
|
mappedChild.thunk(childOwningLocalID, childTransform);
|
|
2810
2836
|
}
|
|
@@ -2816,6 +2842,7 @@ export class AP214GeometryExtraction {
|
|
|
2816
2842
|
Logger.error(`Unknown exception processing child shape_representation (${ex}) expressID: #${this.model.getExpressIDByLocalID(childLocalID)}`);
|
|
2817
2843
|
}
|
|
2818
2844
|
}
|
|
2845
|
+
this.scene.popOccurrence();
|
|
2819
2846
|
while (this.scene.stackLength > enterChildStackDepth) {
|
|
2820
2847
|
this.scene.popTransform();
|
|
2821
2848
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ap214_occurrence_geometry.test.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_occurrence_geometry.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { describe, expect, test, beforeAll } from "@jest/globals";
|
|
3
|
+
import { AP214GeometryExtraction } from "./ap214_geometry_extraction.js";
|
|
4
|
+
import { ParseResult } from "../step/parsing/step_parser.js";
|
|
5
|
+
import AP214StepParser from "./ap214_step_parser.js";
|
|
6
|
+
import ParsingBuffer from "../parsing/parsing_buffer.js";
|
|
7
|
+
import { ConwayGeometry } from "../../dependencies/conway-geom/index.js";
|
|
8
|
+
import { ExtractResult } from "../core/shared_constants.js";
|
|
9
|
+
import { AP214Properties } from "../compat/web-ifc/ap214_properties.js";
|
|
10
|
+
/**
|
|
11
|
+
* The geometry-rich NIST `as1-oc-214` assembly (real BREP + a 13-NAUO
|
|
12
|
+
* occurrence tree, parts placed via context_dependent_shape_representation).
|
|
13
|
+
* Unlike the structure-only `as1-assembly.step` stub, this fixture pairs
|
|
14
|
+
* geometry with instancing, so it is the reference case for occurrence-keyed
|
|
15
|
+
* selection (Share NavTree <-> scene): the same leaf part (e.g. the nut) is
|
|
16
|
+
* reused across occurrences, so its scalar expressID collides while its
|
|
17
|
+
* occurrence path is unique.
|
|
18
|
+
*/
|
|
19
|
+
const FIXTURE = "data/as1-oc-214.stp";
|
|
20
|
+
let model;
|
|
21
|
+
let scene;
|
|
22
|
+
beforeAll(async () => {
|
|
23
|
+
const parser = AP214StepParser.Instance;
|
|
24
|
+
const buffer = new ParsingBuffer(fs.readFileSync(FIXTURE));
|
|
25
|
+
expect(parser.parseHeader(buffer)[1]).toBe(ParseResult.COMPLETE);
|
|
26
|
+
const [, parsed] = parser.parseDataToModel(buffer);
|
|
27
|
+
expect(parsed).not.toBe(void 0);
|
|
28
|
+
model = parsed;
|
|
29
|
+
const conwayGeometry = new ConwayGeometry();
|
|
30
|
+
expect(await conwayGeometry.initialize()).toBe(true);
|
|
31
|
+
const [result, sceneBuilder] = new AP214GeometryExtraction(conwayGeometry, model).extractAP214GeometryData();
|
|
32
|
+
expect(result).toBe(ExtractResult.COMPLETE);
|
|
33
|
+
scene = sceneBuilder;
|
|
34
|
+
});
|
|
35
|
+
/** @return {any} The spatial-structure root of the fixture. */
|
|
36
|
+
async function spatialRoot() {
|
|
37
|
+
const props = new AP214Properties({ StepModel: model });
|
|
38
|
+
return await props.getSpatialStructure();
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Collect the occurrence path of every leaf (geometry-bearing) product node.
|
|
42
|
+
*
|
|
43
|
+
* @param root Spatial-structure root.
|
|
44
|
+
* @return {number[][]} One occurrence path per leaf node.
|
|
45
|
+
*/
|
|
46
|
+
function leafOccurrencePaths(root) {
|
|
47
|
+
const paths = [];
|
|
48
|
+
const walk = (node) => {
|
|
49
|
+
const children = node.children ?? [];
|
|
50
|
+
if (children.length === 0) {
|
|
51
|
+
paths.push(node.occurrencePath);
|
|
52
|
+
}
|
|
53
|
+
for (const child of children) {
|
|
54
|
+
walk(child);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
walk(root);
|
|
58
|
+
return paths;
|
|
59
|
+
}
|
|
60
|
+
describe("AP214 as1-oc-214 occurrence geometry", () => {
|
|
61
|
+
test("extracts real geometry for the assembly", () => {
|
|
62
|
+
const owners = [...scene.geometryOccurrences()].filter(([owner]) => owner !== void 0);
|
|
63
|
+
// 10 BREP solids placed across the occurrence tree — a non-trivial mesh
|
|
64
|
+
// count guards against the fixture silently regressing to a stub.
|
|
65
|
+
expect(owners.length).toBeGreaterThan(0);
|
|
66
|
+
});
|
|
67
|
+
test("the same leaf part is reused across occurrences (the selection case)", async () => {
|
|
68
|
+
const root = await spatialRoot();
|
|
69
|
+
const nuts = [];
|
|
70
|
+
const walk = (node) => {
|
|
71
|
+
if (node.Name?.value === "nut") {
|
|
72
|
+
nuts.push(node);
|
|
73
|
+
}
|
|
74
|
+
for (const child of node.children ?? []) {
|
|
75
|
+
walk(child);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
walk(root);
|
|
79
|
+
expect(nuts.length).toBeGreaterThan(1);
|
|
80
|
+
// The nut inside nut-bolt-assembly is reused across every l-bracket-assembly
|
|
81
|
+
// occurrence, so several nut nodes share one scalar expressID. Group by it
|
|
82
|
+
// and take the largest colliding set.
|
|
83
|
+
const byExpressID = new Map();
|
|
84
|
+
for (const nut of nuts) {
|
|
85
|
+
const group = byExpressID.get(nut.expressID) ?? [];
|
|
86
|
+
group.push(nut);
|
|
87
|
+
byExpressID.set(nut.expressID, group);
|
|
88
|
+
}
|
|
89
|
+
const colliding = [...byExpressID.values()].sort((a, b) => b.length - a.length)[0];
|
|
90
|
+
// Same scalar id, but each occurrence has a distinct path — exactly what a
|
|
91
|
+
// scalar id cannot represent and the occurrence path can.
|
|
92
|
+
expect(colliding.length).toBeGreaterThan(1);
|
|
93
|
+
const paths = colliding.map((n) => JSON.stringify(n.occurrencePath));
|
|
94
|
+
expect(new Set(paths).size).toBe(colliding.length);
|
|
95
|
+
});
|
|
96
|
+
test("every geometry instance carries the occurrence path of its tree leaf", async () => {
|
|
97
|
+
const geometryPaths = [...scene.geometryOccurrences()].map(([, path]) => JSON.stringify(path));
|
|
98
|
+
const treePaths = leafOccurrencePaths(await spatialRoot()).map((p) => JSON.stringify(p));
|
|
99
|
+
// Each leaf occurrence has geometry, and each geometry instance is stamped
|
|
100
|
+
// with a leaf's occurrence path: the two multisets match. This is the
|
|
101
|
+
// mesh<->node reconciliation occurrence-keyed selection needs.
|
|
102
|
+
expect(geometryPaths.slice().sort()).toEqual(treePaths.slice().sort());
|
|
103
|
+
// ...and every path is distinct, so no two instances are confusable.
|
|
104
|
+
expect(new Set(geometryPaths).size).toBe(geometryPaths.length);
|
|
105
|
+
});
|
|
106
|
+
});
|
|
@@ -46,6 +46,7 @@ export declare class AP214SceneGeometry implements SceneNodeGeometry {
|
|
|
46
46
|
readonly relatedElementLocalId?: number | undefined;
|
|
47
47
|
readonly parentIndex?: number | undefined;
|
|
48
48
|
readonly materialOverideLocalID?: number | undefined;
|
|
49
|
+
readonly occurrencePath: readonly number[];
|
|
49
50
|
readonly type = SceneNodeModelType.GEOMETRY;
|
|
50
51
|
/**
|
|
51
52
|
* No Spaces for AP214
|
|
@@ -63,7 +64,7 @@ export declare class AP214SceneGeometry implements SceneNodeGeometry {
|
|
|
63
64
|
* @param parentIndex
|
|
64
65
|
* @param materialOverideLocalID
|
|
65
66
|
*/
|
|
66
|
-
constructor(model: Model, localID: number, index: number, relatedElementLocalId?: number | undefined, parentIndex?: number | undefined, materialOverideLocalID?: number | undefined);
|
|
67
|
+
constructor(model: Model, localID: number, index: number, relatedElementLocalId?: number | undefined, parentIndex?: number | undefined, materialOverideLocalID?: number | undefined, occurrencePath?: readonly number[]);
|
|
67
68
|
}
|
|
68
69
|
export type AP214SceneNode = AP214SceneTransform | AP214SceneGeometry;
|
|
69
70
|
/**
|
|
@@ -79,6 +80,7 @@ export declare class AP214SceneBuilder implements WalkableScene<StepEntityBase<E
|
|
|
79
80
|
private geometrySet_;
|
|
80
81
|
private sceneStack_;
|
|
81
82
|
private currentParent_?;
|
|
83
|
+
private occurrenceStack_;
|
|
82
84
|
private transformListeners_?;
|
|
83
85
|
private geometryListeners_?;
|
|
84
86
|
/**
|
|
@@ -122,6 +124,17 @@ export declare class AP214SceneBuilder implements WalkableScene<StepEntityBase<E
|
|
|
122
124
|
*
|
|
123
125
|
*/
|
|
124
126
|
clearParentStack(): void;
|
|
127
|
+
/**
|
|
128
|
+
* Enter an assembly occurrence: subsequent geometry is stamped as belonging
|
|
129
|
+
* to this NAUO. Balanced by {@link popOccurrence}.
|
|
130
|
+
*
|
|
131
|
+
* @param occurrenceExpressID The NAUO express id of the placement being entered.
|
|
132
|
+
*/
|
|
133
|
+
pushOccurrence(occurrenceExpressID: number): void;
|
|
134
|
+
/**
|
|
135
|
+
* Leave the most recently entered assembly occurrence.
|
|
136
|
+
*/
|
|
137
|
+
popOccurrence(): void;
|
|
125
138
|
/**
|
|
126
139
|
*
|
|
127
140
|
* @param localID
|
|
@@ -155,6 +168,37 @@ export declare class AP214SceneBuilder implements WalkableScene<StepEntityBase<E
|
|
|
155
168
|
CanonicalMaterial | undefined,
|
|
156
169
|
StepEntityBase<EntityTypesAP214> | undefined
|
|
157
170
|
]>;
|
|
171
|
+
/**
|
|
172
|
+
* Same as {@link walk}, but also yields each geometry instance's occurrence
|
|
173
|
+
* path (NAUO express ids) as a 6th element. Kept separate from `walk` (which
|
|
174
|
+
* satisfies the shared `WalkableScene` contract) so the AP214 shim can attach
|
|
175
|
+
* per-instance occurrence identity to each emitted PlacedGeometry without
|
|
176
|
+
* changing the interface every scene builder implements.
|
|
177
|
+
*
|
|
178
|
+
* @param includeSpaces Unused; kept for signature parity with `walk`.
|
|
179
|
+
* @yields walk tuple plus the occurrence path of the geometry instance.
|
|
180
|
+
*/
|
|
181
|
+
walkWithOccurrence(includeSpaces?: boolean): IterableIterator<[
|
|
182
|
+
readonly number[] | undefined,
|
|
183
|
+
NativeTransform4x4 | undefined,
|
|
184
|
+
CanonicalMesh,
|
|
185
|
+
CanonicalMaterial | undefined,
|
|
186
|
+
StepEntityBase<EntityTypesAP214> | undefined,
|
|
187
|
+
readonly number[]
|
|
188
|
+
]>;
|
|
189
|
+
/**
|
|
190
|
+
* Walk every geometry node yielding its owning part-type element (the
|
|
191
|
+
* `product_definition_shape`, shared across occurrences) alongside the
|
|
192
|
+
* occurrence path (NAUO express ids) that uniquely places it. This is the
|
|
193
|
+
* seam that lets a picked mesh resolve to the right product-structure node:
|
|
194
|
+
* the owner id alone collides across reused parts; the occurrence path does not.
|
|
195
|
+
*
|
|
196
|
+
* @yields [owning element, occurrence path] per geometry node.
|
|
197
|
+
*/
|
|
198
|
+
geometryOccurrences(): IterableIterator<[
|
|
199
|
+
StepEntityBase<EntityTypesAP214> | undefined,
|
|
200
|
+
readonly number[]
|
|
201
|
+
]>;
|
|
158
202
|
/**
|
|
159
203
|
*
|
|
160
204
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ap214_scene_builder.d.ts","sourceRoot":"","sources":["../../../src/AP214E3_2010/ap214_scene_builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAkB,kBAAkB,EAAwB,MACjF,gCAAgC,CAAA;AAClC,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAE,aAAa,EAAqB,MAAM,wBAAwB,CAAA;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAA;AAChD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAA;AAClF,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EACnB,MACM,oBAAoB,CAAA;AAE3B,OAAO,cAAc,MAAM,0BAA0B,CAAA;AACrD,OAAO,gBAAgB,MAAM,2CAA2C,CAAA;AACxE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAC3D,OAAO,cAAc,MAAM,oBAAoB,CAAA;AAG/C;;GAEG;AACH,qBAAa,mBAAoB,YAAW,kBAAkB;aAkB1C,KAAK,EAAE,KAAK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f,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,EAChC,eAAe,EAAE,kBAAkB,EACnC,UAAU,GAAE,OAAe,GAAI,mBAAmB;CAsEvD"}
|
|
@@ -53,13 +53,20 @@ export class AP214SceneGeometry {
|
|
|
53
53
|
* @param parentIndex
|
|
54
54
|
* @param materialOverideLocalID
|
|
55
55
|
*/
|
|
56
|
-
constructor(model, localID, index, relatedElementLocalId, parentIndex, materialOverideLocalID
|
|
56
|
+
constructor(model, localID, index, relatedElementLocalId, parentIndex, materialOverideLocalID,
|
|
57
|
+
// Ordered occurrence path (NAUO express ids, root->this placement) this
|
|
58
|
+
// geometry instance sits under. `relatedElementLocalId` is the part *type*
|
|
59
|
+
// (product_definition_shape), shared by every occurrence of the part; this
|
|
60
|
+
// path is what distinguishes them and matches the product-structure node's
|
|
61
|
+
// `occurrencePath`, so a picked mesh can resolve to the right tree node.
|
|
62
|
+
occurrencePath = []) {
|
|
57
63
|
this.model = model;
|
|
58
64
|
this.localID = localID;
|
|
59
65
|
this.index = index;
|
|
60
66
|
this.relatedElementLocalId = relatedElementLocalId;
|
|
61
67
|
this.parentIndex = parentIndex;
|
|
62
68
|
this.materialOverideLocalID = materialOverideLocalID;
|
|
69
|
+
this.occurrencePath = occurrencePath;
|
|
63
70
|
this.type = SceneNodeModelType.GEOMETRY;
|
|
64
71
|
}
|
|
65
72
|
}
|
|
@@ -82,6 +89,11 @@ export class AP214SceneBuilder {
|
|
|
82
89
|
this.sceneLocalIdMap_ = new Map();
|
|
83
90
|
this.geometrySet_ = new Set();
|
|
84
91
|
this.sceneStack_ = [];
|
|
92
|
+
// Occurrence path (NAUO express ids, root->current) of the assembly placement
|
|
93
|
+
// currently being walked. Maintained as a stack by the geometry extractor
|
|
94
|
+
// around each child recursion (see AP214GeometryExtraction.makeThunk) so
|
|
95
|
+
// addGeometry can stamp every geometry node with the occurrence it belongs to.
|
|
96
|
+
this.occurrenceStack_ = [];
|
|
85
97
|
}
|
|
86
98
|
get currentParent() {
|
|
87
99
|
return this.currentParent_;
|
|
@@ -184,8 +196,24 @@ export class AP214SceneBuilder {
|
|
|
184
196
|
*/
|
|
185
197
|
clearParentStack() {
|
|
186
198
|
this.sceneStack_.length = 0;
|
|
199
|
+
this.occurrenceStack_.length = 0;
|
|
187
200
|
delete this.currentParent_;
|
|
188
201
|
}
|
|
202
|
+
/**
|
|
203
|
+
* Enter an assembly occurrence: subsequent geometry is stamped as belonging
|
|
204
|
+
* to this NAUO. Balanced by {@link popOccurrence}.
|
|
205
|
+
*
|
|
206
|
+
* @param occurrenceExpressID The NAUO express id of the placement being entered.
|
|
207
|
+
*/
|
|
208
|
+
pushOccurrence(occurrenceExpressID) {
|
|
209
|
+
this.occurrenceStack_.push(occurrenceExpressID);
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Leave the most recently entered assembly occurrence.
|
|
213
|
+
*/
|
|
214
|
+
popOccurrence() {
|
|
215
|
+
this.occurrenceStack_.pop();
|
|
216
|
+
}
|
|
189
217
|
/**
|
|
190
218
|
*
|
|
191
219
|
* @param localID
|
|
@@ -306,6 +334,59 @@ export class AP214SceneBuilder {
|
|
|
306
334
|
}
|
|
307
335
|
}
|
|
308
336
|
}
|
|
337
|
+
/**
|
|
338
|
+
* Same as {@link walk}, but also yields each geometry instance's occurrence
|
|
339
|
+
* path (NAUO express ids) as a 6th element. Kept separate from `walk` (which
|
|
340
|
+
* satisfies the shared `WalkableScene` contract) so the AP214 shim can attach
|
|
341
|
+
* per-instance occurrence identity to each emitted PlacedGeometry without
|
|
342
|
+
* changing the interface every scene builder implements.
|
|
343
|
+
*
|
|
344
|
+
* @param includeSpaces Unused; kept for signature parity with `walk`.
|
|
345
|
+
* @yields walk tuple plus the occurrence path of the geometry instance.
|
|
346
|
+
*/
|
|
347
|
+
*walkWithOccurrence(includeSpaces = false) {
|
|
348
|
+
for (const node of this.scene_) {
|
|
349
|
+
if (node instanceof AP214SceneGeometry) {
|
|
350
|
+
const geometry = node.model.geometry?.getByLocalID(node.localID);
|
|
351
|
+
if (geometry === void 0) {
|
|
352
|
+
continue;
|
|
353
|
+
}
|
|
354
|
+
const parentNode = node.parentIndex !== void 0 ?
|
|
355
|
+
this.scene_[node.parentIndex] : void 0;
|
|
356
|
+
const material = this.materials.getMaterialByGeometryID(geometry.localID);
|
|
357
|
+
yield [
|
|
358
|
+
parentNode?.absoluteTransform,
|
|
359
|
+
parentNode?.absoluteNativeTransform,
|
|
360
|
+
geometry,
|
|
361
|
+
material !== void 0 ? material[0] : void 0,
|
|
362
|
+
node.relatedElementLocalId !== void 0 ?
|
|
363
|
+
this.model.getElementByLocalID(node.relatedElementLocalId) : void 0,
|
|
364
|
+
node.occurrencePath,
|
|
365
|
+
];
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Walk every geometry node yielding its owning part-type element (the
|
|
371
|
+
* `product_definition_shape`, shared across occurrences) alongside the
|
|
372
|
+
* occurrence path (NAUO express ids) that uniquely places it. This is the
|
|
373
|
+
* seam that lets a picked mesh resolve to the right product-structure node:
|
|
374
|
+
* the owner id alone collides across reused parts; the occurrence path does not.
|
|
375
|
+
*
|
|
376
|
+
* @yields [owning element, occurrence path] per geometry node.
|
|
377
|
+
*/
|
|
378
|
+
*geometryOccurrences() {
|
|
379
|
+
for (const node of this.scene_) {
|
|
380
|
+
if (node instanceof AP214SceneGeometry) {
|
|
381
|
+
if (this.model.geometry?.getByLocalID(node.localID) === void 0) {
|
|
382
|
+
continue;
|
|
383
|
+
}
|
|
384
|
+
const owner = node.relatedElementLocalId !== void 0 ?
|
|
385
|
+
this.model.getElementByLocalID(node.relatedElementLocalId) : void 0;
|
|
386
|
+
yield [owner, node.occurrencePath];
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
}
|
|
309
390
|
/**
|
|
310
391
|
*
|
|
311
392
|
*/
|
|
@@ -349,7 +430,7 @@ export class AP214SceneBuilder {
|
|
|
349
430
|
else {
|
|
350
431
|
this.roots.push(nodeIndex);
|
|
351
432
|
}
|
|
352
|
-
const result = new AP214SceneGeometry(this.model, localID, nodeIndex, owningElementLocalID, parentIndex, materialOverridLocalID);
|
|
433
|
+
const result = new AP214SceneGeometry(this.model, localID, nodeIndex, owningElementLocalID, parentIndex, materialOverridLocalID, this.occurrenceStack_.slice());
|
|
353
434
|
this.scene_.push(result);
|
|
354
435
|
const geometryChildren = this.model.geometry?.getChildrenByLocalID(localID);
|
|
355
436
|
if (geometryChildren !== void 0) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ifc_api.d.ts","sourceRoot":"","sources":["../../../../src/compat/web-ifc/ifc_api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,mBAAmB,IAAI,mBAAmB,EACjE,MAAM,aAAa,CAAA;AAIrB,OAAO,KAAK,QAAQ,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAEpE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAGzC,cAAc,UAAU,CAAA;AAGxB,eAAO,MAAM,OAAO,IAAI,CAAA;AACxB,eAAO,MAAM,MAAM,IAAI,CAAA;AACvB,eAAO,MAAM,KAAK,IAAI,CAAA;AACtB,eAAO,MAAM,IAAI,IAAI,CAAA;AACrB,eAAO,MAAM,IAAI,IAAI,CAAA;AACrB,eAAO,MAAM,GAAG,IAAI,CAAA;AACpB,eAAO,MAAM,KAAK,IAAI,CAAA;AACtB,eAAO,MAAM,SAAS,IAAI,CAAA;AAC1B,eAAO,MAAM,OAAO,IAAI,CAAA;AACxB,eAAO,MAAM,QAAQ,IAAI,CAAA;AAEzB,MAAM,WAAW,cAAc;IAC7B,oBAAoB,EAAE,OAAO,CAAA;IAC7B,cAAc,EAAE,OAAO,CAAA;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAA;IAC5B,sBAAsB,CAAC,EAAE,MAAM,CAAA;IAC/B,oBA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