@itwin/rpcinterface-full-stack-tests 4.0.0-dev.7 → 4.0.0-dev.8

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.
@@ -183333,9 +183333,9 @@ class Geometry {
183333
183333
  return 2 - ((-axis - 1) % 3);
183334
183334
  }
183335
183335
  /** Return the AxisOrder for which axisIndex is the first named axis.
183336
- * * `axisIndex===0`returns AxisOrder.XYZ
183337
- * * `axisIndex===1`returns AxisOrder.YZX
183338
- * * `axisIndex===2`returns AxisOrder.ZXY
183336
+ * * `axisIndex === 0` returns `AxisOrder.XYZ`
183337
+ * * `axisIndex === 1` returns `AxisOrder.YZX`
183338
+ * * `axisIndex === 2` returns `AxisOrder.ZXY`
183339
183339
  */
183340
183340
  static axisIndexToRightHandedAxisOrder(axisIndex) {
183341
183341
  if (axisIndex === 0)
@@ -183347,7 +183347,9 @@ class Geometry {
183347
183347
  return Geometry.axisIndexToRightHandedAxisOrder(Geometry.cyclic3dAxis(axisIndex));
183348
183348
  }
183349
183349
  /** Return the largest absolute distance from a to either of b0 or b1 */
183350
- static maxAbsDiff(a, b0, b1) { return Math.max(Math.abs(a - b0), Math.abs(a - b1)); }
183350
+ static maxAbsDiff(a, b0, b1) {
183351
+ return Math.max(Math.abs(a - b0), Math.abs(a - b1));
183352
+ }
183351
183353
  /** Return the largest absolute absolute value among x,y,z */
183352
183354
  static maxAbsXYZ(x, y, z) {
183353
183355
  return Geometry.maxXYZ(Math.abs(x), Math.abs(y), Math.abs(z));
@@ -183392,19 +183394,33 @@ class Geometry {
183392
183394
  return q;
183393
183395
  }
183394
183396
  /** Return the hypotenuse `sqrt(x*x + y*y)`. This is much faster than `Math.hypot(x,y)`. */
183395
- static hypotenuseXY(x, y) { return Math.sqrt(x * x + y * y); }
183397
+ static hypotenuseXY(x, y) {
183398
+ return Math.sqrt(x * x + y * y);
183399
+ }
183396
183400
  /** Return the squared `hypotenuse (x*x + y*y)`. */
183397
- static hypotenuseSquaredXY(x, y) { return x * x + y * y; }
183401
+ static hypotenuseSquaredXY(x, y) {
183402
+ return x * x + y * y;
183403
+ }
183398
183404
  /** Return the square of x */
183399
- static square(x) { return x * x; }
183405
+ static square(x) {
183406
+ return x * x;
183407
+ }
183400
183408
  /** Return the hypotenuse `sqrt(x*x + y*y + z*z)`. This is much faster than `Math.hypot(x,y,z)`. */
183401
- static hypotenuseXYZ(x, y, z) { return Math.sqrt(x * x + y * y + z * z); }
183409
+ static hypotenuseXYZ(x, y, z) {
183410
+ return Math.sqrt(x * x + y * y + z * z);
183411
+ }
183402
183412
  /** Return the squared hypotenuse `(x*x + y*y + z*z)`. This is much faster than `Math.hypot(x,y,z)`. */
183403
- static hypotenuseSquaredXYZ(x, y, z) { return x * x + y * y + z * z; }
183413
+ static hypotenuseSquaredXYZ(x, y, z) {
183414
+ return x * x + y * y + z * z;
183415
+ }
183404
183416
  /** Return the (full 4d) hypotenuse `sqrt(x*x + y*y + z*z + w*w)`. This is much faster than `Math.hypot(x,y,z,w)`. */
183405
- static hypotenuseXYZW(x, y, z, w) { return Math.sqrt(x * x + y * y + z * z + w * w); }
183417
+ static hypotenuseXYZW(x, y, z, w) {
183418
+ return Math.sqrt(x * x + y * y + z * z + w * w);
183419
+ }
183406
183420
  /** Return the squared hypotenuse `(x*x + y*y + z*z+w*w)`. This is much faster than `Math.hypot(x,y,z)`. */
183407
- static hypotenuseSquaredXYZW(x, y, z, w) { return x * x + y * y + z * z + w * w; }
183421
+ static hypotenuseSquaredXYZW(x, y, z, w) {
183422
+ return x * x + y * y + z * z + w * w;
183423
+ }
183408
183424
  /**
183409
183425
  * Return the distance between xy points given as numbers.
183410
183426
  * @param x0 x coordinate of point 0
@@ -197273,11 +197289,12 @@ __webpack_require__.r(__webpack_exports__);
197273
197289
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
197274
197290
  /* harmony export */ "CurveCurve": () => (/* binding */ CurveCurve)
197275
197291
  /* harmony export */ });
197276
- /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
197277
- /* harmony import */ var _CurveCurveIntersectXY__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./CurveCurveIntersectXY */ "../../core/geometry/lib/esm/curve/CurveCurveIntersectXY.js");
197278
- /* harmony import */ var _CurveCurveIntersectXYZ__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CurveCurveIntersectXYZ */ "../../core/geometry/lib/esm/curve/CurveCurveIntersectXYZ.js");
197279
- /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
197280
- /* harmony import */ var _CurveCurveCloseApproachXY__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CurveCurveCloseApproachXY */ "../../core/geometry/lib/esm/curve/CurveCurveCloseApproachXY.js");
197292
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
197293
+ /* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
197294
+ /* harmony import */ var _CurveCurveCloseApproachXY__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CurveCurveCloseApproachXY */ "../../core/geometry/lib/esm/curve/CurveCurveCloseApproachXY.js");
197295
+ /* harmony import */ var _CurveCurveIntersectXY__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CurveCurveIntersectXY */ "../../core/geometry/lib/esm/curve/CurveCurveIntersectXY.js");
197296
+ /* harmony import */ var _CurveCurveIntersectXYZ__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CurveCurveIntersectXYZ */ "../../core/geometry/lib/esm/curve/CurveCurveIntersectXYZ.js");
197297
+ /* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
197281
197298
  /*---------------------------------------------------------------------------------------------
197282
197299
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
197283
197300
  * See LICENSE.md in the project root for license terms and full copyright notice.
@@ -197290,6 +197307,7 @@ __webpack_require__.r(__webpack_exports__);
197290
197307
 
197291
197308
 
197292
197309
 
197310
+
197293
197311
  /**
197294
197312
  * `CurveCurve` has static method for various computations that work on a pair of curves or curve collections.
197295
197313
  * @public
@@ -197297,17 +197315,18 @@ __webpack_require__.r(__webpack_exports__);
197297
197315
  class CurveCurve {
197298
197316
  /**
197299
197317
  * Return xy intersections of 2 curves.
197300
- * @param geometryA second geometry
197318
+ * @param geometryA first geometry
197301
197319
  * @param extendA true to allow geometryA to extend
197302
197320
  * @param geometryB second geometry
197303
197321
  * @param extendB true to allow geometryB to extend
197322
+ * @param tolerance optional distance tolerance for coincidence
197304
197323
  */
