@itwin/core-geometry 4.2.0-dev.9 → 4.3.0-dev.1

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 (478) hide show
  1. package/CHANGELOG.md +36 -1
  2. package/lib/cjs/Geometry.d.ts +4 -4
  3. package/lib/cjs/Geometry.d.ts.map +1 -1
  4. package/lib/cjs/Geometry.js +2 -2
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts +4 -3
  7. package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
  8. package/lib/cjs/clipping/AlternatingConvexClipTree.js +1 -1
  9. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  10. package/lib/cjs/clipping/BooleanClipNode.d.ts +4 -3
  11. package/lib/cjs/clipping/BooleanClipNode.d.ts.map +1 -1
  12. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  13. package/lib/cjs/clipping/ClipPlane.d.ts +2 -1
  14. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  15. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  16. package/lib/cjs/clipping/ClipUtils.d.ts +17 -11
  17. package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
  18. package/lib/cjs/clipping/ClipUtils.js +14 -8
  19. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  20. package/lib/cjs/clipping/ClipVector.d.ts +6 -5
  21. package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
  22. package/lib/cjs/clipping/ClipVector.js +1 -1
  23. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  24. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +3 -2
  25. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  26. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  27. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +2 -1
  28. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  29. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  30. package/lib/cjs/core-geometry.d.ts +1 -3
  31. package/lib/cjs/core-geometry.d.ts.map +1 -1
  32. package/lib/cjs/core-geometry.js +1 -3
  33. package/lib/cjs/core-geometry.js.map +1 -1
  34. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  35. package/lib/cjs/curve/Arc3d.js +4 -4
  36. package/lib/cjs/curve/Arc3d.js.map +1 -1
  37. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +93 -91
  38. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  39. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +171 -152
  40. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  41. package/lib/cjs/curve/CurveCollection.d.ts +19 -19
  42. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  43. package/lib/cjs/curve/CurveCollection.js +20 -22
  44. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  45. package/lib/cjs/curve/CurveCurve.d.ts +47 -30
  46. package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
  47. package/lib/cjs/curve/CurveCurve.js +81 -46
  48. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  49. package/lib/cjs/curve/CurveFactory.d.ts +1 -1
  50. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  51. package/lib/cjs/curve/CurveLocationDetail.d.ts +17 -5
  52. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  53. package/lib/cjs/curve/CurveLocationDetail.js +14 -2
  54. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  55. package/lib/cjs/curve/CurveOps.d.ts +1 -1
  56. package/lib/cjs/curve/CurveOps.js.map +1 -1
  57. package/lib/cjs/curve/CurvePrimitive.d.ts +1 -2
  58. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  59. package/lib/cjs/curve/CurvePrimitive.js +2 -2
  60. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  61. package/lib/cjs/curve/CurveProcessor.d.ts +1 -1
  62. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  63. package/lib/cjs/curve/{CurveChain.d.ts → CurveTypes.d.ts} +6 -6
  64. package/lib/cjs/curve/CurveTypes.d.ts.map +1 -0
  65. package/lib/cjs/curve/{CurveChain.js → CurveTypes.js} +1 -1
  66. package/lib/cjs/curve/CurveTypes.js.map +1 -0
  67. package/lib/cjs/curve/CurveWireMomentsXYZ.d.ts +1 -1
  68. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  69. package/lib/cjs/curve/ParityRegion.d.ts +3 -3
  70. package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
  71. package/lib/cjs/curve/ParityRegion.js +2 -2
  72. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  73. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts +3 -2
  74. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  75. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +2 -2
  76. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  77. package/lib/cjs/curve/Query/CurveSplitContext.d.ts +1 -1
  78. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  79. package/lib/cjs/curve/Query/CylindricalRange.d.ts +1 -1
  80. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  81. package/lib/cjs/curve/Query/InOutTests.d.ts +1 -1
  82. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  83. package/lib/cjs/curve/Query/StrokeCountChain.d.ts +1 -1
  84. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  85. package/lib/cjs/curve/RegionOps.d.ts +54 -5
  86. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  87. package/lib/cjs/curve/RegionOps.js +154 -3
  88. package/lib/cjs/curve/RegionOps.js.map +1 -1
  89. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +1 -1
  90. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  91. package/lib/cjs/curve/StrokeOptions.d.ts +20 -11
  92. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  93. package/lib/cjs/curve/StrokeOptions.js +22 -11
  94. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  95. package/lib/cjs/curve/UnionRegion.d.ts +3 -3
  96. package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
  97. package/lib/cjs/curve/UnionRegion.js +2 -2
  98. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  99. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts +1 -1
  100. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
  101. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +2 -2
  102. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  103. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +233 -0
  104. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -0
  105. package/lib/cjs/curve/{CurveCurveCloseApproachXY.js → internalContexts/CurveCurveCloseApproachXY.js} +299 -202
  106. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -0
  107. package/lib/{esm/curve → cjs/curve/internalContexts}/CurveCurveIntersectXY.d.ts +45 -51
  108. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -0
  109. package/lib/cjs/curve/{CurveCurveIntersectXY.js → internalContexts/CurveCurveIntersectXY.js} +104 -115
  110. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -0
  111. package/lib/cjs/curve/{CurveCurveIntersectXYZ.d.ts → internalContexts/CurveCurveIntersectXYZ.d.ts} +18 -18
  112. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -0
  113. package/lib/cjs/curve/{CurveCurveIntersectXYZ.js → internalContexts/CurveCurveIntersectXYZ.js} +134 -108
  114. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -0
  115. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.d.ts +2 -2
  116. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.d.ts.map +1 -1
  117. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js +9 -5
  118. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  119. package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +1 -1
  120. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  121. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +1 -0
  122. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  123. package/lib/cjs/geometry3d/BarycentricTriangle.js +1 -0
  124. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  125. package/lib/cjs/geometry3d/FrameBuilder.d.ts +28 -11
  126. package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
  127. package/lib/cjs/geometry3d/FrameBuilder.js +57 -45
  128. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  129. package/lib/cjs/geometry3d/GeometryHandler.d.ts +15 -26
  130. package/lib/cjs/geometry3d/GeometryHandler.d.ts.map +1 -1
  131. package/lib/cjs/geometry3d/GeometryHandler.js +23 -32
  132. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  133. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +0 -8
  134. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  135. package/lib/cjs/geometry3d/GrowableXYZArray.js +0 -16
  136. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  137. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +4 -4
  138. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  139. package/lib/cjs/geometry3d/IndexedXYZCollection.js +12 -0
  140. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  141. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  142. package/lib/cjs/geometry3d/Matrix3d.js +3 -6
  143. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  144. package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
  145. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  146. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -2
  147. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  148. package/lib/cjs/geometry3d/Point3dVector3d.js +0 -1
  149. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  150. package/lib/cjs/geometry3d/PolygonOps.d.ts +2 -2
  151. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  152. package/lib/cjs/geometry3d/PolygonOps.js +2 -3
  153. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  154. package/lib/cjs/geometry3d/Range.d.ts +1 -1
  155. package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
  156. package/lib/cjs/geometry3d/Range.js +1 -1
  157. package/lib/cjs/geometry3d/Range.js.map +1 -1
  158. package/lib/cjs/geometry3d/Ray3d.d.ts +3 -1
  159. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  160. package/lib/cjs/geometry3d/Ray3d.js +4 -3
  161. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  162. package/lib/cjs/geometry3d/ReusableObjectCache.d.ts +2 -1
  163. package/lib/cjs/geometry3d/ReusableObjectCache.d.ts.map +1 -1
  164. package/lib/cjs/geometry3d/ReusableObjectCache.js +1 -1
  165. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  166. package/lib/cjs/geometry3d/SortablePolygon.d.ts +1 -1
  167. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  168. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  169. package/lib/cjs/geometry3d/Transform.js +4 -6
  170. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  171. package/lib/cjs/geometry3d/YawPitchRollAngles.js +1 -1
  172. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  173. package/lib/cjs/geometry4d/Map4d.d.ts +14 -8
  174. package/lib/cjs/geometry4d/Map4d.d.ts.map +1 -1
  175. package/lib/cjs/geometry4d/Map4d.js +38 -16
  176. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  177. package/lib/cjs/geometry4d/Matrix4d.d.ts.map +1 -1
  178. package/lib/cjs/geometry4d/Matrix4d.js +4 -2
  179. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  180. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  181. package/lib/cjs/numerics/Polynomials.d.ts +2 -2
  182. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  183. package/lib/cjs/numerics/Polynomials.js +2 -2
  184. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  185. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +18 -6
  186. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  187. package/lib/cjs/polyface/PolyfaceBuilder.js +55 -25
  188. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  189. package/lib/cjs/polyface/PolyfaceClip.d.ts +16 -7
  190. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  191. package/lib/cjs/polyface/PolyfaceClip.js +38 -7
  192. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  193. package/lib/cjs/polyface/PolyfaceData.d.ts +5 -39
  194. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  195. package/lib/cjs/polyface/PolyfaceData.js +7 -41
  196. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  197. package/lib/cjs/polyface/PolyfaceQuery.d.ts +10 -8
  198. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  199. package/lib/cjs/polyface/PolyfaceQuery.js +64 -18
  200. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  201. package/lib/cjs/serialization/GeometrySamples.d.ts +6 -0
  202. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  203. package/lib/cjs/serialization/GeometrySamples.js +68 -2
  204. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  205. package/lib/cjs/solid/LinearSweep.d.ts +1 -1
  206. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  207. package/lib/cjs/solid/RotationalSweep.d.ts +1 -1
  208. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  209. package/lib/cjs/solid/RuledSweep.d.ts +1 -1
  210. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  211. package/lib/cjs/solid/SweepContour.d.ts +35 -26
  212. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  213. package/lib/cjs/solid/SweepContour.js +84 -100
  214. package/lib/cjs/solid/SweepContour.js.map +1 -1
  215. package/lib/cjs/topology/Graph.d.ts +29 -11
  216. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  217. package/lib/cjs/topology/Graph.js +45 -26
  218. package/lib/cjs/topology/Graph.js.map +1 -1
  219. package/lib/cjs/topology/HalfEdgeMarkSet.d.ts +2 -2
  220. package/lib/cjs/topology/HalfEdgeMarkSet.d.ts.map +1 -1
  221. package/lib/cjs/topology/HalfEdgeMarkSet.js +4 -4
  222. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  223. package/lib/cjs/topology/Merging.d.ts +3 -0
  224. package/lib/cjs/topology/Merging.d.ts.map +1 -1
  225. package/lib/cjs/topology/Merging.js +19 -5
  226. package/lib/cjs/topology/Merging.js.map +1 -1
  227. package/lib/cjs/topology/Triangulation.d.ts +15 -7
  228. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  229. package/lib/cjs/topology/Triangulation.js +89 -47
  230. package/lib/cjs/topology/Triangulation.js.map +1 -1
  231. package/lib/esm/Geometry.d.ts +4 -4
  232. package/lib/esm/Geometry.d.ts.map +1 -1
  233. package/lib/esm/Geometry.js +2 -2
  234. package/lib/esm/Geometry.js.map +1 -1
  235. package/lib/esm/clipping/AlternatingConvexClipTree.d.ts +4 -3
  236. package/lib/esm/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
  237. package/lib/esm/clipping/AlternatingConvexClipTree.js +1 -1
  238. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  239. package/lib/esm/clipping/BooleanClipNode.d.ts +4 -3
  240. package/lib/esm/clipping/BooleanClipNode.d.ts.map +1 -1
  241. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  242. package/lib/esm/clipping/ClipPlane.d.ts +2 -1
  243. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  244. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  245. package/lib/esm/clipping/ClipUtils.d.ts +17 -11
  246. package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
  247. package/lib/esm/clipping/ClipUtils.js +14 -8
  248. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  249. package/lib/esm/clipping/ClipVector.d.ts +6 -5
  250. package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
  251. package/lib/esm/clipping/ClipVector.js +1 -1
  252. package/lib/esm/clipping/ClipVector.js.map +1 -1
  253. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +3 -2
  254. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  255. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  256. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +2 -1
  257. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  258. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  259. package/lib/esm/core-geometry.d.ts +1 -3
  260. package/lib/esm/core-geometry.d.ts.map +1 -1
  261. package/lib/esm/core-geometry.js +1 -3
  262. package/lib/esm/core-geometry.js.map +1 -1
  263. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  264. package/lib/esm/curve/Arc3d.js +4 -4
  265. package/lib/esm/curve/Arc3d.js.map +1 -1
  266. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +93 -91
  267. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  268. package/lib/esm/curve/CurveChainWithDistanceIndex.js +171 -152
  269. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  270. package/lib/esm/curve/CurveCollection.d.ts +19 -19
  271. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  272. package/lib/esm/curve/CurveCollection.js +19 -20
  273. package/lib/esm/curve/CurveCollection.js.map +1 -1
  274. package/lib/esm/curve/CurveCurve.d.ts +47 -30
  275. package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
  276. package/lib/esm/curve/CurveCurve.js +81 -46
  277. package/lib/esm/curve/CurveCurve.js.map +1 -1
  278. package/lib/esm/curve/CurveFactory.d.ts +1 -1
  279. package/lib/esm/curve/CurveFactory.js.map +1 -1
  280. package/lib/esm/curve/CurveLocationDetail.d.ts +17 -5
  281. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  282. package/lib/esm/curve/CurveLocationDetail.js +12 -1
  283. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  284. package/lib/esm/curve/CurveOps.d.ts +1 -1
  285. package/lib/esm/curve/CurveOps.js.map +1 -1
  286. package/lib/esm/curve/CurvePrimitive.d.ts +1 -2
  287. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  288. package/lib/esm/curve/CurvePrimitive.js +2 -2
  289. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  290. package/lib/esm/curve/CurveProcessor.d.ts +1 -1
  291. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  292. package/lib/esm/curve/{CurveChain.d.ts → CurveTypes.d.ts} +6 -6
  293. package/lib/esm/curve/CurveTypes.d.ts.map +1 -0
  294. package/lib/esm/curve/{CurveChain.js → CurveTypes.js} +1 -1
  295. package/lib/esm/curve/CurveTypes.js.map +1 -0
  296. package/lib/esm/curve/CurveWireMomentsXYZ.d.ts +1 -1
  297. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  298. package/lib/esm/curve/ParityRegion.d.ts +3 -3
  299. package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
  300. package/lib/esm/curve/ParityRegion.js +2 -2
  301. package/lib/esm/curve/ParityRegion.js.map +1 -1
  302. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts +3 -2
  303. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  304. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +1 -1
  305. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  306. package/lib/esm/curve/Query/CurveSplitContext.d.ts +1 -1
  307. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  308. package/lib/esm/curve/Query/CylindricalRange.d.ts +1 -1
  309. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  310. package/lib/esm/curve/Query/InOutTests.d.ts +1 -1
  311. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  312. package/lib/esm/curve/Query/StrokeCountChain.d.ts +1 -1
  313. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  314. package/lib/esm/curve/RegionOps.d.ts +54 -5
  315. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  316. package/lib/esm/curve/RegionOps.js +153 -3
  317. package/lib/esm/curve/RegionOps.js.map +1 -1
  318. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +1 -1
  319. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  320. package/lib/esm/curve/StrokeOptions.d.ts +20 -11
  321. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  322. package/lib/esm/curve/StrokeOptions.js +22 -11
  323. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  324. package/lib/esm/curve/UnionRegion.d.ts +3 -3
  325. package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
  326. package/lib/esm/curve/UnionRegion.js +2 -2
  327. package/lib/esm/curve/UnionRegion.js.map +1 -1
  328. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts +1 -1
  329. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
  330. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +2 -2
  331. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  332. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +233 -0
  333. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -0
  334. package/lib/esm/curve/{CurveCurveCloseApproachXY.js → internalContexts/CurveCurveCloseApproachXY.js} +299 -202
  335. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -0
  336. package/lib/{cjs/curve → esm/curve/internalContexts}/CurveCurveIntersectXY.d.ts +45 -51
  337. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -0
  338. package/lib/esm/curve/{CurveCurveIntersectXY.js → internalContexts/CurveCurveIntersectXY.js} +103 -113
  339. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -0
  340. package/lib/esm/curve/{CurveCurveIntersectXYZ.d.ts → internalContexts/CurveCurveIntersectXYZ.d.ts} +18 -18
  341. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -0
  342. package/lib/esm/curve/{CurveCurveIntersectXYZ.js → internalContexts/CurveCurveIntersectXYZ.js} +134 -108
  343. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -0
  344. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.d.ts +2 -2
  345. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.d.ts.map +1 -1
  346. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js +9 -5
  347. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  348. package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +1 -1
  349. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  350. package/lib/esm/geometry3d/BarycentricTriangle.d.ts +1 -0
  351. package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  352. package/lib/esm/geometry3d/BarycentricTriangle.js +1 -0
  353. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  354. package/lib/esm/geometry3d/FrameBuilder.d.ts +28 -11
  355. package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
  356. package/lib/esm/geometry3d/FrameBuilder.js +57 -45
  357. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  358. package/lib/esm/geometry3d/GeometryHandler.d.ts +15 -26
  359. package/lib/esm/geometry3d/GeometryHandler.d.ts.map +1 -1
  360. package/lib/esm/geometry3d/GeometryHandler.js +23 -32
  361. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  362. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +0 -8
  363. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  364. package/lib/esm/geometry3d/GrowableXYZArray.js +0 -16
  365. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  366. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +4 -4
  367. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  368. package/lib/esm/geometry3d/IndexedXYZCollection.js +12 -0
  369. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  370. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  371. package/lib/esm/geometry3d/Matrix3d.js +3 -6
  372. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  373. package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
  374. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  375. package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -2
  376. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  377. package/lib/esm/geometry3d/Point3dVector3d.js +0 -1
  378. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  379. package/lib/esm/geometry3d/PolygonOps.d.ts +2 -2
  380. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  381. package/lib/esm/geometry3d/PolygonOps.js +2 -3
  382. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  383. package/lib/esm/geometry3d/Range.d.ts +1 -1
  384. package/lib/esm/geometry3d/Range.d.ts.map +1 -1
  385. package/lib/esm/geometry3d/Range.js +1 -1
  386. package/lib/esm/geometry3d/Range.js.map +1 -1
  387. package/lib/esm/geometry3d/Ray3d.d.ts +3 -1
  388. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  389. package/lib/esm/geometry3d/Ray3d.js +4 -3
  390. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  391. package/lib/esm/geometry3d/ReusableObjectCache.d.ts +2 -1
  392. package/lib/esm/geometry3d/ReusableObjectCache.d.ts.map +1 -1
  393. package/lib/esm/geometry3d/ReusableObjectCache.js +1 -1
  394. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  395. package/lib/esm/geometry3d/SortablePolygon.d.ts +1 -1
  396. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  397. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  398. package/lib/esm/geometry3d/Transform.js +4 -6
  399. package/lib/esm/geometry3d/Transform.js.map +1 -1
  400. package/lib/esm/geometry3d/YawPitchRollAngles.js +1 -1
  401. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  402. package/lib/esm/geometry4d/Map4d.d.ts +14 -8
  403. package/lib/esm/geometry4d/Map4d.d.ts.map +1 -1
  404. package/lib/esm/geometry4d/Map4d.js +38 -16
  405. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  406. package/lib/esm/geometry4d/Matrix4d.d.ts.map +1 -1
  407. package/lib/esm/geometry4d/Matrix4d.js +4 -2
  408. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  409. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  410. package/lib/esm/numerics/Polynomials.d.ts +2 -2
  411. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  412. package/lib/esm/numerics/Polynomials.js +2 -2
  413. package/lib/esm/numerics/Polynomials.js.map +1 -1
  414. package/lib/esm/polyface/PolyfaceBuilder.d.ts +18 -6
  415. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  416. package/lib/esm/polyface/PolyfaceBuilder.js +55 -25
  417. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  418. package/lib/esm/polyface/PolyfaceClip.d.ts +16 -7
  419. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  420. package/lib/esm/polyface/PolyfaceClip.js +38 -7
  421. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  422. package/lib/esm/polyface/PolyfaceData.d.ts +5 -39
  423. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  424. package/lib/esm/polyface/PolyfaceData.js +7 -41
  425. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  426. package/lib/esm/polyface/PolyfaceQuery.d.ts +10 -8
  427. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  428. package/lib/esm/polyface/PolyfaceQuery.js +64 -18
  429. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  430. package/lib/esm/serialization/GeometrySamples.d.ts +6 -0
  431. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  432. package/lib/esm/serialization/GeometrySamples.js +68 -2
  433. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  434. package/lib/esm/solid/LinearSweep.d.ts +1 -1
  435. package/lib/esm/solid/LinearSweep.js.map +1 -1
  436. package/lib/esm/solid/RotationalSweep.d.ts +1 -1
  437. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  438. package/lib/esm/solid/RuledSweep.d.ts +1 -1
  439. package/lib/esm/solid/RuledSweep.js.map +1 -1
  440. package/lib/esm/solid/SweepContour.d.ts +35 -26
  441. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  442. package/lib/esm/solid/SweepContour.js +84 -100
  443. package/lib/esm/solid/SweepContour.js.map +1 -1
  444. package/lib/esm/topology/Graph.d.ts +29 -11
  445. package/lib/esm/topology/Graph.d.ts.map +1 -1
  446. package/lib/esm/topology/Graph.js +45 -26
  447. package/lib/esm/topology/Graph.js.map +1 -1
  448. package/lib/esm/topology/HalfEdgeMarkSet.d.ts +2 -2
  449. package/lib/esm/topology/HalfEdgeMarkSet.d.ts.map +1 -1
  450. package/lib/esm/topology/HalfEdgeMarkSet.js +2 -2
  451. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  452. package/lib/esm/topology/Merging.d.ts +3 -0
  453. package/lib/esm/topology/Merging.d.ts.map +1 -1
  454. package/lib/esm/topology/Merging.js +19 -5
  455. package/lib/esm/topology/Merging.js.map +1 -1
  456. package/lib/esm/topology/Triangulation.d.ts +15 -7
  457. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  458. package/lib/esm/topology/Triangulation.js +89 -47
  459. package/lib/esm/topology/Triangulation.js.map +1 -1
  460. package/package.json +4 -4
  461. package/lib/cjs/curve/CurveChain.d.ts.map +0 -1
  462. package/lib/cjs/curve/CurveChain.js.map +0 -1
  463. package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts +0 -175
  464. package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts.map +0 -1
  465. package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +0 -1
  466. package/lib/cjs/curve/CurveCurveIntersectXY.d.ts.map +0 -1
  467. package/lib/cjs/curve/CurveCurveIntersectXY.js.map +0 -1
  468. package/lib/cjs/curve/CurveCurveIntersectXYZ.d.ts.map +0 -1
  469. package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +0 -1
  470. package/lib/esm/curve/CurveChain.d.ts.map +0 -1
  471. package/lib/esm/curve/CurveChain.js.map +0 -1
  472. package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts +0 -175
  473. package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts.map +0 -1
  474. package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +0 -1
  475. package/lib/esm/curve/CurveCurveIntersectXY.d.ts.map +0 -1
  476. package/lib/esm/curve/CurveCurveIntersectXY.js.map +0 -1
  477. package/lib/esm/curve/CurveCurveIntersectXYZ.d.ts.map +0 -1
  478. package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +0 -1
