@itwin/rpcinterface-full-stack-tests 4.5.0-dev.4 → 4.5.0-dev.6

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.
@@ -30890,15 +30890,12 @@ class Logger {
30890
30890
  const stack = Logger.logExceptionCallstacks ? `\n${_BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorStack(err)}` : "";
30891
30891
  return _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorMessage(err) + stack;
30892
30892
  }
30893
- /** Log the specified exception. The special "ExceptionType" property will be added as metadata,
30894
- * in addition to any other metadata that may be supplied by the caller, unless the
30895
- * metadata supplied by the caller already includes this property.
30893
+ /** Log the specified exception. The special "ExceptionType" property will be added as metadata.
30896
30894
  * @param category The category of the message.
30897
30895
  * @param err The exception object.
30898
30896
  * @param log The logger output function to use - defaults to Logger.logError
30899
- * @param metaData Optional data for the message
30900
30897
  */
30901
- static logException(category, err, log = (_category, message) => Logger.logError(_category, message)) {
30898
+ static logException(category, err, log = (_category, message, metaData) => Logger.logError(_category, message, metaData)) {
30902
30899
  log(category, Logger.getExceptionMessage(err), () => {
30903
30900
  return { ..._BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyError.getErrorMetadata(err), exceptionType: err.constructor.name };
30904
30901
  });
@@ -48535,6 +48532,7 @@ SubCategoryOverride.defaults = new SubCategoryOverride({});
48535
48532
  "use strict";
48536
48533
  __webpack_require__.r(__webpack_exports__);
48537
48534
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
48535
+ /* harmony export */ "CesiumTerrainAssetId": () => (/* binding */ CesiumTerrainAssetId),
48538
48536
  /* harmony export */ "TerrainHeightOriginMode": () => (/* binding */ TerrainHeightOriginMode),
48539
48537
  /* harmony export */ "TerrainSettings": () => (/* binding */ TerrainSettings)
48540
48538
  /* harmony export */ });
@@ -48545,6 +48543,19 @@ __webpack_require__.r(__webpack_exports__);
48545
48543
  /** @packageDocumentation
48546
48544
  * @module DisplayStyles
48547
48545
  */
