@itwin/ecschema-rpcinterface-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.
@@ -172639,8 +172639,8 @@ __webpack_require__.r(__webpack_exports__);
172639
172639
 
172640
172640
 
172641
172641
  /* eslint-disable @typescript-eslint/naming-convention, no-empty */
172642
- /** Enumeration of the 6 possible orderings of XYZ axis order
172643
- *
172642
+ /**
172643
+ * Enumeration of the 6 possible orderings of XYZ axis order
172644
172644
  * * **Note:** There are 3 axis order with right hand system (XYZ = 0, YZX = 1, ZXY = 2) and 3 axis order with
172645
172645
  * left hand system (XZY = 4, YXZ = 5, ZYX = 6). Note that AxisOrder is encoding the handedness as well. Cross
172646
172646
  * 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
@@ -172662,7 +172662,8 @@ var AxisOrder;
172662
172662
  /** Left handed system, Z then Y then X */
172663
172663
  AxisOrder[AxisOrder["ZYX"] = 6] = "ZYX";
172664
172664
  })(AxisOrder || (AxisOrder = {}));
172665
- /** Enumeration of numeric indices of 3 axes AxisIndex.X, AxisIndex.Y, AxisIndex.Z
172665
+ /**
172666
+ * Enumeration of numeric indices of 3 axes AxisIndex.X, AxisIndex.Y, AxisIndex.Z
172666
172667
  * @public
172667
172668
  */
172668
172669
  var AxisIndex;