197305
- static intersectionXYPairs(geometryA, extendA, geometryB, extendB) {
197306
- const handler = new _CurveCurveIntersectXY__WEBPACK_IMPORTED_MODULE_0__.CurveCurveIntersectXY(undefined, geometryA, extendA, geometryB, extendB);
197307
- if (geometryB instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_1__.CurvePrimitive) {
197324
+ static intersectionXYPairs(geometryA, extendA, geometryB, extendB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
197325
+ const handler = new _CurveCurveIntersectXY__WEBPACK_IMPORTED_MODULE_1__.CurveCurveIntersectXY(undefined, geometryA, extendA, geometryB, extendB, tolerance);
197326
+ if (geometryB instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__.CurvePrimitive) {
197308
197327
  geometryA.dispatchToGeometryHandler(handler);
197309
197328
  }
197310
- else if (geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_2__.CurveCollection) {
197329
+ else if (geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_3__.CurveCollection) {
197311
197330
  const allCurves = geometryB.collectCurvePrimitives();
197312
197331
  for (const child of allCurves) {
197313
197332
  handler.resetGeometry(geometryA, false, child, false);
@@ -197318,13 +197337,14 @@ class CurveCurve {
197318
197337
  }
197319
197338
  /**
197320
197339
  * Return xy intersections of 2 projected curves
197321
- * @param geometryA second geometry
197340
+ * @param geometryA first geometry
197322
197341
  * @param extendA true to allow geometryA to extend
197323
197342
  * @param geometryB second geometry
197324
197343
  * @param extendB true to allow geometryB to extend
197344
+ * @param tolerance optional distance tolerance for coincidence
197325
197345
  */
197326
- static intersectionProjectedXYPairs(worldToLocal, geometryA, extendA, geometryB, extendB) {
197327
- const handler = new _CurveCurveIntersectXY__WEBPACK_IMPORTED_MODULE_0__.CurveCurveIntersectXY(worldToLocal, geometryA, extendA, geometryB, extendB);
197346
+ static intersectionProjectedXYPairs(worldToLocal, geometryA, extendA, geometryB, extendB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
197347
+ const handler = new _CurveCurveIntersectXY__WEBPACK_IMPORTED_MODULE_1__.CurveCurveIntersectXY(worldToLocal, geometryA, extendA, geometryB, extendB, tolerance);
197328
197348
  geometryA.dispatchToGeometryHandler(handler);
197329
197349
  return handler.grabPairedResults();
197330
197350
  }
@@ -197333,25 +197353,26 @@ class CurveCurve {
197333
197353
  * * Implemented for combinations of LineSegment3d, LineString3d, Arc3d.
197334
197354
  * * Not Implemented for bspline and bezier curves.
197335
197355
  * @beta
197336
- * @param geometryA second geometry
197356
+ * @param geometryA first geometry
197337
197357
  * @param extendA true to allow geometryA to extend
197338
197358
  * @param geometryB second geometry
197339
197359
  * @param extendB true to allow geometryB to extend
197340
197360
  */
197341
197361
  static intersectionXYZ(geometryA, extendA, geometryB, extendB) {
197342
- const handler = new _CurveCurveIntersectXYZ__WEBPACK_IMPORTED_MODULE_3__.CurveCurveIntersectXYZ(geometryA, extendA, geometryB, extendB);
197362
+ const handler = new _CurveCurveIntersectXYZ__WEBPACK_IMPORTED_MODULE_4__.CurveCurveIntersectXYZ(geometryA, extendA, geometryB, extendB);
197343
197363
  geometryA.dispatchToGeometryHandler(handler);
197344
197364
  return handler.grabResults();
197345
197365
  }
197346
197366
  /**
197347
197367
  * Return xy intersections of 2 curves.
197348
- * @param geometryA second geometry
197368
+ * @param geometryA first geometry
197349
197369
  * @param extendA true to allow geometryA to extend
197350
197370
  * @param geometryB second geometry
197351
197371
  * @param extendB true to allow geometryB to extend
197372
+ * @param tolerance optional distance tolerance for coincidence
197352
197373
  */
197353
- static allIntersectionsAmongPrimitivesXY(primitives) {
197354
- const handler = new _CurveCurveIntersectXY__WEBPACK_IMPORTED_MODULE_0__.CurveCurveIntersectXY(undefined, undefined, false, undefined, false);
197374
+ static allIntersectionsAmongPrimitivesXY(primitives, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
197375
+ const handler = new _CurveCurveIntersectXY__WEBPACK_IMPORTED_MODULE_1__.CurveCurveIntersectXY(undefined, undefined, false, undefined, false, tolerance);
197355
197376
  for (let i = 0; i < primitives.length; i++) {
197356
197377
  const geometryA = primitives[i];
197357
197378
  for (let j = i + 1; j < primitives.length; j++) {
@@ -197363,11 +197384,11 @@ class CurveCurve {
197363
197384
  }
197364
197385
  /**
197365
197386
  * Return xy close approaches of 2 projected curves
197366
- * @param geometryA second geometry
197387
+ * @param geometryA first geometry
197367
197388
  * @param geometryB second geometry
197368
197389
  */
197369
197390
  static closeApproachProjectedXYPairs(geometryA, geometryB, maxDistance) {
197370
- const handler = new _CurveCurveCloseApproachXY__WEBPACK_IMPORTED_MODULE_4__.CurveCurveCloseApproachXY(geometryA, geometryB);
197391
+ const handler = new _CurveCurveCloseApproachXY__WEBPACK_IMPORTED_MODULE_5__.CurveCurveCloseApproachXY(geometryA, geometryB);
197371
197392
  handler.maxDistanceToAccept = maxDistance;
197372
197393
  geometryA.dispatchToGeometryHandler(handler);
197373
197394
  return handler.grabPairedResults();
@@ -198136,8 +198157,8 @@ __webpack_require__.r(__webpack_exports__);
198136
198157
  /* harmony export */ "CurveLocationDetailArrayPair": () => (/* binding */ CurveLocationDetailArrayPair)
198137
198158
  /* harmony export */ });
198138
198159
  /* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
198139
- /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
198140
- /* harmony import */ var _geometry3d_CoincidentGeometryOps__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../geometry3d/CoincidentGeometryOps */ "../../core/geometry/lib/esm/geometry3d/CoincidentGeometryOps.js");
198160
+ /* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
198161
+ /* harmony import */ var _geometry3d_CoincidentGeometryOps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/CoincidentGeometryOps */ "../../core/geometry/lib/esm/geometry3d/CoincidentGeometryOps.js");
198141
198162
  /* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
198142
198163
  /* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
198143
198164
  /* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
@@ -198162,14 +198183,12 @@ __webpack_require__.r(__webpack_exports__);
198162
198183
 
198163
198184
 
198164
198185
 
198165
- // import { Arc3d } from "./Arc3d";
198166
198186
 
198167
198187
 
198168
198188
 
198169
198189
 
198170
198190
 
198171
198191
 
198172
- // import { LineString3d } from "./LineString3d";
198173
198192
 
198174
198193
 
198175
198194
 
@@ -198222,8 +198241,9 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
198222
198241
  * @param extendA flag to enable using extension of geometryA.
198223
198242
  * @param geometryB second curve for intersection. Saved for reference by specific handler methods.
198224
198243
  * @param extendB flag for extension of geometryB.
198244
+ * @param tolerance optional distance tolerance for coincidence
198225
198245
  */
198226
- constructor(worldToLocal, _geometryA, extendA, geometryB, extendB) {
198246
+ constructor(worldToLocal, _geometryA, extendA, geometryB, extendB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance) {
198227
198247
  super();
198228
198248
  // this.geometryA = _geometryA;
198229
198249
  this._extendA = extendA;
@@ -198236,7 +198256,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
198236
198256
  if (!this._worldToLocalAffine)
198237
198257
  this._worldToLocalPerspective = worldToLocal.clone();
198238
198258
  }
198239
- this._coincidentGeometryContext = _geometry3d_CoincidentGeometryOps__WEBPACK_IMPORTED_MODULE_3__.CoincidentGeometryQuery.create();
198259
+ this._coincidentGeometryContext = _geometry3d_CoincidentGeometryOps__WEBPACK_IMPORTED_MODULE_4__.CoincidentGeometryQuery.create(tolerance);
198240
198260
  this.reinitialize();
198241
198261
  }
198242
198262
  reinitialize() {
@@ -198255,13 +198275,15 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
198255
198275
  return false;
198256
198276
  return true;
198257
198277
  }
198258
- // Test the fraction by strict parameter, but allow physical (metric) test at ends.
198259
- acceptFractionOnLine(extend0, fraction, extend1, pointA, pointB) {
198278
+ /** Test the fraction by strict parameter, but allow toleranced distance test at ends.
198279
+ * @param tolerance optional distance tolerance to check proximity to start/end point
198280
+ */
198281
+ acceptFractionOnLine(extend0, fraction, extend1, pointA, pointB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance) {
198260
198282
  if (!extend0 && fraction < 0) {
198261
- return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance(fraction * pointA.distanceXY(pointB));
198283
+ return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isDistanceWithinTol(fraction * pointA.distanceXY(pointB), tolerance);
198262
198284
  }
198263
198285
  else if (!extend1 && fraction > 1.0)
198264
- return _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isSmallMetricDistance((fraction - 1.0) * pointA.distanceXY(pointB));
198286
+ return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isDistanceWithinTol((fraction - 1.0) * pointA.distanceXY(pointB), tolerance);
198265
198287
  return true;
198266
198288
  }
198267
198289
  /**
@@ -198276,7 +198298,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
198276
198298
  return result;
198277
198299
  }
198278
198300
  sameCurveAndFraction(cp, fraction, detail) {
198279
- return cp === detail.curve && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isAlmostEqualNumber(fraction, detail.fraction);
198301
+ return cp === detail.curve && _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isAlmostEqualNumber(fraction, detail.fraction);
198280
198302
  }
198281
198303
  /** compute intersection of two line segments.
198282
198304
  * filter by extension rules.
@@ -198288,14 +198310,14 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
198288
198310
  let globalFractionA1, globalFractionB1;
198289
198311
  const isInterval = intervalDetails !== undefined && intervalDetails.detailA.hasFraction1 && intervalDetails.detailB.hasFraction1;
198290
198312
  if (isInterval) {
198291
- globalFractionA = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction, fractionA1);
198292
- globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction, fractionB1);
198293
- globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction1, fractionA1);
198294
- globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction1, fractionB1);
198313
+ globalFractionA = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction, fractionA1);
198314
+ globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction, fractionB1);
198315
+ globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction1, fractionA1);
198316
+ globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction1, fractionB1);
198295
198317
  }
198296
198318
  else {
198297
- globalFractionA = globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.interpolate(fractionA0, localFractionA, fractionA1);
198298
- globalFractionB = globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
198319
+ globalFractionA = globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, localFractionA, fractionA1);
198320
+ globalFractionB = globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
198299
198321
  }
198300
198322
  // ignore duplicate of most recent point . ..
198301
198323
  const numPrevious = this._results.length;
@@ -198357,8 +198379,8 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
198357
198379
  this.recordPointWithLocalFractions(overlap.detailA.fraction, cpA, fractionA0, fractionA1, overlap.detailB.fraction, cpB, fractionB0, fractionB1, reversed, overlap);
198358
198380
  }
198359
198381
  else if (_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_6__.SmallSystem.lineSegment3dXYTransverseIntersectionUnbounded(pointA0, pointA1, pointB0, pointB1, uv)) {
198360
- if (this.acceptFractionOnLine(extendA0, uv.x, extendA1, pointA0, pointA1)
198361
- && this.acceptFractionOnLine(extendB0, uv.y, extendB1, pointB0, pointB1)) {
198382
+ if (this.acceptFractionOnLine(extendA0, uv.x, extendA1, pointA0, pointA1, this._coincidentGeometryContext.tolerance)
198383
+ && this.acceptFractionOnLine(extendB0, uv.y, extendB1, pointB0, pointB1, this._coincidentGeometryContext.tolerance)) {
198362
198384
  this.recordPointWithLocalFractions(uv.x, cpA, fractionA0, fractionA1, uv.y, cpB, fractionB0, fractionB1, reversed);
198363
198385
  }
198364
198386
  }
@@ -198416,9 +198438,9 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
198416
198438
  const data = arc.toTransformedPoint4d(this._worldToLocalPerspective);
198417
198439
  const pointA0H = this._worldToLocalPerspective.multiplyPoint3d(pointA0, 1);
198418
198440
  const pointA1H = this._worldToLocalPerspective.multiplyPoint3d(pointA1, 1);
198419
- const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.center);
198420
- const beta = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.vector0);
198421
- const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.vector90);
198441
+ const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.center);
198442
+ const beta = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.vector0);
198443
+ const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.vector90);
198422
198444
  const cosines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_7__.GrowableFloat64Array(2);
198423
198445
  const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_7__.GrowableFloat64Array(2);
198424
198446
  const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_7__.GrowableFloat64Array(2);
@@ -198440,9 +198462,9 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
198440
198462
  pointA0Local = this._worldToLocalAffine.multiplyPoint3d(pointA0);
198441
198463
  pointA1Local = this._worldToLocalAffine.multiplyPoint3d(pointA1);
198442
198464
  }
198443
- const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1);
198444
- const beta = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0);
198445
- const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0);
198465
+ const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1);
198466
+ const beta = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0);
198467
+ const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0);
198446
198468
  const cosines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_7__.GrowableFloat64Array(2);
198447
198469
  const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_7__.GrowableFloat64Array(2);
198448
198470
  const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_7__.GrowableFloat64Array(2);
@@ -198667,8 +198689,8 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
198667
198689
  let bezierBFraction = r;
198668
198690
  bezierB.fractionToPoint4d(bezierBFraction, this._xyzwB);
198669
198691
  const segmentAFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_6__.SmallSystem.lineSegment3dHXYClosestPointUnbounded(this._xyzwA0, this._xyzwA1, this._xyzwB);
198670
- if (segmentAFraction && _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {
198671
- let bezierAFraction = _Geometry__WEBPACK_IMPORTED_MODULE_4__.Geometry.interpolate(f0, segmentAFraction, f1);
198692
+ if (segmentAFraction && _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {
198693
+ let bezierAFraction = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(f0, segmentAFraction, f1);
198672
198694
  const xyMatchingFunction = new BezierBezierIntersectionXYRRToRRD(bezierA, bezierB);
198673
198695
  const newtonSearcher = new _numerics_Newton__WEBPACK_IMPORTED_MODULE_0__.Newton2dUnboundedWithDerivative(xyMatchingFunction);
198674
198696
  newtonSearcher.setUV(bezierAFraction, bezierBFraction);
@@ -213522,6 +213544,9 @@ class CoincidentGeometryQuery {
213522
213544
  constructor(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
213523
213545
  this._tolerance = tolerance;
213524
213546
  }
213547
+ get tolerance() {
213548
+ return this._tolerance;
213549
+ }
213525
213550
  static create(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
213526
213551
  return new CoincidentGeometryQuery(tolerance);
213527
213552
  }
@@ -218071,6 +218096,7 @@ __webpack_require__.r(__webpack_exports__);
218071
218096
 
218072
218097
 
218073
218098
  /* eslint-disable @itwin/prefer-get */
218099
+ // cSpell:words XXYZ YXYZ ZXYZ
218074
218100
  /**
218075
218101
  * PackedMatrix3dOps contains static methods for matrix operations where the matrix is a Float64Array.
218076
218102
  * * The Float64Array contains the matrix entries in row-major order
@@ -218698,7 +218724,8 @@ class Matrix3d {
218698
218724
  return undefined;
218699
218725
  }
218700
218726
  /**
218701
- * Construct a rigid matrix using vectorA and its 2 perpendicular.
218727
+ * Construct a rigid matrix (orthogonal matrix with +1 determinant) using vectorA and its 2 perpendicular.
218728
+ * * If axisOrder is not passed then `AxisOrder = AxisOrder.ZXY` is used as default.
218702
218729
  * * This function internally uses createPerpendicularVectorFavorXYPlane and createRigidFromColumns.
218703
218730
  */
218704
218731
  static createRigidHeadsUp(vectorA, axisOrder = _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.ZXY, result) {
@@ -218710,7 +218737,7 @@ class Matrix3d {
218710
218737
  }
218711
218738
  return Matrix3d.createIdentity(result);
218712
218739
  }
218713
- /** Return the matrix for rotation of `angle` around `axis` */
218740
+ /** Return the matrix for rotation of `angle` around desired `axis` */
218714
218741
  static createRotationAroundVector(axis, angle, result) {
218715
218742
  // Rodriguez formula (matrix form), https://mathworld.wolfram.com/RodriguesRotationFormula.html
218716
218743
  const c = angle.cos();
@@ -218724,7 +218751,7 @@ class Matrix3d {
218724
218751
  }
218725
218752
  return undefined;
218726
218753
  }
218727
- /** Returns a rotation of specified angle around an axis
218754
+ /** Returns a rotation of specified angle around one of the main axis (X,Y,Z).
218728
218755
  * @param axisIndex index of axis (AxisIndex.X, AxisIndex.Y, AxisIndex.Z) kept fixed by the rotation.
218729
218756
  * @param angle angle of rotation
218730
218757
  * @param result optional result matrix.
@@ -218747,14 +218774,33 @@ class Matrix3d {
218747
218774
  return myResult;
218748
218775
  }
218749
218776
  /**
218750
- * Replace current columns Ui and Uj with (c*Ui - s*Uj) and (c*Uj + s*Ui).
218751
- * * There is no checking for i,j being 0,1,2.
218752
- * * This is used in compute intensive inner loops
218753
- * @param i first row index. **must be 0,1,2** (unchecked)
218754
- * @param j second row index. **must be 0,1,2** (unchecked)
218755
- * @param c fist coefficient
218756
- * @param s second coefficient
218757
- */
218777
+ * Replace current rows Ui and Uj with (c*Ui + s*Uj) and (c*Uj - s*Ui).
218778
+ * * There is no checking for i,j being 0,1,2.
218779
+ * @param i first row index. **must be 0,1,2** (unchecked)
218780
+ * @param j second row index. **must be 0,1,2** (unchecked)
218781
+ * @param c fist coefficient
218782
+ * @param s second coefficient
218783
+ */
218784
+ applyGivensRowOp(i, j, c, s) {
218785
+ let ii = 3 * i;
218786
+ let jj = 3 * j;
218787
+ const limit = ii + 3;
218788
+ for (; ii < limit; ii++, jj++) {
218789
+ const a = this.coffs[ii];
218790
+ const b = this.coffs[jj];
218791
+ this.coffs[ii] = a * c + b * s;
218792
+ this.coffs[jj] = -a * s + b * c;
218793
+ }
218794
+ }
218795
+ /**
218796
+ * Replace current columns Ui and Uj with (c*Ui + s*Uj) and (c*Uj - s*Ui).
218797
+ * * There is no checking for i,j being 0,1,2.
218798
+ * * This is used in compute intensive inner loops
218799
+ * @param i first row index. **must be 0,1,2** (unchecked)
218800
+ * @param j second row index. **must be 0,1,2** (unchecked)
218801
+ * @param c fist coefficient
218802
+ * @param s second coefficient
218803
+ */
218758
218804
  applyGivensColumnOp(i, j, c, s) {
218759
218805
  const limit = i + 9;
218760
218806
  for (; i < limit; i += 3, j += 3) {
@@ -218765,12 +218811,12 @@ class Matrix3d {
218765
218811
  }
218766
218812
  }
218767
218813
  /**
218768
- * Create a matrix from column vectors.
218769
- * ```
218770
- * equation
218771
- * \begin{bmatrix}U_x & V_x & W_x \\ U_y & V_y & W_y \\ U_z & V_z & W_z \end{bmatrix}
218772
- * ```
218773
- */
218814
+ * Create a matrix from column vectors.
218815
+ * ```
218816
+ * equation
218817
+ * \begin{bmatrix}U_x & V_x & W_x \\ U_y & V_y & W_y \\ U_z & V_z & W_z \end{bmatrix}
218818
+ * ```
218819
+ */
218774
218820
  static createColumns(vectorU, vectorV, vectorW, result) {
218775
218821
  return Matrix3d.createRowValues(vectorU.x, vectorV.x, vectorW.x, vectorU.y, vectorV.y, vectorW.y, vectorU.z, vectorV.z, vectorW.z, result);
218776
218822
  }
@@ -218787,8 +218833,9 @@ class Matrix3d {
218787
218833
  * * ColumnX points in the rightVector direction
218788
218834
  * * ColumnY points in the upVector direction
218789
218835
  * * ColumnZ is a unit cross product of ColumnX and ColumnY.
218790
- * * Optionally rotate the standard cube by 45 degrees ccw around Y to bring its left or right vertical edge to center.
218791
- * * Optionally rotate the standard cube by 35.264 degrees ccw around X (isometric rotation).
218836
+ * * Optionally rotate by 45 degrees around `upVector` to bring its left or right vertical edge to center.
218837
+ * * Optionally rotate by arctan(1/sqrt(2)) ~ 35.264 degrees around `rightVector` to bring the top or bottom
218838
+ * horizontal edge of the view to the center (for isometric views).
218792
218839
  * * This is expected to be used with various principal unit vectors that are perpendicular to each other.
218793
218840
  * * STANDARD TOP VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitY(), 0, 0)
218794
218841
  * * STANDARD FRONT VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitZ(), 0, 0)
@@ -218796,16 +218843,20 @@ class Matrix3d {
218796
218843
  * * STANDARD RIGHT VIEW: createViewedAxes(Vector3d.unitY(), Vector3d.unitZ(), 0, 0)
218797
218844
  * * STANDARD LEFT VIEW: createViewedAxes(Vector3d.unitY(-1), Vector3d.unitZ(), 0, 0)
218798
218845
  * * STANDARD BOTTOM VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitY(-1), 0, 0)
218846
+ * * STANDARD ISO VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitZ(), -1, 1)
218847
+ * * STANDARD RIGHT ISO VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitZ(), 1, 1)
218848
+ * * Front, right, back, left, top, and bottom standard views are views from faces of the cube
218849
+ * and iso and right iso standard views are views from corners of the cube.
218799
218850
  * * Note: createViewedAxes is column-based so always returns local to world
218800
218851
  *
218801
218852
  * @param rightVector ColumnX of the returned matrix. Expected to be perpendicular to upVector.
218802
218853
  * @param upVector ColumnY of the returned matrix. Expected to be perpendicular to rightVector.
218803
- * @param leftNoneRight Specifies the ccw rotation around Y axis. Normally one of "-1", "0", and "1", where
218804
- * "-1" indicates rotation by 45 degrees to bring the left vertical edge to center, "0" means no rotation,
218854
+ * @param leftNoneRight Specifies the ccw rotation around `upVector` axis. Normally one of "-1", "0", and "1",
218855
+ * where "-1" indicates rotation by 45 degrees to bring the left vertical edge to center, "0" means no rotation,
218805
218856
  * and "1" indicates rotation by 45 degrees to bring the right vertical edge to center. Other numbers are
218806
218857
  * used as multiplier for this 45 degree rotation.
218807
- * @param topNoneBottom Specifies the ccw rotation around X axis. Normally one of "-1", "0", and "1", where
218808
- * "-1" indicates isometric rotation (35.264 degrees) to bring the bottom upward, "0" means no rotation,
218858
+ * @param topNoneBottom Specifies the ccw rotation around `rightVector` axis. Normally one of "-1", "0", and "1",
218859
+ * where "-1" indicates isometric rotation (35.264 degrees) to bring the bottom upward, "0" means no rotation,
218809
218860
  * and "1" indicates isometric rotation (35.264 degrees) to bring the top downward. Other numbers are
218810
218861
  * used as multiplier for the 35.264 degree rotation.
218811
218862
  * @returns matrix = [rightVector, upVector, rightVector cross upVector] with the applied rotations specified
@@ -218843,9 +218894,11 @@ class Matrix3d {
218843
218894
  * * Default is TOP view (`local X = world X`, `local Y = world Y`, `local Z = world Z`).
218844
218895
  * * To change view from the TOP to one of the other 7 standard views, we need to multiply "world data" to
218845
218896
  * the corresponding matrix1 provided by `createStandardWorldToView(index, false)` and then
218846
- * `matrix1.multiply(world data)` will returns "local data".
218897
+ * `matrix1.multiply(world data)` will return "local data".
218847
218898
  * * To change view back to the TOP, we need to multiply "local data" to the corresponding matrix2 provided
218848
218899
  * by `createStandardWorldToView(index, true)` and then `matrix2.multiply(local data)` will returns "world data".
218900
+ * * Note: No matter how you rotate the world axis, local X is always pointing right, local Y is always pointing up,
218901
+ * and local Z is always pointing toward you.
218849
218902
  *
218850
218903
  * @param index standard view index `StandardViewIndex.Top, Bottom, Left, Right, Front, Back, Iso, RightIso`
218851
218904
  * @param invert if false (default), the return matrix is world to local (view) and if true, the the return
@@ -218854,343 +218907,182 @@ class Matrix3d {
218854
218907
  */
218855
218908
  static createStandardWorldToView(index, invert = false, result) {
218856
218909
  switch (index) {
218857
- // start with TOP view, ccw rotation by 180 degrees around X
218910
+ // Start with TOP view, ccw rotation by 180 degrees around X
218858
218911
  case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Bottom:
218859
218912
  result = Matrix3d.createRowValues(1, 0, 0, 0, -1, 0, 0, 0, -1);
218860
218913
  break;
218861
- // start with TOP view, ccw rotation by -90 degrees around X and by 90 degrees around Z
218914
+ // Start with TOP view, ccw rotation by -90 degrees around X and by 90 degrees around Z
218862
218915
  case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Left:
218863
218916
  result = Matrix3d.createRowValues(0, -1, 0, 0, 0, 1, -1, 0, 0);
218864
218917
  break;
218865
- // start with TOP view, ccw rotation by -90 degrees around X and by -90 degrees around Z
218918
+ // Start with TOP view, ccw rotation by -90 degrees around X and by -90 degrees around Z
218866
218919
  case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Right:
218867
218920
  result = Matrix3d.createRowValues(0, 1, 0, 0, 0, 1, 1, 0, 0);
218868
218921
  break;
218869
- // start with TOP view, ccw rotation by -90 degrees around X
218922
+ // Start with TOP view, ccw rotation by -90 degrees around X
218870
218923
  case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Front:
218871
218924
  result = Matrix3d.createRowValues(1, 0, 0, 0, 0, 1, 0, -1, 0);
218872
218925
  break;
218873
- // start with TOP view, ccw rotation by -90 degrees around X and by 180 degrees around Z
218926
+ // Start with TOP view, ccw rotation by -90 degrees around X and by 180 degrees around Z
218874
218927
  case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Back:
218875
218928
  result = Matrix3d.createRowValues(-1, 0, 0, 0, 0, 1, 0, 1, 0);
218876
218929
  break;
218930
+ /**
218931
+ * Isometric view
218932
+ * Start with FRONT view, ccw rotation by -45 degrees around Y and by arctan(1/sqrt(2)) ~ 35.264 degrees around X
218933
+ * cos(45) = 1/sqrt(2) = 0.70710678118 and sin(45) = 1/sqrt(2) = 0.70710678118
218934
+ * cos(35.264) = 2/sqrt(6) = 0.81649658092 and sin(35.264) = 1/sqrt(3) = 0.57735026919
218935
+ * More info: https://en.wikipedia.org/wiki/Isometric_projection
218936
+ */
218877
218937
  case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Iso:
218878
- // start with FRONT view, ccw rotation by -45 degrees around Y and by 35.264 degrees around X
218879
218938
  result = Matrix3d.createRowValues(0.707106781186548, -0.70710678118654757, 0.00000000000000000, 0.408248290463863, 0.40824829046386302, 0.81649658092772603, -0.577350269189626, -0.57735026918962573, 0.57735026918962573);
218880
218939
  break;
218940
+ // Start with FRONT view, ccw rotation by 45 degrees around Y and by 35.264 degrees around X
218881
218941
  case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.RightIso:
218882
218942
  result = Matrix3d.createRowValues(0.707106781186548, 0.70710678118654757, 0.00000000000000000, -0.408248290463863, 0.40824829046386302, 0.81649658092772603, 0.577350269189626, -0.57735026918962573, 0.57735026918962573);
218883
218943
  break;
218884
- case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Top: // no rotation
218944
+ // no rotation
218945
+ case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Top:
218885
218946
  default:
218886
218947
  result = Matrix3d.createIdentity(result);
218887
218948
  }
218888
218949
  if (invert)
218889
- result.transposeInPlace();
218950
+ result.transposeInPlace(); // matrix is rigid so transpose and inverse are the same
218890
218951
  return result;
218891
218952
  }
218892
- /*
218893
- // this implementation has problems distinguishing failure (normalize) from small angle.
218894
- public getAxisAndAngleOfRotation(): { axis: Vector3d, angle: Angle, error: boolean } {
218895
-
218896
- const result = { axis: Vector3d.unitZ(), angle: Angle.createRadians(0), error: true };
218897
- if (this.isIdentity) {
218898
- result.error = false;
218899
- return result;
218900
- }
218901
- if (!this.isRigid())
218902
- return result;
218903
- const QMinusI = this.clone();
218904
- QMinusI.coffs[0] -= 1.0;
218905
- QMinusI.coffs[4] -= 1.0;
218906
- QMinusI.coffs[8] -= 1.0;
218907
- // Each column of (Q - I) is the motion of the corresponding axis vector
218908
- // during the rotation.
218909
- // Only one of the three axes can really be close to the rotation axis.
218910
- const delta0 = QMinusI.columnX();
218911
- const delta1 = QMinusI.columnY();
218912
- const delta2 = QMinusI.columnZ();
218913
- const cross01 = delta0.crossProduct(delta1);
218914
- const cross12 = delta1.crossProduct(delta2);
218915
- const cross20 = delta2.crossProduct(delta0);
218916
-
218917
- const aa01 = cross01.magnitudeSquared();
218918
- const aa12 = cross12.magnitudeSquared();
218919
- const aa20 = cross20.magnitudeSquared();
218920
-
218921
- const cross = cross01.clone(); // This will end up as the biggest cross product
218922
- const v0 = delta0.clone(); // This will end up as one of the two largest delta vectors
218923
- let aaMax = aa01;
218924
- if (aa12 > aaMax) {
218925
- cross.setFrom(cross12);
218926
- aaMax = aa12;
218927
- v0.setFrom(delta1);
218928
- }
218929
- if (aa20 > aaMax) {
218930
- cross.setFrom(cross20);
218931
- aaMax = aa20;
218932
- v0.setFrom(delta2);
218933
- }
218934
-
218935
- if (aaMax === 0.0) {
218936
- // The vectors did not move. Just accept the zero rotation, with error flag set.
218937
- return result;
218938
- }
218939
-
218940
- v0.normalizeInPlace();
218941
- // V0 is a unit vector perpendicular to the rotation axis.
218942
- // Rotate it. Its image V1 is also a unit vector, and the angle from V0 to V1 is the quat angle.
218943
- // CrossProduct is axis vector times sine of angle.
218944
- // Dot Product is cosine of angle.
218945
- // V2 is zero in 180 degree case, so we use the Cross from the search as the axis
218946
- // as direction, being careful to keep sine positive.
218947
- const v1 = this.multiplyVector(v0);
218948
- const v2 = v0.crossProduct(v1);
218949
- const sine = v2.magnitude();
218950
- if (v2.dotProduct(cross) < 0.0)
218951
- cross.scaleInPlace(-1.0);
218952
- const cosine = v0.dotProduct(v1);
218953
- result.angle.setRadians(Math.atan2(sine, cosine));
218954
- result.axis.setFrom(cross);
218955
- result.error = !result.axis.tryNormalizeInPlace();
218956
- return result
218953
+ /**
218954
+ * Apply (in place) a jacobi update that zeros out this.at(i,j).
218955
+ * @param i row index of zeroed member
218956
+ * @param j column index of zeroed member
218957
+ * @param k other row/column index (different from i and j)
218958
+ * @param leftEigenVectors a matrix that its columns will be filled by eigenvectors of this Matrix3d
218959
+ * (allocated by caller, computed and filled by this function)
218960
+ */
218961
+ applyFastSymmetricJacobiUpdate(i, j, k, leftEigenVectors) {
218962
+ const indexII = 4 * i;
218963
+ const indexJJ = 4 * j;
218964
+ const indexIJ = 3 * i + j;
218965
+ const indexIK = 3 * i + k;
218966
+ const indexJK = 3 * j + k;
218967
+ const dotUU = this.coffs[indexII];
218968
+ const dotVV = this.coffs[indexJJ];
218969
+ const dotUV = this.coffs[indexIJ];
218970
+ const jacobi = _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.trigValuesToHalfAngleTrigValues(dotUU - dotVV, 2.0 * dotUV);
218971
+ if (Math.abs(dotUV) < 1.0e-15 * (dotUU + dotVV))
218972
+ return 0.0;
218973
+ const c = jacobi.c;
218974
+ const s = jacobi.s;
218975
+ const cc = c * c;
218976
+ const ss = s * s;
218977
+ const sc2 = 2.0 * c * s;
218978
+ this.coffs[indexII] = cc * dotUU + sc2 * dotUV + ss * dotVV;
218979
+ this.coffs[indexJJ] = ss * dotUU - sc2 * dotUV + cc * dotVV;
218980
+ this.coffs[indexIJ] = 0.0;
218981
+ const a = this.coffs[indexIK];
218982
+ const b = this.coffs[indexJK];
218983
+ this.coffs[indexIK] = a * c + b * s;
218984
+ this.coffs[indexJK] = -s * a + c * b;
218985
+ this.coffs[3 * j + i] = 0.0;
218986
+ this.coffs[3 * k + i] = this.coffs[indexIK];
218987
+ this.coffs[3 * k + j] = this.coffs[indexJK];
218988
+ leftEigenVectors.applyGivensColumnOp(i, j, c, s);
218989
+ return Math.abs(dotUV);
218990
+ }
218991
+ /**
218992
+ * Factor this (symmetrized) as a product U * lambda * UT where U is orthogonal, lambda is diagonal.
218993
+ * The upper triangle is mirrored to lower triangle to enforce symmetry.
218994
+ * @param leftEigenvectors a matrix that its columns will be filled by eigenvectors of this Matrix3d
218995
+ * (allocated by caller, computed and filled by this function)
218996
+ * @param lambda a vector that its entries will be filled by eigenvalues of this Matrix3d
218997
+ * (allocated by caller, computed and filled by this function)
218998
+ */
218999
+ fastSymmetricEigenvalues(leftEigenvectors, lambda) {
219000
+ const matrix = this.clone();
219001
+ leftEigenvectors.setIdentity();
219002
+ const tolerance = 1.0e-12 * this.sumSquares();
219003
+ for (let iteration = 0; iteration < 7; iteration++) {
219004
+ const sum = matrix.applyFastSymmetricJacobiUpdate(0, 1, 2, leftEigenvectors)
219005
+ + matrix.applyFastSymmetricJacobiUpdate(0, 2, 1, leftEigenvectors)
219006
+ + matrix.applyFastSymmetricJacobiUpdate(1, 2, 0, leftEigenvectors);
219007
+ // console.log("symmetric sum", sum);
219008
+ // console.log ("sum", sum);
219009
+ if (sum < tolerance) {
219010
+ // console.log("symmetric iterations", iteration);
219011
+ lambda.set(matrix.at(0, 0), matrix.at(1, 1), matrix.at(2, 2));
219012
+ return true;
219013
+ }
219014
+ }
219015
+ return false;
218957
219016
  }
218958
- */
218959
219017
  /**
218960
219018
  * Compute the (unit vector) axis and angle of rotation.
219019
+ * * math details can be found at docs/learning/geometry/Angle.md
218961
219020
  * @returns Returns axis and angle of rotation with result.ok === true when the conversion succeeded.
218962
219021
  */
218963
219022
  getAxisAndAngleOfRotation() {
218964
219023
  const trace = this.coffs[0] + this.coffs[4] + this.coffs[8];
218965
- // trace = (xx + yy * zz) * (1-c) + 3 * c = 1 + 2c ==> c = (trace-1) / 2
218966
- const skewXY = this.coffs[3] - this.coffs[1]; // == 2sz
218967
- const skewYZ = this.coffs[7] - this.coffs[5]; // == 2sx
218968
- const skewZX = this.coffs[2] - this.coffs[6]; // == 2sy
218969
- const c = (trace - 1.0) / 2.0;
218970
- const s = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(skewXY, skewYZ, skewZX) / 2.0;
218971
- const e = c * c + s * s - 1.0;
219024
+ const skewXY = this.coffs[3] - this.coffs[1]; // 2*z*sin
219025
+ const skewYZ = this.coffs[7] - this.coffs[5]; // 2*y*sin
219026
+ const skewZX = this.coffs[2] - this.coffs[6]; // 2*x*sin
219027
+ // trace = (m00^2 + m11^2 + m22^2) * (1-cos) + 3cos = (1-cos) + 3cos = 1 + 2cos ==> cos = (trace-1) / 2
219028
+ const c = (trace - 1.0) / 2.0; // cosine
219029
+ const s = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(skewXY, skewYZ, skewZX) / 2.0; // sine
219030
+ const e = c * c + s * s - 1.0; // s^2 + c^2 = 1
219031
+ // if s^2 + c^2 != 1 then we have a bad matrix so return false
218972
219032
  if (Math.abs(e) > _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallAngleRadians) {
218973
- // the sine and cosine are not a unit circle point. bad matrix . ..
218974
219033
  return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(0), ok: false };
218975
219034
  }
219035
+ // sin is close to 0 then we got to special cases (angle 0 or 180) which needs to be handled differently
218976
219036
  if (Math.abs(s) < _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallAngleRadians) {
218977
- // There is no significant skew.
218978
- // The matrix is symmetric
218979
- // So it has simple eigenvalues -- either (1,1,1) or (1,-1,-1).
218980
- if (c > 0) // no rotation
219037
+ if (c > 0) // sin = 0 and cos = 1 so angle = 0 (i.e., no rotation)
218981
219038
  return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(0), ok: true };
218982
- // 180 degree flip around some axis ?
218983
- // Look for the simple case of a principal rotation ...
218984
- // look for a pair of (-1) entries on the diagonal ...
219039
+ /**
219040
+ * If sin = 0 and cos = -1 then angle = 180 (i.e., 180 degree rotation around some axis)
219041
+ * then the rotation matrix becomes
219042
+ * 2x^2-1 2xy 2xz
219043
+ * 2xy 2y^2-1 2yz
219044
+ * 2xz 2yz 2z^2-1
219045
+ * Note that the matrix is symmetric.
219046
+ * If rotation is around one the standard basis then non-diagonal entries become 0 and we
219047
+ * have one 1 and two -1s on the diagonal.
219048
+ * If rotation is around an axis other than standard basis, then the axis is the eigenvector
219049
+ * of the rotation matrix with eigenvalue = 1.
219050
+ */
218985
219051
  const axx = this.coffs[0];
218986
219052
  const ayy = this.coffs[4];
218987
219053
  const azz = this.coffs[8];
218988
- const theta180 = _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(180);
218989
- // Look for principal axis flips as a special case . ..
219054
+ // Look for a pair of "-1" entries on the diagonal (for rotation around the basis X,Y,Z axis)
218990
219055
  if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1.0, ayy) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1, azz)) {
218991
- // rotate around
218992
- return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(1, 0, 0), angle: theta180, ok: true };
219056
+ return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(1, 0, 0), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(180), ok: true };
218993
219057
  }
218994
219058
  else if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1.0, axx) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1, azz)) {
218995
- return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 1, 0), angle: theta180, ok: true };
219059
+ return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 1, 0), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(180), ok: true };
218996
219060
  }