48546
+ /** Ids of [Cesium ION assets](https://cesium.com/platform/cesium-ion/content/) providing global terrain data.
48547
+ * These values are appropriate to use with [[TerrainSettings.dataSource]] when [[TerrainSettings.providerName]] is set to "CesiumWorldTerrain".
48548
+ * You may alternatively use the Id of any ION asset to which you have access.
48549
+ * @see [[TerrainSettings.fromCesiumIonAsset]] to create TerrainSettings that obtain terrain from a specified ION asset.
48550
+ * @public
48551
+ */
48552
+ var CesiumTerrainAssetId;
48553
+ (function (CesiumTerrainAssetId) {
48554
+ /** Default [global 3d terrain](https://cesium.com/platform/cesium-ion/content/cesium-world-terrain/). */
48555
+ CesiumTerrainAssetId["Default"] = "1";
48556
+ /** Global 3d terrain that includes [bathymetry](https://cesium.com/platform/cesium-ion/content/cesium-world-bathymetry/) (seafloor) terrain. */
48557
+ CesiumTerrainAssetId["Bathymetry"] = "2426648";
48558
+ })(CesiumTerrainAssetId || (CesiumTerrainAssetId = {}));
48548
48559
  /** Correction modes for terrain height
48549
48560
  * @see [[TerrainProps]]
48550
48561
  * @public
@@ -48570,11 +48581,24 @@ class TerrainSettings {
48570
48581
  get nonLocatable() {
48571
48582
  return this._nonLocatable;
48572
48583
  }
48573
- constructor(providerName = "CesiumWorldTerrain", exaggeration = 1.0, applyLighting = false, heightOrigin = 0.0, heightOriginMode = TerrainHeightOriginMode.Geodetic) {
48574
- this.providerName = providerName;
48575
- this.exaggeration = Math.min(100, Math.max(0.1, exaggeration));
48576
- this.applyLighting = applyLighting;
48577
- this.heightOrigin = heightOrigin;
48584
+ /** @internal */
48585
+ constructor(providerNameOrProps, exaggeration, applyLighting, heightOrigin, heightOriginMode) {
48586
+ let providerName;
48587
+ let dataSource;
48588
+ let nonLocatable;
48589
+ if (typeof providerNameOrProps === "string") {
48590
+ providerName = providerNameOrProps;
48591
+ }
48592
+ else if (providerNameOrProps) {
48593
+ ({ providerName, dataSource, exaggeration, applyLighting, heightOrigin, heightOriginMode, nonLocatable } = providerNameOrProps);
48594
+ }
48595
+ this.providerName = providerName ?? "CesiumWorldTerrain";
48596
+ this.dataSource = dataSource ?? "";
48597
+ this.exaggeration = Math.min(100, Math.max(0.1, exaggeration ?? 1.0));
48598
+ this.applyLighting = applyLighting ?? false;
48599
+ this.heightOrigin = heightOrigin ?? 0.0;
48600
+ if (true === nonLocatable)
48601
+ this._nonLocatable = true;
48578
48602
  switch (heightOriginMode) {
48579
48603
  case TerrainHeightOriginMode.Ground:
48580
48604
  case TerrainHeightOriginMode.Geoid:
@@ -48586,18 +48610,24 @@ class TerrainSettings {
48586
48610
  }
48587
48611
  }
48588
48612
  static fromJSON(json) {
48589
- if (undefined === json)
48590
- return new TerrainSettings();
48591
- const providerName = json?.providerName ?? "CesiumWorldTerrain";
48592
- const settings = new TerrainSettings(providerName, json.exaggeration, json.applyLighting, json.heightOrigin, json.heightOriginMode);
48593
- if (true === json.nonLocatable)
48594
- settings._nonLocatable = true;
48595
- return settings;
48613
+ return new TerrainSettings(json);
48614
+ }
48615
+ /** Create settings that obtain terrain from a [Cesium ION asset](https://cesium.com/platform/cesium-ion/content/) such as
48616
+ * one of those defined by [[CesiumTerrainAssetId]].
48617
+ * @note You must ensure your Cesium ION account has access to the specified asset.
48618
+ */
48619
+ static fromCesiumIonAsset(assetId = CesiumTerrainAssetId.Default, options) {
48620
+ return TerrainSettings.fromJSON({
48621
+ ...options,
48622
+ dataSource: assetId,
48623
+ });
48596
48624
  }
48597
48625
  toJSON() {
48598
48626
  const props = { heightOriginMode: this.heightOriginMode };
48599
48627
  if ("CesiumWorldTerrain" !== this.providerName)
48600
48628
  props.providerName = this.providerName;
48629
+ if (this.dataSource)
48630
+ props.dataSource = this.dataSource;
48601
48631
  if (1 !== this.exaggeration)
48602
48632
  props.exaggeration = this.exaggeration;
48603
48633
  if (this.nonLocatable)
@@ -48609,7 +48639,7 @@ class TerrainSettings {
48609
48639
  return props;
48610
48640
  }
48611
48641
  equals(other) {
48612
- return this.providerName === other.providerName && this.exaggeration === other.exaggeration && this.applyLighting === other.applyLighting
48642
+ return this.providerName === other.providerName && this.dataSource === other.dataSource && this.exaggeration === other.exaggeration && this.applyLighting === other.applyLighting
48613
48643
  && this.heightOrigin === other.heightOrigin && this.heightOriginMode === other.heightOriginMode && this.nonLocatable === other.nonLocatable;
48614
48644
  }
48615
48645
  /** Returns true if these settings are equivalent to the supplied JSON settings. */
@@ -48625,6 +48655,7 @@ class TerrainSettings {
48625
48655
  return this;
48626
48656
  const props = {
48627
48657
  providerName: changedProps.providerName ?? this.providerName,
48658
+ dataSource: changedProps.dataSource ?? this.dataSource,
48628
48659
  exaggeration: changedProps.exaggeration ?? this.exaggeration,
48629
48660
  nonLocatable: changedProps.nonLocatable ?? this.nonLocatable,
48630
48661
  applyLighting: changedProps.applyLighting ?? this.applyLighting,
@@ -50647,6 +50678,7 @@ __webpack_require__.r(__webpack_exports__);
50647
50678
  /* harmony export */ "Carto2DDegrees": () => (/* reexport safe */ _geometry_Projection__WEBPACK_IMPORTED_MODULE_48__.Carto2DDegrees),
50648
50679
  /* harmony export */ "Cartographic": () => (/* reexport safe */ _geometry_Cartographic__WEBPACK_IMPORTED_MODULE_38__.Cartographic),
50649
50680
  /* harmony export */ "CartographicRange": () => (/* reexport safe */ _geometry_Cartographic__WEBPACK_IMPORTED_MODULE_38__.CartographicRange),
50681
+ /* harmony export */ "CesiumTerrainAssetId": () => (/* reexport safe */ _TerrainSettings__WEBPACK_IMPORTED_MODULE_103__.CesiumTerrainAssetId),
50650
50682
  /* harmony export */ "ChangeOpCode": () => (/* reexport safe */ _ECSqlTypes__WEBPACK_IMPORTED_MODULE_21__.ChangeOpCode),
50651
50683
  /* harmony export */ "ChangeSetStatus": () => (/* reexport safe */ _IModelError__WEBPACK_IMPORTED_MODULE_62__.ChangeSetStatus),
50652
50684
  /* harmony export */ "ChangedValueState": () => (/* reexport safe */ _ECSqlTypes__WEBPACK_IMPORTED_MODULE_21__.ChangedValueState),
@@ -61076,7 +61108,7 @@ var RpcResponseCacheControl;
61076
61108
  })(RpcResponseCacheControl || (RpcResponseCacheControl = {}));
61077
61109
  /** RPC protocol event types.
61078
61110
  * @public
61079
- * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in version 5.0.
61111
+ * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
61080
61112
  */
61081
61113
  var RpcProtocolEvent;
61082
61114
  (function (RpcProtocolEvent) {
@@ -61096,7 +61128,7 @@ var RpcProtocolEvent;
61096
61128
  })(RpcProtocolEvent || (RpcProtocolEvent = {}));
61097
61129
  /** The status of an RPC operation request.
61098
61130
  * @public
61099
- * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in version 5.0.
61131
+ * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
61100
61132
  */
61101
61133
  var RpcRequestStatus;
61102
61134
  (function (RpcRequestStatus) {
@@ -61116,7 +61148,7 @@ var RpcRequestStatus;
61116
61148
  RpcRequestStatus[RpcRequestStatus["RequestTimeout"] = 13] = "RequestTimeout";
61117
61149
  RpcRequestStatus[RpcRequestStatus["TooManyRequests"] = 14] = "TooManyRequests";
61118
61150
  })(RpcRequestStatus || (RpcRequestStatus = {}));
61119
- /** @public @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in version 5.0. */
61151
+ /** @public @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future. */
61120
61152
  (function (RpcRequestStatus) {
61121
61153
  function isTransientError(status) {
61122
61154
  return status === RpcRequestStatus.BadGateway || status === RpcRequestStatus.ServiceUnavailable || status === RpcRequestStatus.GatewayTimeout
@@ -61126,7 +61158,7 @@ var RpcRequestStatus;
61126
61158
  })(RpcRequestStatus || (RpcRequestStatus = {}));
61127
61159
  /** RPC request event types.
61128
61160
  * @public
61129
- * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in version 5.0.
61161
+ * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
61130
61162
  */
61131
61163
  var RpcRequestEvent;
61132
61164
  (function (RpcRequestEvent) {
@@ -61136,7 +61168,7 @@ var RpcRequestEvent;
61136
61168
  })(RpcRequestEvent || (RpcRequestEvent = {}));
61137
61169
  /** RPC content types.
61138
61170
  * @public
61139
- * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in version 5.0.
61171
+ * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
61140
61172
  */
61141
61173
  var RpcContentType;
61142
61174
  (function (RpcContentType) {
@@ -61148,7 +61180,7 @@ var RpcContentType;
61148
61180
  })(RpcContentType || (RpcContentType = {}));
61149
61181
  /** Endpoints for RPC protocols.
61150
61182
  * @public
61151
- * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in version 5.0.
61183
+ * @deprecated in 3.6. The RPC system will be significantly refactored (or replaced) in the future.
61152
61184
  */
61153
61185
  var RpcEndpoint;
61154
61186
  (function (RpcEndpoint) {
@@ -90797,7 +90829,7 @@ class RealityDataSourceCesiumIonAssetImpl {
90797
90829
  // The following is only if the reality data is not stored on PW Context Share.
90798
90830
  const cesiumAsset = _tile_internal__WEBPACK_IMPORTED_MODULE_3__.CesiumIonAssetProvider.parseCesiumUrl(url);
90799
90831
  if (cesiumAsset) {
90800
- const tokenAndUrl = await (0,_tile_internal__WEBPACK_IMPORTED_MODULE_3__.getCesiumAccessTokenAndEndpointUrl)(cesiumAsset.id, cesiumAsset.key);
90832
+ const tokenAndUrl = await (0,_tile_internal__WEBPACK_IMPORTED_MODULE_3__.getCesiumAccessTokenAndEndpointUrl)(`${cesiumAsset.id}`, cesiumAsset.key);
90801
90833
  if (tokenAndUrl.url && tokenAndUrl.token) {
90802
90834
  url = tokenAndUrl.url;
90803
90835
  this._requestAuthorization = `Bearer ${tokenAndUrl.token}`;
@@ -155773,7 +155805,7 @@ function getCesiumOSMBuildingsUrl() {
155773
155805
  return getCesiumAssetUrl(osmBuildingAssetId, key);
155774
155806
  }
155775
155807
  /** @internal */
155776
- async function getCesiumAccessTokenAndEndpointUrl(assetId = 1, requestKey) {
155808
+ async function getCesiumAccessTokenAndEndpointUrl(assetId, requestKey) {
155777
155809
  if (undefined === requestKey) {
155778
155810
  requestKey = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.tileAdmin.cesiumIonKey;
155779
155811
  if (undefined === requestKey)
@@ -155804,7 +155836,7 @@ function notifyTerrainError(detailedDescription) {
155804
155836
  }
155805
155837
  /** @internal */
155806
155838
  async function getCesiumTerrainProvider(opts) {
155807
- const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl();
155839
+ const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl(opts.dataSource || _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.CesiumTerrainAssetId.Default);
155808
155840
  if (!accessTokenAndEndpointUrl.token || !accessTokenAndEndpointUrl.url) {
155809
155841
  notifyTerrainError(_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.localization.getLocalizedString(`iModelJs:BackgroundMap.MissingCesiumToken`));
155810
155842
  return undefined;
@@ -155890,13 +155922,17 @@ class CesiumTerrainProvider extends _internal__WEBPACK_IMPORTED_MODULE_8__.Terra
155890
155922
  this._tilingScheme = tilingScheme;
155891
155923
  this._tileAvailability = tileAvailability;
155892
155924
  this._metaDataAvailableLevel = metaDataAvailableLevel;
155925
+ this._assetId = opts.dataSource || _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.CesiumTerrainAssetId.Default;
155893
155926
  this._tokenTimeOut = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now().plus(CesiumTerrainProvider._tokenTimeoutInterval);
155894
155927
  }
155895
155928
  addLogoCards(cards) {
155896
155929
  if (cards.dataset.cesiumIonLogoCard)
155897
155930
  return;
155898
155931
  cards.dataset.cesiumIonLogoCard = "true";
155899
- const card = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.makeLogoCard({ iconSrc: `${_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.publicPath}images/cesium-ion.svg`, heading: "Cesium Ion", notice: _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.localization.getLocalizedString("iModelJs:BackgroundMap.CesiumWorldTerrainAttribution") });
155932
+ let notice = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.localization.getLocalizedString("iModelJs:BackgroundMap.CesiumWorldTerrainAttribution");
155933
+ if (this._assetId === _itwin_core_common__WEBPACK_IMPORTED_MODULE_2__.CesiumTerrainAssetId.Bathymetry)
155934
+ notice = `${notice}\n${_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.localization.getLocalizedString("iModelJs:BackgroundMap.CesiumBathymetryAttribution")}`;
155935
+ const card = _IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.makeLogoCard({ iconSrc: `${_IModelApp__WEBPACK_IMPORTED_MODULE_6__.IModelApp.publicPath}images/cesium-ion.svg`, heading: "Cesium Ion", notice });
155900
155936
  cards.appendChild(card);
155901
155937
  }
155902
155938
  get maxDepth() { return this._maxDepth; }
@@ -155928,7 +155964,7 @@ class CesiumTerrainProvider extends _internal__WEBPACK_IMPORTED_MODULE_8__.Terra
155928
155964
  // ###TODO why does he update the access token when reading the mesh instead of when requesting it?
155929
155965
  // This function only returns undefined if it fails to acquire token - but it doesn't need the token...
155930
155966
  if (_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BeTimePoint.now().milliseconds > this._tokenTimeOut.milliseconds) {
155931
- const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl();
155967
+ const accessTokenAndEndpointUrl = await getCesiumAccessTokenAndEndpointUrl(this._assetId);
155932
155968
  if (!accessTokenAndEndpointUrl.token || args.isCanceled())
155933
155969
  return undefined;
155934
155970
  this._accessToken = accessTokenAndEndpointUrl.token;
@@ -161236,13 +161272,16 @@ class MapTreeSupplier {
161236
161272
  // Terrain-only settings.
161237
161273
  cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStrings)(lhs.terrainProviderName, rhs.terrainProviderName);
161238
161274
  if (0 === cmp) {
161239
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainHeightOrigin, rhs.terrainHeightOrigin);
161275
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareStringsOrUndefined)(lhs.terrainDataSource, rhs.terrainDataSource);
161240
161276
  if (0 === cmp) {
161241
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainHeightOriginMode, rhs.terrainHeightOriginMode);
161277
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainHeightOrigin, rhs.terrainHeightOrigin);
161242
161278
  if (0 === cmp) {
161243
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainExaggeration, rhs.terrainExaggeration);
161244
- if (0 === cmp)
161245
- cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleansOrUndefined)(lhs.produceGeometry, rhs.produceGeometry);
161279
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainHeightOriginMode, rhs.terrainHeightOriginMode);
161280
+ if (0 === cmp) {
161281
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareNumbers)(lhs.terrainExaggeration, rhs.terrainExaggeration);
161282
+ if (0 === cmp)
161283
+ cmp = (0,_itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.compareBooleansOrUndefined)(lhs.produceGeometry, rhs.produceGeometry);
161284
+ }
161246
161285
  }
161247
161286
  }
161248
161287
  }
@@ -161285,6 +161324,7 @@ class MapTreeSupplier {
161285
161324
  wantSkirts: id.wantSkirts,
161286
161325
  exaggeration: id.terrainExaggeration,
161287
161326
  wantNormals: id.wantNormals,
161327
+ dataSource: id.terrainDataSource,
161288
161328
  };
161289
161329
  if (id.applyTerrain) {
161290
161330
  await _ApproximateTerrainHeights__WEBPACK_IMPORTED_MODULE_3__.ApproximateTerrainHeights.instance.initialize();
@@ -161443,6 +161483,7 @@ class MapTileTreeReference extends _internal__WEBPACK_IMPORTED_MODULE_7__.TileTr
161443
161483
  tileUserId: this._tileUserId,
161444
161484
  applyTerrain: this.settings.applyTerrain && !this._isDrape,
161445
161485
  terrainProviderName: this.settings.terrainSettings.providerName,
161486
+ terrainDataSource: this.settings.terrainSettings.dataSource,
161446
161487
  terrainHeightOrigin: this.settings.terrainSettings.heightOrigin,
161447
161488
  terrainHeightOriginMode: this.settings.terrainSettings.heightOriginMode,
161448
161489
  terrainExaggeration: this.settings.terrainSettings.exaggeration,
@@ -190515,27 +190556,32 @@ __webpack_require__.r(__webpack_exports__);
190515
190556
  */
190516
190557
  class CoordinateXYZ extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.GeometryQuery {
190517
190558
  /** Return a (REFERENCE TO) the coordinate data. */
190518
- get point() { return this._xyz; }
190559
+ get point() {
190560
+ return this._xyz;
190561
+ }
190519
190562
  /**
190563
+ * Constructor
190520
190564
  * @param xyz point to be CAPTURED.
190521
190565
  */
190522
190566
  constructor(xyz) {
190523
190567
  super();
190524
- /** String name for interface properties */
190568
+ /** String name for interface properties. */
190525
190569
  this.geometryCategory = "point";
190526
190570
  this._xyz = xyz;
190527
190571
  }
190528
- /** Create a new CoordinateXYZ containing a CLONE of point */
190572
+ /** Create a new CoordinateXYZ containing a CLONE of point. */
190529
190573
  static create(point) {
190530
190574
  return new CoordinateXYZ(point.clone());
190531
190575
  }
190532
- /** Create a new CoordinateXYZ */
190576
+ /** Create a new CoordinateXYZ. */
190533
190577
  static createXYZ(x = 0, y = 0, z = 0) {
190534
190578
  return new CoordinateXYZ(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Point3d.create(x, y, z));
190535
190579
  }
190536
- /** Return the range of the point */
190537
- range() { return _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__.Range3d.create(this._xyz); }
190538
- /** Extend `rangeToExtend` to include this point (optionally transformed) */
190580
+ /** Return the range of the point. */
190581
+ range() {
190582
+ return _geometry3d_Range__WEBPACK_IMPORTED_MODULE_2__.Range3d.create(this._xyz);
190583
+ }
190584
+ /** Extend `rangeToExtend` to include this point (optionally transformed). */
190539
190585
  extendRange(rangeToExtend, transform) {
190540
190586
  if (transform)
190541
190587
  rangeToExtend.extendTransformedXYZ(transform, this._xyz.x, this._xyz.y, this._xyz.z);
@@ -190547,27 +190593,23 @@ class CoordinateXYZ extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
190547
190593
  transform.multiplyPoint3d(this._xyz, this._xyz);
190548
190594
  return true;
190549
190595
  }
190550
- /** Return a transformed clone */
190596
+ /** Return a transformed clone. */
190551
190597
  cloneTransformed(transform) {
190552
190598
  const result = new CoordinateXYZ(this._xyz.clone());
190553
190599
  result.tryTransformInPlace(transform);
190554
190600
  return result;
190555
190601
  }
190556
- /** Return a clone */
190602
+ /** Return a clone. */
190557
190603
  clone() {
190558
190604
  return new CoordinateXYZ(this._xyz.clone());
190559
190605
  }
190560
- /**
190561
- * Return GeometryQuery children for recursive queries.
190562
- * * Leaf classes do not need to implement.
190563
- */
190564
190606
  /** Test if (other instanceof Coordinate). */
190565
190607
  isSameGeometryClass(other) {
190566
190608
  return other instanceof CoordinateXYZ;
190567
190609
  }
190568
190610
  /**
190569
190611
  * Test for exact structure and nearly identical geometry.
190570
- * * Leaf classes must implement !!!
190612
+ * * Leaf classes must implement.
190571
190613
  * * Base class implementation recurses through children.
190572
190614
  * * Base implementation is complete for classes with children and no properties.
190573
190615
  * * Classes with both children and properties must implement for properties, call super for children.
@@ -190575,7 +190617,7 @@ class CoordinateXYZ extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
190575
190617
  isAlmostEqual(other) {
190576
190618
  return (other instanceof CoordinateXYZ) && this._xyz.isAlmostEqual(other._xyz);
190577
190619
  }
190578
- /** Second step of double dispatch: call `handler.handleCoordinateXYZ(this)` */
190620
+ /** Second step of double dispatch: call `handler.handleCoordinateXYZ(this)` */
190579
190621
  dispatchToGeometryHandler(handler) {
190580
190622
  return handler.handleCoordinateXYZ(this);
190581
190623
  }
@@ -194224,13 +194266,13 @@ __webpack_require__.r(__webpack_exports__);
194224
194266
 
194225
194267
 
194226
194268
  /**
194227
- * Queries to be supported by Curve, Surface, and Solid objects
194269
+ * Queries to be supported by Curve, Surface, and Solid objects.
194228
194270
  * * `GeometryQuery` is an abstract base class with (abstract) methods for querying curve, solid primitive, mesh,
194229
- * and bspline surfaces
194271
+ * and bspline surfaces.
194230
194272
  * @public
194231
194273
  */
194232
194274
  class GeometryQuery {
194233
- /** Return the range of the entire GeometryQuery tree */
194275
+ /** Return the range of the entire GeometryQuery tree. */
194234
194276
  range(transform, result) {
194235
194277
  if (result)
194236
194278
  result.setNull();
@@ -194238,7 +194280,7 @@ class GeometryQuery {
194238
194280
  this.extendRange(range, transform);
194239
194281
  return range;
194240
194282
  }
194241
- /** Try to move the geometry by dx,dy,dz */
194283
+ /** Try to move the geometry by dx,dy,dz. */
194242
194284
  tryTranslateInPlace(dx, dy = 0.0, dz = 0.0) {
194243
194285
  return this.tryTransformInPlace(_geometry3d_Transform__WEBPACK_IMPORTED_MODULE_1__.Transform.createTranslationXYZ(dx, dy, dz));
194244
194286
  }
@@ -194246,13 +194288,15 @@ class GeometryQuery {
194246
194288
  * Return GeometryQuery children for recursive queries.
194247
194289
  * * leaf classes do not need to implement.
194248
194290
  */
194249
- get children() { return undefined; }
194291
+ get children() {
194292
+ return undefined;
194293
+ }
194250
194294
  /**
194251
194295
  * Test for exact structure and nearly identical geometry.
194252
- * * Leaf classes must implement !!!
194253
- * * base class implementation recurses through children.
194254
- * * base implementation is complete for classes with children and no properties.
194255
- * * classes with both children and properties must implement for properties, call super for children.
194296
+ * * Leaf classes must implement.
194297
+ * * Base class implementation recurses through children.
194298
+ * * Base implementation is complete for classes with children and no properties.
194299
+ * * Classes with both children and properties must implement for properties, call super for children.
194256
194300
  */
194257
194301
  isAlmostEqual(other) {
194258
194302
  if (this.isSameGeometryClass(other)) {
@@ -194267,20 +194311,19 @@ class GeometryQuery {
194267
194311
  }
194268
194312
  return true;
194269
194313
  }
194270
- else if (childrenA || childrenB) { // CurveCollections start with empty arrays for children. So these null pointer cases are never reached.
194271
- return false; // plainly different .
194314
+ else if (childrenA || childrenB) { // CurveCollections start with empty arrays for children so these null pointer cases are never reached.
194315
+ return false; // plainly different
194272
194316
  }
194273
194317
  else {
194274
- // both children null. call it equal? This class should probably have implemented.
194275
- return true;
194318
+ return true; // both children null; call it equal
194276
194319
  }
194277
194320
  }
194278
194321
  return false;
194279
194322
  }
194280
194323
  /**
194281
194324
  * Apply instance method [[isAlmostEqual]] if both are defined.
194282
- * * both undefined returns true
194283
- * * single defined returns false
194325
+ * * Both undefined returns true.
194326
+ * * Single defined returns false.
194284
194327
  */
194285
194328
  static areAlmostEqual(a, b) {
194286
194329
  if (a instanceof GeometryQuery && b instanceof GeometryQuery)
@@ -196914,9 +196957,13 @@ __webpack_require__.r(__webpack_exports__);
196914
196957
  */
196915
196958
  class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.GeometryQuery {
196916
196959
  /** Test if `other` is a PointString3d */
196917
- isSameGeometryClass(other) { return other instanceof PointString3d; }
196918
- /** return a clone of the points array. */
196919
- get points() { return this._points; }
196960
+ isSameGeometryClass(other) {
196961
+ return other instanceof PointString3d;
196962
+ }
196963
+ /** Return a clone of the points array. */
196964
+ get points() {
196965
+ return this._points;
196966
+ }
196920
196967
  constructor() {
196921
196968
  super();
196922
196969
  /** String name for schema properties */
@@ -196926,11 +196973,18 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
196926
196973
  /** Clone and apply a transform. */
196927
196974
  cloneTransformed(transform) {
196928
196975
  const c = this.clone();
196929
- c.tryTransformInPlace(transform);
196976
+ c.tryTransformInPlace(transform); // we know tryTransformInPlace succeeds
196930
196977
  return c;
196931
196978
  }
196979
+ /**
196980
+ * Turn any array (possibly nested) into a "flat" array of objects that are not arrays. This allows processing
196981
+ * the objects without recursion into nested arrays.
196982
+ */
196932
196983
  static flattenArray(arr) {
196933
- return arr.reduce((flat, toFlatten) => {
196984
+ return arr.reduce(
196985
+ // a callback function to execute for each element in the array. Its return value becomes
196986
+ // the value of the "flat" parameter on the next invocation of the callback function.
196987
+ (flat, toFlatten) => {
196934
196988
  return flat.concat(Array.isArray(toFlatten) ? PointString3d.flattenArray(toFlatten) : toFlatten);
196935
196989
  }, []);
196936
196990
  }
@@ -196940,7 +196994,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
196940
196994
  result.addPoints(points);
196941
196995
  return result;
196942
196996
  }
196943
- /** Add multiple points to the PointString3d */
196997
+ /** Add multiple points to the PointString3d. */
196944
196998
  addPoints(...points) {
196945
196999
  const toAdd = PointString3d.flattenArray(points);
196946
197000
  for (const p of toAdd) {
@@ -196948,25 +197002,25 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
196948
197002
  this._points.push(p);
196949
197003
  }
196950
197004
  }
196951
- /** Add a single point to the PointString3d */
197005
+ /** Add a single point to the PointString3d. */
196952
197006
  addPoint(point) {
196953
197007
  this._points.push(point);
196954
197008
  }
196955
- /** Remove the last point added to the PointString3d */
197009
+ /** Remove the last point added to the PointString3d. */
196956
197010
  popPoint() {
196957
197011
  this._points.pop();
196958
197012
  }
196959
- /** Replace this PointString3d's point array by a clone of the array in `other` */
197013
+ /** Replace this PointString3d's point array by a clone of the array in `other`. */
196960
197014
  setFrom(other) {
196961
197015
  this._points = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.clonePoint3dArray(other._points);
196962
197016
  }
196963
- /** Create from an array of Point3d */
197017
+ /** Create from an array of Point3d. */
196964
197018
  static createPoints(points) {
196965
197019
  const ps = new PointString3d();
196966
197020
  ps._points = _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.clonePoint3dArray(points);
196967
197021
  return ps;
196968
197022
  }
196969
- /** Create a PointString3d from xyz coordinates packed in a Float64Array */
197023
+ /** Create a PointString3d from xyz coordinates packed in a Float64Array. */
196970
197024
  static createFloat64Array(xyzData) {
196971
197025
  const ps = new PointString3d();
196972
197026
  for (let i = 0; i + 3 <= xyzData.length; i += 3)
@@ -196979,7 +197033,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
196979
197033
  retVal.setFrom(this);
196980
197034
  return retVal;
196981
197035
  }
196982
- /** Replace this instance's points by those from a json array, e.g. `[[1,2,3], [4,2,2]]` */
197036
+ /** Replace this instance's points by those from a json array, e.g. `[[1,2,3], [4,5,6]]`. */
196983
197037
  setFromJSON(json) {
196984
197038
  this._points.length = 0;
196985
197039
  if (Array.isArray(json)) {
@@ -196990,7 +197044,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
196990
197044
  }
196991
197045
  /**
196992
197046
  * Convert an PointString3d to a JSON object.
196993
- * @return {*} [[x,y,z],...[x,y,z]]
197047
+ * @return {*} e.g., `[[1,2,3], [4,5,6]]`.
196994
197048
  */
196995
197049
  toJSON() {
196996
197050
  const value = [];
@@ -196998,7 +197052,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
196998
197052
  value.push(p.toJSON());
196999
197053
  return value;
197000
197054
  }
197001
- /** Create a PointString3d from a json array, e.g. `[[1,2,3], [4,2,2]]` */
197055
+ /** Create a PointString3d from a json array, e.g. `[[1,2,3], [4,5,6]]`. */
197002
197056
  static fromJSON(json) {
197003
197057
  const ps = new PointString3d();
197004
197058
  ps.setFromJSON(json);
@@ -197016,14 +197070,16 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
197016
197070
  return undefined;
197017
197071
  }
197018
197072
  /** Return the number of points. */
197019
- numPoints() { return this._points.length; }
197073
+ numPoints() {
197074
+ return this._points.length;
197075
+ }
197020
197076
  /** Reverse the point order */
197021
197077
  reverseInPlace() {
197022
197078
  if (this._points.length >= 2) {
197023
197079
  let i0 = 0;
197024
197080
  let i1 = this._points.length - 1;
197025
197081
  while (i0 < i1) {
197026
- const a = this._points[i0];
197082
+ const a = this._points[i1];
197027
197083
  this._points[i1] = this._points[i0];
197028
197084
  this._points[i0] = a;
197029
197085
  i0++;
@@ -197031,7 +197087,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
197031
197087
  }
197032
197088
  }
197033
197089
  }
197034
- /** Return the number of points. */
197090
+ /** Apply transform on points in place. */
197035
197091
  tryTransformInPlace(transform) {
197036
197092
  transform.multiplyPoint3dArrayInPlace(this._points);
197037
197093
  return true;
@@ -197050,7 +197106,7 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
197050
197106
  isInPlane(plane) {
197051
197107
  return _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.isCloseToPlane(this._points, plane, _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance);
197052
197108
  }
197053
- /** Extend a range to include the points in this PointString3d. */
197109
+ /** Extend a range to include the points in this PointString3d (optionally transformed). */
197054
197110
  extendRange(rangeToExtend, transform) {
197055
197111
  rangeToExtend.extendArray(this._points, transform);
197056
197112
  }
@@ -197061,8 +197117,10 @@ class PointString3d extends _GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometry
197061
197117
  return _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.Point3dArray.isAlmostEqual(this._points, other._points);
197062
197118
  }
197063
197119
  /** Reduce to empty set of points. */
197064
- clear() { this._points.length = 0; }
197065
- /** Second step of double dispatch: call `handler.handlePointString(this)` */
197120
+ clear() {
197121
+ this._points.length = 0;
197122
+ }
197123
+ /** Second step of double dispatch: call `handler.handlePointString(this)` */
197066
197124
  dispatchToGeometryHandler(handler) {
197067
197125
  return handler.handlePointString3d(this);
197068
197126
  }
@@ -238918,6 +238976,7 @@ __webpack_require__.r(__webpack_exports__);
238918
238976
  * @public
238919
238977
  */
238920
238978
  class Polyface extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.GeometryQuery {
238979
+ /** Constructor */
238921
238980
  constructor(data) {
238922
238981
  super();
238923
238982
  /** String name for schema properties */
@@ -238925,69 +238984,102 @@ class Polyface extends _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_0__.Geometr
238925
238984
  this.data = data;
238926
238985
  }
238927
238986
  /** Flag indicating if the mesh display must assume both sides are visible. */
238928
- get twoSided() { return this.data.twoSided; }
238929
- set twoSided(value) { this.data.twoSided = value; }
238930
- /** Flag indicating if the mesh closure is unknown (0), open sheet (1), closed (2) */
238931
- get expectedClosure() { return this.data.expectedClosure; }
238932
- set expectedClosure(value) { this.data.expectedClosure = value; }
238933
- /**
238934
- * Check validity of indices into a data array.
238935
- * * It is valid to have both indices and data undefined.
238936
- * * It is NOT valid for just one to be defined.
238937
- * * Index values at indices[indexPositionA <= i < indexPositionB] must be valid indices to the data array.
238938
- * @param indices array of indices.
238939
- * @param indexPositionA first index to test
238940
- * @param indexPositionB one past final index to test
238941
- * @param data data array
238942
- * @param dataLength length of data array
238943
- */
238987
+ get twoSided() {
238988
+ return this.data.twoSided;
238989
+ }
238990
+ set twoSided(value) {
238991
+ this.data.twoSided = value;
238992
+ }
238993
+ /**
238994
+ * Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).
238995
+ * * A boundary edge of a mesh is defined as an edge with only one connected facet.
238996
+ * * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).
238997
+ */
238998
+ get expectedClosure() {
238999
+ return this.data.expectedClosure;
239000
+ }
239001
+ set expectedClosure(value) {
239002
+ this.data.expectedClosure = value;
239003
+ }
239004
+ /**
239005
+ * Check validity of indices into a data array.
239006
+ * * It is valid to have both indices and data undefined.
239007
+ * * It is NOT valid for just one to be defined.
239008
+ * * Index values at indices[indexPositionA <= i < indexPositionB] must be valid indices to the data array.
239009
+ * @param indices array of indices.
239010
+ * @param indexPositionA first index to test.
239011
+ * @param indexPositionB one past final index to test.
239012
+ * @param data data array.
239013
+ * @param dataLength length of data array.
239014
+ */
238944
239015
  static areIndicesValid(indices, indexPositionA, indexPositionB, data, dataLength) {
238945
239016
  if (indices === undefined && data === undefined)
238946
239017
  return true;
238947
- if (!indices || !data)
239018
+ if (indices === undefined || data === undefined)
238948
239019
  return false;
238949
239020
  if (indexPositionA < 0 || indexPositionA >= indices.length)
238950
239021
  return false;
238951
- if (indexPositionB < indexPositionA || indexPositionB > indices.length)
239022
+ if (indexPositionB <= indexPositionA || indexPositionB > indices.length)
238952
239023
  return false;
238953
239024
  for (let i = indexPositionA; i < indexPositionB; i++)
238954
239025
  if (indices[i] < 0 || indices[i] >= dataLength)
238955
239026
  return false;
238956
239027
  return true;
238957
239028
  }
238958
- /**
238959
- * Returns the number of facets of this polyface. Subclasses should override.
238960
- */
239029
+ /** Returns the number of facets of this polyface. Subclasses should override. */
238961
239030
  get facetCount() {
238962
239031
  return undefined;
238963
239032
  }
238964
239033
  }
238965
239034
  /**
238966
- * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point, normal, param, and color indices.
239035
+ * An `IndexedPolyface` is a set of facets which can have normal, param, and color arrays with independent point,
239036
+ * normal, param, and color indices.
238967
239037
  * @public
238968
239038
  */
238969
239039
  class IndexedPolyface extends Polyface {
239040
+ /**
239041
+ * Constructor for a new polyface.
239042
+ * @param data PolyfaceData arrays to capture.
239043
+ * @param facetStart optional array of facet start indices (e.g. known during clone)
239044
+ * @param facetToFacetData optional array of face identifiers (e.g. known during clone)
239045
+ */
239046
+ constructor(data, facetStart, facetToFaceData) {
239047
+ super(data);
239048
+ if (facetStart)
239049
+ this._facetStart = facetStart.slice(); // deep copy
239050
+ else {
239051
+ this._facetStart = [];
239052
+ this._facetStart.push(0);
239053
+ }
239054
+ if (facetToFaceData)
239055
+ this._facetToFaceData = facetToFaceData.slice(); // deep copy
239056
+ else
239057
+ this._facetToFaceData = [];
239058
+ }
238970
239059
  /** Test if other is an instance of `IndexedPolyface` */
238971
- isSameGeometryClass(other) { return other instanceof IndexedPolyface; }
239060
+ isSameGeometryClass(other) {
239061
+ return other instanceof IndexedPolyface;
239062
+ }
238972
239063
  /** Tests for equivalence between two IndexedPolyfaces. */
238973
239064
  isAlmostEqual(other) {
238974
239065
  if (other instanceof IndexedPolyface) {
238975
- return this.data.isAlmostEqual(other.data) && _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__.NumberArray.isExactEqual(this._facetStart, other._facetStart) &&
239066
+ return this.data.isAlmostEqual(other.data) &&
239067
+ _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__.NumberArray.isExactEqual(this._facetStart, other._facetStart) &&
238976
239068
  _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_1__.NumberArray.isExactEqual(this._facetToFaceData, other._facetToFaceData);
238977
239069
  }
238978
239070
  return false;
238979
239071
  }
239072
+ /** Returns true if either the point array or the point index array is empty. */
239073
+ get isEmpty() {
239074
+ return this.data.pointCount === 0 || this.data.pointIndex.length === 0;
239075
+ }
238980
239076
  /**
238981
- * Returns true if either the point array or the point index array is empty.
238982
- */
238983
- get isEmpty() { return this.data.pointCount === 0 || this.data.pointIndex.length === 0; }
238984
- /**
238985
- * * apply the transform to points
238986
- * * apply the (inverse transpose of) the matrix part to normals
238987
- * * If determinant is negative, also
239077
+ * Transform the mesh.
239078
+ * * Apply the transform to points.
239079
+ * * Apply the (inverse transpose of the) matrix part to normals.
239080
+ * * If determinant of the transform matrix is negative, also
238988
239081
  * * negate normals
238989
239082
  * * reverse index order around each facet.
238990
- * @param transform
238991
239083
  */
238992
239084
  tryTransformInPlace(transform) {
238993
239085
  if (!this.data.tryTransformInPlace(transform))
@@ -239008,52 +239100,47 @@ class IndexedPolyface extends Polyface {
239008
239100
  const result = new IndexedPolyface(this.data.clone(), this._facetStart.slice(), this._facetToFaceData.slice());
239009
239101
  return result;
239010
239102
  }
239011
- /** Return a deep clone with transformed points and normals */
239103
+ /**
239104
+ * Return a deep clone with transformed points and normals.
239105
+ * @see [[IndexedPolyface.tryTransformInPlace]] for details of how transform is done.
239106
+ */
239012
239107
  cloneTransformed(transform) {
239013
239108
  const result = this.clone();
239014
239109
  result.tryTransformInPlace(transform);
239015
239110
  return result;
239016
239111
  }
239017
239112
  /** Reverse the order of indices around all facets. */
239018
- reverseIndices() { this.data.reverseIndices(this._facetStart); }
239113
+ reverseIndices() {
239114
+ this.data.reverseIndices(this._facetStart);
239115
+ }
239019
239116
  /** Reverse the direction of all normal vectors. */
239020
- reverseNormals() { this.data.reverseNormals(); }
239021
- /** return face data using a facet index. This is the REFERENCE to the FacetFaceData, not a copy. Returns undefined if none found. */
239117
+ reverseNormals() {
239118
+ this.data.reverseNormals();
239119
+ }
239120
+ /**
239121
+ * Return face data using a facet index.
239122
+ * * Returns `undefined` if none found.
239123
+ * * This is the REFERENCE to the FacetFaceData not a copy.
239124
+ */
239022
239125
  tryGetFaceData(i) {
239126
+ if (i < 0 || i >= this._facetToFaceData.length)
239127
+ return undefined;
239023
239128
  const faceIndex = this._facetToFaceData[i];
239024
- if (faceIndex >= this.data.face.length)
239129
+ if (faceIndex < 0 || faceIndex >= this.data.face.length)
239025
239130
  return undefined;
239026
239131
  return this.data.face[faceIndex];
239027
239132
  }
239028
239133
  /**
239029
- * Constructor for a new polyface.
239030
- * @param data PolyfaceData arrays to capture.
239031
- * @param facetStart optional array of facet start indices (e.g. known during clone)
239032
- * @param facetToFacetData optional array of face identifiers (e.g. known during clone)
239033
- */
239034
- constructor(data, facetStart, facetToFaceData) {
239035
- super(data);
239036
- if (facetStart)
239037
- this._facetStart = facetStart.slice();
239038
- else {
239039
- this._facetStart = [];
239040
- this._facetStart.push(0);
239041
- }
239042
- if (facetToFaceData)
239043
- this._facetToFaceData = facetToFaceData.slice();
239044
- else
239045
- this._facetToFaceData = [];
239046
- }
239047
- /**
239048
- * * Add facets from source to this polyface.
239049
- * * Optionally reverse facet indices as per PolyfaceData.reverseIndicesSingleFacet() with preserveStart = false, and invert source normals.
239050
- * * Optionally apply a transform to points and normals.
239134
+ * Add facets from `source` to `this` polyface.
239135
+ * * Optionally reverse facet indices as per `PolyfaceData.reverseIndicesSingleFacet()` with `preserveStart = false` and
239136
+ * invert source normals.
239137
+ * * Optionally apply a `transform` to points and normals.
239051
239138
  * * Will only copy param, normal, color, and face data if we are already tracking them AND/OR the source contains them.
239052
239139
  */
239053
239140
  addIndexedPolyface(source, reversed, transform) {
239054
239141
  const numSourceFacets = source.facetCount;
239055
- // Add point, point index, and edge visibility data
239056
- // Note: there is no need to build an intermediate index map since all points are added
239142
+ // add point, point index, and edge visibility data
239143
+ // note that there is no need to build an intermediate index map since all points are added
239057
239144
  const startOfNewPoints = this.data.point.length;
239058
239145
  const xyz = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create();
239059
239146
  for (let i = 0; i < source.data.point.length; i++) {
@@ -239080,11 +239167,11 @@ class IndexedPolyface extends Polyface {
239080
239167
  }
239081
239168
  this.terminateFacet(false);
239082
239169
  }
239083
- // Add param and param index data
239170
+ // add param and param index data
239084
239171
  if (undefined !== this.data.param && undefined !== source.data.param && undefined !== source.data.paramIndex) {
239085
239172
  const startOfNewParams = this.data.param.length;
239086
239173
  this.data.param.pushFromGrowableXYArray(source.data.param);
239087
- for (let i = 0; i < numSourceFacets; i++) { // Expect facet start and ends for points to match normals
239174
+ for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals
239088
239175
  const i0 = source._facetStart[i];
239089
239176
  const i1 = source._facetStart[i + 1];
239090
239177
  if (reversed) {
@@ -239097,7 +239184,7 @@ class IndexedPolyface extends Polyface {
239097
239184
  }
239098
239185
  }
239099
239186
  }
239100
- // Add normal and normal index data
239187
+ // add normal and normal index data
239101
239188
  if (undefined !== this.data.normal && undefined !== source.data.normal && undefined !== source.data.normalIndex) {
239102
239189
  const startOfNewNormals = this.data.normal.length;
239103
239190
  for (let i = 0; i < source.data.normal.length; i++) {
@@ -239108,7 +239195,7 @@ class IndexedPolyface extends Polyface {
239108
239195
  sourceNormal.scaleInPlace(-1.0);
239109
239196
  this.addNormal(sourceNormal);
239110
239197
  }
239111
- for (let i = 0; i < numSourceFacets; i++) { // Expect facet start and ends for points to match normals
239198
+ for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match normals
239112
239199
  const i0 = source._facetStart[i];
239113
239200
  const i1 = source._facetStart[i + 1];
239114
239201
  if (reversed) {
@@ -239121,12 +239208,12 @@ class IndexedPolyface extends Polyface {
239121
239208
  }
239122
239209
  }
239123
239210
  }
239124
- // Add color and color index data
239211
+ // add color and color index data
239125
239212
  if (undefined !== this.data.color && undefined !== source.data.color && undefined !== source.data.colorIndex) {
239126
239213
  const startOfNewColors = this.data.color.length;
239127
239214
  for (const sourceColor of source.data.color)
239128
239215
  this.addColor(sourceColor);
239129
- for (let i = 0; i < numSourceFacets; i++) { // Expect facet start and ends for points to match colors
239216
+ for (let i = 0; i < numSourceFacets; i++) { // expect facet start and ends for points to match colors
239130
239217
  const i0 = source._facetStart[i];
239131
239218
  const i1 = source._facetStart[i + 1];
239132
239219
  if (reversed) {
@@ -239139,7 +239226,7 @@ class IndexedPolyface extends Polyface {
239139
239226
  }
239140
239227
  }
239141
239228
  }
239142
- // Add face and facetToFace index data
239229
+ // add face and facetToFace index data
239143
239230
  if (source.data.face.length !== 0) {
239144
239231
  const startOfNewFaceData = this.data.face.length;
239145
239232
  for (const face of source.data.face) {
@@ -239151,25 +239238,31 @@ class IndexedPolyface extends Polyface {
239151
239238
  }
239152
239239
  }
239153
239240
  }
239154
- /** Return the total number of param indices in zero-terminated style, which includes
239155
- * * all the indices in the packed zero-based table
239241
+ /**
239242
+ * Return the total number of indices in zero-terminated style, which includes
239243
+ * * all the indices in the packed zero-based table.
239156
239244
  * * one additional index for the zero-terminator of each facet.
239157
- * @note Note that all index arrays (point, normal, param, color) have the same counts, so there
239245
+ * @note Note that all index arrays (pointIndex, normalIndex, paramIndex, colorIndex) have the same counts, so there
239158
239246
  * is not a separate query for each of them.
239159
239247
  */
239160
- get zeroTerminatedIndexCount() { return this.data.pointIndex.length + this._facetStart.length - 1; }
239161
- /** Create an empty facet set, with coordinate and index data to be supplied later.
239162
- * @param needNormals true if normals will be constructed
239163
- * @param needParams true if uv parameters will be constructed
239164
- * @param needColors true if colors will e constructed.
239248
+ get zeroTerminatedIndexCount() {
239249
+ return this.data.pointIndex.length + this._facetStart.length - 1;
239250
+ }
239251
+ /**
239252
+ * Create an empty facet set with coordinate and index data to be supplied later.
239253
+ * @param needNormals true if normals will be constructed.
239254
+ * @param needParams true if uv parameters will be constructed.
239255
+ * @param needColors true if colors will be constructed.
239256
+ * @param twoSided true if the facets are to be considered viewable from the back.
239165
239257
  */
239166
239258
  static create(needNormals = false, needParams = false, needColors = false, twoSided = false) {
239167
239259
  return new IndexedPolyface(new _PolyfaceData__WEBPACK_IMPORTED_MODULE_3__.PolyfaceData(needNormals, needParams, needColors, twoSided));
239168
239260
  }
239169
- /** add (a clone of ) a point. return its 0 based index.
239170
- * @param point point coordinates
239171
- * @param priorIndex optional index of prior point to check for repeated coordinates
239172
- * @returns Returns the zero-based index of the added or reused point.
239261
+ /**
239262
+ * Add (a clone of) a point to point array.
239263
+ * @param point the point.
239264
+ * @param priorIndex (optional) index of prior point to check for possible duplicate value.
239265
+ * @returns the zero-based index of the added or duplicate point.
239173
239266
  */
239174
239267
  addPoint(point, priorIndex) {
239175
239268
  if (priorIndex !== undefined) {
@@ -239180,12 +239273,21 @@ class IndexedPolyface extends Polyface {
239180
239273
  this.data.point.pushXYZ(point.x, point.y, point.z);
239181
239274
  return this.data.point.length - 1;
239182
239275
  }
239183
- /** add a point.
239184
- * @returns Returns the zero-based index of the added point.
239276
+ /**
239277
+ * Add a point to point array.
239278
+ * @param x the x coordinate of point.
239279
+ * @param y the y coordinate of point.
239280
+ * @param z the z coordinate of point.
239281
+ * @returns the zero-based index of the added point.
239185
239282
  */
239186
- addPointXYZ(x, y, z) { this.data.point.pushXYZ(x, y, z); return this.data.point.length - 1; }
239187
- /** Add a uv param.
239188
- * @returns 0-based index of the added param.
239283
+ addPointXYZ(x, y, z) {
239284
+ this.data.point.pushXYZ(x, y, z);
239285
+ return this.data.point.length - 1;
239286
+ }
239287
+ /**
239288
+ * Add (a clone of) a uv parameter to the parameter array.
239289
+ * @param param the parameter.
239290
+ * @returns zero-based index of the added param.
239189
239291
  */
239190
239292
  addParam(param) {
239191
239293
  if (!this.data.param)
@@ -239193,10 +239295,13 @@ class IndexedPolyface extends Polyface {
239193
239295
  this.data.param.push(param);
239194
239296
  return this.data.param.length - 1;
239195
239297
  }
239196
- /** Add a uv parameter to the parameter array.
239298
+ /**
239299
+ * Add a uv parameter to the parameter array.
239300
+ * @param u the u part of parameter.
239301
+ * @param v the v part of parameter.
239197
239302
  * @param priorIndexA first index to check for possible duplicate value.
239198
239303
  * @param priorIndexB second index to check for possible duplicate value.
239199
- * @returns 0-based index of the added or reused param.
239304
+ * @returns zero-based index of the added or duplicate parameter.
239200
239305
  */
239201
239306
  addParamUV(u, v, priorIndexA, priorIndexB) {
239202
239307
  if (!this.data.param)
@@ -239208,37 +239313,39 @@ class IndexedPolyface extends Polyface {
239208
239313
  this.data.param.pushXY(u, v);
239209
239314
  return this.data.param.length - 1;
239210
239315
  }
239211
- /** Add a normal vector
239316
+ /**
239317
+ * Add (a clone of) a normal vector to the normal array.
239318
+ * @param normal the normal vector.
239212
239319
  * @param priorIndexA first index to check for possible duplicate value.
239213
239320
  * @param priorIndexB second index to check for possible duplicate value.
239214
- * @returns 0-based index of the added or reused normal.
239321
+ * @returns zero-based index of the added or duplicate normal.
239215
239322
  */
239216
239323
  addNormal(normal, priorIndexA, priorIndexB) {
239324
+ // check if `normal` is duplicate of `dataNormal` at index `i`
239325
+ const normalIsDuplicate = (dataNormal, i) => {
239326
+ const distance = dataNormal.distanceIndexToPoint(i, normal);
239327
+ return distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance);
239328
+ };
239217
239329
  if (this.data.normal !== undefined) {
239218
- let distance;
239219
- if (priorIndexA !== undefined) {
239220
- distance = this.data.normal.distanceIndexToPoint(priorIndexA, normal);
239221
- if (distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance))
239222
- return priorIndexA;
239223
- }
239224
- if (priorIndexB !== undefined) {
239225
- distance = this.data.normal.distanceIndexToPoint(priorIndexB, normal);
239226
- if (distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance))
239227
- return priorIndexB;
239228
- }
239229
- // Note: Do NOT attempt to chain to tail if no prior indices given.
239230
- // But if they are, look also to the tail.
239330
+ if (priorIndexA !== undefined && normalIsDuplicate(this.data.normal, priorIndexA))
239331
+ return priorIndexA;
239332
+ if (priorIndexB !== undefined && normalIsDuplicate(this.data.normal, priorIndexB))
239333
+ return priorIndexB;
239334
+ // check the tail index for possible duplicate
239231
239335
  if (priorIndexA !== undefined || priorIndexB !== undefined) {
239232
239336
  const tailIndex = this.data.normal.length - 1;
239233
- distance = this.data.normal.distanceIndexToPoint(tailIndex, normal);
239234
- if (distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance))
239337
+ if (normalIsDuplicate(this.data.normal, tailIndex))
239235
239338
  return tailIndex;
239236
239339
  }
239237
239340
  }
239238
239341
  return this.addNormalXYZ(normal.x, normal.y, normal.z);
239239
239342
  }
239240
- /** Add a normal vector given by direct coordinates
239241
- * @returns 0-based index of the added or reused param.
239343
+ /**
239344
+ * Add a normal vector to the normal array.
239345
+ * @param x the x coordinate of normal.
239346
+ * @param y the y coordinate of normal.
239347
+ * @param z the z coordinate of normal.
239348
+ * @returns zero-based index of the added normal vector.
239242
239349
  */
239243
239350
  addNormalXYZ(x, y, z) {
239244
239351
  if (!this.data.normal)
@@ -239246,8 +239353,10 @@ class IndexedPolyface extends Polyface {
239246
239353
  this.data.normal.pushXYZ(x, y, z);
239247
239354
  return this.data.normal.length - 1;
239248
239355
  }
239249
- /** Add a color
239250
- * @returns 0-based index of the added or reused color.
239356
+ /**
239357
+ * Add a color to the color array
239358
+ * @param color the color.
239359
+ * @returns zero-based index of the added color.
239251
239360
  */
239252
239361
  addColor(color) {
239253
239362
  if (!this.data.color)
@@ -239256,46 +239365,54 @@ class IndexedPolyface extends Polyface {
239256
239365
  return this.data.color.length - 1;
239257
239366
  }
239258
239367
  /** Add a point index with edge visibility flag. */
239259
- addPointIndex(index, visible = true) { this.data.pointIndex.push(index); this.data.edgeVisible.push(visible); }
239260
- /** Add a normal index */
239368
+ addPointIndex(index, visible = true) {
239369
+ this.data.pointIndex.push(index);
239370
+ this.data.edgeVisible.push(visible);
239371
+ }
239372
+ /** Add a normal index. */
239261
239373
  addNormalIndex(index) {
239262
239374
  if (!this.data.normalIndex)
239263
239375
  this.data.normalIndex = [];
239264
239376
  this.data.normalIndex.push(index);
239265
239377
  }
239266
- /** Add a param index */
239378
+ /** Add a param index. */
239267
239379
  addParamIndex(index) {
239268
239380
  if (!this.data.paramIndex)
239269
239381
  this.data.paramIndex = [];
239270
239382
  this.data.paramIndex.push(index);
239271
239383
  }
239272
- /** Add a color index */
239384
+ /** Add a color index. */
239273
239385
  addColorIndex(index) {
239274
239386
  if (!this.data.colorIndex)
239275
239387
  this.data.colorIndex = [];
239276
239388
  this.data.colorIndex.push(index);
239277
239389
  }
239278
- /** clean up the open facet. return the returnValue (so caller can easily return cleanupOpenFacet("message")) */
239390
+ /**
239391
+ * Clean up the open facet.
239392
+ * @deprecated in 4.x to remove nebulous "open facet" concept from the API. Call [[PolyfaceData.trimAllIndexArrays]]
239393
+ * instead.
239394
+ */
239279
239395
  cleanupOpenFacet() {
239280
239396
  this.data.trimAllIndexArrays(this.data.pointIndex.length);
239281
239397
  }
239282
- /** announce the end of construction of a facet.
239283
- *
239284
- * * The "open" facet is checked for:
239285
- *
239286
- * ** Same number of indices among all active index arrays -- point, normal, param, color
239287
- * ** All indices are within bounds of the respective data arrays.
239288
- * * in error cases, all index arrays are trimmed back to the size when previous facet was terminated.
239289
- * * "undefined" return is normal. Any other return is a description of an error.
239398
+ /**
239399
+ * Announce the end of construction of a facet.
239400
+ * * Optionally check for:
239401
+ * * Same number of indices among all active index arrays -- point, normal, param, color
239402
+ * * All indices are within bounds of the respective data arrays.
239403
+ * * In error cases, all index arrays are trimmed back to the size when previous facet was terminated.
239404
+ * * A return value of `undefined` is normal. Otherwise, a string array of error messages is returned.
239290
239405
  */
239291
239406
  terminateFacet(validateAllIndices = true) {
239292
239407
  const numFacets = this._facetStart.length - 1;
239293
- const lengthA = this._facetStart[numFacets]; // number of indices in accepted facets
239294
- const lengthB = this.data.pointIndex.length; // number of indices including the open facet
239408
+ // number of indices in accepted facets
239409
+ const lengthA = this._facetStart[numFacets];
239410
+ // number of indices in all facets (accepted facet plus the last facet to be accepted)
239411
+ const lengthB = this.data.pointIndex.length;
239295
239412
  if (validateAllIndices) {
239296
239413
  const messages = [];
239297
239414
  if (lengthB < lengthA + 2)
239298
- messages.push("Less than 3 indices in open facet");
239415
+ messages.push("Less than 3 indices in the last facet");
239299
239416
  if (this.data.normalIndex && this.data.normalIndex.length !== lengthB)
239300
239417
  messages.push("normalIndex count must match pointIndex count");
239301
239418
  if (this.data.paramIndex && this.data.paramIndex.length !== lengthB)
@@ -239305,70 +239422,93 @@ class IndexedPolyface extends Polyface {
239305
239422
  if (this.data.edgeVisible.length !== lengthB)
239306
239423
  messages.push("visibleIndex count must equal pointIndex count");
239307
239424
  if (!Polyface.areIndicesValid(this.data.normalIndex, lengthA, lengthB, this.data.normal, this.data.normal ? this.data.normal.length : 0))
239308
- messages.push("invalid normal indices in open facet");
239425
+ messages.push("invalid normal indices in the last facet");
239309
239426
  if (messages.length > 0) {
239310
- this.cleanupOpenFacet();
239427
+ this.data.trimAllIndexArrays(lengthB);
239311
239428
  return messages;
239312
239429
  }
239313
239430
  }
239314
- // appending to facetStart accepts the facet !!!
239315
- this._facetStart.push(lengthB);
239431
+ this._facetStart.push(lengthB); // append start index of the future facet
239316
239432
  return undefined;
239317
239433
  }
239318
- /**
239319
- * All terminated facets added since the declaration of the previous face
239320
- * will be grouped into a new face with their own 2D range.
239321
- */
239322
- /** (read-only property) number of facets */
239323
- get facetCount() { return this._facetStart.length - 1; }
239324
- /** (read-only property) number of faces */
239325
- get faceCount() { return this.data.faceCount; }
239326
- /** (read-only property) number of points */
239327
- get pointCount() { return this.data.pointCount; }
239328
- /** (read-only property) number of colors */
239329
- get colorCount() { return this.data.colorCount; }
239330
- /** (read-only property) number of parameters */
239331
- get paramCount() { return this.data.paramCount; }
239332
- /** (read-only property) number of normals */
239333
- get normalCount() { return this.data.normalCount; }
239434
+ /** Number of facets (read-only property). */
239435
+ get facetCount() {
239436
+ return this._facetStart.length - 1;
239437
+ }
239438
+ /** Number of faces (read-only property). */
239439
+ get faceCount() {
239440
+ return this.data.faceCount;
239441
+ }
239442
+ /** Number of points (read-only property). */
239443
+ get pointCount() {
239444
+ return this.data.pointCount;
239445
+ }
239446
+ /** Number of colors (read-only property). */
239447
+ get colorCount() {
239448
+ return this.data.colorCount;
239449
+ }
239450
+ /** Number of parameters (read-only property). */
239451
+ get paramCount() {
239452
+ return this.data.paramCount;
239453
+ }
239454
+ /** Number of normals (read-only property). */
239455
+ get normalCount() {
239456
+ return this.data.normalCount;
239457
+ }
239458
+ /** Test if `index` is a valid facet index. */
239459
+ isValidFacetIndex(index) {
239460
+ return index >= 0 && index < this.facetCount;
239461
+ }
239334
239462
  /** Return the number of edges in a particular facet. */
239335
239463
  numEdgeInFacet(facetIndex) {
239336
239464
  if (this.isValidFacetIndex(facetIndex))
239337
239465
  return this._facetStart[facetIndex + 1] - this._facetStart[facetIndex];
239338
239466
  return 0;
239339
239467
  }
239340
- /** test if `index` is a valid facet index. */
239341
- isValidFacetIndex(index) { return index >= 0 && index + 1 < this._facetStart.length; }
239342
- /** ASSUME valid facet index . .. return its start index in index arrays. */
239343
- facetIndex0(index) { return this._facetStart[index]; }
239344
- /** ASSUME valid facet index . .. return its end index in index arrays. */
239345
- facetIndex1(index) { return this._facetStart[index + 1]; }
239346
- /** create a visitor for this polyface */
239347
- createVisitor(numWrap = 0) { return _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_7__.IndexedPolyfaceVisitor.create(this, numWrap); }
239468
+ /** ASSUME valid facet index. Return start index of facet in pointIndex arrays. */
239469
+ facetIndex0(index) {
239470
+ return this._facetStart[index];
239471
+ }
239472
+ /** ASSUME valid facet index. Return one past end index of facet in pointIndex arrays. */
239473
+ facetIndex1(index) {
239474
+ return this._facetStart[index + 1];
239475
+ }
239476
+ /** Create a visitor for this polyface */
239477
+ createVisitor(numWrap = 0) {
239478
+ return _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_7__.IndexedPolyfaceVisitor.create(this, numWrap);
239479
+ }
239348
239480
  /** Return the range of (optionally transformed) points in this mesh. */
239349
- range(transform, result) { return this.data.range(result, transform); }
239350
- /** Extend `range` with coordinates from this mesh */
239351
- extendRange(range, transform) { this.data.range(range, transform); }
239352
- /** Given the index of a facet, return the data pertaining to the face it is a part of. */
239481
+ range(transform, result) {
239482
+ return this.data.range(result, transform);
239483
+ }
239484
+ /** Extend `range` with coordinates from this mesh. */
239485
+ extendRange(range, transform) {
239486
+ this.data.range(range, transform);
239487
+ }
239488
+ /**
239489
+ * Given the index of a facet, return the data pertaining to the face it is a part of.
239490
+ * @deprecated in 4.x. Use [[IndexedPolyface.tryGetFaceData]], which verifies the index is in range.
239491
+ */
239353
239492
  getFaceDataByFacetIndex(facetIndex) {
239354
239493
  return this.data.face[this._facetToFaceData[facetIndex]];
239355
239494
  }
239356
239495
  /**
239357
- * All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object
239358
- * using facetToFaceData[]. FacetFaceData holds the 2D range of the face. Returns true if successful, false otherwise.
239496
+ * Set new FacetFaceData.
239497
+ * * All terminated facets since the last face declaration will be mapped to a single new FacetFaceData object using
239498
+ * facetToFaceData[]. FacetFaceData holds the 2D range of the face. Returns `true` if successful, `false` otherwise.
239359
239499
  */
239360
239500
  setNewFaceData(endFacetIndex = 0) {
239361
239501
  const facetStart = this._facetToFaceData.length;
239362
239502
  if (facetStart >= this._facetStart.length)
239363
239503
  return false;
239364
- if (0 === endFacetIndex) // The default for endFacetIndex is really the last facet
239365
- endFacetIndex = this._facetStart.length; // Last facetStart index corresponds to the next facet if we were to create one
239504
+ if (0 === endFacetIndex) // the default for endFacetIndex is really the last facet
239505
+ endFacetIndex = this._facetStart.length; // last facet index corresponds to the future facet
239366
239506
  const faceData = _FacetFaceData__WEBPACK_IMPORTED_MODULE_8__.FacetFaceData.createNull();
239367
239507
  const visitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_7__.IndexedPolyfaceVisitor.create(this, 0);
239368
- if (!visitor.moveToReadIndex(facetStart)) { // Move visitor to first facet of new face
239508
+ if (!visitor.moveToReadIndex(facetStart)) { // move visitor to first facet of new face
239369
239509
  return false;
239370
239510
  }
239371
- // If parameter range is provided (by the polyface planeSet clipper) then use it
239511
+ // if parameter range is provided (by the polyface planeSet clipper) then use it
239372
239512
  const paramDefined = this.data.param !== undefined;
239373
239513
  const setParamRange = faceData.paramRange.isNull && paramDefined;
239374
239514
  do {
@@ -239383,7 +239523,7 @@ class IndexedPolyface extends Polyface {
239383
239523
  this._facetToFaceData.push(0 === this._facetStart[i] ? 0 : faceDataIndex);
239384
239524
  return true;
239385
239525
  }
239386
- /** Second step of double dispatch: call `handler.handleIndexedPolyface(this)` */
239526
+ /** Second step of double dispatch: call `handler.handleIndexedPolyface(this)`. */
239387
239527
  dispatchToGeometryHandler(handler) {
239388
239528
  return handler.handleIndexedPolyface(this);
239389
239529
  }
@@ -242062,14 +242202,18 @@ __webpack_require__.r(__webpack_exports__);
242062
242202
  * @public
242063
242203
  */
242064
242204
  class PolyfaceData {
242065
- /** boolean tag indicating if the facets are viewable from the back */
242205
+ /** boolean tag indicating if the facets are to be considered viewable from the back */
242066
242206
  get twoSided() { return this._twoSided; }
242067
242207
  set twoSided(value) { this._twoSided = value; }
242068
242208
  /** set the `taggedNumericData` member */
242069
242209
  setTaggedNumericData(data) {
242070
242210
  this.taggedNumericData = data;
242071
242211
  }
242072
- /** boolean tag indicating if the facets are viewable from the back */
242212
+ /**
242213
+ * Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).
242214
+ * * A boundary edge of a mesh is defined as an edge with only one connected facet.
242215
+ * * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).
242216
+ */
242073
242217
  get expectedClosure() { return this._expectedClosure; }
242074
242218
  set expectedClosure(value) { this._expectedClosure = value; }
242075
242219
  /** Constructor for facets.
@@ -242281,10 +242425,13 @@ class PolyfaceData {
242281
242425
  this.auxData.indices[numEdge + i] = this.auxData.indices[i];
242282
242426
  }
242283
242427
  }
242284
- static trimArray(data, length) { if (data && length < data.length)
242285
- data.length = length; }
242286
- /** Trim all index arrays to stated length.
242287
- * * This is called by PolyfaceBuilder to clean up after an aborted construction sequence.
242428
+ static trimArray(data, length) {
242429
+ if (data && length < data.length)
242430
+ data.length = length;
242431
+ }
242432
+ /**
242433
+ * Trim all index arrays to the stated length.
242434
+ * This is called by PolyfaceBuilder to clean up after an aborted construction sequence.
242288
242435
  */
242289
242436
  trimAllIndexArrays(length) {
242290
242437
  PolyfaceData.trimArray(this.pointIndex, length);
@@ -288604,7 +288751,7 @@ class TestContext {
288604
288751
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
288605
288752
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
288606
288753
  await core_frontend_1.NoRenderApp.startup({
288607
- applicationVersion: "4.5.0-dev.4",
288754
+ applicationVersion: "4.5.0-dev.6",
288608
288755
  applicationId: this.settings.gprid,
288609
288756
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
288610
288757
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -307437,7 +307584,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
307437
307584
  /***/ ((module) => {
307438
307585
 
307439
307586
  "use strict";
307440
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.5.0-dev.4","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.5.0-dev.4","@itwin/core-bentley":"workspace:^4.5.0-dev.4","@itwin/core-common":"workspace:^4.5.0-dev.4","@itwin/core-geometry":"workspace:^4.5.0-dev.4","@itwin/core-orbitgt":"workspace:^4.5.0-dev.4","@itwin/core-quantity":"workspace:^4.5.0-dev.4"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.0.2","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
307587
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.5.0-dev.6","description":"iTwin.js frontend components","main":"lib/cjs/core-frontend.js","module":"lib/esm/core-frontend.js","typings":"lib/cjs/core-frontend","license":"MIT","scripts":{"build":"npm run -s copy:public && npm run -s build:cjs && npm run -s build:esm && npm run -s webpackWorkers && npm run -s copy:workers","build:cjs":"npm run -s copy:js:cjs && tsc 1>&2 --outDir lib/cjs","build:esm":"npm run -s copy:js:esm && tsc 1>&2 --module ES2020 --outDir lib/esm","clean":"rimraf lib .rush/temp/package-deps*.json","copy:public":"cpx \\"./src/public/**/*\\" ./lib/public","copy:js:cjs":"cpx \\"./src/**/*.js\\" ./lib/cjs","copy:js:esm":"cpx \\"./src/**/*.js\\" ./lib/esm","copy:workers":"cpx \\"./lib/workers/webpack/parse-imdl-worker.js\\" ./lib/public/scripts","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/map/*.d.ts,**/tile/*.d.ts,**/*-css.ts","extract-api":"betools extract-api --entry=core-frontend && npm run extract-extension-api","extract-extension-api":"eslint -c extraction.eslint.config.js \\"./src/**/*.ts\\" 1>&2","lint":"eslint -f visualstudio \\"./src/**/*.ts\\" 1>&2","lint-fix":"eslint --fix -f visualstudio \\"./src/**/*.ts\\" 1>&2","pseudolocalize":"betools pseudolocalize --englishDir ./src/public/locales/en --out ./public/locales/en-PSEUDO","test":"npm run -s webpackTests && certa -r chrome","cover":"npm -s test","test:debug":"certa -r chrome --debug","webpackTests":"webpack --config ./src/test/utils/webpack.config.js 1>&2 && npm run -s webpackTestWorker","webpackTestWorker":"webpack --config ./src/test/worker/webpack.config.js 1>&2 && cpx \\"./lib/test/test-worker.js\\" ./lib/test","webpackWorkers":"webpack --config ./src/workers/ImdlParser/webpack.config.js 1>&2"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core.git","directory":"core/frontend"},"keywords":["Bentley","BIM","iModel","digital-twin","iTwin"],"author":{"name":"Bentley Systems, Inc.","url":"http://www.bentley.com"},"peerDependencies":{"@itwin/appui-abstract":"workspace:^4.5.0-dev.6","@itwin/core-bentley":"workspace:^4.5.0-dev.6","@itwin/core-common":"workspace:^4.5.0-dev.6","@itwin/core-geometry":"workspace:^4.5.0-dev.6","@itwin/core-orbitgt":"workspace:^4.5.0-dev.6","@itwin/core-quantity":"workspace:^4.5.0-dev.6"},"//devDependencies":["NOTE: All peerDependencies should also be listed as devDependencies since peerDependencies are not considered by npm install","NOTE: All tools used by scripts in this package must be listed as devDependencies"],"devDependencies":{"@itwin/appui-abstract":"workspace:*","@itwin/build-tools":"workspace:*","@itwin/core-bentley":"workspace:*","@itwin/core-common":"workspace:*","@itwin/core-geometry":"workspace:*","@itwin/core-orbitgt":"workspace:*","@itwin/core-quantity":"workspace:*","@itwin/certa":"workspace:*","@itwin/eslint-plugin":"4.0.0-dev.44","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/mocha":"^10.0.6","@types/sinon":"^17.0.2","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.3.10","chai-as-promised":"^7.1.1","cpx2":"^3.0.0","eslint":"^8.44.0","glob":"^7.1.2","mocha":"^10.2.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^17.0.1","source-map-loader":"^4.0.0","typescript":"~5.0.2","typemoq":"^2.1.0","webpack":"^5.76.0"},"//dependencies":["NOTE: these dependencies should be only for things that DO NOT APPEAR IN THE API","NOTE: core-frontend should remain UI technology agnostic, so no react/angular dependencies are allowed"],"dependencies":{"@itwin/cloud-agnostic-core":"^2.1.0","@itwin/object-storage-core":"^2.2.2","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","fuse.js":"^3.3.0","wms-capabilities":"0.4.0"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"}}');
307441
307588
 
307442
307589
  /***/ }),
307443
307590