@itwin/core-geometry 4.10.0-dev.26 → 4.10.0-dev.28

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.
Files changed (117) hide show
  1. package/lib/cjs/core-geometry.d.ts +1 -1
  2. package/lib/cjs/core-geometry.d.ts.map +1 -1
  3. package/lib/cjs/core-geometry.js +1 -1
  4. package/lib/cjs/core-geometry.js.map +1 -1
  5. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  6. package/lib/cjs/curve/Arc3d.js +2 -1
  7. package/lib/cjs/curve/Arc3d.js.map +1 -1
  8. package/lib/cjs/curve/CurveFactory.d.ts +1 -1
  9. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  10. package/lib/cjs/curve/CurveFactory.js +3 -3
  11. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  12. package/lib/cjs/curve/LineSegment3d.js +2 -2
  13. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  14. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  15. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +3 -2
  16. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  17. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  18. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +7 -6
  19. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  20. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  21. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +3 -2
  22. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  23. package/lib/cjs/geometry3d/BilinearPatch.js +4 -4
  24. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  25. package/lib/cjs/geometry3d/Matrix3d.d.ts +26 -16
  26. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  27. package/lib/cjs/geometry3d/Matrix3d.js +34 -16
  28. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  29. package/lib/cjs/geometry3d/Ray3d.js +2 -2
  30. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  31. package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
  32. package/lib/cjs/geometry4d/Point4d.js +2 -1
  33. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  34. package/lib/cjs/numerics/Newton.d.ts +3 -0
  35. package/lib/cjs/numerics/Newton.d.ts.map +1 -1
  36. package/lib/cjs/numerics/Newton.js +2 -5
  37. package/lib/cjs/numerics/Newton.js.map +1 -1
  38. package/lib/cjs/numerics/Polynomials.d.ts +22 -178
  39. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  40. package/lib/cjs/numerics/Polynomials.js +62 -360
  41. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  42. package/lib/cjs/numerics/SmallSystem.d.ts +164 -0
  43. package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -0
  44. package/lib/cjs/numerics/SmallSystem.js +321 -0
  45. package/lib/cjs/numerics/SmallSystem.js.map +1 -0
  46. package/lib/cjs/polyface/multiclip/OffsetMeshContext.d.ts +1 -1
  47. package/lib/cjs/polyface/multiclip/OffsetMeshContext.d.ts.map +1 -1
  48. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +7 -7
  49. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  50. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  51. package/lib/cjs/topology/Graph.js +2 -2
  52. package/lib/cjs/topology/Graph.js.map +1 -1
  53. package/lib/cjs/topology/InsertAndRetriangulateContext.js +2 -2
  54. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  55. package/lib/cjs/topology/Merging.d.ts +1 -1
  56. package/lib/cjs/topology/Merging.d.ts.map +1 -1
  57. package/lib/cjs/topology/Merging.js +2 -2
  58. package/lib/cjs/topology/Merging.js.map +1 -1
  59. package/lib/esm/core-geometry.d.ts +1 -1
  60. package/lib/esm/core-geometry.d.ts.map +1 -1
  61. package/lib/esm/core-geometry.js +1 -1
  62. package/lib/esm/core-geometry.js.map +1 -1
  63. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  64. package/lib/esm/curve/Arc3d.js +2 -1
  65. package/lib/esm/curve/Arc3d.js.map +1 -1
  66. package/lib/esm/curve/CurveFactory.d.ts +1 -1
  67. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  68. package/lib/esm/curve/CurveFactory.js +1 -1
  69. package/lib/esm/curve/CurveFactory.js.map +1 -1
  70. package/lib/esm/curve/LineSegment3d.js +1 -1
  71. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  72. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  73. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +2 -1
  74. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  75. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  76. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +2 -1
  77. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  78. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  79. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +2 -1
  80. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  81. package/lib/esm/geometry3d/BilinearPatch.js +1 -1
  82. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  83. package/lib/esm/geometry3d/Matrix3d.d.ts +26 -16
  84. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  85. package/lib/esm/geometry3d/Matrix3d.js +34 -16
  86. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  87. package/lib/esm/geometry3d/Ray3d.js +1 -1
  88. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  89. package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
  90. package/lib/esm/geometry4d/Point4d.js +2 -1
  91. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  92. package/lib/esm/numerics/Newton.d.ts +3 -0
  93. package/lib/esm/numerics/Newton.d.ts.map +1 -1
  94. package/lib/esm/numerics/Newton.js +1 -4
  95. package/lib/esm/numerics/Newton.js.map +1 -1
  96. package/lib/esm/numerics/Polynomials.d.ts +22 -178
  97. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  98. package/lib/esm/numerics/Polynomials.js +62 -359
  99. package/lib/esm/numerics/Polynomials.js.map +1 -1
  100. package/lib/esm/numerics/SmallSystem.d.ts +164 -0
  101. package/lib/esm/numerics/SmallSystem.d.ts.map +1 -0
  102. package/lib/esm/numerics/SmallSystem.js +317 -0
  103. package/lib/esm/numerics/SmallSystem.js.map +1 -0
  104. package/lib/esm/polyface/multiclip/OffsetMeshContext.d.ts +1 -1
  105. package/lib/esm/polyface/multiclip/OffsetMeshContext.d.ts.map +1 -1
  106. package/lib/esm/polyface/multiclip/OffsetMeshContext.js +4 -4
  107. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  108. package/lib/esm/topology/Graph.d.ts.map +1 -1
  109. package/lib/esm/topology/Graph.js +1 -1
  110. package/lib/esm/topology/Graph.js.map +1 -1
  111. package/lib/esm/topology/InsertAndRetriangulateContext.js +1 -1
  112. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  113. package/lib/esm/topology/Merging.d.ts +1 -1
  114. package/lib/esm/topology/Merging.d.ts.map +1 -1
  115. package/lib/esm/topology/Merging.js +1 -1
  116. package/lib/esm/topology/Merging.js.map +1 -1
  117. package/package.json +3 -3