218997
219061
  else if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1.0, axx) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1, ayy)) {
218998
- return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, 1), angle: theta180, ok: true };
219062
+ return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(180), ok: true };
218999
219063
  }
219000
- // 180 degree flip around some other axis ...
219001
- // eigenvalues will have 1.0 once, -1.0 twice.
219002
- // These cases look for each place (x,y,z) that the 1.0 might appear.
219003
- // But fastSymmetricEigenvalues reliably always seems to put the 1.0 as the x eigenvalue.
219004
- // so only the getColumn(0) return seems reachable in unit tests.
219064
+ // Look for eigenvector with eigenvalue = 1
219005
219065
  const eigenvectors = Matrix3d.createIdentity();
219006
219066
  const eigenvalues = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, 0);
219007
219067
  if (this.fastSymmetricEigenvalues(eigenvectors, eigenvalues)) {
219008
219068
  for (let axisIndex = 0; axisIndex < 2; axisIndex++) {
219009
219069
  const lambda = eigenvalues.at(axisIndex);
219010
219070
  if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(1, lambda))
219011
- return { axis: eigenvectors.getColumn(axisIndex), angle: theta180, ok: true };
219071
+ return { axis: eigenvectors.getColumn(axisIndex), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(180), ok: true };
219012
219072
  }