@@ -172773,7 +172774,10 @@ class Geometry {
172773
172774
  static inverseMetricDistanceSquared(a) {
172774
172775
  return (Math.abs(a) <= Geometry.smallMetricDistanceSquared) ? undefined : 1.0 / a;
172775
172776
  }
172776
- /** Boolean test for metric coordinate near-equality */
172777
+ /**
172778
+ * Boolean test for metric coordinate near-equality. If tolerance is not passed, `Geometry.smallMetricDistance`
172779
+ * is used as tolerance.
172780
+ */
172777
172781
  static isSameCoordinate(x, y, tol) {
172778
172782
  if (tol)
172779
172783
  return Math.abs(x - y) < Math.abs(tol);
@@ -173210,16 +173214,37 @@ class Geometry {
173210
173214
  }
173211
173215
  /** return 0 if the value is undefined, 1 if defined. */
173212
173216
  static defined01(value) { return value === undefined ? 0 : 1; }
173213
- /** normally, return numerator/denominator.
173214
- * but if the ratio would exceed Geometry.largeFractionResult, return undefined.
173217
+ /**
173218
+ * Return `numerator` over `denominator` or `undefined`.
173219
+ * @param numerator the numerator
173220
+ * @param denominator the denominator
173221
+ * @returns return `numerator/denominator` but if the ratio would exceed `Geometry.largeFractionResult`,
173222
+ * return `undefined`.
173215
173223
  */
173216
173224
  static conditionalDivideFraction(numerator, denominator) {
173217
173225
  if (Math.abs(denominator) * Geometry.largeFractionResult > Math.abs(numerator))
173218
173226
  return numerator / denominator;
173219
173227
  return undefined;
173220
173228
  }
173221
- /** normally, return numerator/denominator.
173222
- * but if the ratio would exceed Geometry.largestResult, return undefined.
173229
+ /**
173230
+ * Return `numerator` over `denominator`.
173231
+ * @param numerator the numerator
173232
+ * @param denominator the denominator
173233
+ * @returns return `numerator/denominator` but if the ratio would exceed `Geometry.largeFractionResult`,
173234
+ * return `defaultResult`.
173235
+ */
173236
+ static safeDivideFraction(numerator, denominator, defaultResult) {
173237
+ const a = Geometry.conditionalDivideFraction(numerator, denominator);
173238
+ if (a !== undefined)
173239
+ return a;
173240
+ return defaultResult;
173241
+ }
173242
+ /**
173243
+ * Return `numerator` over `denominator` (with a given `largestResult`) or `undefined`.
173244
+ * @param numerator the numerator
173245
+ * @param denominator the denominator
173246
+ * @param largestResult the ratio threshold.
173247
+ * @returns return `numerator/denominator` but if the ratio would exceed `largestResult`, return `undefined`.
173223
173248
  */
173224
173249
  static conditionalDivideCoordinate(numerator, denominator, largestResult = Geometry.largeCoordinateResult) {
173225
173250
  if (Math.abs(denominator * largestResult) > Math.abs(numerator))
@@ -173258,15 +173283,6 @@ class Geometry {
173258
173283
  return result;
173259
173284
  }
173260
173285
  }
173261
- /** normally, return the number result of conditionalDivideFraction.
173262
- * but if conditionalDivideFraction fails return specified default number.
173263
- */
173264
- static safeDivideFraction(numerator, denominator, defaultResult) {
173265
- const a = Geometry.conditionalDivideFraction(numerator, denominator);
173266
- if (a !== undefined)
173267
- return a;
173268
- return defaultResult;
173269
- }
173270
173286
  /** 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; */
173271
173287
  static inverseInterpolate(x0, f0, x1, f1, targetF = 0, defaultResult) {
173272
173288
  const g = Geometry.conditionalDivideFraction(targetF - f0, f1 - f0);
@@ -193181,6 +193197,12 @@ class Loop extends _CurveCollection__WEBPACK_IMPORTED_MODULE_0__.CurveChain {
193181
193197
  const strokes = _LineString3d__WEBPACK_IMPORTED_MODULE_1__.LineString3d.create();
193182
193198
  for (const curve of this.children)
193183
193199
  curve.emitStrokes(strokes, options);
193200
+ // eliminate near-duplicate points between children
193201
+ strokes.removeDuplicatePoints();
193202
+ if (strokes.isPhysicallyClosed) {
193203
+ strokes.popPoint();
193204
+ strokes.addClosurePoint();
193205
+ }
193184
193206
  return Loop.create(strokes);
193185
193207
  }
193186
193208
  /** Return the boundary type (2) of a corresponding MicroStation CurveVector */
@@ -195891,15 +195913,14 @@ class RegionOps {
195891
195913
  curves.dispatchToGeometryHandler(context);
195892
195914
  }
195893
195915
  /**
195894
- * If reverse loops as necessary to make them all have CCW orientation for given outward normal.
195895
- * * Return an array of arrays which capture the input pointers.
195896
- * * In each first level array:
195897
- * * The first loop is an outer loop.
195898
- * * all subsequent loops are holes
195899
- * * The outer loop is CCW
195900
- * * The holes are CW.
195901
- * * Call PolygonOps.sortOuterAndHoleLoopsXY to have the result returned as an array of arrays of polygons.
195902
- * @param loops multiple loops to sort and reverse.
195916
+ * Reverse and reorder loops in the xy-plane for consistency and containment.
195917
+ * @param loops multiple loops in any order and orientation, z-coordinates ignored
195918
+ * @returns a region that captures the input pointers. This region is a:
195919
+ * * `Loop` if there is exactly one input loop. It is oriented counterclockwise.
195920
+ * * `ParityRegion` if input consists of exactly one outer loop with at least one hole loop.
195921
+ * Its first child is an outer loop oriented counterclockwise; all subsequent children are holes oriented clockwise.
195922
+ * * `UnionRegion` if any other input configuration. Its children are individually ordered/oriented as in the above cases.
195923
+ * @see PolygonOps.sortOuterAndHoleLoopsXY
195903
195924
  */
195904
195925
  static sortOuterAndHoleLoopsXY(loops) {
195905
195926
  const loopAndArea = [];
@@ -196261,6 +196282,8 @@ class RegionOpsFaceToFaceSearch {
196261
196282
  if (graphCheckPoint)
196262
196283
  graphCheckPoint("After regularize", graph, "MR");
196263
196284
  const exteriorHalfEdge = _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_4__.HalfEdgeGraphSearch.findMinimumAreaFace(graph);
196285
+ if (exteriorHalfEdge === undefined)
196286
+ return undefined;
196264
196287
  const exteriorMask = _topology_Graph__WEBPACK_IMPORTED_MODULE_0__.HalfEdgeMask.EXTERIOR;
196265
196288
  const faceVisitedMask = graph.grabMask();
196266
196289
  const nodeVisitedMask = graph.grabMask();
@@ -208285,7 +208308,7 @@ __webpack_require__.r(__webpack_exports__);
208285
208308
 
208286
208309
 
208287
208310
  /* eslint-disable @itwin/prefer-get */
208288
- // cSpell:words XXYZ YXYZ ZXYZ SaeedTorabi
208311
+ // cSpell:words XXYZ YXYZ ZXYZ SaeedTorabi arctan newcommand
208289
208312
  /**
208290
208313
  * PackedMatrix3dOps contains static methods for matrix operations where the matrix is a Float64Array.
208291
208314
  * * The Float64Array contains the matrix entries in row-major order
@@ -208581,7 +208604,7 @@ class Matrix3d {
208581
208604
  /**
208582
208605
  * Here we rotate this.columnX() around this.columnZ() by "angle" and expect to get other.columnX().
208583
208606
  * Then we rotate this.columnY() around this.columnZ() by the same "angle" and if we get other.columnY(),
208584
- * that means this` and `other` have X and Y columns differing only by a rotation around that Z.
208607
+ * that means `this` and `other` have X and Y columns differing only by a rotation around column Z.
208585
208608
  */
208586
208609
  let column = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.createRotateVectorAroundVector(columnX, columnZ, angle);
208587
208610
  if (other.isAlmostEqualColumnXYZ(0, column.x, column.y, column.z, tol)) {
@@ -209030,14 +209053,16 @@ class Matrix3d {
209030
209053
  static createColumnsXYW(vectorU, u, vectorV, v, vectorW, w, result) {
209031
209054
  return Matrix3d.createRowValues(vectorU.x, vectorV.x, vectorW.x, vectorU.y, vectorV.y, vectorW.y, u, v, w, result);
209032
209055
  }
209033
- /** Create a matrix from "as viewed" right and up vectors.
209034
- * * ColumnX points in the rightVector direction
209035
- * * ColumnY points in the upVector direction
209056
+ /**
209057
+ * Create a matrix from "as viewed" right and up vectors.
209058
+ * * ColumnX points in the rightVector direction.
209059
+ * * ColumnY points in the upVector direction.
209036
209060
  * * ColumnZ is a unit cross product of ColumnX and ColumnY.
209037
209061
  * * Optionally rotate by 45 degrees around `upVector` to bring its left or right vertical edge to center.
209038
209062
  * * Optionally rotate by arctan(1/sqrt(2)) ~ 35.264 degrees around `rightVector` to bring the top or bottom
209039
209063
  * horizontal edge of the view to the center (for isometric views).
209040
- * * This is expected to be used with various principal unit vectors that are perpendicular to each other.
209064
+ *
209065
+ * This is expected to be used with various principal unit vectors that are perpendicular to each other.
209041
209066
  * * STANDARD TOP VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitY(), 0, 0)
209042
209067
  * * STANDARD FRONT VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitZ(), 0, 0)
209043
209068
  * * STANDARD BACK VIEW: createViewedAxes(Vector3d.unitX(-1), Vector3d.unitZ(), 0, 0)
@@ -209526,6 +209551,18 @@ class Matrix3d {
209526
209551
  + this.coffs[3] * this.coffs[4]
209527
209552
  + this.coffs[6] * this.coffs[7];
209528
209553
  }
209554
+ /** Return the dot product of column X with column Z */
209555
+ columnXDotColumnZ() {
209556
+ return this.coffs[0] * this.coffs[2]
209557
+ + this.coffs[3] * this.coffs[5]
209558
+ + this.coffs[6] * this.coffs[8];
209559
+ }
209560
+ /** Return the dot product of column Y with column Z */
209561
+ columnYDotColumnZ() {
209562
+ return this.coffs[1] * this.coffs[2]
209563
+ + this.coffs[4] * this.coffs[5]
209564
+ + this.coffs[7] * this.coffs[8];
209565
+ }
209529
209566
  /**
209530
209567
  * Dot product of an indexed column with a vector given as x,y,z
209531
209568
  * @param columnIndex index of column. Must be 0,1,2.
@@ -209820,7 +209857,7 @@ class Matrix3d {
209820
209857
  * \text{Treating U as a row to the left of untransposed matrix\: return row}&\rowSubXYZ{V}&=&\rowSubXYZ{U}\matrixXY{A}
209821
209858
  * \end{matrix}
209822
209859
  * ```
209823
- * @return the vector result (optional)
209860
+ * @param result the vector result (optional)
209824
209861
  */
209825
209862
  multiplyTransposeVector(vector, result) {
209826
209863
  result = result ? result : new _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d();
@@ -209834,7 +209871,7 @@ class Matrix3d {
209834
209871
  }
209835
209872
  /**
209836
209873
  * Multiply the matrix * [x,y,z], i.e. the vector [x,y,z] is a column vector on the right.
209837
- * @return the vector result (optional)
209874
+ * @param result the vector result (optional)
209838
209875
  */
209839
209876
  multiplyXYZ(x, y, z, result) {
209840
209877
  result = result ? result : new _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d();
@@ -209859,7 +209896,7 @@ class Matrix3d {
209859
209896
  }
209860
209897
  /**
209861
209898
  * Multiply the matrix * [x,y,0], i.e. the vector [x,y,0] is a column vector on the right.
209862
- * @return the vector result (optional)
209899
+ * @param result the vector result (optional)
209863
209900
  */
209864
209901
  multiplyXY(x, y, result) {
209865
209902
  result = result ? result : new _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d();
@@ -209870,7 +209907,7 @@ class Matrix3d {
209870
209907
  }
209871
209908
  /**
209872
209909
  * Compute origin + the matrix * [x,y,0].
209873
- * @return the vector result (optional)
209910
+ * @param result the Point3d result (optional)
209874
209911
  */
209875
209912
  originPlusMatrixTimesXY(origin, x, y, result) {
209876
209913
  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);
@@ -209878,7 +209915,7 @@ class Matrix3d {
209878
209915
  /**
209879
209916
  * Multiply the matrix * (x,y,z) in place, i.e. the vector (x,y,z) is a column vector on the right and
209880
209917
  * the multiplication updates the vector values.
209881
- * @param xyzData the vector data
209918
+ * @param xyzData the vector data.
209882
209919
  */
209883
209920
  multiplyVectorInPlace(xyzData) {
209884
209921
  const x = xyzData.x;
@@ -209892,7 +209929,7 @@ class Matrix3d {
209892
209929
  * Multiply the transpose matrix times [x,y,z] in place, i.e. the vector [x,y,z] is a column vector on
209893
209930
  * the right and the multiplication updates the vector values.
209894
209931
  * * This is equivalent to `multiplyTransposeVector` but always returns the result directly in the input.
209895
- * @param xyzData the vector data
209932
+ * @param vectorU the vector data
209896
209933
  */
209897
209934
  multiplyTransposeVectorInPlace(vectorU) {
209898
209935
  const x = vectorU.x;
@@ -209913,7 +209950,7 @@ class Matrix3d {
209913
209950
  * \phantom{8888}\text{and return V as a Vector3d} & & &
209914
209951
  * \end{matrix}
209915
209952
  * ````
209916
- * @return the vector result (optional)
209953
+ * @param result the vector result (optional)
209917
209954
  */
209918
209955
  multiplyTransposeXYZ(x, y, z, result) {
209919
209956
  result = result ? result : new _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d();
@@ -209924,8 +209961,8 @@ class Matrix3d {
209924
209961
  }
209925
209962
  /**
209926
209963
  * Solve `matrix * result = vector` for an unknown `result`.
209927
- * * This is equivalent to multiplication `result = inverse matrix * vector`.
209928
- * * Result is undefined if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
209964
+ * * This is equivalent to multiplication `result = matrixInverse * vector`.
209965
+ * * Result is `undefined` if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
209929
209966
  */
209930
209967
  multiplyInverse(vector, result) {
209931
209968
  this.computeCachedInverse(true);
@@ -209940,7 +209977,7 @@ class Matrix3d {
209940
209977
  /**
209941
209978
  * Solve `matrixTranspose * result = vector` for an unknown `result`.
209942
209979
  * * This is equivalent to multiplication `result = matrixInverseTranspose * vector`.
209943
- * * Result is undefined if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
209980
+ * * Result is `undefined` if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
209944
209981
  */
209945
209982
  multiplyInverseTranspose(vector, result) {
209946
209983
  this.computeCachedInverse(true);
@@ -209955,7 +209992,7 @@ class Matrix3d {
209955
209992
  /**
209956
209993
  * Multiply `matrixInverse * [x,y,z]`.
209957
209994
  * * This is equivalent to solving `matrix * result = [x,y,z]` for an unknown `result`.
209958
- * * Result is undefined if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
209995
+ * * Result is `undefined` if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
209959
209996
  * @return result as a Vector3d or undefined (if the matrix is singular).
209960
209997
  */
209961
209998
  multiplyInverseXYZAsVector3d(x, y, z, result) {
@@ -209968,7 +210005,7 @@ class Matrix3d {
209968
210005
  /**
209969
210006
  * Multiply `matrixInverse * [x,y,z]` and return result as `Point4d` with given weight.
209970
210007
  * * Equivalent to solving `matrix * result = [x,y,z]` for an unknown `result`.
209971
- * * Result is undefined if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
210008
+ * * Result is `undefined` if the matrix is singular (e.g. has parallel columns or a zero magnitude column)
209972
210009
  * @return result as a Point4d with the same weight.
209973
210010
  */
209974
210011
  multiplyInverseXYZW(x, y, z, w, result) {
@@ -209981,7 +210018,7 @@ class Matrix3d {
209981
210018
  /**
209982
210019
  * Multiply `matrixInverse * [x,y,z]` and return result as `Point3d`.
209983
210020
  * * Equivalent to solving `matrix * result = [x,y,z]` for an unknown `result`.
209984
- * @return result as a Point3d or undefined (if the matrix is singular).
210021
+ * @return result as a Point3d or `undefined` (if the matrix is singular).
209985
210022
  */
209986
210023
  multiplyInverseXYZAsPoint3d(x, y, z, result) {
209987
210024
  this.computeCachedInverse(true);
@@ -209992,7 +210029,7 @@ class Matrix3d {
209992
210029
  }
209993
210030
  /**
209994
210031
  * Invoke a given matrix*matrix operation to compute the inverse matrix and set this.inverseCoffs
209995
- * * If either input coffA or coffB is undefined, set state to `InverseMatrixState.unknown` but
210032
+ * * If either input coffA or coffB is `undefined`, set state to `InverseMatrixState.unknown` but
209996
210033
  * leave the inverseCoffs untouched.
209997
210034
  * @param f the given matrix*matrix operation that is called by this function to compute the inverse.
209998
210035
  * `f` must be a matrix*matrix operation. Otherwise, the function does not generate the inverse properly.
@@ -210214,10 +210251,12 @@ class Matrix3d {
210214
210251
  * * [A B C] ===> [A B AxB] ===> [A (AxB)xA AxB]
210215
210252
  *
210216
210253
  * This means that in the final matrix:
210217
- * * column A is same as original column A.
210218
- * * column B is linear combination of original A and B (i.e., is in the plane of original A and B).
210219
- * * column C is perpendicular to A and B of both the original and final.
210254
+ * * first column is same as original column A.
210255
+ * * second column is linear combination of original A and B (i.e., is in the plane of original A and B).
210256
+ * * third column is perpendicular to first and second columns of both the original and final.
210220
210257
  * * original column C is overwritten and does not participate in the result.
210258
+ *
210259
+ * The final matrix will have 3 orthogonal columns.
210221
210260
  */
210222
210261
  axisOrderCrossProductsInPlace(axisOrder) {
210223
210262
  switch (axisOrder) {
@@ -210255,35 +210294,35 @@ class Matrix3d {
210255
210294
  }
210256
210295
  /**
210257
210296
  * Normalize each column in place.
210258
- * @param originalRowMagnitudes optional vector to store original column magnitudes.
210259
- * @returns Return true if all columns have non-zero lengths. Otherwise, return false.
210260
- * * If false is returned, the magnitudes are stored in the `originalRowMagnitudes` vector but no columns
210297
+ * @param originalColumnMagnitudes optional vector to store original column magnitudes.
210298
+ * @returns return true if all columns have non-zero lengths. Otherwise, return false.
210299
+ * * If false is returned, the magnitudes are stored in the `originalColumnMagnitudes` vector but no columns
210261
210300
  * are altered.
210262
210301
  */
210263
- normalizeColumnsInPlace(originalRowMagnitudes) {
210302
+ normalizeColumnsInPlace(originalColumnMagnitudes) {
210264
210303
  const ax = this.columnXMagnitude();
210265
210304
  const ay = this.columnYMagnitude();
210266
210305
  const az = this.columnZMagnitude();
210267
- if (originalRowMagnitudes)
210268
- originalRowMagnitudes.set(ax, ay, az);
210306
+ if (originalColumnMagnitudes)
210307
+ originalColumnMagnitudes.set(ax, ay, az);
210269
210308
  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))
210270
210309
  return false;
210271
210310
  this.scaleColumns(1.0 / ax, 1.0 / ay, 1.0 / az, this);
210272
210311
  return true;
210273
210312
  }
210274
210313
  /**
210275
- * Normalize each row in place.
210276
- * @param originalColumnMagnitudes optional vector to store original row magnitudes.
210277
- * @returns Return true if all rows have non-zero lengths. Otherwise, return false.
210278
- * * If false is returned, the magnitudes are stored in the `originalColumnMagnitudes` vector but no rows
210279
- * are altered.
210280
- */
210281
- normalizeRowsInPlace(originalColumnMagnitudes) {
210314
+ * Normalize each row in place.
210315
+ * @param originalRowMagnitudes optional vector to store original row magnitudes.
210316
+ * @returns return true if all rows have non-zero lengths. Otherwise, return false.
210317
+ * * If false is returned, the magnitudes are stored in the `originalRowMagnitudes` vector but no rows
210318
+ * are altered.
210319
+ */
210320
+ normalizeRowsInPlace(originalRowMagnitudes) {
210282
210321
  const ax = this.rowXMagnitude();
210283
210322
  const ay = this.rowYMagnitude();
210284
210323
  const az = this.rowZMagnitude();
210285
- if (originalColumnMagnitudes)
210286
- originalColumnMagnitudes.set(ax, ay, az);
210324
+ if (originalRowMagnitudes)
210325
+ originalRowMagnitudes.set(ax, ay, az);
210287
210326
  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))
210288
210327
  return false;
210289
210328
  this.scaleRows(1.0 / ax, 1.0 / ay, 1.0 / az, this);
@@ -210305,7 +210344,7 @@ class Matrix3d {
210305
210344
  * Compute the inverse of `this` Matrix3d. The inverse is stored in `this.inverseCoffs` for later use.
210306
210345
  * @param useCacheIfAvailable if `true`, use the previously computed inverse if available. If `false`,
210307
210346
  * recompute the inverse.
210308
- * @returns Return `true` if the inverse is computed. Return `false` if matrix is singular.
210347
+ * @returns return `true` if the inverse is computed. Return `false` if matrix is singular.
210309
210348
  */
210310
210349
  computeCachedInverse(useCacheIfAvailable) {
210311
210350
  if (useCacheIfAvailable && Matrix3d.useCachedInverse && this.inverseState !== InverseMatrixState.unknown) {
@@ -210318,10 +210357,11 @@ class Matrix3d {
210318
210357
  const inverseCoffs = this.inverseCoffs;
210319
210358
  /**
210320
210359
  * We calculate the inverse using cross products.
210321
- * Math details can be found at
210322
- * https://www.chilimath.com/lessons/advanced-algebra/determinant-3x3-matrix/
210323
- * In summary, if M = [A B C] then inverse of M = (1/det)[BxC CxA AxB] where det is the
210324
- * determinant of matrix M and can be calculated by "A dot BxC".
210360
+ * Math details can be found at docs/learning/matrix/Matrix.md
210361
+ * [ A ]
210362
+ * In summary, if M = [ B ] then inverse of M = (1/det)[BxC CxA AxB] where
210363
+ * [ C ]
210364
+ * det is the determinant of matrix M (which is equal to "A dot BxC").
210325
210365
  */
210326
210366
  Matrix3d.indexedRowCrossProduct(coffs, 3, 6, inverseCoffs, 0); // BxC
210327
210367
  Matrix3d.indexedRowCrossProduct(coffs, 6, 0, inverseCoffs, 1); // CxA
@@ -210363,19 +210403,30 @@ class Matrix3d {
210363
210403
  this.coffs[Matrix3d.flatIndexOf(row, column)] = value;
210364
210404
  this.inverseState = InverseMatrixState.unknown;
210365
210405
  }
210366
- /** create a Matrix3d whose columns are scaled copies of this Matrix3d.
210367
- * @param scaleX scale factor for column x
210368
- * @param scaleY scale factor for column y
210369
- * @param scaleZ scale factor for column z
210370
- * @param result optional preallocated result.
210406
+ /**
210407
+ * Create a Matrix3d whose values are uniformly scaled from `this` Matrix3d.
210408
+ * @param scale scale factor to apply.
210409
+ * @param result optional result.
210410
+ * @returns return the scaled matrix.
210411
+ */
210412
+ scale(scale, result) {
210413
+ 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);
210414
+ }
210415
+ /**
210416
+ * Create a Matrix3d whose columns are scaled copies of `this` Matrix3d.
210417
+ * @param scaleX scale factor for column 0
210418
+ * @param scaleY scale factor for column 1
210419
+ * @param scaleZ scale factor for column 2
210420
+ * @param result optional result
210371
210421
  */
210372
210422
  scaleColumns(scaleX, scaleY, scaleZ, result) {
210373
210423
  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);
210374
210424
  }
210375
- /** Scale the columns of this Matrix3d.
210376
- * @param scaleX scale factor for column x
210377
- * @param scaleY scale factor for column y
210378
- * @param scaleZ scale factor for column z
210425
+ /**
210426
+ * Scale the columns of `this` Matrix3d in place.
210427
+ * @param scaleX scale factor for column 0
210428
+ * @param scaleY scale factor for column 1
210429
+ * @param scaleZ scale factor for column 2
210379
210430
  */
210380
210431
  scaleColumnsInPlace(scaleX, scaleY, scaleZ) {
210381
210432
  this.coffs[0] *= scaleX;
@@ -210407,18 +210458,55 @@ class Matrix3d {
210407
210458
  this.inverseState = InverseMatrixState.singular;
210408
210459
  }
210409
210460
  }
210410
- /** create a Matrix3d whose rows are scaled copies of this Matrix3d.
210411
- * @param scaleX scale factor for row x
210412
- * @param scaleY scale factor for row y
210413
- * @param scaleZ scale factor for row z
210414
- * @param result optional preallocated result.
210461
+ /**
210462
+ * Create a Matrix3d whose rows are scaled copies of `this` Matrix3d.
210463
+ * @param scaleX scale factor for row 0
210464
+ * @param scaleY scale factor for row 1
210465
+ * @param scaleZ scale factor for row 2
210466
+ * @param result optional result
210415
210467
  */
210416
210468
  scaleRows(scaleX, scaleY, scaleZ, result) {
210417
210469
  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);
210418
210470
  }
210419
210471
  /**
210420
- * add scaled values from other Matrix3d to this Matrix3d
210421
- * @param other Matrix3d with values to be added
210472
+ * Scale the rows of `this` Matrix3d in place.
210473
+ * @param scaleX scale factor for row 0
210474
+ * @param scaleY scale factor for row 1
210475
+ * @param scaleZ scale factor for row 2
210476
+ */
210477
+ scaleRowsInPlace(scaleX, scaleY, scaleZ) {
210478
+ this.coffs[0] *= scaleX;
210479
+ this.coffs[1] *= scaleX;
210480
+ this.coffs[2] *= scaleX;
210481
+ this.coffs[3] *= scaleY;
210482
+ this.coffs[4] *= scaleY;
210483
+ this.coffs[5] *= scaleY;
210484
+ this.coffs[6] *= scaleZ;
210485
+ this.coffs[7] *= scaleZ;
210486
+ this.coffs[8] *= scaleZ;
210487
+ if (this.inverseState === InverseMatrixState.inverseStored && this.inverseCoffs !== undefined) {
210488
+ // apply reciprocal scales to the COLUMNs of the inverse
210489
+ const divX = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(1.0, scaleX);
210490
+ const divY = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(1.0, scaleY);
210491
+ const divZ = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(1.0, scaleZ);
210492
+ if (divX !== undefined && divY !== undefined && divZ !== undefined) {
210493
+ this.inverseCoffs[0] *= divX;
210494
+ this.inverseCoffs[1] *= divY;
210495
+ this.inverseCoffs[2] *= divZ;
210496
+ this.inverseCoffs[3] *= divX;
210497
+ this.inverseCoffs[4] *= divY;
210498
+ this.inverseCoffs[5] *= divZ;
210499
+ this.inverseCoffs[6] *= divX;
210500
+ this.inverseCoffs[7] *= divY;
210501
+ this.inverseCoffs[8] *= divZ;
210502
+ }
210503
+ else
210504
+ this.inverseState = InverseMatrixState.singular;
210505
+ }
210506
+ }
210507
+ /**
210508
+ * Add scaled values from `other` Matrix3d to `this` Matrix3d.
210509
+ * @param other Matrix3d with values to be added.
210422
210510
  * @param scale scale factor to apply to the added values.
210423
210511
  */
210424
210512
  addScaledInPlace(other, scale) {
@@ -210427,18 +210515,19 @@ class Matrix3d {
210427
210515
  this.inverseState = InverseMatrixState.unknown;
210428
210516
  }
210429
210517
  /**
210430
- * add scaled values from an outer product.
210431
- * * The scaled outer product is a "rank 1" matrix.
210518
+ * Add scaled values from an outer product of vectors U and V.
210519
+ * * The scaled outer product is a matrix with `rank 1` (all columns/rows are linearly dependent).
210432
210520
  * * This is useful in constructing mirrors and directional scales.
210433
210521
  * ```
210434
210522
  * equation
210435
210523
  * A += s \columnSubXYZ{U}\rowSubXYZ{V}
210436
210524
  * \\ \matrixXY{A} += s \begin{bmatrix}
210437
- * U_x * V_x & U_y * V_x & U_z * V_x \\
210438
- * U_x * V_y & U_y * V_y & U_z * V_y \\
210439
- * U_x * V_z & U_y * V_z & U_z * V_z \end{bmatrix}
210525
+ * U_x * V_x & U_x * V_y & U_x * V_z \\
210526
+ * U_y * V_x & U_y * V_y & U_y * V_z \\
210527
+ * U_z * V_x & U_z * V_y & U_z * V_z \end{bmatrix}
210440
210528
  * ```
210441
- * @param other Matrix3d with values to be added
210529
+ * @param vectorU first vector in the outer product.
210530
+ * @param vectorV second vector in the outer product.
210442
210531
  * @param scale scale factor to apply to the added values.
210443
210532
  */
210444
210533
  addScaledOuterProductInPlace(vectorU, vectorV, scale) {
@@ -210453,14 +210542,6 @@ class Matrix3d {
210453
210542
  this.coffs[8] += scale * vectorU.z * vectorV.z;
210454
210543
  this.inverseState = InverseMatrixState.unknown;
210455
210544
  }
210456
- /** create a Matrix3d whose values are uniformly scaled from this.
210457
- * @param scale scale factor to apply.
210458
- * @param result optional preallocated result.
210459
- * @returns Return the new or repopulated matrix
210460
- */
210461
- scale(scale, result) {
210462
- 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);
210463
- }
210464
210545
  /**
210465
210546
  * Create a rigid matrix (columns and rows are unit length and pairwise perpendicular) for
210466
210547
  * the given eye coordinate.
@@ -210483,7 +210564,6 @@ class Matrix3d {
210483
210564
  result.scaleColumnsInPlace(1.0, -1.0, -1.0);
210484
210565
  }
210485
210566
  else {
210486
- // if coordinate is (x,y,0), i.e., Front or Back or Left or Right view
210487
210567
  /**
210488
210568
  * The matrix that the "else" statement creates is
210489
210569
  * [-s -s1*c c1*c]
@@ -210513,57 +210593,56 @@ class Matrix3d {
210513
210593
  }
210514
210594
  return result;
210515
210595
  }
210516
- /** Return the determinant of this matrix. */
210596
+ /** Return the determinant of `this` matrix. */
210517
210597
  determinant() {
210518
210598
  return this.coffs[0] * this.coffs[4] * this.coffs[8]
210519
- - this.coffs[0] * this.coffs[7] * this.coffs[5]
210520
- + this.coffs[3] * this.coffs[7] * this.coffs[2]
210521
- - this.coffs[3] * this.coffs[1] * this.coffs[8]
210522
- + this.coffs[6] * this.coffs[1] * this.coffs[5]
210523
- - this.coffs[6] * this.coffs[4] * this.coffs[2];
210599
+ - this.coffs[0] * this.coffs[5] * this.coffs[7]
210600
+ - this.coffs[1] * this.coffs[3] * this.coffs[8]
210601
+ + this.coffs[1] * this.coffs[5] * this.coffs[6]
210602
+ + this.coffs[2] * this.coffs[3] * this.coffs[7]
210603
+ - this.coffs[2] * this.coffs[4] * this.coffs[6];
210524
210604
  }
210525
- /** Return an estimate of how independent the columns are. Near zero is bad. Near 1 is good
210605
+ /**
210606
+ * Return an estimate of how independent the columns of `this` matrix are. Near zero is bad (i.e.,
210607
+ * columns are almost dependent and matrix is nearly singular). Near 1 is good (i.e., columns are
210608
+ * almost independent and matrix is invertible).
210526
210609
  */
210527
210610
  conditionNumber() {
210528
210611
  const determinant = this.determinant();
210529
- const columnMagnitudeProduct = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[0], this.coffs[3], this.coffs[6])
210612
+ const columnMagnitudeSum = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[0], this.coffs[3], this.coffs[6])
210530
210613
  + _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[1], this.coffs[4], this.coffs[7])
210531
210614
  + _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[2], this.coffs[5], this.coffs[8]);
210532
- return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.safeDivideFraction(determinant, columnMagnitudeProduct, 0.0);
210615
+ return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.safeDivideFraction(determinant, columnMagnitudeSum, 0.0);
210533
210616
  }
210534
210617
  /** Return the sum of squares of all entries */
210535
210618
  sumSquares() {
210536
- let i = 0;
210537
210619
  let sum = 0;
210538
- for (i = 0; i < 9; i++)
210620
+ for (let i = 0; i < 9; i++)
210539
210621
  sum += this.coffs[i] * this.coffs[i];
210540
210622
  return sum;
210541
210623
  }
210542
210624
  /** Return the sum of squares of diagonal entries */
210543
210625
  sumDiagonalSquares() {
210544
- let i = 0;
210545
210626
  let sum = 0;
210546
- for (i = 0; i < 9; i += 4)
210627
+ for (let i = 0; i < 9; i += 4)
210547
210628
  sum += this.coffs[i] * this.coffs[i];
210548
210629
  return sum;
210549
210630
  }
210550
- /** Return the sum of diagonal entries (also known as the trace) */
210631
+ /** Return the matrix `trace` (sum of diagonal entries) */
210551
210632
  sumDiagonal() {
210552
210633
  return this.coffs[0] + this.coffs[4] + this.coffs[8];
210553
210634
  }
210554
210635
  /** Return the Maximum absolute value of any single entry */
210555
210636
  maxAbs() {
210556
- let i = 0;
210557
210637
  let max = 0;
210558
- for (i = 0; i < 9; i++)
210638
+ for (let i = 0; i < 9; i++)
210559
210639
  max = Math.max(max, Math.abs(this.coffs[i]));
210560
210640
  return max;
210561
210641
  }
210562
210642
  /** Return the maximum absolute difference between corresponding entries of `this` and `other` */
210563
210643
  maxDiff(other) {
210564
- let i = 0;
210565
210644
  let max = 0;
210566
- for (i = 0; i < 9; i++)
210645
+ for (let i = 0; i < 9; i++)
210567
210646
  max = Math.max(max, Math.abs(this.coffs[i] - other.coffs[i]));
210568
210647
  return max;
210569
210648
  }
@@ -210582,86 +210661,102 @@ class Matrix3d {
210582
210661
  get hasCachedInverse() {
210583
210662
  return this.inverseState === InverseMatrixState.inverseStored && this.inverseCoffs !== undefined;
210584
210663
  }
210585
- /** Test if the below diagonal entries are all nearly zero */
210664
+ /** Test if the below diagonal entries (3,6,7) are all nearly zero */
210586
210665
  get isUpperTriangular() {
210587
210666
  const sumAll = this.sumSquares();
210588
210667
  const sumLow = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[3], this.coffs[6], this.coffs[7]);
210589
210668
  return Math.sqrt(sumLow) <= _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallAngleRadians * (1.0 + Math.sqrt(sumAll));
210590
210669
  }
210591
- /** If the matrix is diagonal and all diagonals are within tolerance, return the first diagonal. Otherwise return undefined.
210670
+ /** Test if the above diagonal entries (1,2,5) are all nearly zero */
210671
+ get isLowerTriangular() {
210672
+ const sumAll = this.sumSquares();
210673
+ const sumLow = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[1], this.coffs[2], this.coffs[75]);
210674
+ return Math.sqrt(sumLow) <= _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallAngleRadians * (1.0 + Math.sqrt(sumAll));
210675
+ }
210676
+ /**
210677
+ * If the matrix is diagonal and all diagonals are almost equal, return the first diagonal (entry 0
210678
+ * which is same as entry 4 and 8). Otherwise return `undefined`.
210592
210679
  */
210593
210680
  sameDiagonalScale() {
210594
210681
  const sumAll = this.sumSquares();
210595
210682
  const sumDiagonal = this.sumDiagonalSquares();
210596
210683
  const sumOff = Math.abs(sumAll - sumDiagonal);
210597
210684
  if (Math.sqrt(sumOff) <= _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallAngleRadians * (1.0 + Math.sqrt(sumAll))
210598
- && _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]))
210685
+ && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.coffs[0], this.coffs[4])
210686
+ && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSameCoordinate(this.coffs[0], this.coffs[8]))
210599
210687
  return this.coffs[0];
210600
210688
  return undefined;
210601
210689
  }
210602
- /** Sum of squared differences between symmetric pairs */
210690
+ /** Sum of squared differences between symmetric pairs (entry 1 and 3 - 2 and 6 - 5 and 7) */
210603
210691
  sumSkewSquares() {
210604
210692
  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]);
210605
210693
  }
210606
- /** Test if the matrix is a pure rotation.
210607
- * @param allowMirror whether to widen the test to return true if the matrix is orthogonal (a pure rotation or a mirror)
210694
+ /**
210695
+ * Test if all rows and columns are unit length and are perpendicular to each other, i.e., the matrix is either
210696
+ * a `pure rotation` (determinant is +1) or is a `mirror` (determinant is -1).
210697
+ * * **Note:** such a matrix is called `orthogonal` and its inverse is its transpose.
210698
+ */
210699
+ testPerpendicularUnitRowsAndColumns() {
210700
+ const product = this.multiplyMatrixMatrixTranspose(this);
210701
+ return product.isIdentity;
210702
+ }
210703
+ /**
210704
+ * Test if the matrix is a `rigid` matrix (or `pure rotation`, i.e., columns and rows are unit length and
210705
+ * pairwise perpendicular and determinant is +1).
210706
+ * @param allowMirror whether to widen the test to return true if the matrix is a `mirror` (determinant is -1).
210608
210707
  */
210609
210708
  isRigid(allowMirror = false) {
210610
210709
  return this.testPerpendicularUnitRowsAndColumns() && (allowMirror || this.determinant() > 0);
210611
210710
  }
210612
- /** Test if all rows and columns are perpendicular to each other and have equal length.
210613
- * If so, the length (or its negative) is the scale factor from a set of rigid axes to these axes.
210614
- * * result.rigidAxes is the rigid axes (with the scale factor removed)
210615
- * * result.scale is the scale factor
210711
+ /**
210712
+ * Test if all rows and columns are perpendicular to each other and have equal length.
210713
+ * If so, the length (or its negative) is the `scale` factor from a set of `orthonormal axes` to
210714
+ * the set of axes created by columns of `this` matrix. Otherwise, returns `undefined`.
210715
+ * @returns returns `{ rigidAxes, scale }` where `rigidAxes` is a Matrix3d with its columns as the rigid axes
210716
+ * (with the scale factor removed) and `scale` is the scale factor.
210717
+ * * Note that determinant of a rigid matrix is +1.
210718
+ * * The context for this method is to determine if the matrix is the product a `rotation` matrix and a uniform
210719
+ * `scale` matrix (diagonal matrix with all diagonal entries the same nonzero number).
210616
210720
  */
210617
210721
  factorRigidWithSignedScale() {
210618
210722
  const product = this.multiplyMatrixMatrixTranspose(this);
210619
- const ss = product.sameDiagonalScale();
210620
- if (ss === undefined || ss <= 0.0)
210723
+ const scaleSquare = product.sameDiagonalScale();
210724
+ if (scaleSquare === undefined || scaleSquare <= 0.0)
210621
210725
  return undefined;
210622
- const s = this.determinant() > 0 ? Math.sqrt(ss) : -Math.sqrt(ss);
210623
- const divS = 1.0 / s;
210624
- const result = { rigidAxes: this.scaleColumns(divS, divS, divS), scale: s };
210726
+ const scale = this.determinant() > 0 ? Math.sqrt(scaleSquare) : -Math.sqrt(scaleSquare);
210727
+ const scaleInverse = 1.0 / scale;
210728
+ const result = { rigidAxes: this.scaleColumns(scaleInverse, scaleInverse, scaleInverse), scale };
210625
210729
  return result;
210626
210730
  }
210627
- /** Test if the matrix is shuffles and negates columns. */
210731
+ /** Test if `this` matrix reorders and/or negates the columns of the `identity` matrix. */
210628
210732
  get isSignedPermutation() {
210629
210733
  let count = 0;
210630
210734
  for (let row = 0; row < 3; row++)
210631
210735
  for (let col = 0; col < 3; col++) {
210632
210736
  const q = this.at(row, col);
210633
- if (q === 0) { // This comment makes the block non-empty
210737
+ if (q === 0) {
210738
+ // do nothing
210634
210739
  }
210635
210740
  else if (q === 1 || q === -1) {
210636
- // the rest of this row and column should be 0.
210637
- // "at" will apply cyclic indexing.
210638
210741
  count++;
210639
- if (this.at(row + 1, col) !== 0)
210640
- return false;
210641
- if (this.at(row + 2, col) !== 0)
210642
- return false;
210643
- if (this.at(row, col + 1) !== 0)
210644
- return false;
210645
- if (this.at(row, col + 2) !== 0)
210742
+ // if the rest of this row and column should be 0 ("at" will apply cyclic indexing)
210743
+ if ((this.at(row + 1, col) !== 0) || (this.at(row + 2, col) !== 0) ||
210744
+ (this.at(row, col + 1) !== 0) || (this.at(row, col + 2) !== 0))
210646
210745
  return false;
210647
210746
  }
210648
- else { // entry is not from 0,1,-1 . . .
210747
+ else { // entry is not 0, 1, or -1
210649
210748
  return false;
210650
210749
  }
210651
210750
  }
210652
210751
  return count === 3;
210653
210752
  }
210654
- /** 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) */
210655
- testPerpendicularUnitRowsAndColumns() {
210656
- const product = this.multiplyMatrixMatrixTranspose(this);
210657
- return product.isIdentity;
210658
- }
210659
- /** Adjust the matrix in place so that:
210660
- * * columns are perpendicular and have unit length
210661
- * * transpose equals inverse
210662
- * * mirroring is removed
210753
+ /**
210754
+ * Adjust the matrix in place to make is a `rigid` matrix so that:
210755
+ * * columns are perpendicular and have unit length.
210756
+ * * transpose equals inverse.
210757
+ * * mirroring is removed.
210663
210758
  * @param axisOrder how to reorder the matrix columns
210664
- * @return whether the instance is rigid on return
210759
+ * @return whether the adjusted matrix is `rigid` on return
210665
210760
  */
210666
210761
  makeRigid(axisOrder = _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.XYZ) {
210667
210762
  const maxAbs = this.maxAbs();
@@ -210682,22 +210777,13 @@ class Matrix3d {
210682
210777
  return result;
210683
210778
  return undefined;
210684
210779
  }
210685
- static computeQuatTerm(numerator, denomCoff, reciprocal, diagSum) {
210686
- let coff;
210687
- const diagTol = 0.500;
210688
- if (diagSum > diagTol) {
210689
- coff = Math.sqrt(diagSum) * 0.5;
210690
- if (denomCoff * numerator < 0.0)
210691
- coff = -coff;
210692
- }
210693
- else {
210694
- coff = numerator * reciprocal;
210695
- }
210696
- return coff;
210697
- }
210698
- /** create a matrix from a quaternion.
210699
- * **WARNING:** There is frequent confusion over whether a "from quaternion" matrix is organized by rows and columns.
210700
- * **WARNING:** If you find that the matrix seems to rotate by the opposite angle expect it, transpose it.
210780
+ /**
210781
+ * Create a matrix from a quaternion.
210782
+ * **WARNING:** There is frequent confusion over whether a "from quaternion" matrix is organized by
210783
+ * rows or columns. If you find that the matrix seems to rotate by the opposite angle, transpose it.
210784
+ *
210785
+ * Some math details can be found at
210786
+ * http://marc-b-reynolds.github.io/quaternions/2017/08/08/QuatRotMatrix.html
210701
210787
  */
210702
210788
  static createFromQuaternion(quat) {
210703
210789
  const qqx = quat.x * quat.x;
@@ -210710,31 +210796,57 @@ class Matrix3d {
210710
210796
  }
210711
210797
  else {
210712
210798
  const a = 1.0 / mag2;
210713
- 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));
210799
+ const matrix = Matrix3d.createRowValues(
210800
+ // first row
210801
+ 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),
210802
+ // second row
210803
+ 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),
210804
+ // third row
210805
+ 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));
210714
210806
  return matrix;
210715
210807
  }
210716
210808
  }
210717
- /** convert the matrix to a quaternion.
210718
- * @note This calculation requires the matrix to have unit length rows and columns.
210719
- * **WARNING:** There is frequent confusion over whether a "from quaternion" matrix is organized by rows and columns.
210720
- * **WARNING:** If you find that the matrix seems to rotate by the opposite angle expect it, transpose it.
210809
+ /** Calculate quaternion terms used to convert matrix to a quaternion */
210810
+ static computeQuatTerm(numerator, denomCoff, reciprocal, diagSum) {
210811
+ let coff;
210812
+ const diagTol = 0.500;
210813
+ if (diagSum > diagTol) {
210814
+ coff = 0.5 * Math.sqrt(diagSum);
210815
+ if (denomCoff * numerator < 0.0)
210816
+ coff = -coff;
210817
+ }
210818
+ else {
210819
+ coff = numerator * reciprocal;
210820
+ }
210821
+ return coff;
210822
+ }
210823
+ /**
210824
+ * Create `this` matrix to a quaternion.
210825
+ * **Note:** This calculation requires `this` matrix to have unit length rows and columns.
210826
+ * **WARNING:** There is frequent confusion over whether a "from quaternion" matrix is organized by
210827
+ * rows or columns. If you find that the matrix seems to rotate by the opposite angle, transpose it.
210828
+ *
210829
+ * Some math details can be found at
210830
+ * http://marc-b-reynolds.github.io/quaternions/2017/08/08/QuatRotMatrix.html
210721
210831
  */
210722
210832
  toQuaternion() {
210723
210833
  const result = _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_4__.Point4d.createZero();
210724
- const props = [[this.coffs[0], this.coffs[3], this.coffs[6]],
210834
+ const props = [
210835
+ [this.coffs[0], this.coffs[3], this.coffs[6]],
210725
210836
  [this.coffs[1], this.coffs[4], this.coffs[7]],
210726
- [this.coffs[2], this.coffs[5], this.coffs[8]]];
210837
+ [this.coffs[2], this.coffs[5], this.coffs[8]],
210838
+ ];
210727
210839
  const xx = props[0][0];
210728
210840
  const yy = props[1][1];
210729
210841
  const zz = props[2][2];
210730
210842
  const dSum = [];
210731
- let denom, maxIndex, i;
210732
210843
  dSum[0] = 1.0 + xx - yy - zz;
210733
210844
  dSum[1] = 1.0 - xx + yy - zz;
210734
210845
  dSum[2] = 1.0 - xx - yy + zz;
210735
210846
  dSum[3] = 1.0 + xx + yy + zz;
210736
- maxIndex = 0;
210737
- for (i = 1; i < 4; i++) {
210847
+ let denom;
210848
+ let maxIndex = 0;
210849
+ for (let i = 1; i <= 3; i++) {
210738
210850
  if (dSum[i] > dSum[maxIndex])
210739
210851
  maxIndex = i;
210740
210852
  }
@@ -212684,13 +212796,10 @@ __webpack_require__.r(__webpack_exports__);
212684
212796
  /** @packageDocumentation
212685
212797
  * @module CartesianGeometry
212686
212798
  */
212687
- // cspell:word CWXY
212688
- // cspell:word arctan
212689
- // cspell:word Rodrigues
212690
212799
 
212691
212800
 
212692
212801
 
212693
- // cspell:word CCWXY
212802
+ // cspell:words CWXY CCWXY arctan Rodrigues
212694
212803
  /**
212695
212804
  * * `XYZ` is a minimal object containing x,y,z and operations that are meaningful without change in both point and vector.
212696
212805
  * * `XYZ` is not instantiable.
@@ -213429,9 +213538,9 @@ class Vector3d extends XYZ {
213429
213538
  }
213430
213539
  /**
213431
213540
  * Return a vector defined by start and end points (end - start).
213432
- * @param start start point for vector
213433
- * @param end end point for vector
213434
- * @param result optional result
213541
+ * @param start start point for vector.
213542
+ * @param end end point for vector.
213543
+ * @param result optional result.
213435
213544
  */
213436
213545
  static createStartEnd(start, end, result) {
213437
213546
  const zStart = XYZ.accessZ(start, 0.0);
@@ -213445,22 +213554,22 @@ class Vector3d extends XYZ {
213445
213554
  }
213446
213555
  /**
213447
213556
  * Return a vector (optionally in preallocated result, otherwise newly created) from [x0,y0,z0] to [x1,y1,z1]
213448
- * @param x0 start point x coordinate
213449
- * @param y0 start point y coordinate
213450
- * @param z0 start point z coordinate
213451
- * @param x1 end point x coordinate
213452
- * @param y1 end point y coordinate
213453
- * @param z1 end point z coordinate
213454
- * @param result optional result vector
213557
+ * @param x0 start point x coordinate.
213558
+ * @param y0 start point y coordinate.
213559
+ * @param z0 start point z coordinate.
213560
+ * @param x1 end point x coordinate.
213561
+ * @param y1 end point y coordinate.
213562
+ * @param z1 end point z coordinate.
213563
+ * @param result optional result vector.
213455
213564
  */
213456
213565
  static createStartEndXYZXYZ(x0, y0, z0, x1, y1, z1, result) {
213457
213566
  return this.create(x1 - x0, y1 - y0, z1 - z0, result);
213458
213567
  }
213459
213568
  /**
213460
- * Return a vector which is the input vector rotated around the axis vector.
213461
- * @param vector initial vector
213462
- * @param axis axis of rotation
213463
- * @param angle angle of rotation. If undefined, 90 degrees is implied
213569
+ * Return a vector which is the input `vector` rotated by `angle` around the `axis` vector.
213570
+ * @param vector initial vector.
213571
+ * @param axis axis of rotation.
213572
+ * @param angle angle of rotation. If undefined, 90 degrees is implied.
213464
213573
  * @param result optional result vector
213465
213574
  * @returns undefined if axis has no length.
213466
213575
  */
@@ -213484,7 +213593,7 @@ class Vector3d extends XYZ {
213484
213593
  }
213485
213594
  /**
213486
213595
  * Set (replace) xyz components so they are a vector from point0 to point1
213487
- * @param point0 start point of computed vector
213596
+ * @param point0 start point of computed vector.
213488
213597
  * @param point1 end point of computed vector.
213489
213598
  */
213490
213599
  setStartEnd(point0, point1) {
@@ -216111,15 +216220,12 @@ class PolygonOps {
216111
216220
  return numReverse;
216112
216221
  }
216113
216222
  /**
216114
- * Reverse loops as necessary to make them all have CCW orientation for given outward normal.
216115
- * * Return an array of arrays which capture the input pointers.
216116
- * * In each first level array:
216117
- * * The first loop is an outer loop.
216118
- * * all subsequent loops are holes
216119
- * * The outer loop is CCW
216120
- * * The holes are CW.
216121
- * * Call RegionOps.sortOuterAndHoleLoopsXY to have the result returned as a UnionRegion
216122
- * @param loops multiple loops to sort and reverse.
216223
+ * Reverse and reorder loops in the xy-plane for consistency and containment.
216224
+ * @param loops multiple polygons in any order and orientation, z-coordinates ignored
216225
+ * @returns array of arrays of polygons that capture the input pointers. In each first level array:
216226
+ * * The first polygon is an outer loop, oriented counterclockwise.
216227
+ * * Any subsequent polygons are holes of the outer loop, oriented clockwise.
216228
+ * @see RegionOps.sortOuterAndHoleLoopsXY
216123
216229
  */
216124
216230
  static sortOuterAndHoleLoopsXY(loops) {
216125
216231
  const loopAndArea = [];
@@ -216132,6 +216238,7 @@ class PolygonOps {
216132
216238
  * Exactly like `sortOuterAndHoleLoopsXY` but allows loops in any plane.
216133
216239
  * @param loops multiple loops to sort and reverse.
216134
216240
  * @param defaultNormal optional normal for the loops, if known
216241
+ * @see sortOuterAndHoleLoopsXY
216135
216242
  */
216136
216243
  static sortOuterAndHoleLoops(loops, defaultNormal) {
216137
216244
  const localToWorld = _FrameBuilder__WEBPACK_IMPORTED_MODULE_9__.FrameBuilder.createRightHandedFrame(defaultNormal, loops);
@@ -230950,43 +231057,44 @@ __webpack_require__.r(__webpack_exports__);
230950
231057
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
230951
231058
  /* harmony export */ "PolyfaceBuilder": () => (/* binding */ PolyfaceBuilder)
230952
231059
  /* harmony export */ });
230953
- /* harmony import */ var _curve_ConstructCurveBetweenCurves__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../curve/ConstructCurveBetweenCurves */ "../../core/geometry/lib/esm/curve/ConstructCurveBetweenCurves.js");
231060
+ /* harmony import */ var _curve_ConstructCurveBetweenCurves__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../curve/ConstructCurveBetweenCurves */ "../../core/geometry/lib/esm/curve/ConstructCurveBetweenCurves.js");
230954
231061
  /* harmony import */ var _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../curve/CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
230955
- /* harmony import */ var _curve_CurveFactory__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../curve/CurveFactory */ "../../core/geometry/lib/esm/curve/CurveFactory.js");
230956
- /* harmony import */ var _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../curve/CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
230957
- /* harmony import */ var _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../curve/GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
231062
+ /* harmony import */ var _curve_CurveFactory__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../curve/CurveFactory */ "../../core/geometry/lib/esm/curve/CurveFactory.js");
231063
+ /* harmony import */ var _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ../curve/CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
231064
+ /* harmony import */ var _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../curve/GeometryQuery */ "../../core/geometry/lib/esm/curve/GeometryQuery.js");
230958
231065
  /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
230959
231066
  /* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
230960
231067
  /* harmony import */ var _curve_Query_CylindricalRange__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../curve/Query/CylindricalRange */ "../../core/geometry/lib/esm/curve/Query/CylindricalRange.js");
230961
231068
  /* harmony import */ var _curve_Query_StrokeCountChain__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ../curve/Query/StrokeCountChain */ "../../core/geometry/lib/esm/curve/Query/StrokeCountChain.js");
230962
231069
  /* harmony import */ var _curve_StrokeOptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../curve/StrokeOptions */ "../../core/geometry/lib/esm/curve/StrokeOptions.js");
231070
+ /* harmony import */ var _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../curve/UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
230963
231071
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
230964
- /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
230965
- /* harmony import */ var _geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../geometry3d/BilinearPatch */ "../../core/geometry/lib/esm/geometry3d/BilinearPatch.js");
230966
- /* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
231072
+ /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
231073
+ /* harmony import */ var _geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../geometry3d/BilinearPatch */ "../../core/geometry/lib/esm/geometry3d/BilinearPatch.js");
231074
+ /* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
230967
231075
  /* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
230968
- /* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
231076
+ /* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
230969
231077
  /* harmony import */ var _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geometry3d/GrowableXYZArray */ "../../core/geometry/lib/esm/geometry3d/GrowableXYZArray.js");
230970
- /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
231078
+ /* harmony import */ var _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../geometry3d/IndexedXYZCollection */ "../../core/geometry/lib/esm/geometry3d/IndexedXYZCollection.js");
230971
231079
  /* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
230972
- /* harmony import */ var _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndVectors */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndVectors.js");
231080
+ /* harmony import */ var _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../geometry3d/Plane3dByOriginAndVectors */ "../../core/geometry/lib/esm/geometry3d/Plane3dByOriginAndVectors.js");
230973
231081
  /* harmony import */ var _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../geometry3d/Point2dVector2d */ "../../core/geometry/lib/esm/geometry3d/Point2dVector2d.js");
230974
- /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
231082
+ /* harmony import */ var _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ../geometry3d/Point3dArrayCarrier */ "../../core/geometry/lib/esm/geometry3d/Point3dArrayCarrier.js");
230975
231083
  /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
230976
- /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
231084
+ /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
230977
231085
  /* harmony import */ var _geometry3d_Range__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../geometry3d/Range */ "../../core/geometry/lib/esm/geometry3d/Range.js");
230978
231086
  /* harmony import */ var _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../geometry3d/Segment1d */ "../../core/geometry/lib/esm/geometry3d/Segment1d.js");
230979
231087
  /* harmony import */ var _geometry3d_Transform__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/Transform */ "../../core/geometry/lib/esm/geometry3d/Transform.js");
230980
231088
  /* harmony import */ var _geometry3d_UVSurfaceOps__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ../geometry3d/UVSurfaceOps */ "../../core/geometry/lib/esm/geometry3d/UVSurfaceOps.js");
230981
- /* harmony import */ var _solid_SweepContour__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../solid/SweepContour */ "../../core/geometry/lib/esm/solid/SweepContour.js");
230982
- /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
230983
- /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
231089
+ /* harmony import */ var _solid_SweepContour__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ../solid/SweepContour */ "../../core/geometry/lib/esm/solid/SweepContour.js");
231090
+ /* harmony import */ var _topology_Graph__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ../topology/Graph */ "../../core/geometry/lib/esm/topology/Graph.js");
231091
+ /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
230984
231092
  /* harmony import */ var _BoxTopology__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./BoxTopology */ "../../core/geometry/lib/esm/polyface/BoxTopology.js");
