@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
@@ -15,7 +15,6 @@ const CoincidentGeometryOps_1 = require("../../geometry3d/CoincidentGeometryOps"
15
15
  const GeometryHandler_1 = require("../../geometry3d/GeometryHandler");
16
16
  const GrowableFloat64Array_1 = require("../../geometry3d/GrowableFloat64Array");
17
17
  const Matrix3d_1 = require("../../geometry3d/Matrix3d");
18
- const Point2dVector2d_1 = require("../../geometry3d/Point2dVector2d");
19
18
  const Point3dVector3d_1 = require("../../geometry3d/Point3dVector3d");
20
19
  const Point4d_1 = require("../../geometry4d/Point4d");
21
20
  const BezierPolynomials_1 = require("../../numerics/BezierPolynomials");
@@ -47,7 +46,6 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
47
46
  _worldToLocalPerspective;
48
47
  _worldToLocalAffine;
49
48
  _coincidentGeometryContext;
50
- static _workVector2dA = Point2dVector2d_1.Vector2d.create();
51
49
  static _workPointA0H = Point4d_1.Point4d.create();
52
50
  static _workPointA1H = Point4d_1.Point4d.create();
53
51
  static _workPointB0H = Point4d_1.Point4d.create();
@@ -199,21 +197,25 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
199
197
  }
200
198
  /** Compute intersection of two line segments. Filter by extension rules. Record with fraction mapping. */