219013
- // Don't know if this can be reached ....
219073
+ // if no eigenvalue = 1 was found return false
219014
219074
  return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(0), ok: false };
219015
219075
  }
219076
+ // if no axis was found return false
219016
219077
  return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(0), ok: false };
219017
219078
  }
219079
+ // good matrix and non-zero sine
219018
219080
  const a = 1.0 / (2.0 * s);
219019
- const result = { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(skewYZ * a, skewZX * a, skewXY * a), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createAtan2(s, c), ok: true };
219020
- return result;
219021
- }
219022
- /**
219023
- * Returns a matrix that rotates from vectorA to vectorB.
219024
- */
219025
- static createRotationVectorToVector(vectorA, vectorB, result) {
219026
- return this.createPartialRotationVectorToVector(vectorA, 1.0, vectorB, result);
219027
- }
219028
- /**
219029
- * Return a matrix that rotates a fraction of the angular sweep from vectorA to vectorB.
219030
- * @param vectorA initial vector position
219031
- * @param fraction fractional rotation. 1.0 is "all the way"
219032
- * @param vectorB final vector position
219033
- * @param result optional result matrix.
219034
- */
219035
- static createPartialRotationVectorToVector(vectorA, fraction, vectorB, result) {
219036
- let upVector = vectorA.unitCrossProduct(vectorB);
219037
- if (upVector) { // the usual case --
219038
- return Matrix3d.createRotationAroundVector(upVector, _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(fraction * vectorA.planarAngleTo(vectorB, upVector).radians));
219039
- }
219040
- // fail if either vector is zero ...
219041
- if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(vectorA.magnitude())
219042
- || _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(vectorB.magnitude()))
219043
- return undefined;
219044
- // nonzero but aligned vectors ...
219045
- if (vectorA.dotProduct(vectorB) > 0.0)
219046
- return Matrix3d.createIdentity(result);
219047
- // nonzero opposing vectors ..
219048
- upVector = Matrix3d.createPerpendicularVectorFavorPlaneContainingZ(vectorA, upVector);
219049
- return Matrix3d.createRotationAroundVector(upVector, _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(fraction * Math.PI));
219050
- }
219051
- /** Create a 90 degree rotation around a principal axis */
219052
- static create90DegreeRotationAroundAxis(axisIndex) {
219053
- axisIndex = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.cyclic3dAxis(axisIndex);
219054
- if (axisIndex === 0) {
219055
- const retVal = Matrix3d.createRowValues(1, 0, 0, 0, 0, -1, 0, 1, 0);
219056
- retVal.setupInverseTranspose();
219057
- return retVal;
219058
- }
219059
- else if (axisIndex === 1) {
219060
- const retVal = Matrix3d.createRowValues(0, 0, 1, 0, 1, 0, -1, 0, 0);
219061
- retVal.setupInverseTranspose();
219062
- return retVal;
219063
- }
219064
- else {
219065
- const retVal = Matrix3d.createRowValues(0, -1, 0, 1, 0, 0, 0, 0, 1);
219066
- retVal.setupInverseTranspose();
219067
- return retVal;
219068
- }
219069
- }
219070
- /** Return (a copy of) the X column */
219071
- columnX(result) { return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[0], this.coffs[3], this.coffs[6], result); }
219072
- /** Return (a copy of)the Y column */
219073
- columnY(result) { return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[1], this.coffs[4], this.coffs[7], result); }
219074
- /** Return (a copy of)the Z column */
219075
- columnZ(result) { return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[2], this.coffs[5], this.coffs[8], result); }
219076
- /** Return the X column magnitude squared */
219077
- columnXMagnitudeSquared() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[0], this.coffs[3], this.coffs[6]); }
219078
- /** Return the Y column magnitude squared */
219079
- columnYMagnitudeSquared() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[1], this.coffs[4], this.coffs[7]); }
219080
- /** Return the Z column magnitude squared */
219081
- columnZMagnitudeSquared() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[2], this.coffs[5], this.coffs[8]); }
219082
- /** Return the X column magnitude */
219083
- columnXMagnitude() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[0], this.coffs[3], this.coffs[6]); }
219084
- /** Return the Y column magnitude */
219085
- columnYMagnitude() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[1], this.coffs[4], this.coffs[7]); }
219086
- /** Return the Z column magnitude */
219087
- columnZMagnitude() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[2], this.coffs[5], this.coffs[8]); }
219088
- /** Return magnitude of columnX cross columnY. */
219089
- columnXYCrossProductMagnitude() {
219090
- return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.crossProductMagnitude(this.coffs[0], this.coffs[3], this.coffs[6], this.coffs[1], this.coffs[4], this.coffs[7]);
219091
- }
219092
- /** Return the X row magnitude d */
219093
- rowXMagnitude() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[0], this.coffs[1], this.coffs[2]); }
219094
- /** Return the Y row magnitude */
219095
- rowYMagnitude() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[3], this.coffs[4], this.coffs[5]); }
219096
- /** Return the Z row magnitude */
219097
- rowZMagnitude() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[6], this.coffs[7], this.coffs[8]); }
219098
- /** Return the dot product of column X with column Y */
219099
- /** Return the dot product of column X with column Y */
219100
- columnXDotColumnY() {
219101
- return this.coffs[0] * this.coffs[1]
219102
- + this.coffs[3] * this.coffs[4]
219103
- + this.coffs[6] * this.coffs[7];
219104
- }
219105
- /**
219106
- * Dot product of an indexed column with a vector given as x,y,z
219107
- * @param columnIndex index of column. Must be 0,1,2
219108
- * @param x x component of vector
219109
- * @param y y component of vector
219110
- * @param z z component of vector
219111
- */
219112
- columnDotXYZ(columnIndex, x, y, z) {
219113
- return this.coffs[columnIndex] * x + this.coffs[columnIndex + 3] * y + this.coffs[columnIndex + 6] * z;
219114
- }
219115
- /** Return (a copy of) the X row */
219116
- rowX(result) { return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[0], this.coffs[1], this.coffs[2], result); }
219117
- /** Return (a copy of) the Y row */
219118
- rowY(result) { return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[3], this.coffs[4], this.coffs[5], result); }
219119
- /** Return (a copy of) the Z row */
219120
- rowZ(result) { return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[6], this.coffs[7], this.coffs[8], result); }
219121
- /** Return the dot product of the vector parameter with the X column. */
219122
- dotColumnX(vector) { return vector.x * this.coffs[0] + vector.y * this.coffs[3] + vector.z * this.coffs[6]; }
219123
- /** Return the dot product of the vector parameter with the Y column. */
219124
- dotColumnY(vector) { return vector.x * this.coffs[1] + vector.y * this.coffs[4] + vector.z * this.coffs[7]; }
219125
- /** Return the dot product of the vector parameter with the Z column. */
219126
- dotColumnZ(vector) { return vector.x * this.coffs[2] + vector.y * this.coffs[5] + vector.z * this.coffs[8]; }
219127
- /** Return the dot product of the vector parameter with the X row. */
219128
- dotRowX(vector) { return vector.x * this.coffs[0] + vector.y * this.coffs[1] + vector.z * this.coffs[2]; }
219129
- /** Return the dot product of the vector parameter with the Y row. */
219130
- dotRowY(vector) { return vector.x * this.coffs[3] + vector.y * this.coffs[4] + vector.z * this.coffs[5]; }
219131
- /** Return the dot product of the vector parameter with the Z row. */
219132
- dotRowZ(vector) { return vector.x * this.coffs[6] + vector.y * this.coffs[7] + vector.z * this.coffs[8]; }
219133
- // cSpell:words XXYZ YXYZ ZXYZ XYZAs Eigen
219134
- /** Return the dot product of the x,y,z with the X row. */
219135
- dotRowXXYZ(x, y, z) { return x * this.coffs[0] + y * this.coffs[1] + z * this.coffs[2]; }
219136
- /** Return the dot product of the x,y,z with the Y row. */
219137
- dotRowYXYZ(x, y, z) { return x * this.coffs[3] + y * this.coffs[4] + z * this.coffs[5]; }
219138
- /** Return the dot product of the x,y,z with the Z row. */
219139
- dotRowZXYZ(x, y, z) { return x * this.coffs[6] + y * this.coffs[7] + z * this.coffs[8]; }
219140
- /** Return the (vector) cross product of the Z column with the vector parameter. */
219141
- columnZCrossVector(vector, result) {
219142
- return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.crossProductXYZXYZ(this.coffs[2], this.coffs[5], this.coffs[8], vector.x, vector.y, vector.z, result);
219143
- }
219144
- /*
219145
- * Replace current rows Ui Uj with (c*Ui - s*Uj) and (c*Uj + s*Ui).
219146
- * @param i first row index. must be 0,1,2 (unchecked)
219147
- * @param j second row index. must be 0,1,2 (unchecked)
219148
- * @param c fist coefficient
219149
- * @param s second coefficient
219150
- */
219151
- applyGivensRowOp(i, j, c, s) {
219152
- let ii = 3 * i;
219153
- let jj = 3 * j;
219154
- const limit = ii + 3;
219155
- for (; ii < limit; ii++, jj++) {
219156
- const a = this.coffs[ii];
219157
- const b = this.coffs[jj];
219158
- this.coffs[ii] = a * c + b * s;
219159
- this.coffs[jj] = -a * s + b * c;
219160
- }
219161
- }
219162
- /**
219163
- * create a rigid coordinate frame column z parallel to (_x_,_y_,_z_) and column x in the xy plane.
219164
- * * column z points from origin to x,y,z
219165
- * * column x is perpendicular and in the xy plane
219166
- * * column y is perpendicular to both. It is the "up" vector on the view plane.
219167
- * * Multiplying a world vector times the transpose of this matrix transforms into the view xy
219168
- * * Multiplying the matrix times the an in-view vector transforms the vector to world.
219169
- * @param x eye x coordinate
219170
- * @param y eye y coordinate
219171
- * @param z eye z coordinate
219172
- * @param result
219173
- */
219174
- static createRigidViewAxesZTowardsEye(x, y, z, result) {
219175
- result = Matrix3d.createIdentity(result);
219176
- const rxy = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXY(x, y);
219177
- if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(rxy)) {
219178
- // special case for top or bottom view.
219179
- if (z < 0.0)
219180
- result.scaleColumnsInPlace(1.0, -1, -1.0);
219181
- }
219182
- else {
219183
- // const d = Geometry.hypotenuseSquaredXYZ(x, y, z);
219184
- const c = x / rxy;
219185
- const s = y / rxy;
219186
- result.setRowValues(-s, 0, c, c, 0, s, 0, 1, 0);
219187
- if (z !== 0.0) {
219188
- const r = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(x, y, z);
219189
- const s1 = z / r;
219190
- const c1 = rxy / r;
219191
- result.applyGivensColumnOp(1, 2, c1, -s1);
219192
- }
219193
- }
219081
+ const result = {
219082
+ axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(skewYZ * a, skewZX * a, skewXY * a),
219083
+ angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createAtan2(s, c),
219084
+ ok: true,
219085
+ };
219194
219086
  return result;
