@itwin/rpcinterface-full-stack-tests 4.5.0-dev.21 → 4.5.0-dev.23

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.
@@ -27695,6 +27695,7 @@ var IModelStatus;
27695
27695
  IModelStatus[IModelStatus["NotRegistered"] = 65605] = "NotRegistered";
27696
27696
  IModelStatus[IModelStatus["FunctionNotFound"] = 65606] = "FunctionNotFound";
27697
27697
  IModelStatus[IModelStatus["NoActiveCommand"] = 65607] = "NoActiveCommand";
27698
+ IModelStatus[IModelStatus["Aborted"] = 65608] = "Aborted";
27698
27699
  })(IModelStatus || (IModelStatus = {}));
27699
27700
  /** Error statuses produced by various briefcase operations, typically encountered as the `errorNumber` of an [IModelError]($common).
27700
27701
  * @public
@@ -32065,7 +32066,10 @@ class StatusCategory {
32065
32066
  return category;
32066
32067
  }
32067
32068
  }
32068
- return lookupCategory(error);
32069
+ const errorNumber = error.errorNumber;
32070
+ if (typeof errorNumber === "number")
32071
+ return lookupHttpStatusCategory(errorNumber);
32072
+ return new UnknownError();
32069
32073
  }
32070
32074
  }
32071
32075
  StatusCategory.handlers = new Set();
@@ -32301,8 +32305,10 @@ class UnknownError extends HTTP.InternalServerError {
32301
32305
  }
32302
32306
  class NotImplemented extends HTTP.NotImplemented {
32303
32307
  }
32304
- function lookupCategory(error) {
32305
- switch (error.errorNumber) {
32308
+ class Aborted extends HTTP.BadRequest {
32309
+ }
32310
+ function lookupHttpStatusCategory(statusCode) {
32311
+ switch (statusCode) {
32306
32312
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.SUCCESS: return new Success();
32307
32313
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BentleyStatus.ERROR: return new UnknownError();
32308
32314
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.IModelStatus.Success: return new Success();
@@ -32376,6 +32382,7 @@ function lookupCategory(error) {
32376
32382
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.IModelStatus.NotRegistered: return new NotImplemented();
32377
32383
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.IModelStatus.FunctionNotFound: return new NotImplemented();
32378
32384
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.IModelStatus.NoActiveCommand: return new StateViolation();
32385
+ case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.IModelStatus.Aborted: return new Aborted();
32379
32386
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BriefcaseStatus.CannotAcquire: return new OperationFailed();
32380
32387
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BriefcaseStatus.CannotDownload: return new OperationFailed();
32381
32388
  case _BentleyError__WEBPACK_IMPORTED_MODULE_0__.BriefcaseStatus.CannotUpload: return new OperationFailed();
@@ -61693,7 +61700,7 @@ class RpcInvocation {
61693
61700
  status.responseValue = rawResult; // for ipc case
61694
61701
  fulfillment.rawResult = status;
61695
61702
  }
61696
- if (rawResult instanceof _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.BentleyError) {
61703
+ if (rawResult instanceof Error) {
61697
61704
  fulfillment.status = _itwin_core_bentley__WEBPACK_IMPORTED_MODULE_0__.StatusCategory["for"](rawResult).code;
61698
61705
  }
61699
61706
  }
@@ -95044,6 +95051,10 @@ class ViewManager {
95044
95051
  clearTimeout(this._idleWorkTimer);
95045
95052
  this._idleWorkTimer = undefined;
95046
95053
  }
95054
+ this._viewports.map((viewport) => {
95055
+ if (!viewport.isDisposed)
95056
+ this.dropViewport(viewport, true);
95057
+ });
95047
95058
  this._viewports.length = 0;
95048
95059
  this.decorators.length = 0;
95049
95060
  this.toolTipProviders.length = 0;
@@ -207376,7 +207387,7 @@ class MXCubicAlongArcEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_
207376
207387
  super.scaleInPlace(scaleFactor);
207377
207388
  }
207378
207389
  /** return a deep copy of the evaluator */
207379
- clone() { return new MXCubicAlongArcEvaluator(this.nominalLength1, this.nominalRadius1, super._axisLength, this.cubicM); }
207390
+ clone() { return new MXCubicAlongArcEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM); }
207380
207391
  /** Member by member matchup ... */
207381
207392
  isAlmostEqual(other) {
207382
207393
  if (other instanceof MXCubicAlongArcEvaluator) {
@@ -207666,7 +207677,7 @@ class PolishCubicEvaluator extends _CubicEvaluator__WEBPACK_IMPORTED_MODULE_0__.
207666
207677
  super.scaleInPlace(scaleFactor);
207667
207678
  }
207668
207679
  /** return a deep copy of the evaluator */
207669
- clone() { return new PolishCubicEvaluator(this.nominalLength1, this.nominalRadius1, super._axisLength, this.cubicM); }
207680
+ clone() { return new PolishCubicEvaluator(this.nominalLength1, this.nominalRadius1, this.axisLength, this.cubicM); }
207670
207681
  /** Member by member matchup ... */
207671
207682
  isAlmostEqual(other) {
207672
207683
  if (other instanceof PolishCubicEvaluator) {
@@ -211679,6 +211690,9 @@ class FrameBuilder {
211679
211690
  break;
211680
211691
  }
211681
211692
  }
211693
+ else if (data.hasOwnProperty("x") && data.hasOwnProperty("y") && data.hasOwnProperty("z")) {
211694
+ this.announcePoint(_Point3dVector3d__WEBPACK_IMPORTED_MODULE_3__.Point3d.create(data.x, data.y, data.z));
211695
+ }
211682
211696
  }
211683
211697
  /**
211684
211698
  * Create a localToWorld frame for the given data.
@@ -213762,7 +213776,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
213762
213776
  this._xyzInUse = 0;
213763
213777
  }
213764
213778
  /**
213765
- * Get a point by index, strongly typed as a Point3d. This is unchecked. Use getPoint3dAtCheckedPointIndex to have validity test.
213779
+ * Get a point by index, strongly typed as a Point3d. This is unchecked. Use [[getPoint3dAtCheckedPointIndex]] to have validity test.
213766
213780
  * @param pointIndex index to access
213767
213781
  * @param result optional result
213768
213782
  */
@@ -213771,7 +213785,7 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
213771
213785
  return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
213772
213786
  }
213773
213787
  /**
213774
- * Get a point by index, strongly typed as a Point2d. This is unchecked. Use getPoint2dAtCheckedPointIndex to have validity test.
213788
+ * Get a point by index, strongly typed as a Point2d. This is unchecked. Use [[getPoint2dAtCheckedPointIndex]] to have validity test.
213775
213789
  * @param pointIndex index to access
213776
213790
  * @param result optional result
213777
213791
  */
@@ -213779,6 +213793,15 @@ class GrowableXYZArray extends _IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_0_
213779
213793
  const index = 3 * pointIndex;
213780
213794
  return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Point2d.create(this._data[index], this._data[index + 1], result);
213781
213795
  }
213796
+ /**
213797
+ * Get a vector by index, strongly typed as a Vector3d. This is unchecked. Use [[getVector3dAtCheckedVectorIndex]] to have validity test.
213798
+ * @param vectorIndex index to access
213799
+ * @param result optional result
213800
+ */
213801
+ getVector3dAtUncheckedVectorIndex(vectorIndex, result) {
213802
+ const index = 3 * vectorIndex;
213803
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this._data[index], this._data[index + 1], this._data[index + 2], result);
213804
+ }
213782
213805
  /** copy xyz into strongly typed Point3d */
