@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"}
@@ -5,30 +5,25 @@
5
5
  /** @packageDocumentation
6
6
  * @module Curve
7
7
  */
8
- import { BSplineCurve3d, BSplineCurve3dBase } from "../bspline/BSplineCurve";
9
- import { Geometry } from "../Geometry";
10
- import { NullGeometryHandler } from "../geometry3d/GeometryHandler";
11
- import { Plane3dByOriginAndUnitNormal } from "../geometry3d/Plane3dByOriginAndUnitNormal";
12
- import { Vector2d } from "../geometry3d/Point2dVector2d";
13
- import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
14
- import { SmallSystem, TrigPolynomial } from "../numerics/Polynomials";
15
- import { Arc3d } from "./Arc3d";
16
- import { CurveLocationDetailArrayPair } from "./CurveCurveIntersectXY";
17
- import { CurveIntervalRole, CurveLocationDetail } from "./CurveLocationDetail";
18
- import { LineSegment3d } from "./LineSegment3d";
19
- import { LineString3d } from "./LineString3d";
8
+ import { BSplineCurve3d, BSplineCurve3dBase } from "../../bspline/BSplineCurve";
9
+ import { Geometry } from "../../Geometry";
10
+ import { NullGeometryHandler } from "../../geometry3d/GeometryHandler";
11
+ import { Plane3dByOriginAndUnitNormal } from "../../geometry3d/Plane3dByOriginAndUnitNormal";
12
+ import { Vector2d } from "../../geometry3d/Point2dVector2d";
13
+ import { Point3d, Vector3d } from "../../geometry3d/Point3dVector3d";
14
+ import { SmallSystem, TrigPolynomial } from "../../numerics/Polynomials";
15
+ import { Arc3d } from "../Arc3d";
16
+ import { CurveIntervalRole, CurveLocationDetail, CurveLocationDetailPair } from "../CurveLocationDetail";
17
+ import { LineSegment3d } from "../LineSegment3d";
18
+ import { LineString3d } from "../LineString3d";
20
19
  // cspell:word XYRR
21
20
  /**
22
21
  * Handler class for XYZ intersections between _geometryB and another geometry.
23
- * * **NOTE:** GeometryQuery input (_geometryB) should really be AnyCurve.
24
22
  * * Instances are initialized and called from CurveCurve.
25
23
  * * geometryB is saved for later reference.
26
24
  * @internal
27
25
  */