230985
- /* harmony import */ var _GreedyTriangulationBetweenLineStrings__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./GreedyTriangulationBetweenLineStrings */ "../../core/geometry/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js");
230986
- /* harmony import */ var _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
230987
- /* harmony import */ var _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./IndexedPolyfaceVisitor */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceVisitor.js");
231093
+ /* harmony import */ var _GreedyTriangulationBetweenLineStrings__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./GreedyTriangulationBetweenLineStrings */ "../../core/geometry/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js");
231094
+ /* harmony import */ var _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./IndexedEdgeMatcher */ "../../core/geometry/lib/esm/polyface/IndexedEdgeMatcher.js");
231095
+ /* harmony import */ var _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./IndexedPolyfaceVisitor */ "../../core/geometry/lib/esm/polyface/IndexedPolyfaceVisitor.js");
230988
231096
  /* harmony import */ var _Polyface__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
230989
- /* harmony import */ var _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
231097
+ /* harmony import */ var _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./PolyfaceQuery */ "../../core/geometry/lib/esm/polyface/PolyfaceQuery.js");
230990
231098
  /*---------------------------------------------------------------------------------------------
230991
231099
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
230992
231100
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -231026,6 +231134,7 @@ __webpack_require__.r(__webpack_exports__);
231026
231134
 
231027
231135
 
231028
231136
 
231137
+
231029
231138
 
231030
231139
 
231031
231140
  /* eslint-disable @typescript-eslint/naming-convention, @typescript-eslint/prefer-for-of */
