@itwin/core-geometry 4.0.0-dev.99 → 4.1.0-dev.11

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 (127) hide show
  1. package/lib/cjs/Geometry.d.ts.map +1 -1
  2. package/lib/cjs/Geometry.js +8 -5
  3. package/lib/cjs/Geometry.js.map +1 -1
  4. package/lib/cjs/curve/Arc3d.d.ts +70 -86
  5. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  6. package/lib/cjs/curve/Arc3d.js +109 -96
  7. package/lib/cjs/curve/Arc3d.js.map +1 -1
  8. package/lib/cjs/curve/CurveCollection.d.ts +47 -30
  9. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  10. package/lib/cjs/curve/CurveCollection.js +63 -34
  11. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  12. package/lib/cjs/curve/CurveCurveIntersectXY.d.ts.map +1 -1
  13. package/lib/cjs/curve/CurveCurveIntersectXY.js +3 -3
  14. package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
  15. package/lib/cjs/curve/CurveLocationDetail.d.ts +41 -42
  16. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  17. package/lib/cjs/curve/CurveLocationDetail.js +32 -36
  18. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  19. package/lib/cjs/curve/CurvePrimitive.d.ts +137 -92
  20. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  21. package/lib/cjs/curve/CurvePrimitive.js +114 -75
  22. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  23. package/lib/cjs/curve/GeometryQuery.d.ts +26 -20
  24. package/lib/cjs/curve/GeometryQuery.d.ts.map +1 -1
  25. package/lib/cjs/curve/GeometryQuery.js +11 -9
  26. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  27. package/lib/cjs/curve/LineSegment3d.d.ts +34 -25
  28. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  29. package/lib/cjs/curve/LineSegment3d.js +76 -38
  30. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  31. package/lib/cjs/curve/LineString3d.d.ts +70 -51
  32. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  33. package/lib/cjs/curve/LineString3d.js +120 -71
  34. package/lib/cjs/curve/LineString3d.js.map +1 -1
  35. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +3 -2
  36. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  37. package/lib/cjs/curve/Query/PlanarSubdivision.js +57 -43
  38. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  39. package/lib/cjs/curve/Query/StrokeCountMap.d.ts +14 -13
  40. package/lib/cjs/curve/Query/StrokeCountMap.d.ts.map +1 -1
  41. package/lib/cjs/curve/Query/StrokeCountMap.js +9 -8
  42. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  43. package/lib/cjs/curve/RegionOps.d.ts +7 -5
  44. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  45. package/lib/cjs/curve/RegionOps.js +17 -16
  46. package/lib/cjs/curve/RegionOps.js.map +1 -1
  47. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +1 -1
  48. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  49. package/lib/cjs/curve/StrokeOptions.d.ts +29 -21
  50. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  51. package/lib/cjs/curve/StrokeOptions.js +44 -22
  52. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  53. package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts +9 -9
  54. package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
  55. package/lib/cjs/geometry3d/CoincidentGeometryOps.js +82 -56
  56. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  57. package/lib/cjs/geometry3d/Matrix3d.d.ts +2 -2
  58. package/lib/cjs/geometry3d/Matrix3d.js +3 -3
  59. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  60. package/lib/cjs/topology/Merging.d.ts +1 -0
  61. package/lib/cjs/topology/Merging.d.ts.map +1 -1
  62. package/lib/cjs/topology/Merging.js +1 -0
  63. package/lib/cjs/topology/Merging.js.map +1 -1
  64. package/lib/esm/Geometry.d.ts.map +1 -1
  65. package/lib/esm/Geometry.js +8 -5
  66. package/lib/esm/Geometry.js.map +1 -1
  67. package/lib/esm/curve/Arc3d.d.ts +70 -86
  68. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  69. package/lib/esm/curve/Arc3d.js +109 -96
  70. package/lib/esm/curve/Arc3d.js.map +1 -1
  71. package/lib/esm/curve/CurveCollection.d.ts +47 -30
  72. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  73. package/lib/esm/curve/CurveCollection.js +63 -34
  74. package/lib/esm/curve/CurveCollection.js.map +1 -1
  75. package/lib/esm/curve/CurveCurveIntersectXY.d.ts.map +1 -1
  76. package/lib/esm/curve/CurveCurveIntersectXY.js +3 -3
  77. package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
  78. package/lib/esm/curve/CurveLocationDetail.d.ts +41 -42
  79. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  80. package/lib/esm/curve/CurveLocationDetail.js +32 -36
  81. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  82. package/lib/esm/curve/CurvePrimitive.d.ts +137 -92
  83. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  84. package/lib/esm/curve/CurvePrimitive.js +114 -75
  85. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  86. package/lib/esm/curve/GeometryQuery.d.ts +26 -20
  87. package/lib/esm/curve/GeometryQuery.d.ts.map +1 -1
  88. package/lib/esm/curve/GeometryQuery.js +11 -9
  89. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  90. package/lib/esm/curve/LineSegment3d.d.ts +34 -25
  91. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  92. package/lib/esm/curve/LineSegment3d.js +76 -38
  93. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  94. package/lib/esm/curve/LineString3d.d.ts +70 -51
  95. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  96. package/lib/esm/curve/LineString3d.js +120 -71
  97. package/lib/esm/curve/LineString3d.js.map +1 -1
  98. package/lib/esm/curve/Query/PlanarSubdivision.d.ts +3 -2
  99. package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  100. package/lib/esm/curve/Query/PlanarSubdivision.js +58 -44
  101. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  102. package/lib/esm/curve/Query/StrokeCountMap.d.ts +14 -13
  103. package/lib/esm/curve/Query/StrokeCountMap.d.ts.map +1 -1
  104. package/lib/esm/curve/Query/StrokeCountMap.js +9 -8
  105. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  106. package/lib/esm/curve/RegionOps.d.ts +7 -5
  107. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  108. package/lib/esm/curve/RegionOps.js +17 -16
  109. package/lib/esm/curve/RegionOps.js.map +1 -1
  110. package/lib/esm/curve/RegionOpsClassificationSweeps.js +1 -1
  111. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  112. package/lib/esm/curve/StrokeOptions.d.ts +29 -21
  113. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  114. package/lib/esm/curve/StrokeOptions.js +44 -22
  115. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  116. package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts +9 -9
  117. package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
  118. package/lib/esm/geometry3d/CoincidentGeometryOps.js +82 -56
  119. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  120. package/lib/esm/geometry3d/Matrix3d.d.ts +2 -2
  121. package/lib/esm/geometry3d/Matrix3d.js +3 -3
  122. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  123. package/lib/esm/topology/Merging.d.ts +1 -0
  124. package/lib/esm/topology/Merging.d.ts.map +1 -1
  125. package/lib/esm/topology/Merging.js +1 -0
  126. package/lib/esm/topology/Merging.js.map +1 -1
  127. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"CoincidentGeometryOps.js","sourceRoot":"","sources":["../../../src/geometry3d/CoincidentGeometryOps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAM/F,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAE5F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAW,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;GAKG;AACH,MAAM,OAAO,uBAAuB;IAIlC,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IACD,YAAoB,YAAoB,QAAQ,CAAC,mBAAmB;QAClE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IACM,MAAM,CAAC,MAAM,CAAC,YAAoB,QAAQ,CAAC,mBAAmB;QACnE,OAAO,IAAI,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAChD,CAAC;IACD;;;OAGG;IACI,MAAM,CAAC,0CAA0C,CAAC,MAA2B,EAAE,EAAU,EAAE,EAAU,EAC1G,MAAe,EAAE,MAAe,EAAE,OAAgB,KAAK;QACvD,IAAI,IAAI,EAAE;YACR,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;YACrB,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC;SACvB;aAAM;YACL,MAAM,CAAC,QAAQ,GAAG,EAAE,CAAC;YACrB,MAAM,CAAC,SAAS,GAAG,EAAE,CAAC;SACvB;Q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AAE,UAAU,EAAE,sBAAsB,CAAC,CAAC,CAAC;oBAC5I,IAAI,UAAU,GAAG,eAAe,EAAE;wBAChC,MAAM,kBAAkB,GAAG,SAAS,CAAC,MAAM,CAAC,UAAU,GAAG,eAAe,EAAE,UAAU,GAAG,eAAe,CAAC,CAAC;wBACxG,IAAI,kBAAkB,CAAC,iBAAiB,EAAE;4BACxC,MAAM,GAAG,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,kBAAkB,EAAE,UAAU,EAAE,UAAU,EAAE,sBAAsB,CAAC,CAAC,CAAC;qBACjJ;iBACF;aACF;SACF;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { CurveLocationDetail, CurveLocationDetailPair } from \"../curve/CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { AngleSweep } from \"./AngleSweep\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Segment1d } from \"./Segment1d\";\r\n\r\n/**\r\n * `CoincidentGeometryQuery` has methods useful in testing for overlapping geometry.\r\n * * Each instance carries tolerance information that can be reused over extended call sequences.\r\n * * These methods are expected to be called internally by CurveCurve intersection methods.\r\n * @internal\r\n */\r\nexport class CoincidentGeometryQuery {\r\n private _vectorU?: Vector3d;\r\n private _vectorV?: Vector3d;\r\n private _tolerance: number;\r\n public get tolerance(): number {\r\n return this._tolerance;\r\n }\r\n private constructor(tolerance: number = Geometry.smallMetricDistance) {\r\n this._tolerance = tolerance;\r\n }\r\n public static create(tolerance: number = Geometry.smallMetricDistance): CoincidentGeometryQuery {\r\n return new CoincidentGeometryQuery(tolerance);\r\n }\r\n /**\r\n * * Assign both the fraction and fraction1 values in the detail, possibly swapped.\r\n * * reevaluate the points as simple interpolation between given points.\r\n */\r\n public static assignDetailInterpolatedFractionsAndPoints(detail: CurveLocationDetail, f0: number, f1: number,\r\n pointA: Point3d, pointB: Point3d, swap: boolean = false) {\r\n if (swap) {\r\n detail.fraction = f1;\r\n detail.fraction1 = f0;\r\n } else {\r\n detail.fraction = f0;\r\n detail.fraction1 = f1;\r\n }\r\n detail.point = pointA.interpolate(detail.fraction, pointB, detail.point);\r\n detail.point1 = pointA.interpolate(detail.fraction1, pointB, detail.point1);\r\n\r\n }\r\n\r\n /** Return a curve location detail with projection of a `spacePoint` to the line segment with `pointA` and `pointB`\r\n *\r\n */\r\n public projectPointToSegmentXY(spacePoint: Point3d, pointA: Point3d, pointB: Point3d): CurveLocationDetail {\r\n this._vectorU = Vector3d.createStartEnd(pointA, pointB, this._vectorU);\r\n this._vectorV = Vector3d.createStartEnd(pointA, spacePoint, this._vectorV);\r\n const uDotU = this._vectorU.dotProductXY(this._vectorU);\r\n const uDotV = this._vectorU.dotProductXY(this._vectorV);\r\n const fraction = Geometry.safeDivideFraction(uDotV, uDotU, 0.0);\r\n return CurveLocationDetail.createCurveFractionPoint(undefined, fraction,\r\n pointA.interpolate(fraction, pointB));\r\n }\r\n /**\r\n * * project `pointA0` and `pointA1` onto the segment with `pointB0` and `pointB1`\r\n * * In the returned detail pair, the `detailA` has fractions along segmentA, and `detailB` has fractions along segment B\r\n * @param pointA0 start point of segment A\r\n * @param pointA1 end point of segment A\r\n * @param pointB0 start point of segment B\r\n * @param pointB1 end point of segment B\r\n */\r\n public coincidentSegmentRangeXY(pointA0: Point3d, pointA1: Point3d, pointB0: Point3d, pointB1: Point3d, restrictToBounds: boolean = true): CurveLocationDetailPair | undefined {\r\n const detailAOnB = this.projectPointToSegmentXY(pointA0, pointB0, pointB1);\r\n if (pointA0.distanceXY(detailAOnB.point) > this._tolerance)\r\n return undefined;\r\n const detailA1OnB = this.projectPointToSegmentXY(pointA1, pointB0, pointB1);\r\n if (pointA1.distanceXY(detailA1OnB.point) > this._tolerance)\r\n return undefined;\r\n\r\n const detailBOnA = this.projectPointToSegmentXY(pointB0, pointA0, pointA1);\r\n if (pointB0.distanceXY(detailBOnA.point) > this._tolerance)\r\n return undefined;\r\n const detailB1OnA = this.projectPointToSegmentXY(pointB1, pointA0, pointA1);\r\n if (pointB1.distanceXY(detailB1OnA.point) > this._tolerance)\r\n return undefined;\r\n\r\n detailAOnB.fraction1 = detailA1OnB.fraction;\r\n detailAOnB.point1 = detailA1OnB.point; // capture -- detailB0OnA is not reused.\r\n detailBOnA.fraction1 = detailB1OnA.fraction;\r\n detailBOnA.point1 = detailB1OnA.point;\r\n if (!restrictToBounds)\r\n return CurveLocationDetailPair.createCapture(detailBOnA, detailAOnB);\r\n\r\n const segment = Segment1d.create(detailBOnA.fraction, detailBOnA.fraction1);\r\n if (segment.clampDirectedTo01()) {\r\n segment.reverseIfNeededForDeltaSign(1.0);\r\n const f0 = segment.x0;\r\n const f1 = segment.x1;\r\n const h0 = detailBOnA.inverseInterpolateFraction(f0);\r\n const h1 = detailBOnA.inverseInterpolateFraction(f1);\r\n // recompute fractions and points..\r\n CoincidentGeometryQuery.assignDetailInterpolatedFractionsAndPoints(detailBOnA, f0, f1, pointA0, pointA1);\r\n CoincidentGeometryQuery.assignDetailInterpolatedFractionsAndPoints(detailAOnB, h0, h1, pointB0, pointB1);\r\n return CurveLocationDetailPair.createCapture(detailBOnA, detailAOnB);\r\n } else {\r\n if (segment.signedDelta() < 0.0) {\r\n if (detailBOnA.point.isAlmostEqual(pointA0)) {\r\n detailBOnA.collapseToStart();\r\n detailAOnB.collapseToStart();\r\n return CurveLocationDetailPair.createCapture(detailBOnA, detailAOnB);\r\n }\r\n if (detailBOnA.point1.isAlmostEqual(pointA1)) {\r\n detailBOnA.collapseToEnd();\r\n detailAOnB.collapseToEnd();\r\n return CurveLocationDetailPair.createCapture(detailBOnA, detailAOnB);\r\n }\r\n } else {\r\n if (detailBOnA.point.isAlmostEqual(pointA1)) {\r\n detailBOnA.collapseToStart();\r\n detailAOnB.collapseToEnd();\r\n return CurveLocationDetailPair.createCapture(detailBOnA, detailAOnB);\r\n }\r\n if (detailBOnA.point1.isAlmostEqual(pointA0)) {\r\n detailBOnA.collapseToEnd();\r\n detailAOnB.collapseToStart();\r\n return CurveLocationDetailPair.createCapture(detailBOnA, detailAOnB);\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create a CurveLocationDetailPair from . . .\r\n * @param cpA curveA\r\n * @param cpB curve B\r\n * @param fractionsOnA fractions of an active section of curveA\r\n * @param fractionB0 fraction of an original containing B interval\r\n * @param fractionB1 end fraction of an original containing B interval\r\n */\r\n private createDetailPair(cpA: CurvePrimitive, cpB: CurvePrimitive, fractionsOnA: Segment1d, fractionB0: number, fractionB1: number, reverse: boolean): CurveLocationDetailPair | undefined {\r\n const deltaB = fractionB1 - fractionB0;\r\n const g0 = Geometry.conditionalDivideFraction(fractionsOnA.x0 - fractionB0, deltaB);\r\n const g1 = Geometry.conditionalDivideFraction(fractionsOnA.x1 - fractionB0, deltaB);\r\n if (g0 !== undefined && g1 !== undefined) {\r\n const detailA = CurveLocationDetail.createCurveEvaluatedFractionFraction(cpA, fractionsOnA.x0, fractionsOnA.x1);\r\n const detailB = CurveLocationDetail.createCurveEvaluatedFractionFraction(cpB, g0, g1);\r\n if (reverse) {\r\n detailA.swapFractionsAndPoints();\r\n detailB.swapFractionsAndPoints();\r\n }\r\n return CurveLocationDetailPair.createCapture(detailA, detailB);\r\n }\r\n return undefined;\r\n }\r\n private appendDetailPair(result: CurveLocationDetailPair[] | undefined, pair: CurveLocationDetailPair | undefined): CurveLocationDetailPair[] | undefined {\r\n if (pair === undefined)\r\n return result;\r\n if (result === undefined)\r\n return [pair];\r\n result.push(pair);\r\n return result;\r\n }\r\n /**\r\n * Test if 2 arcs have coinciding portions.\r\n * @param arcA\r\n * @param arcB\r\n * @param _restrictToBounds\r\n * @return 0, 1, or 2 overlap intervals.\r\n */\r\n public coincidentArcIntersectionXY(arcA: Arc3d, arcB: Arc3d, _restrictToBounds: boolean = true): CurveLocationDetailPair[] | undefined {\r\n let result: CurveLocationDetailPair[] | undefined;\r\n if (arcA.center.isAlmostEqual(arcB.center)) {\r\n const matrixBToA = arcA.matrixRef.multiplyMatrixInverseMatrix(arcB.matrixRef);\r\n if (matrixBToA) {\r\n const ux = matrixBToA.at(0, 0); const uy = matrixBToA.at(1, 0);\r\n const vx = matrixBToA.at(0, 1); const vy = matrixBToA.at(1, 1);\r\n const ru = Geometry.hypotenuseXY(ux, uy);\r\n const rv = Geometry.hypotenuseXY(vx, vy);\r\n const dot = Geometry.dotProductXYXY(ux, uy, vx, vy);\r\n const cross = Geometry.crossProductXYXY(ux, uy, vx, vy);\r\n if (Geometry.isAlmostEqualNumber(ru, 1.0)\r\n && Geometry.isAlmostEqualNumber(rv, 1.0)\r\n && Geometry.isAlmostEqualNumber(0, dot)) {\r\n const alphaB0Radians = Math.atan2(uy, ux); // angular position of arcB 0 point in A sweep\r\n const sweepDirection = cross > 0 ? 1.0 : -1.0; // 1 if arcB's parameter space sweeps forward, -1 if reverse\r\n const betaStartRadians = alphaB0Radians + sweepDirection * arcB.sweep.startRadians;\r\n const betaEndRadians = alphaB0Radians + sweepDirection * arcB.sweep.endRadians;\r\n const fractionSpacesReversed = (sweepDirection * arcA.sweep.sweepRadians * arcB.sweep.sweepRadians) < 0;\r\n const sweepB = AngleSweep.createStartEndRadians(betaStartRadians, betaEndRadians);\r\n const sweepA = arcA.sweep;\r\n const fractionPeriodA = sweepA.fractionPeriod();\r\n const fractionB0 = sweepA.radiansToPositivePeriodicFraction(sweepB.startRadians);\r\n const fractionSweep = sweepB.sweepRadians / sweepA.sweepRadians;\r\n const fractionB1 = fractionB0 + fractionSweep;\r\n const fractionSweepB = Segment1d.create(fractionB0, fractionB1);\r\n if (fractionSweepB.clampDirectedTo01())\r\n result = this.appendDetailPair(result, this.createDetailPair(arcA, arcB, fractionSweepB, fractionB0, fractionB1, fractionSpacesReversed));\r\n if (fractionB1 > fractionPeriodA) {\r\n const fractionSweepBWrap = Segment1d.create(fractionB0 - fractionPeriodA, fractionB1 - fractionPeriodA);\r\n if (fractionSweepBWrap.clampDirectedTo01())\r\n result = this.appendDetailPair(result, this.createDetailPair(arcA, arcB, fractionSweepBWrap, fractionB0, fractionB1, fractionSpacesReversed));\r\n }\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CoincidentGeometryOps.js","sourceRoot":"","sources":["../../../src/geometry3d/CoincidentGeometryOps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAE5F,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAW,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;;;GAKG;AACH,MAAM,OAAO,uBAAuB;IAMlC,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IACD,YAAoB,YAAoB,QAAQ,CAAC,mBAAmB;QAClE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;IAC9B,CAAC;IACM,MAAM,CAAC,MAAM,CAAC,YAAoB,QAAQ,CAAC,mBAAmB;QACnE,OAAO,IAAI,uBAAuB,CAAC,SAAS,CAAC,CAAC;IAChD,CAAC;IACD;;;OAGG;IACI,MAAM,CAAC,0CAA0C,CAAC,MAA2B,EA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------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { CurveLocationDetail, CurveLocationDetailPair } from \"../curve/CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { AngleSweep } from \"./AngleSweep\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Segment1d } from \"./Segment1d\";\r\n\r\n/**\r\n * `CoincidentGeometryQuery` has methods useful in testing for overlapping geometry.\r\n * * Each instance carries tolerance information that can be reused over extended call sequences.\r\n * * These methods are expected to be called internally by CurveCurve intersection methods.\r\n * @internal\r\n */\r\nexport class CoincidentGeometryQuery {\r\n private _vectorU?: Vector3d;\r\n private _vectorV?: Vector3d;\r\n private _point0?: Point3d;\r\n private _point1?: Point3d;\r\n private _tolerance: number;\r\n public get tolerance(): number {\r\n return this._tolerance;\r\n }\r\n private constructor(tolerance: number = Geometry.smallMetricDistance) {\r\n this._tolerance = tolerance;\r\n }\r\n public static create(tolerance: number = Geometry.smallMetricDistance): CoincidentGeometryQuery {\r\n return new CoincidentGeometryQuery(tolerance);\r\n }\r\n /**\r\n * * Assign both the fraction and fraction1 values in the detail, possibly swapped.\r\n * * reevaluate the points as simple interpolation between given points.\r\n */\r\n public static assignDetailInterpolatedFractionsAndPoints(detail: CurveLocationDetail, f0: number, f1: number,\r\n pointA: Point3d, pointB: Point3d, swap: boolean = false) {\r\n if (swap) {\r\n detail.fraction = f1;\r\n detail.fraction1 = f0;\r\n } else {\r\n detail.fraction = f0;\r\n detail.fraction1 = f1;\r\n }\r\n detail.point = pointA.interpolate(detail.fraction, pointB, detail.point);\r\n detail.point1 = pointA.interpolate(detail.fraction1, pointB, detail.point1);\r\n\r\n }\r\n\r\n /** Return a curve location detail with projection of a `spacePoint` to the line segment with `pointA` and `pointB`\r\n *\r\n */\r\n public projectPointToSegmentXY(spacePoint: Point3d, pointA: Point3d, pointB: Point3d): CurveLocationDetail {\r\n this._vectorU = Vector3d.createStartEnd(pointA, pointB, this._vectorU);\r\n this._vectorV = Vector3d.createStartEnd(pointA, spacePoint, this._vectorV);\r\n const uDotU = this._vectorU.dotProductXY(this._vectorU);\r\n const uDotV = this._vectorU.dotProductXY(this._vectorV);\r\n const fraction = Geometry.safeDivideFraction(uDotV, uDotU, 0.0);\r\n return CurveLocationDetail.createCurveFractionPoint(undefined, fraction,\r\n pointA.interpolate(fraction, pointB));\r\n }\r\n /**\r\n * * project `pointA0` and `pointA1` onto the segment with `pointB0` and `pointB1`\r\n * * In the returned detail pair, the `detailA` has fractions along segmentA, and `detailB` has fractions along segment B\r\n * @param pointA0 start point of segment A\r\n * @param pointA1 end point of segment A\r\n * @param pointB0 start point of segment B\r\n * @param pointB1 end point of segment B\r\n */\r\n public coincidentSegmentRangeXY(pointA0: Point3d, pointA1: Point3d, pointB0: Point3d, pointB1: Point3d, restrictToBounds: boolean = true): CurveLocationDetailPair | undefined {\r\n const detailA0OnB = this.projectPointToSegmentXY(pointA0, pointB0, pointB1);\r\n if (pointA0.distanceXY(detailA0OnB.point) > this._tolerance)\r\n return undefined;\r\n const detailA1OnB = this.projectPointToSegmentXY(pointA1, pointB0, pointB1);\r\n if (pointA1.distanceXY(detailA1OnB.point) > this._tolerance)\r\n return undefined;\r\n\r\n const detailB0OnA = this.projectPointToSegmentXY(pointB0, pointA0, pointA1);\r\n if (pointB0.distanceXY(detailB0OnA.point) > this._tolerance)\r\n return undefined;\r\n const detailB1OnA = this.projectPointToSegmentXY(pointB1, pointA0, pointA1);\r\n if (pointB1.distanceXY(detailB1OnA.point) > this._tolerance)\r\n return undefined;\r\n\r\n detailA0OnB.fraction1 = detailA1OnB.fraction;\r\n detailA0OnB.point1 = detailA1OnB.point; // capture -- detailA1OnB is not reused.\r\n detailB0OnA.fraction1 = detailB1OnA.fraction;\r\n detailB0OnA.point1 = detailB1OnA.point;\r\n if (!restrictToBounds)\r\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\r\n\r\n const segment = Segment1d.create(detailB0OnA.fraction, detailB0OnA.fraction1);\r\n if (segment.clampDirectedTo01()) {\r\n const f0 = segment.x0;\r\n const f1 = segment.x1;\r\n const h0 = detailB0OnA.inverseInterpolateFraction(f0);\r\n const h1 = detailB0OnA.inverseInterpolateFraction(f1);\r\n // recompute fractions and points..\r\n CoincidentGeometryQuery.assignDetailInterpolatedFractionsAndPoints(detailB0OnA, f0, f1, pointA0, pointA1, f0 > f1);\r\n CoincidentGeometryQuery.assignDetailInterpolatedFractionsAndPoints(detailA0OnB, h0, h1, pointB0, pointB1, h0 > h1);\r\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\r\n } else {\r\n if (segment.signedDelta() < 0.0) {\r\n if (detailB0OnA.point.isAlmostEqual(pointA0, this.tolerance)) {\r\n detailB0OnA.collapseToStart();\r\n detailA0OnB.collapseToStart();\r\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\r\n }\r\n if (detailB0OnA.point1.isAlmostEqual(pointA1, this.tolerance)) {\r\n detailB0OnA.collapseToEnd();\r\n detailA0OnB.collapseToEnd();\r\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\r\n }\r\n } else {\r\n if (detailB0OnA.point.isAlmostEqual(pointA1, this.tolerance)) {\r\n detailB0OnA.collapseToStart();\r\n detailA0OnB.collapseToEnd();\r\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\r\n }\r\n if (detailB0OnA.point1.isAlmostEqual(pointA0, this.tolerance)) {\r\n detailB0OnA.collapseToEnd();\r\n detailA0OnB.collapseToStart();\r\n return CurveLocationDetailPair.createCapture(detailB0OnA, detailA0OnB);\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create a CurveLocationDetailPair for a coincident interval of two overlapping curves\r\n * @param cpA curveA\r\n * @param cpB curveB\r\n * @param fractionsOnA coincident interval of curveB in fraction space of curveA\r\n * @param fractionB0 curveB start in fraction space of curveA\r\n * @param fractionB1 curveB end in fraction space of curveA\r\n * @param reverse whether curveB and curveA have opposite direction\r\n */\r\n private createDetailPair(cpA: CurvePrimitive, cpB: CurvePrimitive, fractionsOnA: Segment1d, fractionB0: number, fractionB1: number, reverse: boolean): CurveLocationDetailPair | undefined {\r\n const deltaB = fractionB1 - fractionB0;\r\n const g0 = Geometry.conditionalDivideFraction(fractionsOnA.x0 - fractionB0, deltaB);\r\n const g1 = Geometry.conditionalDivideFraction(fractionsOnA.x1 - fractionB0, deltaB);\r\n if (g0 !== undefined && g1 !== undefined) {\r\n const detailA = CurveLocationDetail.createCurveEvaluatedFractionFraction(cpA, fractionsOnA.x0, fractionsOnA.x1);\r\n const detailB = CurveLocationDetail.createCurveEvaluatedFractionFraction(cpB, g0, g1);\r\n if (reverse)\r\n detailA.swapFractionsAndPoints();\r\n return CurveLocationDetailPair.createCapture(detailA, detailB);\r\n }\r\n return undefined;\r\n }\r\n private appendDetailPair(result: CurveLocationDetailPair[] | undefined, pair: CurveLocationDetailPair | undefined): CurveLocationDetailPair[] | undefined {\r\n if (pair === undefined)\r\n return result;\r\n if (result === undefined)\r\n return [pair];\r\n result.push(pair);\r\n return result;\r\n }\r\n /**\r\n * Test if 2 arcs have coinciding portions.\r\n * @param arcA\r\n * @param arcB\r\n * @param _restrictToBounds\r\n * @return 0, 1, or 2 overlap points/intervals\r\n */\r\n public coincidentArcIntersectionXY(arcA: Arc3d, arcB: Arc3d, _restrictToBounds: boolean = true): CurveLocationDetailPair[] | undefined {\r\n let result: CurveLocationDetailPair[] | undefined;\r\n if (arcA.center.isAlmostEqual(arcB.center, this.tolerance)) {\r\n const matrixBToA = arcA.matrixRef.multiplyMatrixInverseMatrix(arcB.matrixRef);\r\n if (matrixBToA) {\r\n const ux = matrixBToA.at(0, 0); const uy = matrixBToA.at(1, 0);\r\n const vx = matrixBToA.at(0, 1); const vy = matrixBToA.at(1, 1);\r\n const ru = Geometry.hypotenuseXY(ux, uy);\r\n const rv = Geometry.hypotenuseXY(vx, vy);\r\n const dot = Geometry.dotProductXYXY(ux, uy, vx, vy);\r\n const cross = Geometry.crossProductXYXY(ux, uy, vx, vy);\r\n if (Geometry.isAlmostEqualNumber(ru, 1.0)\r\n && Geometry.isAlmostEqualNumber(rv, 1.0)\r\n && Geometry.isAlmostEqualNumber(0, dot)) {\r\n const alphaB0Radians = Math.atan2(uy, ux); // angular position of arcB 0 point in arcA sweep\r\n const sweepDirection = cross > 0 ? 1.0 : -1.0; // 1 if arcB parameter space sweeps in same direction as arcA, -1 if opposite\r\n const betaStartRadians = alphaB0Radians + sweepDirection * arcB.sweep.startRadians; // arcB start in arcA parameter space\r\n const betaEndRadians = alphaB0Radians + sweepDirection * arcB.sweep.endRadians; // arcB end in arcA parameter space\r\n const fractionSpacesReversed = (sweepDirection * arcA.sweep.sweepRadians * arcB.sweep.sweepRadians) < 0;\r\n const sweepB = AngleSweep.createStartEndRadians(betaStartRadians, betaEndRadians);\r\n const sweepA = arcA.sweep;\r\n const fractionPeriodA = sweepA.fractionPeriod();\r\n const fractionB0 = sweepA.radiansToPositivePeriodicFraction(sweepB.startRadians); // arcB start in arcA fraction space\r\n assert(fractionB0 >= 0.0);\r\n const fractionSweep = sweepB.sweepRadians / sweepA.sweepRadians; // arcB sweep in arcA fraction space\r\n const fractionB1 = fractionB0 + fractionSweep; // arcB end in arcA fraction space\r\n const fractionSweepB = Segment1d.create(fractionB0, fractionB1);\r\n\r\n /** lambda to add a coincident interval or isolated intersection, given inputs in arcA fraction space\r\n * @param arcBInArcAFractionSpace span of arcB in arcA fraction space. On return, clamped to [0,1] if nontrivial.\r\n * @param testStartOfArcA if no nontrivial coincident interval was found, look for an isolated intersection at the start (true) or end (false) of arcA\r\n * @returns whether a detail pair was appended to result\r\n */\r\n const appendCoincidentIntersection = (arcBInArcAFractionSpace: Segment1d, testStartOfArcA: boolean): boolean => {\r\n const size = result ? result.length : 0;\r\n const arcBStart = arcBInArcAFractionSpace.x0;\r\n const arcBEnd = arcBInArcAFractionSpace.x1;\r\n if (arcBInArcAFractionSpace.clampDirectedTo01() && !Geometry.isSmallRelative(arcBInArcAFractionSpace.absoluteDelta())) {\r\n result = this.appendDetailPair(result, this.createDetailPair(arcA, arcB, arcBInArcAFractionSpace, arcBStart, arcBEnd, fractionSpacesReversed));\r\n } else { // test isolated intersection\r\n const testStartOfArcB = fractionSpacesReversed ? testStartOfArcA : !testStartOfArcA;\r\n const arcAPt = this._point0 = testStartOfArcA ? arcA.startPoint(this._point0): arcA.endPoint(this._point0);\r\n const arcBPt = this._point1 = testStartOfArcB ? arcB.startPoint(this._point1): arcB.endPoint(this._point1);\r\n if (arcAPt.isAlmostEqual(arcBPt, this.tolerance)) {\r\n const detailA = CurveLocationDetail.createCurveFractionPoint(arcA, testStartOfArcA ? 0 : 1, arcAPt);\r\n const detailB = CurveLocationDetail.createCurveFractionPoint(arcB, testStartOfArcB ? 0 : 1, arcBPt);\r\n result = this.appendDetailPair(result, CurveLocationDetailPair.createCapture(detailA, detailB));\r\n }\r\n }\r\n return result !== undefined && result.length > size;\r\n };\r\n\r\n appendCoincidentIntersection(fractionSweepB, false); // compute overlap in strict interior, or at end of arcA\r\n\r\n // check overlap at start of arcA with a periodic shift of fractionSweepB\r\n if (fractionB1 >= fractionPeriodA)\r\n appendCoincidentIntersection(Segment1d.create(fractionB0 - fractionPeriodA, fractionB1 - fractionPeriodA), true);\r\n else if (fractionB0 === 0.0)\r\n appendCoincidentIntersection(Segment1d.create(fractionB0 + fractionPeriodA, fractionB1 + fractionPeriodA), true);\r\n }\r\n }\r\n }\r\n return result;\r\n }\r\n}\r\n"]}
