@bldrs-ai/conway 0.23.968 → 0.23.969

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.
@@ -2101,11 +2101,11 @@ export class IfcGeometryExtraction {
2101
2101
  masterRepresentation: trimmingArguments.start?.hasPos ? 0 : 1,
2102
2102
  dimensions: 3,
2103
2103
  senseAgreement: parentSense,
2104
- trim1Cartesian2D: trimmingArguments.start?.pos,
2105
- trim1Cartesian3D: trimmingArguments.start?.pos3D,
2104
+ trim1Cartesian2D: trimmingArguments.start?.pos ?? { x: 0, y: 0 },
2105
+ trim1Cartesian3D: trimmingArguments.start?.pos3D ?? { x: 0, y: 0, z: 0 },
2106
2106
  trim1Double: trimmingArguments.start?.param ?? 0,
2107
- trim2Cartesian2D: trimmingArguments.end?.pos,
2108
- trim2Cartesian3D: trimmingArguments.end?.pos3D,
2107
+ trim2Cartesian2D: trimmingArguments.end?.pos ?? { x: 0, y: 0 },
2108
+ trim2Cartesian3D: trimmingArguments.end?.pos3D ?? { x: 0, y: 0, z: 0 },
2109
2109
  trim2Double: trimmingArguments.end?.param ?? 0,
2110
2110
  trimExists: true
2111
2111
  };
@@ -2119,11 +2119,11 @@ export class IfcGeometryExtraction {
2119
2119
  masterRepresentation: trimmingArguments.start?.hasPos ? 0 : 1,
2120
2120
  dimensions: 3,
2121
2121
  senseAgreement: parentSense,
2122
- trim1Cartesian2D: trimmingArguments.start?.pos,
2123
- trim1Cartesian3D: trimmingArguments.start?.pos3D,
2122
+ trim1Cartesian2D: trimmingArguments.start?.pos ?? { x: 0, y: 0 },
2123
+ trim1Cartesian3D: trimmingArguments.start?.pos3D ?? { x: 0, y: 0, z: 0 },
2124
2124
  trim1Double: trimmingArguments.start?.param ?? 0,
2125
- trim2Cartesian2D: trimmingArguments.end?.pos,
2126
- trim2Cartesian3D: trimmingArguments.end?.pos3D,
2125
+ trim2Cartesian2D: trimmingArguments.end?.pos ?? { x: 0, y: 0 },
2126
+ trim2Cartesian3D: trimmingArguments.end?.pos3D ?? { x: 0, y: 0, z: 0 },
2127
2127
  trim2Double: trimmingArguments.end?.param ?? 0,
2128
2128
  trimExists: true
2129
2129
  };
@@ -2137,11 +2137,11 @@ export class IfcGeometryExtraction {
2137
2137
  masterRepresentation: trimmingArguments.start?.hasPos ? 0 : 1,
2138
2138
  dimensions: 3,
2139
2139
  senseAgreement: parentSense,
2140
- trim1Cartesian2D: trimmingArguments.start?.pos,
2141
- trim1Cartesian3D: trimmingArguments.start?.pos3D,
2140
+ trim1Cartesian2D: trimmingArguments.start?.pos ?? { x: 0, y: 0 },
2141
+ trim1Cartesian3D: trimmingArguments.start?.pos3D ?? { x: 0, y: 0, z: 0 },
2142
2142
  trim1Double: trimmingArguments.start?.param ?? 0,
2143
- trim2Cartesian2D: trimmingArguments.end?.pos,
2144
- trim2Cartesian3D: trimmingArguments.end?.pos3D,
2143
+ trim2Cartesian2D: trimmingArguments.end?.pos ?? { x: 0, y: 0 },
2144
+ trim2Cartesian3D: trimmingArguments.end?.pos3D ?? { x: 0, y: 0, z: 0 },
2145
2145
  trim2Double: trimmingArguments.end?.param ?? 0,
2146
2146
  trimExists: true
2147
2147
  };