219195
219087
  }
219196
219088
  /** Rotate so columns i and j become perpendicular */
@@ -219222,8 +219114,7 @@ class Matrix3d {
219222
219114
  factorPerpendicularColumns(matrixC, matrixU) {
219223
219115
  matrixC.setFrom(this);
219224
219116
  matrixU.setIdentity();
219225
- const ss = this.sumSquares();
219226
- const tolerance = 1.0e-12 * ss;
219117
+ const tolerance = 1.0e-12 * this.sumSquares();
219227
219118
  for (let iteration = 0; iteration < 7; iteration++) {
219228
219119
  const sum = matrixC.applyJacobiColumnRotation(0, 1, matrixU)
219229
219120
  + matrixC.applyJacobiColumnRotation(0, 2, matrixU)
@@ -219314,8 +219205,7 @@ class Matrix3d {
219314
219205
  matrix.coffs[3] = matrix.coffs[1];
219315
219206
  matrix.coffs[6] = matrix.coffs[2];
219316
219207
  matrix.coffs[7] = matrix.coffs[5];
219317
- const ss = this.sumSquares();
219318
- const tolerance = 1.0e-12 * ss;
219208
+ const tolerance = 1.0e-12 * this.sumSquares();
219319
219209
  for (let iteration = 0; iteration < 7; iteration++) {
219320
219210
  const sum = leftEigenvectors.applySymmetricJacobi(0, 1, matrix)
219321
219211
  + leftEigenvectors.applySymmetricJacobi(0, 2, matrix)
@@ -219330,68 +219220,174 @@ class Matrix3d {
219330
219220
  }
219331
219221
  return false;
219332
219222
  }
219333
- /** Apply (in place a jacobi update that zeros out this.at(i,j).
219334
- *
219223
+ /**
219224
+ * Return a matrix that rotates a fraction of the angular sweep from vectorA to vectorB.
219225
+ * @param vectorA initial vector position
219226
+ * @param fraction fractional rotation (1 means rotate all the way)
219227
+ * @param vectorB final vector position
219228
+ * @param result optional result matrix.
219335
219229
  */
219336
- applyFastSymmetricJacobiUpdate(i, // row index of zeroed member
219337
- j, // column index of zeroed member
219338
- k, // other row/column index (different from i and j)
219339
- leftEigenVectors) {
219340
- const indexII = 4 * i;
219341
- const indexJJ = 4 * j;
219342
- const indexIJ = 3 * i + j;
219343
- const indexIK = 3 * i + k;
219344
- const indexJK = 3 * j + k;
219345
- const dotUU = this.coffs[indexII];
219346
- const dotVV = this.coffs[indexJJ];
219347
- const dotUV = this.coffs[indexIJ];
219348
- const jacobi = _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.trigValuesToHalfAngleTrigValues(dotUU - dotVV, 2.0 * dotUV);
219349
- if (Math.abs(dotUV) < 1.0e-15 * (dotUU + dotVV))
219350
- return 0.0;
219351
- const c = jacobi.c;
219352
- const s = jacobi.s;
219353
- const cc = c * c;
219354
- const ss = s * s;
219355
- const sc2 = 2.0 * c * s;
219356
- this.coffs[indexII] = cc * dotUU + sc2 * dotUV + ss * dotVV;
219357
- this.coffs[indexJJ] = ss * dotUU - sc2 * dotUV + cc * dotVV;
219358
- this.coffs[indexIJ] = 0.0;
219359
- const a = this.coffs[indexIK];
219360
- const b = this.coffs[indexJK];
219361
- this.coffs[indexIK] = a * c + b * s;
219362
- this.coffs[indexJK] = -s * a + c * b;
219363
- this.coffs[3 * j + i] = 0.0;
219364
- this.coffs[3 * k + i] = this.coffs[indexIK];
219365
- this.coffs[3 * k + j] = this.coffs[indexJK];
219366
- leftEigenVectors.applyGivensColumnOp(i, j, c, s);
219367
- return Math.abs(dotUV);
219230
+ static createPartialRotationVectorToVector(vectorA, fraction, vectorB, result) {
219231
+ let upVector = vectorA.unitCrossProduct(vectorB);
219232
+ // the usual case (both vectors and also their cross product is non-zero)
219233
+ if (upVector) {
219234
+ return Matrix3d.createRotationAroundVector(upVector, _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(fraction * vectorA.planarAngleTo(vectorB, upVector).radians));
219235
+ }
219236
+ // if either vector is zero
219237
+ if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(vectorA.magnitude())
219238
+ || _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(vectorB.magnitude()))
219239
+ return undefined;
219240
+ // aligned vectors (cross product = 0, dot product > 0)
219241
+ if (vectorA.dotProduct(vectorB) > 0.0)
219242
+ return Matrix3d.createIdentity(result);
219243
+ // opposing vectors (cross product = 0, dot product < 0)
219244
+ upVector = Matrix3d.createPerpendicularVectorFavorPlaneContainingZ(vectorA, upVector);
219245
+ return Matrix3d.createRotationAroundVector(upVector, _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(fraction * Math.PI));
219246
+ }
219247
+ /** Returns a matrix that rotates from vectorA to vectorB. */
219248
+ static createRotationVectorToVector(vectorA, vectorB, result) {
219249
+ return this.createPartialRotationVectorToVector(vectorA, 1.0, vectorB, result);
219250
+ }
219251
+ /** Create a 90 degree rotation around a principal axis */
219252
+ static create90DegreeRotationAroundAxis(axisIndex) {
219253
+ axisIndex = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.cyclic3dAxis(axisIndex);
219254
+ if (axisIndex === 0) {
219255
+ const retVal = Matrix3d.createRowValues(1, 0, 0, 0, 0, -1, 0, 1, 0);
219256
+ retVal.setupInverseTranspose();
219257
+ return retVal;
219258
+ }
219259
+ else if (axisIndex === 1) {
219260
+ const retVal = Matrix3d.createRowValues(0, 0, 1, 0, 1, 0, -1, 0, 0);
219261
+ retVal.setupInverseTranspose();
219262
+ return retVal;
219263
+ }
219264
+ else {
219265
+ const retVal = Matrix3d.createRowValues(0, -1, 0, 1, 0, 0, 0, 0, 1);
219266
+ retVal.setupInverseTranspose();
219267
+ return retVal;
219268
+ }
219269
+ }
219270
+ /** Return (a copy of) the X column */
219271
+ columnX(result) {
219272
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[0], this.coffs[3], this.coffs[6], result);
219273
+ }
219274
+ /** Return (a copy of) the Y column */
219275
+ columnY(result) {
219276
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[1], this.coffs[4], this.coffs[7], result);
219277
+ }
219278
+ /** Return (a copy of) the Z column */
219279
+ columnZ(result) {
219280
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[2], this.coffs[5], this.coffs[8], result);
219281
+ }
219282
+ /** Return the X column magnitude squared */
219283
+ columnXMagnitudeSquared() {
219284
+ return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[0], this.coffs[3], this.coffs[6]);
219285
+ }
219286
+ /** Return the Y column magnitude squared */
219287
+ columnYMagnitudeSquared() {
219288
+ return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[1], this.coffs[4], this.coffs[7]);
219289
+ }
219290
+ /** Return the Z column magnitude squared */
219291
+ columnZMagnitudeSquared() {
219292
+ return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[2], this.coffs[5], this.coffs[8]);
219293
+ }
219294
+ /** Return the X column magnitude */
219295
+ columnXMagnitude() {
219296
+ return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[0], this.coffs[3], this.coffs[6]);
219297
+ }
219298
+ /** Return the Y column magnitude */
219299
+ columnYMagnitude() {
219300
+ return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[1], this.coffs[4], this.coffs[7]);
219301
+ }
219302
+ /** Return the Z column magnitude */
219303
+ columnZMagnitude() {
219304
+ return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[2], this.coffs[5], this.coffs[8]);
219305
+ }
219306
+ /** Return magnitude of columnX cross columnY. */
219307
+ columnXYCrossProductMagnitude() {
219308
+ return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.crossProductMagnitude(this.coffs[0], this.coffs[3], this.coffs[6], this.coffs[1], this.coffs[4], this.coffs[7]);
219309
+ }
219310
+ /** Return the X row magnitude */
219311
+ rowXMagnitude() {
219312
+ return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[0], this.coffs[1], this.coffs[2]);
219313
+ }
219314
+ /** Return the Y row magnitude */
219315
+ rowYMagnitude() {
219316
+ return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[3], this.coffs[4], this.coffs[5]);
219317
+ }
219318
+ /** Return the Z row magnitude */
219319
+ rowZMagnitude() {
219320
+ return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[6], this.coffs[7], this.coffs[8]);
219321
+ }
219322
+ /** Return the dot product of column X with column Y */
219323
+ columnXDotColumnY() {
219324
+ return this.coffs[0] * this.coffs[1]
219325
+ + this.coffs[3] * this.coffs[4]
219326
+ + this.coffs[6] * this.coffs[7];
219368
219327
  }