@@ -327,8 +327,8 @@ export declare class Matrix3d implements BeJSONFunctions {
327
327
  static createPerpendicularVectorFavorPlaneContainingZ(vectorA: Vector3d, result?: Vector3d): Vector3d;
328
328
  /**
329
329
  * Create a matrix from column vectors, shuffled into place per axisOrder
330
- * For example, if axisOrder = XYZ then it returns [vectorU, vectorV, vectorW]
331
- * Another example, if axisOrder = YZX then it returns [vectorW, vectorU, vectorV] because
330
+ * * For example, if axisOrder = XYZ then it returns [vectorU, vectorV, vectorW]
331
+ * * Another example, if axisOrder = YZX then it returns [vectorW, vectorU, vectorV] because
332
332
  * Y is at index 0 so vectorU goes to the column Y (column 2), Z is at index 1 so vectorV goes
333
333
  * to the column Z (column 3), and X is at index 2 so vectorW goes to the column X (column 1)
334
334
  */
@@ -613,8 +613,8 @@ class Matrix3d {
613
613
  }
614
614
  /**
615
615
  * Create a matrix from column vectors, shuffled into place per axisOrder
616
- * For example, if axisOrder = XYZ then it returns [vectorU, vectorV, vectorW]
617
- * Another example, if axisOrder = YZX then it returns [vectorW, vectorU, vectorV] because
616
+ * * For example, if axisOrder = XYZ then it returns [vectorU, vectorV, vectorW]
617
+ * * Another example, if axisOrder = YZX then it returns [vectorW, vectorU, vectorV] because
618
618
  * Y is at index 0 so vectorU goes to the column Y (column 2), Z is at index 1 so vectorV goes
619
619
  * to the column Z (column 3), and X is at index 2 so vectorW goes to the column X (column 1)
620
620
  */
@@ -2383,7 +2383,7 @@ class Matrix3d {
2383
2383
  * almost independent and matrix is invertible).
2384
2384
  */
2385
2385
  conditionNumber() {
2386
- const determinant = this.determinant();
2386
+ const determinant = Math.abs(this.determinant());
2387
2387
  const columnMagnitudeSum = Geometry.hypotenuseXYZ(this.coffs[0], this.coffs[3], this.coffs[6])
2388
2388
  + Geometry.hypotenuseXYZ(this.coffs[1], this.coffs[4], this.coffs[7])
2389
2389
  + Geometry.hypotenuseXYZ(this.coffs[2], this.coffs[5], this.coffs[8]);