213783
213806
  getPoint3dAtCheckedPointIndex(pointIndex, result) {
213784
213807
  if (this.isIndexValid(pointIndex)) {
@@ -238849,7 +238872,7 @@ class IndexedPolyfaceVisitor extends _PolyfaceData__WEBPACK_IMPORTED_MODULE_0__.
238849
238872
  this._currentFacetIndex = facetIndex;
238850
238873
  this._nextFacetIndex = facetIndex + 1;
238851
238874
  this._numEdges = this._polyface.numEdgeInFacet(facetIndex);
238852
- this.resizeAllDataArrays(this._numEdges + this._numWrap);
238875
+ this.resizeAllArrays(this._numEdges + this._numWrap);
238853
238876
  this.gatherIndexedData(this._polyface.data, this._polyface.facetIndex0(this._currentFacetIndex), this._polyface.facetIndex1(this._currentFacetIndex), this._numWrap);
238854
238877
  return true;
238855
238878
  }
@@ -239069,6 +239092,7 @@ __webpack_require__.r(__webpack_exports__);
239069
239092
  * @module Polyface
239070
239093
  */
239071
239094
  /* eslint-disable @typescript-eslint/naming-convention, no-empty */
239095
+ // cspell:word internaldocs
239072
239096
 
239073
239097
 
239074
239098
 
@@ -239358,10 +239382,10 @@ class IndexedPolyface extends Polyface {
239358
239382
  }
239359
239383
  /**
239360
239384
  * Create an empty facet set with coordinate and index data to be supplied later.
239361
- * @param needNormals true if normals will be constructed.
239362
- * @param needParams true if uv parameters will be constructed.
239363
- * @param needColors true if colors will be constructed.
239364
- * @param twoSided true if the facets are to be considered viewable from the back.
239385
+ * @param needNormals `true` to allocate empty normal data and index arrays; `false` (default) to leave undefined.
239386
+ * @param needParams `true` to allocate empty uv parameter data and index arrays; `false` (default) to leave undefined.
239387
+ * @param needColors `true` to allocate empty color data and index arrays; `false` (default) to leave undefined.
239388
+ * @param twoSided `true` if the facets are to be considered viewable from the back; `false` (default) if not.
239365
239389
  */
239366
239390
  static create(needNormals = false, needParams = false, needColors = false, twoSided = false) {
239367
239391
  return new IndexedPolyface(new _PolyfaceData__WEBPACK_IMPORTED_MODULE_3__.PolyfaceData(needNormals, needParams, needColors, twoSided));
@@ -239430,19 +239454,19 @@ class IndexedPolyface extends Polyface {
239430
239454
  */
239431
239455
  addNormal(normal, priorIndexA, priorIndexB) {
239432
239456
  // check if `normal` is duplicate of `dataNormal` at index `i`
239433
- const normalIsDuplicate = (dataNormal, i) => {
239434
- const distance = dataNormal.distanceIndexToPoint(i, normal);
239457
+ const normalIsDuplicate = (i) => {
239458
+ const distance = this.data.normal.distanceIndexToPoint(i, normal);
239435
239459
  return distance !== undefined && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(distance);
239436
239460
  };
239437
239461
  if (this.data.normal !== undefined) {
239438
- if (priorIndexA !== undefined && normalIsDuplicate(this.data.normal, priorIndexA))
239462
+ if (priorIndexA !== undefined && normalIsDuplicate(priorIndexA))
239439
239463
  return priorIndexA;
239440
- if (priorIndexB !== undefined && normalIsDuplicate(this.data.normal, priorIndexB))
239464
+ if (priorIndexB !== undefined && normalIsDuplicate(priorIndexB))
239441
239465
  return priorIndexB;
239442
239466
  // check the tail index for possible duplicate
239443
239467
  if (priorIndexA !== undefined || priorIndexB !== undefined) {
239444
239468
  const tailIndex = this.data.normal.length - 1;
239445
- if (normalIsDuplicate(this.data.normal, tailIndex))
239469
+ if (normalIsDuplicate(tailIndex))
239446
239470
  return tailIndex;
239447
239471
  }
239448
239472
  }
@@ -239529,10 +239553,16 @@ class IndexedPolyface extends Polyface {
239529
239553
  messages.push("colorIndex count must equal pointIndex count");
239530
239554
  if (this.data.edgeVisible.length !== lengthB)
239531
239555
  messages.push("visibleIndex count must equal pointIndex count");
239556
+ if (!Polyface.areIndicesValid(this.data.pointIndex, lengthA, lengthB, this.data.point, this.data.point ? this.data.point.length : 0))
239557
+ messages.push("invalid point indices in the last facet");
239532
239558
  if (!Polyface.areIndicesValid(this.data.normalIndex, lengthA, lengthB, this.data.normal, this.data.normal ? this.data.normal.length : 0))
239533
239559
  messages.push("invalid normal indices in the last facet");
239560
+ if (!Polyface.areIndicesValid(this.data.paramIndex, lengthA, lengthB, this.data.param, this.data.param ? this.data.param.length : 0))
239561
+ messages.push("invalid param indices in the last facet");
239562
+ if (!Polyface.areIndicesValid(this.data.colorIndex, lengthA, lengthB, this.data.color, this.data.color ? this.data.color.length : 0))
239563
+ messages.push("invalid color indices in the last facet");
239534
239564
  if (messages.length > 0) {
239535
- this.data.trimAllIndexArrays(lengthB);
239565
+ this.data.trimAllIndexArrays(lengthA);
239536
239566
  return messages;
239537
239567
  }
239538
239568
  }
@@ -239776,8 +239806,8 @@ class FacetSector {
239776
239806
  */
239777
239807
  loadIndexedPointAndDerivativeCoordinatesFromPackedArrays(i, packedXYZ, packedDerivatives, fractions, v) {
239778
239808
  packedXYZ.getPoint3dAtCheckedPointIndex(i, this.xyz);
239779
- if (fractions && v !== undefined)
239780
- this.uv = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_1__.Point2d.create(fractions.atUncheckedIndex(i), v);
239809
+ if (this.uv && fractions && v !== undefined)
239810
+ this.uv.set(fractions.atUncheckedIndex(i), v);
239781
239811
  this.xyzIndex = -1;
239782
239812
  this.normalIndex = -1;
239783
239813
  this.uvIndex = -1;
@@ -240462,8 +240492,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
240462
240492
  this.addIndexedTriangleNormalIndexes(sectorA0.normalIndex, sectorA1.normalIndex, sectorA2.normalIndex);
240463
240493
  if (this._options.needParams)
240464
240494
  this.addIndexedTriangleParamIndexes(sectorA0.uvIndex, sectorA1.uvIndex, sectorA2.uvIndex);
240465
- this.addIndexedTrianglePointIndexes(sectorA0.xyzIndex, sectorA1.xyzIndex, sectorA2.xyzIndex);
240466
- this._polyface.terminateFacet();
240495
+ this.addIndexedTrianglePointIndexes(sectorA0.xyzIndex, sectorA1.xyzIndex, sectorA2.xyzIndex, true);
240467
240496
  }
240468
240497
  }
240469
240498
  addSectorQuadA01B01(sectorA0, sectorA1, sectorB0, sectorB1) {
@@ -240479,8 +240508,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
240479
240508
  this.addIndexedQuadNormalIndexes(sectorA0.normalIndex, sectorA1.normalIndex, sectorB0.normalIndex, sectorB1.normalIndex);
240480
240509
  if (this._options.needParams)
240481
240510
  this.addIndexedQuadParamIndexes(sectorA0.uvIndex, sectorA1.uvIndex, sectorB0.uvIndex, sectorB1.uvIndex);
240482
- this.addIndexedQuadPointIndexes(sectorA0.xyzIndex, sectorA1.xyzIndex, sectorB0.xyzIndex, sectorB1.xyzIndex);
240483
- this._polyface.terminateFacet();
240511
+ this.addIndexedQuadPointIndexes(sectorA0.xyzIndex, sectorA1.xyzIndex, sectorB0.xyzIndex, sectorB1.xyzIndex, true);
240484
240512
  }
240485
240513
  }
240486
240514
  /** Add facets between lineStrings with matched point counts.
@@ -240552,14 +240580,14 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
240552
240580
  for (let i = 1; i < numPoints; i++) {
240553
240581
  if (this.options.shouldTriangulate) {
240554
240582
  if (distinctIndices(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i))) {
240555
- this.addIndexedTrianglePointIndexes(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i));
240583
+ this.addIndexedTrianglePointIndexes(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i), false);
240556
240584
  if (normalA && normalB)
240557
240585
  this.addIndexedTriangleNormalIndexes(normalA.atUncheckedIndex(i - 1), normalA.atUncheckedIndex(i), normalB.atUncheckedIndex(i - 1));
240558
240586
  if (paramA && paramB)
240559
240587
  this.addIndexedTriangleParamIndexes(paramA.atUncheckedIndex(i - 1), paramA.atUncheckedIndex(i), paramB.atUncheckedIndex(i - 1));
240560
240588
  }
240561
240589
  if (distinctIndices(pointB.atUncheckedIndex(i), pointB.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i - 1))) {
240562
- this.addIndexedTrianglePointIndexes(pointA.atUncheckedIndex(i - 1), pointB.atUncheckedIndex(i), pointB.atUncheckedIndex(i - 1));
240590
+ this.addIndexedTrianglePointIndexes(pointA.atUncheckedIndex(i - 1), pointB.atUncheckedIndex(i), pointB.atUncheckedIndex(i - 1), false);
240563
240591
  if (normalA && normalB)
240564
240592
  this.addIndexedTriangleNormalIndexes(normalA.atUncheckedIndex(i - 1), normalB.atUncheckedIndex(i), normalB.atUncheckedIndex(i - 1));
240565
240593
  if (paramA && paramB)
@@ -240568,14 +240596,14 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
240568
240596
  }
240569
240597
  else {
240570
240598
  if (pointA.atUncheckedIndex(i - 1) !== pointA.atUncheckedIndex(i) || pointB.atUncheckedIndex(i - 1) !== pointB.atUncheckedIndex(i)) {
240571
- this.addIndexedQuadPointIndexes(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i - 1), pointB.atUncheckedIndex(i));
240599
+ this.addIndexedQuadPointIndexes(pointA.atUncheckedIndex(i - 1), pointA.atUncheckedIndex(i), pointB.atUncheckedIndex(i - 1), pointB.atUncheckedIndex(i), false);
240572
240600
  if (normalA && normalB)
240573
240601
  this.addIndexedQuadNormalIndexes(normalA.atUncheckedIndex(i - 1), normalA.atUncheckedIndex(i), normalB.atUncheckedIndex(i - 1), normalB.atUncheckedIndex(i));
240574
240602
  if (paramA && paramB)
240575
240603
  this.addIndexedQuadParamIndexes(paramA.atUncheckedIndex(i - 1), paramA.atUncheckedIndex(i), paramB.atUncheckedIndex(i - 1), paramB.atUncheckedIndex(i));
240576
240604
  }
240577
- this._polyface.terminateFacet();
240578
240605
  }
240606
+ this._polyface.terminateFacet();
240579
240607
  }
240580
240608
  }
240581
240609
  /** Add facets between lineStrings with matched point counts.
@@ -241219,11 +241247,14 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
241219
241247
  /** add facets for a GeometryQuery object. This is double dispatch through `dispatchToGeometryHandler(this)` */
241220
241248
  addGeometryQuery(g) { g.dispatchToGeometryHandler(this); }
241221
241249
  /**
241222
- *
241223
- * * Visit all faces
241224
- * * Test each face with f(node) for any node on the face.
241225
- * * For each face that passes, pass its coordinates to the builder.
241226
- * * Rely on the builder's compress step to find common vertex coordinates
241250
+ * Add a graph to the builder.
241251
+ * * Visit one node per face
241252
+ * * If `acceptFaceFunction(node)` returns true, pass face coordinates to the builder
241253
+ * * Accepted face edge visibility is determined by `isEdgeVisibleFunction`.
241254
+ * * Rely on the builder's compress step to find common vertex coordinates.
241255
+ * @param graph faces to add as facets
241256
+ * @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces
241257
+ * @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges
241227
241258
  * @internal
241228
241259
  */
241229
241260
  addGraph(graph, acceptFaceFunction = (node) => _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testNodeMaskNotExterior(node), isEdgeVisibleFunction = (node) => _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testMateMaskExterior(node)) {
@@ -241262,7 +241293,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
241262
241293
  * * terminate the facet
241263
241294
  * @internal
241264
241295
  */
241265
- addGraphFaces(_graph, faces) {
241296
+ addGraphFaces(faces) {
241266
241297
  let index = 0;
241267
241298
  for (const seed of faces) {
241268
241299
  let node = seed;
@@ -241274,21 +241305,26 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
241274
241305
  this._polyface.terminateFacet();
241275
241306
  }
241276
241307
  }
241277
- /** Create a polyface containing the faces of a HalfEdgeGraph, with test function to filter faces.
241308
+ /**
241309
+ * Create a polyface containing the faces of a HalfEdgeGraph, with test functions to filter faces and hide edges.
241310
+ * * This is a static wrapper of [[addGraph]].
241311
+ * @param graph faces to add as facets
241312
+ * @param acceptFaceFunction optional test for whether to add a given face. Default: ignore exterior faces
241313
+ * @param isEdgeVisibleFunction optional test for whether to hide an edge. Default: hide interior edges
241278
241314
  * @internal
241279
241315
  */
241280
- static graphToPolyface(graph, options, acceptFaceFunction = (node) => _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testNodeMaskNotExterior(node)) {
241316
+ static graphToPolyface(graph, options, acceptFaceFunction = (node) => _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testNodeMaskNotExterior(node), isEdgeVisibleFunction = (node) => _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testMateMaskExterior(node)) {
241281
241317
  const builder = PolyfaceBuilder.create(options);
241282
- builder.addGraph(graph, acceptFaceFunction);
241318
+ builder.addGraph(graph, acceptFaceFunction, isEdgeVisibleFunction);
241283
241319
  builder.endFace();
241284
241320
  return builder.claimPolyface();
241285
241321
  }
241286
241322
  /** Create a polyface containing the faces of a HalfEdgeGraph that are specified by the HalfEdge array.
241287
241323
  * @internal
241288
241324
  */
241289
- static graphFacesToPolyface(graph, faces) {
241325
+ static graphFacesToPolyface(faces) {
241290
241326
  const builder = PolyfaceBuilder.create();
241291
- builder.addGraphFaces(graph, faces);
241327
+ builder.addGraphFaces(faces);
241292
241328
  builder.endFace();
241293
241329
  return builder.claimPolyface();
241294
241330
  }
@@ -242301,39 +242337,28 @@ __webpack_require__.r(__webpack_exports__);
242301
242337
 
242302
242338
 
242303
242339
 
242340
+ // cspell:word internaldocs
242304
242341
  /**
242305
- * PolyfaceData carries data arrays for point, normal, param, color and their indices.
242306
- *
242307
- * * IndexedPolyface carries a PolyfaceData as a member. (NOT as a base class -- it already has GeometryQuery as base)
242308
- * * IndexedPolyfaceVisitor uses PolyfaceData as a base class. In this use there is only a single facet in the polyfaceData.
242309
- * * PolyfaceData does not know (!!!) what indices range constitute a facet. That is managed by derived class or carrier class.
242342
+ * `PolyfaceData` carries data arrays for point, normal, uv-parameters, and color, and index arrays for each.
242343
+ * * Normal, uv-parameter, and color data are optional.
242344
+ * * A given data array is defined if and only if its corresponding index array is defined.
242345
+ * * All defined index arrays have parallel face loop order and structure, and thus the same length.
242346
+ * * `IndexedPolyface` carries a PolyfaceData as a member (NOT as a base class; it already has `GeometryQuery` as base).
242347
+ * * `IndexedPolyfaceVisitor` uses PolyfaceData as a base class. In this use, there is only a single facet in `PolyfaceData`.
242348
+ * * `PolyfaceData` does not know what index range constitutes a given facet. This is managed by a derived/carrier class.
242310
242349
  * @public
242311
242350
  */
242312
242351
  class PolyfaceData {
242313
- /** boolean tag indicating if the facets are to be considered viewable from the back */
242314
- get twoSided() { return this._twoSided; }
242315
- set twoSided(value) { this._twoSided = value; }
242316
- /** set the `taggedNumericData` member */
242317
- setTaggedNumericData(data) {
242318
- this.taggedNumericData = data;
242319
- }
242320
242352
  /**
242321
- * Flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2).
242322
- * * A boundary edge of a mesh is defined as an edge with only one connected facet.
242323
- * * Closed solid is a mesh with no boundary edge. Open sheet is a mesh that has boundary edge(s).
242324
- */
242325
- get expectedClosure() { return this._expectedClosure; }
242326
- set expectedClosure(value) { this._expectedClosure = value; }
242327
- /** Constructor for facets.
242328
- * * The various params control whether respective arrays are to be allocated.
242329
- * * If arrayData is provided, all other params are IGNORED.
242330
- * *
242353
+ * Constructor for facets.
242354
+ * @param needNormals `true` to allocate empty normal data and index arrays; `false` (default) to leave undefined.
242355
+ * @param needParams `true` to allocate empty uv parameter data and index arrays; `false` (default) to leave undefined.
242356
+ * @param needColors `true` to allocate empty color data and index arrays; `false` (default) to leave undefined.
242357
+ * @param twoSided `true` if the facets are to be considered viewable from the back; `false` (default) if not.
242331
242358
  */
242332
242359
  constructor(needNormals = false, needParams = false, needColors = false, twoSided = false) {
242333
- this.face = [];
242334
242360
  this.point = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_0__.GrowableXYZArray();
242335
242361
  this.pointIndex = [];
242336
- this.edgeVisible = [];
242337
242362
  if (needNormals) {
242338
242363
  this.normal = new _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_0__.GrowableXYZArray();
242339
242364
  this.normalIndex = [];
@@ -242346,6 +242371,8 @@ class PolyfaceData {
242346
242371
  this.color = [];
242347
242372
  this.colorIndex = [];
242348
242373
  }
242374
+ this.face = [];
242375
+ this.edgeVisible = [];
242349
242376
  this._twoSided = twoSided;
242350
242377
  this._expectedClosure = 0;
242351
242378
  }
@@ -242354,30 +242381,29 @@ class PolyfaceData {
242354
242381
  const result = new PolyfaceData();
242355
242382
  result.point = this.point.clone();
242356
242383
  result.pointIndex = this.pointIndex.slice();
242357
- result.edgeVisible = this.edgeVisible.slice();
242358
- result.face = this.face.slice();
242359
- result.twoSided = this.twoSided;
242360
- result.expectedClosure = this.expectedClosure;
242361
242384
  if (this.normal)
242362
242385
  result.normal = this.normal.clone();
242363
- if (this.param)
242364
- result.param = this.param.clone();
242365
- if (this.color)
242366
- result.color = this.color.slice();
242367
242386
  if (this.normalIndex)
242368
242387
  result.normalIndex = this.normalIndex.slice();
242388
+ if (this.param)
242389
+ result.param = this.param.clone();
242369
242390
  if (this.paramIndex)
242370
242391
  result.paramIndex = this.paramIndex.slice();
242392
+ if (this.color)
242393
+ result.color = this.color.slice();
242371
242394
  if (this.colorIndex)
242372
242395
  result.colorIndex = this.colorIndex.slice();
242396
+ result.face = this.face.slice();
242373
242397
  if (this.auxData)
242374
242398
  result.auxData = this.auxData.clone();
242375
- if (this.taggedNumericData) {
242399
+ if (this.taggedNumericData)
242376
242400
  result.taggedNumericData = this.taggedNumericData.clone();
242377
- }
242401
+ result.edgeVisible = this.edgeVisible.slice();
242402
+ result.twoSided = this.twoSided;
242403
+ result.expectedClosure = this.expectedClosure;
242378
242404
  return result;
242379
242405
  }
242380
- /** Test for equal indices and nearly equal coordinates */
242406
+ /** Test for equal indices and nearly equal coordinates. */
242381
242407
  isAlmostEqual(other) {
242382
242408
  if (!_geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_0__.GrowableXYZArray.isAlmostEqual(this.point, other.point))
242383
242409
  return false;
@@ -242395,77 +242421,133 @@ class PolyfaceData {
242395
242421
  return false;
242396
242422
  if (!_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.NumberArray.isExactEqual(this.colorIndex, other.colorIndex))
242397
242423
  return false;
242398
- if (!_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.NumberArray.isExactEqual(this.edgeVisible, other.edgeVisible))
242399
- return false;
242400
242424
  if (!_AuxData__WEBPACK_IMPORTED_MODULE_3__.PolyfaceAuxData.isAlmostEqual(this.auxData, other.auxData))
242401
242425
  return false;
242426
+ if (!_TaggedNumericData__WEBPACK_IMPORTED_MODULE_4__.TaggedNumericData.areAlmostEqual(this.taggedNumericData, other.taggedNumericData))
242427
+ return false;
242428
+ if (!_geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_2__.NumberArray.isExactEqual(this.edgeVisible, other.edgeVisible))
242429
+ return false;
242402
242430
  if (this.twoSided !== other.twoSided)
242403
242431
  return false;
242404
242432
  if (this.expectedClosure !== other.expectedClosure)
242405
242433
  return false;
242406
- if (!_TaggedNumericData__WEBPACK_IMPORTED_MODULE_4__.TaggedNumericData.areAlmostEqual(this.taggedNumericData, other.taggedNumericData))
242407
- return false;
242408
242434
  return true;
242409
242435
  }
242410
242436
  /** Ask if normals are required in this mesh. */
242411
- get requireNormals() { return undefined !== this.normal; }
242437
+ get requireNormals() {
242438
+ return undefined !== this.normal;
242439
+ }
242440
+ /** Ask if params are required in this mesh. */
242441
+ get requireParams() {
242442
+ return undefined !== this.param;
242443
+ }
242444
+ /** Ask if colors are required in this mesh. */
242445
+ get requireColors() {
242446
+ return undefined !== this.color;
242447
+ }
242412
242448
  /** Get the point count */
242413
- get pointCount() { return this.point.length; }
242449
+ get pointCount() {
242450
+ return this.point.length;
242451
+ }
242414
242452
  /** Get the normal count */
242415
- get normalCount() { return this.normal ? this.normal.length : 0; }
242453
+ get normalCount() {
242454
+ return this.normal ? this.normal.length : 0;
242455
+ }
242416
242456
  /** Get the param count */
242417
- get paramCount() { return this.param ? this.param.length : 0; }
242457
+ get paramCount() {
242458
+ return this.param ? this.param.length : 0;
242459
+ }
242418
242460
  /** Get the color count */
242419
- get colorCount() { return this.color ? this.color.length : 0; }
242420
- /** Get the index count. Note that there is one count, and all index arrays (point, normal, param, color) must match */
242421
- get indexCount() { return this.pointIndex.length; } // ALWAYS INDEXED ... all index vectors must have same length.
242422
- /** Get the number of faces.
242461
+ get colorCount() {
242462
+ return this.color ? this.color.length : 0;
242463
+ }
242464
+ /** Get the index count. Note that the point array is always indexed, and index arrays all have the same length. */
242465
+ get indexCount() {
242466
+ return this.pointIndex.length;
242467
+ }
242468
+ /**
242469
+ * Get the number of faces.
242423
242470
  * * Note that a "face" is not a facet.
242424
- * * A "face" is a subset of facets grouped for application purposes.
242425
- */
242426
- get faceCount() { return this.face.length; }
242427
- /** return indexed point. This is a copy of the coordinates, not a reference. */
242428
- getPoint(i, out) {
242429
- return this.point.getPoint3dAtCheckedPointIndex(i, out);
242430
- }
242431
- /** return indexed normal. This is the COPY to the normal, not a reference. */
242432
- getNormal(i) { return this.normal ? this.normal.getVector3dAtCheckedVectorIndex(i) : undefined; }
242433
- /** return indexed param. This is the COPY of the coordinates, not a reference. */
242434
- getParam(i) { return this.param ? this.param.getPoint2dAtCheckedPointIndex(i) : undefined; }
242435
- /** return indexed color */
242436
- getColor(i) { return this.color ? this.color[i] : 0; }
242437
- /** return indexed visibility */
242438
- getEdgeVisible(i) { return this.edgeVisible[i]; }
242439
- /** Copy the contents (not pointer) of point[i] into dest. */
242440
- copyPointTo(i, dest) { this.point.getPoint3dAtUncheckedPointIndex(i, dest); }
242441
- /** Copy the contents (not pointer) of normal[i] into dest. */
242442
- copyNormalTo(i, dest) { if (this.normal)
242443
- this.normal.getVector3dAtCheckedVectorIndex(i, dest); }
242444
- /** Copy the contents (not pointer) of param[i] into dest. */
242445
- copyParamTo(i, dest) { if (this.param)
242446
- this.param.getPoint2dAtCheckedPointIndex(i, dest); }
242447
- /** test if normal at a specified index matches uv */
242448
- isAlmostEqualParamIndexUV(index, u, v) {
242449
- if (this.param !== undefined && index >= 0 && index < this.param.length)
242450
- return _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isSameCoordinate(u, this.param.getXAtUncheckedPointIndex(index))
242451
- && _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isSameCoordinate(v, this.param.getYAtUncheckedPointIndex(index));
242471
+ * * A face is a subset of the Polyface's facets grouped for application purposes.
242472
+ */
242473
+ get faceCount() {
242474
+ return this.face.length;
242475
+ }
242476
+ /** Return indexed point at index `i`. This is a COPY of the coordinates, not a reference. */
242477
+ getPoint(i, result) {
242478
+ return this.point.getPoint3dAtCheckedPointIndex(i, result);
242479
+ }
242480
+ /** Return indexed normal at index `i`. This is a COPY of the normal, not a reference. */
242481
+ getNormal(i, result) {
242482
+ return this.normal ? this.normal.getVector3dAtCheckedVectorIndex(i, result) : undefined;
242483
+ }
242484
+ /** Return indexed param at index `i`. This is a COPY of the coordinates, not a reference. */
242485
+ getParam(i, result) {
242486
+ return this.param ? this.param.getPoint2dAtCheckedPointIndex(i, result) : undefined;
242487
+ }
242488
+ /** Return indexed color at index `i`. Index `i` is not checked for validity. */
242489
+ getColor(i) {
242490
+ return this.color ? this.color[i] : 0;
242491
+ }
242492
+ /** Return indexed visibility. at index `i`. Index `i` is not checked for validity. */
242493
+ getEdgeVisible(i) {
242494
+ return this.edgeVisible[i];
242495
+ }
242496
+ /** Get boolean tag indicating if the facets are to be considered viewable from the back. */
242497
+ get twoSided() {
242498
+ return this._twoSided;
242499
+ }
242500
+ set twoSided(value) {
242501
+ this._twoSided = value;
242502
+ }
242503
+ /** Get flag indicating if the mesh closure is unknown (0), open sheet (1), closed solid (2). */
242504
+ get expectedClosure() {
242505
+ return this._expectedClosure;
242506
+ }
242507
+ set expectedClosure(value) {
242508
+ this._expectedClosure = value;
242509
+ }
242510
+ /** Set the tagged geometry data. */
242511
+ setTaggedNumericData(data) {
242512
+ this.taggedNumericData = data;
242513
+ }
242514
+ /** Copy the contents (not pointer) of `point[i]` into `dest`. Index `i` is not checked for validity. */
242515
+ copyPointTo(i, dest) {
242516
+ this.point.getPoint3dAtUncheckedPointIndex(i, dest);
242517
+ }
242518
+ /** Copy the contents (not pointer) of `normal[i]` into `dest`. Index `i` is not checked for validity. */
242519
+ copyNormalTo(i, dest) {
242520
+ if (this.normal)
242521
+ this.normal.getVector3dAtUncheckedVectorIndex(i, dest);
242522
+ }
242523
+ /** Copy the contents (not pointer) of `param[i]` into `dest`. Index `i` is not checked for validity. */
242524
+ copyParamTo(i, dest) {
242525
+ if (this.param)
242526
+ this.param.getPoint2dAtUncheckedPointIndex(i, dest);
242527
+ }
242528
+ /** Test if param at a index `i` matches the given uv */
242529
+ isAlmostEqualParamIndexUV(i, u, v) {
242530
+ if (this.param !== undefined && i >= 0 && i < this.param.length)
242531
+ return _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isSameCoordinate(u, this.param.getXAtUncheckedPointIndex(i))
242532
+ && _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.isSameCoordinate(v, this.param.getYAtUncheckedPointIndex(i));
242452
242533
  return false;
242453
242534
  }
242454
242535
  /**
242455
- * * Copy data from other to this.
242536
+ * Copy data from `other` to `this`.
242456
242537
  * * This is the essence of transferring coordinates spread throughout a large polyface into a visitor's single facet.
242457
- * * "other" is the large polyface
242458
- * * "this" is the visitor
242459
- * * does NOT copy face data - visitors reference the FacetFaceData array for the whole polyface!!
242538
+ * * Common usage: "other" is a Polyface, "this" is a PolyfaceVisitor to receive data from a single facet of the Polyface.
242539
+ * * Does NOT copy face data - visitors reference the FacetFaceData array for the whole polyface.
242460
242540
  * @param other polyface data being mined.
242461
- * @param index0 start index in other's index arrays
242462
- * @param index1 end index (one beyond last data accessed0 in other's index arrays
242541
+ * @param index0 start index in other's index arrays.
242542
+ * @param index1 end index (one beyond last data accessed) in other's index arrays.
242463
242543
  * @param numWrap number of points to replicate as wraparound.
242464
242544
  */
242465
242545
  gatherIndexedData(other, index0, index1, numWrap) {
242466
242546
  const numEdge = index1 - index0;
242547
+ if (numWrap > numEdge)
242548
+ numWrap = numEdge;
242467
242549
  const numTotal = numEdge + numWrap;
242468
- this.resizeAllDataArrays(numTotal);
242550
+ this.resizeAllArrays(numTotal);
242469
242551
  // copy wrapped points
242470
242552
  for (let i = 0; i < numEdge; i++)
242471
242553
  this.point.transferFromGrowableXYZArray(i, other.point, other.pointIndex[index0 + i]);
@@ -242476,41 +242558,48 @@ class PolyfaceData {
242476
242558
  this.pointIndex[i] = other.pointIndex[index0 + i];
242477
242559
  for (let i = 0; i < numWrap; i++)
242478
242560
  this.pointIndex[numEdge + i] = this.pointIndex[i];
242479
- // copy wrapped edge visibility
242480
- for (let i = 0; i < numEdge; i++)
242481
- this.edgeVisible[i] = other.edgeVisible[index0 + i];
242482
- for (let i = 0; i < numWrap; i++)
242483
- this.edgeVisible[numEdge + i] = this.edgeVisible[i];
242561
+ // copy wrapped normals
242484
242562
  if (this.normal && this.normalIndex && other.normal && other.normalIndex) {
242485
242563
  for (let i = 0; i < numEdge; i++)
242486
242564
  this.normal.transferFromGrowableXYZArray(i, other.normal, other.normalIndex[index0 + i]);
242487
242565
  for (let i = 0; i < numWrap; i++)
242488
242566
  this.normal.transferFromGrowableXYZArray(numEdge + i, this.normal, i);
242567
+ // copy wrapped normalIndex
242489
242568
  for (let i = 0; i < numEdge; i++)
242490
242569
  this.normalIndex[i] = other.normalIndex[index0 + i];
242491
242570
  for (let i = 0; i < numWrap; i++)
242492
242571
  this.normalIndex[numEdge + i] = this.normalIndex[i];
242493
242572
  }
242573
+ // copy wrapped params
242494
242574
  if (this.param && this.paramIndex && other.param && other.paramIndex) {
242495
242575
  for (let i = 0; i < numEdge; i++)
242496
242576
  this.param.transferFromGrowableXYArray(i, other.param, other.paramIndex[index0 + i]);
242497
242577
  for (let i = 0; i < numWrap; i++)
242498
242578
  this.param.transferFromGrowableXYArray(numEdge + i, this.param, i);
242579
+ // copy wrapped paramIndex
242499
242580
  for (let i = 0; i < numEdge; i++)
242500
242581
  this.paramIndex[i] = other.paramIndex[index0 + i];
242501
242582
  for (let i = 0; i < numWrap; i++)
242502
242583
  this.paramIndex[numEdge + i] = this.paramIndex[i];
242503
242584
  }
242585
+ // copy wrapped colors
242504
242586
  if (this.color && this.colorIndex && other.color && other.colorIndex) {
242505
242587
  for (let i = 0; i < numEdge; i++)
242506
242588
  this.color[i] = other.color[other.colorIndex[index0 + i]];
242507
242589
  for (let i = 0; i < numWrap; i++)
242508
242590
  this.color[numEdge + i] = this.color[i];
242591
+ // copy wrapped colorIndex
242509
242592
  for (let i = 0; i < numEdge; i++)
242510
242593
  this.colorIndex[i] = other.colorIndex[index0 + i];
242511
242594
  for (let i = 0; i < numWrap; i++)
242512
242595
  this.colorIndex[numEdge + i] = this.colorIndex[i];
242513
242596
  }
242597
+ // copy wrapped edge visibility
242598
+ for (let i = 0; i < numEdge; i++)
242599
+ this.edgeVisible[i] = other.edgeVisible[index0 + i];
242600
+ for (let i = 0; i < numWrap; i++)
242601
+ this.edgeVisible[numEdge + i] = this.edgeVisible[i];
242602
+ // copy wrapped auxData
242514
242603
  if (this.auxData && other.auxData && this.auxData.channels.length === other.auxData.channels.length) {
242515
242604
  for (let iChannel = 0; iChannel < this.auxData.channels.length; iChannel++) {
242516
242605
  const thisChannel = this.auxData.channels[iChannel];
@@ -242527,19 +242616,21 @@ class PolyfaceData {
242527
242616
  }
242528
242617
  }
242529
242618
  }
242619
+ // copy wrapped auxData index
242530
242620
  for (let i = 0; i < numEdge; i++)
242531
242621
  this.auxData.indices[i] = other.auxData.indices[index0 + i];
242532
242622
  for (let i = 0; i < numWrap; i++)
242533
242623
  this.auxData.indices[numEdge + i] = this.auxData.indices[i];
242534
242624
  }
242535
242625
  }
242626
+ /** Trim the `data` arrays to the stated `length`. */
242536
242627
  static trimArray(data, length) {
242537
242628
  if (data && length < data.length)
242538
242629
  data.length = length;
242539
242630
  }
242540
242631
  /**
242541
- * Trim all index arrays to the stated length.
242542
- * This is called by PolyfaceBuilder to clean up after an aborted construction sequence.
242632
+ * Trim all index arrays to the stated `length`.
242633
+ * * This is called by PolyfaceBuilder to clean up after an aborted construction sequence.
242543
242634
  */
242544
242635
  trimAllIndexArrays(length) {
242545
242636
  PolyfaceData.trimArray(this.pointIndex, length);
@@ -242555,7 +242646,78 @@ class PolyfaceData {
242555
242646
  }
242556
242647
  }
242557
242648
  }
242558
- /** Resize all data arrays to specified length */
242649
+ /**
242650
+ * Resize all data and index arrays to the specified `length`.
242651
+ * * This is used by visitors, whose data and index arrays are all parallel.
242652
+ */
242653
+ resizeAllArrays(length) {
242654
+ if (length > this.point.length) {
242655
+ while (this.point.length < length)
242656
+ this.point.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create());
242657
+ while (this.pointIndex.length < length)
242658
+ this.pointIndex.push(-1);
242659
+ if (this.normal)
242660
+ while (this.normal.length < length)
242661
+ this.normal.push(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Vector3d.create());
242662
+ if (this.normalIndex)
242663
+ while (this.normalIndex.length < length)
242664
+ this.normalIndex.push(-1);
242665
+ if (this.param)
242666
+ while (this.param.length < length)
242667
+ this.param.push(_geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_7__.Point2d.create());
242668
+ if (this.paramIndex)
242669
+ while (this.paramIndex.length < length)
242670
+ this.paramIndex.push(-1);
242671
+ if (this.color)
242672
+ while (this.color.length < length)
242673
+ this.color.push(0);
242674
+ if (this.colorIndex)
242675
+ while (this.colorIndex.length < length)
242676
+ this.colorIndex.push(-1);
242677
+ while (this.edgeVisible.length < length)
242678
+ this.edgeVisible.push(false);
242679
+ if (this.auxData) {
242680
+ for (const channel of this.auxData.channels) {
242681
+ for (const channelData of channel.data) {
242682
+ while (channelData.values.length < length * channel.entriesPerValue)
242683
+ channelData.values.push(0);
242684
+ }
242685
+ }
242686
+ if (this.auxData.indices)
242687
+ this.auxData.indices.push(-1);
242688
+ }
242689
+ }
242690
+ else if (length < this.point.length) {
242691
+ this.point.resize(length);
242692
+ this.pointIndex.length = length;
242693
+ if (this.normal)
242694
+ this.normal.resize(length);
242695
+ if (this.normalIndex)
242696
+ this.normalIndex.length = length;
242697
+ if (this.param)
242698
+ this.param.resize(length);
242699
+ if (this.paramIndex)
242700
+ this.paramIndex.length = length;
242701
+ if (this.color)
242702
+ this.color.length = length;
242703
+ if (this.colorIndex)
242704
+ this.colorIndex.length = length;
242705
+ this.edgeVisible.length = length;
242706
+ if (this.auxData) {
242707
+ for (const channel of this.auxData.channels) {
242708
+ for (const channelData of channel.data) {
242709
+ channelData.values.length = length * channel.entriesPerValue;
242710
+ }
242711
+ }
242712
+ if (this.auxData.indices)
242713
+ this.auxData.indices.length = length;
242714
+ }
242715
+ }
242716
+ }
242717
+ /**
242718
+ * Resize all data arrays to the specified `length`.
242719
+ * @deprecated in 4.x because name is misleading. Call [[PolyfaceData.resizeAllArrays]] instead.
242720
+ */
242559
242721
  resizeAllDataArrays(length) {
242560
242722
  if (length > this.point.length) {
242561
242723
  while (this.point.length < length)
@@ -242601,19 +242763,21 @@ class PolyfaceData {
242601
242763
  }
242602
242764
  }
242603
242765
  }
242604
- /** Return the range of the point array (optionally transformed) */
242766
+ /** Return the range of the point array (optionally transformed). */
242605
242767
  range(result, transform) {
242606
242768
  result = result ? result : _geometry3d_Range__WEBPACK_IMPORTED_MODULE_8__.Range3d.createNull();
242607
242769
  result.extendArray(this.point, transform);
242608
242770
  return result;
242609
242771
  }
242610
- /** reverse indices facet-by-facet, with the given facetStartIndex array delimiting faces.
242611
- *
242612
- * * facetStartIndex[0] == 0 always -- start of facet zero.
242613
- * * facet k has indices from facetStartIndex[k] <= i < facetStartIndex[k+1]
242614
- * * hence for "internal" k, facetStartIndex[k] is both the upper limit of facet k-1 and the start of facet k.
242615
- * *
242616
- */
242772
+ /**
242773
+ * Reverse the indices for the specified facets in the index arrays (pointIndex, normalIndex, paramIndex, colorIndex,
242774
+ * and edgeVisible).
242775
+ * @param facetStartIndex start indices of *consecutive* facets to be reversed.
242776
+ * * Consecutive indices in this array define where a given facet is represented in each of the parallel index arrays.
242777
+ * * The indices for facet k are `facetStartIndex[k]` up to (but not including) `facetStartIndex[k + 1]`.
242778
+ * * This implies `facetStartIndex[k + 1]` is both the upper limit of facet k's indices, and the start index of facet k+1.
242779
+ * * For example, passing an IndexedPolyface's _facetStart array into this method reverses every facet.
242780
+ */
242617
242781
  reverseIndices(facetStartIndex) {
242618
242782
  if (facetStartIndex && PolyfaceData.isValidFacetStartIndexArray(facetStartIndex)) {
242619
242783
  PolyfaceData.reverseIndices(facetStartIndex, this.pointIndex, true);
@@ -242626,31 +242790,33 @@ class PolyfaceData {
242626
242790
  PolyfaceData.reverseIndices(facetStartIndex, this.edgeVisible, false);
242627
242791
  }
242628
242792
  }
242629
- /** reverse indices facet-by-facet, with the given facetStartIndex array delimiting faces.
242630
- *
242631
- * * facetStartIndex[0] == 0 always -- start of facet zero.
242632
- * * facet k has indices from facetStartIndex[k] <= i < facetStartIndex[k+1]
242633
- * * hence for "internal" k, facetStartIndex[k] is both the upper limit of facet k-1 and the start of facet k.
242634
- * *
242793
+ /**
242794
+ * Reverse the indices for the specified facet in the index arrays (pointIndex, normalIndex, paramIndex, colorIndex,
242795
+ * and edgeVisible).
242796
+ * @param facetIndex index of the facet to reverse. The entries of each index array to be reversed are found at
242797
+ * `facetStartIndex[facetIndex] <= i < facetStartIndex[facetIndex + 1]`.
242798
+ * @param facetStartIndex start indices of *consecutive* facets, e.g., an IndexedPolyface's _facetStart array.
242799
+ * See [[reverseIndices]].
242635
242800
  */
242636
- reverseIndicesSingleFacet(facetId, facetStartIndex) {
242637
- PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.pointIndex, true);
242801
+ reverseIndicesSingleFacet(facetIndex, facetStartIndex) {
242802
+ PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.pointIndex, true);
242638
242803
  if (this.normalIndex !== this.pointIndex)
242639
- PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.normalIndex, true);
242804
+ PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.normalIndex, true);
242640
242805
  if (this.paramIndex !== this.pointIndex)
242641
- PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.paramIndex, true);
242806
+ PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.paramIndex, true);
242642
242807
  if (this.colorIndex !== this.pointIndex)
242643
- PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.colorIndex, true);
242644
- PolyfaceData.reverseIndicesSingleFacet(facetId, facetStartIndex, this.edgeVisible, false);
242808
+ PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.colorIndex, true);
242809
+ PolyfaceData.reverseIndicesSingleFacet(facetIndex, facetStartIndex, this.edgeVisible, false);
242645
242810
  }
242646
- /** Scale all the normals by -1 */
242811
+ /** Scale all the normals by -1. */
242647
242812
  reverseNormals() {
242648
242813
  if (this.normal)
242649
242814
  this.normal.scaleInPlace(-1.0);
242650
242815
  }
242651
- /** Apply `transform` to point and normal arrays and to auxData.
242652
- * * IMPORTANT This base class is just a data carrier. It does not know if the index order and normal directions have special meaning.
242653
- * * i.e. caller must separately reverse index order and normal direction if needed.
242816
+ /**
242817
+ * Apply `transform` to point and normal arrays and to auxData.
242818
+ * * IMPORTANT This base class is just a data carrier. It does not know if the index order and normal directions
242819
+ * have special meaning, i.e., caller must separately reverse index order and normal direction if needed.
242654
242820
  */
242655
242821
  tryTransformInPlace(transform) {
242656
242822
  this.point.multiplyTransformInPlace(transform);
@@ -242663,13 +242829,14 @@ class PolyfaceData {
242663
242829
  * * Search for duplicates within points, normals, params, and colors.
242664
242830
  * * Compress each data array.
242665
242831
  * * Revise all indexing for the relocated data.
242666
- * @param tolerance optional tolerance for clustering mesh vertices. Default is [[Geometry.smallMetricDistance]].
242832
+ * @param tolerance (optional) tolerance for clustering mesh vertices. Default is [[Geometry.smallMetricDistance]].
242667
242833
  */
242668
242834
  compress(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_5__.Geometry.smallMetricDistance) {
242835
+ // more info can be found at geometry/internaldocs/Polyface.md
242669
242836
  const packedPoints = _numerics_ClusterableArray__WEBPACK_IMPORTED_MODULE_9__.ClusterableArray.clusterGrowablePoint3dArray(this.point, tolerance);
242670
242837
  this.point = packedPoints.growablePackedPoints;
242671
242838
  packedPoints.updateIndices(this.pointIndex);
242672
- // for now, normals, params, and colors use the default tolerance for clustering...
242839
+ // for now, normals, params, and colors use the default tolerance for clustering
242673
242840
  if (this.normalIndex && this.normal) {
242674
242841
  const packedNormals = _numerics_ClusterableArray__WEBPACK_IMPORTED_MODULE_9__.ClusterableArray.clusterGrowablePoint3dArray(this.normal);
242675
242842
  this.normal = packedNormals.growablePackedPoints;
@@ -242687,10 +242854,11 @@ class PolyfaceData {
242687
242854
  }
242688
242855
  }
242689
242856
  /**
242690
- * Test if facetStartIndex is (minimally!) valid:
242691
- * * length must be nonzero (recall that for "no facets" the facetStartIndexArray still must contain a 0)
242857
+ * Test if `facetStartIndex` is (minimally) valid.
242858
+ * * Length must be nonzero (recall that for "no facets", the `facetStartIndex` array still must contain a 0).
242692
242859
  * * Each entry must be strictly smaller than the one that follows.
242693
- * @param facetStartIndex array of facetStart data. facet `i` has indices at `facetsStartIndex[i]` to (one before) `facetStartIndex[i+1]`
242860
+ * @param facetStartIndex start indices of all facets. Facet k starts at facetStartIndex[k] up to (but not including)
242861
+ * `facetStartIndex[k + 1]`
242694
242862
  */
242695
242863
  static isValidFacetStartIndexArray(facetStartIndex) {
242696
242864
  // facetStartIndex for empty facets has a single entry "0" -- empty array is not allowed
@@ -242701,8 +242869,14 @@ class PolyfaceData {
242701
242869
  return false;
242702
242870
  return true;
242703
242871
  }
242704
- /** Reverse data in entire facet indexing arrays.
242705
- * * parameterized over type T so non-number data -- e.g. boolean visibility flags -- can be reversed.
242872
+ /**
242873
+ * Reverse the indices for the specified facets in the given index array.
242874
+ * * Parameterized over type T so non-number data (e.g., boolean visibility flags) can be reversed.
242875
+ * @param facetStartIndex start indices of *consecutive* facets to be reversed, e.g., an IndexedPolyface's _facetStart
242876
+ * array. See the non-static [[reverseIndices]].
242877
+ * @param indices the index array, e.g., pointIndex, normalIndex, etc.
242878
+ * @param preserveStart `true` to preserve the start index of each facet (e.g., facet [1,2,3,4] becomes [1,4,3,2]);
242879
+ * `false` to reverse all indices (e.g., facet [1,2,3,4] becomes [4,3,2,1]).
242706
242880
  */
242707
242881
  static reverseIndices(facetStartIndex, indices, preserveStart) {
242708
242882
  if (!indices || indices.length === 0)
@@ -242712,8 +242886,7 @@ class PolyfaceData {
242712
242886
  for (let i = 0; i + 1 < facetStartIndex.length; i++) {
242713
242887
  let index0 = facetStartIndex[i];
242714
242888
  let index1 = facetStartIndex[i + 1];
242715
- if (preserveStart) {
242716
- // leave [index0] as is so reversed facet starts at same vertex
242889
+ if (preserveStart) { // leave "index0" as is so reversed facet starts at same vertex
242717
242890
  while (index1 > index0 + 2) {
242718
242891
  index1--;
242719
242892
  index0++;
@@ -242722,8 +242895,7 @@ class PolyfaceData {
242722
242895
  indices[index1] = a;
242723
242896
  }
242724
242897
  }
242725
- else {
242726
- // reverse all
242898
+ else { // reverse all
242727
242899
  while (index1 > index0 + 1) {
242728
242900
  index1--;
242729
242901
  const a = indices[index0];
@@ -242738,19 +242910,26 @@ class PolyfaceData {
242738
242910
  }
242739
242911
  return false;
242740
242912
  }
242741
- /** Reverse data in entire facet indexing arrays.
242742
- * * parameterized over type T so non-number data -- e.g. boolean visibility flags -- can be reversed.
242913
+ /**
242914
+ * Reverse the indices for the specified facet in the specified index array.
242915
+ * * Parameterized over type T so non-number data (e.g., boolean visibility flags) can be reversed.
242916
+ * @param facetIndex index of the facet to reverse. The entries of `indices` to be reversed are found at
242917
+ * `facetStartIndex[facetIndex] <= i < facetStartIndex[facetIndex + 1]`.
242918
+ * @param facetStartIndex start indices of *consecutive* facets, e.g., an IndexedPolyface's _facetStart array.
242919
+ * See [[reverseIndices]].
242920
+ * @param indices the index array, e.g., pointIndex, normalIndex, etc.
242921
+ * @param preserveStart `true` to preserve the start index of each facet (e.g., facet [1,2,3,4] becomes [1,4,3,2]);
242922
+ * `false` to reverse all indices (e.g., facet [1,2,3,4] becomes [4,3,2,1]).
242743
242923
  */
242744
- static reverseIndicesSingleFacet(facetId, facetStartIndex, indices, preserveStart) {
242924
+ static reverseIndicesSingleFacet(facetIndex, facetStartIndex, indices, preserveStart) {
242745
242925
  if (!indices || indices.length === 0)
242746
242926
  return true; // empty case
242747
242927
  if (indices.length > 0) {
242748
242928
  if (facetStartIndex[facetStartIndex.length - 1] === indices.length
242749
- && facetId >= 0 && facetId + 1 < facetStartIndex.length) {
242750
- let index0 = facetStartIndex[facetId];
242751
- let index1 = facetStartIndex[facetId + 1];
242752
- if (preserveStart) {
242753
- // leave [index0] as is so reversed facet starts at same vertex
242929
+ && facetIndex >= 0 && facetIndex + 1 < facetStartIndex.length) {
242930
+ let index0 = facetStartIndex[facetIndex];
242931
+ let index1 = facetStartIndex[facetIndex + 1];
242932
+ if (preserveStart) { // leave "index0" as is so reversed facet starts at same vertex
242754
242933
  while (index1 > index0 + 2) {
242755
242934
  index1--;
242756
242935
  index0++;
@@ -242759,8 +242938,7 @@ class PolyfaceData {
242759
242938
  indices[index1] = a;
242760
242939
  }
242761
242940
  }
242762
- else {
242763
- // reverse all
242941
+ else { // reverse all
242764
242942
  while (index1 > index0 + 1) {
242765
242943
  index1--;
242766
242944
  const a = indices[index0];
@@ -242775,18 +242953,10 @@ class PolyfaceData {
242775
242953
  return false;
242776
242954
  }
242777
242955
  }
242778
- // <ul
242779
- // <li>optional arrays (normal, uv, color) must be indicated at constructor time.
242780
- // <li>all arrays are (independently) indexed.
242781
- // <li>with regret, the point, param, normal, and color arrays are exposed publicly.
242782
- // <li>getX methods are "trusting" -- no bounds check
242783
- // <li>getX methods return references to X.
242784
- // <li> EXCEPT -- for optional arrays, the return 000.
242785
- // <li>copyX methods move data to caller-supplied result..
242786
- // </ul>
242787
- /** Relative tolerance used in tests for planar facets
242956
+ /**
242957
+ * Relative tolerance used in tests for planar facets.
242788
242958
  * @internal
242789
- */
242959
+ */
242790
242960
  PolyfaceData.planarityLocalRelTol = 1.0e-13;
242791
242961
 
242792
242962
 
@@ -263761,7 +263931,6 @@ class HalfEdgeGraph {
263761
263931
  }
263762
263932
  /** Returns the number of vertex loops in a graph structure. */
263763
263933
  countVertexLoops() {
263764
- this.clearMask(HalfEdgeMask.VISITED);
263765
263934
  let count = 0;
263766
263935
  this.announceVertexLoops((_graph, _seed) => {
263767
263936
  count++;
@@ -263771,7 +263940,6 @@ class HalfEdgeGraph {
263771
263940
  }
263772
263941
  /** Returns the number of face loops in a graph structure. */
263773
263942
  countFaceLoops() {
263774
- this.clearMask(HalfEdgeMask.VISITED);
263775
263943
  let count = 0;
263776
263944
  this.announceFaceLoops((_graph, _seed) => {
263777
263945
  count++;
@@ -263781,7 +263949,6 @@ class HalfEdgeGraph {
263781
263949
  }
263782
263950
  /** Returns the number of face loops satisfying a filter function with mask argument. */
263783
263951
  countFaceLoopsWithMaskFilter(filter, mask) {
263784
- this.clearMask(HalfEdgeMask.VISITED);
263785
263952
  let count = 0;
263786
263953
  this.announceFaceLoops((_graph, seed) => {
263787
263954
  if (filter(seed, mask))
@@ -267120,14 +267287,15 @@ __webpack_require__.r(__webpack_exports__);
267120
267287
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
267121
267288
  /* harmony export */ "Triangulator": () => (/* binding */ Triangulator)
267122
267289
  /* harmony export */ });
267123
- /* harmony import */ var _clipping_ClipUtils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../clipping/ClipUtils */ "../../core/geometry/lib/esm/clipping/ClipUtils.js");
267290
+ /* harmony import */ var _clipping_ClipUtils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../clipping/ClipUtils */ "../../core/geometry/lib/esm/clipping/ClipUtils.js");
267124
267291
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
267125
- /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
267126
- /* harmony import */ var _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndUnitNormal */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js");
267127
- /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
267292
+ /* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
267293
+ /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
267294
+ /* harmony import */ var _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndUnitNormal */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js");
267295
+ /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
267128
267296
  /* harmony import */ var _geometry3d_PointHelpers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/PointHelpers */ "../../core/geometry/lib/esm/geometry3d/PointHelpers.js");
267129
- /* harmony import */ var _geometry3d_PointStreaming__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/PointStreaming */ "../../core/geometry/lib/esm/geometry3d/PointStreaming.js");
267130
- /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
267297
+ /* harmony import */ var _geometry3d_PointStreaming__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/PointStreaming */ "../../core/geometry/lib/esm/geometry3d/PointStreaming.js");
267298
+ /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
267131
267299
  /* harmony import */ var _Graph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
267132
267300
  /* harmony import */ var _HalfEdgeMarkSet__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./HalfEdgeMarkSet */ "../../core/geometry/lib/esm/topology/HalfEdgeMarkSet.js");
267133
267301
  /* harmony import */ var _InsertAndRetriangulateContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./InsertAndRetriangulateContext */ "../../core/geometry/lib/esm/topology/InsertAndRetriangulateContext.js");
@@ -267149,6 +267317,7 @@ __webpack_require__.r(__webpack_exports__);
267149
267317
 
267150
267318
 
267151
267319
 
267320
+
267152
267321
  /**
267153
267322
  * (static) methods for triangulating polygons
267154
267323
  * * @internal
@@ -267361,7 +267530,10 @@ class Triangulator {
267361
267530
  return undefined;
267362
267531
  }
267363
267532
  /**
267364
- * Triangulate all positive area faces of a graph.
267533
+ * Triangulate all positive area faces of a (planar) graph.
267534
+ * * Area is computed using `HalfEdge.signedFaceArea`, which ignores z-coordinates.
267535
+ * @returns whether all indicated faces were triangulated successfully
267536
+ * @see [[triangulateAllInteriorFaces]]
267365
267537
  */
267366
267538
  static triangulateAllPositiveAreaFaces(graph) {
267367
267539
  const seeds = graph.collectFaceLoops();
@@ -267376,6 +267548,44 @@ class Triangulator {
267376
267548
  }
267377
267549
  return numFail === 0;
267378
267550
  }
267551
+ /**
267552
+ * Triangulate all interior faces of a graph.
267553
+ * * A random node is checked for each face; if it has the `HalfEdgeMask.EXTERIOR` mask, the face is ignored.
267554
+ * @param useLocalCoords whether to transform each face into local coords before triangulating.
267555
+ * This is useful if the graph has z-coordinates.
267556
+ * @returns whether all indicated faces were triangulated successfully
267557
+ * @see [[triangulateAllPositiveAreaFaces]]
267558
+ */
267559
+ static triangulateAllInteriorFaces(graph, useLocalCoords) {
267560
+ const seeds = graph.collectFaceLoops();
267561
+ const visited = useLocalCoords ? graph.grabMask() : _Graph__WEBPACK_IMPORTED_MODULE_0__.HalfEdgeMask.NULL_MASK;
267562
+ let localToWorld;
267563
+ let nodes;
267564
+ let nodeCount = 0;
267565
+ let numFail = 0;
267566
+ for (const face of seeds) {
267567
+ if (face.countEdgesAroundFace() > 3) {
267568
+ if (face.getMask(_Graph__WEBPACK_IMPORTED_MODULE_0__.HalfEdgeMask.EXTERIOR))
267569
+ continue;
267570
+ if (useLocalCoords) {
267571
+ nodeCount = graph.countNodes();
267572
+ nodes = face.collectAroundFace();
267573
+ localToWorld = this._workTransform = _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_5__.FrameBuilder.createRightHandedLocalToWorld(nodes, this._workTransform);
267574
+ localToWorld?.multiplyInversePoint3dArrayInPlace(nodes);
267575
+ }
267576
+ // don't flip triangles if using local coords; an edge of this face can be flipped out of plane if the neighboring triangle is non-coplanar.
267577
+ if (!Triangulator.triangulateSingleFace(graph, face, useLocalCoords))
267578
+ numFail++;
267579
+ if (localToWorld && nodes) {
267580
+ for (let iNewNode = nodeCount; iNewNode < graph.countNodes(); ++iNewNode)
267581
+ nodes.push(graph.allHalfEdges[iNewNode]);
267582
+ localToWorld.multiplyPoint3dArrayInPlace(nodes);
267583
+ }
267584
+ }
267585
+ }
267586
+ graph.dropMask(visited);
267587
+ return numFail === 0;
267588
+ }
267379
267589
  /**
267380
267590
  * Triangulate the polygon made up of by a series of points.
267381
267591
  * * The loop may be either CCW or CW -- CCW order will be used for triangles.
@@ -267424,7 +267634,7 @@ class Triangulator {
267424
267634
  let n = data.length;
267425
267635
  let x0, y0, x1, y1;
267426
267636
  while (n > 1) {
267427
- if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_5__.IndexedXYZCollection) {
267637
+ if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
267428
267638
  x0 = data.getXAtUncheckedPointIndex(0);
267429
267639
  y0 = data.getYAtUncheckedPointIndex(0);
267430
267640
  x1 = data.getXAtUncheckedPointIndex(n - 1);
@@ -267456,8 +267666,8 @@ class Triangulator {
267456
267666
  static directCreateFaceLoopFromCoordinates(graph, data) {
267457
267667
  const n = this.getUnwrappedLength(data); // open it up to allow starting at a bridge edge
267458
267668
  let baseNode;
267459
- if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_5__.IndexedXYZCollection) {
267460
- const xyz = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_6__.Point3d.create();
267669
+ if (data instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_6__.IndexedXYZCollection) {
267670
+ const xyz = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_7__.Point3d.create();
267461
267671
  for (let i = 0; i < n; i++) {
267462
267672
  data.getPoint3dAtCheckedPointIndex(i, xyz);
267463
267673
  baseNode = Triangulator.interiorEdgeSplit(graph, baseNode, xyz);
@@ -267478,7 +267688,7 @@ class Triangulator {
267478
267688
  */
267479
267689
  static directCreateChainsFromCoordinates(graph, data, id = 0) {
267480
267690
  const assembler = new AssembleXYZXYZChains(graph, id);
267481
- _geometry3d_PointStreaming__WEBPACK_IMPORTED_MODULE_7__.VariantPointDataStream.streamXYZ(data, assembler);
267691
+ _geometry3d_PointStreaming__WEBPACK_IMPORTED_MODULE_8__.VariantPointDataStream.streamXYZ(data, assembler);
267482
267692
  return assembler.claimSeeds();
267483
267693
  }
267484
267694
  /**
@@ -267604,14 +267814,12 @@ class Triangulator {
267604
267814
  return b0;
267605
267815
  }
267606
267816
  /**
267607
- * main ear slicing loop which triangulates a polygon (given as a linked list)
267608
- * While there still exists ear nodes that have not yet been triangulated...
267609
- *
267610
- * * Check if the ear is hashed, and can easily be split off. If so, "join" that ear.
267611
- * * If not hashed, move on to a separate ear.
267612
- * * If no ears are currently hashed, attempt to cure self intersections or split the polygon into two before continuing
267817
+ * Main ear slicing loop which triangulates the face starting at `ear`.
267818
+ * @param graph containing graph to receive new edges
267819
+ * @param ear sector at which to start triangulation of the containing face.
267820
+ * @param noFlips if false (default) perform edge-flipping after each ear cut for better aspect ratio. Pass true if your graph isn't planar.
267613
267821
  */
267614
- static triangulateSingleFace(graph, ear) {
267822
+ static triangulateSingleFace(graph, ear, noFlips = false) {
267615
267823
  if (!ear) {
267616
267824
  Triangulator.setDebugGraph(graph);
267617
267825
  return false;
@@ -267662,7 +267870,8 @@ class Triangulator {
267662
267870
  // If we already have a separated triangle, do not join
267663
267871
  if (ear.faceSuccessor.faceSuccessor !== ear.facePredecessor) {
267664
267872
  Triangulator.joinNeighborsOfEar(graph, ear);
267665
- ear = Triangulator.doPostCutFlips(ear);
267873
+ if (!noFlips)
267874
+ ear = Triangulator.doPostCutFlips(ear);
267666
267875
  ear = ear.faceSuccessor.edgeMate.faceSuccessor;
267667
267876
  // another step? Nate's 2017 code went one more.
267668
267877
  }
@@ -267726,15 +267935,15 @@ class Triangulator {
267726
267935
  if (area <= 0)
267727
267936
  return false; // reflex, can't be an ear
267728
267937
  const planes = this._planes;
267729
- if (!_geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_8__.Plane3dByOriginAndUnitNormal.createOriginAndTargetXY(a, b, planes[0])
267730
- || !_geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_8__.Plane3dByOriginAndUnitNormal.createOriginAndTargetXY(b, c, planes[1])
267731
- || !_geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_8__.Plane3dByOriginAndUnitNormal.createOriginAndTargetXY(c, a, planes[2]))
267938
+ if (!_geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_9__.Plane3dByOriginAndUnitNormal.createOriginAndTargetXY(a, b, planes[0])
267939
+ || !_geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_9__.Plane3dByOriginAndUnitNormal.createOriginAndTargetXY(b, c, planes[1])
267940
+ || !_geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_9__.Plane3dByOriginAndUnitNormal.createOriginAndTargetXY(c, a, planes[2]))
267732
267941
  return false;
267733
267942
  // now make sure we don't have other points inside the potential ear, or edges crossing.
267734
267943
  const earRange = this._earRange;
267735
267944
  const edgeRange = this._edgeRange;
267736
267945
  const edgeInterval = this._edgeInterval;
267737
- _geometry3d_Range__WEBPACK_IMPORTED_MODULE_9__.Range2d.createXYXYXY(a.x, a.y, b.x, b.y, c.x, c.y, earRange);
267946
+ _geometry3d_Range__WEBPACK_IMPORTED_MODULE_10__.Range2d.createXYXYXY(a.x, a.y, b.x, b.y, c.x, c.y, earRange);
267738
267947
  earRange.expandInPlace(_Geometry__WEBPACK_IMPORTED_MODULE_1__.Geometry.smallMetricDistance);
267739
267948
  let p = c;
267740
267949
  const zeroPlus = 1.0e-8;
@@ -267744,11 +267953,11 @@ class Triangulator {
267744
267953
  const clipTolerance = 1.0e-10 * area;
267745
267954
  while (p !== a) {
267746
267955
  const q = p.faceSuccessor;
267747
- _geometry3d_Range__WEBPACK_IMPORTED_MODULE_9__.Range2d.createXYXY(p.x, p.y, q.x, q.y, edgeRange);
267956
+ _geometry3d_Range__WEBPACK_IMPORTED_MODULE_10__.Range2d.createXYXY(p.x, p.y, q.x, q.y, edgeRange);
267748
267957
  if (earRange.intersectsRange(edgeRange)) {
267749
267958
  // Does pq impinge on the triangle abc?
267750
- _geometry3d_Range__WEBPACK_IMPORTED_MODULE_9__.Range1d.createXX(zeroMinus, onePlus, edgeInterval);
267751
- _clipping_ClipUtils__WEBPACK_IMPORTED_MODULE_10__.ClipUtilities.clipSegmentBelowPlanesXY(planes, p, q, edgeInterval, clipTolerance);
267959
+ _geometry3d_Range__WEBPACK_IMPORTED_MODULE_10__.Range1d.createXX(zeroMinus, onePlus, edgeInterval);
267960
+ _clipping_ClipUtils__WEBPACK_IMPORTED_MODULE_11__.ClipUtilities.clipSegmentBelowPlanesXY(planes, p, q, edgeInterval, clipTolerance);
267752
267961
  if (!edgeInterval.isNull) {
267753
267962
  if (edgeInterval.low > oneMinus) {
267754
267963
  // only q touches triangle abc, so b might still be an ear if q lies at a vertex
@@ -268076,20 +268285,20 @@ class Triangulator {
268076
268285
  /** @internal */
268077
268286
  Triangulator.sEnableDebugGraphCapture = false;
268078
268287
  // for reuse over all calls to isEar ....
268079
- Triangulator._edgeInterval = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_9__.Range1d.createNull();
268080
- Triangulator._earRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_9__.Range2d.createNull();
268081
- Triangulator._edgeRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_9__.Range2d.createNull();
268288
+ Triangulator._edgeInterval = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_10__.Range1d.createNull();
268289
+ Triangulator._earRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_10__.Range2d.createNull();
268290
+ Triangulator._edgeRange = _geometry3d_Range__WEBPACK_IMPORTED_MODULE_10__.Range2d.createNull();
268082
268291
  Triangulator._planes = [
268083
- _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_8__.Plane3dByOriginAndUnitNormal.createXYPlane(),
268084
- _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_8__.Plane3dByOriginAndUnitNormal.createXYPlane(),
268085
- _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_8__.Plane3dByOriginAndUnitNormal.createXYPlane(),
268292
+ _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_9__.Plane3dByOriginAndUnitNormal.createXYPlane(),
268293
+ _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_9__.Plane3dByOriginAndUnitNormal.createXYPlane(),
268294
+ _geometry3d_Plane3dByOriginAndUnitNormal__WEBPACK_IMPORTED_MODULE_9__.Plane3dByOriginAndUnitNormal.createXYPlane(),
268086
268295
  ];
268087
268296
 
268088
268297
  /**
268089
268298
  * Internal class for assembling chains
268090
268299
  * @internal
268091
268300
  */
268092
- class AssembleXYZXYZChains extends _geometry3d_PointStreaming__WEBPACK_IMPORTED_MODULE_7__.PointStreamXYZXYZHandlerBase {
268301
+ class AssembleXYZXYZChains extends _geometry3d_PointStreaming__WEBPACK_IMPORTED_MODULE_8__.PointStreamXYZXYZHandlerBase {
268093
268302
  constructor(graph, id) {
268094
268303
  super();
268095
268304
  this._graph = graph;
@@ -288859,7 +289068,7 @@ class TestContext {
288859
289068
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
288860
289069
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
288861
289070
  await core_frontend_1.NoRenderApp.startup({
288862
- applicationVersion: "4.5.0-dev.21",
289071
+ applicationVersion: "4.5.0-dev.23",
288863
289072
  applicationId: this.settings.gprid,
288864
289073
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
288865
289074
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -308182,7 +308391,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
308182
308391
  /***/ ((module) => {
308183
308392
 
308184
308393
  "use strict";
308185
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.5.0-dev.21","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.21","@itwin/core-bentley":"workspace:^4.5.0-dev.21","@itwin/core-common":"workspace:^4.5.0-dev.21","@itwin/core-geometry":"workspace:^4.5.0-dev.21","@itwin/core-orbitgt":"workspace:^4.5.0-dev.21","@itwin/core-quantity":"workspace:^4.5.0-dev.21"},"//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"}}');
308394
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.5.0-dev.23","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.23","@itwin/core-bentley":"workspace:^4.5.0-dev.23","@itwin/core-common":"workspace:^4.5.0-dev.23","@itwin/core-geometry":"workspace:^4.5.0-dev.23","@itwin/core-orbitgt":"workspace:^4.5.0-dev.23","@itwin/core-quantity":"workspace:^4.5.0-dev.23"},"//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"}}');
308186
308395
 
308187
308396
  /***/ }),
308188
308397