@@ -232057,7 +232166,11 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232057
232166
  * Construct facets for any planar region
232058
232167
  */
232059
232168
  addTriangulatedRegion(region) {
232060
- const contour = _solid_SweepContour__WEBPACK_IMPORTED_MODULE_18__.SweepContour.createForLinearSweep(region);
232169
+ if (region instanceof _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_18__.UnionRegion) {
232170
+ for (const child of region.children)
232171
+ this.addTriangulatedRegion(child);
232172
+ }
232173
+ const contour = _solid_SweepContour__WEBPACK_IMPORTED_MODULE_19__.SweepContour.createForLinearSweep(region);
232061
232174
  if (contour)
232062
232175
  contour.emitFacets(this, this.reversedFlag, undefined);
232063
232176
  }
@@ -232068,7 +232181,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232068
232181
  */
232069
232182
  applyStrokeCountsToCurvePrimitives(data) {
232070
232183
  const options = this._options;
232071
- if (data instanceof _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_19__.CurvePrimitive) {
232184
+ if (data instanceof _curve_CurvePrimitive__WEBPACK_IMPORTED_MODULE_20__.CurvePrimitive) {
232072
232185
  data.computeStrokeCountForOptions(options);
232073
232186
  }
232074
232187
  else if (data instanceof _curve_CurveCollection__WEBPACK_IMPORTED_MODULE_13__.CurveCollection) {
@@ -232084,7 +232197,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232084
232197
  const fractions = [0.0];
232085
232198
  for (let vIndex = 1; vIndex < numVEdge; vIndex++) {
232086
232199
  const vFraction = vIndex / numVEdge;
232087
- const strokeA = _curve_ConstructCurveBetweenCurves__WEBPACK_IMPORTED_MODULE_20__.ConstructCurveBetweenCurves.interpolateBetween(stroke0, vIndex / numVEdge, stroke1);
232200
+ const strokeA = _curve_ConstructCurveBetweenCurves__WEBPACK_IMPORTED_MODULE_21__.ConstructCurveBetweenCurves.interpolateBetween(stroke0, vIndex / numVEdge, stroke1);
232088
232201
  strokeSets.push(strokeA);
232089
232202
  fractions.push(vFraction);
232090
232203
  }
@@ -232268,23 +232381,23 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232268
232381
  // 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 ...
232269
232382
  const uParamRange = _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_14__.Segment1d.create(0, xLength);
232270
232383
  const vParamRange = _geometry3d_Segment1d__WEBPACK_IMPORTED_MODULE_14__.Segment1d.create(0, zLength);
232271
- this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[0], corners[1], corners[4], corners[5]), numX, numZ, uParamRange, vParamRange);
232384
+ this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_22__.BilinearPatch.create(corners[0], corners[1], corners[4], corners[5]), numX, numZ, uParamRange, vParamRange);
232272
232385
  uParamRange.shift(xLength);