219369
219328
  /**
219370
- * Factor this (symmetrized) as a product U * lambda * UT where U is orthogonal, lambda is diagonal.
219371
- * The upper triangle is mirrored to lower triangle to enforce symmetry.
219372
- * @param matrixC (allocate by caller, computed here)
219373
- * @param factor (allocate by caller, computed here)
219329
+ * Dot product of an indexed column with a vector given as x,y,z
219330
+ * @param columnIndex index of column. Must be 0,1,2.
219331
+ * @param x x component of vector
219332
+ * @param y y component of vector
219333
+ * @param z z component of vector
219374
219334
  */
219375
- fastSymmetricEigenvalues(leftEigenvectors, lambda) {
219376
- const matrix = this.clone();
219377
- leftEigenvectors.setIdentity();
219378
- const ss = this.sumSquares();
219379
- const tolerance = 1.0e-12 * ss;
219380
- for (let iteration = 0; iteration < 7; iteration++) {
219381
- const sum = matrix.applyFastSymmetricJacobiUpdate(0, 1, 2, leftEigenvectors)
219382
- + matrix.applyFastSymmetricJacobiUpdate(0, 2, 1, leftEigenvectors)
219383
- + matrix.applyFastSymmetricJacobiUpdate(1, 2, 0, leftEigenvectors);
219384
- // console.log("symmetric sum", sum);
219385
- // console.log (" sum", sum);
219386
- if (sum < tolerance) {
219387
- // console.log("symmetric iterations", iteration);
219388
- lambda.set(matrix.at(0, 0), matrix.at(1, 1), matrix.at(2, 2));
219389
- return true;
219390
- }
219391
- }
219392
- return false;
219335
+ columnDotXYZ(columnIndex, x, y, z) {
219336
+ return this.coffs[columnIndex] * x + this.coffs[columnIndex + 3] * y + this.coffs[columnIndex + 6] * z;
219337
+ }
219338
+ /** Return (a copy of) the X row */
219339
+ rowX(result) {
219340
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[0], this.coffs[1], this.coffs[2], result);
219341
+ }
219342
+ /** Return (a copy of) the Y row */
219343
+ rowY(result) {
219344
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[3], this.coffs[4], this.coffs[5], result);
219345
+ }
219346
+ /** Return (a copy of) the Z row */
219347
+ rowZ(result) {
219348
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[6], this.coffs[7], this.coffs[8], result);
219393
219349
  }
219394
- /** Install data from xyz parts of Point4d (w part of Point4d ignored) */
219350
+ /** Return the dot product of the vector parameter with the X column. */
219351
+ dotColumnX(vector) {
219352
+ return vector.x * this.coffs[0] + vector.y * this.coffs[3] + vector.z * this.coffs[6];
219353
+ }
219354
+ /** Return the dot product of the vector parameter with the Y column. */
219355
+ dotColumnY(vector) {
219356
+ return vector.x * this.coffs[1] + vector.y * this.coffs[4] + vector.z * this.coffs[7];
219357
+ }
219358
+ /** Return the dot product of the vector parameter with the Z column. */
219359
+ dotColumnZ(vector) {
219360
+ return vector.x * this.coffs[2] + vector.y * this.coffs[5] + vector.z * this.coffs[8];
219361
+ }
219362
+ /** Return the dot product of the vector parameter with the X row. */
219363
+ dotRowX(vector) {
219364
+ return vector.x * this.coffs[0] + vector.y * this.coffs[1] + vector.z * this.coffs[2];
219365
+ }
219366
+ /** Return the dot product of the vector parameter with the Y row. */
219367
+ dotRowY(vector) {
219368
+ return vector.x * this.coffs[3] + vector.y * this.coffs[4] + vector.z * this.coffs[5];
219369
+ }
219370
+ /** Return the dot product of the vector parameter with the Z row. */
219371
+ dotRowZ(vector) {
219372
+ return vector.x * this.coffs[6] + vector.y * this.coffs[7] + vector.z * this.coffs[8];
219373
+ }
219374
+ /** Return the dot product of the x,y,z with the X row. */
219375
+ dotRowXXYZ(x, y, z) {
219376
+ return x * this.coffs[0] + y * this.coffs[1] + z * this.coffs[2];
219377
+ }
219378
+ /** Return the dot product of the x,y,z with the Y row. */
219379
+ dotRowYXYZ(x, y, z) {
219380
+ return x * this.coffs[3] + y * this.coffs[4] + z * this.coffs[5];
219381
+ }
219382
+ /** Return the dot product of the x,y,z with the Z row. */
219383
+ dotRowZXYZ(x, y, z) {
219384
+ return x * this.coffs[6] + y * this.coffs[7] + z * this.coffs[8];
219385
+ }
219386
+ /** Return the cross product of the Z column with the vector parameter. */
219387
+ columnZCrossVector(vector, result) {
219388
+ return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.crossProductXYZXYZ(this.coffs[2], this.coffs[5], this.coffs[8], vector.x, vector.y, vector.z, result);
219389
+ }
219390
+ /** Set data from xyz parts of Point4d (w part of Point4d ignored) */
219395
219391
  setColumnsPoint4dXYZ(vectorU, vectorV, vectorW) {
219396
219392
  this.inverseState = InverseMatrixState.unknown;
219397
219393
  this.setRowValues(vectorU.x, vectorV.x, vectorW.x, vectorU.y, vectorV.y, vectorW.y, vectorU.z, vectorV.z, vectorW.z);
@@ -219415,16 +219411,22 @@ class Matrix3d {
219415
219411
  this.coffs[index + 6] = 0.0;
219416
219412
  }
219417
219413
  }