@@ -1,19 +1,18 @@
1
1
  /** @packageDocumentation
2
2
  * @module Curve
3
3
  */
4
- import { BSplineCurve3d } from "../bspline/BSplineCurve";
5
- import { BSplineCurve3dH } from "../bspline/BSplineCurve3dH";
6
- import { NullGeometryHandler } from "../geometry3d/GeometryHandler";
7
- import { Plane3dByOriginAndUnitNormal } from "../geometry3d/Plane3dByOriginAndUnitNormal";
8
- import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
9
- import { Arc3d } from "./Arc3d";
10
- import { CurveLocationDetailArrayPair } from "./CurveCurveIntersectXY";
11
- import { GeometryQuery } from "./GeometryQuery";
12
- import { LineSegment3d } from "./LineSegment3d";
13
- import { LineString3d } from "./LineString3d";
4
+ import { BSplineCurve3d } from "../../bspline/BSplineCurve";
5
+ import { BSplineCurve3dH } from "../../bspline/BSplineCurve3dH";
6
+ import { NullGeometryHandler } from "../../geometry3d/GeometryHandler";
7
+ import { Plane3dByOriginAndUnitNormal } from "../../geometry3d/Plane3dByOriginAndUnitNormal";
8
+ import { Point3d, Vector3d } from "../../geometry3d/Point3dVector3d";
9
+ import { Arc3d } from "../Arc3d";
10
+ import { CurveLocationDetailPair } from "../CurveLocationDetail";
11
+ import { AnyCurve } from "../CurveTypes";
12
+ import { LineSegment3d } from "../LineSegment3d";
13
+ import { LineString3d } from "../LineString3d";
14
14
  /**
15
15
  * Handler class for XYZ intersections between _geometryB and another geometry.
16
- * * **NOTE:** GeometryQuery input (_geometryB) should really be AnyCurve.
17
16
  * * Instances are initialized and called from CurveCurve.
18
17
  * * geometryB is saved for later reference.
19
18
  * @internal
@@ -28,18 +27,17 @@ export declare class CurveCurveIntersectXYZ extends NullGeometryHandler {
28
27
  private static _workPointAA1;
29
28
  private static _workPointBB0;
30
29
  private static _workPointBB1;
31
- private reinitialize;
32
30
  /**
33
31
  * @param extendA flag to enable using extension of the other geometry.
34
32
  * @param geometryB second curve for intersection. Saved for reference by specific handler methods.
35
33
  * @param extendB flag for extension of geometryB.
36
34
  */