232273
- this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[1], corners[3], corners[5], corners[7]), numY, numZ, uParamRange, vParamRange);
232386
+ this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_22__.BilinearPatch.create(corners[1], corners[3], corners[5], corners[7]), numY, numZ, uParamRange, vParamRange);
232274
232387
  uParamRange.shift(yLength);
232275
- this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[3], corners[2], corners[7], corners[6]), numX, numZ, uParamRange, vParamRange);
232388
+ this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_22__.BilinearPatch.create(corners[3], corners[2], corners[7], corners[6]), numX, numZ, uParamRange, vParamRange);
232276
232389
  uParamRange.shift(xLength);
232277
- this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[2], corners[0], corners[6], corners[4]), numY, numZ, uParamRange, vParamRange);
232390
+ this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_22__.BilinearPatch.create(corners[2], corners[0], corners[6], corners[4]), numY, numZ, uParamRange, vParamRange);
232278
232391
  // finally end that wraparound face !!
232279
232392
  this.endFace();
232280
232393
  if (box.capped) {
232281
232394
  uParamRange.set(0.0, xLength);
232282
232395
  vParamRange.set(0.0, yLength);
232283
- this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[4], corners[5], corners[6], corners[7]), numX, numY, uParamRange, vParamRange);
232396
+ this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_22__.BilinearPatch.create(corners[4], corners[5], corners[6], corners[7]), numX, numY, uParamRange, vParamRange);
232284
232397
  this.endFace();