219418
- /** Set all columns of the matrix. Any undefined vector is zeros. */
219414
+ /**
219415
+ * Set all columns of the matrix. Any undefined vector is zeros.
219416
+ * @param vectorX values for column 0
219417
+ * @param vectorY values for column 1
219418
+ * @param vectorZ optional values for column 2 (it's optional in case column 2 is 000, which is a
219419
+ * projection onto the xy-plane)
219420
+ */
219419
219421
  setColumns(vectorX, vectorY, vectorZ) {
219420
219422
  this.setColumn(0, vectorX);
219421
219423
  this.setColumn(1, vectorY);
219422
219424
  this.setColumn(2, vectorZ);
219423
219425
  }
219424
219426
  /**
219425
- * set entries in one row of the matrix.
219426
- * @param rowIndex row index. this is interpreted cyclically.
219427
- * @param value x,yz, values for row. If undefined, zeros are installed.
219427
+ * Set entries in one row of the matrix.
219428
+ * @param rowIndex row index. This is interpreted cyclically (using Geometry.cyclic3dAxis).
219429
+ * @param value x,y,z values for row.
219428
219430
  */
219429
219431
  setRow(rowIndex, value) {
219430
219432
  const index = 3 * _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.cyclic3dAxis(rowIndex);
@@ -219433,21 +219435,26 @@ class Matrix3d {
219433
219435
  this.coffs[index + 2] = value.z;
219434
219436
  this.inverseState = InverseMatrixState.unknown;
219435
219437
  }
219436
- /** Return a (copy of) a column of the matrix.
219437
- * @param i column index. This is corrected to 012 by Geometry.cyclic3dAxis.
219438
+ /**
219439
+ * Return (a copy of) a column of the matrix.
219440
+ * @param i column index. This is interpreted cyclically (using Geometry.cyclic3dAxis).
219441
+ * @param result optional preallocated result.
219438
219442
  */
219439
219443
  getColumn(columnIndex, result) {
219440
219444
  const index = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.cyclic3dAxis(columnIndex);
219441
219445
  return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[index], this.coffs[index + 3], this.coffs[index + 6], result);
219442
219446
  }
219443
- /** Return a (copy of) a row of the matrix.
219444
- * @param i row index. This is corrected to 012 by Geometry.cyclic3dAxis.
219447
+ /**
219448
+ * Return a (copy of) a row of the matrix.
219449
+ * @param i row index. This is interpreted cyclically (using Geometry.cyclic3dAxis).
219450
+ * @param result optional preallocated result.
219445
219451
  */
219446
219452
  getRow(columnIndex, result) {
219447
219453
  const index = 3 * _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.cyclic3dAxis(columnIndex);
219448
219454
  return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[index], this.coffs[index + 1], this.coffs[index + 2], result);
219449
219455
  }
219450
- /** Create a matrix from row vectors.
219456
+ /**
219457
+ * Create a matrix from row vectors.
219451
219458
  * ```
219452
219459
  * equation
219453
219460
  * \begin{bmatrix}U_x & U_y & U_z \\ V_x & V_y & V_z \\ W_x & W_y & W_z \end{bmatrix}
@@ -219456,13 +219463,18 @@ class Matrix3d {
219456
219463
  static createRows(vectorU, vectorV, vectorW, result) {
219457
219464
  return Matrix3d.createRowValues(vectorU.x, vectorU.y, vectorU.z, vectorV.x, vectorV.y, vectorV.z, vectorW.x, vectorW.y, vectorW.z, result);
219458
219465
  }
219459
- /** Create a matrix that scales along a specified direction.
219460
- * * The scale factor can be negative.
219461
- * * A scale of -1.0 (negative one) is a mirror across the plane perpendicular to the vector.
219466
+ /**
219467
+ * Create a matrix that scales along a specified `direction`. This means if you multiply the returned matrix
219468
+ * by a `vector`, you get `directional scale` of that `vector`. Suppose `plane` is the plane perpendicular
219469
+ * to the `direction`. When scale = 0, `directional scale` is projection of the `vector` to the `plane`.
219470
+ * When scale = 1, `directional scale` is the `vector` itself. When scale = -1, `directional scale` is
219471
+ * mirror of the `vector` across the `plane`. In general, When scale != 0, the result is computed by first
219472
+ * projecting the `vector` to the `plane`, then translating that projection along the `direction` (if scale > 0)
219473
+ * or in opposite direction (if scale < 0).
219462
219474
  * ```
219463
219475
  * equation
219464
- * \text{The matrix is } I - (s-1) U U^T
219465
- * \\ \text{with }U\text{ being the unit vector in the direction of the input vector.}
219476
+ * \text{The matrix is } I + (s-1) D D^T
219477
+ * \\ \text{with }D\text{ being the normalized direction vector and }s\text{ being the scale.}
219466
219478
  * ```
219467
219479
  */
219468
219480
  static createDirectionalScale(direction, scale, result) {
@@ -219471,19 +219483,13 @@ class Matrix3d {
219471
219483
  const x = unit.x;
219472
219484
  const y = unit.y;
219473
219485
  const z = unit.z;
219474
- const a = (scale - 1);
219486
+ const a = scale - 1;
219475
219487
  return Matrix3d.createRowValues(1 + a * x * x, a * x * y, a * x * z, a * y * x, 1 + a * y * y, a * y * z, a * z * x, a * z * y, 1 + a * z * z, result);
219476
219488
  }
219477
219489
  return Matrix3d.createUniformScale(scale);
219478
219490
  }
219479
- /* Create a matrix with the indicated column in the (normalized) direction, and the other two columns perpendicular. All columns are normalized.
219480
- * * The direction vector is normalized and appears in column axisIndex
219481
- * * If the direction vector is not close to Z, the "next" column ((axisIndex + 1) mod 3) will be in the XY plane in the direction of (direction cross Z)
219482
- * * If the direction vector is close to Z, the "next" column ((axisIndex + 1) mode 3) will be in the direction of (direction cross Y)
219483
- */
219484
- // static create1Vector(direction: Vector3d, axisIndex: number): Matrix3d;
219485
- // static createFromXYVectors(vectorX: Vector3d, vectorY: Vector3d, axisIndex: number): Matrix3d;
219486
- /** Multiply the matrix * vector, treating the vector is a column vector on the right.
219491
+ /**
219492
+ * Multiply `matrix * vector`, treating the vector is a column vector on the right.
219487
219493
  * ```
219488
219494
  * equation
219489
219495
  * \matrixXY{A}\columnSubXYZ{U}
@@ -219494,36 +219500,38 @@ class Matrix3d {
219494
219500
  const x = vectorU.x;
219495
219501
  const y = vectorU.y;
219496
219502
  const z = vectorU.z;
219497
- return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create((this.coffs[0] * x + this.coffs[1] * y + this.coffs[2] * z), (this.coffs[3] * x + this.coffs[4] * y + this.coffs[5] * z), (this.coffs[6] * x + this.coffs[7] * y + this.coffs[8] * z), result);
219503
+ return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[0] * x + this.coffs[1] * y + this.coffs[2] * z, this.coffs[3] * x + this.coffs[4] * y + this.coffs[5] * z, this.coffs[6] * x + this.coffs[7] * y + this.coffs[8] * z, result);
219498
219504
  }
219499
- /** Multiply matrix * vector for each array member, i.e. the vector is a column vector on the right.
219500
- * @return the vector result
219505
+ /**
219506
+ * Multiply `matrix * vector` in place for vector in the array, i.e. treating the vector is a column
219507
+ * vector on the right.
219508
+ * * Each `vector` is updated to be `matrix * vector`
219501
219509
  */
219502
219510
  multiplyVectorArrayInPlace(data) {
219503
219511
  for (const v of data)
219504
- v.set((this.coffs[0] * v.x + this.coffs[1] * v.y + this.coffs[2] * v.z), (this.coffs[3] * v.x + this.coffs[4] * v.y + this.coffs[5] * v.z), (this.coffs[6] * v.x + this.coffs[7] * v.y + this.coffs[8] * v.z));
219512
+ v.set(this.coffs[0] * v.x + this.coffs[1] * v.y + this.coffs[2] * v.z, this.coffs[3] * v.x + this.coffs[4] * v.y + this.coffs[5] * v.z, this.coffs[6] * v.x + this.coffs[7] * v.y + this.coffs[8] * v.z);
219505
219513
  }
219506
- /** compute `origin - matrix * vector` */
219514
+ /** Compute `origin - matrix * vector` */
219507
219515
  static xyzMinusMatrixTimesXYZ(origin, matrix, vector, result) {
219508
219516
  const x = vector.x;
219509
219517
  const y = vector.y;
219510
219518
  const z = vector.z;
219511
219519
  return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(origin.x - (matrix.coffs[0] * x + matrix.coffs[1] * y + matrix.coffs[2] * z), origin.y - (matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z), origin.z - (matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z), result);
219512
219520
  }
219513
- /** compute `origin + matrix * vector` using only the xy parts of the inputs. */
219521
+ /** Compute `origin + matrix * vector` using only the xy parts of the inputs. */
219514
219522
  static xyPlusMatrixTimesXY(origin, matrix, vector, result) {
219515
219523
  const x = vector.x;
219516
219524
  const y = vector.y;
219517
219525
  return _Point2dVector2d__WEBPACK_IMPORTED_MODULE_3__.Point2d.create(origin.x + matrix.coffs[0] * x + matrix.coffs[1] * y, origin.y + matrix.coffs[3] * x + matrix.coffs[4] * y, result);
219518
219526
  }
219519
- /** compute `origin + matrix * vector` using all xyz parts of the inputs. */
219527
+ /** Compute `origin + matrix * vector` using all xyz parts of the inputs. */
219520
219528
  static xyzPlusMatrixTimesXYZ(origin, matrix, vector, result) {
219521
219529
  const x = vector.x;
219522
219530
  const y = vector.y;
219523
219531
  const z = vector.z;
219524
219532
  return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(origin.x + matrix.coffs[0] * x + matrix.coffs[1] * y + matrix.coffs[2] * z, origin.y + matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z, origin.z + matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z, result);
219525
219533
  }