@@ -2177,11 +2177,11 @@ export class IfcGeometryExtraction {
2177
2177
  masterRepresentation: 0,
2178
2178
  dimensions: 0,
2179
2179
  senseAgreement: true,
2180
- trim1Cartesian2D: undefined,
2181
- trim1Cartesian3D: undefined,
2180
+ trim1Cartesian2D: { x: 0, y: 0 },
2181
+ trim1Cartesian3D: { x: 0, y: 0, z: 0 },
2182
2182
  trim1Double: 0,
2183
- trim2Cartesian2D: undefined,
2184
- trim2Cartesian3D: undefined,
2183
+ trim2Cartesian2D: { x: 0, y: 0 },
2184
+ trim2Cartesian3D: { x: 0, y: 0, z: 0 },
2185
2185
  trim2Double: 0,
2186
2186
  trimExists: false,
2187
2187
  };
@@ -2208,6 +2208,9 @@ export class IfcGeometryExtraction {
2208
2208
  if (dimensions === 2) {
2209
2209
  const outputPoints = params.points2;
2210
2210
  for (const point of from.ControlPointsList) {
2211
+ if (point.Dim !== 2) {
2212
+ continue;
2213
+ }
2211
2214
  const coords = point.Coordinates;
2212
2215
  outputPoints.push_back({ x: coords[0], y: coords[1] });
2213
2216
  }
@@ -2295,11 +2298,11 @@ export class IfcGeometryExtraction {
2295
2298
  masterRepresentation: 0,
2296
2299
  dimensions: 0,
2297
2300
  senseAgreement: true,
2298
- trim1Cartesian2D: undefined,
2299
- trim1Cartesian3D: undefined,
2301
+ trim1Cartesian2D: { x: 0, y: 0 },
2302
+ trim1Cartesian3D: { x: 0, y: 0, z: 0 },
2300
2303
  trim1Double: 0,
2301
- trim2Cartesian2D: undefined,
2302
- trim2Cartesian3D: undefined,
2304
+ trim2Cartesian2D: { x: 0, y: 0 },
2305
+ trim2Cartesian3D: { x: 0, y: 0, z: 0 },
2303
2306
  trim2Double: 0,
2304
2307
  trimExists: false,
2305
2308
  };
@@ -2958,38 +2961,48 @@ export class IfcGeometryExtraction {
2958
2961
  this.extractMappedItem(representationItem, owningElement, isRelVoid, isSpace, parents !== void 0 ? [from, ...parents] : [from]);
2959
2962
  }
2960
2963
  else {
2961
- this.extractRepresentationItem(representationItem, owningElement.localID, isRelVoid, isSpace, true);
2962
- const styledItemLocalID = this.materials.styledItemMap.get(representationItem.localID) ??
2963
- this.extractMaterialStyle(owningElement);
2964
- let materialOverrideID = void 0;
2965
- if (styledItemLocalID !== undefined) {
2966
- const styledItem = this.model.getElementByLocalID(styledItemLocalID);
2967
- this.extractStyledItem(styledItem);
2968
- }
2969
- else {
2970
- // get material from parent
2971
- let styledItemParentLocalID = this.materials.styledItemMap.get(from.localID);
2972
- let styleParent = from;
2973
- if (parents !== void 0) {
2974
- for (const parent of parents) {
2975
- if (styledItemParentLocalID !== void 0) {
2976
- break;
2964
+ try {
2965
+ this.extractRepresentationItem(representationItem, owningElement.localID, isRelVoid, isSpace, true);
2966
+ const styledItemLocalID = this.materials.styledItemMap.get(representationItem.localID) ??
2967
+ this.extractMaterialStyle(owningElement);
2968
+ let materialOverrideID = void 0;
2969
+ if (styledItemLocalID !== undefined) {
2970
+ const styledItem = this.model.getElementByLocalID(styledItemLocalID);
2971
+ this.extractStyledItem(styledItem);
2972
+ }
2973
+ else {
2974
+ // get material from parent
2975
+ let styledItemParentLocalID = this.materials.styledItemMap.get(from.localID);
2976
+ let styleParent = from;
2977
+ if (parents !== void 0) {
2978
+ for (const parent of parents) {
2979
+ if (styledItemParentLocalID !== void 0) {
2980
+ break;
2981
+ }
2982
+ styledItemParentLocalID = this.materials.styledItemMap.get(parent.localID);
2983
+ styleParent = parent;
2977
2984
  }
2978
- styledItemParentLocalID = this.materials.styledItemMap.get(parent.localID);
2979
- styleParent = parent;
2985
+ }
2986
+ if (styledItemParentLocalID !== void 0) {
2987
+ const styledItemParent = this.model.getElementByLocalID(styledItemParentLocalID);
2988
+ this.extractStyledItem(styledItemParent, styleParent);
2989
+ materialOverrideID = styleParent.localID;
2980
2990
  }
2981
2991
  }
2982
- if (styledItemParentLocalID !== void 0) {
2983
- const styledItemParent = this.model.getElementByLocalID(styledItemParentLocalID);
2984
- this.extractStyledItem(styledItemParent, styleParent);
2985
- materialOverrideID = styleParent.localID;
2992
+ if (isRelVoid) {
2993
+ this.applyRelVoidToRepresentation(representationItem, relVoidsMeshVector, owningElement.localID, relVoidLocalIDs, materialOverrideID, isSpace);
2994
+ }
2995
+ else {
2996
+ this.scene.addGeometry(representationItem.localID, owningElement.localID, isSpace, materialOverrideID);
2986
2997
  }
2987
2998
  }
2988
- if (isRelVoid) {
2989
- this.applyRelVoidToRepresentation(representationItem, relVoidsMeshVector, owningElement.localID, relVoidLocalIDs, materialOverrideID, isSpace);
2990
- }
2991
- else {
2992
- this.scene.addGeometry(representationItem.localID, owningElement.localID, isSpace, materialOverrideID);
2999
+ catch (error) {
3000
+ if (error instanceof Error) {
3001
+ Logger.error(`Couldn't extract mapped representation item\n\t${error.message}\n\t Express ID #${representationItem.expressID}`);
3002
+ }
3003
+ else {
3004
+ Logger.error(`Couldn't extract mapped representation item\n\t Express ID #${representationItem.expressID}`);
3005
+ }
2993
3006
  }
2994
3007
  }
2995
3008
  }
@@ -4007,16 +4020,26 @@ export class IfcGeometryExtraction {
4007
4020
  }
4008
4021
  }
4009
4022
  for (const item of representation.Items) {
4010
- // extract geometry here and flatten
4011
- this.extractRepresentationItem(item, undefined, true);
4012
- const mesh = this.model.voidGeometry.getByLocalID(item.localID);
4013
- if (mesh !== undefined && mesh.type === CanonicalMeshType.BUFFER_GEOMETRY) {
4014
- const localGeometry = mesh.geometry.clone();
4015
- if (relVoidPlacementTransform !== void 0) {
4016
- localGeometry.applyTransform(relVoidPlacementTransform.absoluteNativeTransform);
4023
+ try {
4024
+ // extract geometry here and flatten
4025
+ this.extractRepresentationItem(item, undefined, true);
4026
+ const mesh = this.model.voidGeometry.getByLocalID(item.localID);
4027
+ if (mesh !== undefined && mesh.type === CanonicalMeshType.BUFFER_GEOMETRY) {
4028
+ const localGeometry = mesh.geometry.clone();
4029
+ if (relVoidPlacementTransform !== void 0) {
4030
+ localGeometry.applyTransform(relVoidPlacementTransform.absoluteNativeTransform);
4031
+ }
4032
+ relVoidMeshVector.push_back(localGeometry);
4033
+ relVoidLocalIDs.push(item.localID);
4034
+ }
4035
+ }
4036
+ catch (error) {
4037
+ if (error instanceof Error) {
4038
+ Logger.error(`Error extracting rel void representation item\n\t${error.message}\n\t Express ID: #${item.expressID}`);
4039
+ }
4040
+ else {
4041
+ Logger.error(`Unknown Error extracting rel void representation item\n\t${error}\n\t Express ID: #${item.expressID}`);
4017
4042
  }
4018
- relVoidMeshVector.push_back(localGeometry);
4019
- relVoidLocalIDs.push(item.localID);
4020
4043
  }
4021
4044
  }
4022
4045
  }
@@ -4416,9 +4439,19 @@ export class IfcGeometryExtraction {
4416
4439
  this.extractMappedItem(item, product, hasRelVoid, isSpace);
4417
4440
  }
4418
4441
  else {
4419
- this.extractRepresentationItem(item, product.localID, hasRelVoid, isSpace);
4420
- if (hasRelVoid) {
4421
- this.applyRelVoidToRepresentation(item, relVoidsMeshVector, product.localID, relVoidLocalIDs, void 0, isSpace);
4442
+ try {
4443
+ this.extractRepresentationItem(item, product.localID, hasRelVoid, isSpace);
4444
+ if (hasRelVoid) {
4445
+ this.applyRelVoidToRepresentation(item, relVoidsMeshVector, product.localID, relVoidLocalIDs, void 0, isSpace);
4446
+ }
4447
+ }
4448
+ catch (error) {
4449
+ if (error instanceof Error) {
4450
+ Logger.error(`Error extracting representation item\n\t${error.message}\n\tExpress ID: #${item.expressID}`);
4451
+ }
4452
+ else {
4453
+ Logger.error(`Error extracting representation item\n\tExpress ID: #${item.expressID}`);
4454
+ }
4422
4455
  }
4423
4456
  }
4424
4457
  const styledItemLocalID_ = this.materials.styledItemMap.get(item.localID);
@@ -4451,14 +4484,24 @@ export class IfcGeometryExtraction {
4451
4484
  this.extractMappedItem(item, product, hasRelVoid, isSpace);
4452
4485
  }
4453
4486
  else {
4454
- this.extractRepresentationItem(item, product.localID, hasRelVoid, isSpace);
4455
- if (hasRelVoid) {
4456
- this.applyRelVoidToRepresentation(item, relVoidsMeshVector, product.localID, relVoidLocalIDs, void 0, isSpace);
4487
+ try {
4488
+ this.extractRepresentationItem(item, product.localID, hasRelVoid, isSpace);
4489
+ if (hasRelVoid) {
4490
+ this.applyRelVoidToRepresentation(item, relVoidsMeshVector, product.localID, relVoidLocalIDs, void 0, isSpace);
4491
+ }
4492
+ const styledItemLocalID_ = this.materials.styledItemMap.get(item.localID);
4493
+ if (styledItemLocalID_ !== void 0) {
4494
+ const styledItem_ = this.model.getElementByLocalID(styledItemLocalID_);
4495
+ this.extractStyledItem(styledItem_);
4496
+ }
4457
4497
  }
4458
- const styledItemLocalID_ = this.materials.styledItemMap.get(item.localID);
4459
- if (styledItemLocalID_ !== void 0) {
4460
- const styledItem_ = this.model.getElementByLocalID(styledItemLocalID_);
4461
- this.extractStyledItem(styledItem_);
4498
+ catch (error) {
4499
+ if (error instanceof Error) {
4500
+ Logger.error(`Error extracting representation item\n\t${error.message}\n\t${error.stack}\n\tExpress ID: #${item.localID}`);
4501
+ }
4502
+ else {
4503
+ Logger.error(`Unknown error extracting representation item Express ID: #${item.localID}`);
4504
+ }
4462
4505
  }
4463
4506
  }
4464
4507
  }
@@ -4523,9 +4566,19 @@ export class IfcGeometryExtraction {
4523
4566
  this.extractMappedItem(item, product, hasRelVoid, isSpace);
4524
4567
  }
4525
4568
  else {
4526
- this.extractRepresentationItem(item, product.localID, hasRelVoid, isSpace);
4527
- if (hasRelVoid) {
4528
- this.applyRelVoidToRepresentation(item, relVoidsMeshVector, product.localID, relVoidLocalIDs, void 0, isSpace);
4569
+ try {
4570
+ this.extractRepresentationItem(item, product.localID, hasRelVoid, isSpace);
4571
+ if (hasRelVoid) {
4572
+ this.applyRelVoidToRepresentation(item, relVoidsMeshVector, product.localID, relVoidLocalIDs, void 0, isSpace);
4573
+ }
4574
+ }
4575
+ catch (error) {
4576
+ if (error instanceof Error) {
4577
+ Logger.error(`Error extracting rel aggregate representation item\n\t${error.message}\n\t${error.stack}\n\t Express ID: #${item.expressID}`);
4578
+ }
4579
+ else {
4580
+ Logger.error(`Unknown error extracting rel aggregate representation item Express ID: #${item.expressID}`);
4581
+ }
4529
4582
  }
4530
4583
  }
4531
4584
  const styledItemLocalID_ = this.materials.styledItemMap.get(item.localID);
@@ -4558,14 +4611,24 @@ export class IfcGeometryExtraction {
4558
4611
  this.extractMappedItem(item, product, hasRelVoid, isSpace);
4559
4612
  }
4560
4613
  else {
4561
- this.extractRepresentationItem(item, product.localID, hasRelVoid, isSpace);
4562
- if (hasRelVoid) {
4563
- this.applyRelVoidToRepresentation(item, relVoidsMeshVector, product.localID, relVoidLocalIDs, void 0, isSpace);
4614
+ try {
4615
+ this.extractRepresentationItem(item, product.localID, hasRelVoid, isSpace);
4616
+ if (hasRelVoid) {
4617
+ this.applyRelVoidToRepresentation(item, relVoidsMeshVector, product.localID, relVoidLocalIDs, void 0, isSpace);
4618
+ }
4619
+ const styledItemLocalID_ = this.materials.styledItemMap.get(item.localID);
4620
+ if (styledItemLocalID_ !== void 0) {
4621
+ const styledItem_ = this.model.getElementByLocalID(styledItemLocalID_);
4622
+ this.extractStyledItem(styledItem_);
4623
+ }
4564
4624
  }
4565
- const styledItemLocalID_ = this.materials.styledItemMap.get(item.localID);
4566
- if (styledItemLocalID_ !== void 0) {
4567
- const styledItem_ = this.model.getElementByLocalID(styledItemLocalID_);
4568
- this.extractStyledItem(styledItem_);
4625
+ catch (error) {
4626
+ if (error instanceof Error) {
4627
+ Logger.error(`Error extracting rel aggregate representation item\n\t${error.message}\n\t${error.stack}\n\t Express ID: #${item.expressID}`);
4628
+ }
4629
+ else {
4630
+ Logger.error(`Unknown error extracting rel aggregate representation item Express ID: #${item.expressID}`);
4631
+ }
4569
4632
  }
4570
4633
  }
4571
4634
  }
@@ -4584,8 +4647,8 @@ export class IfcGeometryExtraction {
4584
4647
  catch (ex) {
4585
4648
  if (ex instanceof Error) {
4586
4649
  if (MATERIAL_RELATED_OBJECTS_PERMISSIVE) {
4587
- Logger.error("Error processing relAggregate expressID: " +
4588
- `${relAggregate.expressID}, error: ${ex.message}`);
4650
+ Logger.error("Error processing relAggregate\n\t" +
4651
+ `error: ${ex.message}\n\t express ID: #${relAggregate.expressID}`);
4589
4652
  }
4590
4653
  else {
4591
4654
  throw ex;
@@ -1,2 +1,2 @@
1
- const versionString = 'Conway Web-Ifc Shim v0.23.968';
1
+ const versionString = 'Conway Web-Ifc Shim v0.23.969';
2
2
  export { versionString };