232285
232398
  uParamRange.set(0.0, xLength);
232286
232399
  vParamRange.set(0.0, yLength);
232287
- this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_21__.BilinearPatch.create(corners[2], corners[3], corners[0], corners[1]), numX, numY, uParamRange, vParamRange);
232400
+ this.addUVGridBody(_geometry3d_BilinearPatch__WEBPACK_IMPORTED_MODULE_22__.BilinearPatch.create(corners[2], corners[3], corners[0], corners[1]), numX, numY, uParamRange, vParamRange);
232288
232401
  this.endFace();
232289
232402
  }
232290
232403
  }
@@ -232453,6 +232566,8 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232453
232566
  handleLoop(g) { return this.addTriangulatedRegion(g); }
232454
232567
  /** Double dispatch handler for ParityRegion */
232455
232568
  handleParityRegion(g) { return this.addTriangulatedRegion(g); }
232569
+ /** Double dispatch handler for UnionRegion */
232570
+ handleUnionRegion(g) { return this.addTriangulatedRegion(g); }
232456
232571
  /** add facets for a GeometryQuery object. This is double dispatch through `dispatchToGeometryHandler(this)` */
232457
232572
  addGeometryQuery(g) { g.dispatchToGeometryHandler(this); }
232458
232573
  /**
@@ -232463,7 +232578,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232463
232578
  * * Rely on the builder's compress step to find common vertex coordinates
232464
232579
  * @internal
232465
232580
  */
