@itwin/core-geometry 4.10.0-dev.2 → 4.10.0-dev.22

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 (138) hide show
  1. package/CHANGELOG.md +31 -1
  2. package/lib/cjs/Geometry.d.ts +2 -2
  3. package/lib/cjs/Geometry.js +2 -2
  4. package/lib/cjs/Geometry.js.map +1 -1
  5. package/lib/cjs/clipping/ClipPrimitive.d.ts +7 -7
  6. package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
  7. package/lib/cjs/clipping/ClipPrimitive.js +1 -1
  8. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  9. package/lib/cjs/curve/Arc3d.d.ts +21 -10
  10. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  11. package/lib/cjs/curve/Arc3d.js +64 -37
  12. package/lib/cjs/curve/Arc3d.js.map +1 -1
  13. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +27 -8
  14. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  15. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +44 -25
  16. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  17. package/lib/cjs/curve/CurveFactory.d.ts +10 -12
  18. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  19. package/lib/cjs/curve/CurveFactory.js +16 -43
  20. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  21. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +2 -2
  22. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  23. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +1 -0
  24. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  25. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +33 -59
  26. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  27. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts +22 -7
  28. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  29. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +128 -68
  30. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  31. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  32. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +14 -11
  33. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  34. package/lib/cjs/geometry3d/Angle.d.ts +5 -5
  35. package/lib/cjs/geometry3d/Angle.js +5 -5
  36. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  37. package/lib/cjs/geometry3d/AngleSweep.d.ts +101 -13
  38. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  39. package/lib/cjs/geometry3d/AngleSweep.js +156 -57
  40. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  41. package/lib/cjs/geometry3d/Matrix3d.d.ts +9 -15
  42. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  43. package/lib/cjs/geometry3d/Matrix3d.js +21 -15
  44. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  45. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +6 -5
  46. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  47. package/lib/cjs/geometry3d/Point3dVector3d.js +6 -5
  48. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  49. package/lib/cjs/geometry3d/PolygonOps.js +2 -2
  50. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  51. package/lib/cjs/geometry3d/Transform.d.ts +4 -2
  52. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  53. package/lib/cjs/geometry3d/Transform.js +4 -2
  54. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  55. package/lib/cjs/geometry4d/Map4d.d.ts +5 -5
  56. package/lib/cjs/geometry4d/Map4d.js +5 -5
  57. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  58. package/lib/cjs/geometry4d/Matrix4d.d.ts +4 -7
  59. package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
  60. package/lib/cjs/geometry4d/Matrix4d.js +4 -7
  61. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  62. package/lib/cjs/numerics/Polynomials.d.ts +37 -36
  63. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  64. package/lib/cjs/numerics/Polynomials.js +90 -105
  65. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  66. package/lib/cjs/polyface/PolyfaceClip.d.ts +3 -3
  67. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  68. package/lib/cjs/polyface/PolyfaceClip.js +1 -1
  69. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  70. package/lib/esm/Geometry.d.ts +2 -2
  71. package/lib/esm/Geometry.js +2 -2
  72. package/lib/esm/Geometry.js.map +1 -1
  73. package/lib/esm/clipping/ClipPrimitive.d.ts +7 -7
  74. package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
  75. package/lib/esm/clipping/ClipPrimitive.js +1 -1
  76. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  77. package/lib/esm/curve/Arc3d.d.ts +21 -10
  78. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  79. package/lib/esm/curve/Arc3d.js +64 -37
  80. package/lib/esm/curve/Arc3d.js.map +1 -1
  81. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +27 -8
  82. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  83. package/lib/esm/curve/CurveChainWithDistanceIndex.js +44 -25
  84. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  85. package/lib/esm/curve/CurveFactory.d.ts +10 -12
  86. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  87. package/lib/esm/curve/CurveFactory.js +16 -43
  88. package/lib/esm/curve/CurveFactory.js.map +1 -1
  89. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +2 -2
  90. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  91. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +1 -0
  92. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  93. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +33 -59
  94. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  95. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts +22 -7
  96. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  97. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +128 -68
  98. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  99. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  100. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +14 -11
  101. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  102. package/lib/esm/geometry3d/Angle.d.ts +5 -5
  103. package/lib/esm/geometry3d/Angle.js +5 -5
  104. package/lib/esm/geometry3d/Angle.js.map +1 -1
  105. package/lib/esm/geometry3d/AngleSweep.d.ts +101 -13
  106. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  107. package/lib/esm/geometry3d/AngleSweep.js +156 -57
  108. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  109. package/lib/esm/geometry3d/Matrix3d.d.ts +9 -15
  110. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  111. package/lib/esm/geometry3d/Matrix3d.js +21 -15
  112. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  113. package/lib/esm/geometry3d/Point3dVector3d.d.ts +6 -5
  114. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  115. package/lib/esm/geometry3d/Point3dVector3d.js +6 -5
  116. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  117. package/lib/esm/geometry3d/PolygonOps.js +2 -2
  118. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  119. package/lib/esm/geometry3d/Transform.d.ts +4 -2
  120. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  121. package/lib/esm/geometry3d/Transform.js +4 -2
  122. package/lib/esm/geometry3d/Transform.js.map +1 -1
  123. package/lib/esm/geometry4d/Map4d.d.ts +5 -5
  124. package/lib/esm/geometry4d/Map4d.js +5 -5
  125. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  126. package/lib/esm/geometry4d/Matrix4d.d.ts +4 -7
  127. package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
  128. package/lib/esm/geometry4d/Matrix4d.js +4 -7
  129. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  130. package/lib/esm/numerics/Polynomials.d.ts +37 -36
  131. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  132. package/lib/esm/numerics/Polynomials.js +90 -105
  133. package/lib/esm/numerics/Polynomials.js.map +1 -1
  134. package/lib/esm/polyface/PolyfaceClip.d.ts +3 -3
  135. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  136. package/lib/esm/polyface/PolyfaceClip.js +1 -1
  137. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  138. package/package.json +7 -19