37
- constructor(extendA: boolean, geometryB: GeometryQuery, extendB: boolean);
35
+ constructor(extendA: boolean, geometryB: AnyCurve, extendB: boolean);
38
36
  /**
39
- * * Return the results structure for the intersection calculation.
37
+ * Return the results structure for the intersection calculation, structured as an array of CurveLocationDetailPair.
40
38
  * @param reinitialize if true, a new results structure is created for use by later calls.
41
39
  */
42
- grabResults(reinitialize?: boolean): CurveLocationDetailArrayPair;
40
+ grabPairedResults(reinitialize?: boolean): CurveLocationDetailPair[];
43
41
  private acceptFraction;
44
42
  /**
45
43
  * Compute intersection of two line segments.
@@ -65,7 +63,7 @@ export declare class CurveCurveIntersectXYZ extends NullGeometryHandler {
65
63
  * @param origin plane origin
66
64
  * @param vectorA vector which must be in the plane.
67
65
  * @param cosineValue largest cosine of the angle theta between vectorA and vectorB to prefer their cross product, e.g.
68
- * passing 0.94 ~ cos(20deg) will switch to using vectorC in the cross product if theta < ~20deg or theta > ~160deg.
66
+ * passing 0.94 ~ cos(20deg) will switch to using vectorC in the cross product if theta < ~20deg or theta > ~160deg.
69
67
  * @param vectorB first candidate for additional in-plane vector
70
68
  * @param vectorC second candidate for additional in-plane vector
71
69
  */