201
199
  computeSegmentSegment3D(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
202
- const uv = CurveCurveIntersectXY._workVector2dA;
203
- // Problem: Normal practice is to do the (quick, simple) transverse intersection first
204
- // But the transverse intersector notion of coincidence is based on the determinant ratios, which are hard
205
- // to relate to physical tolerance.
206
- // So do the overlap first. This should do a quick exit in non-coincident case.
207
- const overlap = this._coincidentGeometryContext.coincidentSegmentRangeXY(pointA0, pointA1, pointB0, pointB1, false);
208
- if (overlap) { // the lines are coincident
209
- if (this._coincidentGeometryContext.clampCoincidentOverlapToSegmentBounds(overlap, pointA0, pointA1, pointB0, pointB1, extendA0, extendA1, extendB0, extendB1)) {
200
+ const aDir = { x: pointA1.x - pointA0.x, y: pointA1.y - pointA0.y };
201
+ const bDir = { x: pointB1.x - pointB0.x, y: pointB1.y - pointB0.y };
202
+ const tol = this._coincidentGeometryContext.tolerance;
203
+ const fractions = SmallSystem_1.SmallSystem.lineSegmentXYUVIntersectionUnbounded(pointA0, aDir, pointB0, bDir, tol);
204
+ if (!fractions)
205
+ return;
206
+ if (fractions.f1) { // the lines are coincident
207
+ const detailA = CurveLocationDetail_1.CurveLocationDetail.createCurveFractionPoint(undefined, fractions.f0.x, pointA0.interpolate(fractions.f0.x, pointA1));
208
+ detailA.captureFraction1Point1(fractions.f1.x, pointA0.interpolate(fractions.f1.x, pointA1));
209
+ const detailB = CurveLocationDetail_1.CurveLocationDetail.createCurveFractionPoint(undefined, fractions.f0.y, pointB0.interpolate(fractions.f0.y, pointB1));
210
+ detailB.captureFraction1Point1(fractions.f1.y, pointB0.interpolate(fractions.f1.y, pointB1));
211
+ const overlap = CurveLocationDetail_1.CurveLocationDetailPair.createCapture(detailA, detailB);
212
+ if (this._coincidentGeometryContext.clampCoincidentOverlapToSegmentBounds(overlap, pointA0, pointA1, pointB0, pointB1, extendA0, extendA1, extendB0, extendB1))
210
213
  this.recordPointWithLocalFractions(overlap.detailA.fraction, cpA, fractionA0, fractionA1, overlap.detailB.fraction, cpB, fractionB0, fractionB1, reversed, overlap);
211
- }
212
214
  }
213
- else if (SmallSystem_1.SmallSystem.lineSegment3dXYTransverseIntersectionUnbounded(pointA0, pointA1, pointB0, pointB1, uv)) {
214
- if (this.acceptFractionOnLine(extendA0, uv.x, extendA1, pointA0, pointA1, this._coincidentGeometryContext.tolerance) &&
215
- this.acceptFractionOnLine(extendB0, uv.y, extendB1, pointB0, pointB1, this._coincidentGeometryContext.tolerance)) {
216
- this.recordPointWithLocalFractions(uv.x, cpA, fractionA0, fractionA1, uv.y, cpB, fractionB0, fractionB1, reversed);
215
+ else { // the lines have a transverse intersection
216
+ if (this.acceptFractionOnLine(extendA0, fractions.f0.x, extendA1, pointA0, pointA1, tol)) {
217
+ if (this.acceptFractionOnLine(extendB0, fractions.f0.y, extendB1, pointB0, pointB1, tol))
218
+ this.recordPointWithLocalFractions(fractions.f0.x, cpA, fractionA0, fractionA1, fractions.f0.y, cpB, fractionB0, fractionB1, reversed);
217
219
  }
218
220
  }
219
221
  }
@@ -261,6 +263,8 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
261
263
  // The line segment in question might be (a) a full line segment or (b) a fragment within a linestring.
262
264
  // The fraction and extend parameters allow all combinations to be passed in.
263
265
  dispatchSegmentArc(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, arc, extendB0, extendB1, reversed) {
266
+ const tol2 = this._coincidentGeometryContext.tolerance * this._coincidentGeometryContext.tolerance;
267
+ let dist2;
264
268
  // Arc: X = C + cU + sV
265
269
  // Line: contains points A0,A1
266
270
  // Arc point colinear with line if det (A0, A1, X) = 0
@@ -271,6 +275,10 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
271
275
  // project back to line.
272
276
  if (this._worldToLocalPerspective) {
273
277
  const data = arc.toTransformedPoint4d(this._worldToLocalPerspective);
278
+ const radians0 = data.sweep.fractionToRadians(0);
279
+ const pointB0H = data.center.plus2Scaled(data.vector0, Math.cos(radians0), data.vector90, Math.sin(radians0));
280
+ const radians1 = data.sweep.fractionToRadians(1);
281
+ const pointB1H = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
274
282
  const pointA0H = this._worldToLocalPerspective.multiplyPoint3d(pointA0, 1);
275
283
  const pointA1H = this._worldToLocalPerspective.multiplyPoint3d(pointA1, 1);
276
284
  const alpha = Geometry_1.Geometry.tripleProductPoint4dXYW(pointA0H, pointA1H, data.center);
@@ -280,19 +288,31 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
280
288
  const sines = new GrowableFloat64Array_1.GrowableFloat64Array(2);
281
289
  const radians = new GrowableFloat64Array_1.GrowableFloat64Array(2);
282
290
  const numRoots = Polynomials_1.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
291
+ if (numRoots <= 0)
292
+ return;
283
293
  for (let i = 0; i < numRoots; i++) {
284
294
  const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
285
- const arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
295
+ let arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
286
296
  const lineFraction = SmallSystem_1.SmallSystem.lineSegment3dHXYClosestPointUnbounded(pointA0H, pointA1H, arcPoint);
287
- if (lineFraction !== undefined &&
288
- this.acceptFraction(extendA0, lineFraction, extendA1) &&
289
- this.acceptFraction(extendB0, arcFraction, extendB1)) {
290
- this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
297
+ if (lineFraction !== undefined) {
298
+ if (this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB0, arcFraction, extendB1)) {
299
+ this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
300
+ }
301
+ else { // check for endpoint intersections beyond parametric tolerance but within point tolerance
302
+ const pointAH = lineFraction < 0.5 ? pointA0H : pointA1H;
303
+ const pointBH = (arcFraction = data.sweep.fractionToSignedPeriodicFraction(arcFraction)) < 0.5 ? pointB0H : pointB1H;
304
+ if ((dist2 = pointAH.realDistanceSquaredXY(pointBH)) !== undefined && Geometry_1.Geometry.isDistanceWithinTol(dist2, tol2))
305
+ this.recordPointWithLocalFractions(lineFraction < 0.5 ? 0 : 1, cpA, fractionA0, fractionA1, arcFraction < 0.5 ? 0 : 1, arc, 0, 1, reversed);
306
+ }
291
307
  }
292
308
  }
293
309
  }
294
310
  else {
295
311
  const data = arc.toTransformedVectors(this._worldToLocalAffine);
312
+ const radians0 = data.sweep.fractionToRadians(0);
313
+ const pointB0Local = data.center.plus2Scaled(data.vector0, Math.cos(radians0), data.vector90, Math.sin(radians0));
314
+ const radians1 = data.sweep.fractionToRadians(1);
315
+ const pointB1Local = data.center.plus2Scaled(data.vector0, Math.cos(radians1), data.vector90, Math.sin(radians1));
296
316
  let pointA0Local = pointA0;
297
317
  let pointA1Local = pointA1;
298
318
  if (this._worldToLocalAffine) {
@@ -306,16 +326,22 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
306
326
  const sines = new GrowableFloat64Array_1.GrowableFloat64Array(2);
307
327
  const radians = new GrowableFloat64Array_1.GrowableFloat64Array(2);
308
328
  const numRoots = Polynomials_1.AnalyticRoots.appendImplicitLineUnitCircleIntersections(alpha, beta, gamma, cosines, sines, radians);
309
- const lineFractionTol = 1.0e-10; // TODO: why are we loosening tolerances here?
310
- const arcFractionTol = 1.0e-7;
329
+ if (numRoots <= 0)
330
+ return;
311
331
  for (let i = 0; i < numRoots; i++) {
312
332
  const arcPoint = data.center.plus2Scaled(data.vector0, cosines.atUncheckedIndex(i), data.vector90, sines.atUncheckedIndex(i));
313
- const arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
333
+ let arcFraction = data.sweep.radiansToSignedFraction(radians.atUncheckedIndex(i), extendB0);
314
334
  const lineFraction = SmallSystem_1.SmallSystem.lineSegment3dXYClosestPointUnbounded(pointA0Local, pointA1Local, arcPoint);
315
- if (lineFraction !== undefined &&
316
- this.acceptFraction(extendA0, lineFraction, extendA1, lineFractionTol) &&
317
- this.acceptFraction(extendB0, arcFraction, extendB1, arcFractionTol)) {
318
- this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
335
+ if (lineFraction !== undefined) {
336
+ if (this.acceptFraction(extendA0, lineFraction, extendA1) && this.acceptFraction(extendB0, arcFraction, extendB1)) {
337
+ this.recordPointWithLocalFractions(lineFraction, cpA, fractionA0, fractionA1, arcFraction, arc, 0, 1, reversed);
338
+ }
339
+ else { // check for endpoint intersections beyond parametric tolerance but within point tolerance
340
+ const pointALocal = lineFraction < 0.5 ? pointA0Local : pointA1Local;
341
+ const pointBLocal = (arcFraction = data.sweep.fractionToSignedPeriodicFraction(arcFraction)) < 0.5 ? pointB0Local : pointB1Local;
342
+ if ((dist2 = pointALocal.distanceSquaredXY(pointBLocal)) !== undefined && Geometry_1.Geometry.isDistanceWithinTol(dist2, tol2))
343
+ this.recordPointWithLocalFractions(lineFraction < 0.5 ? 0 : 1, cpA, fractionA0, fractionA1, arcFraction < 0.5 ? 0 : 1, arc, 0, 1, reversed);
344
+ }
319
345
  }
320
346
  }
321
347
  }
@@ -483,7 +509,7 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
483
509
  }
484
510
  return ranges;
485
511
  }
486
- dispatchBezierBezierStrokeFirst(bezierA, bcurveA, strokeCountA, bezierB, bcurveB, _strokeCountB, univariateBezierB, // caller-allocated for univariate coefficients.
512
+ dispatchBezierBezierStrokeFirst(bezierA, bcurveA, strokeCountA, bezierB, bcurveB, _strokeCountB, univariateBezierB, // caller-allocated for univariate coefficients
487
513
  reversed) {
488
514
  if (!this._xyzwA0)
489
515
  this._xyzwA0 = Point4d_1.Point4d.create();
@@ -527,7 +553,7 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
527
553
  let bezierBFraction = r;
528
554
  bezierB.fractionToPoint4d(bezierBFraction, this._xyzwB);
529
555
  const segmentAFraction = SmallSystem_1.SmallSystem.lineSegment3dHXYClosestPointUnbounded(this._xyzwA0, this._xyzwA1, this._xyzwB);
530
- if (segmentAFraction && Geometry_1.Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {
556
+ if (segmentAFraction !== undefined && Geometry_1.Geometry.isIn01WithTolerance(segmentAFraction, intervalTolerance)) {
531
557
  let bezierAFraction = Geometry_1.Geometry.interpolate(f0, segmentAFraction, f1);
532
558
  // We have a near intersection at fractions on the two beziers
533
559
  // Iterate on the curves for a true intersection
@@ -562,7 +588,7 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
562
588
  }
563
589
  }
564
590
  }
565
- dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB, _reversed) {
591
+ dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB, reversed) {
566
592
  const bezierSpanA = bcurveA.collectBezierSpans(true);
567
593
  const bezierSpanB = bcurveB.collectBezierSpans(true);
568
594
  const numA = bezierSpanA.length;
@@ -581,9 +607,9 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
581
607
  const strokeCountA = bezierSpanA[a].computeStrokeCountForOptions();
582
608
  const strokeCountB = bezierSpanB[b].computeStrokeCountForOptions();
583
609
  if (strokeCountA < strokeCountB)
584
- this.dispatchBezierBezierStrokeFirst(bezierSpanA[a], bcurveA, strokeCountA, bezierSpanB[b], bcurveB, strokeCountB, univariateCoffsB, _reversed);
610
+ this.dispatchBezierBezierStrokeFirst(bezierSpanA[a], bcurveA, strokeCountA, bezierSpanB[b], bcurveB, strokeCountB, univariateCoffsB, reversed);
585
611
  else
586
- this.dispatchBezierBezierStrokeFirst(bezierSpanB[b], bcurveB, strokeCountB, bezierSpanA[a], bcurveA, strokeCountA, univariateCoffsA, !_reversed);
612
+ this.dispatchBezierBezierStrokeFirst(bezierSpanB[b], bcurveB, strokeCountB, bezierSpanA[a], bcurveA, strokeCountA, univariateCoffsA, !reversed);
587
613
  }
588
614
  }
589
615
  }