@@ -766,7 +766,8 @@ export class Matrix3d {
766
766
  static createColumns(vectorU, vectorV, vectorW, result) {
767
767
  return Matrix3d.createRowValues(vectorU.x, vectorV.x, vectorW.x, vectorU.y, vectorV.y, vectorW.y, vectorU.z, vectorV.z, vectorW.z, result);
768
768
  }
769
- /** Create a matrix with each column's _x,y_ parts given `XAndY` and separate numeric z values.
769
+ /**
770
+ * Create a matrix with each column's _x,y_ parts given `XAndY` and separate numeric z values.
770
771
  * ```
771
772
  * equation
772
773
  * \begin{bmatrix}U_x & V_x & W_x \\ U_y & V_y & W_y \\ u & v & w \end{bmatrix}
@@ -1491,23 +1492,28 @@ export class Matrix3d {
1491
1492
  return Matrix3d.createUniformScale(scale);
1492
1493
  }
1493
1494
  /**
1494
- * Create a matrix which sweeps a vector along `sweepVector` until it hits the plane through the origin with the given normal.
1495
- * * To sweep an arbitrary vector U0 along direction W to the vector U1 in the plane through the origin with normal N:
1496
- * * `U1 = U0 + W * alpha`
1497
- * * `U1 DOT N = (U0 + W * alpha) DOT N = 0`
1498
- * * `U0 DOT N = - alpha * W DOT N`
1499
- * * `alpha = - U0 DOT N / W DOT N`
1500
- * * Insert the alpha definition in U1:
1501
- * * `U1 = U0 - W * N DOT U0 / W DOT N`
1502
- * * Write vector dot expression N DOT U0 as a matrix product (^T indicates transpose):
1503
- * * `U1 = U0 - W * N^T * U0 / W DOT N`
1504
- * * Note W * N^T is an outer product, i.e. a 3x3 matrix. By associativity of matrix multiplication:
1505
- * * `U1 = (I - W * N^T / W DOT N) * U0`
1506
- * * and the matrix to do the sweep for any vector in place of U0 is `I - W * N^T / W DOT N`.
1507
- * @param sweepVector sweep direction
1495
+ * Create a matrix which sweeps a vector along `sweepVector` until it hits the plane through the origin with the
1496
+ * given normal.
1497
+ * * Geometrically, the returned matrix `M` acts on a vector `u` by rotating and scaling it to lie in the plane.
1498
+ * Specifically, `Mu = u + sw` is perpendicular to `n` for some scalar `s`, where `w` is the sweep direction, and
1499
+ * `n` is the plane normal.
1500
+ * * Symbolically, `M = I - w⊗n / w.n`, where `I` is the identity, and ⊗ is the vector outer product.
1501
+ * @param sweepVector sweep direction. If same as `planeNormal`, the resulting matrix flattens to the plane.
1508
1502
  * @param planeNormal normal to the target plane
1509
1503
  */
1510
1504
  static createFlattenAlongVectorToPlane(sweepVector, planeNormal) {
1505
+ // To sweep an arbitrary vector U0 along direction W to the vector U1 in the plane through the origin with normal N:
1506
+ // `U1 = U0 + W * alpha`
1507
+ // `U1 DOT N = (U0 + W * alpha) DOT N = 0`
1508
+ // `U0 DOT N = - alpha * W DOT N`
1509
+ // `alpha = - U0 DOT N / W DOT N`
1510
+ // Insert the alpha definition in U1:
1511
+ // `U1 = U0 - W * N DOT U0 / W DOT N`
1512
+ // Write W * N DOT U0 in terms of a vector outer product (^T indicates transpose):
1513
+ // `U1 = U0 - W * N^T * U0 / W DOT N`
1514
+ // Note W * N^T is a 3x3 matrix. By associativity of matrix multiplication:
1515
+ // `U1 = (I - W * N^T / W DOT N) * U0`
1516
+ // and the matrix to do the sweep for any vector in place of U0 is `I - W * N^T / W DOT N`.
1511
1517
  const result = Matrix3d.createIdentity();
1512
1518
  const dot = sweepVector.dotProduct(planeNormal);
1513
1519
  const inverse = Geometry.conditionalDivideCoordinate(1.0, -dot);