@@ -82,13 +80,15 @@ export declare class CurveCurveIntersectXYZ extends NullGeometryHandler {
82
80
  computeSegmentLineString(lsA: LineSegment3d, extendA: boolean, lsB: LineString3d, extendB: boolean, reversed: boolean): any;
83
81
  /** Detail computation for arc intersecting linestring. */
84
82
  computeArcLineString(arcA: Arc3d, extendA: boolean, lsB: LineString3d, extendB: boolean, reversed: boolean): any;
83
+ /** Detail computation for linestring intersecting linestring. */
84
+ private computeLineStringLineString;
85
85
  /** Double dispatch handler for strongly typed segment. */
86
86
  handleLineSegment3d(segmentA: LineSegment3d): any;
87
- /** double dispatch handler for strongly typed linestring .. */
87
+ /** double dispatch handler for strongly typed linestring. */
88
88
  handleLineString3d(lsA: LineString3d): any;
89
89
  /** Double dispatch handler for strongly typed arc. */
90
90
  handleArc3d(arc0: Arc3d): any;
91
- /** Double dispatch handler for strongly typed bspline curve.. */
91
+ /** Double dispatch handler for strongly typed bspline curve. */
92
92
  handleBSplineCurve3d(curve: BSplineCurve3d): any;
93
93
  /** Double dispatch handler for strongly typed homogeneous bspline curve. */
94
94
  handleBSplineCurve3dH(_curve: BSplineCurve3dH): any;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CurveCurveIntersectXYZ.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CurveCurveIntersectXYZ.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAE,cAAc,EAAsB,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AACvE,OAAO,EAAE,4BAA4B,EAAE,MAAM,+CAA+C,CAAC;AAE7F,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAErE,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAA0C,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEzG,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI/C;;;;;GAKG;AACH,qBAAa,sBAAuB,SAAQ,mBAAmB;IAC7D,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,UAAU,CAAW;IAC7B,OAAO,CAAC,QAAQ,CAAU;IAC1B,OAAO,CAAC,QAAQ,CAA4B;IAC5C,OAAO,CAAC,MAAM,CAAC,cAAc,CAAqB;IAClD,OAAO,CAAC,MAAM,CAAC,aAAa,CAAoB;IAChD,OAAO,CAAC,MAAM,CAAC,aAAa,CAAoB;IAChD,OAAO,CAAC,MAAM,CAAC,aAAa,CAAoB;IAChD,OAAO,CAAC,MAAM,CAAC,aAAa,CAAoB;IAChD;;;;OAIG;gBACgB,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO;IAO1E;;;OAGG;IACI,iBAAiB,CAAC,YAAY,GAAE,OAAe,GAAG,uBAAuB,EAAE;IAMlF,OAAO,CAAC,cAAc;IAOtB;;;;;OAKG;IACH,OAAO,CAAC,6BAA6B;IA4CrC;;;;OAIG;IACH,OAAO,CAAC,uBAAuB;IA2B/B,OAAO,CAAC,sBAAsB;IAuB9B;;;;;;;;;;;;;OAaG;IACI,qCAAqC,CAC1C,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,GAC5F,4BAA4B,GAAG,SAAS;IAe3C,OAAO,CAAC,kBAAkB;IAyC1B,OAAO,CAAC,qBAAqB;IA0B7B,OAAO,CAAC,cAAc;IAqCtB,OAAO,CAAC,yBAAyB;IA6LjC,OAAO,CAAC,oCAAoC;IAkE5C,OAAO,CAAC,2BAA2B;IAqCnC,yEAAyE;IAClE,8BAA8B,CACnC,IAAI,EAAE,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO,GACpG,GAAG;IAsBN,8DAA8D;IACvD,wBAAwB,CAC7B,GAAG,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GAC3F,GAAG;IAwBN,0DAA0D;IACnD,oBAAoB,CACzB,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,GAAG,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,GACpF,GAAG;IAqBN,iEAAiE;IACjE,OAAO,CAAC,2BAA2B;IAmCnC,0DAA0D;IAC1C,mBAAmB,CAAC,QAAQ,EAAE,aAAa,GAAG,GAAG;IAuBjE,6DAA6D;IAC7C,kBAAkB,CAAC,GAAG,EAAE,YAAY,GAAG,GAAG;IAa1D,sDAAsD;IACtC,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,GAAG;IAe7C,gEAAgE;IAChD,oBAAoB,CAAC,KAAK,EAAE,cAAc,GAAG,GAAG;IAehE,4EAA4E;IAC5D,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,GAAG;CAgBpE"}
@@ -8,30 +8,25 @@ exports.CurveCurveIntersectXYZ = void 0;
8
8
  /** @packageDocumentation
9
9
  * @module Curve
10
10
  */
11
- const BSplineCurve_1 = require("../bspline/BSplineCurve");
12
- const Geometry_1 = require("../Geometry");
13
- const GeometryHandler_1 = require("../geometry3d/GeometryHandler");
14
- const Plane3dByOriginAndUnitNormal_1 = require("../geometry3d/Plane3dByOriginAndUnitNormal");
15
- const Point2dVector2d_1 = require("../geometry3d/Point2dVector2d");
16
- const Point3dVector3d_1 = require("../geometry3d/Point3dVector3d");
17
- const Polynomials_1 = require("../numerics/Polynomials");
18
- const Arc3d_1 = require("./Arc3d");
19
- const CurveCurveIntersectXY_1 = require("./CurveCurveIntersectXY");
20
- const CurveLocationDetail_1 = require("./CurveLocationDetail");
21
- const LineSegment3d_1 = require("./LineSegment3d");
22
- const LineString3d_1 = require("./LineString3d");
11
+ const BSplineCurve_1 = require("../../bspline/BSplineCurve");
12
+ const Geometry_1 = require("../../Geometry");
13
+ const GeometryHandler_1 = require("../../geometry3d/GeometryHandler");
14
+ const Plane3dByOriginAndUnitNormal_1 = require("../../geometry3d/Plane3dByOriginAndUnitNormal");
15
+ const Point2dVector2d_1 = require("../../geometry3d/Point2dVector2d");
16
+ const Point3dVector3d_1 = require("../../geometry3d/Point3dVector3d");
17
+ const Polynomials_1 = require("../../numerics/Polynomials");
18
+ const Arc3d_1 = require("../Arc3d");
19
+ const CurveLocationDetail_1 = require("../CurveLocationDetail");
20
+ const LineSegment3d_1 = require("../LineSegment3d");
21
+ const LineString3d_1 = require("../LineString3d");
23
22
  // cspell:word XYRR
24
23
  /**
25
24
  * Handler class for XYZ intersections between _geometryB and another geometry.
26
- * * **NOTE:** GeometryQuery input (_geometryB) should really be AnyCurve.
27
25
  * * Instances are initialized and called from CurveCurve.
28
26
  * * geometryB is saved for later reference.
29
27
  * @internal
30
28
  */
31
29
  class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
32
- reinitialize() {
33
- this._results = new CurveCurveIntersectXY_1.CurveLocationDetailArrayPair();
34
- }
35
30
  /**
36
31
  * @param extendA flag to enable using extension of the other geometry.
37
32
  * @param geometryB second curve for intersection. Saved for reference by specific handler methods.
@@ -42,16 +37,16 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
42
37
  this._extendA = extendA;
43
38
  this._geometryB = geometryB;
44
39
  this._extendB = extendB;
45
- this.reinitialize();
40
+ this._results = [];
46
41
  }
47
42
  /**
48
- * * Return the results structure for the intersection calculation.
43
+ * Return the results structure for the intersection calculation, structured as an array of CurveLocationDetailPair.
49
44
  * @param reinitialize if true, a new results structure is created for use by later calls.
50
45
  */
51
- grabResults(reinitialize = false) {
46
+ grabPairedResults(reinitialize = false) {
52
47
  const result = this._results;
53
48
  if (reinitialize)
54
- this.reinitialize();
49
+ this._results = [];
55
50
  return result;
56
51
  }
57
52
  acceptFraction(extend0, fraction, extend1) {
@@ -67,15 +62,14 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
67
62
  * Reject if evaluated points do not match coordinates (e.g. close approach point).
68
63
  * Record with fraction mapping.
69
64
  */
70
- recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, // Computed intersection fraction
71
- cpB, fractionB0, fractionB1, reversed) {
65
+ recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, cpB, fractionB0, fractionB1, reversed) {
72
66
  const globalFractionA = Geometry_1.Geometry.interpolate(fractionA0, localFractionA, fractionA1);
73
67
  const globalFractionB = Geometry_1.Geometry.interpolate(fractionB0, localFractionB, fractionB1);
74
68
  // ignore duplicate of most recent point . ..
75
- const numPrevious = this._results.dataA.length;
69
+ const numPrevious = this._results.length;
76
70
  if (numPrevious > 0) {
77
- const topFractionA = this._results.dataA[numPrevious - 1].fraction;
78
- const topFractionB = this._results.dataB[numPrevious - 1].fraction;
71
+ const topFractionA = this._results[numPrevious - 1].detailA.fraction;
72
+ const topFractionB = this._results[numPrevious - 1].detailB.fraction;
79
73
  if (reversed) {
80
74
  if (Geometry_1.Geometry.isAlmostEqualNumber(topFractionA, globalFractionB) &&
81
75
  Geometry_1.Geometry.isAlmostEqualNumber(topFractionB, globalFractionA))
@@ -96,12 +90,12 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
96
90
  const detailB = CurveLocationDetail_1.CurveLocationDetail.createCurveFractionPoint(cpB, globalFractionB, pointB);
97
91
  detailB.setIntervalRole(CurveLocationDetail_1.CurveIntervalRole.isolated);
98
92
  if (reversed) {
99
- this._results.dataA.push(detailB);
100
- this._results.dataB.push(detailA);
93
+ const pair = new CurveLocationDetail_1.CurveLocationDetailPair(detailB, detailA);
94
+ this._results.push(pair);
101
95
  }
102
96
  else {
103
- this._results.dataA.push(detailA);
104
- this._results.dataB.push(detailB);
97
+ const pair = new CurveLocationDetail_1.CurveLocationDetailPair(detailA, detailB);
98
+ this._results.push(pair);
105
99
  }
106
100
  }
107
101
  /**
@@ -117,8 +111,8 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
117
111
  }
118
112
  }
119
113
  // Caller accesses data from a line segment and passes to here.
120
- // (The line segment in question might be (a) a full line segment or (b) a fragment within a linestring. The fraction and extend parameters
121
- // allow all combinations to be passed in)
114
+ // The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
115
+ // The fraction and extend parameters allow all combinations to be passed in.
122
116
  // This method applies transform.
123
117
  dispatchSegmentSegment(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
124
118
  this.computeSegmentSegment3D(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed);
@@ -133,7 +127,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
133
127
  * @param origin plane origin
134
128
  * @param vectorA vector which must be in the plane.
135
129
  * @param cosineValue largest cosine of the angle theta between vectorA and vectorB to prefer their cross product, e.g.
136
- * passing 0.94 ~ cos(20deg) will switch to using vectorC in the cross product if theta < ~20deg or theta > ~160deg.
130
+ * passing 0.94 ~ cos(20deg) will switch to using vectorC in the cross product if theta < ~20deg or theta > ~160deg.
137
131
  * @param vectorB first candidate for additional in-plane vector
138
132
  * @param vectorC second candidate for additional in-plane vector
139
133
  */
@@ -148,8 +142,8 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
148
142
  return undefined;
149
143
  }
150
144
  // Caller accesses data from a linestring or segment and passes it here.
151
- // (The line segment in question might be (a) a full line segment or (b) a fragment within a linestring. The fraction and extend parameters
152
- // allow all combinations to be passed in)
145
+ // The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
146
+ // The fraction and extend parameters allow all combinations to be passed in.
153
147
  dispatchSegmentArc(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, arc, extendB0, extendB1, reversed) {
154
148
  const lineVector = Point3dVector3d_1.Vector3d.createStartEnd(pointA0, pointA1);
155
149
  const plane = this.createPlaneWithPreferredPerpendicular(pointA0, lineVector, 0.94, arc.perpendicularVector, arc.vector0);
@@ -184,7 +178,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
184
178
  Polynomials_1.TrigPolynomial.solveUnitCircleHomogeneousEllipseIntersection(otherVectors.center.x, otherVectors.center.y, 1.0, otherVectors.vector0.x, otherVectors.vector0.y, 0.0, otherVectors.vector90.x, otherVectors.vector90.y, 0.0, ellipseRadians, circleRadians);
185
179
  for (let i = 0; i < ellipseRadians.length; i++) {
186
180
  const fractionA = cpA.sweep.radiansToSignedPeriodicFraction(circleRadians[i]);
187
- const fractionB = cpA.sweep.radiansToSignedPeriodicFraction(ellipseRadians[i]);
181
+ const fractionB = cpB.sweep.radiansToSignedPeriodicFraction(ellipseRadians[i]);
188
182
  // hm .. do we really need to check the fractions? We know they are internal to the beziers
189
183
  if (this.acceptFraction(extendA, fractionA, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {
190
184
  this.recordPointWithLocalFractions(fractionA, cpA, 0, 1, fractionB, cpB, 0, 1, reversed);
@@ -193,13 +187,13 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
193
187
  }
194
188
  }
195
189
  // Caller accesses data from two arcs.
196
- // Selects the best conditioned arc (in xy parts) as "circle after inversion"
197
- // Solves the arc-arc equations
190
+ // Selects the best conditioned arc (in xy parts) as "circle after inversion".
191
+ // Solves the arc-arc equations.
198
192
  dispatchArcArc(cpA, extendA, cpB, extendB, reversed) {
199
193
  // If arcs are in different planes:
200
194
  // 1) Intersect each plane with the other arc (quadratic)
201
195
  // 2) accept points that appear in both intersection sets.
202
- // If arcs are in parallel planes -- no intersections
196
+ // If arcs are in parallel planes -- no intersections.
203
197
  // If arcs are in the same plane -- xy intersection in that plane.
204
198
  const planeA = Plane3dByOriginAndUnitNormal_1.Plane3dByOriginAndUnitNormal.create(cpA.center, cpA.perpendicularVector);
205
199
  const planeB = Plane3dByOriginAndUnitNormal_1.Plane3dByOriginAndUnitNormal.create(cpB.center, cpB.perpendicularVector);
@@ -207,7 +201,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
207
201
  return;
208
202
  if (planeA.getNormalRef().isParallelTo(planeB.getNormalRef())) {
209
203
  if (planeA.isPointInPlane(planeB.getOriginRef()) && planeB.isPointInPlane(planeA.getOriginRef())) {
210
- // coplanar !!!
204
+ // coplanar
211
205
  this.dispatchArcArcInPlane(cpA, extendA, cpB, extendB, reversed);
212
206
  }
213
207
  }
@@ -229,8 +223,8 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
229
223
  }
230
224
  }
231
225
  // Caller accesses data from two arcs.
232
- // Selects the best conditioned arc (in xy parts) as "circle after inversion"
233
- // Solves the arc-arc equations
226
+ // Selects the best conditioned arc (in xy parts) as "circle after inversion".
227
+ // Solves the arc-arc equations.
234
228
  dispatchArcBsplineCurve3d(_arc, _extendA, _cpB, _extendB, _reversed) {
235
229
  /*
236
230
  // Arc: X = C + cU + sV
@@ -238,7 +232,9 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
238
232
  let matrixA: Matrix3d;
239
233
  if (this._worldToLocalPerspective) {
240
234
  const dataA = cpA.toTransformedPoint4d(this._worldToLocalPerspective);
241
- matrixA = Matrix3d.createColumnsXYW(dataA.vector0, dataA.vector0.w, dataA.vector90, dataA.vector90.w, dataA.center, dataA.center.w);
235
+ matrixA = Matrix3d.createColumnsXYW(
236
+ dataA.vector0, dataA.vector0.w, dataA.vector90, dataA.vector90.w, dataA.center, dataA.center.w,
237
+ );
242
238
  } else {
243
239
  const dataA = cpA.toTransformedVectors(this._worldToLocalAffine);
244
240
  matrixA = Matrix3d.createColumnsXYW(dataA.vector0, 0, dataA.vector90, 0, dataA.center, 1);
@@ -250,12 +246,21 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
250
246
  const matrixAInverse = matrixA.inverse();
251
247
  if (matrixAInverse) {
252
248
  const orderF = cpB.order; // order of the beziers for simple coordinates
253
- const orderG = 2 * orderF - 1; // order of the (single) bezier for squared coordinates.
249
+ const orderG = 2 * orderF - 1; // order of the (single) bezier for squared coordinates.
254
250
  const coffF = new Float64Array(orderF);
255
251
  const univariateBezierG = new UnivariateBezier(orderG);
256
- const axx = matrixAInverse.at(0, 0); const axy = matrixAInverse.at(0, 1); const axz = 0.0; const axw = matrixAInverse.at(0, 2);
257
- const ayx = matrixAInverse.at(1, 0); const ayy = matrixAInverse.at(1, 1); const ayz = 0.0; const ayw = matrixAInverse.at(1, 2);
258
- const awx = matrixAInverse.at(2, 0); const awy = matrixAInverse.at(2, 1); const awz = 0.0; const aww = matrixAInverse.at(2, 2);
252
+ const axx = matrixAInverse.at(0, 0);
253
+ const axy = matrixAInverse.at(0, 1);
254
+ const axz = 0.0;
255
+ const axw = matrixAInverse.at(0, 2);
256
+ const ayx = matrixAInverse.at(1, 0);
257
+ const ayy = matrixAInverse.at(1, 1);
258
+ const ayz = 0.0;
259
+ const ayw = matrixAInverse.at(1, 2);
260
+ const awx = matrixAInverse.at(2, 0);
261
+ const awy = matrixAInverse.at(2, 1);
262
+ const awz = 0.0;
263
+ const aww = matrixAInverse.at(2, 2);
259
264
 
260
265
  if (matrixAInverse) {
261
266
  let bezier: BezierCurve3dH | undefined;
@@ -282,9 +287,11 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
282
287
  const c = bcurvePoint4d.dotProductXYZW(axx, axy, axz, axw);
283
288
  const s = bcurvePoint4d.dotProductXYZW(ayx, ayy, ayz, ayw);
284
289
  const arcFraction = cpA.sweep.radiansToSignedPeriodicFraction(Math.atan2(s, c));
285
- if (this.acceptFraction(extendA, arcFraction, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {
286
- this.recordPointWithLocalFractions(arcFraction, cpA, 0, 1,
287
- fractionB, cpB, 0, 1, reversed);
290
+ if (this.acceptFraction(extendA, arcFraction, extendA) &&
291
+ this.acceptFraction(extendB, fractionB, extendB)) {
292
+ this.recordPointWithLocalFractions(
293
+ arcFraction, cpA, 0, 1, fractionB, cpB, 0, 1, reversed,
294
+ );
288
295
  }
289
296
  }
290
297
  }
@@ -294,8 +301,8 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
294
301
  */
295
302
  }
296
303
  /*
297
- // apply the transformation to bezier curves. optionally construct ranges.
298
- private transformBeziers(beziers: BezierCurve3dH[]) {
304
+ // Apply the transformation to bezier curves. Optionally construct ranges.
305
+ private transformBeziers(beziers: BezierCurve3dH[]): void {
299
306
  if (this._worldToLocalAffine) {
300
307
  for (const bezier of beziers) bezier.tryTransformInPlace(this._worldToLocalAffine);
301
308
  } else if (this._worldToLocalPerspective) {
@@ -312,11 +319,6 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
312
319
  }
313
320
  return ranges;
314
321
  }
315
- private _xyzwA0?: Point4d;
316
- private _xyzwA1?: Point4d;
317
- private _xyzwPlane?: Point4d;
318
- private _xyzwB?: Point4d;
319
-
320
322
  private dispatchBezierBezierStrokeFirst(
321
323
  bezierA: BezierCurve3dH,
322
324
  bcurveA: BSplineCurve3dBase,
@@ -325,11 +327,16 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
325
327
  bcurveB: BSplineCurve3dBase,
326
328
  _strokeCountB: number,
327
329
  univariateBezierB: UnivariateBezier, // caller-allocated for univariate coefficients.
328
- reversed: boolean) {
329
- if (!this._xyzwA0) this._xyzwA0 = Point4d.create();
330
- if (!this._xyzwA1) this._xyzwA1 = Point4d.create();
331
- if (!this._xyzwPlane) this._xyzwPlane = Point4d.create();
332
- if (!this._xyzwB) this._xyzwB = Point4d.create();
330
+ reversed: boolean,
331
+ ) {
332
+ if (!this._xyzwA0)
333
+ this._xyzwA0 = Point4d.create();
334
+ if (!this._xyzwA1)
335
+ this._xyzwA1 = Point4d.create();
336
+ if (!this._xyzwPlane)
337
+ this._xyzwPlane = Point4d.create();
338
+ if (!this._xyzwB)
339
+ this._xyzwB = Point4d.create();
333
340
  const roots = univariateBezierG.roots(0.0, true);
334
341
  if (roots) {
335
342
  for (const root of roots) {
@@ -340,8 +347,9 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
340
347
  const s = bcurvePoint4d.dotProductXYZW(ayx, ayy, ayz, ayw);
341
348
  const arcFraction = cpA.sweep.radiansToSignedPeriodicFraction(Math.atan2(s, c));
342
349
  if (this.acceptFraction(extendA, arcFraction, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {
343
- this.recordPointWithLocalFractions(arcFraction, cpA, 0, 1,
344
- fractionB, cpB, 0, 1, reversed);
350
+ this.recordPointWithLocalFractions(
351
+ arcFraction, cpA, 0, 1, fractionB, cpB, 0, 1, reversed,
352
+ );
345
353
  }
346
354
  }
347
355
  bezierA.fractionToPoint4d(0.0, this._xyzwA0);
@@ -353,7 +361,9 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
353
361
  f1 = i * df;
354
362
  bezierA.fractionToPoint4d(f1, this._xyzwA1);
355
363
  Point4d.createPlanePointPointZ(this._xyzwA0, this._xyzwA1, this._xyzwPlane);
356
- bezierB.poleProductsXYZW(univariateBezierB.coffs, this._xyzwPlane.x, this._xyzwPlane.y, this._xyzwPlane.z, this._xyzwPlane.w);
364
+ bezierB.poleProductsXYZW(
365
+ univariateBezierB.coffs, this._xyzwPlane.x, this._xyzwPlane.y, this._xyzwPlane.z, this._xyzwPlane.w,
366
+ );
357
367
  let errors = 0;
358
368
  const roots = univariateBezierB.roots(0.0, true);
359
369
  if (roots)
@@ -363,7 +373,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
363
373
  const segmentAFraction = SmallSystem.lineSegment3dHXYClosestPointUnbounded(this._xyzwA0, this._xyzwA1, this._xyzwB);
364
374
  if (segmentAFraction && Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {
365
375
  const bezierAFraction = Geometry.interpolate(f0, segmentAFraction, f1);
366
- /*- TODO implement newton search
376
+ // TODO implement newton search
367
377
  const xyMatchingFunction = new BezierBezierIntersectionXYRRToRRD(bezierA, bezierB);
368
378
  const newtonSearcher = new Newton2dUnboundedWithDerivative(xyMatchingFunction);
369
379
  newtonSearcher.setUV(bezierAFraction, bezierBFraction);
@@ -388,9 +398,11 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
388
398
  errors++;
389
399
  if (errors > 0 && !xyzA1.isAlmostEqual(xyzB1))
390
400
  errors++;
391
- if (this.acceptFraction(false, bcurveAFraction, false) && this.acceptFraction(false, bcurveBFraction, false)) {
392
- this.recordPointWithLocalFractions(bcurveAFraction, bcurveA, 0, 1,
393
- bcurveBFraction, bcurveB, 0, 1, reversed);
401
+ if (this.acceptFraction(false, bcurveAFraction, false) &&
402
+ this.acceptFraction(false, bcurveBFraction, false)) {
403
+ this.recordPointWithLocalFractions(
404
+ bcurveAFraction, bcurveA, 0, 1, bcurveBFraction, bcurveB, 0, 1, reversed,
405
+ );
394
406
  }
395
407
  }
396
408
  }
@@ -398,8 +410,8 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
398
410
  }
399
411
  */
400
412
  // Caller accesses data from two arcs.
401
- // Selects the best conditioned arc (in xy parts) as "circle after inversion"
402
- // Solves the arc-arc equations
413
+ // Selects the best conditioned arc (in xy parts) as "circle after inversion".
414
+ // Solves the arc-arc equations.
403
415
  dispatchBSplineCurve3dBSplineCurve3d(_bcurveA, _bcurveB, _reversed) {
404
416
  /*
405
417
  const bezierSpanA = bcurveA.collectBezierSpans(true) as BezierCurve3dH[];
@@ -420,9 +432,13 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
420
432
  const strokeCountA = bezierSpanA[a].computeStrokeCountForOptions();
421
433
  const strokeCountB = bezierSpanB[b].computeStrokeCountForOptions();
422
434
  if (strokeCountA < strokeCountB)
423
- this.dispatchBezierBezierStrokeFirst(bezierSpanA[a], bcurveA, strokeCountA, bezierSpanB[b], bcurveB, strokeCountB, univariateCoffsB, !_reversed);
435
+ this.dispatchBezierBezierStrokeFirst(
436
+ bezierSpanA[a], bcurveA, strokeCountA, bezierSpanB[b], bcurveB, strokeCountB, univariateCoffsB, _reversed,
437
+ );
424
438
  else
425
- this.dispatchBezierBezierStrokeFirst(bezierSpanB[b], bcurveB, strokeCountB, bezierSpanA[a], bcurveA, strokeCountA, univariateCoffsA, _reversed);
439
+ this.dispatchBezierBezierStrokeFirst(
440
+ bezierSpanB[b], bcurveB, strokeCountB, bezierSpanA[a], bcurveA, strokeCountA, univariateCoffsA, !_reversed,
441
+ );
426
442
  }
427
443
  }
428
444
  }
@@ -430,9 +446,9 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
430
446
  }
431
447
  /*
432
448
  /**
433
- * Apply the projection transform (if any) to (xyz, w)
449
+ * Apply the projection transform (if any) to (xyz, w).
434
450
  * @param xyz xyz parts of input point.
435
- * @param w weight to use for homogeneous effects
451
+ * @param w weight to use for homogeneous effects.
436
452
  */
437
453
  /*
438
454
  private projectPoint(xyz: XYAndZ, w: number = 1.0): Point4d {
@@ -469,16 +485,19 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
469
485
  // NOW .. we have a plane in world space. Intersect it with the bspline:
470
486
  const intersections: CurveLocationDetail[] = [];
471
487
  bcurve.appendPlaneIntersectionPoints(planeCoffs, intersections);
472
- // intersections has WORLD points with bspline fractions. (The bspline fractions are all good 0..1 fractions within the spline.)
488
+ // intersections has WORLD points with bspline fractions.
489
+ // (the bspline fractions are all good 0..1 fractions within the spline).
473
490
  // accept those that are within the segment range.
474
491
  for (const detail of intersections) {
475
492
  const fractionB = detail.fraction;
476
493
  const curvePoint = detail.point;
477
494
  const curvePointH = this.projectPoint(curvePoint);
478
495
  const lineFraction = SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, curvePointH);
479
- if (lineFraction !== undefined && this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB, fractionB, extendB)) {
480
- this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1,
481
- fractionB, bcurve, 0, 1, reversed);
496
+ if (lineFraction !== undefined && this.acceptFraction(extendA0, lineFraction, extendA1) &&
497
+ this.acceptFraction(extendB, fractionB, extendB)) {
498
+ this.recordPointWithLocalFractions(
499
+ lineFraction, cpA, fractionA0, fractionA1, fractionB, bcurve, 0, 1, reversed,
500
+ );
482
501
  }
483
502
  }
484
503
  */
@@ -495,7 +514,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
495
514
  const pointA0 = CurveCurveIntersectXYZ._workPointA0;
496
515
  const pointA1 = CurveCurveIntersectXYZ._workPointA1;
497
516
  lsA.pointAt(0, pointA0);
498
- for (let iA = 1; iA < numA; iA++ , pointA0.setFrom(pointA1), fA0 = fA1) {
517
+ for (let iA = 1; iA < numA; iA++, pointA0.setFrom(pointA1), fA0 = fA1) {
499
518
  lsA.pointAt(iA, pointA1);
500
519
  fA1 = iA * dfA;
501
520
  this.dispatchSegmentBsplineCurve(
@@ -546,6 +565,38 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
546
565
  }
547
566
  return undefined;
548
567
  }
568
+ /** Detail computation for linestring intersecting linestring. */
569
+ computeLineStringLineString(lsA, lsB, reversed) {
570
+ const pointA0 = CurveCurveIntersectXYZ._workPointAA0;
571
+ const pointA1 = CurveCurveIntersectXYZ._workPointAA1;
572
+ const pointB0 = CurveCurveIntersectXYZ._workPointBB0;
573
+ const pointB1 = CurveCurveIntersectXYZ._workPointBB1;
574
+ const numA = lsA.numPoints();
575
+ const numB = lsB.numPoints();
576
+ if (numA > 1 && numB > 1) {
577
+ lsA.pointAt(0, pointA0);
578
+ const dfA = 1.0 / (numA - 1);
579
+ const dfB = 1.0 / (numB - 1);
580
+ let fA0 = 0.0;
581
+ let fB0;
582
+ let fA1;
583
+ let fB1;
584
+ const extendA = this._extendA;
585
+ const extendB = this._extendB;
586
+ lsA.pointAt(0, pointA0);
587
+ for (let ia = 1; ia < numA; ia++, pointA0.setFrom(pointA1), fA0 = fA1) {
588
+ fA1 = ia * dfA;
589
+ fB0 = 0.0;
590
+ lsA.pointAt(ia, pointA1);
591
+ lsB.pointAt(0, pointB0);
592
+ for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {
593
+ lsB.pointAt(ib, pointB1);
594
+ fB1 = ib * dfB;
595
+ this.dispatchSegmentSegment(lsA, ia === 1 && extendA, pointA0, fA0, pointA1, fA1, (ia + 1) === numA && extendA, lsB, ib === 1 && extendB, pointB0, fB0, pointB1, fB1, (ib + 1) === numB && extendB, reversed);
596
+ }
597
+ }
598
+ }
599
+ }
549
600
  /** Double dispatch handler for strongly typed segment. */
550
601
  handleLineSegment3d(segmentA) {
551
602
  if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
@@ -561,38 +612,13 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
561
612
  else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
562
613
  this.dispatchSegmentBsplineCurve(segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA, this._geometryB, this._extendB, false);
563
614
  }
615
+ return undefined;
564
616
  }
565
- /** double dispatch handler for strongly typed linestring .. */
617
+ /** double dispatch handler for strongly typed linestring. */
566
618
  handleLineString3d(lsA) {
567
619
  if (this._geometryB instanceof LineString3d_1.LineString3d) {
568
620
  const lsB = this._geometryB;
569
- const pointA0 = CurveCurveIntersectXYZ._workPointAA0;
570
- const pointA1 = CurveCurveIntersectXYZ._workPointAA1;
571
- const pointB0 = CurveCurveIntersectXYZ._workPointBB0;
572
- const pointB1 = CurveCurveIntersectXYZ._workPointBB1;
573
- const numA = lsA.numPoints();
574
- const numB = lsB.numPoints();
575
- if (numA > 1 && numB > 1) {
576
- lsA.pointAt(0, pointA0);
577
- const dfA = 1.0 / (numA - 1);
578
- const dfB = 1.0 / (numB - 1);
579
- let fA0 = 0.0;
580
- let fA1, fB0, fB1;
581
- const extendA = this._extendA;
582
- const extendB = this._extendB;
583
- lsA.pointAt(0, pointA0);
584
- for (let ia = 1; ia < numA; ia++, pointA0.setFrom(pointA1), fA0 = fA1) {
585
- fA1 = ia * dfA;
586
- fB0 = 0.0;
587
- lsA.pointAt(ia, pointA1);
588
- lsB.pointAt(0, pointB0);
589
- for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {
590
- lsB.pointAt(ib, pointB1);
591
- fB1 = ib * dfB;
592
- this.dispatchSegmentSegment(lsA, ia === 1 && extendA, pointA0, fA0, pointA1, fA1, (ia + 1) === numA && extendA, lsB, ib === 1 && extendB, pointB0, fB0, pointB1, fB1, (ib + 1) === numB && extendB, false);
593
- }
594
- }
595
- }
621
+ this.computeLineStringLineString(lsA, lsB, false);
596
622
  }
597
623
  else if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
598
624
  this.computeSegmentLineString(this._geometryB, this._extendB, lsA, this._extendA, true);
@@ -621,7 +647,7 @@ class CurveCurveIntersectXYZ extends GeometryHandler_1.NullGeometryHandler {
621
647
  }
622
648
  return undefined;
623
649
  }
624
- /** Double dispatch handler for strongly typed bspline curve.. */
650
+ /** Double dispatch handler for strongly typed bspline curve. */
625
651
  handleBSplineCurve3d(curve) {
626
652
  if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
627
653
  this.dispatchSegmentBsplineCurve(this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB, curve, this._extendA, true);