@itwin/ecschema-rpcinterface-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.
- package/lib/dist/bundled-tests.js +533 -477
- package/lib/dist/bundled-tests.js.map +1 -1
- package/package.json +16 -16
|
@@ -190305,9 +190305,9 @@ class Geometry {
|
|
|
190305
190305
|
return 2 - ((-axis - 1) % 3);
|
|
190306
190306
|
}
|
|
190307
190307
|
/** Return the AxisOrder for which axisIndex is the first named axis.
|
|
190308
|
-
* * `axisIndex===0`returns AxisOrder.XYZ
|
|
190309
|
-
* * `axisIndex===1`returns AxisOrder.YZX
|
|
190310
|
-
* * `axisIndex===2`returns AxisOrder.ZXY
|
|
190308
|
+
* * `axisIndex === 0` returns `AxisOrder.XYZ`
|
|
190309
|
+
* * `axisIndex === 1` returns `AxisOrder.YZX`
|
|
190310
|
+
* * `axisIndex === 2` returns `AxisOrder.ZXY`
|
|
190311
190311
|
*/
|
|
190312
190312
|
static axisIndexToRightHandedAxisOrder(axisIndex) {
|
|
190313
190313
|
if (axisIndex === 0)
|
|
@@ -190319,7 +190319,9 @@ class Geometry {
|
|
|
190319
190319
|
return Geometry.axisIndexToRightHandedAxisOrder(Geometry.cyclic3dAxis(axisIndex));
|
|
190320
190320
|
}
|
|
190321
190321
|
/** Return the largest absolute distance from a to either of b0 or b1 */
|
|
190322
|
-
static maxAbsDiff(a, b0, b1) {
|
|
190322
|
+
static maxAbsDiff(a, b0, b1) {
|
|
190323
|
+
return Math.max(Math.abs(a - b0), Math.abs(a - b1));
|
|
190324
|
+
}
|
|
190323
190325
|
/** Return the largest absolute absolute value among x,y,z */
|
|
190324
190326
|
static maxAbsXYZ(x, y, z) {
|
|
190325
190327
|
return Geometry.maxXYZ(Math.abs(x), Math.abs(y), Math.abs(z));
|
|
@@ -190364,19 +190366,33 @@ class Geometry {
|
|
|
190364
190366
|
return q;
|
|
190365
190367
|
}
|
|
190366
190368
|
/** Return the hypotenuse `sqrt(x*x + y*y)`. This is much faster than `Math.hypot(x,y)`. */
|
|
190367
|
-
static hypotenuseXY(x, y) {
|
|
190369
|
+
static hypotenuseXY(x, y) {
|
|
190370
|
+
return Math.sqrt(x * x + y * y);
|
|
190371
|
+
}
|
|
190368
190372
|
/** Return the squared `hypotenuse (x*x + y*y)`. */
|
|
190369
|
-
static hypotenuseSquaredXY(x, y) {
|
|
190373
|
+
static hypotenuseSquaredXY(x, y) {
|
|
190374
|
+
return x * x + y * y;
|
|
190375
|
+
}
|
|
190370
190376
|
/** Return the square of x */
|
|
190371
|
-
static square(x) {
|
|
190377
|
+
static square(x) {
|
|
190378
|
+
return x * x;
|
|
190379
|
+
}
|
|
190372
190380
|
/** Return the hypotenuse `sqrt(x*x + y*y + z*z)`. This is much faster than `Math.hypot(x,y,z)`. */
|
|
190373
|
-
static hypotenuseXYZ(x, y, z) {
|
|
190381
|
+
static hypotenuseXYZ(x, y, z) {
|
|
190382
|
+
return Math.sqrt(x * x + y * y + z * z);
|
|
190383
|
+
}
|
|
190374
190384
|
/** Return the squared hypotenuse `(x*x + y*y + z*z)`. This is much faster than `Math.hypot(x,y,z)`. */
|
|
190375
|
-
static hypotenuseSquaredXYZ(x, y, z) {
|
|
190385
|
+
static hypotenuseSquaredXYZ(x, y, z) {
|
|
190386
|
+
return x * x + y * y + z * z;
|
|
190387
|
+
}
|
|
190376
190388
|
/** 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)`. */
|
|
190377
|
-
static hypotenuseXYZW(x, y, z, w) {
|
|
190389
|
+
static hypotenuseXYZW(x, y, z, w) {
|
|
190390
|
+
return Math.sqrt(x * x + y * y + z * z + w * w);
|
|
190391
|
+
}
|
|
190378
190392
|
/** Return the squared hypotenuse `(x*x + y*y + z*z+w*w)`. This is much faster than `Math.hypot(x,y,z)`. */
|
|
190379
|
-
static hypotenuseSquaredXYZW(x, y, z, w) {
|
|
190393
|
+
static hypotenuseSquaredXYZW(x, y, z, w) {
|
|
190394
|
+
return x * x + y * y + z * z + w * w;
|
|
190395
|
+
}
|
|
190380
190396
|
/**
|
|
190381
190397
|
* Return the distance between xy points given as numbers.
|
|
190382
190398
|
* @param x0 x coordinate of point 0
|
|
@@ -204245,11 +204261,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
204245
204261
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
|
204246
204262
|
/* harmony export */ "CurveCurve": () => (/* binding */ CurveCurve)
|
|
204247
204263
|
/* harmony export */ });
|
|
204248
|
-
/* harmony import */ var
|
|
204249
|
-
/* harmony import */ var
|
|
204250
|
-
/* harmony import */ var
|
|
204251
|
-
/* harmony import */ var
|
|
204252
|
-
/* harmony import */ var
|
|
204264
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
204265
|
+
/* harmony import */ var _CurveCollection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CurveCollection */ "../../core/geometry/lib/esm/curve/CurveCollection.js");
|
|
204266
|
+
/* harmony import */ var _CurveCurveCloseApproachXY__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CurveCurveCloseApproachXY */ "../../core/geometry/lib/esm/curve/CurveCurveCloseApproachXY.js");
|
|
204267
|
+
/* harmony import */ var _CurveCurveIntersectXY__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CurveCurveIntersectXY */ "../../core/geometry/lib/esm/curve/CurveCurveIntersectXY.js");
|
|
204268
|
+
/* harmony import */ var _CurveCurveIntersectXYZ__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CurveCurveIntersectXYZ */ "../../core/geometry/lib/esm/curve/CurveCurveIntersectXYZ.js");
|
|
204269
|
+
/* harmony import */ var _CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CurvePrimitive */ "../../core/geometry/lib/esm/curve/CurvePrimitive.js");
|
|
204253
204270
|
/*---------------------------------------------------------------------------------------------
|
|
204254
204271
|
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
|
|
204255
204272
|
* See LICENSE.md in the project root for license terms and full copyright notice.
|
|
@@ -204262,6 +204279,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
204262
204279
|
|
|
204263
204280
|
|
|
204264
204281
|
|
|
204282
|
+
|
|
204265
204283
|
/**
|
|
204266
204284
|
* `CurveCurve` has static method for various computations that work on a pair of curves or curve collections.
|
|
204267
204285
|
* @public
|
|
@@ -204269,17 +204287,18 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
204269
204287
|
class CurveCurve {
|
|
204270
204288
|
/**
|
|
204271
204289
|
* Return xy intersections of 2 curves.
|
|
204272
|
-
* @param geometryA
|
|
204290
|
+
* @param geometryA first geometry
|
|
204273
204291
|
* @param extendA true to allow geometryA to extend
|
|
204274
204292
|
* @param geometryB second geometry
|
|
204275
204293
|
* @param extendB true to allow geometryB to extend
|
|
204294
|
+
* @param tolerance optional distance tolerance for coincidence
|
|
204276
204295
|
*/
|
|
204277
|
-
static intersectionXYPairs(geometryA, extendA, geometryB, extendB) {
|
|
204278
|
-
const handler = new
|
|
204279
|
-
if (geometryB instanceof
|
|
204296
|
+
static intersectionXYPairs(geometryA, extendA, geometryB, extendB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
204297
|
+
const handler = new _CurveCurveIntersectXY__WEBPACK_IMPORTED_MODULE_1__.CurveCurveIntersectXY(undefined, geometryA, extendA, geometryB, extendB, tolerance);
|
|
204298
|
+
if (geometryB instanceof _CurvePrimitive__WEBPACK_IMPORTED_MODULE_2__.CurvePrimitive) {
|
|
204280
204299
|
geometryA.dispatchToGeometryHandler(handler);
|
|
204281
204300
|
}
|
|
204282
|
-
else if (geometryB instanceof
|
|
204301
|
+
else if (geometryB instanceof _CurveCollection__WEBPACK_IMPORTED_MODULE_3__.CurveCollection) {
|
|
204283
204302
|
const allCurves = geometryB.collectCurvePrimitives();
|
|
204284
204303
|
for (const child of allCurves) {
|
|
204285
204304
|
handler.resetGeometry(geometryA, false, child, false);
|
|
@@ -204290,13 +204309,14 @@ class CurveCurve {
|
|
|
204290
204309
|
}
|
|
204291
204310
|
/**
|
|
204292
204311
|
* Return xy intersections of 2 projected curves
|
|
204293
|
-
* @param geometryA
|
|
204312
|
+
* @param geometryA first geometry
|
|
204294
204313
|
* @param extendA true to allow geometryA to extend
|
|
204295
204314
|
* @param geometryB second geometry
|
|
204296
204315
|
* @param extendB true to allow geometryB to extend
|
|
204316
|
+
* @param tolerance optional distance tolerance for coincidence
|
|
204297
204317
|
*/
|
|
204298
|
-
static intersectionProjectedXYPairs(worldToLocal, geometryA, extendA, geometryB, extendB) {
|
|
204299
|
-
const handler = new
|
|
204318
|
+
static intersectionProjectedXYPairs(worldToLocal, geometryA, extendA, geometryB, extendB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
204319
|
+
const handler = new _CurveCurveIntersectXY__WEBPACK_IMPORTED_MODULE_1__.CurveCurveIntersectXY(worldToLocal, geometryA, extendA, geometryB, extendB, tolerance);
|
|
204300
204320
|
geometryA.dispatchToGeometryHandler(handler);
|
|
204301
204321
|
return handler.grabPairedResults();
|
|
204302
204322
|
}
|
|
@@ -204305,25 +204325,26 @@ class CurveCurve {
|
|
|
204305
204325
|
* * Implemented for combinations of LineSegment3d, LineString3d, Arc3d.
|
|
204306
204326
|
* * Not Implemented for bspline and bezier curves.
|
|
204307
204327
|
* @beta
|
|
204308
|
-
* @param geometryA
|
|
204328
|
+
* @param geometryA first geometry
|
|
204309
204329
|
* @param extendA true to allow geometryA to extend
|
|
204310
204330
|
* @param geometryB second geometry
|
|
204311
204331
|
* @param extendB true to allow geometryB to extend
|
|
204312
204332
|
*/
|
|
204313
204333
|
static intersectionXYZ(geometryA, extendA, geometryB, extendB) {
|
|
204314
|
-
const handler = new
|
|
204334
|
+
const handler = new _CurveCurveIntersectXYZ__WEBPACK_IMPORTED_MODULE_4__.CurveCurveIntersectXYZ(geometryA, extendA, geometryB, extendB);
|
|
204315
204335
|
geometryA.dispatchToGeometryHandler(handler);
|
|
204316
204336
|
return handler.grabResults();
|
|
204317
204337
|
}
|
|
204318
204338
|
/**
|
|
204319
204339
|
* Return xy intersections of 2 curves.
|
|
204320
|
-
* @param geometryA
|
|
204340
|
+
* @param geometryA first geometry
|
|
204321
204341
|
* @param extendA true to allow geometryA to extend
|
|
204322
204342
|
* @param geometryB second geometry
|
|
204323
204343
|
* @param extendB true to allow geometryB to extend
|
|
204344
|
+
* @param tolerance optional distance tolerance for coincidence
|
|
204324
204345
|
*/
|
|
204325
|
-
static allIntersectionsAmongPrimitivesXY(primitives) {
|
|
204326
|
-
const handler = new
|
|
204346
|
+
static allIntersectionsAmongPrimitivesXY(primitives, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
204347
|
+
const handler = new _CurveCurveIntersectXY__WEBPACK_IMPORTED_MODULE_1__.CurveCurveIntersectXY(undefined, undefined, false, undefined, false, tolerance);
|
|
204327
204348
|
for (let i = 0; i < primitives.length; i++) {
|
|
204328
204349
|
const geometryA = primitives[i];
|
|
204329
204350
|
for (let j = i + 1; j < primitives.length; j++) {
|
|
@@ -204335,11 +204356,11 @@ class CurveCurve {
|
|
|
204335
204356
|
}
|
|
204336
204357
|
/**
|
|
204337
204358
|
* Return xy close approaches of 2 projected curves
|
|
204338
|
-
* @param geometryA
|
|
204359
|
+
* @param geometryA first geometry
|
|
204339
204360
|
* @param geometryB second geometry
|
|
204340
204361
|
*/
|
|
204341
204362
|
static closeApproachProjectedXYPairs(geometryA, geometryB, maxDistance) {
|
|
204342
|
-
const handler = new
|
|
204363
|
+
const handler = new _CurveCurveCloseApproachXY__WEBPACK_IMPORTED_MODULE_5__.CurveCurveCloseApproachXY(geometryA, geometryB);
|
|
204343
204364
|
handler.maxDistanceToAccept = maxDistance;
|
|
204344
204365
|
geometryA.dispatchToGeometryHandler(handler);
|
|
204345
204366
|
return handler.grabPairedResults();
|
|
@@ -205108,8 +205129,8 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
205108
205129
|
/* harmony export */ "CurveLocationDetailArrayPair": () => (/* binding */ CurveLocationDetailArrayPair)
|
|
205109
205130
|
/* harmony export */ });
|
|
205110
205131
|
/* harmony import */ var _bspline_BSplineCurve__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../bspline/BSplineCurve */ "../../core/geometry/lib/esm/bspline/BSplineCurve.js");
|
|
205111
|
-
/* harmony import */ var
|
|
205112
|
-
/* harmony import */ var
|
|
205132
|
+
/* harmony import */ var _Geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../Geometry */ "../../core/geometry/lib/esm/Geometry.js");
|
|
205133
|
+
/* harmony import */ var _geometry3d_CoincidentGeometryOps__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../geometry3d/CoincidentGeometryOps */ "../../core/geometry/lib/esm/geometry3d/CoincidentGeometryOps.js");
|
|
205113
205134
|
/* harmony import */ var _geometry3d_GeometryHandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../geometry3d/GeometryHandler */ "../../core/geometry/lib/esm/geometry3d/GeometryHandler.js");
|
|
205114
205135
|
/* harmony import */ var _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../geometry3d/GrowableFloat64Array */ "../../core/geometry/lib/esm/geometry3d/GrowableFloat64Array.js");
|
|
205115
205136
|
/* harmony import */ var _geometry3d_Matrix3d__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../geometry3d/Matrix3d */ "../../core/geometry/lib/esm/geometry3d/Matrix3d.js");
|
|
@@ -205134,14 +205155,12 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
205134
205155
|
|
|
205135
205156
|
|
|
205136
205157
|
|
|
205137
|
-
// import { Arc3d } from "./Arc3d";
|
|
205138
205158
|
|
|
205139
205159
|
|
|
205140
205160
|
|
|
205141
205161
|
|
|
205142
205162
|
|
|
205143
205163
|
|
|
205144
|
-
// import { LineString3d } from "./LineString3d";
|
|
205145
205164
|
|
|
205146
205165
|
|
|
205147
205166
|
|
|
@@ -205194,8 +205213,9 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
205194
205213
|
* @param extendA flag to enable using extension of geometryA.
|
|
205195
205214
|
* @param geometryB second curve for intersection. Saved for reference by specific handler methods.
|
|
205196
205215
|
* @param extendB flag for extension of geometryB.
|
|
205216
|
+
* @param tolerance optional distance tolerance for coincidence
|
|
205197
205217
|
*/
|
|
205198
|
-
constructor(worldToLocal, _geometryA, extendA, geometryB, extendB) {
|
|
205218
|
+
constructor(worldToLocal, _geometryA, extendA, geometryB, extendB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance) {
|
|
205199
205219
|
super();
|
|
205200
205220
|
// this.geometryA = _geometryA;
|
|
205201
205221
|
this._extendA = extendA;
|
|
@@ -205208,7 +205228,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
205208
205228
|
if (!this._worldToLocalAffine)
|
|
205209
205229
|
this._worldToLocalPerspective = worldToLocal.clone();
|
|
205210
205230
|
}
|
|
205211
|
-
this._coincidentGeometryContext =
|
|
205231
|
+
this._coincidentGeometryContext = _geometry3d_CoincidentGeometryOps__WEBPACK_IMPORTED_MODULE_4__.CoincidentGeometryQuery.create(tolerance);
|
|
205212
205232
|
this.reinitialize();
|
|
205213
205233
|
}
|
|
205214
205234
|
reinitialize() {
|
|
@@ -205227,13 +205247,15 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
205227
205247
|
return false;
|
|
205228
205248
|
return true;
|
|
205229
205249
|
}
|
|
205230
|
-
|
|
205231
|
-
|
|
205250
|
+
/** Test the fraction by strict parameter, but allow toleranced distance test at ends.
|
|
205251
|
+
* @param tolerance optional distance tolerance to check proximity to start/end point
|
|
205252
|
+
*/
|
|
205253
|
+
acceptFractionOnLine(extend0, fraction, extend1, pointA, pointB, tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.smallMetricDistance) {
|
|
205232
205254
|
if (!extend0 && fraction < 0) {
|
|
205233
|
-
return
|
|
205255
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isDistanceWithinTol(fraction * pointA.distanceXY(pointB), tolerance);
|
|
205234
205256
|
}
|
|
205235
205257
|
else if (!extend1 && fraction > 1.0)
|
|
205236
|
-
return
|
|
205258
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isDistanceWithinTol((fraction - 1.0) * pointA.distanceXY(pointB), tolerance);
|
|
205237
205259
|
return true;
|
|
205238
205260
|
}
|
|
205239
205261
|
/**
|
|
@@ -205248,7 +205270,7 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
205248
205270
|
return result;
|
|
205249
205271
|
}
|
|
205250
205272
|
sameCurveAndFraction(cp, fraction, detail) {
|
|
205251
|
-
return cp === detail.curve &&
|
|
205273
|
+
return cp === detail.curve && _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isAlmostEqualNumber(fraction, detail.fraction);
|
|
205252
205274
|
}
|
|
205253
205275
|
/** compute intersection of two line segments.
|
|
205254
205276
|
* filter by extension rules.
|
|
@@ -205260,14 +205282,14 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
205260
205282
|
let globalFractionA1, globalFractionB1;
|
|
205261
205283
|
const isInterval = intervalDetails !== undefined && intervalDetails.detailA.hasFraction1 && intervalDetails.detailB.hasFraction1;
|
|
205262
205284
|
if (isInterval) {
|
|
205263
|
-
globalFractionA =
|
|
205264
|
-
globalFractionB =
|
|
205265
|
-
globalFractionA1 =
|
|
205266
|
-
globalFractionB1 =
|
|
205285
|
+
globalFractionA = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction, fractionA1);
|
|
205286
|
+
globalFractionB = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction, fractionB1);
|
|
205287
|
+
globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction1, fractionA1);
|
|
205288
|
+
globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction1, fractionB1);
|
|
205267
205289
|
}
|
|
205268
205290
|
else {
|
|
205269
|
-
globalFractionA = globalFractionA1 =
|
|
205270
|
-
globalFractionB = globalFractionB1 =
|
|
205291
|
+
globalFractionA = globalFractionA1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionA0, localFractionA, fractionA1);
|
|
205292
|
+
globalFractionB = globalFractionB1 = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
|
|
205271
205293
|
}
|
|
205272
205294
|
// ignore duplicate of most recent point . ..
|
|
205273
205295
|
const numPrevious = this._results.length;
|
|
@@ -205329,8 +205351,8 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
205329
205351
|
this.recordPointWithLocalFractions(overlap.detailA.fraction, cpA, fractionA0, fractionA1, overlap.detailB.fraction, cpB, fractionB0, fractionB1, reversed, overlap);
|
|
205330
205352
|
}
|
|
205331
205353
|
else if (_numerics_Polynomials__WEBPACK_IMPORTED_MODULE_6__.SmallSystem.lineSegment3dXYTransverseIntersectionUnbounded(pointA0, pointA1, pointB0, pointB1, uv)) {
|
|
205332
|
-
if (this.acceptFractionOnLine(extendA0, uv.x, extendA1, pointA0, pointA1)
|
|
205333
|
-
&& this.acceptFractionOnLine(extendB0, uv.y, extendB1, pointB0, pointB1)) {
|
|
205354
|
+
if (this.acceptFractionOnLine(extendA0, uv.x, extendA1, pointA0, pointA1, this._coincidentGeometryContext.tolerance)
|
|
205355
|
+
&& this.acceptFractionOnLine(extendB0, uv.y, extendB1, pointB0, pointB1, this._coincidentGeometryContext.tolerance)) {
|
|
205334
205356
|
this.recordPointWithLocalFractions(uv.x, cpA, fractionA0, fractionA1, uv.y, cpB, fractionB0, fractionB1, reversed);
|
|
205335
205357
|
}
|
|
205336
205358
|
}
|
|
@@ -205388,9 +205410,9 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
205388
205410
|
const data = arc.toTransformedPoint4d(this._worldToLocalPerspective);
|
|
205389
205411
|
const pointA0H = this._worldToLocalPerspective.multiplyPoint3d(pointA0, 1);
|
|
205390
205412
|
const pointA1H = this._worldToLocalPerspective.multiplyPoint3d(pointA1, 1);
|
|
205391
|
-
const alpha =
|
|
205392
|
-
const beta =
|
|
205393
|
-
const gamma =
|
|
205413
|
+
const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.center);
|
|
205414
|
+
const beta = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.vector0);
|
|
205415
|
+
const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.vector90);
|
|
205394
205416
|
const cosines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_7__.GrowableFloat64Array(2);
|
|
205395
205417
|
const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_7__.GrowableFloat64Array(2);
|
|
205396
205418
|
const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_7__.GrowableFloat64Array(2);
|
|
@@ -205412,9 +205434,9 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
205412
205434
|
pointA0Local = this._worldToLocalAffine.multiplyPoint3d(pointA0);
|
|
205413
205435
|
pointA1Local = this._worldToLocalAffine.multiplyPoint3d(pointA1);
|
|
205414
205436
|
}
|
|
205415
|
-
const alpha =
|
|
205416
|
-
const beta =
|
|
205417
|
-
const gamma =
|
|
205437
|
+
const alpha = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.center, 1);
|
|
205438
|
+
const beta = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector0, 0);
|
|
205439
|
+
const gamma = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.tripleProductXYW(pointA0Local, 1, pointA1Local, 1, data.vector90, 0);
|
|
205418
205440
|
const cosines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_7__.GrowableFloat64Array(2);
|
|
205419
205441
|
const sines = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_7__.GrowableFloat64Array(2);
|
|
205420
205442
|
const radians = new _geometry3d_GrowableFloat64Array__WEBPACK_IMPORTED_MODULE_7__.GrowableFloat64Array(2);
|
|
@@ -205639,8 +205661,8 @@ class CurveCurveIntersectXY extends _geometry3d_GeometryHandler__WEBPACK_IMPORTE
|
|
|
205639
205661
|
let bezierBFraction = r;
|
|
205640
205662
|
bezierB.fractionToPoint4d(bezierBFraction, this._xyzwB);
|
|
205641
205663
|
const segmentAFraction = _numerics_Polynomials__WEBPACK_IMPORTED_MODULE_6__.SmallSystem.lineSegment3dHXYClosestPointUnbounded(this._xyzwA0, this._xyzwA1, this._xyzwB);
|
|
205642
|
-
if (segmentAFraction &&
|
|
205643
|
-
let bezierAFraction =
|
|
205664
|
+
if (segmentAFraction && _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {
|
|
205665
|
+
let bezierAFraction = _Geometry__WEBPACK_IMPORTED_MODULE_3__.Geometry.interpolate(f0, segmentAFraction, f1);
|
|
205644
205666
|
const xyMatchingFunction = new BezierBezierIntersectionXYRRToRRD(bezierA, bezierB);
|
|
205645
205667
|
const newtonSearcher = new _numerics_Newton__WEBPACK_IMPORTED_MODULE_0__.Newton2dUnboundedWithDerivative(xyMatchingFunction);
|
|
205646
205668
|
newtonSearcher.setUV(bezierAFraction, bezierBFraction);
|
|
@@ -220494,6 +220516,9 @@ class CoincidentGeometryQuery {
|
|
|
220494
220516
|
constructor(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
220495
220517
|
this._tolerance = tolerance;
|
|
220496
220518
|
}
|
|
220519
|
+
get tolerance() {
|
|
220520
|
+
return this._tolerance;
|
|
220521
|
+
}
|
|
220497
220522
|
static create(tolerance = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallMetricDistance) {
|
|
220498
220523
|
return new CoincidentGeometryQuery(tolerance);
|
|
220499
220524
|
}
|
|
@@ -225043,6 +225068,7 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
225043
225068
|
|
|
225044
225069
|
|
|
225045
225070
|
/* eslint-disable @itwin/prefer-get */
|
|
225071
|
+
// cSpell:words XXYZ YXYZ ZXYZ
|
|
225046
225072
|
/**
|
|
225047
225073
|
* PackedMatrix3dOps contains static methods for matrix operations where the matrix is a Float64Array.
|
|
225048
225074
|
* * The Float64Array contains the matrix entries in row-major order
|
|
@@ -225670,7 +225696,8 @@ class Matrix3d {
|
|
|
225670
225696
|
return undefined;
|
|
225671
225697
|
}
|
|
225672
225698
|
/**
|
|
225673
|
-
* Construct a rigid matrix using vectorA and its 2 perpendicular.
|
|
225699
|
+
* Construct a rigid matrix (orthogonal matrix with +1 determinant) using vectorA and its 2 perpendicular.
|
|
225700
|
+
* * If axisOrder is not passed then `AxisOrder = AxisOrder.ZXY` is used as default.
|
|
225674
225701
|
* * This function internally uses createPerpendicularVectorFavorXYPlane and createRigidFromColumns.
|
|
225675
225702
|
*/
|
|
225676
225703
|
static createRigidHeadsUp(vectorA, axisOrder = _Geometry__WEBPACK_IMPORTED_MODULE_0__.AxisOrder.ZXY, result) {
|
|
@@ -225682,7 +225709,7 @@ class Matrix3d {
|
|
|
225682
225709
|
}
|
|
225683
225710
|
return Matrix3d.createIdentity(result);
|
|
225684
225711
|
}
|
|
225685
|
-
/** Return the matrix for rotation of `angle` around `axis` */
|
|
225712
|
+
/** Return the matrix for rotation of `angle` around desired `axis` */
|
|
225686
225713
|
static createRotationAroundVector(axis, angle, result) {
|
|
225687
225714
|
// Rodriguez formula (matrix form), https://mathworld.wolfram.com/RodriguesRotationFormula.html
|
|
225688
225715
|
const c = angle.cos();
|
|
@@ -225696,7 +225723,7 @@ class Matrix3d {
|
|
|
225696
225723
|
}
|
|
225697
225724
|
return undefined;
|
|
225698
225725
|
}
|
|
225699
|
-
/** Returns a rotation of specified angle around
|
|
225726
|
+
/** Returns a rotation of specified angle around one of the main axis (X,Y,Z).
|
|
225700
225727
|
* @param axisIndex index of axis (AxisIndex.X, AxisIndex.Y, AxisIndex.Z) kept fixed by the rotation.
|
|
225701
225728
|
* @param angle angle of rotation
|
|
225702
225729
|
* @param result optional result matrix.
|
|
@@ -225719,14 +225746,33 @@ class Matrix3d {
|
|
|
225719
225746
|
return myResult;
|
|
225720
225747
|
}
|
|
225721
225748
|
/**
|
|
225722
|
-
|
|
225723
|
-
|
|
225724
|
-
|
|
225725
|
-
|
|
225726
|
-
|
|
225727
|
-
|
|
225728
|
-
|
|
225729
|
-
|
|
225749
|
+
* Replace current rows Ui and Uj with (c*Ui + s*Uj) and (c*Uj - s*Ui).
|
|
225750
|
+
* * There is no checking for i,j being 0,1,2.
|
|
225751
|
+
* @param i first row index. **must be 0,1,2** (unchecked)
|
|
225752
|
+
* @param j second row index. **must be 0,1,2** (unchecked)
|
|
225753
|
+
* @param c fist coefficient
|
|
225754
|
+
* @param s second coefficient
|
|
225755
|
+
*/
|
|
225756
|
+
applyGivensRowOp(i, j, c, s) {
|
|
225757
|
+
let ii = 3 * i;
|
|
225758
|
+
let jj = 3 * j;
|
|
225759
|
+
const limit = ii + 3;
|
|
225760
|
+
for (; ii < limit; ii++, jj++) {
|
|
225761
|
+
const a = this.coffs[ii];
|
|
225762
|
+
const b = this.coffs[jj];
|
|
225763
|
+
this.coffs[ii] = a * c + b * s;
|
|
225764
|
+
this.coffs[jj] = -a * s + b * c;
|
|
225765
|
+
}
|
|
225766
|
+
}
|
|
225767
|
+
/**
|
|
225768
|
+
* Replace current columns Ui and Uj with (c*Ui + s*Uj) and (c*Uj - s*Ui).
|
|
225769
|
+
* * There is no checking for i,j being 0,1,2.
|
|
225770
|
+
* * This is used in compute intensive inner loops
|
|
225771
|
+
* @param i first row index. **must be 0,1,2** (unchecked)
|
|
225772
|
+
* @param j second row index. **must be 0,1,2** (unchecked)
|
|
225773
|
+
* @param c fist coefficient
|
|
225774
|
+
* @param s second coefficient
|
|
225775
|
+
*/
|
|
225730
225776
|
applyGivensColumnOp(i, j, c, s) {
|
|
225731
225777
|
const limit = i + 9;
|
|
225732
225778
|
for (; i < limit; i += 3, j += 3) {
|
|
@@ -225737,12 +225783,12 @@ class Matrix3d {
|
|
|
225737
225783
|
}
|
|
225738
225784
|
}
|
|
225739
225785
|
/**
|
|
225740
|
-
|
|
225741
|
-
|
|
225742
|
-
|
|
225743
|
-
|
|
225744
|
-
|
|
225745
|
-
|
|
225786
|
+
* Create a matrix from column vectors.
|
|
225787
|
+
* ```
|
|
225788
|
+
* equation
|
|
225789
|
+
* \begin{bmatrix}U_x & V_x & W_x \\ U_y & V_y & W_y \\ U_z & V_z & W_z \end{bmatrix}
|
|
225790
|
+
* ```
|
|
225791
|
+
*/
|
|
225746
225792
|
static createColumns(vectorU, vectorV, vectorW, result) {
|
|
225747
225793
|
return Matrix3d.createRowValues(vectorU.x, vectorV.x, vectorW.x, vectorU.y, vectorV.y, vectorW.y, vectorU.z, vectorV.z, vectorW.z, result);
|
|
225748
225794
|
}
|
|
@@ -225759,8 +225805,9 @@ class Matrix3d {
|
|
|
225759
225805
|
* * ColumnX points in the rightVector direction
|
|
225760
225806
|
* * ColumnY points in the upVector direction
|
|
225761
225807
|
* * ColumnZ is a unit cross product of ColumnX and ColumnY.
|
|
225762
|
-
* * Optionally rotate
|
|
225763
|
-
* * Optionally rotate
|
|
225808
|
+
* * Optionally rotate by 45 degrees around `upVector` to bring its left or right vertical edge to center.
|
|
225809
|
+
* * Optionally rotate by arctan(1/sqrt(2)) ~ 35.264 degrees around `rightVector` to bring the top or bottom
|
|
225810
|
+
* horizontal edge of the view to the center (for isometric views).
|
|
225764
225811
|
* * This is expected to be used with various principal unit vectors that are perpendicular to each other.
|
|
225765
225812
|
* * STANDARD TOP VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitY(), 0, 0)
|
|
225766
225813
|
* * STANDARD FRONT VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitZ(), 0, 0)
|
|
@@ -225768,16 +225815,20 @@ class Matrix3d {
|
|
|
225768
225815
|
* * STANDARD RIGHT VIEW: createViewedAxes(Vector3d.unitY(), Vector3d.unitZ(), 0, 0)
|
|
225769
225816
|
* * STANDARD LEFT VIEW: createViewedAxes(Vector3d.unitY(-1), Vector3d.unitZ(), 0, 0)
|
|
225770
225817
|
* * STANDARD BOTTOM VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitY(-1), 0, 0)
|
|
225818
|
+
* * STANDARD ISO VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitZ(), -1, 1)
|
|
225819
|
+
* * STANDARD RIGHT ISO VIEW: createViewedAxes(Vector3d.unitX(), Vector3d.unitZ(), 1, 1)
|
|
225820
|
+
* * Front, right, back, left, top, and bottom standard views are views from faces of the cube
|
|
225821
|
+
* and iso and right iso standard views are views from corners of the cube.
|
|
225771
225822
|
* * Note: createViewedAxes is column-based so always returns local to world
|
|
225772
225823
|
*
|
|
225773
225824
|
* @param rightVector ColumnX of the returned matrix. Expected to be perpendicular to upVector.
|
|
225774
225825
|
* @param upVector ColumnY of the returned matrix. Expected to be perpendicular to rightVector.
|
|
225775
|
-
* @param leftNoneRight Specifies the ccw rotation around
|
|
225776
|
-
* "-1" indicates rotation by 45 degrees to bring the left vertical edge to center, "0" means no rotation,
|
|
225826
|
+
* @param leftNoneRight Specifies the ccw rotation around `upVector` axis. Normally one of "-1", "0", and "1",
|
|
225827
|
+
* where "-1" indicates rotation by 45 degrees to bring the left vertical edge to center, "0" means no rotation,
|
|
225777
225828
|
* and "1" indicates rotation by 45 degrees to bring the right vertical edge to center. Other numbers are
|
|
225778
225829
|
* used as multiplier for this 45 degree rotation.
|
|
225779
|
-
* @param topNoneBottom Specifies the ccw rotation around
|
|
225780
|
-
* "-1" indicates isometric rotation (35.264 degrees) to bring the bottom upward, "0" means no rotation,
|
|
225830
|
+
* @param topNoneBottom Specifies the ccw rotation around `rightVector` axis. Normally one of "-1", "0", and "1",
|
|
225831
|
+
* where "-1" indicates isometric rotation (35.264 degrees) to bring the bottom upward, "0" means no rotation,
|
|
225781
225832
|
* and "1" indicates isometric rotation (35.264 degrees) to bring the top downward. Other numbers are
|
|
225782
225833
|
* used as multiplier for the 35.264 degree rotation.
|
|
225783
225834
|
* @returns matrix = [rightVector, upVector, rightVector cross upVector] with the applied rotations specified
|
|
@@ -225815,9 +225866,11 @@ class Matrix3d {
|
|
|
225815
225866
|
* * Default is TOP view (`local X = world X`, `local Y = world Y`, `local Z = world Z`).
|
|
225816
225867
|
* * To change view from the TOP to one of the other 7 standard views, we need to multiply "world data" to
|
|
225817
225868
|
* the corresponding matrix1 provided by `createStandardWorldToView(index, false)` and then
|
|
225818
|
-
* `matrix1.multiply(world data)` will
|
|
225869
|
+
* `matrix1.multiply(world data)` will return "local data".
|
|
225819
225870
|
* * To change view back to the TOP, we need to multiply "local data" to the corresponding matrix2 provided
|
|
225820
225871
|
* by `createStandardWorldToView(index, true)` and then `matrix2.multiply(local data)` will returns "world data".
|
|
225872
|
+
* * Note: No matter how you rotate the world axis, local X is always pointing right, local Y is always pointing up,
|
|
225873
|
+
* and local Z is always pointing toward you.
|
|
225821
225874
|
*
|
|
225822
225875
|
* @param index standard view index `StandardViewIndex.Top, Bottom, Left, Right, Front, Back, Iso, RightIso`
|
|
225823
225876
|
* @param invert if false (default), the return matrix is world to local (view) and if true, the the return
|
|
@@ -225826,343 +225879,182 @@ class Matrix3d {
|
|
|
225826
225879
|
*/
|
|
225827
225880
|
static createStandardWorldToView(index, invert = false, result) {
|
|
225828
225881
|
switch (index) {
|
|
225829
|
-
//
|
|
225882
|
+
// Start with TOP view, ccw rotation by 180 degrees around X
|
|
225830
225883
|
case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Bottom:
|
|
225831
225884
|
result = Matrix3d.createRowValues(1, 0, 0, 0, -1, 0, 0, 0, -1);
|
|
225832
225885
|
break;
|
|
225833
|
-
//
|
|
225886
|
+
// Start with TOP view, ccw rotation by -90 degrees around X and by 90 degrees around Z
|
|
225834
225887
|
case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Left:
|
|
225835
225888
|
result = Matrix3d.createRowValues(0, -1, 0, 0, 0, 1, -1, 0, 0);
|
|
225836
225889
|
break;
|
|
225837
|
-
//
|
|
225890
|
+
// Start with TOP view, ccw rotation by -90 degrees around X and by -90 degrees around Z
|
|
225838
225891
|
case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Right:
|
|
225839
225892
|
result = Matrix3d.createRowValues(0, 1, 0, 0, 0, 1, 1, 0, 0);
|
|
225840
225893
|
break;
|
|
225841
|
-
//
|
|
225894
|
+
// Start with TOP view, ccw rotation by -90 degrees around X
|
|
225842
225895
|
case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Front:
|
|
225843
225896
|
result = Matrix3d.createRowValues(1, 0, 0, 0, 0, 1, 0, -1, 0);
|
|
225844
225897
|
break;
|
|
225845
|
-
//
|
|
225898
|
+
// Start with TOP view, ccw rotation by -90 degrees around X and by 180 degrees around Z
|
|
225846
225899
|
case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Back:
|
|
225847
225900
|
result = Matrix3d.createRowValues(-1, 0, 0, 0, 0, 1, 0, 1, 0);
|
|
225848
225901
|
break;
|
|
225902
|
+
/**
|
|
225903
|
+
* Isometric view
|
|
225904
|
+
* Start with FRONT view, ccw rotation by -45 degrees around Y and by arctan(1/sqrt(2)) ~ 35.264 degrees around X
|
|
225905
|
+
* cos(45) = 1/sqrt(2) = 0.70710678118 and sin(45) = 1/sqrt(2) = 0.70710678118
|
|
225906
|
+
* cos(35.264) = 2/sqrt(6) = 0.81649658092 and sin(35.264) = 1/sqrt(3) = 0.57735026919
|
|
225907
|
+
* More info: https://en.wikipedia.org/wiki/Isometric_projection
|
|
225908
|
+
*/
|
|
225849
225909
|
case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Iso:
|
|
225850
|
-
// start with FRONT view, ccw rotation by -45 degrees around Y and by 35.264 degrees around X
|
|
225851
225910
|
result = Matrix3d.createRowValues(0.707106781186548, -0.70710678118654757, 0.00000000000000000, 0.408248290463863, 0.40824829046386302, 0.81649658092772603, -0.577350269189626, -0.57735026918962573, 0.57735026918962573);
|
|
225852
225911
|
break;
|
|
225912
|
+
// Start with FRONT view, ccw rotation by 45 degrees around Y and by 35.264 degrees around X
|
|
225853
225913
|
case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.RightIso:
|
|
225854
225914
|
result = Matrix3d.createRowValues(0.707106781186548, 0.70710678118654757, 0.00000000000000000, -0.408248290463863, 0.40824829046386302, 0.81649658092772603, 0.577350269189626, -0.57735026918962573, 0.57735026918962573);
|
|
225855
225915
|
break;
|
|
225856
|
-
|
|
225916
|
+
// no rotation
|
|
225917
|
+
case _Geometry__WEBPACK_IMPORTED_MODULE_0__.StandardViewIndex.Top:
|
|
225857
225918
|
default:
|
|
225858
225919
|
result = Matrix3d.createIdentity(result);
|
|
225859
225920
|
}
|
|
225860
225921
|
if (invert)
|
|
225861
|
-
result.transposeInPlace();
|
|
225922
|
+
result.transposeInPlace(); // matrix is rigid so transpose and inverse are the same
|
|
225862
225923
|
return result;
|
|
225863
225924
|
}
|
|
225864
|
-
|
|
225865
|
-
|
|
225866
|
-
|
|
225867
|
-
|
|
225868
|
-
|
|
225869
|
-
|
|
225870
|
-
|
|
225871
|
-
|
|
225872
|
-
|
|
225873
|
-
|
|
225874
|
-
|
|
225875
|
-
|
|
225876
|
-
|
|
225877
|
-
|
|
225878
|
-
|
|
225879
|
-
|
|
225880
|
-
|
|
225881
|
-
|
|
225882
|
-
|
|
225883
|
-
|
|
225884
|
-
|
|
225885
|
-
|
|
225886
|
-
|
|
225887
|
-
|
|
225888
|
-
|
|
225889
|
-
|
|
225890
|
-
|
|
225891
|
-
|
|
225892
|
-
|
|
225893
|
-
|
|
225894
|
-
|
|
225895
|
-
|
|
225896
|
-
|
|
225897
|
-
|
|
225898
|
-
|
|
225899
|
-
|
|
225900
|
-
|
|
225901
|
-
|
|
225902
|
-
|
|
225903
|
-
|
|
225904
|
-
|
|
225905
|
-
|
|
225906
|
-
|
|
225907
|
-
|
|
225908
|
-
|
|
225909
|
-
|
|
225910
|
-
|
|
225911
|
-
|
|
225912
|
-
|
|
225913
|
-
|
|
225914
|
-
|
|
225915
|
-
|
|
225916
|
-
|
|
225917
|
-
|
|
225918
|
-
|
|
225919
|
-
|
|
225920
|
-
|
|
225921
|
-
|
|
225922
|
-
|
|
225923
|
-
|
|
225924
|
-
|
|
225925
|
-
|
|
225926
|
-
|
|
225927
|
-
result.error = !result.axis.tryNormalizeInPlace();
|
|
225928
|
-
return result
|
|
225925
|
+
/**
|
|
225926
|
+
* Apply (in place) a jacobi update that zeros out this.at(i,j).
|
|
225927
|
+
* @param i row index of zeroed member
|
|
225928
|
+
* @param j column index of zeroed member
|
|
225929
|
+
* @param k other row/column index (different from i and j)
|
|
225930
|
+
* @param leftEigenVectors a matrix that its columns will be filled by eigenvectors of this Matrix3d
|
|
225931
|
+
* (allocated by caller, computed and filled by this function)
|
|
225932
|
+
*/
|
|
225933
|
+
applyFastSymmetricJacobiUpdate(i, j, k, leftEigenVectors) {
|
|
225934
|
+
const indexII = 4 * i;
|
|
225935
|
+
const indexJJ = 4 * j;
|
|
225936
|
+
const indexIJ = 3 * i + j;
|
|
225937
|
+
const indexIK = 3 * i + k;
|
|
225938
|
+
const indexJK = 3 * j + k;
|
|
225939
|
+
const dotUU = this.coffs[indexII];
|
|
225940
|
+
const dotVV = this.coffs[indexJJ];
|
|
225941
|
+
const dotUV = this.coffs[indexIJ];
|
|
225942
|
+
const jacobi = _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.trigValuesToHalfAngleTrigValues(dotUU - dotVV, 2.0 * dotUV);
|
|
225943
|
+
if (Math.abs(dotUV) < 1.0e-15 * (dotUU + dotVV))
|
|
225944
|
+
return 0.0;
|
|
225945
|
+
const c = jacobi.c;
|
|
225946
|
+
const s = jacobi.s;
|
|
225947
|
+
const cc = c * c;
|
|
225948
|
+
const ss = s * s;
|
|
225949
|
+
const sc2 = 2.0 * c * s;
|
|
225950
|
+
this.coffs[indexII] = cc * dotUU + sc2 * dotUV + ss * dotVV;
|
|
225951
|
+
this.coffs[indexJJ] = ss * dotUU - sc2 * dotUV + cc * dotVV;
|
|
225952
|
+
this.coffs[indexIJ] = 0.0;
|
|
225953
|
+
const a = this.coffs[indexIK];
|
|
225954
|
+
const b = this.coffs[indexJK];
|
|
225955
|
+
this.coffs[indexIK] = a * c + b * s;
|
|
225956
|
+
this.coffs[indexJK] = -s * a + c * b;
|
|
225957
|
+
this.coffs[3 * j + i] = 0.0;
|
|
225958
|
+
this.coffs[3 * k + i] = this.coffs[indexIK];
|
|
225959
|
+
this.coffs[3 * k + j] = this.coffs[indexJK];
|
|
225960
|
+
leftEigenVectors.applyGivensColumnOp(i, j, c, s);
|
|
225961
|
+
return Math.abs(dotUV);
|
|
225962
|
+
}
|
|
225963
|
+
/**
|
|
225964
|
+
* Factor this (symmetrized) as a product U * lambda * UT where U is orthogonal, lambda is diagonal.
|
|
225965
|
+
* The upper triangle is mirrored to lower triangle to enforce symmetry.
|
|
225966
|
+
* @param leftEigenvectors a matrix that its columns will be filled by eigenvectors of this Matrix3d
|
|
225967
|
+
* (allocated by caller, computed and filled by this function)
|
|
225968
|
+
* @param lambda a vector that its entries will be filled by eigenvalues of this Matrix3d
|
|
225969
|
+
* (allocated by caller, computed and filled by this function)
|
|
225970
|
+
*/
|
|
225971
|
+
fastSymmetricEigenvalues(leftEigenvectors, lambda) {
|
|
225972
|
+
const matrix = this.clone();
|
|
225973
|
+
leftEigenvectors.setIdentity();
|
|
225974
|
+
const tolerance = 1.0e-12 * this.sumSquares();
|
|
225975
|
+
for (let iteration = 0; iteration < 7; iteration++) {
|
|
225976
|
+
const sum = matrix.applyFastSymmetricJacobiUpdate(0, 1, 2, leftEigenvectors)
|
|
225977
|
+
+ matrix.applyFastSymmetricJacobiUpdate(0, 2, 1, leftEigenvectors)
|
|
225978
|
+
+ matrix.applyFastSymmetricJacobiUpdate(1, 2, 0, leftEigenvectors);
|
|
225979
|
+
// console.log("symmetric sum", sum);
|
|
225980
|
+
// console.log ("sum", sum);
|
|
225981
|
+
if (sum < tolerance) {
|
|
225982
|
+
// console.log("symmetric iterations", iteration);
|
|
225983
|
+
lambda.set(matrix.at(0, 0), matrix.at(1, 1), matrix.at(2, 2));
|
|
225984
|
+
return true;
|
|
225985
|
+
}
|
|
225986
|
+
}
|
|
225987
|
+
return false;
|
|
225929
225988
|
}
|
|
225930
|
-
*/
|
|
225931
225989
|
/**
|
|
225932
225990
|
* Compute the (unit vector) axis and angle of rotation.
|
|
225991
|
+
* * math details can be found at docs/learning/geometry/Angle.md
|
|
225933
225992
|
* @returns Returns axis and angle of rotation with result.ok === true when the conversion succeeded.
|
|
225934
225993
|
*/
|
|
225935
225994
|
getAxisAndAngleOfRotation() {
|
|
225936
225995
|
const trace = this.coffs[0] + this.coffs[4] + this.coffs[8];
|
|
225937
|
-
|
|
225938
|
-
const
|
|
225939
|
-
const
|
|
225940
|
-
|
|
225941
|
-
const c = (trace - 1.0) / 2.0;
|
|
225942
|
-
const s = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(skewXY, skewYZ, skewZX) / 2.0;
|
|
225943
|
-
const e = c * c + s * s - 1.0;
|
|
225996
|
+
const skewXY = this.coffs[3] - this.coffs[1]; // 2*z*sin
|
|
225997
|
+
const skewYZ = this.coffs[7] - this.coffs[5]; // 2*y*sin
|
|
225998
|
+
const skewZX = this.coffs[2] - this.coffs[6]; // 2*x*sin
|
|
225999
|
+
// trace = (m00^2 + m11^2 + m22^2) * (1-cos) + 3cos = (1-cos) + 3cos = 1 + 2cos ==> cos = (trace-1) / 2
|
|
226000
|
+
const c = (trace - 1.0) / 2.0; // cosine
|
|
226001
|
+
const s = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(skewXY, skewYZ, skewZX) / 2.0; // sine
|
|
226002
|
+
const e = c * c + s * s - 1.0; // s^2 + c^2 = 1
|
|
226003
|
+
// if s^2 + c^2 != 1 then we have a bad matrix so return false
|
|
225944
226004
|
if (Math.abs(e) > _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallAngleRadians) {
|
|
225945
|
-
// the sine and cosine are not a unit circle point. bad matrix . ..
|
|
225946
226005
|
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(0), ok: false };
|
|
225947
226006
|
}
|
|
226007
|
+
// sin is close to 0 then we got to special cases (angle 0 or 180) which needs to be handled differently
|
|
225948
226008
|
if (Math.abs(s) < _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.smallAngleRadians) {
|
|
225949
|
-
//
|
|
225950
|
-
// The matrix is symmetric
|
|
225951
|
-
// So it has simple eigenvalues -- either (1,1,1) or (1,-1,-1).
|
|
225952
|
-
if (c > 0) // no rotation
|
|
226009
|
+
if (c > 0) // sin = 0 and cos = 1 so angle = 0 (i.e., no rotation)
|
|
225953
226010
|
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(0), ok: true };
|
|
225954
|
-
|
|
225955
|
-
|
|
225956
|
-
|
|
226011
|
+
/**
|
|
226012
|
+
* If sin = 0 and cos = -1 then angle = 180 (i.e., 180 degree rotation around some axis)
|
|
226013
|
+
* then the rotation matrix becomes
|
|
226014
|
+
* 2x^2-1 2xy 2xz
|
|
226015
|
+
* 2xy 2y^2-1 2yz
|
|
226016
|
+
* 2xz 2yz 2z^2-1
|
|
226017
|
+
* Note that the matrix is symmetric.
|
|
226018
|
+
* If rotation is around one the standard basis then non-diagonal entries become 0 and we
|
|
226019
|
+
* have one 1 and two -1s on the diagonal.
|
|
226020
|
+
* If rotation is around an axis other than standard basis, then the axis is the eigenvector
|
|
226021
|
+
* of the rotation matrix with eigenvalue = 1.
|
|
226022
|
+
*/
|
|
225957
226023
|
const axx = this.coffs[0];
|
|
225958
226024
|
const ayy = this.coffs[4];
|
|
225959
226025
|
const azz = this.coffs[8];
|
|
225960
|
-
|
|
225961
|
-
// Look for principal axis flips as a special case . ..
|
|
226026
|
+
// Look for a pair of "-1" entries on the diagonal (for rotation around the basis X,Y,Z axis)
|
|
225962
226027
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1.0, ayy) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1, azz)) {
|
|
225963
|
-
|
|
225964
|
-
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(1, 0, 0), angle: theta180, ok: true };
|
|
226028
|
+
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(1, 0, 0), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(180), ok: true };
|
|
225965
226029
|
}
|
|
225966
226030
|
else if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1.0, axx) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1, azz)) {
|
|
225967
|
-
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 1, 0), angle:
|
|
226031
|
+
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 1, 0), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(180), ok: true };
|
|
225968
226032
|
}
|
|
225969
226033
|
else if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1.0, axx) && _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(-1, ayy)) {
|
|
225970
|
-
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, 1), angle:
|
|
226034
|
+
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(180), ok: true };
|
|
225971
226035
|
}
|
|
225972
|
-
//
|
|
225973
|
-
// eigenvalues will have 1.0 once, -1.0 twice.
|
|
225974
|
-
// These cases look for each place (x,y,z) that the 1.0 might appear.
|
|
225975
|
-
// But fastSymmetricEigenvalues reliably always seems to put the 1.0 as the x eigenvalue.
|
|
225976
|
-
// so only the getColumn(0) return seems reachable in unit tests.
|
|
226036
|
+
// Look for eigenvector with eigenvalue = 1
|
|
225977
226037
|
const eigenvectors = Matrix3d.createIdentity();
|
|
225978
226038
|
const eigenvalues = _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, 0);
|
|
225979
226039
|
if (this.fastSymmetricEigenvalues(eigenvectors, eigenvalues)) {
|
|
225980
226040
|
for (let axisIndex = 0; axisIndex < 2; axisIndex++) {
|
|
225981
226041
|
const lambda = eigenvalues.at(axisIndex);
|
|
225982
226042
|
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isAlmostEqualNumber(1, lambda))
|
|
225983
|
-
return { axis: eigenvectors.getColumn(axisIndex), angle:
|
|
226043
|
+
return { axis: eigenvectors.getColumn(axisIndex), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createDegrees(180), ok: true };
|
|
225984
226044
|
}
|
|
225985
|
-
//
|
|
226045
|
+
// if no eigenvalue = 1 was found return false
|
|
225986
226046
|
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(0), ok: false };
|
|
225987
226047
|
}
|
|
226048
|
+
// if no axis was found return false
|
|
225988
226049
|
return { axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(0, 0, 1), angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(0), ok: false };
|
|
225989
226050
|
}
|
|
226051
|
+
// good matrix and non-zero sine
|
|
225990
226052
|
const a = 1.0 / (2.0 * s);
|
|
225991
|
-
const result = {
|
|
225992
|
-
|
|
225993
|
-
|
|
225994
|
-
|
|
225995
|
-
|
|
225996
|
-
*/
|
|
225997
|
-
static createRotationVectorToVector(vectorA, vectorB, result) {
|
|
225998
|
-
return this.createPartialRotationVectorToVector(vectorA, 1.0, vectorB, result);
|
|
225999
|
-
}
|
|
226000
|
-
/**
|
|
226001
|
-
* Return a matrix that rotates a fraction of the angular sweep from vectorA to vectorB.
|
|
226002
|
-
* @param vectorA initial vector position
|
|
226003
|
-
* @param fraction fractional rotation. 1.0 is "all the way"
|
|
226004
|
-
* @param vectorB final vector position
|
|
226005
|
-
* @param result optional result matrix.
|
|
226006
|
-
*/
|
|
226007
|
-
static createPartialRotationVectorToVector(vectorA, fraction, vectorB, result) {
|
|
226008
|
-
let upVector = vectorA.unitCrossProduct(vectorB);
|
|
226009
|
-
if (upVector) { // the usual case --
|
|
226010
|
-
return Matrix3d.createRotationAroundVector(upVector, _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(fraction * vectorA.planarAngleTo(vectorB, upVector).radians));
|
|
226011
|
-
}
|
|
226012
|
-
// fail if either vector is zero ...
|
|
226013
|
-
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(vectorA.magnitude())
|
|
226014
|
-
|| _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(vectorB.magnitude()))
|
|
226015
|
-
return undefined;
|
|
226016
|
-
// nonzero but aligned vectors ...
|
|
226017
|
-
if (vectorA.dotProduct(vectorB) > 0.0)
|
|
226018
|
-
return Matrix3d.createIdentity(result);
|
|
226019
|
-
// nonzero opposing vectors ..
|
|
226020
|
-
upVector = Matrix3d.createPerpendicularVectorFavorPlaneContainingZ(vectorA, upVector);
|
|
226021
|
-
return Matrix3d.createRotationAroundVector(upVector, _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(fraction * Math.PI));
|
|
226022
|
-
}
|
|
226023
|
-
/** Create a 90 degree rotation around a principal axis */
|
|
226024
|
-
static create90DegreeRotationAroundAxis(axisIndex) {
|
|
226025
|
-
axisIndex = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.cyclic3dAxis(axisIndex);
|
|
226026
|
-
if (axisIndex === 0) {
|
|
226027
|
-
const retVal = Matrix3d.createRowValues(1, 0, 0, 0, 0, -1, 0, 1, 0);
|
|
226028
|
-
retVal.setupInverseTranspose();
|
|
226029
|
-
return retVal;
|
|
226030
|
-
}
|
|
226031
|
-
else if (axisIndex === 1) {
|
|
226032
|
-
const retVal = Matrix3d.createRowValues(0, 0, 1, 0, 1, 0, -1, 0, 0);
|
|
226033
|
-
retVal.setupInverseTranspose();
|
|
226034
|
-
return retVal;
|
|
226035
|
-
}
|
|
226036
|
-
else {
|
|
226037
|
-
const retVal = Matrix3d.createRowValues(0, -1, 0, 1, 0, 0, 0, 0, 1);
|
|
226038
|
-
retVal.setupInverseTranspose();
|
|
226039
|
-
return retVal;
|
|
226040
|
-
}
|
|
226041
|
-
}
|
|
226042
|
-
/** Return (a copy of) the X column */
|
|
226043
|
-
columnX(result) { return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[0], this.coffs[3], this.coffs[6], result); }
|
|
226044
|
-
/** Return (a copy of)the Y column */
|
|
226045
|
-
columnY(result) { return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[1], this.coffs[4], this.coffs[7], result); }
|
|
226046
|
-
/** Return (a copy of)the Z column */
|
|
226047
|
-
columnZ(result) { return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[2], this.coffs[5], this.coffs[8], result); }
|
|
226048
|
-
/** Return the X column magnitude squared */
|
|
226049
|
-
columnXMagnitudeSquared() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[0], this.coffs[3], this.coffs[6]); }
|
|
226050
|
-
/** Return the Y column magnitude squared */
|
|
226051
|
-
columnYMagnitudeSquared() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[1], this.coffs[4], this.coffs[7]); }
|
|
226052
|
-
/** Return the Z column magnitude squared */
|
|
226053
|
-
columnZMagnitudeSquared() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[2], this.coffs[5], this.coffs[8]); }
|
|
226054
|
-
/** Return the X column magnitude */
|
|
226055
|
-
columnXMagnitude() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[0], this.coffs[3], this.coffs[6]); }
|
|
226056
|
-
/** Return the Y column magnitude */
|
|
226057
|
-
columnYMagnitude() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[1], this.coffs[4], this.coffs[7]); }
|
|
226058
|
-
/** Return the Z column magnitude */
|
|
226059
|
-
columnZMagnitude() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[2], this.coffs[5], this.coffs[8]); }
|
|
226060
|
-
/** Return magnitude of columnX cross columnY. */
|
|
226061
|
-
columnXYCrossProductMagnitude() {
|
|
226062
|
-
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]);
|
|
226063
|
-
}
|
|
226064
|
-
/** Return the X row magnitude d */
|
|
226065
|
-
rowXMagnitude() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[0], this.coffs[1], this.coffs[2]); }
|
|
226066
|
-
/** Return the Y row magnitude */
|
|
226067
|
-
rowYMagnitude() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[3], this.coffs[4], this.coffs[5]); }
|
|
226068
|
-
/** Return the Z row magnitude */
|
|
226069
|
-
rowZMagnitude() { return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[6], this.coffs[7], this.coffs[8]); }
|
|
226070
|
-
/** Return the dot product of column X with column Y */
|
|
226071
|
-
/** Return the dot product of column X with column Y */
|
|
226072
|
-
columnXDotColumnY() {
|
|
226073
|
-
return this.coffs[0] * this.coffs[1]
|
|
226074
|
-
+ this.coffs[3] * this.coffs[4]
|
|
226075
|
-
+ this.coffs[6] * this.coffs[7];
|
|
226076
|
-
}
|
|
226077
|
-
/**
|
|
226078
|
-
* Dot product of an indexed column with a vector given as x,y,z
|
|
226079
|
-
* @param columnIndex index of column. Must be 0,1,2
|
|
226080
|
-
* @param x x component of vector
|
|
226081
|
-
* @param y y component of vector
|
|
226082
|
-
* @param z z component of vector
|
|
226083
|
-
*/
|
|
226084
|
-
columnDotXYZ(columnIndex, x, y, z) {
|
|
226085
|
-
return this.coffs[columnIndex] * x + this.coffs[columnIndex + 3] * y + this.coffs[columnIndex + 6] * z;
|
|
226086
|
-
}
|
|
226087
|
-
/** Return (a copy of) the X row */
|
|
226088
|
-
rowX(result) { return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[0], this.coffs[1], this.coffs[2], result); }
|
|
226089
|
-
/** Return (a copy of) the Y row */
|
|
226090
|
-
rowY(result) { return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[3], this.coffs[4], this.coffs[5], result); }
|
|
226091
|
-
/** Return (a copy of) the Z row */
|
|
226092
|
-
rowZ(result) { return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[6], this.coffs[7], this.coffs[8], result); }
|
|
226093
|
-
/** Return the dot product of the vector parameter with the X column. */
|
|
226094
|
-
dotColumnX(vector) { return vector.x * this.coffs[0] + vector.y * this.coffs[3] + vector.z * this.coffs[6]; }
|
|
226095
|
-
/** Return the dot product of the vector parameter with the Y column. */
|
|
226096
|
-
dotColumnY(vector) { return vector.x * this.coffs[1] + vector.y * this.coffs[4] + vector.z * this.coffs[7]; }
|
|
226097
|
-
/** Return the dot product of the vector parameter with the Z column. */
|
|
226098
|
-
dotColumnZ(vector) { return vector.x * this.coffs[2] + vector.y * this.coffs[5] + vector.z * this.coffs[8]; }
|
|
226099
|
-
/** Return the dot product of the vector parameter with the X row. */
|
|
226100
|
-
dotRowX(vector) { return vector.x * this.coffs[0] + vector.y * this.coffs[1] + vector.z * this.coffs[2]; }
|
|
226101
|
-
/** Return the dot product of the vector parameter with the Y row. */
|
|
226102
|
-
dotRowY(vector) { return vector.x * this.coffs[3] + vector.y * this.coffs[4] + vector.z * this.coffs[5]; }
|
|
226103
|
-
/** Return the dot product of the vector parameter with the Z row. */
|
|
226104
|
-
dotRowZ(vector) { return vector.x * this.coffs[6] + vector.y * this.coffs[7] + vector.z * this.coffs[8]; }
|
|
226105
|
-
// cSpell:words XXYZ YXYZ ZXYZ XYZAs Eigen
|
|
226106
|
-
/** Return the dot product of the x,y,z with the X row. */
|
|
226107
|
-
dotRowXXYZ(x, y, z) { return x * this.coffs[0] + y * this.coffs[1] + z * this.coffs[2]; }
|
|
226108
|
-
/** Return the dot product of the x,y,z with the Y row. */
|
|
226109
|
-
dotRowYXYZ(x, y, z) { return x * this.coffs[3] + y * this.coffs[4] + z * this.coffs[5]; }
|
|
226110
|
-
/** Return the dot product of the x,y,z with the Z row. */
|
|
226111
|
-
dotRowZXYZ(x, y, z) { return x * this.coffs[6] + y * this.coffs[7] + z * this.coffs[8]; }
|
|
226112
|
-
/** Return the (vector) cross product of the Z column with the vector parameter. */
|
|
226113
|
-
columnZCrossVector(vector, result) {
|
|
226114
|
-
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.crossProductXYZXYZ(this.coffs[2], this.coffs[5], this.coffs[8], vector.x, vector.y, vector.z, result);
|
|
226115
|
-
}
|
|
226116
|
-
/*
|
|
226117
|
-
* Replace current rows Ui Uj with (c*Ui - s*Uj) and (c*Uj + s*Ui).
|
|
226118
|
-
* @param i first row index. must be 0,1,2 (unchecked)
|
|
226119
|
-
* @param j second row index. must be 0,1,2 (unchecked)
|
|
226120
|
-
* @param c fist coefficient
|
|
226121
|
-
* @param s second coefficient
|
|
226122
|
-
*/
|
|
226123
|
-
applyGivensRowOp(i, j, c, s) {
|
|
226124
|
-
let ii = 3 * i;
|
|
226125
|
-
let jj = 3 * j;
|
|
226126
|
-
const limit = ii + 3;
|
|
226127
|
-
for (; ii < limit; ii++, jj++) {
|
|
226128
|
-
const a = this.coffs[ii];
|
|
226129
|
-
const b = this.coffs[jj];
|
|
226130
|
-
this.coffs[ii] = a * c + b * s;
|
|
226131
|
-
this.coffs[jj] = -a * s + b * c;
|
|
226132
|
-
}
|
|
226133
|
-
}
|
|
226134
|
-
/**
|
|
226135
|
-
* create a rigid coordinate frame column z parallel to (_x_,_y_,_z_) and column x in the xy plane.
|
|
226136
|
-
* * column z points from origin to x,y,z
|
|
226137
|
-
* * column x is perpendicular and in the xy plane
|
|
226138
|
-
* * column y is perpendicular to both. It is the "up" vector on the view plane.
|
|
226139
|
-
* * Multiplying a world vector times the transpose of this matrix transforms into the view xy
|
|
226140
|
-
* * Multiplying the matrix times the an in-view vector transforms the vector to world.
|
|
226141
|
-
* @param x eye x coordinate
|
|
226142
|
-
* @param y eye y coordinate
|
|
226143
|
-
* @param z eye z coordinate
|
|
226144
|
-
* @param result
|
|
226145
|
-
*/
|
|
226146
|
-
static createRigidViewAxesZTowardsEye(x, y, z, result) {
|
|
226147
|
-
result = Matrix3d.createIdentity(result);
|
|
226148
|
-
const rxy = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXY(x, y);
|
|
226149
|
-
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(rxy)) {
|
|
226150
|
-
// special case for top or bottom view.
|
|
226151
|
-
if (z < 0.0)
|
|
226152
|
-
result.scaleColumnsInPlace(1.0, -1, -1.0);
|
|
226153
|
-
}
|
|
226154
|
-
else {
|
|
226155
|
-
// const d = Geometry.hypotenuseSquaredXYZ(x, y, z);
|
|
226156
|
-
const c = x / rxy;
|
|
226157
|
-
const s = y / rxy;
|
|
226158
|
-
result.setRowValues(-s, 0, c, c, 0, s, 0, 1, 0);
|
|
226159
|
-
if (z !== 0.0) {
|
|
226160
|
-
const r = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(x, y, z);
|
|
226161
|
-
const s1 = z / r;
|
|
226162
|
-
const c1 = rxy / r;
|
|
226163
|
-
result.applyGivensColumnOp(1, 2, c1, -s1);
|
|
226164
|
-
}
|
|
226165
|
-
}
|
|
226053
|
+
const result = {
|
|
226054
|
+
axis: _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(skewYZ * a, skewZX * a, skewXY * a),
|
|
226055
|
+
angle: _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createAtan2(s, c),
|
|
226056
|
+
ok: true,
|
|
226057
|
+
};
|
|
226166
226058
|
return result;
|
|
226167
226059
|
}
|
|
226168
226060
|
/** Rotate so columns i and j become perpendicular */
|
|
@@ -226194,8 +226086,7 @@ class Matrix3d {
|
|
|
226194
226086
|
factorPerpendicularColumns(matrixC, matrixU) {
|
|
226195
226087
|
matrixC.setFrom(this);
|
|
226196
226088
|
matrixU.setIdentity();
|
|
226197
|
-
const
|
|
226198
|
-
const tolerance = 1.0e-12 * ss;
|
|
226089
|
+
const tolerance = 1.0e-12 * this.sumSquares();
|
|
226199
226090
|
for (let iteration = 0; iteration < 7; iteration++) {
|
|
226200
226091
|
const sum = matrixC.applyJacobiColumnRotation(0, 1, matrixU)
|
|
226201
226092
|
+ matrixC.applyJacobiColumnRotation(0, 2, matrixU)
|
|
@@ -226286,8 +226177,7 @@ class Matrix3d {
|
|
|
226286
226177
|
matrix.coffs[3] = matrix.coffs[1];
|
|
226287
226178
|
matrix.coffs[6] = matrix.coffs[2];
|
|
226288
226179
|
matrix.coffs[7] = matrix.coffs[5];
|
|
226289
|
-
const
|
|
226290
|
-
const tolerance = 1.0e-12 * ss;
|
|
226180
|
+
const tolerance = 1.0e-12 * this.sumSquares();
|
|
226291
226181
|
for (let iteration = 0; iteration < 7; iteration++) {
|
|
226292
226182
|
const sum = leftEigenvectors.applySymmetricJacobi(0, 1, matrix)
|
|
226293
226183
|
+ leftEigenvectors.applySymmetricJacobi(0, 2, matrix)
|
|
@@ -226302,68 +226192,174 @@ class Matrix3d {
|
|
|
226302
226192
|
}
|
|
226303
226193
|
return false;
|
|
226304
226194
|
}
|
|
226305
|
-
/**
|
|
226306
|
-
*
|
|
226195
|
+
/**
|
|
226196
|
+
* Return a matrix that rotates a fraction of the angular sweep from vectorA to vectorB.
|
|
226197
|
+
* @param vectorA initial vector position
|
|
226198
|
+
* @param fraction fractional rotation (1 means rotate all the way)
|
|
226199
|
+
* @param vectorB final vector position
|
|
226200
|
+
* @param result optional result matrix.
|
|
226307
226201
|
*/
|
|
226308
|
-
|
|
226309
|
-
|
|
226310
|
-
|
|
226311
|
-
|
|
226312
|
-
|
|
226313
|
-
|
|
226314
|
-
|
|
226315
|
-
|
|
226316
|
-
|
|
226317
|
-
|
|
226318
|
-
|
|
226319
|
-
|
|
226320
|
-
|
|
226321
|
-
|
|
226322
|
-
|
|
226323
|
-
|
|
226324
|
-
|
|
226325
|
-
|
|
226326
|
-
|
|
226327
|
-
|
|
226328
|
-
|
|
226329
|
-
|
|
226330
|
-
|
|
226331
|
-
|
|
226332
|
-
|
|
226333
|
-
|
|
226334
|
-
|
|
226335
|
-
|
|
226336
|
-
|
|
226337
|
-
|
|
226338
|
-
|
|
226339
|
-
|
|
226202
|
+
static createPartialRotationVectorToVector(vectorA, fraction, vectorB, result) {
|
|
226203
|
+
let upVector = vectorA.unitCrossProduct(vectorB);
|
|
226204
|
+
// the usual case (both vectors and also their cross product is non-zero)
|
|
226205
|
+
if (upVector) {
|
|
226206
|
+
return Matrix3d.createRotationAroundVector(upVector, _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(fraction * vectorA.planarAngleTo(vectorB, upVector).radians));
|
|
226207
|
+
}
|
|
226208
|
+
// if either vector is zero
|
|
226209
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(vectorA.magnitude())
|
|
226210
|
+
|| _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(vectorB.magnitude()))
|
|
226211
|
+
return undefined;
|
|
226212
|
+
// aligned vectors (cross product = 0, dot product > 0)
|
|
226213
|
+
if (vectorA.dotProduct(vectorB) > 0.0)
|
|
226214
|
+
return Matrix3d.createIdentity(result);
|
|
226215
|
+
// opposing vectors (cross product = 0, dot product < 0)
|
|
226216
|
+
upVector = Matrix3d.createPerpendicularVectorFavorPlaneContainingZ(vectorA, upVector);
|
|
226217
|
+
return Matrix3d.createRotationAroundVector(upVector, _Angle__WEBPACK_IMPORTED_MODULE_1__.Angle.createRadians(fraction * Math.PI));
|
|
226218
|
+
}
|
|
226219
|
+
/** Returns a matrix that rotates from vectorA to vectorB. */
|
|
226220
|
+
static createRotationVectorToVector(vectorA, vectorB, result) {
|
|
226221
|
+
return this.createPartialRotationVectorToVector(vectorA, 1.0, vectorB, result);
|
|
226222
|
+
}
|
|
226223
|
+
/** Create a 90 degree rotation around a principal axis */
|
|
226224
|
+
static create90DegreeRotationAroundAxis(axisIndex) {
|
|
226225
|
+
axisIndex = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.cyclic3dAxis(axisIndex);
|
|
226226
|
+
if (axisIndex === 0) {
|
|
226227
|
+
const retVal = Matrix3d.createRowValues(1, 0, 0, 0, 0, -1, 0, 1, 0);
|
|
226228
|
+
retVal.setupInverseTranspose();
|
|
226229
|
+
return retVal;
|
|
226230
|
+
}
|
|
226231
|
+
else if (axisIndex === 1) {
|
|
226232
|
+
const retVal = Matrix3d.createRowValues(0, 0, 1, 0, 1, 0, -1, 0, 0);
|
|
226233
|
+
retVal.setupInverseTranspose();
|
|
226234
|
+
return retVal;
|
|
226235
|
+
}
|
|
226236
|
+
else {
|
|
226237
|
+
const retVal = Matrix3d.createRowValues(0, -1, 0, 1, 0, 0, 0, 0, 1);
|
|
226238
|
+
retVal.setupInverseTranspose();
|
|
226239
|
+
return retVal;
|
|
226240
|
+
}
|
|
226241
|
+
}
|
|
226242
|
+
/** Return (a copy of) the X column */
|
|
226243
|
+
columnX(result) {
|
|
226244
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[0], this.coffs[3], this.coffs[6], result);
|
|
226245
|
+
}
|
|
226246
|
+
/** Return (a copy of) the Y column */
|
|
226247
|
+
columnY(result) {
|
|
226248
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[1], this.coffs[4], this.coffs[7], result);
|
|
226249
|
+
}
|
|
226250
|
+
/** Return (a copy of) the Z column */
|
|
226251
|
+
columnZ(result) {
|
|
226252
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[2], this.coffs[5], this.coffs[8], result);
|
|
226253
|
+
}
|
|
226254
|
+
/** Return the X column magnitude squared */
|
|
226255
|
+
columnXMagnitudeSquared() {
|
|
226256
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[0], this.coffs[3], this.coffs[6]);
|
|
226257
|
+
}
|
|
226258
|
+
/** Return the Y column magnitude squared */
|
|
226259
|
+
columnYMagnitudeSquared() {
|
|
226260
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[1], this.coffs[4], this.coffs[7]);
|
|
226261
|
+
}
|
|
226262
|
+
/** Return the Z column magnitude squared */
|
|
226263
|
+
columnZMagnitudeSquared() {
|
|
226264
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseSquaredXYZ(this.coffs[2], this.coffs[5], this.coffs[8]);
|
|
226265
|
+
}
|
|
226266
|
+
/** Return the X column magnitude */
|
|
226267
|
+
columnXMagnitude() {
|
|
226268
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[0], this.coffs[3], this.coffs[6]);
|
|
226269
|
+
}
|
|
226270
|
+
/** Return the Y column magnitude */
|
|
226271
|
+
columnYMagnitude() {
|
|
226272
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[1], this.coffs[4], this.coffs[7]);
|
|
226273
|
+
}
|
|
226274
|
+
/** Return the Z column magnitude */
|
|
226275
|
+
columnZMagnitude() {
|
|
226276
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[2], this.coffs[5], this.coffs[8]);
|
|
226277
|
+
}
|
|
226278
|
+
/** Return magnitude of columnX cross columnY. */
|
|
226279
|
+
columnXYCrossProductMagnitude() {
|
|
226280
|
+
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]);
|
|
226281
|
+
}
|
|
226282
|
+
/** Return the X row magnitude */
|
|
226283
|
+
rowXMagnitude() {
|
|
226284
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[0], this.coffs[1], this.coffs[2]);
|
|
226285
|
+
}
|
|
226286
|
+
/** Return the Y row magnitude */
|
|
226287
|
+
rowYMagnitude() {
|
|
226288
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[3], this.coffs[4], this.coffs[5]);
|
|
226289
|
+
}
|
|
226290
|
+
/** Return the Z row magnitude */
|
|
226291
|
+
rowZMagnitude() {
|
|
226292
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(this.coffs[6], this.coffs[7], this.coffs[8]);
|
|
226293
|
+
}
|
|
226294
|
+
/** Return the dot product of column X with column Y */
|
|
226295
|
+
columnXDotColumnY() {
|
|
226296
|
+
return this.coffs[0] * this.coffs[1]
|
|
226297
|
+
+ this.coffs[3] * this.coffs[4]
|
|
226298
|
+
+ this.coffs[6] * this.coffs[7];
|
|
226340
226299
|
}
|
|
226341
226300
|
/**
|
|
226342
|
-
*
|
|
226343
|
-
*
|
|
226344
|
-
* @param
|
|
226345
|
-
* @param
|
|
226301
|
+
* Dot product of an indexed column with a vector given as x,y,z
|
|
226302
|
+
* @param columnIndex index of column. Must be 0,1,2.
|
|
226303
|
+
* @param x x component of vector
|
|
226304
|
+
* @param y y component of vector
|
|
226305
|
+
* @param z z component of vector
|
|
226346
226306
|
*/
|
|
226347
|
-
|
|
226348
|
-
|
|
226349
|
-
|
|
226350
|
-
|
|
226351
|
-
|
|
226352
|
-
|
|
226353
|
-
|
|
226354
|
-
|
|
226355
|
-
|
|
226356
|
-
|
|
226357
|
-
|
|
226358
|
-
|
|
226359
|
-
|
|
226360
|
-
|
|
226361
|
-
return true;
|
|
226362
|
-
}
|
|
226363
|
-
}
|
|
226364
|
-
return false;
|
|
226307
|
+
columnDotXYZ(columnIndex, x, y, z) {
|
|
226308
|
+
return this.coffs[columnIndex] * x + this.coffs[columnIndex + 3] * y + this.coffs[columnIndex + 6] * z;
|
|
226309
|
+
}
|
|
226310
|
+
/** Return (a copy of) the X row */
|
|
226311
|
+
rowX(result) {
|
|
226312
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[0], this.coffs[1], this.coffs[2], result);
|
|
226313
|
+
}
|
|
226314
|
+
/** Return (a copy of) the Y row */
|
|
226315
|
+
rowY(result) {
|
|
226316
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[3], this.coffs[4], this.coffs[5], result);
|
|
226317
|
+
}
|
|
226318
|
+
/** Return (a copy of) the Z row */
|
|
226319
|
+
rowZ(result) {
|
|
226320
|
+
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[6], this.coffs[7], this.coffs[8], result);
|
|
226365
226321
|
}
|
|
226366
|
-
/**
|
|
226322
|
+
/** Return the dot product of the vector parameter with the X column. */
|
|
226323
|
+
dotColumnX(vector) {
|
|
226324
|
+
return vector.x * this.coffs[0] + vector.y * this.coffs[3] + vector.z * this.coffs[6];
|
|
226325
|
+
}
|
|
226326
|
+
/** Return the dot product of the vector parameter with the Y column. */
|
|
226327
|
+
dotColumnY(vector) {
|
|
226328
|
+
return vector.x * this.coffs[1] + vector.y * this.coffs[4] + vector.z * this.coffs[7];
|
|
226329
|
+
}
|
|
226330
|
+
/** Return the dot product of the vector parameter with the Z column. */
|
|
226331
|
+
dotColumnZ(vector) {
|
|
226332
|
+
return vector.x * this.coffs[2] + vector.y * this.coffs[5] + vector.z * this.coffs[8];
|
|
226333
|
+
}
|
|
226334
|
+
/** Return the dot product of the vector parameter with the X row. */
|
|
226335
|
+
dotRowX(vector) {
|
|
226336
|
+
return vector.x * this.coffs[0] + vector.y * this.coffs[1] + vector.z * this.coffs[2];
|
|
226337
|
+
}
|
|
226338
|
+
/** Return the dot product of the vector parameter with the Y row. */
|
|
226339
|
+
dotRowY(vector) {
|
|
226340
|
+
return vector.x * this.coffs[3] + vector.y * this.coffs[4] + vector.z * this.coffs[5];
|
|
226341
|
+
}
|
|
226342
|
+
/** Return the dot product of the vector parameter with the Z row. */
|
|
226343
|
+
dotRowZ(vector) {
|
|
226344
|
+
return vector.x * this.coffs[6] + vector.y * this.coffs[7] + vector.z * this.coffs[8];
|
|
226345
|
+
}
|
|
226346
|
+
/** Return the dot product of the x,y,z with the X row. */
|
|
226347
|
+
dotRowXXYZ(x, y, z) {
|
|
226348
|
+
return x * this.coffs[0] + y * this.coffs[1] + z * this.coffs[2];
|
|
226349
|
+
}
|
|
226350
|
+
/** Return the dot product of the x,y,z with the Y row. */
|
|
226351
|
+
dotRowYXYZ(x, y, z) {
|
|
226352
|
+
return x * this.coffs[3] + y * this.coffs[4] + z * this.coffs[5];
|
|
226353
|
+
}
|
|
226354
|
+
/** Return the dot product of the x,y,z with the Z row. */
|
|
226355
|
+
dotRowZXYZ(x, y, z) {
|
|
226356
|
+
return x * this.coffs[6] + y * this.coffs[7] + z * this.coffs[8];
|
|
226357
|
+
}
|
|
226358
|
+
/** Return the cross product of the Z column with the vector parameter. */
|
|
226359
|
+
columnZCrossVector(vector, result) {
|
|
226360
|
+
return _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.crossProductXYZXYZ(this.coffs[2], this.coffs[5], this.coffs[8], vector.x, vector.y, vector.z, result);
|
|
226361
|
+
}
|
|
226362
|
+
/** Set data from xyz parts of Point4d (w part of Point4d ignored) */
|
|
226367
226363
|
setColumnsPoint4dXYZ(vectorU, vectorV, vectorW) {
|
|
226368
226364
|
this.inverseState = InverseMatrixState.unknown;
|
|
226369
226365
|
this.setRowValues(vectorU.x, vectorV.x, vectorW.x, vectorU.y, vectorV.y, vectorW.y, vectorU.z, vectorV.z, vectorW.z);
|
|
@@ -226387,16 +226383,22 @@ class Matrix3d {
|
|
|
226387
226383
|
this.coffs[index + 6] = 0.0;
|
|
226388
226384
|
}
|
|
226389
226385
|
}
|
|
226390
|
-
/**
|
|
226386
|
+
/**
|
|
226387
|
+
* Set all columns of the matrix. Any undefined vector is zeros.
|
|
226388
|
+
* @param vectorX values for column 0
|
|
226389
|
+
* @param vectorY values for column 1
|
|
226390
|
+
* @param vectorZ optional values for column 2 (it's optional in case column 2 is 000, which is a
|
|
226391
|
+
* projection onto the xy-plane)
|
|
226392
|
+
*/
|
|
226391
226393
|
setColumns(vectorX, vectorY, vectorZ) {
|
|
226392
226394
|
this.setColumn(0, vectorX);
|
|
226393
226395
|
this.setColumn(1, vectorY);
|
|
226394
226396
|
this.setColumn(2, vectorZ);
|
|
226395
226397
|
}
|
|
226396
226398
|
/**
|
|
226397
|
-
*
|
|
226398
|
-
* @param rowIndex row index.
|
|
226399
|
-
* @param value x,
|
|
226399
|
+
* Set entries in one row of the matrix.
|
|
226400
|
+
* @param rowIndex row index. This is interpreted cyclically (using Geometry.cyclic3dAxis).
|
|
226401
|
+
* @param value x,y,z values for row.
|
|
226400
226402
|
*/
|
|
226401
226403
|
setRow(rowIndex, value) {
|
|
226402
226404
|
const index = 3 * _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.cyclic3dAxis(rowIndex);
|
|
@@ -226405,21 +226407,26 @@ class Matrix3d {
|
|
|
226405
226407
|
this.coffs[index + 2] = value.z;
|
|
226406
226408
|
this.inverseState = InverseMatrixState.unknown;
|
|
226407
226409
|
}
|
|
226408
|
-
/**
|
|
226409
|
-
*
|
|
226410
|
+
/**
|
|
226411
|
+
* Return (a copy of) a column of the matrix.
|
|
226412
|
+
* @param i column index. This is interpreted cyclically (using Geometry.cyclic3dAxis).
|
|
226413
|
+
* @param result optional preallocated result.
|
|
226410
226414
|
*/
|
|
226411
226415
|
getColumn(columnIndex, result) {
|
|
226412
226416
|
const index = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.cyclic3dAxis(columnIndex);
|
|
226413
226417
|
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[index], this.coffs[index + 3], this.coffs[index + 6], result);
|
|
226414
226418
|
}
|
|
226415
|
-
/**
|
|
226416
|
-
*
|
|
226419
|
+
/**
|
|
226420
|
+
* Return a (copy of) a row of the matrix.
|
|
226421
|
+
* @param i row index. This is interpreted cyclically (using Geometry.cyclic3dAxis).
|
|
226422
|
+
* @param result optional preallocated result.
|
|
226417
226423
|
*/
|
|
226418
226424
|
getRow(columnIndex, result) {
|
|
226419
226425
|
const index = 3 * _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.cyclic3dAxis(columnIndex);
|
|
226420
226426
|
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(this.coffs[index], this.coffs[index + 1], this.coffs[index + 2], result);
|
|
226421
226427
|
}
|
|
226422
|
-
/**
|
|
226428
|
+
/**
|
|
226429
|
+
* Create a matrix from row vectors.
|
|
226423
226430
|
* ```
|
|
226424
226431
|
* equation
|
|
226425
226432
|
* \begin{bmatrix}U_x & U_y & U_z \\ V_x & V_y & V_z \\ W_x & W_y & W_z \end{bmatrix}
|
|
@@ -226428,13 +226435,18 @@ class Matrix3d {
|
|
|
226428
226435
|
static createRows(vectorU, vectorV, vectorW, result) {
|
|
226429
226436
|
return Matrix3d.createRowValues(vectorU.x, vectorU.y, vectorU.z, vectorV.x, vectorV.y, vectorV.z, vectorW.x, vectorW.y, vectorW.z, result);
|
|
226430
226437
|
}
|
|
226431
|
-
/**
|
|
226432
|
-
*
|
|
226433
|
-
*
|
|
226438
|
+
/**
|
|
226439
|
+
* Create a matrix that scales along a specified `direction`. This means if you multiply the returned matrix
|
|
226440
|
+
* by a `vector`, you get `directional scale` of that `vector`. Suppose `plane` is the plane perpendicular
|
|
226441
|
+
* to the `direction`. When scale = 0, `directional scale` is projection of the `vector` to the `plane`.
|
|
226442
|
+
* When scale = 1, `directional scale` is the `vector` itself. When scale = -1, `directional scale` is
|
|
226443
|
+
* mirror of the `vector` across the `plane`. In general, When scale != 0, the result is computed by first
|
|
226444
|
+
* projecting the `vector` to the `plane`, then translating that projection along the `direction` (if scale > 0)
|
|
226445
|
+
* or in opposite direction (if scale < 0).
|
|
226434
226446
|
* ```
|
|
226435
226447
|
* equation
|
|
226436
|
-
* \text{The matrix is } I
|
|
226437
|
-
* \\ \text{with }
|
|
226448
|
+
* \text{The matrix is } I + (s-1) D D^T
|
|
226449
|
+
* \\ \text{with }D\text{ being the normalized direction vector and }s\text{ being the scale.}
|
|
226438
226450
|
* ```
|
|
226439
226451
|
*/
|
|
226440
226452
|
static createDirectionalScale(direction, scale, result) {
|
|
@@ -226443,19 +226455,13 @@ class Matrix3d {
|
|
|
226443
226455
|
const x = unit.x;
|
|
226444
226456
|
const y = unit.y;
|
|
226445
226457
|
const z = unit.z;
|
|
226446
|
-
const a =
|
|
226458
|
+
const a = scale - 1;
|
|
226447
226459
|
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);
|
|
226448
226460
|
}
|
|
226449
226461
|
return Matrix3d.createUniformScale(scale);
|
|
226450
226462
|
}
|
|
226451
|
-
|
|
226452
|
-
* *
|
|
226453
|
-
* * 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)
|
|
226454
|
-
* * If the direction vector is close to Z, the "next" column ((axisIndex + 1) mode 3) will be in the direction of (direction cross Y)
|
|
226455
|
-
*/
|
|
226456
|
-
// static create1Vector(direction: Vector3d, axisIndex: number): Matrix3d;
|
|
226457
|
-
// static createFromXYVectors(vectorX: Vector3d, vectorY: Vector3d, axisIndex: number): Matrix3d;
|
|
226458
|
-
/** Multiply the matrix * vector, treating the vector is a column vector on the right.
|
|
226463
|
+
/**
|
|
226464
|
+
* Multiply `matrix * vector`, treating the vector is a column vector on the right.
|
|
226459
226465
|
* ```
|
|
226460
226466
|
* equation
|
|
226461
226467
|
* \matrixXY{A}\columnSubXYZ{U}
|
|
@@ -226466,36 +226472,38 @@ class Matrix3d {
|
|
|
226466
226472
|
const x = vectorU.x;
|
|
226467
226473
|
const y = vectorU.y;
|
|
226468
226474
|
const z = vectorU.z;
|
|
226469
|
-
return _Point3dVector3d__WEBPACK_IMPORTED_MODULE_2__.Vector3d.create(
|
|
226475
|
+
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);
|
|
226470
226476
|
}
|
|
226471
|
-
/**
|
|
226472
|
-
*
|
|
226477
|
+
/**
|
|
226478
|
+
* Multiply `matrix * vector` in place for vector in the array, i.e. treating the vector is a column
|
|
226479
|
+
* vector on the right.
|
|
226480
|
+
* * Each `vector` is updated to be `matrix * vector`
|
|
226473
226481
|
*/
|
|
226474
226482
|
multiplyVectorArrayInPlace(data) {
|
|
226475
226483
|
for (const v of data)
|
|
226476
|
-
v.set(
|
|
226484
|
+
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);
|
|
226477
226485
|
}
|
|
226478
|
-
/**
|
|
226486
|
+
/** Compute `origin - matrix * vector` */
|
|
226479
226487
|
static xyzMinusMatrixTimesXYZ(origin, matrix, vector, result) {
|
|
226480
226488
|
const x = vector.x;
|
|
226481
226489
|
const y = vector.y;
|
|
226482
226490
|
const z = vector.z;
|
|
226483
226491
|
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);
|
|
226484
226492
|
}
|
|
226485
|
-
/**
|
|
226493
|
+
/** Compute `origin + matrix * vector` using only the xy parts of the inputs. */
|
|
226486
226494
|
static xyPlusMatrixTimesXY(origin, matrix, vector, result) {
|
|
226487
226495
|
const x = vector.x;
|
|
226488
226496
|
const y = vector.y;
|
|
226489
226497
|
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);
|
|
226490
226498
|
}
|
|
226491
|
-
/**
|
|
226499
|
+
/** Compute `origin + matrix * vector` using all xyz parts of the inputs. */
|
|
226492
226500
|
static xyzPlusMatrixTimesXYZ(origin, matrix, vector, result) {
|
|
226493
226501
|
const x = vector.x;
|
|
226494
226502
|
const y = vector.y;
|
|
226495
226503
|
const z = vector.z;
|
|
226496
226504
|
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);
|
|
226497
226505
|
}
|
|
226498
|
-
/**
|
|
226506
|
+
/** Updates vector to be `origin + matrix * vector` using all xyz parts of the inputs. */
|
|
226499
226507
|
static xyzPlusMatrixTimesXYZInPlace(origin, matrix, vector) {
|
|
226500
226508
|
const x = vector.x;
|
|
226501
226509
|
const y = vector.y;
|
|
@@ -226504,61 +226512,72 @@ class Matrix3d {
|
|
|
226504
226512
|
vector.y = origin.y + matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z;
|
|
226505
226513
|
vector.z = origin.z + matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z;
|
|
226506
226514
|
}
|
|
226507
|
-
/**
|
|
226515
|
+
/** Compute `origin + matrix * vector` where the final vector is given as direct x,y,z coordinates */
|
|
226508
226516
|
static xyzPlusMatrixTimesCoordinates(origin, matrix, x, y, z, result) {
|
|
226509
226517
|
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);
|
|
226510
226518
|
}
|
|
226511
226519
|
/**
|
|
226512
226520
|
* Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row.
|
|
226513
|
-
* Multiply
|
|
226521
|
+
* Multiply the 4x4 matrix by `[x,y,z,w]`
|
|
226522
|
+
* ```
|
|
226523
|
+
* equation
|
|
226524
|
+
* \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}
|
|
226525
|
+
* ```
|
|
226514
226526
|
* @param origin translation part (xyz in column 3)
|
|
226515
226527
|
* @param matrix matrix part (leading 3x3)
|
|
226516
226528
|
* @param x x part of multiplied point
|
|
226517
226529
|
* @param y y part of multiplied point
|
|
226518
226530
|
* @param z z part of multiplied point
|
|
226519
226531
|
* @param w w part of multiplied point
|
|
226520
|
-
* @param result optional result.
|
|
226532
|
+
* @param result optional preallocated result.
|
|
226521
226533
|
*/
|
|
226522
226534
|
static xyzPlusMatrixTimesWeightedCoordinates(origin, matrix, x, y, z, w, result) {
|
|
226523
|
-
return _geometry4d_Point4d__WEBPACK_IMPORTED_MODULE_4__.Point4d.create(
|
|
226535
|
+
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);
|
|
226524
226536
|
}
|
|
226525
226537
|
/**
|
|
226526
226538
|
* Treat the 3x3 matrix and origin as upper 3x4 part of a 4x4 matrix, with 0001 as the final row.
|
|
226527
|
-
* Multiply
|
|
226539
|
+
* Multiply the 4x4 matrix by `[x,y,z,w]`
|
|
226540
|
+
* ```
|
|
226541
|
+
* equation
|
|
226542
|
+
* \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}
|
|
226543
|
+
* ```
|
|
226528
226544
|
* @param origin translation part (xyz in column 3)
|
|
226529
226545
|
* @param matrix matrix part (leading 3x3)
|
|
226530
226546
|
* @param x x part of multiplied point
|
|
226531
226547
|
* @param y y part of multiplied point
|
|
226532
226548
|
* @param z z part of multiplied point
|
|
226533
226549
|
* @param w w part of multiplied point
|
|
226534
|
-
* @param result optional result.
|
|
226550
|
+
* @param result optional preallocated result.
|
|
226535
226551
|
*/
|
|
226536
226552
|
static xyzPlusMatrixTimesWeightedCoordinatesToFloat64Array(origin, matrix, x, y, z, w, result) {
|
|
226537
226553
|
if (!result)
|
|
226538
226554
|
result = new Float64Array(4);
|
|
226539
|
-
result[0] =
|
|
226540
|
-
result[1] =
|
|
226541
|
-
result[2] =
|
|
226555
|
+
result[0] = matrix.coffs[0] * x + matrix.coffs[1] * y + matrix.coffs[2] * z + origin.x * w;
|
|
226556
|
+
result[1] = matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z + origin.y * w;
|
|
226557
|
+
result[2] = matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z + origin.z * w;
|
|
226542
226558
|
result[3] = w;
|
|
226543
226559
|
return result;
|
|
226544
226560
|
}
|
|
226545
226561
|
/**
|
|
226546
|
-
* Treat the 3x3 matrix and origin as
|
|
226547
|
-
* Multiply
|
|
226562
|
+
* Treat the 3x3 matrix and origin as a 3x4 matrix.
|
|
226563
|
+
* * Multiply the 3x4 matrix by `[x,y,z,1]`
|
|
226564
|
+
* ```
|
|
226565
|
+
* equation
|
|
226566
|
+
* \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}
|
|
226567
|
+
* ```
|
|
226548
226568
|
* @param origin translation part (xyz in column 3)
|
|
226549
226569
|
* @param matrix matrix part (leading 3x3)
|
|
226550
226570
|
* @param x x part of multiplied point
|
|
226551
226571
|
* @param y y part of multiplied point
|
|
226552
226572
|
* @param z z part of multiplied point
|
|
226553
|
-
* @param
|
|
226554
|
-
* @param result optional result.
|
|
226573
|
+
* @param result optional preallocated result.
|
|
226555
226574
|
*/
|
|
226556
226575
|
static xyzPlusMatrixTimesCoordinatesToFloat64Array(origin, matrix, x, y, z, result) {
|
|
226557
226576
|
if (!result)
|
|
226558
226577
|
result = new Float64Array(3);
|
|
226559
|
-
result[0] =
|
|
226560
|
-
result[1] =
|
|
226561
|
-
result[2] =
|
|
226578
|
+
result[0] = matrix.coffs[0] * x + matrix.coffs[1] * y + matrix.coffs[2] * z + origin.x;
|
|
226579
|
+
result[1] = matrix.coffs[3] * x + matrix.coffs[4] * y + matrix.coffs[5] * z + origin.y;
|
|
226580
|
+
result[2] = matrix.coffs[6] * x + matrix.coffs[7] * y + matrix.coffs[8] * z + origin.z;
|
|
226562
226581
|
return result;
|
|
226563
226582
|
}
|
|
226564
226583
|
/**
|
|
@@ -226578,9 +226597,9 @@ class Matrix3d {
|
|
|
226578
226597
|
const x = vector.x;
|
|
226579
226598
|
const y = vector.y;
|
|
226580
226599
|
const z = vector.z;
|
|
226581
|
-
result.x =
|
|
226582
|
-
result.y =
|
|
226583
|
-
result.z =
|
|
226600
|
+
result.x = this.coffs[0] * x + this.coffs[3] * y + this.coffs[6] * z;
|
|
226601
|
+
result.y = this.coffs[1] * x + this.coffs[4] * y + this.coffs[7] * z;
|
|
226602
|
+
result.z = this.coffs[2] * x + this.coffs[5] * y + this.coffs[8] * z;
|
|
226584
226603
|
return result;
|
|
226585
226604
|
}
|
|
226586
226605
|
/** Multiply the matrix * (x,y,z), i.e. the vector (x,y,z) is a column vector on the right.
|
|
@@ -227108,7 +227127,7 @@ class Matrix3d {
|
|
|
227108
227127
|
* @param scaleX scale factor for column x
|
|
227109
227128
|
* @param scaleY scale factor for column y
|
|
227110
227129
|
* @param scaleZ scale factor for column z
|
|
227111
|
-
* @param result optional result.
|
|
227130
|
+
* @param result optional preallocated result.
|
|
227112
227131
|
*/
|
|
227113
227132
|
scaleColumns(scaleX, scaleY, scaleZ, result) {
|
|
227114
227133
|
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);
|
|
@@ -227129,7 +227148,7 @@ class Matrix3d {
|
|
|
227129
227148
|
this.coffs[7] *= scaleY;
|
|
227130
227149
|
this.coffs[8] *= scaleZ;
|
|
227131
227150
|
if (this.inverseState === InverseMatrixState.inverseStored && this.inverseCoffs !== undefined) {
|
|
227132
|
-
// apply
|
|
227151
|
+
// apply reverse scales to the ROWS of the inverse
|
|
227133
227152
|
const divX = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(1.0, scaleX);
|
|
227134
227153
|
const divY = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(1.0, scaleY);
|
|
227135
227154
|
const divZ = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.conditionalDivideFraction(1.0, scaleZ);
|
|
@@ -227152,7 +227171,7 @@ class Matrix3d {
|
|
|
227152
227171
|
* @param scaleX scale factor for row x
|
|
227153
227172
|
* @param scaleY scale factor for row y
|
|
227154
227173
|
* @param scaleZ scale factor for row z
|
|
227155
|
-
* @param result optional result.
|
|
227174
|
+
* @param result optional preallocated result.
|
|
227156
227175
|
*/
|
|
227157
227176
|
scaleRows(scaleX, scaleY, scaleZ, result) {
|
|
227158
227177
|
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);
|
|
@@ -227196,12 +227215,49 @@ class Matrix3d {
|
|
|
227196
227215
|
}
|
|
227197
227216
|
/** create a Matrix3d whose values are uniformly scaled from this.
|
|
227198
227217
|
* @param scale scale factor to apply.
|
|
227199
|
-
* @param result optional result.
|
|
227218
|
+
* @param result optional preallocated result.
|
|
227200
227219
|
* @returns Return the new or repopulated matrix
|
|
227201
227220
|
*/
|
|
227202
227221
|
scale(scale, result) {
|
|
227203
227222
|
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);
|
|
227204
227223
|
}
|
|
227224
|
+
/**
|
|
227225
|
+
* Create a rigid matrix (columns and rows are unit length and pairwise perpendicular) for
|
|
227226
|
+
* the given eye coordinate.
|
|
227227
|
+
* * column z is parallel to x,y,z
|
|
227228
|
+
* * column x is perpendicular to column z and is in the xy plane
|
|
227229
|
+
* * column y is perpendicular to both. It is the "up" vector on the view plane.
|
|
227230
|
+
* * Multiplying the returned matrix times a local (view) vector gives the world vector.
|
|
227231
|
+
* * Multiplying transpose of the returned matrix times a world vector gives the local
|
|
227232
|
+
* (view) vector.
|
|
227233
|
+
* @param x eye x coordinate
|
|
227234
|
+
* @param y eye y coordinate
|
|
227235
|
+
* @param z eye z coordinate
|
|
227236
|
+
* @param result optional preallocated result
|
|
227237
|
+
*/
|
|
227238
|
+
static createRigidViewAxesZTowardsEye(x, y, z, result) {
|
|
227239
|
+
result = Matrix3d.createIdentity(result);
|
|
227240
|
+
const rxy = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXY(x, y);
|
|
227241
|
+
// if coordinate is (0,0,z), i.e., Top or Bottom view
|
|
227242
|
+
if (_Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.isSmallMetricDistance(rxy)) {
|
|
227243
|
+
if (z < 0.0)
|
|
227244
|
+
result.scaleColumnsInPlace(1.0, -1.0, -1.0);
|
|
227245
|
+
}
|
|
227246
|
+
else {
|
|
227247
|
+
const c = x / rxy;
|
|
227248
|
+
const s = y / rxy;
|
|
227249
|
+
// if coordinate is (x,y,0), i.e., Front or Back or Left or Right view
|
|
227250
|
+
result.setRowValues(-s, 0, c, c, 0, s, 0, 1, 0);
|
|
227251
|
+
// if coordinate is (x,y,z), i.e., other views such as Iso or RightIso
|
|
227252
|
+
if (z !== 0.0) {
|
|
227253
|
+
const r = _Geometry__WEBPACK_IMPORTED_MODULE_0__.Geometry.hypotenuseXYZ(x, y, z);
|
|
227254
|
+
const s1 = z / r;
|
|
227255
|
+
const c1 = rxy / r;
|
|
227256
|
+
result.applyGivensColumnOp(1, 2, c1, -s1);
|
|
227257
|
+
}
|
|
227258
|
+
}
|
|
227259
|
+
return result;
|
|
227260
|
+
}
|
|
227205
227261
|
/** Return the determinant of this matrix. */
|
|
227206
227262
|
determinant() {
|
|
227207
227263
|
return this.coffs[0] * this.coffs[4] * this.coffs[8]
|
|
@@ -230209,7 +230265,7 @@ class Vector3d extends XYZ {
|
|
|
230209
230265
|
return { v: this.safeDivideOrNull(magnitude, result), mag: magnitude };
|
|
230210
230266
|
}
|
|
230211
230267
|
/**
|
|
230212
|
-
* Return a unit vector parallel with this.
|
|
230268
|
+
* Return a unit vector parallel with this. Return undefined if this.magnitude is near zero.
|
|
230213
230269
|
* @param result optional result.
|
|
230214
230270
|
*/
|
|
230215
230271
|
normalize(result) {
|
|
@@ -235648,7 +235704,7 @@ class Segment1d {
|
|
|
235648
235704
|
*/
|
|
235649
235705
|
reverseInPlace() { const x = this.x0; this.x0 = this.x1; this.x1 = x; }
|
|
235650
235706
|
/**
|
|
235651
|
-
* * if `x1
|
|
235707
|
+
* * if `x1-x0` multiplied by the scale factor is (strictly) negative, swap the x0 and x1 member values.
|
|
235652
235708
|
* * This makes the fractionToPoint evaluates reverse direction.
|
|
235653
235709
|
*/
|
|
235654
235710
|
reverseIfNeededForDeltaSign(sign = 1) {
|
|
@@ -303448,7 +303504,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
|
303448
303504
|
/***/ ((module) => {
|
|
303449
303505
|
|
|
303450
303506
|
"use strict";
|
|
303451
|
-
module.exports = JSON.parse('{"name":"@itwin/core-frontend","version":"4.0.0-dev.
|
|
303507
|
+
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"}}]}}');
|
|
303452
303508
|
|
|
303453
303509
|
/***/ })
|
|
303454
303510
|
|