28
26
  class CurveCurveIntersectXYZ extends NullGeometryHandler {
29
- reinitialize() {
30
- this._results = new CurveLocationDetailArrayPair();
31
- }
32
27
  /**
33
28
  * @param extendA flag to enable using extension of the other geometry.
34
29
  * @param geometryB second curve for intersection. Saved for reference by specific handler methods.
@@ -39,16 +34,16 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
39
34
  this._extendA = extendA;
40
35
  this._geometryB = geometryB;
41
36
  this._extendB = extendB;
42
- this.reinitialize();
37
+ this._results = [];
43
38
  }
44
39
  /**
45
- * * Return the results structure for the intersection calculation.
40
+ * Return the results structure for the intersection calculation, structured as an array of CurveLocationDetailPair.
46
41
  * @param reinitialize if true, a new results structure is created for use by later calls.
47
42
  */
48
- grabResults(reinitialize = false) {
43
+ grabPairedResults(reinitialize = false) {
49
44
  const result = this._results;
50
45
  if (reinitialize)
51
- this.reinitialize();
46
+ this._results = [];
52
47
  return result;
53
48
  }
54
49
  acceptFraction(extend0, fraction, extend1) {
@@ -64,15 +59,14 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
64
59
  * Reject if evaluated points do not match coordinates (e.g. close approach point).
65
60
  * Record with fraction mapping.
66
61
  */
67
- recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, // Computed intersection fraction
68
- cpB, fractionB0, fractionB1, reversed) {
62
+ recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, cpB, fractionB0, fractionB1, reversed) {
69
63
  const globalFractionA = Geometry.interpolate(fractionA0, localFractionA, fractionA1);
70
64
  const globalFractionB = Geometry.interpolate(fractionB0, localFractionB, fractionB1);
71
65
  // ignore duplicate of most recent point . ..
72
- const numPrevious = this._results.dataA.length;
66
+ const numPrevious = this._results.length;
73
67
  if (numPrevious > 0) {
74
- const topFractionA = this._results.dataA[numPrevious - 1].fraction;
75
- const topFractionB = this._results.dataB[numPrevious - 1].fraction;
68
+ const topFractionA = this._results[numPrevious - 1].detailA.fraction;
69
+ const topFractionB = this._results[numPrevious - 1].detailB.fraction;
76
70
  if (reversed) {
77
71
  if (Geometry.isAlmostEqualNumber(topFractionA, globalFractionB) &&
78
72
  Geometry.isAlmostEqualNumber(topFractionB, globalFractionA))
@@ -93,12 +87,12 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
93
87
  const detailB = CurveLocationDetail.createCurveFractionPoint(cpB, globalFractionB, pointB);
94
88
  detailB.setIntervalRole(CurveIntervalRole.isolated);
95
89
  if (reversed) {
96
- this._results.dataA.push(detailB);
97
- this._results.dataB.push(detailA);
90
+ const pair = new CurveLocationDetailPair(detailB, detailA);
91
+ this._results.push(pair);
98
92
  }
99
93
  else {
100
- this._results.dataA.push(detailA);
101
- this._results.dataB.push(detailB);
94
+ const pair = new CurveLocationDetailPair(detailA, detailB);
95
+ this._results.push(pair);
102
96
  }
103
97
  }
104
98
  /**
@@ -114,8 +108,8 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
114
108
  }
115
109
  }
116
110
  // Caller accesses data from a line segment and passes to here.
117
- // (The line segment in question might be (a) a full line segment or (b) a fragment within a linestring. The fraction and extend parameters
118
- // allow all combinations to be passed in)
111
+ // The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
112
+ // The fraction and extend parameters allow all combinations to be passed in.
119
113
  // This method applies transform.
120
114
  dispatchSegmentSegment(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
121
115
  this.computeSegmentSegment3D(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed);
@@ -130,7 +124,7 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
130
124
  * @param origin plane origin
131
125
  * @param vectorA vector which must be in the plane.
132
126
  * @param cosineValue largest cosine of the angle theta between vectorA and vectorB to prefer their cross product, e.g.
133
- * passing 0.94 ~ cos(20deg) will switch to using vectorC in the cross product if theta < ~20deg or theta > ~160deg.
127
+ * passing 0.94 ~ cos(20deg) will switch to using vectorC in the cross product if theta < ~20deg or theta > ~160deg.
134
128
  * @param vectorB first candidate for additional in-plane vector
135
129
  * @param vectorC second candidate for additional in-plane vector
136
130
  */
@@ -145,8 +139,8 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
145
139
  return undefined;
146
140
  }
147
141
  // Caller accesses data from a linestring or segment and passes it here.
148
- // (The line segment in question might be (a) a full line segment or (b) a fragment within a linestring. The fraction and extend parameters
149
- // allow all combinations to be passed in)
142
+ // The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
143
+ // The fraction and extend parameters allow all combinations to be passed in.
150
144
  dispatchSegmentArc(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, arc, extendB0, extendB1, reversed) {
151
145
  const lineVector = Vector3d.createStartEnd(pointA0, pointA1);
152
146
  const plane = this.createPlaneWithPreferredPerpendicular(pointA0, lineVector, 0.94, arc.perpendicularVector, arc.vector0);
@@ -181,7 +175,7 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
181
175
  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);
182
176
  for (let i = 0; i < ellipseRadians.length; i++) {
183
177
  const fractionA = cpA.sweep.radiansToSignedPeriodicFraction(circleRadians[i]);
184
- const fractionB = cpA.sweep.radiansToSignedPeriodicFraction(ellipseRadians[i]);
178
+ const fractionB = cpB.sweep.radiansToSignedPeriodicFraction(ellipseRadians[i]);
185
179
  // hm .. do we really need to check the fractions? We know they are internal to the beziers
186
180
  if (this.acceptFraction(extendA, fractionA, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {
187
181
  this.recordPointWithLocalFractions(fractionA, cpA, 0, 1, fractionB, cpB, 0, 1, reversed);
@@ -190,13 +184,13 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
190
184
  }
191
185
  }
192
186
  // Caller accesses data from two arcs.
193
- // Selects the best conditioned arc (in xy parts) as "circle after inversion"
194
- // Solves the arc-arc equations
187
+ // Selects the best conditioned arc (in xy parts) as "circle after inversion".
188
+ // Solves the arc-arc equations.
195
189
  dispatchArcArc(cpA, extendA, cpB, extendB, reversed) {
196
190
  // If arcs are in different planes:
197
191
  // 1) Intersect each plane with the other arc (quadratic)
198
192
  // 2) accept points that appear in both intersection sets.
199
- // If arcs are in parallel planes -- no intersections
193
+ // If arcs are in parallel planes -- no intersections.
200
194
  // If arcs are in the same plane -- xy intersection in that plane.
201
195
  const planeA = Plane3dByOriginAndUnitNormal.create(cpA.center, cpA.perpendicularVector);
202
196
  const planeB = Plane3dByOriginAndUnitNormal.create(cpB.center, cpB.perpendicularVector);
@@ -204,7 +198,7 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
204
198
  return;
205
199
  if (planeA.getNormalRef().isParallelTo(planeB.getNormalRef())) {
206
200
  if (planeA.isPointInPlane(planeB.getOriginRef()) && planeB.isPointInPlane(planeA.getOriginRef())) {
207
- // coplanar !!!
201
+ // coplanar
208
202
  this.dispatchArcArcInPlane(cpA, extendA, cpB, extendB, reversed);
209
203
  }
210
204
  }
@@ -226,8 +220,8 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
226
220
  }
227
221
  }
228
222
  // Caller accesses data from two arcs.
229
- // Selects the best conditioned arc (in xy parts) as "circle after inversion"
230
- // Solves the arc-arc equations
223
+ // Selects the best conditioned arc (in xy parts) as "circle after inversion".
224
+ // Solves the arc-arc equations.
231
225
  dispatchArcBsplineCurve3d(_arc, _extendA, _cpB, _extendB, _reversed) {
232
226
  /*
233
227
  // Arc: X = C + cU + sV
@@ -235,7 +229,9 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
235
229
  let matrixA: Matrix3d;
236
230
  if (this._worldToLocalPerspective) {
237
231
  const dataA = cpA.toTransformedPoint4d(this._worldToLocalPerspective);
238
- matrixA = Matrix3d.createColumnsXYW(dataA.vector0, dataA.vector0.w, dataA.vector90, dataA.vector90.w, dataA.center, dataA.center.w);
232
+ matrixA = Matrix3d.createColumnsXYW(
233
+ dataA.vector0, dataA.vector0.w, dataA.vector90, dataA.vector90.w, dataA.center, dataA.center.w,
234
+ );
239
235
  } else {
240
236
  const dataA = cpA.toTransformedVectors(this._worldToLocalAffine);
241
237
  matrixA = Matrix3d.createColumnsXYW(dataA.vector0, 0, dataA.vector90, 0, dataA.center, 1);
@@ -247,12 +243,21 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
247
243
  const matrixAInverse = matrixA.inverse();
248
244
  if (matrixAInverse) {
249
245
  const orderF = cpB.order; // order of the beziers for simple coordinates
250
- const orderG = 2 * orderF - 1; // order of the (single) bezier for squared coordinates.
246
+ const orderG = 2 * orderF - 1; // order of the (single) bezier for squared coordinates.
251
247
  const coffF = new Float64Array(orderF);
252
248
  const univariateBezierG = new UnivariateBezier(orderG);
253
- const axx = matrixAInverse.at(0, 0); const axy = matrixAInverse.at(0, 1); const axz = 0.0; const axw = matrixAInverse.at(0, 2);
254
- const ayx = matrixAInverse.at(1, 0); const ayy = matrixAInverse.at(1, 1); const ayz = 0.0; const ayw = matrixAInverse.at(1, 2);
255
- const awx = matrixAInverse.at(2, 0); const awy = matrixAInverse.at(2, 1); const awz = 0.0; const aww = matrixAInverse.at(2, 2);
249
+ const axx = matrixAInverse.at(0, 0);
250
+ const axy = matrixAInverse.at(0, 1);
251
+ const axz = 0.0;
252
+ const axw = matrixAInverse.at(0, 2);
253
+ const ayx = matrixAInverse.at(1, 0);
254
+ const ayy = matrixAInverse.at(1, 1);
255
+ const ayz = 0.0;
256
+ const ayw = matrixAInverse.at(1, 2);
257
+ const awx = matrixAInverse.at(2, 0);
258
+ const awy = matrixAInverse.at(2, 1);
259
+ const awz = 0.0;
260
+ const aww = matrixAInverse.at(2, 2);
256
261
 
257
262
  if (matrixAInverse) {
258
263
  let bezier: BezierCurve3dH | undefined;
@@ -279,9 +284,11 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
279
284
  const c = bcurvePoint4d.dotProductXYZW(axx, axy, axz, axw);
280
285
  const s = bcurvePoint4d.dotProductXYZW(ayx, ayy, ayz, ayw);
281
286
  const arcFraction = cpA.sweep.radiansToSignedPeriodicFraction(Math.atan2(s, c));
282
- if (this.acceptFraction(extendA, arcFraction, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {
283
- this.recordPointWithLocalFractions(arcFraction, cpA, 0, 1,
284
- fractionB, cpB, 0, 1, reversed);
287
+ if (this.acceptFraction(extendA, arcFraction, extendA) &&
288
+ this.acceptFraction(extendB, fractionB, extendB)) {
289
+ this.recordPointWithLocalFractions(
290
+ arcFraction, cpA, 0, 1, fractionB, cpB, 0, 1, reversed,
291
+ );
285
292
  }
286
293
  }
287
294
  }
@@ -291,8 +298,8 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
291
298
  */
292
299
  }
293
300
  /*
294
- // apply the transformation to bezier curves. optionally construct ranges.
295
- private transformBeziers(beziers: BezierCurve3dH[]) {
301
+ // Apply the transformation to bezier curves. Optionally construct ranges.
302
+ private transformBeziers(beziers: BezierCurve3dH[]): void {
296
303
  if (this._worldToLocalAffine) {
297
304
  for (const bezier of beziers) bezier.tryTransformInPlace(this._worldToLocalAffine);
298
305
  } else if (this._worldToLocalPerspective) {
@@ -309,11 +316,6 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
309
316
  }
310
317
  return ranges;
311
318
  }
312
- private _xyzwA0?: Point4d;
313
- private _xyzwA1?: Point4d;
314
- private _xyzwPlane?: Point4d;
315
- private _xyzwB?: Point4d;
316
-
317
319
  private dispatchBezierBezierStrokeFirst(
318
320
  bezierA: BezierCurve3dH,
319
321
  bcurveA: BSplineCurve3dBase,
@@ -322,11 +324,16 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
322
324
  bcurveB: BSplineCurve3dBase,
323
325
  _strokeCountB: number,
324
326
  univariateBezierB: UnivariateBezier, // caller-allocated for univariate coefficients.
325
- reversed: boolean) {
326
- if (!this._xyzwA0) this._xyzwA0 = Point4d.create();
327
- if (!this._xyzwA1) this._xyzwA1 = Point4d.create();
328
- if (!this._xyzwPlane) this._xyzwPlane = Point4d.create();
329
- if (!this._xyzwB) this._xyzwB = Point4d.create();
327
+ reversed: boolean,
328
+ ) {
329
+ if (!this._xyzwA0)
330
+ this._xyzwA0 = Point4d.create();
331
+ if (!this._xyzwA1)
332
+ this._xyzwA1 = Point4d.create();
333
+ if (!this._xyzwPlane)
334
+ this._xyzwPlane = Point4d.create();
335
+ if (!this._xyzwB)
336
+ this._xyzwB = Point4d.create();
330
337
  const roots = univariateBezierG.roots(0.0, true);
331
338
  if (roots) {
332
339
  for (const root of roots) {
@@ -337,8 +344,9 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
337
344
  const s = bcurvePoint4d.dotProductXYZW(ayx, ayy, ayz, ayw);
338
345
  const arcFraction = cpA.sweep.radiansToSignedPeriodicFraction(Math.atan2(s, c));
339
346
  if (this.acceptFraction(extendA, arcFraction, extendA) && this.acceptFraction(extendB, fractionB, extendB)) {
340
- this.recordPointWithLocalFractions(arcFraction, cpA, 0, 1,
341
- fractionB, cpB, 0, 1, reversed);
347
+ this.recordPointWithLocalFractions(
348
+ arcFraction, cpA, 0, 1, fractionB, cpB, 0, 1, reversed,
349
+ );
342
350
  }
343
351
  }
344
352
  bezierA.fractionToPoint4d(0.0, this._xyzwA0);
@@ -350,7 +358,9 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
350
358
  f1 = i * df;
351
359
  bezierA.fractionToPoint4d(f1, this._xyzwA1);
352
360
  Point4d.createPlanePointPointZ(this._xyzwA0, this._xyzwA1, this._xyzwPlane);
353
- bezierB.poleProductsXYZW(univariateBezierB.coffs, this._xyzwPlane.x, this._xyzwPlane.y, this._xyzwPlane.z, this._xyzwPlane.w);
361
+ bezierB.poleProductsXYZW(
362
+ univariateBezierB.coffs, this._xyzwPlane.x, this._xyzwPlane.y, this._xyzwPlane.z, this._xyzwPlane.w,
363
+ );
354
364
  let errors = 0;
355
365
  const roots = univariateBezierB.roots(0.0, true);
356
366
  if (roots)
@@ -360,7 +370,7 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
360
370
  const segmentAFraction = SmallSystem.lineSegment3dHXYClosestPointUnbounded(this._xyzwA0, this._xyzwA1, this._xyzwB);
361
371
  if (segmentAFraction && Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {
362
372
  const bezierAFraction = Geometry.interpolate(f0, segmentAFraction, f1);
363
- /*- TODO implement newton search
373
+ // TODO implement newton search
364
374
  const xyMatchingFunction = new BezierBezierIntersectionXYRRToRRD(bezierA, bezierB);
365
375
  const newtonSearcher = new Newton2dUnboundedWithDerivative(xyMatchingFunction);
366
376
  newtonSearcher.setUV(bezierAFraction, bezierBFraction);
@@ -385,9 +395,11 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
385
395
  errors++;
386
396
  if (errors > 0 && !xyzA1.isAlmostEqual(xyzB1))
387
397
  errors++;
388
- if (this.acceptFraction(false, bcurveAFraction, false) && this.acceptFraction(false, bcurveBFraction, false)) {
389
- this.recordPointWithLocalFractions(bcurveAFraction, bcurveA, 0, 1,
390
- bcurveBFraction, bcurveB, 0, 1, reversed);
398
+ if (this.acceptFraction(false, bcurveAFraction, false) &&
399
+ this.acceptFraction(false, bcurveBFraction, false)) {
400
+ this.recordPointWithLocalFractions(
401
+ bcurveAFraction, bcurveA, 0, 1, bcurveBFraction, bcurveB, 0, 1, reversed,
402
+ );
391
403
  }
392
404
  }
393
405
  }
@@ -395,8 +407,8 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
395
407
  }
396
408
  */
397
409
  // Caller accesses data from two arcs.
398
- // Selects the best conditioned arc (in xy parts) as "circle after inversion"
399
- // Solves the arc-arc equations
410
+ // Selects the best conditioned arc (in xy parts) as "circle after inversion".
411
+ // Solves the arc-arc equations.
400
412
  dispatchBSplineCurve3dBSplineCurve3d(_bcurveA, _bcurveB, _reversed) {
401
413
  /*
402
414
  const bezierSpanA = bcurveA.collectBezierSpans(true) as BezierCurve3dH[];
@@ -417,9 +429,13 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
417
429
  const strokeCountA = bezierSpanA[a].computeStrokeCountForOptions();
418
430
  const strokeCountB = bezierSpanB[b].computeStrokeCountForOptions();
419
431
  if (strokeCountA < strokeCountB)
420
- this.dispatchBezierBezierStrokeFirst(bezierSpanA[a], bcurveA, strokeCountA, bezierSpanB[b], bcurveB, strokeCountB, univariateCoffsB, !_reversed);
432
+ this.dispatchBezierBezierStrokeFirst(
433
+ bezierSpanA[a], bcurveA, strokeCountA, bezierSpanB[b], bcurveB, strokeCountB, univariateCoffsB, _reversed,
434
+ );
421
435
  else
422
- this.dispatchBezierBezierStrokeFirst(bezierSpanB[b], bcurveB, strokeCountB, bezierSpanA[a], bcurveA, strokeCountA, univariateCoffsA, _reversed);
436
+ this.dispatchBezierBezierStrokeFirst(
437
+ bezierSpanB[b], bcurveB, strokeCountB, bezierSpanA[a], bcurveA, strokeCountA, univariateCoffsA, !_reversed,
438
+ );
423
439
  }
424
440
  }
425
441
  }
@@ -427,9 +443,9 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
427
443
  }
428
444
  /*
429
445
  /**
430
- * Apply the projection transform (if any) to (xyz, w)
446
+ * Apply the projection transform (if any) to (xyz, w).
431
447
  * @param xyz xyz parts of input point.
432
- * @param w weight to use for homogeneous effects
448
+ * @param w weight to use for homogeneous effects.
433
449
  */
434
450
  /*
435
451
  private projectPoint(xyz: XYAndZ, w: number = 1.0): Point4d {
@@ -466,16 +482,19 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
466
482
  // NOW .. we have a plane in world space. Intersect it with the bspline:
467
483
  const intersections: CurveLocationDetail[] = [];
468
484
  bcurve.appendPlaneIntersectionPoints(planeCoffs, intersections);
469
- // intersections has WORLD points with bspline fractions. (The bspline fractions are all good 0..1 fractions within the spline.)
485
+ // intersections has WORLD points with bspline fractions.
486
+ // (the bspline fractions are all good 0..1 fractions within the spline).
470
487
  // accept those that are within the segment range.
471
488
  for (const detail of intersections) {
472
489
  const fractionB = detail.fraction;
473
490
  const curvePoint = detail.point;
474
491
  const curvePointH = this.projectPoint(curvePoint);
475
492
  const lineFraction = SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, curvePointH);
476
- if (lineFraction !== undefined && this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB, fractionB, extendB)) {
477
- this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1,
478
- fractionB, bcurve, 0, 1, reversed);
493
+ if (lineFraction !== undefined && this.acceptFraction(extendA0, lineFraction, extendA1) &&
494
+ this.acceptFraction(extendB, fractionB, extendB)) {
495
+ this.recordPointWithLocalFractions(
496
+ lineFraction, cpA, fractionA0, fractionA1, fractionB, bcurve, 0, 1, reversed,
497
+ );
479
498
  }
480
499
  }
481
500
  */
@@ -492,7 +511,7 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
492
511
  const pointA0 = CurveCurveIntersectXYZ._workPointA0;
493
512
  const pointA1 = CurveCurveIntersectXYZ._workPointA1;
494
513
  lsA.pointAt(0, pointA0);
495
- for (let iA = 1; iA < numA; iA++ , pointA0.setFrom(pointA1), fA0 = fA1) {
514
+ for (let iA = 1; iA < numA; iA++, pointA0.setFrom(pointA1), fA0 = fA1) {
496
515
  lsA.pointAt(iA, pointA1);
497
516
  fA1 = iA * dfA;
498
517
  this.dispatchSegmentBsplineCurve(
@@ -543,6 +562,38 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
543
562
  }
544
563
  return undefined;
545
564
  }
565
+ /** Detail computation for linestring intersecting linestring. */
566
+ computeLineStringLineString(lsA, lsB, reversed) {
567
+ const pointA0 = CurveCurveIntersectXYZ._workPointAA0;
568
+ const pointA1 = CurveCurveIntersectXYZ._workPointAA1;
569
+ const pointB0 = CurveCurveIntersectXYZ._workPointBB0;
570
+ const pointB1 = CurveCurveIntersectXYZ._workPointBB1;
571
+ const numA = lsA.numPoints();
572
+ const numB = lsB.numPoints();
573
+ if (numA > 1 && numB > 1) {
574
+ lsA.pointAt(0, pointA0);
575
+ const dfA = 1.0 / (numA - 1);
576
+ const dfB = 1.0 / (numB - 1);
577
+ let fA0 = 0.0;
578
+ let fB0;
579
+ let fA1;
580
+ let 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, reversed);
593
+ }
594
+ }
595
+ }
596
+ }
546
597
  /** Double dispatch handler for strongly typed segment. */
547
598
  handleLineSegment3d(segmentA) {
548
599
  if (this._geometryB instanceof LineSegment3d) {
@@ -558,38 +609,13 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
558
609
  else if (this._geometryB instanceof BSplineCurve3d) {
559
610
  this.dispatchSegmentBsplineCurve(segmentA, this._extendA, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA, this._geometryB, this._extendB, false);
560
611
  }
612
+ return undefined;
561
613
  }
562
- /** double dispatch handler for strongly typed linestring .. */
614
+ /** double dispatch handler for strongly typed linestring. */
563
615
  handleLineString3d(lsA) {
564
616
  if (this._geometryB instanceof LineString3d) {
565
617
  const lsB = this._geometryB;
566
- const pointA0 = CurveCurveIntersectXYZ._workPointAA0;
567
- const pointA1 = CurveCurveIntersectXYZ._workPointAA1;
568
- const pointB0 = CurveCurveIntersectXYZ._workPointBB0;
569
- const pointB1 = CurveCurveIntersectXYZ._workPointBB1;
570
- const numA = lsA.numPoints();
571
- const numB = lsB.numPoints();
572
- if (numA > 1 && numB > 1) {
573
- lsA.pointAt(0, pointA0);
574
- const dfA = 1.0 / (numA - 1);
575
- const dfB = 1.0 / (numB - 1);
576
- let fA0 = 0.0;
577
- let fA1, fB0, fB1;
578
- const extendA = this._extendA;
579
- const extendB = this._extendB;
580
- lsA.pointAt(0, pointA0);
581
- for (let ia = 1; ia < numA; ia++, pointA0.setFrom(pointA1), fA0 = fA1) {
582
- fA1 = ia * dfA;
583
- fB0 = 0.0;
584
- lsA.pointAt(ia, pointA1);
585
- lsB.pointAt(0, pointB0);
586
- for (let ib = 1; ib < numB; ib++, pointB0.setFrom(pointB1), fB0 = fB1) {
587
- lsB.pointAt(ib, pointB1);
588
- fB1 = ib * dfB;
589
- 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);
590
- }
591
- }
592
- }
618
+ this.computeLineStringLineString(lsA, lsB, false);
593
619
  }
594
620
  else if (this._geometryB instanceof LineSegment3d) {
595
621
  this.computeSegmentLineString(this._geometryB, this._extendB, lsA, this._extendA, true);
@@ -618,7 +644,7 @@ class CurveCurveIntersectXYZ extends NullGeometryHandler {
618
644
  }
619
645
  return undefined;
620
646
  }
621
- /** Double dispatch handler for strongly typed bspline curve.. */
647
+ /** Double dispatch handler for strongly typed bspline curve. */
622
648
  handleBSplineCurve3d(curve) {
623
649
  if (this._geometryB instanceof LineSegment3d) {
624
650
  this.dispatchSegmentBsplineCurve(this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB, curve, this._extendA, true);