232466
- addGraph(graph, needParams, acceptFaceFunction = _topology_Graph__WEBPACK_IMPORTED_MODULE_22__.HalfEdge.testNodeMaskNotExterior, isEdgeVisibleFunction = _topology_Graph__WEBPACK_IMPORTED_MODULE_22__.HalfEdge.testMateMaskExterior) {
232581
+ addGraph(graph, needParams, acceptFaceFunction = _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testNodeMaskNotExterior, isEdgeVisibleFunction = _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testMateMaskExterior) {
232467
232582
  let index = 0;
232468
232583
  const needNormals = this._options.needNormals;
232469
232584
  let normalIndex = 0;
@@ -232513,7 +232628,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232513
232628
  /** Create a polyface containing the faces of a HalfEdgeGraph, with test function to filter faces.
232514
232629
  * @internal
232515
232630
  */
232516
- static graphToPolyface(graph, options, acceptFaceFunction = _topology_Graph__WEBPACK_IMPORTED_MODULE_22__.HalfEdge.testNodeMaskNotExterior) {
232631
+ static graphToPolyface(graph, options, acceptFaceFunction = _topology_Graph__WEBPACK_IMPORTED_MODULE_23__.HalfEdge.testNodeMaskNotExterior) {
232517
232632
  const builder = PolyfaceBuilder.create(options);
232518
232633
  builder.addGraph(graph, builder.options.needParams, acceptFaceFunction);
232519
232634
  builder.endFace();
@@ -232533,13 +232648,13 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232533
232648
  */
232534
232649
  static polygonToTriangulatedPolyface(points, localToWorld) {
232535
232650
  if (!localToWorld)
232536
- localToWorld = _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_23__.FrameBuilder.createFrameWithCCWPolygon(points);
232651
+ localToWorld = _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_24__.FrameBuilder.createFrameWithCCWPolygon(points);
232537
232652
  if (localToWorld) {
232538
232653
  const localPoints = localToWorld.multiplyInversePoint3dArray(points);
232539
- const areaXY = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_24__.PolygonOps.areaXY(localPoints);
232654
+ const areaXY = _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_25__.PolygonOps.areaXY(localPoints);
232540
232655
  if (areaXY < 0.0)
232541
232656
  localPoints.reverse();
232542
- const graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_25__.Triangulator.createTriangulatedGraphFromSingleLoop(localPoints);
232657
+ const graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_26__.Triangulator.createTriangulatedGraphFromSingleLoop(localPoints);
232543
232658
  if (graph) {
232544
232659
  const polyface = this.graphToPolyface(graph);
232545
232660
  polyface.tryTransformInPlace(localToWorld);
@@ -232582,8 +232697,8 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232582
232697
  * @param vMap optional mapping from v fraction to parameter space (such as texture)
232583
232698
  */
232584
232699
  addUVGridBody(surface, numU, numV, uMap, vMap) {
232585
- let xyzIndex0 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_26__.GrowableFloat64Array(numU);
232586
- let xyzIndex1 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_26__.GrowableFloat64Array(numU);
232700
+ let xyzIndex0 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__.GrowableFloat64Array(numU);
232701
+ let xyzIndex1 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__.GrowableFloat64Array(numU);
232587
232702
  let paramIndex0;
232588
232703
  let paramIndex1;
232589
232704
  let normalIndex0;
@@ -232591,13 +232706,13 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232591
232706
  const reverse = this._reversed;
232592
232707
  const needNormals = this.options.needNormals;
232593
232708
  if (needNormals) {
232594
- normalIndex0 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_26__.GrowableFloat64Array(numU);
232595
- normalIndex1 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_26__.GrowableFloat64Array(numU);
232709
+ normalIndex0 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__.GrowableFloat64Array(numU);
232710
+ normalIndex1 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__.GrowableFloat64Array(numU);
232596
232711
  }
232597
232712
  const needParams = this.options.needParams;
232598
232713
  if (needParams) {
232599
- paramIndex0 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_26__.GrowableFloat64Array(numU);
232600
- paramIndex1 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_26__.GrowableFloat64Array(numU);
232714
+ paramIndex0 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__.GrowableFloat64Array(numU);
232715
+ paramIndex1 = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_27__.GrowableFloat64Array(numU);
232601
232716
  }
232602
232717
  let indexSwap;
232603
232718
  xyzIndex0.ensureCapacity(numU);
@@ -232606,7 +232721,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232606
232721
  const normal = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Vector3d.create();
232607
232722
  const du = 1.0 / numU;
232608
232723
  const dv = 1.0 / numV;
232609
- const plane = _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_27__.Plane3dByOriginAndVectors.createXYPlane();
232724
+ const plane = _geometry3d_Plane3dByOriginAndVectors__WEBPACK_IMPORTED_MODULE_28__.Plane3dByOriginAndVectors.createXYPlane();
232610
232725
  for (let v = 0; v <= numV; v++) {
232611
232726
  // evaluate new points ....
232612
232727
  xyzIndex1.clear();
@@ -232677,7 +232792,7 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232677
232792
  * @param points
232678
232793
  */
232679
232794
  static pointsToTriangulatedPolyface(points) {
232680
- const graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_25__.Triangulator.createTriangulatedGraphFromPoints(points);
232795
+ const graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_26__.Triangulator.createTriangulatedGraphFromPoints(points);
232681
232796
  if (graph)
232682
232797
  return PolyfaceBuilder.graphToPolyface(graph);
232683
232798
  return undefined;
@@ -232693,13 +232808,13 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232693
232808
  * @param pointsB points of second linestring.
232694
232809
  */
232695
232810
  addGreedyTriangulationBetweenLineStrings(pointsA, pointsB) {
232696
- const context = _GreedyTriangulationBetweenLineStrings__WEBPACK_IMPORTED_MODULE_28__.GreedyTriangulationBetweenLineStrings.createContext();
232811
+ const context = _GreedyTriangulationBetweenLineStrings__WEBPACK_IMPORTED_MODULE_29__.GreedyTriangulationBetweenLineStrings.createContext();
232697
232812
  context.emitTriangles(resolveToIndexedXYZCollectionOrCarrier(pointsA), resolveToIndexedXYZCollectionOrCarrier(pointsB), (triangle) => {
232698
232813
  this.addTriangleFacet(triangle.points);
232699
232814
  });
232700
232815
  }
232701
232816
  addMiteredPipesFromPoints(centerline, sectionData, numFacetAround = 12) {
232702
- const sections = _curve_CurveFactory__WEBPACK_IMPORTED_MODULE_29__.CurveFactory.createMiteredPipeSections(centerline, sectionData);
232817
+ const sections = _curve_CurveFactory__WEBPACK_IMPORTED_MODULE_30__.CurveFactory.createMiteredPipeSections(centerline, sectionData);
232703
232818
  const pointA0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
232704
232819
  const pointA1 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
232705
232820
  const pointB0 = _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_0__.Point3d.create();
@@ -232731,18 +232846,18 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232731
232846
  */
232732
232847
  addMiteredPipes(centerline, sectionData, numFacetAround = 12) {
232733
232848
  if (Array.isArray(centerline)) {
232734
- this.addMiteredPipesFromPoints(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__.Point3dArrayCarrier(centerline), sectionData, numFacetAround);
232849
+ this.addMiteredPipesFromPoints(new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_31__.Point3dArrayCarrier(centerline), sectionData, numFacetAround);
232735
232850
  }
232736
232851
  else if (centerline instanceof _geometry3d_GrowableXYZArray__WEBPACK_IMPORTED_MODULE_10__.GrowableXYZArray) {
232737
232852
  this.addMiteredPipesFromPoints(centerline, sectionData, numFacetAround);
232738
232853
  }
232739
- else if (centerline instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_31__.IndexedXYZCollection) {
232854
+ else if (centerline instanceof _geometry3d_IndexedXYZCollection__WEBPACK_IMPORTED_MODULE_32__.IndexedXYZCollection) {
232740
232855
  this.addMiteredPipesFromPoints(centerline, sectionData, numFacetAround);
232741
232856
  }
232742
232857
  else if (centerline instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d) {
232743
232858
  this.addMiteredPipesFromPoints(centerline.packedPoints, sectionData, numFacetAround);
232744
232859
  }
232745
- else if (centerline instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_32__.GeometryQuery) {
232860
+ else if (centerline instanceof _curve_GeometryQuery__WEBPACK_IMPORTED_MODULE_33__.GeometryQuery) {
232746
232861
  const linestring = _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d.create();
232747
232862
  centerline.emitStrokes(linestring, this._options);
232748
232863
  this.addMiteredPipesFromPoints(linestring.packedPoints, sectionData, numFacetAround);
@@ -232809,10 +232924,10 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232809
232924
  */
232810
232925
  addSweptIndexedPolyface(source, sweepVector, triangulateSides = false) {
232811
232926
  let isSimpleSweep = true;
232812
- const totalProjectedArea = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_33__.PolyfaceQuery.sumFacetAreas(source, sweepVector);
232927
+ const totalProjectedArea = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__.PolyfaceQuery.sumFacetAreas(source, sweepVector);
232813
232928
  if (_Geometry__WEBPACK_IMPORTED_MODULE_8__.Geometry.isAlmostEqualNumber(0.0, totalProjectedArea))
232814
232929
  isSimpleSweep = false;
232815
- const partitionedIndices = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_33__.PolyfaceQuery.partitionFacetIndicesByVisibilityVector(source, sweepVector, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_34__.Angle.createDegrees(1.0e-3));
232930
+ const partitionedIndices = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__.PolyfaceQuery.partitionFacetIndicesByVisibilityVector(source, sweepVector, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_35__.Angle.createDegrees(1.0e-3));
232816
232931
  const numForwardFacets = partitionedIndices[0].length;
232817
232932
  const numBackwardFacets = partitionedIndices[1].length;
232818
232933
  const numSideFacets = partitionedIndices[2].length;
@@ -232829,15 +232944,15 @@ class PolyfaceBuilder extends _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODU
232829
232944
  // collect base edges added to the builder, and extract boundary
232830
232945
  const numBaseFacets = firstSweptFacet - firstBaseFacet;
232831
232946
  const baseFacetIndices = Array.from({ length: numBaseFacets }, (_, i) => firstBaseFacet + i);
232832
- const baseFacetVisitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_35__.IndexedPolyfaceSubsetVisitor.createSubsetVisitor(this._polyface, baseFacetIndices, 1);
232833
- const baseEdges = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_33__.PolyfaceQuery.createIndexedEdges(baseFacetVisitor);
232947
+ const baseFacetVisitor = _IndexedPolyfaceVisitor__WEBPACK_IMPORTED_MODULE_36__.IndexedPolyfaceSubsetVisitor.createSubsetVisitor(this._polyface, baseFacetIndices, 1);
232948
+ const baseEdges = _PolyfaceQuery__WEBPACK_IMPORTED_MODULE_34__.PolyfaceQuery.createIndexedEdges(baseFacetVisitor);
232834
232949
  const baseBoundaryEdges = [];
232835
232950
  baseEdges.sortAndCollectClusters(undefined, baseBoundaryEdges, undefined, undefined);
232836
232951
  // add a side face per boundary edge
232837
232952
  const oldShouldTriangulate = this._options.shouldTriangulate;
232838
232953
  this._options.shouldTriangulate = triangulateSides;
232839
232954
  for (const edgeOrCluster of baseBoundaryEdges) {
232840
- if (edgeOrCluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_36__.SortableEdge)
232955
+ if (edgeOrCluster instanceof _IndexedEdgeMatcher__WEBPACK_IMPORTED_MODULE_37__.SortableEdge)
232841
232956
  this.addSweptFace(edgeOrCluster, numBaseFacets);
232842
232957
  else if (Array.isArray(edgeOrCluster))
232843
232958
  for (const edge of edgeOrCluster)
@@ -232852,7 +232967,7 @@ PolyfaceBuilder._workVectorFindOrAdd = _geometry3d_Point3dVector3d__WEBPACK_IMPO
232852
232967
  PolyfaceBuilder._workUVFindOrAdd = _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_1__.Point2d.create();
232853
232968
  function resolveToIndexedXYZCollectionOrCarrier(points) {
232854
232969
  if (Array.isArray(points))
232855
- return new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_30__.Point3dArrayCarrier(points);
232970
+ return new _geometry3d_Point3dArrayCarrier__WEBPACK_IMPORTED_MODULE_31__.Point3dArrayCarrier(points);
232856
232971
  if (points instanceof _curve_LineString3d__WEBPACK_IMPORTED_MODULE_11__.LineString3d)
232857
232972
  return points.packedPoints;
232858
232973
  return points;
@@ -244968,6 +245083,7 @@ __webpack_require__.r(__webpack_exports__);
244968
245083
  /* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
244969
245084
  /* harmony import */ var _bspline_BSplineCurve3dH__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../bspline/BSplineCurve3dH */ "../../core/geometry/lib/esm/bspline/BSplineCurve3dH.js");
244970
245085
  /* harmony import */ var _bspline_BSplineSurface__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ../bspline/BSplineSurface */ "../../core/geometry/lib/esm/bspline/BSplineSurface.js");
245086
+ /* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
244971
245087
  /* harmony import */ var _bspline_KnotVector__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ../bspline/KnotVector */ "../../core/geometry/lib/esm/bspline/KnotVector.js");
244972
245088
  /* harmony import */ var _clipping_ClipPlane__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../clipping/ClipPlane */ "../../core/geometry/lib/esm/clipping/ClipPlane.js");
244973
245089
  /* harmony import */ var _clipping_ConvexClipPlaneSet__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../clipping/ConvexClipPlaneSet */ "../../core/geometry/lib/esm/clipping/ConvexClipPlaneSet.js");
@@ -244982,6 +245098,8 @@ __webpack_require__.r(__webpack_exports__);
244982
245098
  /* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
244983
245099
  /* harmony import */ var _curve_Path__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ../curve/Path */ "../../core/geometry/lib/esm/curve/Path.js");
244984
245100
  /* harmony import */ var _curve_PointString3d__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ../curve/PointString3d */ "../../core/geometry/lib/esm/curve/PointString3d.js");
245101
+ /* harmony import */ var _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../curve/spiral/DirectSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/DirectSpiral3d.js");
245102
+ /* harmony import */ var _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../curve/spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
244985
245103
  /* harmony import */ var _curve_UnionRegion__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ../curve/UnionRegion */ "../../core/geometry/lib/esm/curve/UnionRegion.js");
244986
245104
  /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
244987
245105
  /* harmony import */ var _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/Angle */ "../../core/geometry/lib/esm/geometry3d/Angle.js");
@@ -244999,7 +245117,9 @@ __webpack_require__.r(__webpack_exports__);
244999
245117
  /* harmony import */ var _geometry4d_Map4d__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ../geometry4d/Map4d */ "../../core/geometry/lib/esm/geometry4d/Map4d.js");
245000
245118
  /* harmony import */ var _geometry4d_Matrix4d__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ../geometry4d/Matrix4d */ "../../core/geometry/lib/esm/geometry4d/Matrix4d.js");
245001
245119
  /* harmony import */ var _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../geometry4d/Point4d */ "../../core/geometry/lib/esm/geometry4d/Point4d.js");
245120
+ /* harmony import */ var _polyface_AuxData__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ../polyface/AuxData */ "../../core/geometry/lib/esm/polyface/AuxData.js");
245002
245121
  /* harmony import */ var _polyface_Polyface__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ../polyface/Polyface */ "../../core/geometry/lib/esm/polyface/Polyface.js");
245122
+ /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
245003
245123
  /* harmony import */ var _solid_Box__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ../solid/Box */ "../../core/geometry/lib/esm/solid/Box.js");
245004
245124
  /* harmony import */ var _solid_Cone__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ../solid/Cone */ "../../core/geometry/lib/esm/solid/Cone.js");
245005
245125
  /* harmony import */ var _solid_LinearSweep__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ../solid/LinearSweep */ "../../core/geometry/lib/esm/solid/LinearSweep.js");
@@ -245007,11 +245127,6 @@ __webpack_require__.r(__webpack_exports__);
245007
245127
  /* harmony import */ var _solid_RuledSweep__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ../solid/RuledSweep */ "../../core/geometry/lib/esm/solid/RuledSweep.js");
