@itwin/core-geometry 5.1.0-dev.4 → 5.1.0-dev.41

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 (470) hide show
  1. package/CHANGELOG.md +48 -1
  2. package/lib/cjs/Geometry.d.ts +12 -4
  3. package/lib/cjs/Geometry.d.ts.map +1 -1
  4. package/lib/cjs/Geometry.js +13 -3
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/bspline/BSpline1dNd.d.ts +1 -1
  7. package/lib/cjs/bspline/BSpline1dNd.js +1 -1
  8. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  9. package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
  10. package/lib/cjs/bspline/BSplineCurve.js +7 -1
  11. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  12. package/lib/cjs/bspline/BSplineSurface.d.ts +4 -3
  13. package/lib/cjs/bspline/BSplineSurface.d.ts.map +1 -1
  14. package/lib/cjs/bspline/BSplineSurface.js +6 -5
  15. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  16. package/lib/cjs/clipping/ClipPlane.d.ts +7 -5
  17. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  18. package/lib/cjs/clipping/ClipPlane.js +9 -5
  19. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  20. package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
  21. package/lib/cjs/clipping/ClipUtils.js +5 -3
  22. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  23. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +1 -2
  24. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  25. package/lib/cjs/clipping/ConvexClipPlaneSet.js +13 -25
  26. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  27. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +1 -2
  28. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  29. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +1 -2
  30. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  31. package/lib/cjs/core-geometry.d.ts +1 -0
  32. package/lib/cjs/core-geometry.d.ts.map +1 -1
  33. package/lib/cjs/core-geometry.js +1 -0
  34. package/lib/cjs/core-geometry.js.map +1 -1
  35. package/lib/cjs/curve/Arc3d.d.ts +54 -32
  36. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  37. package/lib/cjs/curve/Arc3d.js +56 -37
  38. package/lib/cjs/curve/Arc3d.js.map +1 -1
  39. package/lib/cjs/curve/CurveCollection.d.ts +33 -1
  40. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  41. package/lib/cjs/curve/CurveCollection.js +79 -0
  42. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  43. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  44. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  45. package/lib/cjs/curve/CurveLocationDetail.d.ts +25 -25
  46. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  47. package/lib/cjs/curve/CurveLocationDetail.js +25 -25
  48. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  49. package/lib/cjs/curve/CurvePrimitive.d.ts +2 -2
  50. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  51. package/lib/cjs/curve/CurveTypes.d.ts +1 -1
  52. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  53. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  54. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +10 -5
  55. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  56. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +9 -5
  57. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  58. package/lib/cjs/curve/Query/PlanarSubdivision.js +27 -11
  59. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  60. package/lib/cjs/curve/RegionMomentsXY.d.ts +1 -0
  61. package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
  62. package/lib/cjs/curve/RegionMomentsXY.js +21 -39
  63. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  64. package/lib/cjs/curve/RegionOps.d.ts +55 -29
  65. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  66. package/lib/cjs/curve/RegionOps.js +96 -35
  67. package/lib/cjs/curve/RegionOps.js.map +1 -1
  68. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +27 -26
  69. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  70. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +70 -54
  71. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  72. package/lib/cjs/curve/StrokeOptions.d.ts +1 -1
  73. package/lib/cjs/curve/StrokeOptions.js +1 -1
  74. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  75. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  76. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +0 -1
  77. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  78. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +58 -32
  79. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  80. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  81. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +0 -1
  82. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  83. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.d.ts +14 -0
  84. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.d.ts.map +1 -0
  85. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js +34 -0
  86. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -0
  87. package/lib/cjs/geometry3d/AngleSweep.d.ts +24 -17
  88. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  89. package/lib/cjs/geometry3d/AngleSweep.js +31 -17
  90. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  91. package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts +8 -7
  92. package/lib/cjs/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
  93. package/lib/cjs/geometry3d/CoincidentGeometryOps.js +19 -25
  94. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  95. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
  96. package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
  97. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  98. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +7 -2
  99. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  100. package/lib/cjs/geometry3d/GrowableXYZArray.js +20 -2
  101. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  102. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +2 -1
  103. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  104. package/lib/cjs/geometry3d/IndexedXYZCollection.js +7 -3
  105. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  106. package/lib/cjs/geometry3d/Plane3d.d.ts +2 -0
  107. package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -1
  108. package/lib/cjs/geometry3d/Plane3d.js +6 -1
  109. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  110. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
  111. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  112. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
  113. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  114. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
  115. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  116. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +18 -10
  117. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  118. package/lib/cjs/geometry3d/Point2dVector2d.d.ts.map +1 -1
  119. package/lib/cjs/geometry3d/Point2dVector2d.js +0 -2
  120. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  121. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +4 -4
  122. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  123. package/lib/cjs/geometry3d/Point3dVector3d.js +4 -5
  124. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  125. package/lib/cjs/geometry3d/PointHelpers.d.ts +7 -7
  126. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  127. package/lib/cjs/geometry3d/PointHelpers.js +66 -26
  128. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  129. package/lib/cjs/geometry3d/PolygonOps.d.ts +49 -2
  130. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  131. package/lib/cjs/geometry3d/PolygonOps.js +38 -2
  132. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  133. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
  134. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
  135. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
  136. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  137. package/lib/cjs/geometry3d/PolylineOps.d.ts +5 -4
  138. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  139. package/lib/cjs/geometry3d/PolylineOps.js +5 -4
  140. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  141. package/lib/cjs/geometry3d/Range.d.ts +18 -10
  142. package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
  143. package/lib/cjs/geometry3d/Range.js +32 -10
  144. package/lib/cjs/geometry3d/Range.js.map +1 -1
  145. package/lib/cjs/geometry3d/Ray2d.d.ts.map +1 -1
  146. package/lib/cjs/geometry3d/Ray2d.js +0 -1
  147. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  148. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  149. package/lib/cjs/geometry3d/Ray3d.js +11 -23
  150. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  151. package/lib/cjs/geometry3d/Transform.d.ts +21 -2
  152. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  153. package/lib/cjs/geometry3d/Transform.js +32 -13
  154. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  155. package/lib/cjs/geometry4d/Point4d.d.ts +8 -5
  156. package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
  157. package/lib/cjs/geometry4d/Point4d.js +27 -16
  158. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  159. package/lib/cjs/numerics/BezierPolynomials.d.ts +2 -0
  160. package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
  161. package/lib/cjs/numerics/BezierPolynomials.js +11 -0
  162. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  163. package/lib/cjs/numerics/SmallSystem.d.ts +77 -36
  164. package/lib/cjs/numerics/SmallSystem.d.ts.map +1 -1
  165. package/lib/cjs/numerics/SmallSystem.js +129 -73
  166. package/lib/cjs/numerics/SmallSystem.js.map +1 -1
  167. package/lib/cjs/polyface/FacetOrientation.d.ts +1 -1
  168. package/lib/cjs/polyface/FacetOrientation.js +1 -1
  169. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  170. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +55 -40
  171. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  172. package/lib/cjs/polyface/IndexedEdgeMatcher.js +83 -75
  173. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  174. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
  175. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  176. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +47 -38
  177. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  178. package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts +26 -19
  179. package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
  180. package/lib/cjs/polyface/IndexedPolyfaceWalker.js +47 -32
  181. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
  182. package/lib/cjs/polyface/Polyface.d.ts +19 -5
  183. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  184. package/lib/cjs/polyface/Polyface.js +18 -2
  185. package/lib/cjs/polyface/Polyface.js.map +1 -1
  186. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +1 -1
  187. package/lib/cjs/polyface/PolyfaceBuilder.js +3 -3
  188. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  189. package/lib/cjs/polyface/PolyfaceClip.d.ts +19 -18
  190. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  191. package/lib/cjs/polyface/PolyfaceClip.js +39 -42
  192. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  193. package/lib/cjs/polyface/PolyfaceData.d.ts +1 -1
  194. package/lib/cjs/polyface/PolyfaceData.js +1 -1
  195. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  196. package/lib/cjs/polyface/PolyfaceQuery.d.ts +119 -78
  197. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  198. package/lib/cjs/polyface/PolyfaceQuery.js +315 -231
  199. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  200. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
  201. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
  202. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +3 -3
  203. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  204. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
  205. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  206. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
  207. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  208. package/lib/cjs/serialization/GeometrySamples.d.ts +1 -1
  209. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  210. package/lib/cjs/serialization/GeometrySamples.js +3 -3
  211. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  212. package/lib/cjs/serialization/IModelJsonSchema.d.ts +3 -3
  213. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  214. package/lib/cjs/solid/LinearSweep.d.ts +2 -3
  215. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  216. package/lib/cjs/solid/LinearSweep.js +2 -3
  217. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  218. package/lib/cjs/solid/RotationalSweep.d.ts +2 -2
  219. package/lib/cjs/solid/RotationalSweep.js +2 -2
  220. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  221. package/lib/cjs/topology/ChainMerge.d.ts +1 -1
  222. package/lib/cjs/topology/ChainMerge.js +1 -1
  223. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  224. package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +1 -0
  225. package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  226. package/lib/cjs/topology/HalfEdgeGraphSearch.js +1 -0
  227. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  228. package/lib/cjs/topology/Merging.d.ts +0 -1
  229. package/lib/cjs/topology/Merging.d.ts.map +1 -1
  230. package/lib/cjs/topology/Merging.js +49 -46
  231. package/lib/cjs/topology/Merging.js.map +1 -1
  232. package/lib/cjs/topology/Triangulation.d.ts +9 -14
  233. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  234. package/lib/cjs/topology/Triangulation.js +29 -22
  235. package/lib/cjs/topology/Triangulation.js.map +1 -1
  236. package/lib/esm/Geometry.d.ts +12 -4
  237. package/lib/esm/Geometry.d.ts.map +1 -1
  238. package/lib/esm/Geometry.js +13 -3
  239. package/lib/esm/Geometry.js.map +1 -1
  240. package/lib/esm/bspline/BSpline1dNd.d.ts +1 -1
  241. package/lib/esm/bspline/BSpline1dNd.js +1 -1
  242. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  243. package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
  244. package/lib/esm/bspline/BSplineCurve.js +7 -1
  245. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  246. package/lib/esm/bspline/BSplineSurface.d.ts +4 -3
  247. package/lib/esm/bspline/BSplineSurface.d.ts.map +1 -1
  248. package/lib/esm/bspline/BSplineSurface.js +6 -5
  249. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  250. package/lib/esm/clipping/ClipPlane.d.ts +7 -5
  251. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  252. package/lib/esm/clipping/ClipPlane.js +9 -5
  253. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  254. package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
  255. package/lib/esm/clipping/ClipUtils.js +5 -3
  256. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  257. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +1 -2
  258. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  259. package/lib/esm/clipping/ConvexClipPlaneSet.js +13 -25
  260. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  261. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +1 -2
  262. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  263. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +1 -2
  264. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  265. package/lib/esm/core-geometry.d.ts +1 -0
  266. package/lib/esm/core-geometry.d.ts.map +1 -1
  267. package/lib/esm/core-geometry.js +1 -0
  268. package/lib/esm/core-geometry.js.map +1 -1
  269. package/lib/esm/curve/Arc3d.d.ts +54 -32
  270. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  271. package/lib/esm/curve/Arc3d.js +56 -37
  272. package/lib/esm/curve/Arc3d.js.map +1 -1
  273. package/lib/esm/curve/CurveCollection.d.ts +33 -1
  274. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  275. package/lib/esm/curve/CurveCollection.js +79 -0
  276. package/lib/esm/curve/CurveCollection.js.map +1 -1
  277. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  278. package/lib/esm/curve/CurveFactory.js.map +1 -1
  279. package/lib/esm/curve/CurveLocationDetail.d.ts +25 -25
  280. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  281. package/lib/esm/curve/CurveLocationDetail.js +25 -25
  282. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  283. package/lib/esm/curve/CurvePrimitive.d.ts +2 -2
  284. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  285. package/lib/esm/curve/CurveTypes.d.ts +1 -1
  286. package/lib/esm/curve/CurveTypes.js.map +1 -1
  287. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  288. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +10 -5
  289. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  290. package/lib/esm/curve/Query/PlanarSubdivision.d.ts +9 -5
  291. package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  292. package/lib/esm/curve/Query/PlanarSubdivision.js +27 -11
  293. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  294. package/lib/esm/curve/RegionMomentsXY.d.ts +1 -0
  295. package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
  296. package/lib/esm/curve/RegionMomentsXY.js +21 -39
  297. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  298. package/lib/esm/curve/RegionOps.d.ts +55 -29
  299. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  300. package/lib/esm/curve/RegionOps.js +96 -35
  301. package/lib/esm/curve/RegionOps.js.map +1 -1
  302. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +27 -26
  303. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  304. package/lib/esm/curve/RegionOpsClassificationSweeps.js +70 -54
  305. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  306. package/lib/esm/curve/StrokeOptions.d.ts +1 -1
  307. package/lib/esm/curve/StrokeOptions.js +1 -1
  308. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  309. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  310. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +0 -1
  311. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  312. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +58 -32
  313. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  314. package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  315. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +0 -1
  316. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  317. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.d.ts +14 -0
  318. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.d.ts.map +1 -0
  319. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js +30 -0
  320. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -0
  321. package/lib/esm/geometry3d/AngleSweep.d.ts +24 -17
  322. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  323. package/lib/esm/geometry3d/AngleSweep.js +31 -17
  324. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  325. package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts +8 -7
  326. package/lib/esm/geometry3d/CoincidentGeometryOps.d.ts.map +1 -1
  327. package/lib/esm/geometry3d/CoincidentGeometryOps.js +19 -25
  328. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  329. package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
  330. package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
  331. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  332. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +7 -2
  333. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  334. package/lib/esm/geometry3d/GrowableXYZArray.js +20 -2
  335. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  336. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +2 -1
  337. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  338. package/lib/esm/geometry3d/IndexedXYZCollection.js +7 -3
  339. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  340. package/lib/esm/geometry3d/Plane3d.d.ts +2 -0
  341. package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -1
  342. package/lib/esm/geometry3d/Plane3d.js +6 -1
  343. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  344. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +2 -0
  345. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  346. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +6 -1
  347. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  348. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +8 -2
  349. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  350. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +18 -10
  351. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  352. package/lib/esm/geometry3d/Point2dVector2d.d.ts.map +1 -1
  353. package/lib/esm/geometry3d/Point2dVector2d.js +0 -2
  354. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  355. package/lib/esm/geometry3d/Point3dVector3d.d.ts +4 -4
  356. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  357. package/lib/esm/geometry3d/Point3dVector3d.js +4 -5
  358. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  359. package/lib/esm/geometry3d/PointHelpers.d.ts +7 -7
  360. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  361. package/lib/esm/geometry3d/PointHelpers.js +66 -26
  362. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  363. package/lib/esm/geometry3d/PolygonOps.d.ts +49 -2
  364. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  365. package/lib/esm/geometry3d/PolygonOps.js +38 -2
  366. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  367. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts +13 -6
  368. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.d.ts.map +1 -1
  369. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +16 -9
  370. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  371. package/lib/esm/geometry3d/PolylineOps.d.ts +5 -4
  372. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  373. package/lib/esm/geometry3d/PolylineOps.js +5 -4
  374. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  375. package/lib/esm/geometry3d/Range.d.ts +18 -10
  376. package/lib/esm/geometry3d/Range.d.ts.map +1 -1
  377. package/lib/esm/geometry3d/Range.js +32 -10
  378. package/lib/esm/geometry3d/Range.js.map +1 -1
  379. package/lib/esm/geometry3d/Ray2d.d.ts.map +1 -1
  380. package/lib/esm/geometry3d/Ray2d.js +0 -1
  381. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  382. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  383. package/lib/esm/geometry3d/Ray3d.js +11 -23
  384. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  385. package/lib/esm/geometry3d/Transform.d.ts +21 -2
  386. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  387. package/lib/esm/geometry3d/Transform.js +32 -13
  388. package/lib/esm/geometry3d/Transform.js.map +1 -1
  389. package/lib/esm/geometry4d/Point4d.d.ts +8 -5
  390. package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
  391. package/lib/esm/geometry4d/Point4d.js +27 -16
  392. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  393. package/lib/esm/numerics/BezierPolynomials.d.ts +2 -0
  394. package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
  395. package/lib/esm/numerics/BezierPolynomials.js +11 -0
  396. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  397. package/lib/esm/numerics/SmallSystem.d.ts +77 -36
  398. package/lib/esm/numerics/SmallSystem.d.ts.map +1 -1
  399. package/lib/esm/numerics/SmallSystem.js +129 -73
  400. package/lib/esm/numerics/SmallSystem.js.map +1 -1
  401. package/lib/esm/polyface/FacetOrientation.d.ts +1 -1
  402. package/lib/esm/polyface/FacetOrientation.js +1 -1
  403. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  404. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +55 -40
  405. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  406. package/lib/esm/polyface/IndexedEdgeMatcher.js +83 -75
  407. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  408. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +15 -14
  409. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  410. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +47 -38
  411. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  412. package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts +26 -19
  413. package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -1
  414. package/lib/esm/polyface/IndexedPolyfaceWalker.js +47 -32
  415. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
  416. package/lib/esm/polyface/Polyface.d.ts +19 -5
  417. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  418. package/lib/esm/polyface/Polyface.js +18 -2
  419. package/lib/esm/polyface/Polyface.js.map +1 -1
  420. package/lib/esm/polyface/PolyfaceBuilder.d.ts +1 -1
  421. package/lib/esm/polyface/PolyfaceBuilder.js +3 -3
  422. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  423. package/lib/esm/polyface/PolyfaceClip.d.ts +19 -18
  424. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  425. package/lib/esm/polyface/PolyfaceClip.js +39 -42
  426. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  427. package/lib/esm/polyface/PolyfaceData.d.ts +1 -1
  428. package/lib/esm/polyface/PolyfaceData.js +1 -1
  429. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  430. package/lib/esm/polyface/PolyfaceQuery.d.ts +119 -78
  431. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  432. package/lib/esm/polyface/PolyfaceQuery.js +316 -232
  433. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  434. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +3 -3
  435. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -1
  436. package/lib/esm/polyface/RangeTree/RangeTreeNode.js +3 -3
  437. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  438. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +7 -6
  439. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  440. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +8 -9
  441. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  442. package/lib/esm/serialization/GeometrySamples.d.ts +1 -1
  443. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  444. package/lib/esm/serialization/GeometrySamples.js +3 -3
  445. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  446. package/lib/esm/serialization/IModelJsonSchema.d.ts +3 -3
  447. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  448. package/lib/esm/solid/LinearSweep.d.ts +2 -3
  449. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  450. package/lib/esm/solid/LinearSweep.js +2 -3
  451. package/lib/esm/solid/LinearSweep.js.map +1 -1
  452. package/lib/esm/solid/RotationalSweep.d.ts +2 -2
  453. package/lib/esm/solid/RotationalSweep.js +2 -2
  454. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  455. package/lib/esm/topology/ChainMerge.d.ts +1 -1
  456. package/lib/esm/topology/ChainMerge.js +1 -1
  457. package/lib/esm/topology/ChainMerge.js.map +1 -1
  458. package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +1 -0
  459. package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  460. package/lib/esm/topology/HalfEdgeGraphSearch.js +1 -0
  461. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  462. package/lib/esm/topology/Merging.d.ts +0 -1
  463. package/lib/esm/topology/Merging.d.ts.map +1 -1
  464. package/lib/esm/topology/Merging.js +49 -46
  465. package/lib/esm/topology/Merging.js.map +1 -1
  466. package/lib/esm/topology/Triangulation.d.ts +9 -14
  467. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  468. package/lib/esm/topology/Triangulation.js +29 -22
  469. package/lib/esm/topology/Triangulation.js.map +1 -1
  470. package/package.json +3 -3