@@ -2497,8 +2497,8 @@ export class Matrix3d {
2497
2497
  return Math.sqrt(sumLow) <= Geometry.smallAngleRadians * (1.0 + Math.sqrt(sumAll));
2498
2498
  }
2499
2499
  /**
2500
- * If the matrix is diagonal and all diagonals are almost equal, return the first diagonal (entry 0
2501
- * which is same as entry 4 and 8). Otherwise return `undefined`.
2500
+ * If the matrix is diagonal with almost equal diagonal entries, return the first diagonal entry.
2501
+ * Otherwise return `undefined`.
2502
2502
  */
2503
2503
  sameDiagonalScale() {
2504
2504
  const sumAll = this.sumSquares();
@@ -2511,32 +2511,31 @@ export class Matrix3d {
2511
2511
  return undefined;
2512
2512
  }
2513
2513
  /**
2514
- * Test if all rows and columns are unit length and are perpendicular to each other, i.e., the matrix is either
2515
- * a `pure rotation` (determinant is +1) or is a `mirror` (determinant is -1).
2516
- * * **Note:** such a matrix is called `orthogonal` and its inverse is its transpose.
2514
+ * Test if all rows and columns are unit length and perpendicular to each other.
2515
+ * * If so, the matrix is either a rotation (determinant is +1) or a mirror (determinant is -1).
2516
+ * * Such a matrix is called "orthogonal" and its inverse is its transpose.
2517
2517
  */
2518
2518
  testPerpendicularUnitRowsAndColumns() {
2519
2519
  const product = this.multiplyMatrixMatrixTranspose(this);
2520
2520
  return product.isIdentity;
2521
2521
  }
2522
2522
  /**
2523
- * Test if the matrix is a `rigid` matrix (or `pure rotation`, i.e., columns and rows are unit length and
2524
- * pairwise perpendicular and determinant is +1).
2525
- * @param allowMirror whether to widen the test to return true if the matrix is a `mirror` (determinant is -1).
2523
+ * Test if the matrix is a rigid matrix.
2524
+ * * A rigid matrix is a rotation: its columns and rows are unit length and pairwise perpendicular, and its
2525
+ * determinant is +1.
2526
+ * @param allowMirror whether to widen the test to also return true if the matrix is a mirror (determinant is -1).
2526
2527
  */
2527
2528
  isRigid(allowMirror = false) {
2528
2529
  return this.testPerpendicularUnitRowsAndColumns() && (allowMirror || this.determinant() > 0);
2529
2530
  }
2530
2531
  /**
2531
- * Test if all rows and columns are perpendicular to each other and have equal length.
2532
- * If so, the length (or its negative) is the `scale` factor from a set of `orthonormal axes` to
2533
- * the set of axes created by columns of `this` matrix. Otherwise, returns `undefined`.
2532
+ * Test if the instance is the product of a rigid matrix and a signed scale, and return both.
2533
+ * * Specifically, this is a test of whether the instance rows and columns are pairwise perpendicular and have equal
2534
+ * length. If so, the scale factor is this length, or its negative if the instance is a mirror, and dividing the
2535
+ * columns by this scale factor produces a rigid matrix (a rotation).
2534
2536
  * @param result optional pre-allocated object to populate and return
2535
- * @returns returns `{ rigidAxes, scale }` where `rigidAxes` is a Matrix3d with its columns as the rigid axes
2536
- * (with the scale factor removed) and `scale` is the scale factor.
2537
- * * Note that determinant of a rigid matrix is +1.
2538
- * * The context for this method is to determine if the matrix is the product a `rotation` matrix and a uniform
2539
- * `scale` matrix (diagonal matrix with all diagonal entries the same nonzero number).
2537
+ * @returns the factorization `{ rigidAxes, scale }` where `rigidAxes` is the instance matrix with `scale` factor
2538
+ * removed, or undefined if the factorization failed.
2540
2539
  */
2541
2540
  factorRigidWithSignedScale(result) {
2542
2541
  const product = this.multiplyMatrixMatrixTranspose(this);
@@ -2547,6 +2546,25 @@ export class Matrix3d {
2547
2546
  const scaleInverse = 1.0 / scale;
2548
2547
  return { rigidAxes: this.scaleColumns(scaleInverse, scaleInverse, scaleInverse, result), scale };
2549
2548
  }
2549
+ /**
2550
+ * Compute the factorization M = R*G, where R is rigid (a rotation) and G is whatever is left over (skew, scale,
2551
+ * mirror, etc).
2552
+ * * The rotation is computed from the instance by passing `axisOrder` into [[createRigidFromMatrix3d]].
2553
+ * @param rotation the rigid factor R
2554
+ * @param skew the non-rotation factor G = R^t * M (since R transposed is its inverse)
2555
+ * @param axisOrder optional cross product ordering for computing R
2556
+ * @return whether [[createRigidFromMatrix3d]] succeeded; if not, `rotation` is set to the identity, and `skew` is
2557
+ * set to this instance.
2558
+ */
2559
+ factorRigidSkew(rotation, skew, axisOrder = AxisOrder.XYZ) {
2560
+ if (Matrix3d.createRigidFromMatrix3d(this, axisOrder, rotation)) {
2561
+ rotation.multiplyMatrixTransposeMatrix(this, skew);
2562
+ return true;
2563
+ }
2564
+ rotation.setIdentity();
2565
+ skew.setFrom(this);
2566
+ return false;
2567
+ }
2550
2568
  /** Test if `this` matrix reorders and/or negates the columns of the `identity` matrix. */
2551
2569
  get isSignedPermutation() {
2552
2570
  let count = 0;