219526
- /** compute `origin + matrix * vector` using all xyz parts of the inputs. */
219534
+ /** Updates vector to be `origin + matrix * vector` using all xyz parts of the inputs. */
219527
219535
  static xyzPlusMatrixTimesXYZInPlace(origin, matrix, vector) {
219528
219536
  const x = vector.x;
219529
219537
  const y = vector.y;
@@ -219532,61 +219540,72 @@ class Matrix3d {
219532
219540
  vector.y = origin.y + matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z;
219533
219541
  vector.z = origin.z + matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z;
219534
219542
  }
219535
- /** compute `origin + matrix * vector` where the final vector is given as direct x,y,z coordinates */
219543
+ /** Compute `origin + matrix * vector` where the final vector is given as direct x,y,z coordinates */
219536
219544
  static xyzPlusMatrixTimesCoordinates(origin, matrix, x, y, z, result) {
219537
219545
  return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Point3d.create(origin.x + matrix.coffs[0] * x + matrix.coffs[1] * y + matrix.coffs[2] * z, origin.y + matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z, origin.z + matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z, result);
219538
219546
  }
219539
219547
  /**
219540
219548
  * Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row.
219541
- * Multiply times point with coordinates `[x,y,z,w]`
219549
+ * Multiply the 4x4 matrix by `[x,y,z,w]`
219550
+ * ```
219551
+ * equation
219552
+ * \begin{bmatrix}M_0 & M_1 & M_2 & Ox \\ M_3 & M_4 & M_5 & Oy \\ M_6 & M_7 & M_8 & Oz \\ 0 & 0 & 0 & 1\end{bmatrix} * \begin{bmatrix}x \\ y \\ z \\ w\end{bmatrix}
219553
+ * ```
219542
219554
  * @param origin translation part (xyz in column 3)
219543
219555
  * @param matrix matrix part (leading 3x3)
219544
219556
  * @param x x part of multiplied point
219545
219557
  * @param y y part of multiplied point
219546
219558
  * @param z z part of multiplied point
219547
219559
  * @param w w part of multiplied point
219548
- * @param result optional result.
219560
+ * @param result optional preallocated result.
219549
219561
  */
219550
219562
  static xyzPlusMatrixTimesWeightedCoordinates(origin, matrix, x, y, z, w, result) {
219551
- return _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_4__.Point4d.create(w * origin.x + matrix.coffs[0] * x + matrix.coffs[1] * y + matrix.coffs[2] * z, w * origin.y + matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z, w * origin.z + matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z, w, result);
219563
+ return _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_4__.Point4d.create(matrix.coffs[0] * x + matrix.coffs[1] * y + matrix.coffs[2] * z + origin.x * w, matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z + origin.y * w, matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z + origin.z * w, w, result);
219552
219564
  }
219553
219565
  /**
219554
219566
  * Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row.
219555
- * Multiply times point with coordinates `[x,y,z,w]`
219567
+ * Multiply the 4x4 matrix by `[x,y,z,w]`
219568
+ * ```
219569
+ * equation
219570
+ * \begin{bmatrix}M_0 & M_1 & M_2 & Ox \\ M_3 & M_4 & M_5 & Oy \\ M_6 & M_7 & M_8 & Oz \\ 0 & 0 & 0 & 1\end{bmatrix} * \begin{bmatrix}x \\ y \\ z \\ w\end{bmatrix}
219571
+ * ```
219556
219572
  * @param origin translation part (xyz in column 3)
219557
219573
  * @param matrix matrix part (leading 3x3)
219558
219574
  * @param x x part of multiplied point
219559
219575
  * @param y y part of multiplied point
219560
219576
  * @param z z part of multiplied point
219561
219577
  * @param w w part of multiplied point
219562
- * @param result optional result.
219578
+ * @param result optional preallocated result.
219563
219579
  */
219564
219580
  static xyzPlusMatrixTimesWeightedCoordinatesToFloat64Array(origin, matrix, x, y, z, w, result) {
219565
219581
  if (!result)
219566
219582
  result = new Float64Array(4);
219567
- result[0] = w * origin.x + matrix.coffs[0] * x + matrix.coffs[1] * y + matrix.coffs[2] * z;
219568
- result[1] = w * origin.y + matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z;
219569
- result[2] = w * origin.z + matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z;
219583
+ result[0] = matrix.coffs[0] * x + matrix.coffs[1] * y + matrix.coffs[2] * z + origin.x * w;
219584
+ result[1] = matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z + origin.y * w;
219585
+ result[2] = matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z + origin.z * w;
219570
219586
  result[3] = w;
219571
219587
  return result;
219572
219588
  }
219573
219589
  /**
219574
- * Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row.
219575
- * Multiply times point with coordinates `[x,y,z,w]`
219590
+ * Treat the 3x3 matrix and origin as a 3x4 matrix.
219591
+ * * Multiply the 3x4 matrix by `[x,y,z,1]`
219592
+ * ```
219593
+ * equation
219594
+ * \begin{bmatrix}M_0 & M_1 & M_2 & Ox \\ M_3 & M_4 & M_5 & Oy \\ M_6 & M_7 & M_8 & Oz\end{bmatrix} * \begin{bmatrix}x \\ y \\ z \\ 1\end{bmatrix}
219595
+ * ```
219576
219596
  * @param origin translation part (xyz in column 3)
219577
219597
  * @param matrix matrix part (leading 3x3)
219578
219598
  * @param x x part of multiplied point
219579
219599
  * @param y y part of multiplied point
219580
219600
  * @param z z part of multiplied point
219581
- * @param w w part of multiplied point
219582
- * @param result optional result.
219601
+ * @param result optional preallocated result.
219583
219602
  */
219584
219603
  static xyzPlusMatrixTimesCoordinatesToFloat64Array(origin, matrix, x, y, z, result) {
219585
219604
  if (!result)
219586
219605
  result = new Float64Array(3);
219587
- result[0] = origin.x + matrix.coffs[0] * x + matrix.coffs[1] * y + matrix.coffs[2] * z;
219588
- result[1] = origin.y + matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z;
219589
- result[2] = origin.z + matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z;
219606
+ result[0] = matrix.coffs[0] * x + matrix.coffs[1] * y + matrix.coffs[2] * z + origin.x;
219607
+ result[1] = matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z + origin.y;
219608
+ result[2] = matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z + origin.z;
219590
219609
  return result;
219591
219610
  }
219592
219611
  /**
@@ -219606,9 +219625,9 @@ class Matrix3d {
219606
219625
  const x = vector.x;
219607
219626
  const y = vector.y;
219608
219627
  const z = vector.z;
219609
- result.x = (this.coffs[0] * x + this.coffs[3] * y + this.coffs[6] * z);
219610
- result.y = (this.coffs[1] * x + this.coffs[4] * y + this.coffs[7] * z);
219611
- result.z = (this.coffs[2] * x + this.coffs[5] * y + this.coffs[8] * z);
219628
+ result.x = this.coffs[0] * x + this.coffs[3] * y + this.coffs[6] * z;
219629
+ result.y = this.coffs[1] * x + this.coffs[4] * y + this.coffs[7] * z;
219630
+ result.z = this.coffs[2] * x + this.coffs[5] * y + this.coffs[8] * z;
219612
219631
  return result;
219613
219632
  }
219614
219633
  /** Multiply the matrix * (x,y,z), i.e. the vector (x,y,z) is a column vector on the right.
@@ -220136,7 +220155,7 @@ class Matrix3d {
220136
220155
  * @param scaleX scale factor for column x
220137
220156
  * @param scaleY scale factor for column y
220138
220157
  * @param scaleZ scale factor for column z
220139
- * @param result optional result.
220158
+ * @param result optional preallocated result.
220140
220159
  */
220141
220160
  scaleColumns(scaleX, scaleY, scaleZ, result) {
220142
220161
  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);
@@ -220157,7 +220176,7 @@ class Matrix3d {
220157
220176
  this.coffs[7] *= scaleY;
220158
220177
  this.coffs[8] *= scaleZ;
220159
220178
  if (this.inverseState === InverseMatrixState.inverseStored && this.inverseCoffs !== undefined) {
220160
- // apply reciprocal scales to the ROWS of the inverse . . .
220179
+ // apply reverse scales to the ROWS of the inverse
220161
220180
  const divX = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(1.0, scaleX);
220162
220181
  const divY = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(1.0, scaleY);
220163
220182
  const divZ = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(1.0, scaleZ);
@@ -220180,7 +220199,7 @@ class Matrix3d {
220180
220199
  * @param scaleX scale factor for row x
220181
220200
  * @param scaleY scale factor for row y
220182
220201
  * @param scaleZ scale factor for row z
220183
- * @param result optional result.
220202
+ * @param result optional preallocated result.
220184
220203
  */
220185
220204
  scaleRows(scaleX, scaleY, scaleZ, result) {
220186
220205
  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);
@@ -220224,12 +220243,49 @@ class Matrix3d {
220224
220243
  }
220225
220244
  /** create a Matrix3d whose values are uniformly scaled from this.
220226
220245
  * @param scale scale factor to apply.
220227
- * @param result optional result.
220246
+ * @param result optional preallocated result.
220228
220247
  * @returns Return the new or repopulated matrix
220229
220248
  */
220230
220249
  scale(scale, result) {
220231
220250
  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);
220232
220251
  }
220252
+ /**
220253
+ * Create a rigid matrix (columns and rows are unit length and pairwise perpendicular) for
220254
+ * the given eye coordinate.
220255
+ * * column z is parallel to x,y,z
220256
+ * * column x is perpendicular to column z and is in the xy plane
220257
+ * * column y is perpendicular to both. It is the "up" vector on the view plane.
220258
+ * * Multiplying the returned matrix times a local (view) vector gives the world vector.
220259
+ * * Multiplying transpose of the returned matrix times a world vector gives the local
220260
+ * (view) vector.
220261
+ * @param x eye x coordinate
220262
+ * @param y eye y coordinate
220263
+ * @param z eye z coordinate
220264
+ * @param result optional preallocated result
220265
+ */
220266
+ static createRigidViewAxesZTowardsEye(x, y, z, result) {
220267
+ result = Matrix3d.createIdentity(result);
220268
+ const rxy = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXY(x, y);
220269
+ // if coordinate is (0,0,z), i.e., Top or Bottom view
220270
+ if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(rxy)) {
220271
+ if (z < 0.0)
220272
+ result.scaleColumnsInPlace(1.0, -1.0, -1.0);
220273
+ }
220274
+ else {
220275
+ const c = x / rxy;
220276
+ const s = y / rxy;
220277
+ // if coordinate is (x,y,0), i.e., Front or Back or Left or Right view
220278
+ result.setRowValues(-s, 0, c, c, 0, s, 0, 1, 0);
220279
+ // if coordinate is (x,y,z), i.e., other views such as Iso or RightIso
220280
+ if (z !== 0.0) {
220281
+ const r = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(x, y, z);
220282
+ const s1 = z / r;
220283
+ const c1 = rxy / r;
220284
+ result.applyGivensColumnOp(1, 2, c1, -s1);
220285
+ }
220286
+ }
220287
+ return result;
220288
+ }
220233
220289
  /** Return the determinant of this matrix. */
220234
220290
  determinant() {
220235
220291
  return this.coffs[0] * this.coffs[4] * this.coffs[8]
@@ -223237,7 +223293,7 @@ class Vector3d extends XYZ {
223237
223293
  return { v: this.safeDivideOrNull(magnitude, result), mag: magnitude };
223238
223294
  }
223239
223295
  /**
223240
- * Return a unit vector parallel with this. Return undefined if this.magnitude is near zero.
223296
+ * Return a unit vector parallel with this. Return undefined if this.magnitude is near zero.
223241
223297
  * @param result optional result.
223242
223298
  */
223243
223299
  normalize(result) {
@@ -228676,7 +228732,7 @@ class Segment1d {
228676
228732
  */
228677
228733
  reverseInPlace() { const x = this.x0; this.x0 = this.x1; this.x1 = x; }
228678
228734
  /**
228679
- * * if `x1<x0` multiplied by the scale factor is (strictly) negative, swap the x0 and x1 member values.
228735
+ * * if `x1-x0` multiplied by the scale factor is (strictly) negative, swap the x0 and x1 member values.
228680
228736
  * * This makes the fractionToPoint evaluates reverse direction.
228681
228737
  */
228682
228738
  reverseIfNeededForDeltaSign(sign = 1) {
@@ -287028,7 +287084,7 @@ class TestContext {
287028
287084
  this.initializeRpcInterfaces({ title: this.settings.Backend.name, version: this.settings.Backend.version });
287029
287085
  const iModelClient = new imodels_client_management_1.IModelsClient({ api: { baseUrl: `https://${(_a = process.env.IMJS_URL_PREFIX) !== null && _a !== void 0 ? _a : ""}api.bentley.com/imodels` } });
287030
287086
  await core_frontend_1.NoRenderApp.startup({
287031
- applicationVersion: "4.0.0-dev.7",
287087
+ applicationVersion: "4.0.0-dev.8",
287032
287088
  applicationId: this.settings.gprid,
287033
287089
  authorizationClient: new frontend_1.TestFrontendAuthorizationClient(this.adminUserAccessToken),
287034
287090
  hubAccess: new imodels_access_frontend_1.FrontendIModelsAccess(iModelClient),
@@ -306457,7 +306513,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
306457
306513
  /***/ ((module) => {
306458
306514
 
306459
306515
  "use strict";
306460
- module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.0-dev.7","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.7","@itwin/core-bentley":"workspace:^4.0.0-dev.7","@itwin/core-common":"workspace:^4.0.0-dev.7","@itwin/core-geometry":"workspace:^4.0.0-dev.7","@itwin/core-orbitgt":"workspace:^4.0.0-dev.7","@itwin/core-quantity":"workspace:^4.0.0-dev.7"},"//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/lodash":"^4.14.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.4.0","@itwin/cloud-agnostic-core":"~1.4.0","@itwin/object-storage-core":"~1.4.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","lodash":"^4.17.10","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"}}]}}');
306516
+ module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.0-dev.8","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.8","@itwin/core-bentley":"workspace:^4.0.0-dev.8","@itwin/core-common":"workspace:^4.0.0-dev.8","@itwin/core-geometry":"workspace:^4.0.0-dev.8","@itwin/core-orbitgt":"workspace:^4.0.0-dev.8","@itwin/core-quantity":"workspace:^4.0.0-dev.8"},"//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/lodash":"^4.14.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.4.0","@itwin/cloud-agnostic-core":"~1.4.0","@itwin/object-storage-core":"~1.4.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","lodash":"^4.17.10","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"}}]}}');
306461
306517
 
306462
306518
  /***/ }),
306463
306519