@@ -12,7 +12,6 @@ import { CoincidentGeometryQuery } from "../../geometry3d/CoincidentGeometryOps"
12
12
  import { RecurseToCurvesGeometryHandler } from "../../geometry3d/GeometryHandler";
13
13
  import { GrowableFloat64Array } from "../../geometry3d/GrowableFloat64Array";
14
14
  import { Matrix3d } from "../../geometry3d/Matrix3d";
15
- import { Vector2d } from "../../geometry3d/Point2dVector2d";
16
15
  import { Point3d } from "../../geometry3d/Point3dVector3d";
17
16
  import { Point4d } from "../../geometry4d/Point4d";
18
17
  import { UnivariateBezier } from "../../numerics/BezierPolynomials";
@@ -44,7 +43,6 @@ export class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandler {
44
43
  _worldToLocalPerspective;
45
44
  _worldToLocalAffine;
46
45
  _coincidentGeometryContext;
47
- static _workVector2dA = Vector2d.create();
48
46
  static _workPointA0H = Point4d.create();
49
47
  static _workPointA1H = Point4d.create();
50
48
  static _workPointB0H = Point4d.create();
@@ -196,21 +194,25 @@ export class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandler {
196
194
  }
197
195
  /** Compute intersection of two line segments. Filter by extension rules. Record with fraction mapping. */
198
196
  computeSegmentSegment3D(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
199
- const uv = CurveCurveIntersectXY._workVector2dA;
200
- // Problem: Normal practice is to do the (quick, simple) transverse intersection first
201
- // But the transverse intersector notion of coincidence is based on the determinant ratios, which are hard
202
- // to relate to physical tolerance.
203
- // So do the overlap first. This should do a quick exit in non-coincident case.
204
- const overlap = this._coincidentGeometryContext.coincidentSegmentRangeXY(pointA0, pointA1, pointB0, pointB1, false);
205
- if (overlap) { // the lines are coincident
206
- if (this._coincidentGeometryContext.clampCoincidentOverlapToSegmentBounds(overlap, pointA0, pointA1, pointB0, pointB1, extendA0, extendA1, extendB0, extendB1)) {
197
+ const aDir = { x: pointA1.x - pointA0.x, y: pointA1.y - pointA0.y };
198
+ const bDir = { x: pointB1.x - pointB0.x, y: pointB1.y - pointB0.y };
199
+ const tol = this._coincidentGeometryContext.tolerance;
200
+ const fractions = SmallSystem.lineSegmentXYUVIntersectionUnbounded(pointA0, aDir, pointB0, bDir, tol);
201
+ if (!fractions)
202
+ return;
203
+ if (fractions.f1) { // the lines are coincident
204
+ const detailA = CurveLocationDetail.createCurveFractionPoint(undefined, fractions.f0.x, pointA0.interpolate(fractions.f0.x, pointA1));
205
+ detailA.captureFraction1Point1(fractions.f1.x, pointA0.interpolate(fractions.f1.x, pointA1));
206
+ const detailB = CurveLocationDetail.createCurveFractionPoint(undefined, fractions.f0.y, pointB0.interpolate(fractions.f0.y, pointB1));
207
+ detailB.captureFraction1Point1(fractions.f1.y, pointB0.interpolate(fractions.f1.y, pointB1));
208
+ const overlap = CurveLocationDetailPair.createCapture(detailA, detailB);
209
+ if (this._coincidentGeometryContext.clampCoincidentOverlapToSegmentBounds(overlap, pointA0, pointA1, pointB0, pointB1, extendA0, extendA1, extendB0, extendB1))
207
210
  this.recordPointWithLocalFractions(overlap.detailA.fraction, cpA, fractionA0, fractionA1, overlap.detailB.fraction, cpB, fractionB0, fractionB1, reversed, overlap);
208
- }
209
211
  }
210
- else if (SmallSystem.lineSegment3dXYTransverseIntersectionUnbounded(pointA0, pointA1, pointB0, pointB1, uv)) {
211
- if (this.acceptFractionOnLine(extendA0, uv.x, extendA1, pointA0, pointA1, this._coincidentGeometryContext.tolerance) &&
212
- this.acceptFractionOnLine(extendB0, uv.y, extendB1, pointB0, pointB1, this._coincidentGeometryContext.tolerance)) {
213
- this.recordPointWithLocalFractions(uv.x, cpA, fractionA0, fractionA1, uv.y, cpB, fractionB0, fractionB1, reversed);
212
+ else { // the lines have a transverse intersection
213
+ if (this.acceptFractionOnLine(extendA0, fractions.f0.x, extendA1, pointA0, pointA1, tol)) {
214
+ if (this.acceptFractionOnLine(extendB0, fractions.f0.y, extendB1, pointB0, pointB1, tol))
215
+ this.recordPointWithLocalFractions(fractions.f0.x, cpA, fractionA0, fractionA1, fractions.f0.y, cpB, fractionB0, fractionB1, reversed);
214
216
  }
215
217
  }
216
218
  }
@@ -258,6 +260,8 @@ export class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandler {
258
260
  // The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
259
261
  // The fraction and extend parameters allow all combinations to be passed in.
260
262
  dispatchSegmentArc(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, arc, extendB0, extendB1, reversed) {
263
+ const tol2 = this._coincidentGeometryContext.tolerance * this._coincidentGeometryContext.tolerance;
264
+ let dist2;
261
265
  // Arc: X = C + cU + sV
262
266
  // Line: contains points A0,A1
263
267
  // Arc point colinear with line if det (A0, A1, X) = 0
@@ -268,6 +272,10 @@ export class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandler {
268
272
  // project back to line.
269
273
  if (this._worldToLocalPerspective) {
270
274
  const data = arc.toTransformedPoint4d(this._worldToLocalPerspective);
275
+ const radians0 = data.sweep.fractionToRadians(0);
276
+ const pointB0H = data.center.plus2Scaled(data.vector0, Math.cos(radians0), data.vector90, Math.sin(radians0));
277
+ const radians1 = data.sweep.fractionToRadians(1);
278
+ const pointB1H = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
271
279
  const pointA0H = this._worldToLocalPerspective.multiplyPoint3d(pointA0, 1);
272
280
  const pointA1H = this._worldToLocalPerspective.multiplyPoint3d(pointA1, 1);
273
281
  const alpha = Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.center);
@@ -277,19 +285,31 @@ export class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandler {
277
285
  const sines = new GrowableFloat64Array(2);
278
286
  const radians = new GrowableFloat64Array(2);
279
287
  const numRoots = AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
288
+ if (numRoots <= 0)
289
+ return;
280
290
  for (let i = 0; i < numRoots; i++) {
281
291
  const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
282
- const arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
292
+ let arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
283
293
  const lineFraction = SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, arcPoint);
284
- if (lineFraction !== undefined &&
285
- this.acceptFraction(extendA0, lineFraction, extendA1) &&
286
- this.acceptFraction(extendB0, arcFraction, extendB1)) {
287
- this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
294
+ if (lineFraction !== undefined) {
295
+ if (this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB0, arcFraction, extendB1)) {
296
+ this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
297
+ }
298
+ else { // check for endpoint intersections beyond parametric tolerance but within point tolerance
299
+ const pointAH = lineFraction < 0.5 ? pointA0H : pointA1H;
300
+ const pointBH = (arcFraction = data.sweep.fractionToSignedPeriodicFraction(arcFraction)) < 0.5 ? pointB0H : pointB1H;
301
+ if ((dist2 = pointAH.realDistanceSquaredXY(pointBH)) !== undefined && Geometry.isDistanceWithinTol(dist2, tol2))
302
+ this.recordPointWithLocalFractions(lineFraction < 0.5 ? 0 : 1, cpA, fractionA0, fractionA1, arcFraction < 0.5 ? 0 : 1, arc, 0, 1, reversed);
303
+ }
288
304
  }
289
305
  }
290
306
  }
291
307
  else {
292
308
  const data = arc.toTransformedVectors(this._worldToLocalAffine);
309
+ const radians0 = data.sweep.fractionToRadians(0);
310
+ const pointB0Local = data.center.plus2Scaled(data.vector0, Math.cos(radians0), data.vector90, Math.sin(radians0));
311
+ const radians1 = data.sweep.fractionToRadians(1);
312
+ const pointB1Local = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
293
313
  let pointA0Local = pointA0;
294
314
  let pointA1Local = pointA1;
295
315
  if (this._worldToLocalAffine) {
@@ -303,16 +323,22 @@ export class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandler {
303
323
  const sines = new GrowableFloat64Array(2);
304
324
  const radians = new GrowableFloat64Array(2);
305
325
  const numRoots = AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
306
- const lineFractionTol = 1.0e-10; // TODO: why are we loosening tolerances here?
307
- const arcFractionTol = 1.0e-7;
326
+ if (numRoots <= 0)
327
+ return;
308
328
  for (let i = 0; i < numRoots; i++) {
309
329
  const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
310
- const arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
330
+ let arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
311
331
  const lineFraction = SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
312
- if (lineFraction !== undefined &&
313
- this.acceptFraction(extendA0, lineFraction, extendA1, lineFractionTol) &&
314
- this.acceptFraction(extendB0, arcFraction, extendB1, arcFractionTol)) {
315
- this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
332
+ if (lineFraction !== undefined) {
333
+ if (this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB0, arcFraction, extendB1)) {
334
+ this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
335
+ }
336
+ else { // check for endpoint intersections beyond parametric tolerance but within point tolerance
337
+ const pointALocal = lineFraction < 0.5 ? pointA0Local : pointA1Local;
338
+ const pointBLocal = (arcFraction = data.sweep.fractionToSignedPeriodicFraction(arcFraction)) < 0.5 ? pointB0Local : pointB1Local;
339
+ if ((dist2 = pointALocal.distanceSquaredXY(pointBLocal)) !== undefined && Geometry.isDistanceWithinTol(dist2, tol2))
340
+ this.recordPointWithLocalFractions(lineFraction < 0.5 ? 0 : 1, cpA, fractionA0, fractionA1, arcFraction < 0.5 ? 0 : 1, arc, 0, 1, reversed);
341
+ }
316
342
  }
317
343
  }
318
344
  }
@@ -480,7 +506,7 @@ export class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandler {
480
506
  }
481
507
  return ranges;
482
508
  }
483
- dispatchBezierBezierStrokeFirst(bezierA, bcurveA, strokeCountA, bezierB, bcurveB, _strokeCountB, univariateBezierB, // caller-allocated for univariate coefficients.
509
+ dispatchBezierBezierStrokeFirst(bezierA, bcurveA, strokeCountA, bezierB, bcurveB, _strokeCountB, univariateBezierB, // caller-allocated for univariate coefficients
484
510
  reversed) {
485
511
  if (!this._xyzwA0)
486
512
  this._xyzwA0 = Point4d.create();
@@ -524,7 +550,7 @@ export class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandler {
524
550
  let bezierBFraction = r;
525
551
  bezierB.fractionToPoint4d(bezierBFraction, this._xyzwB);
526
552
  const segmentAFraction = SmallSystem.lineSegment3dHXYClosestPointUnbounded(this._xyzwA0, this._xyzwA1, this._xyzwB);
527
- if (segmentAFraction && Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {
553
+ if (segmentAFraction !== undefined && Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {
528
554
  let bezierAFraction = Geometry.interpolate(f0, segmentAFraction, f1);
529
555
  // We have a near intersection at fractions on the two beziers
530
556
  // Iterate on the curves for a true intersection
@@ -559,7 +585,7 @@ export class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandler {
559
585
  }
560
586
  }
561
587
  }
562
- dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB, _reversed) {
588
+ dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB, reversed) {
563
589
  const bezierSpanA = bcurveA.collectBezierSpans(true);
564
590
  const bezierSpanB = bcurveB.collectBezierSpans(true);
565
591
  const numA = bezierSpanA.length;
@@ -578,9 +604,9 @@ export class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandler {
578
604
  const strokeCountA = bezierSpanA[a].computeStrokeCountForOptions();
579
605
  const strokeCountB = bezierSpanB[b].computeStrokeCountForOptions();
580
606
  if (strokeCountA < strokeCountB)
581
- this.dispatchBezierBezierStrokeFirst(bezierSpanA[a], bcurveA, strokeCountA, bezierSpanB[b], bcurveB, strokeCountB, univariateCoffsB, _reversed);
607
+ this.dispatchBezierBezierStrokeFirst(bezierSpanA[a], bcurveA, strokeCountA, bezierSpanB[b], bcurveB, strokeCountB, univariateCoffsB, reversed);
582
608
  else
583
- this.dispatchBezierBezierStrokeFirst(bezierSpanB[b], bcurveB, strokeCountB, bezierSpanA[a], bcurveA, strokeCountA, univariateCoffsA, !_reversed);
609
+ this.dispatchBezierBezierStrokeFirst(bezierSpanB[b], bcurveB, strokeCountB, bezierSpanA[a], bcurveA, strokeCountA, univariateCoffsA, !reversed);
584
610
  }
585
611
  }
586
612
  }