245008
245128
  /* harmony import */ var _solid_Sphere__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ../solid/Sphere */ "../../core/geometry/lib/esm/solid/Sphere.js");
245009
245129
  /* harmony import */ var _solid_TorusPipe__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ../solid/TorusPipe */ "../../core/geometry/lib/esm/solid/TorusPipe.js");
245010
- /* harmony import */ var _curve_spiral_IntegratedSpiral3d__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ../curve/spiral/IntegratedSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/IntegratedSpiral3d.js");
245011
- /* harmony import */ var _curve_spiral_DirectSpiral3d__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ../curve/spiral/DirectSpiral3d */ "../../core/geometry/lib/esm/curve/spiral/DirectSpiral3d.js");
245012
- /* harmony import */ var _polyface_AuxData__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ../polyface/AuxData */ "../../core/geometry/lib/esm/polyface/AuxData.js");
245013
- /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
245014
- /* harmony import */ var _bspline_InterpolationCurve3d__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ../bspline/InterpolationCurve3d */ "../../core/geometry/lib/esm/bspline/InterpolationCurve3d.js");
245015
245130
  /*---------------------------------------------------------------------------------------------
245016
245131
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
245017
245132
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -245136,7 +245251,7 @@ class Sample {
245136
245251
  _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)),
245137
245252
  _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.createPolar(2.0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(20)),
245138
245253
  _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)),
245139
- _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(2, 3, 0)
245254
+ _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_1__.Vector3d.create(2, 3, 0),
245140
245255
  ];
245141
245256
  }
245142
245257
  /** Return an array with assorted Range3d samples */
@@ -245144,7 +245259,7 @@ class Sample {
245144
245259
  return [
245145
245260
  _geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range3d.createXYZXYZ(0, 0, 0, 1, 1, 1),
245146
245261
  _geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range3d.createXYZ(1, 2, 3),
245147
- _geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range3d.createXYZXYZ(-2, -3, 1, 200, 301, 8)
245262
+ _geometry3d_Range__WEBPACK_IMPORTED_MODULE_4__.Range3d.createXYZXYZ(-2, -3, 1, 200, 301, 8),
245148
245263
  ];
245149
245264
  }
245150
245265
  /** Create 5 points of a (axis aligned) rectangle with corners (x0,y0) and (x0+ax, y0 + ay) */
@@ -245424,10 +245539,10 @@ class Sample {
245424
245539
  _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createIdentity(),
245425
245540
  _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)),
245426
245541
  _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)),
245427
- _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createUniformScale(2.0),
245428
245542
  _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)),
245543
+ _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createUniformScale(2.0),
245429
245544
  _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createScale(1, 1, -1),
245430
- _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createScale(2, 3, 4)
245545
+ _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createScale(2, 3, 4),
245431
245546
  ];
245432
245547
  }
245433
245548
  /** Assorted invertible transforms. */
@@ -245443,8 +245558,7 @@ class Sample {
245443
245558
  /** Return an array of Matrix3d with various skew and scale. This includes at least:
245444
245559
  * * identity
245445
245560
  * * 3 distinct diagonals.
245446
- * * The distinct diagonal base with smaller value added to
245447
- * other 6 spots in succession.
245561
+ * * The distinct diagonal base with smaller value added to other 6 spots in succession.
245448
245562
  * * the distinct diagonals with all others also smaller non-zeros.
245449
245563
  */
245450
245564
  static createScaleSkewMatrix3d() {
@@ -245457,7 +245571,7 @@ class Sample {
245457
245571
  _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRowValues(5, 0, 0, 0, 6, 1, 0, 0, 7),
245458
245572
  _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRowValues(5, 0, 0, 0, 6, 0, 1, 0, 7),
245459
245573
  _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRowValues(5, 0, 0, 0, 6, 0, 0, 1, 7),
245460
- _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRowValues(5, 2, 3, 2, 6, 1, -1, 2, 7)
245574
+ _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_12__.Matrix3d.createRowValues(5, 2, 3, 2, 6, 1, -1, 2, 7),
245461
245575
  ];
245462
245576
  }
245463
245577
  /** Return an array of singular Matrix3d. This includes at least:
@@ -247162,7 +247276,7 @@ Sample.vector2d = [
247162
247276
  _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Vector2d.create(0, 0),
247163
247277
  _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Vector2d.createPolar(1.0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(20)),
247164
247278
  _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Vector2d.createPolar(2.0, _geometry3d_Angle__WEBPACK_IMPORTED_MODULE_3__.Angle.createDegrees(20)),
247165
- _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Vector2d.create(2, 3)
247279
+ _geometry3d_Point2dVector2d__WEBPACK_IMPORTED_MODULE_2__.Vector2d.create(2, 3),
247166
247280
  ];
247167
247281
  /** Assorted Plane3dBYOriginAndUnitNormal */
247168
247282
  Sample.plane3dByOriginAndUnitNormal = [
@@ -250280,12 +250394,12 @@ __webpack_require__.r(__webpack_exports__);
250280
250394
  /* harmony import */ var _curve_LineString3d__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../curve/LineString3d */ "../../core/geometry/lib/esm/curve/LineString3d.js");
250281
250395
  /* harmony import */ var _curve_Loop__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../curve/Loop */ "../../core/geometry/lib/esm/curve/Loop.js");
250282
250396
  /* harmony import */ var _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../curve/ParityRegion */ "../../core/geometry/lib/esm/curve/ParityRegion.js");
250283
- /* harmony import */ var _curve_RegionOps__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../curve/RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
250397
+ /* harmony import */ var _curve_RegionOps__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../curve/RegionOps */ "../../core/geometry/lib/esm/curve/RegionOps.js");
250284
250398
  /* harmony import */ var _geometry3d_FrameBuilder__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../geometry3d/FrameBuilder */ "../../core/geometry/lib/esm/geometry3d/FrameBuilder.js");
250285
250399
  /* harmony import */ var _geometry3d_Point3dVector3d__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../geometry3d/Point3dVector3d */ "../../core/geometry/lib/esm/geometry3d/Point3dVector3d.js");
250286
250400
  /* harmony import */ var _geometry3d_PolygonOps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/PolygonOps */ "../../core/geometry/lib/esm/geometry3d/PolygonOps.js");
250287
250401
  /* harmony import */ var _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../polyface/PolyfaceBuilder */ "../../core/geometry/lib/esm/polyface/PolyfaceBuilder.js");
250288
- /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
250402
+ /* harmony import */ var _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../topology/HalfEdgeGraphSearch */ "../../core/geometry/lib/esm/topology/HalfEdgeGraphSearch.js");
250289
250403
  /* harmony import */ var _topology_Triangulation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../topology/Triangulation */ "../../core/geometry/lib/esm/topology/Triangulation.js");
250290
250404
  /*---------------------------------------------------------------------------------------------
250291
250405
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
@@ -250427,6 +250541,13 @@ class SweepContour {
250427
250541
  this._facets = unflippedPoly;
250428
250542
  this._facets.tryTransformInPlace(this.localToWorld);
250429
250543
  }
250544
+ else { // earcut failed (e.g., on a split washer polygon, where the bridge edge is traversed twice)
250545
+ const polyface = _curve_RegionOps__WEBPACK_IMPORTED_MODULE_7__.RegionOps.polygonXYAreaUnionLoopsToPolyface(points, [], true);
250546
+ if (polyface) {
250547
+ this._facets = polyface;
250548
+ this._facets.tryTransformInPlace(this.localToWorld);
250549
+ }
250550
+ }
250430
250551
  }
250431
250552
  }
250432
250553
  else if (this.curves instanceof _curve_ParityRegion__WEBPACK_IMPORTED_MODULE_3__.ParityRegion) {
@@ -250446,7 +250567,7 @@ class SweepContour {
250446
250567
  const numLoops = strokes.length;
250447
250568
  /** Try the earcut algorithm first -- lots less machinery, but can't handle any form of overlap */
250448
250569
  const graph = _topology_Triangulation__WEBPACK_IMPORTED_MODULE_5__.Triangulator.createTriangulatedGraphFromLoops(strokes);
250449
- if (graph && _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_7__.HalfEdgeGraphSearch.isTriangulatedCCW(graph, true, numLoops - 1)) {
250570
+ if (graph && _topology_HalfEdgeGraphSearch__WEBPACK_IMPORTED_MODULE_8__.HalfEdgeGraphSearch.isTriangulatedCCW(graph, true, numLoops - 1)) {
250450
250571
  _topology_Triangulation__WEBPACK_IMPORTED_MODULE_5__.Triangulator.flipTriangles(graph);
250451
250572
  const unflippedPoly = _polyface_PolyfaceBuilder__WEBPACK_IMPORTED_MODULE_6__.PolyfaceBuilder.graphToPolyface(graph, options);
250452
250573
  this._facets = unflippedPoly;
@@ -250454,7 +250575,7 @@ class SweepContour {
250454
250575
  }
250455
250576
  else {
250456
250577
  // earcut failed. Restart with full merge and parity analysis.
250457
- const polyface = _curve_RegionOps__WEBPACK_IMPORTED_MODULE_8__.RegionOps.polygonXYAreaUnionLoopsToPolyface(strokes, [], true);
250578
+ const polyface = _curve_RegionOps__WEBPACK_IMPORTED_MODULE_7__.RegionOps.polygonXYAreaUnionLoopsToPolyface(strokes, [], true);
250458
250579
  if (polyface) {
250459
250580
  this._facets = polyface;
250460
250581
  this._facets.tryTransformInPlace(this.localToWorld);
@@ -252777,6 +252898,7 @@ class HalfEdgeGraphSearch {
252777
252898
  /**
252778
252899
  * Search an array of faceSeed nodes for the face with the most negative area.
252779
252900
  * @param oneCandidateNodePerFace array containing one node from each face to be considered.
252901
+ * @returns node on the minimum area face, or undefined if no such face (e.g., all faces have zero area).
252780
252902
  */
252781
252903
  static findMinimumAreaFace(oneCandidateNodePerFace, faceAreaFunction) {
252782
252904
  const summary = HalfEdgeGraphSearch.collectFaceAreaSummary(oneCandidateNodePerFace, false, faceAreaFunction);
@@ -287636,7 +287758,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
287636
287758
  /***/ ((module) => {
287637
287759
 
287638
287760
  "use strict";
287639
- 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"}}]}}');
287761
+ 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"}}]}}');
287640
287762
 
287641
287763
  /***/ })
287642
287764