@itwin/rpcinterface-full-stack-tests 4.0.0-dev.37 → 4.0.0-dev.39

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.
@@ -175230,8 +175230,8 @@ __webpack_require__.r(__webpack_exports__);
175230
175230
 
175231
175231
 
175232
175232
  /* eslint-disable @typescript-eslint/naming-convention, no-empty */
175233
- /** Enumeration of the 6 possible orderings of XYZ axis order
175234
- *
175233
+ /**
175234
+ * Enumeration of the 6 possible orderings of XYZ axis order
175235
175235
  * * **Note:** There are 3 axis order with right hand system (XYZ = 0, YZX = 1, ZXY = 2) and 3 axis order with
175236
175236
  * left hand system (XZY = 4, YXZ = 5, ZYX = 6). Note that AxisOrder is encoding the handedness as well. Cross
175237
175237
  * product of the i_th axis in an ordering (i=0,1,2), with the i+1_th in that ordering, will produce the i+2_th
@@ -175253,7 +175253,8 @@ var AxisOrder;
175253
175253
  /** Left handed system, Z then Y then X */
175254
175254
  AxisOrder[AxisOrder["ZYX"] = 6] = "ZYX";
175255
175255
  })(AxisOrder || (AxisOrder = {}));
175256
- /** Enumeration of numeric indices of 3 axes AxisIndex.X, AxisIndex.Y, AxisIndex.Z
175256
+ /**
175257
+ * Enumeration of numeric indices of 3 axes AxisIndex.X, AxisIndex.Y, AxisIndex.Z
175257
175258
  * @public
175258
175259
  */
175259
175260
  var AxisIndex;
@@ -175364,7 +175365,10 @@ class Geometry {
175364
175365
  static inverseMetricDistanceSquared(a) {
175365
175366
  return (Math.abs(a) <= Geometry.smallMetricDistanceSquared) ? undefined : 1.0 / a;
175366
175367
  }
175367
- /** Boolean test for metric coordinate near-equality */
175368
+ /**
175369
+ * Boolean test for metric coordinate near-equality. If tolerance is not passed, `Geometry.smallMetricDistance`
175370
+ * is used as tolerance.
175371
+ */
175368
175372
  static isSameCoordinate(x, y, tol) {
175369
175373
  if (tol)
175370
175374
  return Math.abs(x - y) < Math.abs(tol);
@@ -175801,16 +175805,37 @@ class Geometry {
175801
175805
  }
175802
175806
  /** return 0 if the value is undefined, 1 if defined. */
175803
175807
  static defined01(value) { return value === undefined ? 0 : 1; }
175804
- /** normally, return numerator/denominator.
175805
- * but if the ratio would exceed Geometry.largeFractionResult, return undefined.
175808
+ /**
175809
+ * Return `numerator` over `denominator` or `undefined`.
175810
+ * @param numerator the numerator
175811
+ * @param denominator the denominator
175812
+ * @returns return `numerator/denominator` but if the ratio would exceed `Geometry.largeFractionResult`,
175813
+ * return `undefined`.
175806
175814
  */
175807
175815
  static conditionalDivideFraction(numerator, denominator) {
175808
175816
  if (Math.abs(denominator) * Geometry.largeFractionResult > Math.abs(numerator))
175809
175817
  return numerator / denominator;
175810
175818
  return undefined;
175811
175819
  }
175812
- /** normally, return numerator/denominator.
175813
- * but if the ratio would exceed Geometry.largestResult, return undefined.
175820
+ /**
175821
+ * Return `numerator` over `denominator`.
175822
+ * @param numerator the numerator
175823
+ * @param denominator the denominator
175824
+ * @returns return `numerator/denominator` but if the ratio would exceed `Geometry.largeFractionResult`,
175825
+ * return `defaultResult`.
175826
+ */
175827
+ static safeDivideFraction(numerator, denominator, defaultResult) {
175828
+ const a = Geometry.conditionalDivideFraction(numerator, denominator);
175829
+ if (a !== undefined)
175830
+ return a;
175831
+ return defaultResult;
175832
+ }
175833
+ /**
175834
+ * Return `numerator` over `denominator` (with a given `largestResult`) or `undefined`.
175835
+ * @param numerator the numerator
175836
+ * @param denominator the denominator
175837
+ * @param largestResult the ratio threshold.
175838
+ * @returns return `numerator/denominator` but if the ratio would exceed `largestResult`, return `undefined`.
175814
175839
  */
175815
175840
  static conditionalDivideCoordinate(numerator, denominator, largestResult = Geometry.largeCoordinateResult) {
175816
175841
  if (Math.abs(denominator * largestResult) > Math.abs(numerator))
@@ -175849,15 +175874,6 @@ class Geometry {
175849
175874
  return result;
175850
175875
  }
175851
175876
  }
175852
- /** normally, return the number result of conditionalDivideFraction.
175853
- * but if conditionalDivideFraction fails return specified default number.
175854
- */
175855
- static safeDivideFraction(numerator, denominator, defaultResult) {
175856
- const a = Geometry.conditionalDivideFraction(numerator, denominator);
175857
- if (a !== undefined)
175858
- return a;
175859
- return defaultResult;
175860
- }
175861
175877
  /** For a line f(x) whose function values at x0 and x1 are f0 and f1, return the x value at which f(x)=fTarget; */
175862
175878
  static inverseInterpolate(x0, f0, x1, f1, targetF = 0, defaultResult) {
175863
175879
  const g = Geometry.conditionalDivideFraction(targetF - f0, f1 - f0);
@@ -195772,6 +195788,12 @@ class Loop extends _CurveCollection__WEBPACK_IMPORTED_MODULE_0__.CurveChain {
195772
195788
  const strokes = _LineString3d__WEBPACK_IMPORTED_MODULE_1__.LineString3d.create();
195773
195789
  for (const curve of this.children)
195774
195790
  curve.emitStrokes(strokes, options);
195791
+ // eliminate near-duplicate points between children
195792
+ strokes.removeDuplicatePoints();
195793
+ if (strokes.isPhysicallyClosed) {
195794
+ strokes.popPoint();
195795
+ strokes.addClosurePoint();
195796
+ }
195775
195797
  return Loop.create(strokes);
195776
195798
  }
195777
195799
  /** Return the boundary type (2) of a corresponding MicroStation CurveVector */
@@ -198482,15 +198504,14 @@ class RegionOps {
198482
198504
  curves.dispatchToGeometryHandler(context);
198483
198505
  }
198484
198506
  /**
198485
- * If reverse loops as necessary to make them all have CCW orientation for given outward normal.
198486
- * * Return an array of arrays which capture the input pointers.
198487
- * * In each first level array:
198488
- * * The first loop is an outer loop.
198489
- * * all subsequent loops are holes
198490
- * * The outer loop is CCW
198491
- * * The holes are CW.
198492
- * * Call PolygonOps.sortOuterAndHoleLoopsXY to have the result returned as an array of arrays of polygons.
198493
- * @param loops multiple loops to sort and reverse.
198507
+ * Reverse and reorder loops in the xy-plane for consistency and containment.
198508
+ * @param loops multiple loops in any order and orientation, z-coordinates ignored
198509
+ * @returns a region that captures the input pointers. This region is a:
198510
+ * * `Loop` if there is exactly one input loop. It is oriented counterclockwise.
198511
+ * * `ParityRegion` if input consists of exactly one outer loop with at least one hole loop.
198512
+ * Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented clockwise.
198513
+ * * `UnionRegion` if any other input configuration. Its children are individually ordered/oriented as in the above cases.
198514
+ * @see PolygonOps.sortOuterAndHoleLoopsXY
198494
198515
  */
198495
198516
  static sortOuterAndHoleLoopsXY(loops) {
198496
198517
  const loopAndArea = [];
@@ -198852,6 +198873,8 @@ class RegionOpsFaceToFaceSearch {
198852
198873
  if (graphCheckPoint)
198853
198874
  graphCheckPoint("After regularize", graph, "MR");
198854
198875
  const exteriorHalfEdge = _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_4__.HalfEdgeGraphSearch.findMinimumAreaFace(graph);
198876
+ if (exteriorHalfEdge === undefined)
198877
+ return undefined;
198855
198878
  const exteriorMask = _topology_Graph__WEBPACK_IMPORTED_MODULE_0__.HalfEdgeMask.EXTERIOR;
198856
198879
  const faceVisitedMask = graph.grabMask();
198857
198880
  const nodeVisitedMask = graph.grabMask();
@@ -210876,7 +210899,7 @@ __webpack_require__.r(__webpack_exports__);
210876
210899
 
210877
210900
 
210878
210901
  /* eslint-disable @itwin/prefer-get */
210879
- // cSpell:words XXYZ YXYZ ZXYZ SaeedTorabi
210902
+ // cSpell:words XXYZ YXYZ ZXYZ SaeedTorabi arctan newcommand
210880
210903
  /**
210881
210904
  * PackedMatrix3dOps contains static methods for matrix operations where the matrix is a Float64Array.
210882
210905
  * * The Float64Array contains the matrix entries in row-major order
@@ -211172,7 +211195,7 @@ class Matrix3d {
211172
211195
  /**
211173
211196
  * Here we rotate this.columnX() around this.columnZ() by "angle" and expect to get other.columnX().
211174
211197
  * Then we rotate this.columnY() around this.columnZ() by the same "angle" and if we get other.columnY(),
211175
- * that means this` and `other` have X and Y columns differing only by a rotation around that Z.
211198
+ * that means `this` and `other` have X and Y columns differing only by a rotation around column Z.
211176
211199
  */
211177
211200
  let column = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createRotateVectorAroundVector(columnX, columnZ, angle);
211178
211201
  if (other.isAlmostEqualColumnXYZ(0, column.x, column.y, column.z, tol)) {
@@ -211621,14 +211644,16 @@ class Matrix3d {
211621
211644
  static createColumnsXYW(vectorU, u, vectorV, v, vectorW, w, result) {
211622
211645
  return Matrix3d.createRowValues(vectorU.x, vectorV.x, vectorW.x, vectorU.y, vectorV.y, vectorW.y, u, v, w, result);
211623
211646
  }
211624
- /** Create a matrix from "as viewed" right and up vectors.
211625
- * * ColumnX points in the rightVector direction
211626
- * * ColumnY points in the upVector direction
211647
+ /**
211648
+ * Create a matrix from "as viewed" right and up vectors.
211649
+ * * ColumnX points in the rightVector direction.
211650
+ * * ColumnY points in the upVector direction.
211627
211651
  * * ColumnZ is a unit cross product of ColumnX and ColumnY.
211628
211652
  * * Optionally rotate by 45 degrees around `upVector` to bring its left or right vertical edge to center.
211629
211653
  * * Optionally rotate by arctan(1/sqrt(2)) ~ 35.264 degrees around `rightVector` to bring the top or bottom
211630
211654
  * horizontal edge of the view to the center (for isometric views).
211631
- * * This is expected to be used with various principal unit vectors that are perpendicular to each other.
211655
+ *
211656
+ * This is expected to be used with various principal unit vectors that are perpendicular to each other.
211632
211657
  * * STANDARD TOP VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitY(), 0, 0)
211633
211658
  * * STANDARD FRONT VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitZ(), 0, 0)
211634
211659
  * * STANDARD BACK VIEW: createViewedAxes(Vector3d.unitX(-1), Vector3d.unitZ(), 0, 0)
@@ -212117,6 +212142,18 @@ class Matrix3d {
212117
212142
  + this.coffs[3] * this.coffs[4]
212118
212143
  + this.coffs[6] * this.coffs[7];
212119
212144
  }
212145
+ /** Return the dot product of column X with column Z */
212146
+ columnXDotColumnZ() {
212147
+ return this.coffs[0] * this.coffs[2]
212148
+ + this.coffs[3] * this.coffs[5]
212149
+ + this.coffs[6] * this.coffs[8];
212150
+ }
212151
+ /** Return the dot product of column Y with column Z */
212152
+ columnYDotColumnZ() {
212153
+ return this.coffs[1] * this.coffs[2]
212154
+ + this.coffs[4] * this.coffs[5]
212155
+ + this.coffs[7] * this.coffs[8];
212156
+ }
212120
212157
  /**
212121
212158
  * Dot product of an indexed column with a vector given as x,y,z
212122
212159
  * @param columnIndex index of column. Must be 0,1,2.
@@ -212411,7 +212448,7 @@ class Matrix3d {
212411
212448
  * \text{Treating U as a row to the left of untransposed matrix\: return row}&\rowSubXYZ{V}&=&\rowSubXYZ{U}\matrixXY{A}
212412
212449
  * \end{matrix}
212413
212450
  * ```
212414
- * @return the vector result (optional)
212451
+ * @param result the vector result (optional)
212415
212452
  */
212416
212453
  multiplyTransposeVector(vector, result) {
212417
212454
  result = result ? result : new _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d();
@@ -212425,7 +212462,7 @@ class Matrix3d {
212425
212462
  }
212426
212463
  /**
212427
212464
  * Multiply the matrix * [x,y,z], i.e. the vector [x,y,z] is a column vector on the right.
212428
- * @return the vector result (optional)
212465
+ * @param result the vector result (optional)
212429
212466
  */
212430
212467
  multiplyXYZ(x, y, z, result) {
212431
212468
  result = result ? result : new _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d();
@@ -212450,7 +212487,7 @@ class Matrix3d {
212450
212487
  }
212451
212488
  /**
212452
212489
  * Multiply the matrix * [x,y,0], i.e. the vector [x,y,0] is a column vector on the right.
212453
- * @return the vector result (optional)
212490
+ * @param result the vector result (optional)
212454
212491
  */
212455
212492
  multiplyXY(x, y, result) {
212456
212493
  result = result ? result : new _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d();
@@ -212461,7 +212498,7 @@ class Matrix3d {
212461
212498
  }
212462
212499
  /**
212463
212500
  * Compute origin + the matrix * [x,y,0].
212464
- * @return the vector result (optional)
212501
+ * @param result the Point3d result (optional)
212465
212502
  */
212466
212503
  originPlusMatrixTimesXY(origin, x, y, result) {
212467
212504
  return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(origin.x + this.coffs[0] * x + this.coffs[1] * y, origin.y + this.coffs[3] * x + this.coffs[4] * y, origin.z + this.coffs[6] * x + this.coffs[7] * y, result);
@@ -212469,7 +212506,7 @@ class Matrix3d {
212469
212506
  /**
212470
212507
  * Multiply the matrix * (x,y,z) in place, i.e. the vector (x,y,z) is a column vector on the right and
212471
212508
  * the multiplication updates the vector values.
212472
- * @param xyzData the vector data
212509
+ * @param xyzData the vector data.
212473
212510
  */
212474
212511
  multiplyVectorInPlace(xyzData) {
212475
212512
  const x = xyzData.x;
@@ -212483,7 +212520,7 @@ class Matrix3d {
212483
212520
  * Multiply the transpose matrix times [x,y,z] in place, i.e. the vector [x,y,z] is a column vector on
212484
212521
  * the right and the multiplication updates the vector values.
212485
212522
  * * This is equivalent to `multiplyTransposeVector` but always returns the result directly in the input.
212486
- * @param xyzData the vector data
212523
+ * @param vectorU the vector data
212487
212524
  */
212488
212525
  multiplyTransposeVectorInPlace(vectorU) {
212489
212526
  const x = vectorU.x;
@@ -212504,7 +212541,7 @@ class Matrix3d {
212504
212541
  * \phantom{8888}\text{and return V as a Vector3d} & & &
212505
212542
  * \end{matrix}
212506
212543
  * ````
212507
- * @return the vector result (optional)
212544
+ * @param result the vector result (optional)
212508
212545
  */
212509
212546
  multiplyTransposeXYZ(x, y, z, result) {
212510
212547
  result = result ? result : new _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d();
@@ -212515,8 +212552,8 @@ class Matrix3d {
212515
212552
  }
212516
212553
  /**
212517
212554
  * Solve `matrix * result = vector` for an unknown `result`.
212518
- * * This is equivalent to multiplication `result = inverse matrix * vector`.
212519
- * * Result is undefined if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
212555
+ * * This is equivalent to multiplication `result = matrixInverse * vector`.
212556
+ * * Result is `undefined` if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
212520
212557
  */
212521
212558
  multiplyInverse(vector, result) {
212522
212559
  this.computeCachedInverse(true);
@@ -212531,7 +212568,7 @@ class Matrix3d {
212531
212568
  /**
212532
212569
  * Solve `matrixTranspose * result = vector` for an unknown `result`.
212533
212570
  * * This is equivalent to multiplication `result = matrixInverseTranspose * vector`.
212534
- * * Result is undefined if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
212571
+ * * Result is `undefined` if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
212535
212572
  */
212536
212573
  multiplyInverseTranspose(vector, result) {
212537
212574
  this.computeCachedInverse(true);
@@ -212546,7 +212583,7 @@ class Matrix3d {
212546
212583
  /**
212547
212584
  * Multiply `matrixInverse * [x,y,z]`.
212548
212585
  * * This is equivalent to solving `matrix * result = [x,y,z]` for an unknown `result`.
212549
- * * Result is undefined if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
212586
+ * * Result is `undefined` if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
212550
212587
  * @return result as a Vector3d or undefined (if the matrix is singular).
212551
212588
  */
212552
212589
  multiplyInverseXYZAsVector3d(x, y, z, result) {
@@ -212559,7 +212596,7 @@ class Matrix3d {
212559
212596
  /**
212560
212597
  * Multiply `matrixInverse * [x,y,z]` and return result as `Point4d` with given weight.
212561
212598
  * * Equivalent to solving `matrix * result = [x,y,z]` for an unknown `result`.
212562
- * * Result is undefined if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
212599
+ * * Result is `undefined` if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
212563
212600
  * @return result as a Point4d with the same weight.
212564
212601
  */
212565
212602
  multiplyInverseXYZW(x, y, z, w, result) {
@@ -212572,7 +212609,7 @@ class Matrix3d {
212572
212609
  /**
212573
212610
  * Multiply `matrixInverse * [x,y,z]` and return result as `Point3d`.
212574
212611
  * * Equivalent to solving `matrix * result = [x,y,z]` for an unknown `result`.
212575
- * @return result as a Point3d or undefined (if the matrix is singular).
212612
+ * @return result as a Point3d or `undefined` (if the matrix is singular).
212576
212613
  */
212577
212614
  multiplyInverseXYZAsPoint3d(x, y, z, result) {
212578
212615
  this.computeCachedInverse(true);
@@ -212583,7 +212620,7 @@ class Matrix3d {
212583
212620
  }
212584
212621
  /**
212585
212622
  * Invoke a given matrix*matrix operation to compute the inverse matrix and set this.inverseCoffs
212586
- * * If either input coffA or coffB is undefined, set state to `InverseMatrixState.unknown` but
212623
+ * * If either input coffA or coffB is `undefined`, set state to `InverseMatrixState.unknown` but
212587
212624
  * leave the inverseCoffs untouched.
212588
212625
  * @param f the given matrix*matrix operation that is called by this function to compute the inverse.
212589
212626
  * `f` must be a matrix*matrix operation. Otherwise, the function does not generate the inverse properly.
@@ -212805,10 +212842,12 @@ class Matrix3d {
212805
212842
  * * [A B C] ===> [A B AxB] ===> [A (AxB)xA AxB]
212806
212843
  *
212807
212844
  * This means that in the final matrix:
212808
- * * column A is same as original column A.
212809
- * * column B is linear combination of original A and B (i.e., is in the plane of original A and B).
212810
- * * column C is perpendicular to A and B of both the original and final.
212845
+ * * first column is same as original column A.
212846
+ * * second column is linear combination of original A and B (i.e., is in the plane of original A and B).
212847
+ * * third column is perpendicular to first and second columns of both the original and final.
212811
212848
  * * original column C is overwritten and does not participate in the result.
212849
+ *
212850
+ * The final matrix will have 3 orthogonal columns.
212812
212851
  */
212813
212852
  axisOrderCrossProductsInPlace(axisOrder) {
212814
212853
  switch (axisOrder) {
@@ -212846,35 +212885,35 @@ class Matrix3d {
212846
212885
  }
212847
212886
  /**
212848
212887
  * Normalize each column in place.
212849
- * @param originalRowMagnitudes optional vector to store original column magnitudes.
212850
- * @returns Return true if all columns have non-zero lengths. Otherwise, return false.
212851
- * * If false is returned, the magnitudes are stored in the `originalRowMagnitudes` vector but no columns
212888
+ * @param originalColumnMagnitudes optional vector to store original column magnitudes.
212889
+ * @returns return true if all columns have non-zero lengths. Otherwise, return false.
212890
+ * * If false is returned, the magnitudes are stored in the `originalColumnMagnitudes` vector but no columns
212852
212891
  * are altered.
212853
212892
  */
212854
- normalizeColumnsInPlace(originalRowMagnitudes) {
212893
+ normalizeColumnsInPlace(originalColumnMagnitudes) {
212855
212894
  const ax = this.columnXMagnitude();
212856
212895
  const ay = this.columnYMagnitude();
212857
212896
  const az = this.columnZMagnitude();
212858
- if (originalRowMagnitudes)
212859
- originalRowMagnitudes.set(ax, ay, az);
212897
+ if (originalColumnMagnitudes)
212898
+ originalColumnMagnitudes.set(ax, ay, az);
212860
212899
  if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(ax) || _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(ay) || _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(az))
212861
212900
  return false;
212862
212901
  this.scaleColumns(1.0 / ax, 1.0 / ay, 1.0 / az, this);
212863
212902
  return true;
212864
212903
  }
212865
212904
  /**
212866
- * Normalize each row in place.
212867
- * @param originalColumnMagnitudes optional vector to store original row magnitudes.
212868
- * @returns Return true if all rows have non-zero lengths. Otherwise, return false.
212869
- * * If false is returned, the magnitudes are stored in the `originalColumnMagnitudes` vector but no rows
212870
- * are altered.
212871
- */
212872
- normalizeRowsInPlace(originalColumnMagnitudes) {
212905
+ * Normalize each row in place.
212906
+ * @param originalRowMagnitudes optional vector to store original row magnitudes.
212907
+ * @returns return true if all rows have non-zero lengths. Otherwise, return false.
212908
+ * * If false is returned, the magnitudes are stored in the `originalRowMagnitudes` vector but no rows
212909
+ * are altered.
212910
+ */
212911
+ normalizeRowsInPlace(originalRowMagnitudes) {
212873
212912
  const ax = this.rowXMagnitude();
212874
212913
  const ay = this.rowYMagnitude();
212875
212914
  const az = this.rowZMagnitude();
212876
- if (originalColumnMagnitudes)
212877
- originalColumnMagnitudes.set(ax, ay, az);
212915
+ if (originalRowMagnitudes)
212916
+ originalRowMagnitudes.set(ax, ay, az);
212878
212917
  if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(ax) || _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(ay) || _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(az))
212879
212918
  return false;
212880
212919
  this.scaleRows(1.0 / ax, 1.0 / ay, 1.0 / az, this);
@@ -212896,7 +212935,7 @@ class Matrix3d {
212896
212935
  * Compute the inverse of `this` Matrix3d. The inverse is stored in `this.inverseCoffs` for later use.
212897
212936
  * @param useCacheIfAvailable if `true`, use the previously computed inverse if available. If `false`,
212898
212937
  * recompute the inverse.
212899
- * @returns Return `true` if the inverse is computed. Return `false` if matrix is singular.
212938
+ * @returns return `true` if the inverse is computed. Return `false` if matrix is singular.
212900
212939
  */
212901
212940
  computeCachedInverse(useCacheIfAvailable) {
212902
212941
  if (useCacheIfAvailable && Matrix3d.useCachedInverse && this.inverseState !== InverseMatrixState.unknown) {
@@ -212909,10 +212948,11 @@ class Matrix3d {
212909
212948
  const inverseCoffs = this.inverseCoffs;
212910
212949
  /**
212911
212950
  * We calculate the inverse using cross products.
212912
- * Math details can be found at
212913
- * https://www.chilimath.com/lessons/advanced-algebra/determinant-3x3-matrix/
212914
- * In summary, if M = [A B C] then inverse of M = (1/det)[BxC CxA AxB] where det is the
212915
- * determinant of matrix M and can be calculated by "A dot BxC".
212951
+ * Math details can be found at docs/learning/matrix/Matrix.md
212952
+ * [ A ]
212953
+ * In summary, if M = [ B ] then inverse of M = (1/det)[BxC CxA AxB] where
212954
+ * [ C ]
212955
+ * det is the determinant of matrix M (which is equal to "A dot BxC").
212916
212956
  */
212917
212957
  Matrix3d.indexedRowCrossProduct(coffs, 3, 6, inverseCoffs, 0); // BxC
212918
212958
  Matrix3d.indexedRowCrossProduct(coffs, 6, 0, inverseCoffs, 1); // CxA
@@ -212954,19 +212994,30 @@ class Matrix3d {
212954
212994
  this.coffs[Matrix3d.flatIndexOf(row, column)] = value;
212955
212995
  this.inverseState = InverseMatrixState.unknown;
212956
212996
  }
212957
- /** create a Matrix3d whose columns are scaled copies of this Matrix3d.
212958
- * @param scaleX scale factor for column x
212959
- * @param scaleY scale factor for column y
212960
- * @param scaleZ scale factor for column z
212961
- * @param result optional preallocated result.
212997
+ /**
212998
+ * Create a Matrix3d whose values are uniformly scaled from `this` Matrix3d.
212999
+ * @param scale scale factor to apply.
213000
+ * @param result optional result.
213001
+ * @returns return the scaled matrix.
213002
+ */
213003
+ scale(scale, result) {
213004
+ return Matrix3d.createRowValues(this.coffs[0] * scale, this.coffs[1] * scale, this.coffs[2] * scale, this.coffs[3] * scale, this.coffs[4] * scale, this.coffs[5] * scale, this.coffs[6] * scale, this.coffs[7] * scale, this.coffs[8] * scale, result);
213005
+ }
213006
+ /**
213007
+ * Create a Matrix3d whose columns are scaled copies of `this` Matrix3d.
213008
+ * @param scaleX scale factor for column 0
213009
+ * @param scaleY scale factor for column 1
213010
+ * @param scaleZ scale factor for column 2
213011
+ * @param result optional result
212962
213012
  */
212963
213013
  scaleColumns(scaleX, scaleY, scaleZ, result) {
212964
213014
  return Matrix3d.createRowValues(this.coffs[0] * scaleX, this.coffs[1] * scaleY, this.coffs[2] * scaleZ, this.coffs[3] * scaleX, this.coffs[4] * scaleY, this.coffs[5] * scaleZ, this.coffs[6] * scaleX, this.coffs[7] * scaleY, this.coffs[8] * scaleZ, result);
212965
213015
  }
212966
- /** Scale the columns of this Matrix3d.
212967
- * @param scaleX scale factor for column x
212968
- * @param scaleY scale factor for column y
212969
- * @param scaleZ scale factor for column z
213016
+ /**
213017
+ * Scale the columns of `this` Matrix3d in place.
213018
+ * @param scaleX scale factor for column 0
213019
+ * @param scaleY scale factor for column 1
213020
+ * @param scaleZ scale factor for column 2
212970
213021
  */
212971
213022
  scaleColumnsInPlace(scaleX, scaleY, scaleZ) {
212972
213023
  this.coffs[0] *= scaleX;
@@ -212998,18 +213049,55 @@ class Matrix3d {
212998
213049
  this.inverseState = InverseMatrixState.singular;
212999
213050
  }
213000
213051
  }
213001
- /** create a Matrix3d whose rows are scaled copies of this Matrix3d.
213002
- * @param scaleX scale factor for row x
213003
- * @param scaleY scale factor for row y
213004
- * @param scaleZ scale factor for row z
213005
- * @param result optional preallocated result.
213052
+ /**
213053
+ * Create a Matrix3d whose rows are scaled copies of `this` Matrix3d.
213054
+ * @param scaleX scale factor for row 0
213055
+ * @param scaleY scale factor for row 1
213056
+ * @param scaleZ scale factor for row 2
213057
+ * @param result optional result
213006
213058
  */
213007
213059
  scaleRows(scaleX, scaleY, scaleZ, result) {
213008
213060
  return Matrix3d.createRowValues(this.coffs[0] * scaleX, this.coffs[1] * scaleX, this.coffs[2] * scaleX, this.coffs[3] * scaleY, this.coffs[4] * scaleY, this.coffs[5] * scaleY, this.coffs[6] * scaleZ, this.coffs[7] * scaleZ, this.coffs[8] * scaleZ, result);
213009
213061
  }
213010
213062
  /**
213011
- * add scaled values from other Matrix3d to this Matrix3d
213012
- * @param other Matrix3d with values to be added
213063
+ * Scale the rows of `this` Matrix3d in place.
213064
+ * @param scaleX scale factor for row 0
213065
+ * @param scaleY scale factor for row 1
213066
+ * @param scaleZ scale factor for row 2
213067
+ */
213068
+ scaleRowsInPlace(scaleX, scaleY, scaleZ) {
213069
+ this.coffs[0] *= scaleX;
213070
+ this.coffs[1] *= scaleX;
213071
+ this.coffs[2] *= scaleX;
213072
+ this.coffs[3] *= scaleY;
213073
+ this.coffs[4] *= scaleY;
213074
+ this.coffs[5] *= scaleY;
213075
+ this.coffs[6] *= scaleZ;
213076
+ this.coffs[7] *= scaleZ;
213077
+ this.coffs[8] *= scaleZ;
213078
+ if (this.inverseState === InverseMatrixState.inverseStored && this.inverseCoffs !== undefined) {
213079
+ // apply reciprocal scales to the COLUMNs of the inverse
213080
+ const divX = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(1.0, scaleX);
213081
+ const divY = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(1.0, scaleY);
213082
+ const divZ = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(1.0, scaleZ);
213083
+ if (divX !== undefined && divY !== undefined && divZ !== undefined) {
213084
+ this.inverseCoffs[0] *= divX;
213085
+ this.inverseCoffs[1] *= divY;
213086
+ this.inverseCoffs[2] *= divZ;
213087
+ this.inverseCoffs[3] *= divX;
213088
+ this.inverseCoffs[4] *= divY;
213089
+ this.inverseCoffs[5] *= divZ;
213090
+ this.inverseCoffs[6] *= divX;
213091
+ this.inverseCoffs[7] *= divY;
213092
+ this.inverseCoffs[8] *= divZ;
213093
+ }
213094
+ else
213095
+ this.inverseState = InverseMatrixState.singular;
213096
+ }
213097
+ }
213098
+ /**
213099
+ * Add scaled values from `other` Matrix3d to `this` Matrix3d.
213100
+ * @param other Matrix3d with values to be added.
213013
213101
  * @param scale scale factor to apply to the added values.
213014
213102
  */
213015
213103
  addScaledInPlace(other, scale) {
@@ -213018,18 +213106,19 @@ class Matrix3d {
213018
213106
  this.inverseState = InverseMatrixState.unknown;
213019
213107
  }
213020
213108
  /**
213021
- * add scaled values from an outer product.
213022
- * * The scaled outer product is a "rank 1" matrix.
213109
+ * Add scaled values from an outer product of vectors U and V.
213110
+ * * The scaled outer product is a matrix with `rank 1` (all columns/rows are linearly dependent).
213023
213111
  * * This is useful in constructing mirrors and directional scales.
213024
213112
  * ```
213025
213113
  * equation
213026
213114
  * A += s \columnSubXYZ{U}\rowSubXYZ{V}
213027
213115
  * \\ \matrixXY{A} += s \begin{bmatrix}
213028
- * U_x * V_x & U_y * V_x & U_z * V_x \\
213029
- * U_x * V_y & U_y * V_y & U_z * V_y \\
213030
- * U_x * V_z & U_y * V_z & U_z * V_z \end{bmatrix}
213116
+ * U_x * V_x & U_x * V_y & U_x * V_z \\
213117
+ * U_y * V_x & U_y * V_y & U_y * V_z \\
213118
+ * U_z * V_x & U_z * V_y & U_z * V_z \end{bmatrix}
213031
213119
  * ```
213032
- * @param other Matrix3d with values to be added
213120
+ * @param vectorU first vector in the outer product.
213121
+ * @param vectorV second vector in the outer product.
213033
213122
  * @param scale scale factor to apply to the added values.
213034
213123
  */
213035
213124
  addScaledOuterProductInPlace(vectorU, vectorV, scale) {
@@ -213044,14 +213133,6 @@ class Matrix3d {
213044
213133
  this.coffs[8] += scale * vectorU.z * vectorV.z;
213045
213134
  this.inverseState = InverseMatrixState.unknown;
213046
213135
  }
213047
- /** create a Matrix3d whose values are uniformly scaled from this.
213048
- * @param scale scale factor to apply.
213049
- * @param result optional preallocated result.
213050
- * @returns Return the new or repopulated matrix
213051
- */
213052
- scale(scale, result) {
213053
- return Matrix3d.createRowValues(this.coffs[0] * scale, this.coffs[1] * scale, this.coffs[2] * scale, this.coffs[3] * scale, this.coffs[4] * scale, this.coffs[5] * scale, this.coffs[6] * scale, this.coffs[7] * scale, this.coffs[8] * scale, result);
213054
- }
213055
213136
  /**
213056
213137
  * Create a rigid matrix (columns and rows are unit length and pairwise perpendicular) for
213057
213138
  * the given eye coordinate.
@@ -213074,7 +213155,6 @@ class Matrix3d {
213074
213155
  result.scaleColumnsInPlace(1.0, -1.0, -1.0);
213075
213156
  }
213076
213157
  else {
213077
- // if coordinate is (x,y,0), i.e., Front or Back or Left or Right view
213078
213158
  /**
213079
213159
  * The matrix that the "else" statement creates is
213080
213160
  * [-s -s1*c c1*c]
@@ -213104,57 +213184,56 @@ class Matrix3d {
213104
213184
  }
213105
213185
  return result;
213106
213186
  }
213107
- /** Return the determinant of this matrix. */
213187
+ /** Return the determinant of `this` matrix. */
213108
213188
  determinant() {
213109
213189
  return this.coffs[0] * this.coffs[4] * this.coffs[8]
213110
- - this.coffs[0] * this.coffs[7] * this.coffs[5]
213111
- + this.coffs[3] * this.coffs[7] * this.coffs[2]
213112
- - this.coffs[3] * this.coffs[1] * this.coffs[8]
213113
- + this.coffs[6] * this.coffs[1] * this.coffs[5]
213114
- - this.coffs[6] * this.coffs[4] * this.coffs[2];
213190
+ - this.coffs[0] * this.coffs[5] * this.coffs[7]
213191
+ - this.coffs[1] * this.coffs[3] * this.coffs[8]
213192
+ + this.coffs[1] * this.coffs[5] * this.coffs[6]
213193
+ + this.coffs[2] * this.coffs[3] * this.coffs[7]
213194
+ - this.coffs[2] * this.coffs[4] * this.coffs[6];
213115
213195
  }
213116
- /** Return an estimate of how independent the columns are. Near zero is bad. Near 1 is good
213196
+ /**
213197
+ * Return an estimate of how independent the columns of `this` matrix are. Near zero is bad (i.e.,
213198
+ * columns are almost dependent and matrix is nearly singular). Near 1 is good (i.e., columns are
213199
+ * almost independent and matrix is invertible).
213117
213200
  */
213118
213201
  conditionNumber() {
213119
213202
  const determinant = this.determinant();
213120
- const columnMagnitudeProduct = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[0], this.coffs[3], this.coffs[6])
213203
+ const columnMagnitudeSum = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[0], this.coffs[3], this.coffs[6])
213121
213204
  + _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[1], this.coffs[4], this.coffs[7])
213122
213205
  + _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[2], this.coffs[5], this.coffs[8]);
213123
- return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.safeDivideFraction(determinant, columnMagnitudeProduct, 0.0);
213206
+ return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.safeDivideFraction(determinant, columnMagnitudeSum, 0.0);
213124
213207
  }
213125
213208
  /** Return the sum of squares of all entries */
213126
213209
  sumSquares() {
213127
- let i = 0;
213128
213210
  let sum = 0;
213129
- for (i = 0; i < 9; i++)
213211
+ for (let i = 0; i < 9; i++)
213130
213212
  sum += this.coffs[i] * this.coffs[i];
213131
213213
  return sum;
213132
213214
  }
213133
213215
  /** Return the sum of squares of diagonal entries */
213134
213216
  sumDiagonalSquares() {
213135
- let i = 0;
213136
213217
  let sum = 0;
213137
- for (i = 0; i < 9; i += 4)
213218
+ for (let i = 0; i < 9; i += 4)
213138
213219
  sum += this.coffs[i] * this.coffs[i];
213139
213220
  return sum;
213140
213221
  }
213141
- /** Return the sum of diagonal entries (also known as the trace) */
213222
+ /** Return the matrix `trace` (sum of diagonal entries) */
213142
213223
  sumDiagonal() {
213143
213224
  return this.coffs[0] + this.coffs[4] + this.coffs[8];
213144
213225
  }
213145
213226
  /** Return the Maximum absolute value of any single entry */
213146
213227
  maxAbs() {
213147
- let i = 0;
213148
213228
  let max = 0;
213149
- for (i = 0; i < 9; i++)
213229
+ for (let i = 0; i < 9; i++)
213150
213230
  max = Math.max(max, Math.abs(this.coffs[i]));
213151
213231
  return max;
213152
213232
  }
213153
213233
  /** Return the maximum absolute difference between corresponding entries of `this` and `other` */
213154
213234
  maxDiff(other) {
213155
- let i = 0;
213156
213235
  let max = 0;
213157
- for (i = 0; i < 9; i++)
213236
+ for (let i = 0; i < 9; i++)
213158
213237
  max = Math.max(max, Math.abs(this.coffs[i] - other.coffs[i]));
213159
213238
  return max;
213160
213239
  }
@@ -213173,86 +213252,102 @@ class Matrix3d {
213173
213252
  get hasCachedInverse() {
213174
213253
  return this.inverseState === InverseMatrixState.inverseStored && this.inverseCoffs !== undefined;
213175
213254
  }
213176
- /** Test if the below diagonal entries are all nearly zero */
213255
+ /** Test if the below diagonal entries (3,6,7) are all nearly zero */
213177
213256
  get isUpperTriangular() {
213178
213257
  const sumAll = this.sumSquares();
213179
213258
  const sumLow = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[3], this.coffs[6], this.coffs[7]);
213180
213259
  return Math.sqrt(sumLow) <= _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallAngleRadians * (1.0 + Math.sqrt(sumAll));
213181
213260
  }
213182
- /** If the matrix is diagonal and all diagonals are within tolerance, return the first diagonal. Otherwise return undefined.
213261
+ /** Test if the above diagonal entries (1,2,5) are all nearly zero */
213262
+ get isLowerTriangular() {
213263
+ const sumAll = this.sumSquares();
213264
+ const sumLow = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[1], this.coffs[2], this.coffs[75]);
213265
+ return Math.sqrt(sumLow) <= _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallAngleRadians * (1.0 + Math.sqrt(sumAll));
213266
+ }
213267
+ /**
213268
+ * If the matrix is diagonal and all diagonals are almost equal, return the first diagonal (entry 0
213269
+ * which is same as entry 4 and 8). Otherwise return `undefined`.
213183
213270
  */
213184
213271
  sameDiagonalScale() {
213185
213272
  const sumAll = this.sumSquares();
213186
213273
  const sumDiagonal = this.sumDiagonalSquares();
213187
213274
  const sumOff = Math.abs(sumAll - sumDiagonal);
213188
213275
  if (Math.sqrt(sumOff) <= _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallAngleRadians * (1.0 + Math.sqrt(sumAll))
213189
- && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.coffs[0], this.coffs[4]) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.coffs[0], this.coffs[8]))
213276
+ && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.coffs[0], this.coffs[4])
213277
+ && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.coffs[0], this.coffs[8]))
213190
213278
  return this.coffs[0];
213191
213279
  return undefined;
213192
213280
  }
213193
- /** Sum of squared differences between symmetric pairs */
213281
+ /** Sum of squared differences between symmetric pairs (entry 1 and 3 - 2 and 6 - 5 and 7) */
213194
213282
  sumSkewSquares() {
213195
213283
  return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[1] - this.coffs[3], this.coffs[2] - this.coffs[6], this.coffs[5] - this.coffs[7]);
213196
213284
  }
213197
- /** Test if the matrix is a pure rotation.
213198
- * @param allowMirror whether to widen the test to return true if the matrix is orthogonal (a pure rotation or a mirror)
213285
+ /**
213286
+ * Test if all rows and columns are unit length and are perpendicular to each other, i.e., the matrix is either
213287
+ * a `pure rotation` (determinant is +1) or is a `mirror` (determinant is -1).
213288
+ * * **Note:** such a matrix is called `orthogonal` and its inverse is its transpose.
213289
+ */
213290
+ testPerpendicularUnitRowsAndColumns() {
213291
+ const product = this.multiplyMatrixMatrixTranspose(this);
213292
+ return product.isIdentity;
213293
+ }
213294
+ /**
213295
+ * Test if the matrix is a `rigid` matrix (or `pure rotation`, i.e., columns and rows are unit length and
213296
+ * pairwise perpendicular and determinant is +1).
213297
+ * @param allowMirror whether to widen the test to return true if the matrix is a `mirror` (determinant is -1).
213199
213298
  */
213200
213299
  isRigid(allowMirror = false) {
213201
213300
  return this.testPerpendicularUnitRowsAndColumns() && (allowMirror || this.determinant() > 0);
213202
213301
  }
213203
- /** Test if all rows and columns are perpendicular to each other and have equal length.
213204
- * If so, the length (or its negative) is the scale factor from a set of rigid axes to these axes.
213205
- * * result.rigidAxes is the rigid axes (with the scale factor removed)
213206
- * * result.scale is the scale factor
213302
+ /**
213303
+ * Test if all rows and columns are perpendicular to each other and have equal length.
213304
+ * If so, the length (or its negative) is the `scale` factor from a set of `orthonormal axes` to
213305
+ * the set of axes created by columns of `this` matrix. Otherwise, returns `undefined`.
213306
+ * @returns returns `{ rigidAxes, scale }` where `rigidAxes` is a Matrix3d with its columns as the rigid axes
213307
+ * (with the scale factor removed) and `scale` is the scale factor.
213308
+ * * Note that determinant of a rigid matrix is +1.
213309
+ * * The context for this method is to determine if the matrix is the product a `rotation` matrix and a uniform
213310
+ * `scale` matrix (diagonal matrix with all diagonal entries the same nonzero number).
213207
213311
  */
213208
213312
  factorRigidWithSignedScale() {
213209
213313
  const product = this.multiplyMatrixMatrixTranspose(this);
213210
- const ss = product.sameDiagonalScale();
213211
- if (ss === undefined || ss <= 0.0)
213314
+ const scaleSquare = product.sameDiagonalScale();
213315
+ if (scaleSquare === undefined || scaleSquare <= 0.0)
213212
213316
  return undefined;
213213
- const s = this.determinant() > 0 ? Math.sqrt(ss) : -Math.sqrt(ss);
213214
- const divS = 1.0 / s;
213215
- const result = { rigidAxes: this.scaleColumns(divS, divS, divS), scale: s };
213317
+ const scale = this.determinant() > 0 ? Math.sqrt(scaleSquare) : -Math.sqrt(scaleSquare);
213318
+ const scaleInverse = 1.0 / scale;
213319
+ const result = { rigidAxes: this.scaleColumns(scaleInverse, scaleInverse, scaleInverse), scale };
213216
213320
  return result;
213217
213321
  }
213218
- /** Test if the matrix is shuffles and negates columns. */
213322
+ /** Test if `this` matrix reorders and/or negates the columns of the `identity` matrix. */
213219
213323
  get isSignedPermutation() {
213220
213324
  let count = 0;
213221
213325
  for (let row = 0; row < 3; row++)
213222
213326
  for (let col = 0; col < 3; col++) {
213223
213327
  const q = this.at(row, col);
213224
- if (q === 0) { // This comment makes the block non-empty
213328
+ if (q === 0) {
213329
+ // do nothing
213225
213330
  }
213226
213331
  else if (q === 1 || q === -1) {
213227
- // the rest of this row and column should be 0.
213228
- // "at" will apply cyclic indexing.
213229
213332
  count++;
213230
- if (this.at(row + 1, col) !== 0)
213231
- return false;
213232
- if (this.at(row + 2, col) !== 0)
213233
- return false;
213234
- if (this.at(row, col + 1) !== 0)
213235
- return false;
213236
- if (this.at(row, col + 2) !== 0)
213333
+ // if the rest of this row and column should be 0 ("at" will apply cyclic indexing)
213334
+ if ((this.at(row + 1, col) !== 0) || (this.at(row + 2, col) !== 0) ||
213335
+ (this.at(row, col + 1) !== 0) || (this.at(row, col + 2) !== 0))
213237
213336
  return false;
213238
213337
  }
213239
- else { // entry is not from 0,1,-1 . . .
213338
+ else { // entry is not 0, 1, or -1
213240
213339
  return false;
213241
213340
  }
213242
213341
  }
213243
213342
  return count === 3;
213244
213343
  }
213245
- /** Test if all rows and columns are length 1 and are perpendicular to each other. (I.e. the matrix is either a pure rotation with uniform scale factor of 1 or -1) */
213246
- testPerpendicularUnitRowsAndColumns() {
213247
- const product = this.multiplyMatrixMatrixTranspose(this);
213248
- return product.isIdentity;
213249
- }
213250
- /** Adjust the matrix in place so that:
213251
- * * columns are perpendicular and have unit length
213252
- * * transpose equals inverse
213253
- * * mirroring is removed
213344
+ /**
213345
+ * Adjust the matrix in place to make is a `rigid` matrix so that:
213346
+ * * columns are perpendicular and have unit length.
213347
+ * * transpose equals inverse.
213348
+ * * mirroring is removed.
213254
213349
  * @param axisOrder how to reorder the matrix columns
213255
- * @return whether the instance is rigid on return
213350
+ * @return whether the adjusted matrix is `rigid` on return
213256
213351
  */
213257
213352
  makeRigid(axisOrder = _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.XYZ) {
213258
213353
  const maxAbs = this.maxAbs();
@@ -213273,22 +213368,13 @@ class Matrix3d {
213273
213368
  return result;
213274
213369
  return undefined;
213275
213370
  }
213276
- static computeQuatTerm(numerator, denomCoff, reciprocal, diagSum) {
213277
- let coff;
213278
- const diagTol = 0.500;
213279
- if (diagSum > diagTol) {
213280
- coff = Math.sqrt(diagSum) * 0.5;
213281
- if (denomCoff * numerator < 0.0)
213282
- coff = -coff;
213283
- }
213284
- else {
213285
- coff = numerator * reciprocal;
213286
- }
213287
- return coff;
213288
- }
213289
- /** create a matrix from a quaternion.
213290
- * **WARNING:** There is frequent confusion over whether a "from quaternion" matrix is organized by rows and columns.
213291
- * **WARNING:** If you find that the matrix seems to rotate by the opposite angle expect it, transpose it.
213371
+ /**
213372
+ * Create a matrix from a quaternion.
213373
+ * **WARNING:** There is frequent confusion over whether a "from quaternion" matrix is organized by
213374
+ * rows or columns. If you find that the matrix seems to rotate by the opposite angle, transpose it.
213375
+ *
213376
+ * Some math details can be found at
213377
+ * http://marc-b-reynolds.github.io/quaternions/2017/08/08/QuatRotMatrix.html
213292
213378
  */
213293
213379
  static createFromQuaternion(quat) {
213294
213380
  const qqx = quat.x * quat.x;
@@ -213301,31 +213387,57 @@ class Matrix3d {
213301
213387
  }
213302
213388
  else {
213303
213389
  const a = 1.0 / mag2;
213304
- const matrix = Matrix3d.createRowValues(a * (qqw + qqx - qqy - qqz), 2.0 * a * (quat.w * quat.z + quat.x * quat.y), 2.0 * a * (quat.x * quat.z - quat.w * quat.y), 2.0 * a * (quat.x * quat.y - quat.w * quat.z), a * (qqw - qqx + qqy - qqz), 2.0 * a * (quat.w * quat.x + quat.y * quat.z), 2.0 * a * (quat.x * quat.z + quat.w * quat.y), 2.0 * a * (quat.y * quat.z - quat.w * quat.x), a * (qqw - qqx - qqy + qqz));
213390
+ const matrix = Matrix3d.createRowValues(
213391
+ // first row
213392
+ a * (qqw + qqx - qqy - qqz), 2.0 * a * (quat.w * quat.z + quat.x * quat.y), 2.0 * a * (quat.x * quat.z - quat.w * quat.y),
213393
+ // second row
213394
+ 2.0 * a * (quat.x * quat.y - quat.w * quat.z), a * (qqw - qqx + qqy - qqz), 2.0 * a * (quat.w * quat.x + quat.y * quat.z),
213395
+ // third row
213396
+ 2.0 * a * (quat.x * quat.z + quat.w * quat.y), 2.0 * a * (quat.y * quat.z - quat.w * quat.x), a * (qqw - qqx - qqy + qqz));
213305
213397
  return matrix;
213306
213398
  }
213307
213399
  }
213308
- /** convert the matrix to a quaternion.
213309
- * @note This calculation requires the matrix to have unit length rows and columns.
213310
- * **WARNING:** There is frequent confusion over whether a "from quaternion" matrix is organized by rows and columns.
213311
- * **WARNING:** If you find that the matrix seems to rotate by the opposite angle expect it, transpose it.
213400
+ /** Calculate quaternion terms used to convert matrix to a quaternion */
213401
+ static computeQuatTerm(numerator, denomCoff, reciprocal, diagSum) {
213402
+ let coff;
213403
+ const diagTol = 0.500;
213404
+ if (diagSum > diagTol) {
213405
+ coff = 0.5 * Math.sqrt(diagSum);
213406
+ if (denomCoff * numerator < 0.0)
213407
+ coff = -coff;
213408
+ }
213409
+ else {
213410
+ coff = numerator * reciprocal;
213411
+ }
213412
+ return coff;
213413
+ }
213414
+ /**
213415
+ * Create `this` matrix to a quaternion.
213416
+ * **Note:** This calculation requires `this` matrix to have unit length rows and columns.
213417
+ * **WARNING:** There is frequent confusion over whether a "from quaternion" matrix is organized by
213418
+ * rows or columns. If you find that the matrix seems to rotate by the opposite angle, transpose it.
213419
+ *
213420
+ * Some math details can be found at
213421
+ * http://marc-b-reynolds.github.io/quaternions/2017/08/08/QuatRotMatrix.html
213312
213422
  */
213313
213423
  toQuaternion() {
213314
213424
  const result = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_4__.Point4d.createZero();
213315
- const props = [[this.coffs[0], this.coffs[3], this.coffs[6]],
213425
+ const props = [
213426
+ [this.coffs[0], this.coffs[3], this.coffs[6]],
213316
213427
  [this.coffs[1], this.coffs[4], this.coffs[7]],
213317
- [this.coffs[2], this.coffs[5], this.coffs[8]]];
213428
+ [this.coffs[2], this.coffs[5], this.coffs[8]],
213429
+ ];
213318
213430
  const xx = props[0][0];
213319
213431
  const yy = props[1][1];
213320
213432
  const zz = props[2][2];
213321
213433
  const dSum = [];
213322
- let denom, maxIndex, i;
213323
213434
  dSum[0] = 1.0 + xx - yy - zz;
213324
213435
  dSum[1] = 1.0 - xx + yy - zz;
213325
213436
  dSum[2] = 1.0 - xx - yy + zz;
213326
213437
  dSum[3] = 1.0 + xx + yy + zz;
213327
- maxIndex = 0;
213328
- for (i = 1; i < 4; i++) {
213438
+ let denom;
213439
+ let maxIndex = 0;
213440
+ for (let i = 1; i <= 3; i++) {
213329
213441
  if (dSum[i] > dSum[maxIndex])
213330
213442
  maxIndex = i;
213331
213443
  }
@@ -215275,13 +215387,10 @@ __webpack_require__.r(__webpack_exports__);
215275
215387
  /** @packageDocumentation
215276
215388
  * @module CartesianGeometry
215277
215389
  */
215278
- // cspell:word CWXY
215279
- // cspell:word arctan
215280
- // cspell:word Rodrigues
215281
215390
 
215282
215391
 
215283
215392
 
215284
- // cspell:word CCWXY
215393
+ // cspell:words CWXY CCWXY arctan Rodrigues
215285
215394
  /**
215286
215395
  * * `XYZ` is a minimal object containing x,y,z and operations that are meaningful without change in both point and vector.
215287
215396
  * * `XYZ` is not instantiable.
@@ -216020,9 +216129,9 @@ class Vector3d extends XYZ {
216020
216129
  }
216021
216130
  /**
216022
216131
  * Return a vector defined by start and end points (end - start).
216023
- * @param start start point for vector
216024
- * @param end end point for vector
216025
- * @param result optional result
216132
+ * @param start start point for vector.
216133
+ * @param end end point for vector.
216134
+ * @param result optional result.
216026
216135
  */
216027
216136
  static createStartEnd(start, end, result) {
216028
216137
  const zStart = XYZ.accessZ(start, 0.0);
@@ -216036,22 +216145,22 @@ class Vector3d extends XYZ {
216036
216145
  }
216037
216146
  /**
216038
216147
  * Return a vector (optionally in preallocated result, otherwise newly created) from [x0,y0,z0] to [x1,y1,z1]
216039
- * @param x0 start point x coordinate
216040
- * @param y0 start point y coordinate
216041
- * @param z0 start point z coordinate
216042
- * @param x1 end point x coordinate
216043
- * @param y1 end point y coordinate
216044
- * @param z1 end point z coordinate
216045
- * @param result optional result vector
216148
+ * @param x0 start point x coordinate.
216149
+ * @param y0 start point y coordinate.
216150
+ * @param z0 start point z coordinate.
216151
+ * @param x1 end point x coordinate.
216152
+ * @param y1 end point y coordinate.
216153
+ * @param z1 end point z coordinate.
216154
+ * @param result optional result vector.
216046
216155
  */
216047
216156
  static createStartEndXYZXYZ(x0, y0, z0, x1, y1, z1, result) {
216048
216157
  return this.create(x1 - x0, y1 - y0, z1 - z0, result);
216049
216158
  }
216050
216159
  /**
216051
- * Return a vector which is the input vector rotated around the axis vector.
216052
- * @param vector initial vector
216053
- * @param axis axis of rotation
216054
- * @param angle angle of rotation. If undefined, 90 degrees is implied
216160
+ * Return a vector which is the input `vector` rotated by `angle` around the `axis` vector.
216161
+ * @param vector initial vector.
216162
+ * @param axis axis of rotation.
216163
+ * @param angle angle of rotation. If undefined, 90 degrees is implied.
216055
216164
  * @param result optional result vector
216056
216165
  * @returns undefined if axis has no length.
216057
216166
  */
@@ -216075,7 +216184,7 @@ class Vector3d extends XYZ {
216075
216184
  }
216076
216185
  /**
216077
216186
  * Set (replace) xyz components so they are a vector from point0 to point1
216078
- * @param point0 start point of computed vector
216187
+ * @param point0 start point of computed vector.
216079
216188
  * @param point1 end point of computed vector.
216080
216189
  */
216081
216190
  setStartEnd(point0, point1) {
@@ -218702,15 +218811,12 @@ class PolygonOps {
218702
218811
  return numReverse;
218703
218812
  }
218704
218813
  /**
218705
- * Reverse loops as necessary to make them all have CCW orientation for given outward normal.
218706
- * * Return an array of arrays which capture the input pointers.
218707
- * * In each first level array:
218708
- * * The first loop is an outer loop.
218709
- * * all subsequent loops are holes
218710
- * * The outer loop is CCW
218711
- * * The holes are CW.
218712
- * * Call RegionOps.sortOuterAndHoleLoopsXY to have the result returned as a UnionRegion
218713
- * @param loops multiple loops to sort and reverse.
218814
+ * Reverse and reorder loops in the xy-plane for consistency and containment.
218815
+ * @param loops multiple polygons in any order and orientation, z-coordinates ignored
218816
+ * @returns array of arrays of polygons that capture the input pointers. In each first level array:
218817
+ * * The first polygon is an outer loop, oriented counterclockwise.
218818
+ * * Any subsequent polygons are holes of the outer loop, oriented clockwise.
218819
+ * @see RegionOps.sortOuterAndHoleLoopsXY
218714
218820
  */
218715
218821
  static sortOuterAndHoleLoopsXY(loops) {
218716
218822
  const loopAndArea = [];
@@ -218723,6 +218829,7 @@ class PolygonOps {
218723
218829
  * Exactly like `sortOuterAndHoleLoopsXY` but allows loops in any plane.
218724
218830
  * @param loops multiple loops to sort and reverse.
218725
218831
  * @param defaultNormal optional normal for the loops, if known
218832
+ * @see sortOuterAndHoleLoopsXY
218726
218833
  */
218727
218834
  static sortOuterAndHoleLoops(loops, defaultNormal) {
218728
218835
  const localToWorld = _FrameBuilder__WEBPACK_IMPORTED_MODULE_9__.FrameBuilder.createRightHandedFrame(defaultNormal, loops);
@@ -233541,43 +233648,44 @@ __webpack_require__.r(__webpack_exports__);
233541
233648
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
233542
233649
  /* harmony export */ "PolyfaceBuilder": () => (/* binding */ PolyfaceBuilder)
233543
233650
  /* harmony export */ });
233544
- /* harmony import */ var _curve_ConstructCurveBetweenCurves__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../curve/ConstructCurveBetweenCurves */ "../../core/geometry/lib/esm/curve/ConstructCurveBetweenCurves.js");
233651
+ /* harmony import */ var _curve_ConstructCurveBetweenCurves__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../curve/ConstructCurveBetweenCurves */ "../../core/geometry/lib/esm/curve/ConstructCurveBetweenCurves.js");
233545
233652
  /* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
233546
- /* harmony import */ var _curve_CurveFactory__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../curve/CurveFactory */ "../../core/geometry/lib/esm/curve/CurveFactory.js");
233547
- /* harmony import */ var _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../curve/CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
233548
- /* harmony import */ var _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../curve/GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
233653
+ /* harmony import */ var _curve_CurveFactory__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../curve/CurveFactory */ "../../core/geometry/lib/esm/curve/CurveFactory.js");
233654
+ /* harmony import */ var _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../curve/CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
233655
+ /* harmony import */ var _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../curve/GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
233549
233656
  /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
233550
233657
  /* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
233551
233658
  /* harmony import */ var _curve_Query_CylindricalRange__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../curve/Query/CylindricalRange */ "../../core/geometry/lib/esm/curve/Query/CylindricalRange.js");
233552
233659
  /* harmony import */ var _curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../curve/Query/StrokeCountChain */ "../../core/geometry/lib/esm/curve/Query/StrokeCountChain.js");
233553
233660
  /* harmony import */ var _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../curve/StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
233661
+ /* harmony import */ var _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../curve/UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
233554
233662
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
233555
- /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
233556
- /* harmony import */ var _geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../geometry3d/BilinearPatch */ "../../core/geometry/lib/esm/geometry3d/BilinearPatch.js");
233557
- /* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
233663
+ /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
233664
+ /* harmony import */ var _geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../geometry3d/BilinearPatch */ "../../core/geometry/lib/esm/geometry3d/BilinearPatch.js");
233665
+ /* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
233558
233666
  /* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
233559
- /* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
233667
+ /* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
233560
233668
  /* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
233561
- /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
233669
+ /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
233562
233670
  /* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
233563
- /* harmony import */ var _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndVectors */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndVectors.js");
233671
+ /* harmony import */ var _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndVectors */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndVectors.js");
233564
233672
  /* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
233565
- /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
233673
+ /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
233566
233674
  /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
233567
- /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
233675
+ /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
233568
233676
  /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
233569
233677
  /* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
233570
233678
  /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
233571
233679
  /* harmony import */ var _geometry3d_UVSurfaceOps__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry3d/UVSurfaceOps */ "../../core/geometry/lib/esm/geometry3d/UVSurfaceOps.js");
233572
- /* harmony import */ var _solid_SweepContour__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../solid/SweepContour */ "../../core/geometry/lib/esm/solid/SweepContour.js");
233573
- /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
233574
- /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
233680
+ /* harmony import */ var _solid_SweepContour__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../solid/SweepContour */ "../../core/geometry/lib/esm/solid/SweepContour.js");
233681
+ /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
233682
+ /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
233575
233683
  /* harmony import */ var _BoxTopology__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./BoxTopology */ "../../core/geometry/lib/esm/polyface/BoxTopology.js");
233576
- /* harmony import */ var _GreedyTriangulationBetweenLineStrings__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./GreedyTriangulationBetweenLineStrings */ "../../core/geometry/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js");
233577
- /* harmony import */ var _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
233578
- /* harmony import */ var _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./IndexedPolyfaceVisitor */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceVisitor.js");
233684
+ /* harmony import */ var _GreedyTriangulationBetweenLineStrings__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./GreedyTriangulationBetweenLineStrings */ "../../core/geometry/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js");
233685
+ /* harmony import */ var _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
233686
+ /* harmony import */ var _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./IndexedPolyfaceVisitor */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceVisitor.js");
233579
233687
  /* harmony import */ var _Polyface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
233580
- /* harmony import */ var _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
233688
+ /* harmony import */ var _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
233581
233689
  /*---------------------------------------------------------------------------------------------
233582
233690
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
233583
233691
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -233617,6 +233725,7 @@ __webpack_require__.r(__webpack_exports__);
233617
233725
 
233618
233726
 
233619
233727
 
233728
+
233620
233729
 
233621
233730
 
233622
233731
  /* eslint-disable @typescript-eslint/naming-convention, @typescript-eslint/prefer-for-of */
@@ -234648,7 +234757,11 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
234648
234757
  * Construct facets for any planar region
234649
234758
  */
234650
234759
  addTriangulatedRegion(region) {
234651
- const contour = _solid_SweepContour__WEBPACK_IMPORTED_MODULE_18__.SweepContour.createForLinearSweep(region);
234760
+ if (region instanceof _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_18__.UnionRegion) {
234761
+ for (const child of region.children)
234762
+ this.addTriangulatedRegion(child);
234763
+ }
234764
+ const contour = _solid_SweepContour__WEBPACK_IMPORTED_MODULE_19__.SweepContour.createForLinearSweep(region);
234652
234765
  if (contour)
234653
234766
  contour.emitFacets(this, this.reversedFlag, undefined);
234654
234767
  }
@@ -234659,7 +234772,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
234659
234772
  */
234660
234773
  applyStrokeCountsToCurvePrimitives(data) {
234661
234774
  const options = this._options;
234662
- if (data instanceof _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_19__.CurvePrimitive) {
234775
+ if (data instanceof _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_20__.CurvePrimitive) {
234663
234776
  data.computeStrokeCountForOptions(options);
234664
234777
  }
234665
234778
  else if (data instanceof _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_13__.CurveCollection) {
@@ -234675,7 +234788,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
234675
234788
  const fractions = [0.0];
234676
234789
  for (let vIndex = 1; vIndex < numVEdge; vIndex++) {
234677
234790
  const vFraction = vIndex / numVEdge;
234678
- const strokeA = _curve_ConstructCurveBetweenCurves__WEBPACK_IMPORTED_MODULE_20__.ConstructCurveBetweenCurves.interpolateBetween(stroke0, vIndex / numVEdge, stroke1);
234791
+ const strokeA = _curve_ConstructCurveBetweenCurves__WEBPACK_IMPORTED_MODULE_21__.ConstructCurveBetweenCurves.interpolateBetween(stroke0, vIndex / numVEdge, stroke1);
234679
234792
  strokeSets.push(strokeA);
234680
234793
  fractions.push(vFraction);
234681
234794
  }
@@ -234859,23 +234972,23 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
234859
234972
  // Wrap the 4 out-of-plane faces as a single parameters space with "distance" advancing in x then y then negative x then negative y ...
234860
234973
  const uParamRange = _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_14__.Segment1d.create(0, xLength);
234861
234974
  const vParamRange = _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_14__.Segment1d.create(0, zLength);
234862
- this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[0], corners[1], corners[4], corners[5]), numX, numZ, uParamRange, vParamRange);
234975
+ this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_22__.BilinearPatch.create(corners[0], corners[1], corners[4], corners[5]), numX, numZ, uParamRange, vParamRange);
234863
234976
  uParamRange.shift(xLength);
234864
- this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[1], corners[3], corners[5], corners[7]), numY, numZ, uParamRange, vParamRange);
234977
+ this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_22__.BilinearPatch.create(corners[1], corners[3], corners[5], corners[7]), numY, numZ, uParamRange, vParamRange);
234865
234978
  uParamRange.shift(yLength);
234866
- this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[3], corners[2], corners[7], corners[6]), numX, numZ, uParamRange, vParamRange);
234979
+ this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_22__.BilinearPatch.create(corners[3], corners[2], corners[7], corners[6]), numX, numZ, uParamRange, vParamRange);
234867
234980
  uParamRange.shift(xLength);
234868
- this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[2], corners[0], corners[6], corners[4]), numY, numZ, uParamRange, vParamRange);
234981
+ this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_22__.BilinearPatch.create(corners[2], corners[0], corners[6], corners[4]), numY, numZ, uParamRange, vParamRange);
234869
234982
  // finally end that wraparound face !!
234870
234983
  this.endFace();
234871
234984
  if (box.capped) {
234872
234985
  uParamRange.set(0.0, xLength);
234873
234986
  vParamRange.set(0.0, yLength);
234874
- this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[4], corners[5], corners[6], corners[7]), numX, numY, uParamRange, vParamRange);
234987
+ this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_22__.BilinearPatch.create(corners[4], corners[5], corners[6], corners[7]), numX, numY, uParamRange, vParamRange);
234875
234988
  this.endFace();
234876
234989
  uParamRange.set(0.0, xLength);
234877
234990
  vParamRange.set(0.0, yLength);
234878
- this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[2], corners[3], corners[0], corners[1]), numX, numY, uParamRange, vParamRange);
234991
+ this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_22__.BilinearPatch.create(corners[2], corners[3], corners[0], corners[1]), numX, numY, uParamRange, vParamRange);
234879
234992
  this.endFace();
234880
234993
  }
234881
234994
  }
@@ -235044,6 +235157,8 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
235044
235157
  handleLoop(g) { return this.addTriangulatedRegion(g); }
235045
235158
  /** Double dispatch handler for ParityRegion */
235046
235159
  handleParityRegion(g) { return this.addTriangulatedRegion(g); }
235160
+ /** Double dispatch handler for UnionRegion */
235161
+ handleUnionRegion(g) { return this.addTriangulatedRegion(g); }
235047
235162
  /** add facets for a GeometryQuery object. This is double dispatch through `dispatchToGeometryHandler(this)` */
235048
235163
  addGeometryQuery(g) { g.dispatchToGeometryHandler(this); }
235049
235164
  /**
@@ -235054,7 +235169,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
235054
235169
  * * Rely on the builder's compress step to find common vertex coordinates
235055
235170
  * @internal
235056
235171
  */
235057
- addGraph(graph, needParams, acceptFaceFunction = _topology_Graph__WEBPACK_IMPORTED_MODULE_22__.HalfEdge.testNodeMaskNotExterior, isEdgeVisibleFunction = _topology_Graph__WEBPACK_IMPORTED_MODULE_22__.HalfEdge.testMateMaskExterior) {
235172
+ addGraph(graph, needParams, acceptFaceFunction = _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testNodeMaskNotExterior, isEdgeVisibleFunction = _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testMateMaskExterior) {
235058
235173
  let index = 0;
235059
235174
  const needNormals = this._options.needNormals;
235060
235175
  let normalIndex = 0;
@@ -235104,7 +235219,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
235104
235219
  /** Create a polyface containing the faces of a HalfEdgeGraph, with test function to filter faces.
235105
235220
  * @internal
235106
235221
  */
235107
- static graphToPolyface(graph, options, acceptFaceFunction = _topology_Graph__WEBPACK_IMPORTED_MODULE_22__.HalfEdge.testNodeMaskNotExterior) {
235222
+ static graphToPolyface(graph, options, acceptFaceFunction = _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testNodeMaskNotExterior) {
235108
235223
  const builder = PolyfaceBuilder.create(options);
235109
235224
  builder.addGraph(graph, builder.options.needParams, acceptFaceFunction);
235110
235225
  builder.endFace();
@@ -235124,13 +235239,13 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
235124
235239
  */
235125
235240
  static polygonToTriangulatedPolyface(points, localToWorld) {
235126
235241
  if (!localToWorld)
235127
- localToWorld = _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_23__.FrameBuilder.createFrameWithCCWPolygon(points);
235242
+ localToWorld = _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_24__.FrameBuilder.createFrameWithCCWPolygon(points);
235128
235243
  if (localToWorld) {
235129
235244
  const localPoints = localToWorld.multiplyInversePoint3dArray(points);
235130
- const areaXY = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_24__.PolygonOps.areaXY(localPoints);
235245
+ const areaXY = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_25__.PolygonOps.areaXY(localPoints);
235131
235246
  if (areaXY < 0.0)
235132
235247
  localPoints.reverse();
235133
- const graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_25__.Triangulator.createTriangulatedGraphFromSingleLoop(localPoints);
235248
+ const graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_26__.Triangulator.createTriangulatedGraphFromSingleLoop(localPoints);
235134
235249
  if (graph) {
235135
235250
  const polyface = this.graphToPolyface(graph);
235136
235251
  polyface.tryTransformInPlace(localToWorld);
@@ -235173,8 +235288,8 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
235173
235288
  * @param vMap optional mapping from v fraction to parameter space (such as texture)
235174
235289
  */
235175
235290
  addUVGridBody(surface, numU, numV, uMap, vMap) {
235176
- let xyzIndex0 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_26__.GrowableFloat64Array(numU);
235177
- let xyzIndex1 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_26__.GrowableFloat64Array(numU);
235291
+ let xyzIndex0 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__.GrowableFloat64Array(numU);
235292
+ let xyzIndex1 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__.GrowableFloat64Array(numU);
235178
235293
  let paramIndex0;
235179
235294
  let paramIndex1;
235180
235295
  let normalIndex0;
@@ -235182,13 +235297,13 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
235182
235297
  const reverse = this._reversed;
235183
235298
  const needNormals = this.options.needNormals;
235184
235299
  if (needNormals) {
235185
- normalIndex0 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_26__.GrowableFloat64Array(numU);
235186
- normalIndex1 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_26__.GrowableFloat64Array(numU);
235300
+ normalIndex0 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__.GrowableFloat64Array(numU);
235301
+ normalIndex1 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__.GrowableFloat64Array(numU);
235187
235302
  }
235188
235303
  const needParams = this.options.needParams;
235189
235304
  if (needParams) {
235190
- paramIndex0 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_26__.GrowableFloat64Array(numU);
235191
- paramIndex1 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_26__.GrowableFloat64Array(numU);
235305
+ paramIndex0 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__.GrowableFloat64Array(numU);
235306
+ paramIndex1 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__.GrowableFloat64Array(numU);
235192
235307
  }
235193
235308
  let indexSwap;
235194
235309
  xyzIndex0.ensureCapacity(numU);
@@ -235197,7 +235312,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
235197
235312
  const normal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
235198
235313
  const du = 1.0 / numU;
235199
235314
  const dv = 1.0 / numV;
235200
- const plane = _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_27__.Plane3dByOriginAndVectors.createXYPlane();
235315
+ const plane = _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_28__.Plane3dByOriginAndVectors.createXYPlane();
235201
235316
  for (let v = 0; v <= numV; v++) {
235202
235317
  // evaluate new points ....
235203
235318
  xyzIndex1.clear();
@@ -235268,7 +235383,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
235268
235383
  * @param points
235269
235384
  */
235270
235385
  static pointsToTriangulatedPolyface(points) {
235271
- const graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_25__.Triangulator.createTriangulatedGraphFromPoints(points);
235386
+ const graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_26__.Triangulator.createTriangulatedGraphFromPoints(points);
235272
235387
  if (graph)
235273
235388
  return PolyfaceBuilder.graphToPolyface(graph);
235274
235389
  return undefined;
@@ -235284,13 +235399,13 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
235284
235399
  * @param pointsB points of second linestring.
235285
235400
  */
235286
235401
  addGreedyTriangulationBetweenLineStrings(pointsA, pointsB) {
235287
- const context = _GreedyTriangulationBetweenLineStrings__WEBPACK_IMPORTED_MODULE_28__.GreedyTriangulationBetweenLineStrings.createContext();
235402
+ const context = _GreedyTriangulationBetweenLineStrings__WEBPACK_IMPORTED_MODULE_29__.GreedyTriangulationBetweenLineStrings.createContext();
235288
235403
  context.emitTriangles(resolveToIndexedXYZCollectionOrCarrier(pointsA), resolveToIndexedXYZCollectionOrCarrier(pointsB), (triangle) => {
235289
235404
  this.addTriangleFacet(triangle.points);
235290
235405
  });
235291
235406
  }
235292
235407
  addMiteredPipesFromPoints(centerline, sectionData, numFacetAround = 12) {
235293
- const sections = _curve_CurveFactory__WEBPACK_IMPORTED_MODULE_29__.CurveFactory.createMiteredPipeSections(centerline, sectionData);
235408
+ const sections = _curve_CurveFactory__WEBPACK_IMPORTED_MODULE_30__.CurveFactory.createMiteredPipeSections(centerline, sectionData);
235294
235409
  const pointA0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
235295
235410
  const pointA1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
235296
235411
  const pointB0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
@@ -235322,18 +235437,18 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
235322
235437
  */
235323
235438
  addMiteredPipes(centerline, sectionData, numFacetAround = 12) {
235324
235439
  if (Array.isArray(centerline)) {
235325
- this.addMiteredPipesFromPoints(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__.Point3dArrayCarrier(centerline), sectionData, numFacetAround);
235440
+ this.addMiteredPipesFromPoints(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_31__.Point3dArrayCarrier(centerline), sectionData, numFacetAround);
235326
235441
  }
235327
235442
  else if (centerline instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__.GrowableXYZArray) {
235328
235443
  this.addMiteredPipesFromPoints(centerline, sectionData, numFacetAround);
235329
235444
  }
235330
- else if (centerline instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_31__.IndexedXYZCollection) {
235445
+ else if (centerline instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_32__.IndexedXYZCollection) {
235331
235446
  this.addMiteredPipesFromPoints(centerline, sectionData, numFacetAround);
235332
235447
  }
235333
235448
  else if (centerline instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d) {
235334
235449
  this.addMiteredPipesFromPoints(centerline.packedPoints, sectionData, numFacetAround);
235335
235450
  }
235336
- else if (centerline instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_32__.GeometryQuery) {
235451
+ else if (centerline instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_33__.GeometryQuery) {
235337
235452
  const linestring = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d.create();
235338
235453
  centerline.emitStrokes(linestring, this._options);
235339
235454
  this.addMiteredPipesFromPoints(linestring.packedPoints, sectionData, numFacetAround);
@@ -235400,10 +235515,10 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
235400
235515
  */
235401
235516
  addSweptIndexedPolyface(source, sweepVector, triangulateSides = false) {
235402
235517
  let isSimpleSweep = true;
235403
- const totalProjectedArea = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_33__.PolyfaceQuery.sumFacetAreas(source, sweepVector);
235518
+ const totalProjectedArea = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__.PolyfaceQuery.sumFacetAreas(source, sweepVector);
235404
235519
  if (_Geometry__WEBPACK_IMPORTED_MODULE_8__.Geometry.isAlmostEqualNumber(0.0, totalProjectedArea))
235405
235520
  isSimpleSweep = false;
235406
- const partitionedIndices = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_33__.PolyfaceQuery.partitionFacetIndicesByVisibilityVector(source, sweepVector, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_34__.Angle.createDegrees(1.0e-3));
235521
+ const partitionedIndices = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__.PolyfaceQuery.partitionFacetIndicesByVisibilityVector(source, sweepVector, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_35__.Angle.createDegrees(1.0e-3));
235407
235522
  const numForwardFacets = partitionedIndices[0].length;
235408
235523
  const numBackwardFacets = partitionedIndices[1].length;
235409
235524
  const numSideFacets = partitionedIndices[2].length;
@@ -235420,15 +235535,15 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
235420
235535
  // collect base edges added to the builder, and extract boundary
235421
235536
  const numBaseFacets = firstSweptFacet - firstBaseFacet;
235422
235537
  const baseFacetIndices = Array.from({ length: numBaseFacets }, (_, i) => firstBaseFacet + i);
235423
- const baseFacetVisitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_35__.IndexedPolyfaceSubsetVisitor.createSubsetVisitor(this._polyface, baseFacetIndices, 1);
235424
- const baseEdges = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_33__.PolyfaceQuery.createIndexedEdges(baseFacetVisitor);
235538
+ const baseFacetVisitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_36__.IndexedPolyfaceSubsetVisitor.createSubsetVisitor(this._polyface, baseFacetIndices, 1);
235539
+ const baseEdges = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__.PolyfaceQuery.createIndexedEdges(baseFacetVisitor);
235425
235540
  const baseBoundaryEdges = [];
235426
235541
  baseEdges.sortAndCollectClusters(undefined, baseBoundaryEdges, undefined, undefined);
235427
235542
  // add a side face per boundary edge
235428
235543
  const oldShouldTriangulate = this._options.shouldTriangulate;
235429
235544
  this._options.shouldTriangulate = triangulateSides;
235430
235545
  for (const edgeOrCluster of baseBoundaryEdges) {
235431
- if (edgeOrCluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_36__.SortableEdge)
235546
+ if (edgeOrCluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_37__.SortableEdge)
235432
235547
  this.addSweptFace(edgeOrCluster, numBaseFacets);
235433
235548
  else if (Array.isArray(edgeOrCluster))
235434
235549
  for (const edge of edgeOrCluster)
@@ -235443,7 +235558,7 @@ PolyfaceBuilder._workVectorFindOrAdd = _geometry3d_Point3dVector3d__WEBPACK_IMPO
235443
235558
  PolyfaceBuilder._workUVFindOrAdd = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_1__.Point2d.create();
235444
235559
  function resolveToIndexedXYZCollectionOrCarrier(points) {
235445
235560
  if (Array.isArray(points))
235446
- return new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__.Point3dArrayCarrier(points);
235561
+ return new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_31__.Point3dArrayCarrier(points);
235447
235562
  if (points instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d)
235448
235563
  return points.packedPoints;
235449
235564
  return points;
@@ -247559,6 +247674,7 @@ __webpack_require__.r(__webpack_exports__);
247559
247674
  /* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
247560
247675
  /* harmony import */ var _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../bspline/BSplineCurve3dH */ "../../core/geometry/lib/esm/bspline/BSplineCurve3dH.js");
247561
247676
  /* harmony import */ var _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../bspline/BSplineSurface */ "../../core/geometry/lib/esm/bspline/BSplineSurface.js");
247677
+ /* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
247562
247678
  /* harmony import */ var _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../bspline/KnotVector */ "../../core/geometry/lib/esm/bspline/KnotVector.js");
247563
247679
  /* harmony import */ var _clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../clipping/ClipPlane */ "../../core/geometry/lib/esm/clipping/ClipPlane.js");
247564
247680
  /* harmony import */ var _clipping_ConvexClipPlaneSet__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../clipping/ConvexClipPlaneSet */ "../../core/geometry/lib/esm/clipping/ConvexClipPlaneSet.js");
@@ -247573,6 +247689,8 @@ __webpack_require__.r(__webpack_exports__);
247573
247689
  /* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
247574
247690
  /* harmony import */ var _curve_Path__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../curve/Path */ "../../core/geometry/lib/esm/curve/Path.js");
247575
247691
  /* harmony import */ var _curve_PointString3d__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../curve/PointString3d */ "../../core/geometry/lib/esm/curve/PointString3d.js");
247692
+ /* harmony import */ var _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../curve/spiral/DirectSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/DirectSpiral3d.js");
247693
+ /* harmony import */ var _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../curve/spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
247576
247694
  /* harmony import */ var _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../curve/UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
247577
247695
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
247578
247696
  /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
@@ -247590,7 +247708,9 @@ __webpack_require__.r(__webpack_exports__);
247590
247708
  /* harmony import */ var _geometry4d_Map4d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../geometry4d/Map4d */ "../../core/geometry/lib/esm/geometry4d/Map4d.js");
247591
247709
  /* harmony import */ var _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry4d/Matrix4d */ "../../core/geometry/lib/esm/geometry4d/Matrix4d.js");
247592
247710
  /* harmony import */ var _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geometry4d/Point4d */ "../../core/geometry/lib/esm/geometry4d/Point4d.js");
247711
+ /* harmony import */ var _polyface_AuxData__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ../polyface/AuxData */ "../../core/geometry/lib/esm/polyface/AuxData.js");
247593
247712
  /* harmony import */ var _polyface_Polyface__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../polyface/Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
247713
+ /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
247594
247714
  /* harmony import */ var _solid_Box__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../solid/Box */ "../../core/geometry/lib/esm/solid/Box.js");
247595
247715
  /* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
247596
247716
  /* harmony import */ var _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../solid/LinearSweep */ "../../core/geometry/lib/esm/solid/LinearSweep.js");
@@ -247598,11 +247718,6 @@ __webpack_require__.r(__webpack_exports__);
247598
247718
  /* harmony import */ var _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../solid/RuledSweep */ "../../core/geometry/lib/esm/solid/RuledSweep.js");
247599
247719
  /* harmony import */ var _solid_Sphere__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../solid/Sphere */ "../../core/geometry/lib/esm/solid/Sphere.js");
247600
247720
  /* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
247601
- /* harmony import */ var _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../curve/spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
247602
- /* harmony import */ var _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../curve/spiral/DirectSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/DirectSpiral3d.js");
247603
- /* harmony import */ var _polyface_AuxData__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ../polyface/AuxData */ "../../core/geometry/lib/esm/polyface/AuxData.js");
247604
- /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
247605
- /* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
247606
247721
  /*---------------------------------------------------------------------------------------------
247607
247722
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
247608
247723
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -247727,7 +247842,7 @@ class Sample {
247727
247842
  _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createSpherical(1.0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(20), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(10)),
247728
247843
  _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createPolar(2.0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(20)),
247729
247844
  _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createSpherical(2.0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(20), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(10)),
247730
- _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(2, 3, 0)
247845
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(2, 3, 0),
247731
247846
  ];
247732
247847
  }
247733
247848
  /** Return an array with assorted Range3d samples */
@@ -247735,7 +247850,7 @@ class Sample {
247735
247850
  return [
247736
247851
  _geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range3d.createXYZXYZ(0, 0, 0, 1, 1, 1),
247737
247852
  _geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range3d.createXYZ(1, 2, 3),
247738
- _geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range3d.createXYZXYZ(-2, -3, 1, 200, 301, 8)
247853
+ _geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range3d.createXYZXYZ(-2, -3, 1, 200, 301, 8),
247739
247854
  ];
247740
247855
  }
247741
247856
  /** Create 5 points of a (axis aligned) rectangle with corners (x0,y0) and (x0+ax, y0 + ay) */
@@ -248015,10 +248130,10 @@ class Sample {
248015
248130
  _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createIdentity(),
248016
248131
  _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundVector(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(1, 0, 0), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(10)),
248017
248132
  _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundVector(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(1, -2, 5), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(-6.0)),
248018
- _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createUniformScale(2.0),
248019
248133
  _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRotationAroundVector(_geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(1, 2, 3), _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(49.0)),
248134
+ _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createUniformScale(2.0),
248020
248135
  _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createScale(1, 1, -1),
248021
- _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createScale(2, 3, 4)
248136
+ _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createScale(2, 3, 4),
248022
248137
  ];
248023
248138
  }
248024
248139
  /** Assorted invertible transforms. */
@@ -248034,8 +248149,7 @@ class Sample {
248034
248149
  /** Return an array of Matrix3d with various skew and scale. This includes at least:
248035
248150
  * * identity
248036
248151
  * * 3 distinct diagonals.
248037
- * * The distinct diagonal base with smaller value added to
248038
- * other 6 spots in succession.
248152
+ * * The distinct diagonal base with smaller value added to other 6 spots in succession.
248039
248153
  * * the distinct diagonals with all others also smaller non-zeros.
248040
248154
  */
248041
248155
  static createScaleSkewMatrix3d() {
@@ -248048,7 +248162,7 @@ class Sample {
248048
248162
  _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRowValues(5, 0, 0, 0, 6, 1, 0, 0, 7),
248049
248163
  _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRowValues(5, 0, 0, 0, 6, 0, 1, 0, 7),
248050
248164
  _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRowValues(5, 0, 0, 0, 6, 0, 0, 1, 7),
248051
- _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRowValues(5, 2, 3, 2, 6, 1, -1, 2, 7)
248165
+ _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRowValues(5, 2, 3, 2, 6, 1, -1, 2, 7),
248052
248166
  ];
248053
248167
  }
248054
248168
  /** Return an array of singular Matrix3d. This includes at least:
@@ -249753,7 +249867,7 @@ Sample.vector2d = [
249753
249867
  _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Vector2d.create(0, 0),
249754
249868
  _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Vector2d.createPolar(1.0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(20)),
249755
249869
  _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Vector2d.createPolar(2.0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(20)),
249756
- _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Vector2d.create(2, 3)
249870
+ _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Vector2d.create(2, 3),
249757
249871
  ];
249758
249872
  /** Assorted Plane3dBYOriginAndUnitNormal */
249759
249873
  Sample.plane3dByOriginAndUnitNormal = [
@@ -252871,12 +252985,12 @@ __webpack_require__.r(__webpack_exports__);
252871
252985
  /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
252872
252986
  /* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
252873
252987
  /* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
252874
- /* harmony import */ var _curve_RegionOps__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../curve/RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
252988
+ /* harmony import */ var _curve_RegionOps__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../curve/RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
252875
252989
  /* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
252876
252990
  /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
252877
252991
  /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
252878
252992
  /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
252879
- /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
252993
+ /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
252880
252994
  /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
252881
252995
  /*---------------------------------------------------------------------------------------------
252882
252996
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
@@ -253018,6 +253132,13 @@ class SweepContour {
253018
253132
  this._facets = unflippedPoly;
253019
253133
  this._facets.tryTransformInPlace(this.localToWorld);
253020
253134
  }
253135
+ else { // earcut failed (e.g., on a split washer polygon, where the bridge edge is traversed twice)
253136
+ const polyface = _curve_RegionOps__WEBPACK_IMPORTED_MODULE_7__.RegionOps.polygonXYAreaUnionLoopsToPolyface(points, [], true);
253137
+ if (polyface) {
253138
+ this._facets = polyface;
253139
+ this._facets.tryTransformInPlace(this.localToWorld);
253140
+ }
253141
+ }
253021
253142
  }
253022
253143
  }
253023
253144
  else if (this.curves instanceof _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_3__.ParityRegion) {
@@ -253037,7 +253158,7 @@ class SweepContour {
253037
253158
  const numLoops = strokes.length;
253038
253159
  /** Try the earcut algorithm first -- lots less machinery, but can't handle any form of overlap */
253039
253160
  const graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_5__.Triangulator.createTriangulatedGraphFromLoops(strokes);
253040
- if (graph && _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_7__.HalfEdgeGraphSearch.isTriangulatedCCW(graph, true, numLoops - 1)) {
253161
+ if (graph && _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_8__.HalfEdgeGraphSearch.isTriangulatedCCW(graph, true, numLoops - 1)) {
253041
253162
  _topology_Triangulation__WEBPACK_IMPORTED_MODULE_5__.Triangulator.flipTriangles(graph);
253042
253163
  const unflippedPoly = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_6__.PolyfaceBuilder.graphToPolyface(graph, options);
253043
253164
  this._facets = unflippedPoly;
@@ -253045,7 +253166,7 @@ class SweepContour {
253045
253166
  }
253046
253167
  else {
253047
253168
  // earcut failed. Restart with full merge and parity analysis.
253048
- const polyface = _curve_RegionOps__WEBPACK_IMPORTED_MODULE_8__.RegionOps.polygonXYAreaUnionLoopsToPolyface(strokes, [], true);
253169
+ const polyface = _curve_RegionOps__WEBPACK_IMPORTED_MODULE_7__.RegionOps.polygonXYAreaUnionLoopsToPolyface(strokes, [], true);
253049
253170
  if (polyface) {
253050
253171
  this._facets = polyface;
253051
253172
  this._facets.tryTransformInPlace(this.localToWorld);
@@ -255368,6 +255489,7 @@ class HalfEdgeGraphSearch {
255368
255489
  /**
255369
255490
  * Search an array of faceSeed nodes for the face with the most negative area.
255370
255491
  * @param oneCandidateNodePerFace array containing one node from each face to be considered.
255492
+ * @returns node on the minimum area face, or undefined if no such face (e.g., all faces have zero area).
255371
255493
  */
255372
255494
  static findMinimumAreaFace(oneCandidateNodePerFace, faceAreaFunction) {
255373
255495
  const summary = HalfEdgeGraphSearch.collectFaceAreaSummary(oneCandidateNodePerFace, false, faceAreaFunction);
@@ -279907,7 +280029,7 @@ class TestContext {
279907
280029
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
279908
280030
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${process.env.IMJS_URL_PREFIX ?? ""}api.bentley.com/imodels` } });
279909
280031
  await core_frontend_1.NoRenderApp.startup({
279910
- applicationVersion: "4.0.0-dev.37",
280032
+ applicationVersion: "4.0.0-dev.39",
279911
280033
  applicationId: this.settings.gprid,
279912
280034
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
279913
280035
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -299463,7 +299585,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
299463
299585
  /***/ ((module) => {
299464
299586
 
299465
299587
  "use strict";
299466
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.0-dev.37","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","build:ci":"npm run -s build && npm run -s build:esm","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","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/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 --no-eslintrc -c \\"../../tools/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -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"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core/tree/master/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.0.0-dev.37","@itwin/core-bentley":"workspace:^4.0.0-dev.37","@itwin/core-common":"workspace:^4.0.0-dev.37","@itwin/core-geometry":"workspace:^4.0.0-dev.37","@itwin/core-orbitgt":"workspace:^4.0.0-dev.37","@itwin/core-quantity":"workspace:^4.0.0-dev.37"},"//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":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/deep-assign":"^0.1.0","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@types/qs":"^6.5.0","@types/semver":"7.3.10","@types/superagent":"^4.1.14","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^7.11.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~4.4.0","webpack":"^5.64.4"},"//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/object-storage-azure":"^1.5.0","@itwin/cloud-agnostic-core":"^1.5.0","@itwin/object-storage-core":"^1.5.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","deep-assign":"^2.0.0","fuse.js":"^3.3.0","qs":"^6.5.3","semver":"^7.3.5","superagent":"^7.1.5","wms-capabilities":"0.4.0","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
299588
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.0-dev.39","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","build:ci":"npm run -s build && npm run -s build:esm","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","docs":"betools docs --includes=../../generated-docs/extract --json=../../generated-docs/core/core-frontend/file.json --tsIndexFile=./core-frontend.ts --onlyJson --excludes=webgl/**/*,**/primitives,**/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 --no-eslintrc -c \\"../../tools/eslint-plugin/dist/configs/extension-exports-config.js\\" \\"./src/**/*.ts\\" 1>&2","lint":"eslint -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"},"repository":{"type":"git","url":"https://github.com/iTwin/itwinjs-core/tree/master/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.0.0-dev.39","@itwin/core-bentley":"workspace:^4.0.0-dev.39","@itwin/core-common":"workspace:^4.0.0-dev.39","@itwin/core-geometry":"workspace:^4.0.0-dev.39","@itwin/core-orbitgt":"workspace:^4.0.0-dev.39","@itwin/core-quantity":"workspace:^4.0.0-dev.39"},"//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":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@types/chai":"4.3.1","@types/chai-as-promised":"^7","@types/deep-assign":"^0.1.0","@types/mocha":"^8.2.2","@types/node":"^18.11.5","@types/qs":"^6.5.0","@types/semver":"7.3.10","@types/superagent":"^4.1.14","@types/sinon":"^9.0.0","babel-loader":"~8.2.5","babel-plugin-istanbul":"~6.1.1","chai":"^4.1.2","chai-as-promised":"^7","cpx2":"^3.0.0","eslint":"^7.11.0","glob":"^7.1.2","mocha":"^10.0.0","nyc":"^15.1.0","rimraf":"^3.0.2","sinon":"^9.0.2","source-map-loader":"^4.0.0","typescript":"~4.4.0","webpack":"^5.64.4"},"//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/object-storage-azure":"^1.5.0","@itwin/cloud-agnostic-core":"^1.5.0","@itwin/object-storage-core":"^1.5.0","@itwin/core-i18n":"workspace:*","@itwin/core-telemetry":"workspace:*","@itwin/webgl-compatibility":"workspace:*","@loaders.gl/core":"^3.1.6","@loaders.gl/draco":"^3.1.6","deep-assign":"^2.0.0","fuse.js":"^3.3.0","qs":"^6.5.3","semver":"^7.3.5","superagent":"^7.1.5","wms-capabilities":"0.4.0","reflect-metadata":"0.1.13"},"nyc":{"extends":"./node_modules/@itwin/build-tools/.nycrc"},"eslintConfig":{"plugins":["@itwin"],"extends":"plugin:@itwin/itwinjs-recommended","rules":{"@itwin/no-internal-barrel-imports":["error",{"required-barrel-modules":["./src/tile/internal.ts"]}],"@itwin/public-extension-exports":["error",{"releaseTags":["public","preview"],"outputApiFile":false}]},"overrides":[{"files":["*.test.ts","*.test.tsx","**/test/**/*.ts"],"rules":{"@itwin/no-internal-barrel-imports":"off"}}]}}');
299467
299589
 
299468
299590
  /***/ }),
299469
299591