@itwin/core-geometry 5.5.0-dev.4 → 5.5.0-dev.6

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 (611) hide show
  1. package/lib/cjs/Geometry.d.ts +7 -0
  2. package/lib/cjs/Geometry.d.ts.map +1 -1
  3. package/lib/cjs/Geometry.js +9 -0
  4. package/lib/cjs/Geometry.js.map +1 -1
  5. package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurve.js +2 -1
  7. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  8. package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
  9. package/lib/cjs/bspline/BSplineCurveOps.js +4 -1
  10. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  11. package/lib/cjs/bspline/BezierCurve3d.d.ts.map +1 -1
  12. package/lib/cjs/bspline/BezierCurve3d.js +14 -4
  13. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  14. package/lib/cjs/bspline/BezierCurve3dH.d.ts +2 -0
  15. package/lib/cjs/bspline/BezierCurve3dH.d.ts.map +1 -1
  16. package/lib/cjs/bspline/BezierCurve3dH.js +19 -3
  17. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  18. package/lib/cjs/bspline/BezierCurveBase.d.ts +8 -2
  19. package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
  20. package/lib/cjs/bspline/BezierCurveBase.js +10 -4
  21. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  22. package/lib/cjs/clipping/AlternatingConvexClipTree.js +4 -4
  23. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  24. package/lib/cjs/clipping/ClipPlane.d.ts +0 -3
  25. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  26. package/lib/cjs/clipping/ClipPlane.js +9 -2
  27. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  28. package/lib/cjs/clipping/ClipPrimitive.d.ts +59 -9
  29. package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
  30. package/lib/cjs/clipping/ClipPrimitive.js +124 -55
  31. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  32. package/lib/cjs/clipping/ClipUtils.js +1 -1
  33. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  34. package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
  35. package/lib/cjs/clipping/ClipVector.js +12 -8
  36. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  37. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +0 -2
  38. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  39. package/lib/cjs/clipping/ConvexClipPlaneSet.js +19 -18
  40. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  41. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +1 -1
  42. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
  43. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +4 -5
  44. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  45. package/lib/cjs/core-geometry.d.ts +0 -1
  46. package/lib/cjs/core-geometry.d.ts.map +1 -1
  47. package/lib/cjs/core-geometry.js +0 -1
  48. package/lib/cjs/core-geometry.js.map +1 -1
  49. package/lib/cjs/curve/Arc3d.js +2 -2
  50. package/lib/cjs/curve/Arc3d.js.map +1 -1
  51. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +12 -4
  52. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  53. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +52 -33
  54. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  55. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  56. package/lib/cjs/curve/CurveCollection.js +13 -6
  57. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  58. package/lib/cjs/curve/CurveCurve.js +1 -1
  59. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  60. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  61. package/lib/cjs/curve/CurveFactory.js +13 -1
  62. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  63. package/lib/cjs/curve/CurveLocationDetail.d.ts +12 -4
  64. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  65. package/lib/cjs/curve/CurveLocationDetail.js +14 -5
  66. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  67. package/lib/cjs/curve/CurvePrimitive.d.ts +5 -4
  68. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  69. package/lib/cjs/curve/CurvePrimitive.js +7 -4
  70. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  71. package/lib/cjs/curve/LineString3d.d.ts +25 -16
  72. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  73. package/lib/cjs/curve/LineString3d.js +90 -72
  74. package/lib/cjs/curve/LineString3d.js.map +1 -1
  75. package/lib/cjs/curve/Path.d.ts +0 -3
  76. package/lib/cjs/curve/Path.d.ts.map +1 -1
  77. package/lib/cjs/curve/Path.js +9 -2
  78. package/lib/cjs/curve/Path.js.map +1 -1
  79. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  80. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  81. package/lib/cjs/curve/Query/PlanarSubdivision.js +25 -31
  82. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  83. package/lib/cjs/curve/Query/StrokeCountChain.d.ts +7 -1
  84. package/lib/cjs/curve/Query/StrokeCountChain.d.ts.map +1 -1
  85. package/lib/cjs/curve/Query/StrokeCountChain.js +27 -36
  86. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  87. package/lib/cjs/curve/RegionMomentsXY.d.ts.map +1 -1
  88. package/lib/cjs/curve/RegionMomentsXY.js +7 -1
  89. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  90. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  91. package/lib/cjs/curve/RegionOps.js +8 -5
  92. package/lib/cjs/curve/RegionOps.js.map +1 -1
  93. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  94. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +6 -6
  95. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  96. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts.map +1 -1
  97. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js +4 -1
  98. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  99. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
  100. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +6 -1
  101. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  102. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +5 -21
  103. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  104. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +29 -73
  105. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  106. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +55 -13
  107. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  108. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +238 -110
  109. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  110. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +1 -1
  111. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  112. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts +1 -4
  113. package/lib/cjs/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  114. package/lib/cjs/curve/spiral/DirectSpiral3d.js +9 -9
  115. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  116. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts +11 -14
  117. package/lib/cjs/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  118. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +18 -18
  119. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  120. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts +7 -1
  121. package/lib/cjs/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  122. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  123. package/lib/cjs/geometry3d/Ellipsoid.d.ts +19 -7
  124. package/lib/cjs/geometry3d/Ellipsoid.d.ts.map +1 -1
  125. package/lib/cjs/geometry3d/Ellipsoid.js +26 -11
  126. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  127. package/lib/cjs/geometry3d/FrustumAnimation.d.ts.map +1 -1
  128. package/lib/cjs/geometry3d/FrustumAnimation.js +11 -1
  129. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  130. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts +5 -1
  131. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  132. package/lib/cjs/geometry3d/GrowableFloat64Array.js +11 -1
  133. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  134. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +1 -1
  135. package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
  136. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  137. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +49 -8
  138. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  139. package/lib/cjs/geometry3d/GrowableXYZArray.js +90 -37
  140. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  141. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +100 -3
  142. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  143. package/lib/cjs/geometry3d/IndexedXYZCollection.js +125 -0
  144. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  145. package/lib/cjs/geometry3d/Matrix3d.d.ts +10 -1
  146. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  147. package/lib/cjs/geometry3d/Matrix3d.js +53 -34
  148. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  149. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +1 -1
  150. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  151. package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts +49 -2
  152. package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
  153. package/lib/cjs/geometry3d/Point3dArrayCarrier.js +67 -9
  154. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  155. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +1 -1
  156. package/lib/cjs/geometry3d/Point3dVector3d.js +1 -1
  157. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  158. package/lib/cjs/geometry3d/PointStreaming.js +1 -1
  159. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  160. package/lib/cjs/geometry3d/PolygonOps.d.ts +24 -32
  161. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  162. package/lib/cjs/geometry3d/PolygonOps.js +147 -180
  163. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  164. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +5 -5
  165. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  166. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  167. package/lib/cjs/geometry3d/PolylineOps.js +13 -3
  168. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  169. package/lib/cjs/geometry3d/Range.js.map +1 -1
  170. package/lib/cjs/geometry3d/Ray3d.d.ts +0 -3
  171. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  172. package/lib/cjs/geometry3d/Ray3d.js +5 -1
  173. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  174. package/lib/cjs/geometry3d/SortablePolygon.d.ts +2 -2
  175. package/lib/cjs/geometry3d/SortablePolygon.d.ts.map +1 -1
  176. package/lib/cjs/geometry3d/SortablePolygon.js +14 -18
  177. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  178. package/lib/cjs/geometry3d/Transform.d.ts +8 -0
  179. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  180. package/lib/cjs/geometry3d/Transform.js +15 -9
  181. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  182. package/lib/cjs/numerics/ClusterableArray.d.ts +4 -2
  183. package/lib/cjs/numerics/ClusterableArray.d.ts.map +1 -1
  184. package/lib/cjs/numerics/ClusterableArray.js +6 -4
  185. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  186. package/lib/cjs/numerics/Newton.d.ts +3 -1
  187. package/lib/cjs/numerics/Newton.d.ts.map +1 -1
  188. package/lib/cjs/numerics/Newton.js +5 -1
  189. package/lib/cjs/numerics/Newton.js.map +1 -1
  190. package/lib/cjs/polyface/AuxData.d.ts +1 -4
  191. package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
  192. package/lib/cjs/polyface/AuxData.js +5 -1
  193. package/lib/cjs/polyface/AuxData.js.map +1 -1
  194. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js +3 -3
  195. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  196. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  197. package/lib/cjs/polyface/Polyface.js +14 -16
  198. package/lib/cjs/polyface/Polyface.js.map +1 -1
  199. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +84 -28
  200. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  201. package/lib/cjs/polyface/PolyfaceBuilder.js +277 -217
  202. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  203. package/lib/cjs/polyface/PolyfaceClip.d.ts +4 -3
  204. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  205. package/lib/cjs/polyface/PolyfaceClip.js +11 -4
  206. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  207. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  208. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  209. package/lib/cjs/polyface/PolyfaceQuery.js +9 -7
  210. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  211. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.d.ts.map +1 -1
  212. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js +3 -2
  213. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  214. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +1 -1
  215. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +2 -2
  216. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  217. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
  218. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js +14 -12
  219. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  220. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.d.ts +1 -1
  221. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.d.ts.map +1 -1
  222. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js +10 -6
  223. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  224. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +4 -3
  225. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  226. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  227. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +3 -5
  228. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  229. package/lib/cjs/polyface/multiclip/XYPointBuckets.d.ts +1 -1
  230. package/lib/cjs/polyface/multiclip/XYPointBuckets.d.ts.map +1 -1
  231. package/lib/cjs/polyface/multiclip/XYPointBuckets.js +4 -8
  232. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  233. package/lib/cjs/serialization/BGFBAccessors.d.ts.map +1 -1
  234. package/lib/cjs/serialization/BGFBAccessors.js +1 -0
  235. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  236. package/lib/cjs/serialization/BGFBReader.d.ts.map +1 -1
  237. package/lib/cjs/serialization/BGFBReader.js +37 -7
  238. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  239. package/lib/cjs/serialization/BGFBWriter.d.ts +4 -4
  240. package/lib/cjs/serialization/BGFBWriter.d.ts.map +1 -1
  241. package/lib/cjs/serialization/BGFBWriter.js +24 -40
  242. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  243. package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
  244. package/lib/cjs/serialization/IModelJsonSchema.js +9 -3
  245. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  246. package/lib/cjs/serialization/SerializationHelpers.d.ts +0 -3
  247. package/lib/cjs/serialization/SerializationHelpers.d.ts.map +1 -1
  248. package/lib/cjs/serialization/SerializationHelpers.js +16 -7
  249. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  250. package/lib/cjs/solid/Box.d.ts +2 -2
  251. package/lib/cjs/solid/Box.d.ts.map +1 -1
  252. package/lib/cjs/solid/Box.js.map +1 -1
  253. package/lib/cjs/solid/Cone.d.ts +3 -2
  254. package/lib/cjs/solid/Cone.d.ts.map +1 -1
  255. package/lib/cjs/solid/Cone.js +4 -1
  256. package/lib/cjs/solid/Cone.js.map +1 -1
  257. package/lib/cjs/solid/LinearSweep.d.ts +1 -1
  258. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  259. package/lib/cjs/solid/LinearSweep.js +1 -1
  260. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  261. package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
  262. package/lib/cjs/solid/RotationalSweep.js +1 -3
  263. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  264. package/lib/cjs/solid/TorusPipe.d.ts +4 -3
  265. package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
  266. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  267. package/lib/cjs/topology/ChainMerge.d.ts +4 -4
  268. package/lib/cjs/topology/ChainMerge.d.ts.map +1 -1
  269. package/lib/cjs/topology/ChainMerge.js +11 -1
  270. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  271. package/lib/cjs/topology/Graph.d.ts +2 -0
  272. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  273. package/lib/cjs/topology/Graph.js +5 -0
  274. package/lib/cjs/topology/Graph.js.map +1 -1
  275. package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  276. package/lib/cjs/topology/HalfEdgeGraphSearch.js +2 -0
  277. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  278. package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
  279. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js +23 -16
  280. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  281. package/lib/cjs/topology/HalfEdgePositionDetail.d.ts +20 -9
  282. package/lib/cjs/topology/HalfEdgePositionDetail.d.ts.map +1 -1
  283. package/lib/cjs/topology/HalfEdgePositionDetail.js +17 -13
  284. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  285. package/lib/cjs/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
  286. package/lib/cjs/topology/HalfEdgePriorityQueue.js +3 -1
  287. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  288. package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts +6 -2
  289. package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
  290. package/lib/cjs/topology/InsertAndRetriangulateContext.js +41 -35
  291. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  292. package/lib/cjs/topology/MaskManager.d.ts +7 -3
  293. package/lib/cjs/topology/MaskManager.d.ts.map +1 -1
  294. package/lib/cjs/topology/MaskManager.js +10 -4
  295. package/lib/cjs/topology/MaskManager.js.map +1 -1
  296. package/lib/cjs/topology/RegularizeFace.d.ts.map +1 -1
  297. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  298. package/lib/cjs/topology/Triangulation.d.ts +2 -1
  299. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  300. package/lib/cjs/topology/Triangulation.js +12 -7
  301. package/lib/cjs/topology/Triangulation.js.map +1 -1
  302. package/lib/esm/Geometry.d.ts +7 -0
  303. package/lib/esm/Geometry.d.ts.map +1 -1
  304. package/lib/esm/Geometry.js +9 -0
  305. package/lib/esm/Geometry.js.map +1 -1
  306. package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
  307. package/lib/esm/bspline/BSplineCurve.js +2 -1
  308. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  309. package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
  310. package/lib/esm/bspline/BSplineCurveOps.js +4 -1
  311. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  312. package/lib/esm/bspline/BezierCurve3d.d.ts.map +1 -1
  313. package/lib/esm/bspline/BezierCurve3d.js +14 -4
  314. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  315. package/lib/esm/bspline/BezierCurve3dH.d.ts +2 -0
  316. package/lib/esm/bspline/BezierCurve3dH.d.ts.map +1 -1
  317. package/lib/esm/bspline/BezierCurve3dH.js +19 -3
  318. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  319. package/lib/esm/bspline/BezierCurveBase.d.ts +8 -2
  320. package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
  321. package/lib/esm/bspline/BezierCurveBase.js +10 -4
  322. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  323. package/lib/esm/clipping/AlternatingConvexClipTree.js +4 -4
  324. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  325. package/lib/esm/clipping/ClipPlane.d.ts +0 -3
  326. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  327. package/lib/esm/clipping/ClipPlane.js +9 -2
  328. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  329. package/lib/esm/clipping/ClipPrimitive.d.ts +59 -9
  330. package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
  331. package/lib/esm/clipping/ClipPrimitive.js +124 -55
  332. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  333. package/lib/esm/clipping/ClipUtils.js +1 -1
  334. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  335. package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
  336. package/lib/esm/clipping/ClipVector.js +12 -8
  337. package/lib/esm/clipping/ClipVector.js.map +1 -1
  338. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +0 -2
  339. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  340. package/lib/esm/clipping/ConvexClipPlaneSet.js +20 -19
  341. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  342. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts +1 -1
  343. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.d.ts.map +1 -1
  344. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +4 -5
  345. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  346. package/lib/esm/core-geometry.d.ts +0 -1
  347. package/lib/esm/core-geometry.d.ts.map +1 -1
  348. package/lib/esm/core-geometry.js +0 -1
  349. package/lib/esm/core-geometry.js.map +1 -1
  350. package/lib/esm/curve/Arc3d.js +2 -2
  351. package/lib/esm/curve/Arc3d.js.map +1 -1
  352. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +12 -4
  353. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  354. package/lib/esm/curve/CurveChainWithDistanceIndex.js +53 -34
  355. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  356. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  357. package/lib/esm/curve/CurveCollection.js +13 -6
  358. package/lib/esm/curve/CurveCollection.js.map +1 -1
  359. package/lib/esm/curve/CurveCurve.js +1 -1
  360. package/lib/esm/curve/CurveCurve.js.map +1 -1
  361. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  362. package/lib/esm/curve/CurveFactory.js +13 -1
  363. package/lib/esm/curve/CurveFactory.js.map +1 -1
  364. package/lib/esm/curve/CurveLocationDetail.d.ts +12 -4
  365. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  366. package/lib/esm/curve/CurveLocationDetail.js +14 -5
  367. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  368. package/lib/esm/curve/CurvePrimitive.d.ts +5 -4
  369. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  370. package/lib/esm/curve/CurvePrimitive.js +7 -4
  371. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  372. package/lib/esm/curve/LineString3d.d.ts +25 -16
  373. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  374. package/lib/esm/curve/LineString3d.js +90 -72
  375. package/lib/esm/curve/LineString3d.js.map +1 -1
  376. package/lib/esm/curve/Path.d.ts +0 -3
  377. package/lib/esm/curve/Path.d.ts.map +1 -1
  378. package/lib/esm/curve/Path.js +9 -2
  379. package/lib/esm/curve/Path.js.map +1 -1
  380. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  381. package/lib/esm/curve/Query/PlanarSubdivision.d.ts.map +1 -1
  382. package/lib/esm/curve/Query/PlanarSubdivision.js +25 -31
  383. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  384. package/lib/esm/curve/Query/StrokeCountChain.d.ts +7 -1
  385. package/lib/esm/curve/Query/StrokeCountChain.d.ts.map +1 -1
  386. package/lib/esm/curve/Query/StrokeCountChain.js +27 -36
  387. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  388. package/lib/esm/curve/RegionMomentsXY.d.ts.map +1 -1
  389. package/lib/esm/curve/RegionMomentsXY.js +7 -1
  390. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  391. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  392. package/lib/esm/curve/RegionOps.js +8 -5
  393. package/lib/esm/curve/RegionOps.js.map +1 -1
  394. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  395. package/lib/esm/curve/RegionOpsClassificationSweeps.js +6 -6
  396. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  397. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.d.ts.map +1 -1
  398. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js +4 -1
  399. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  400. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.d.ts.map +1 -1
  401. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +6 -1
  402. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  403. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +5 -21
  404. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  405. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +29 -73
  406. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  407. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +55 -13
  408. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  409. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +239 -111
  410. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  411. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +1 -1
  412. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  413. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts +1 -4
  414. package/lib/esm/curve/spiral/DirectSpiral3d.d.ts.map +1 -1
  415. package/lib/esm/curve/spiral/DirectSpiral3d.js +9 -9
  416. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  417. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts +11 -14
  418. package/lib/esm/curve/spiral/IntegratedSpiral3d.d.ts.map +1 -1
  419. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +18 -18
  420. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  421. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts +7 -1
  422. package/lib/esm/curve/spiral/TransitionConditionalProperties.d.ts.map +1 -1
  423. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  424. package/lib/esm/geometry3d/Ellipsoid.d.ts +19 -7
  425. package/lib/esm/geometry3d/Ellipsoid.d.ts.map +1 -1
  426. package/lib/esm/geometry3d/Ellipsoid.js +26 -11
  427. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  428. package/lib/esm/geometry3d/FrustumAnimation.d.ts.map +1 -1
  429. package/lib/esm/geometry3d/FrustumAnimation.js +11 -1
  430. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  431. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts +5 -1
  432. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  433. package/lib/esm/geometry3d/GrowableFloat64Array.js +11 -1
  434. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  435. package/lib/esm/geometry3d/GrowableXYArray.d.ts +1 -1
  436. package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
  437. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  438. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +49 -8
  439. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  440. package/lib/esm/geometry3d/GrowableXYZArray.js +90 -37
  441. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  442. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +100 -3
  443. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  444. package/lib/esm/geometry3d/IndexedXYZCollection.js +125 -0
  445. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  446. package/lib/esm/geometry3d/Matrix3d.d.ts +10 -1
  447. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  448. package/lib/esm/geometry3d/Matrix3d.js +53 -34
  449. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  450. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +1 -1
  451. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  452. package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts +49 -2
  453. package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
  454. package/lib/esm/geometry3d/Point3dArrayCarrier.js +67 -9
  455. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  456. package/lib/esm/geometry3d/Point3dVector3d.d.ts +1 -1
  457. package/lib/esm/geometry3d/Point3dVector3d.js +1 -1
  458. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  459. package/lib/esm/geometry3d/PointStreaming.js +1 -1
  460. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  461. package/lib/esm/geometry3d/PolygonOps.d.ts +24 -32
  462. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  463. package/lib/esm/geometry3d/PolygonOps.js +147 -180
  464. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  465. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +5 -5
  466. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  467. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  468. package/lib/esm/geometry3d/PolylineOps.js +13 -3
  469. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  470. package/lib/esm/geometry3d/Range.js.map +1 -1
  471. package/lib/esm/geometry3d/Ray3d.d.ts +0 -3
  472. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  473. package/lib/esm/geometry3d/Ray3d.js +5 -1
  474. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  475. package/lib/esm/geometry3d/SortablePolygon.d.ts +2 -2
  476. package/lib/esm/geometry3d/SortablePolygon.d.ts.map +1 -1
  477. package/lib/esm/geometry3d/SortablePolygon.js +14 -18
  478. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  479. package/lib/esm/geometry3d/Transform.d.ts +8 -0
  480. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  481. package/lib/esm/geometry3d/Transform.js +15 -9
  482. package/lib/esm/geometry3d/Transform.js.map +1 -1
  483. package/lib/esm/numerics/ClusterableArray.d.ts +4 -2
  484. package/lib/esm/numerics/ClusterableArray.d.ts.map +1 -1
  485. package/lib/esm/numerics/ClusterableArray.js +6 -4
  486. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  487. package/lib/esm/numerics/Newton.d.ts +3 -1
  488. package/lib/esm/numerics/Newton.d.ts.map +1 -1
  489. package/lib/esm/numerics/Newton.js +5 -1
  490. package/lib/esm/numerics/Newton.js.map +1 -1
  491. package/lib/esm/polyface/AuxData.d.ts +1 -4
  492. package/lib/esm/polyface/AuxData.d.ts.map +1 -1
  493. package/lib/esm/polyface/AuxData.js +5 -1
  494. package/lib/esm/polyface/AuxData.js.map +1 -1
  495. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js +3 -3
  496. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  497. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  498. package/lib/esm/polyface/Polyface.js +14 -16
  499. package/lib/esm/polyface/Polyface.js.map +1 -1
  500. package/lib/esm/polyface/PolyfaceBuilder.d.ts +84 -28
  501. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  502. package/lib/esm/polyface/PolyfaceBuilder.js +277 -217
  503. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  504. package/lib/esm/polyface/PolyfaceClip.d.ts +4 -3
  505. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  506. package/lib/esm/polyface/PolyfaceClip.js +11 -4
  507. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  508. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  509. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  510. package/lib/esm/polyface/PolyfaceQuery.js +9 -7
  511. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  512. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.d.ts.map +1 -1
  513. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js +3 -2
  514. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  515. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +1 -1
  516. package/lib/esm/polyface/RangeTree/RangeTreeNode.js +2 -2
  517. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  518. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -1
  519. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js +14 -12
  520. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  521. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.d.ts +1 -1
  522. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.d.ts.map +1 -1
  523. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js +10 -6
  524. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  525. package/lib/esm/polyface/multiclip/OffsetMeshContext.js +4 -3
  526. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  527. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  528. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +3 -5
  529. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  530. package/lib/esm/polyface/multiclip/XYPointBuckets.d.ts +1 -1
  531. package/lib/esm/polyface/multiclip/XYPointBuckets.d.ts.map +1 -1
  532. package/lib/esm/polyface/multiclip/XYPointBuckets.js +4 -8
  533. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  534. package/lib/esm/serialization/BGFBAccessors.d.ts.map +1 -1
  535. package/lib/esm/serialization/BGFBAccessors.js +1 -0
  536. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  537. package/lib/esm/serialization/BGFBReader.d.ts.map +1 -1
  538. package/lib/esm/serialization/BGFBReader.js +37 -7
  539. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  540. package/lib/esm/serialization/BGFBWriter.d.ts +4 -4
  541. package/lib/esm/serialization/BGFBWriter.d.ts.map +1 -1
  542. package/lib/esm/serialization/BGFBWriter.js +24 -40
  543. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  544. package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
  545. package/lib/esm/serialization/IModelJsonSchema.js +9 -3
  546. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  547. package/lib/esm/serialization/SerializationHelpers.d.ts +0 -3
  548. package/lib/esm/serialization/SerializationHelpers.d.ts.map +1 -1
  549. package/lib/esm/serialization/SerializationHelpers.js +16 -7
  550. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  551. package/lib/esm/solid/Box.d.ts +2 -2
  552. package/lib/esm/solid/Box.d.ts.map +1 -1
  553. package/lib/esm/solid/Box.js.map +1 -1
  554. package/lib/esm/solid/Cone.d.ts +3 -2
  555. package/lib/esm/solid/Cone.d.ts.map +1 -1
  556. package/lib/esm/solid/Cone.js +4 -1
  557. package/lib/esm/solid/Cone.js.map +1 -1
  558. package/lib/esm/solid/LinearSweep.d.ts +1 -1
  559. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  560. package/lib/esm/solid/LinearSweep.js +1 -1
  561. package/lib/esm/solid/LinearSweep.js.map +1 -1
  562. package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
  563. package/lib/esm/solid/RotationalSweep.js +1 -3
  564. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  565. package/lib/esm/solid/TorusPipe.d.ts +4 -3
  566. package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
  567. package/lib/esm/solid/TorusPipe.js.map +1 -1
  568. package/lib/esm/topology/ChainMerge.d.ts +4 -4
  569. package/lib/esm/topology/ChainMerge.d.ts.map +1 -1
  570. package/lib/esm/topology/ChainMerge.js +11 -1
  571. package/lib/esm/topology/ChainMerge.js.map +1 -1
  572. package/lib/esm/topology/Graph.d.ts +2 -0
  573. package/lib/esm/topology/Graph.d.ts.map +1 -1
  574. package/lib/esm/topology/Graph.js +5 -0
  575. package/lib/esm/topology/Graph.js.map +1 -1
  576. package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  577. package/lib/esm/topology/HalfEdgeGraphSearch.js +2 -0
  578. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  579. package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
  580. package/lib/esm/topology/HalfEdgePointInGraphSearch.js +23 -16
  581. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  582. package/lib/esm/topology/HalfEdgePositionDetail.d.ts +20 -9
  583. package/lib/esm/topology/HalfEdgePositionDetail.d.ts.map +1 -1
  584. package/lib/esm/topology/HalfEdgePositionDetail.js +17 -13
  585. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  586. package/lib/esm/topology/HalfEdgePriorityQueue.d.ts.map +1 -1
  587. package/lib/esm/topology/HalfEdgePriorityQueue.js +4 -2
  588. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  589. package/lib/esm/topology/InsertAndRetriangulateContext.d.ts +6 -2
  590. package/lib/esm/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
  591. package/lib/esm/topology/InsertAndRetriangulateContext.js +41 -35
  592. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  593. package/lib/esm/topology/MaskManager.d.ts +7 -3
  594. package/lib/esm/topology/MaskManager.d.ts.map +1 -1
  595. package/lib/esm/topology/MaskManager.js +10 -4
  596. package/lib/esm/topology/MaskManager.js.map +1 -1
  597. package/lib/esm/topology/RegularizeFace.d.ts.map +1 -1
  598. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  599. package/lib/esm/topology/Triangulation.d.ts +2 -1
  600. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  601. package/lib/esm/topology/Triangulation.js +12 -7
  602. package/lib/esm/topology/Triangulation.js.map +1 -1
  603. package/package.json +3 -3
  604. package/lib/cjs/serialization/GeometrySamples.d.ts +0 -705
  605. package/lib/cjs/serialization/GeometrySamples.d.ts.map +0 -1
  606. package/lib/cjs/serialization/GeometrySamples.js +0 -2433
  607. package/lib/cjs/serialization/GeometrySamples.js.map +0 -1
  608. package/lib/esm/serialization/GeometrySamples.d.ts +0 -705
  609. package/lib/esm/serialization/GeometrySamples.d.ts.map +0 -1
  610. package/lib/esm/serialization/GeometrySamples.js +0 -2428
  611. package/lib/esm/serialization/GeometrySamples.js.map +0 -1
@@ -52,8 +52,18 @@ export declare class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandle
52
52
  * @param tolerance optional distance tolerance for coincidence.
53
53
  */
54
54
  constructor(worldToLocal: Matrix4d | undefined, extendA: boolean, geometryB: AnyCurve | undefined, extendB: boolean, tolerance?: number);
55
- /** Reset the geometry, leaving all other parts unchanged (and preserving accumulated intersections). */
56
- resetGeometry(geometryB: AnyCurve): void;
55
+ /**
56
+ * Reset geometryA extension flags.
57
+ * * Undefined inputs are ignored.
58
+ * * All other instance data is unchanged, including accumulated intersections.
59
+ */
60
+ resetGeometryA(extendA0?: boolean, extendA1?: boolean): void;
61
+ /**
62
+ * Reset geometryB and its extension flags.
63
+ * * Undefined inputs are ignored.
64
+ * * All other instance data is unchanged, including accumulated intersections.
65
+ */
66
+ resetGeometryB(geometryB?: AnyCurve, extendB0?: boolean, extendB1?: boolean): void;
57
67
  /** Accept the fraction if it falls inside (possibly extended) fraction range. */
58
68
  private acceptFraction;
59
69
  /** Test the fraction by strict parameter, but allow toleranced distance test at ends. */
@@ -75,6 +85,7 @@ export declare class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandle
75
85
  * @param fractionB1 end of the subcurve of cpB
76
86
  * @param reversed whether to reverse the details in the recorded intersection pair
77
87
  * @param intervalDetails optional data for a coincident segment intersection
88
+ * @param fractionTol relative tolerance for comparing fractions to avoid duplicating the last intersection. Defaults to [[Geometry.smallAngleRadians]].
78
89
  */
79
90
  private recordPointWithLocalFractions;
80
91
  /**
@@ -144,8 +155,8 @@ export declare class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandle
144
155
  */
145
156
  private dispatchCurveChainWithDistanceIndex;
146
157
  /**
147
- * Invoke `child.dispatchToGeometryHandler(this)` for each child in the array returned by the query `g.children`.
148
- * We take care of extend variables of geometry's children here if geometry is Path or Loop.
158
+ * Invoke dispatch on each child of `g` as "geometryA".
159
+ * * If `g` is a `Path` or `Loop`, adjust extension flags for geometryA accordingly.
149
160
  */
150
161
  handleChildren(g: GeometryQuery): any;
151
162
  /** Double dispatch handler for strongly typed segment. */
@@ -153,19 +164,50 @@ export declare class CurveCurveIntersectXY extends RecurseToCurvesGeometryHandle
153
164
  /** Double dispatch handler for strongly typed linestring. */
154
165
  handleLineString3d(lsA: LineString3d): any;
155
166
  /** Double dispatch handler for strongly typed arc. */
156
- handleArc3d(arc0: Arc3d): any;
167
+ handleArc3d(arcA: Arc3d): any;
157
168
  /** Double dispatch handler for strongly typed bspline curve. */
158
- handleBSplineCurve3d(curve: BSplineCurve3d): any;
169
+ handleBSplineCurve3d(curveA: BSplineCurve3d): any;
159
170
  /**
160
- * Assuming the tail of `this._results` holds the given number of approximate solutions to the curve-spiral
161
- * xy-intersection problem, replace each with its Newton refinement, unless it doesn't converge, in which case
162
- * it is removed.
163
- * @param spiral The transition spiral.
164
- * @param otherCurve The other curve primitive.
165
- * @param numberOfNewResults The number of results in the tail of `this._results` to be refined.
166
- * @param reversed Whether the spiral is geometryA (true) or geometryB (false).
171
+ * Process tail of `this._results` for xy-intersections between the curve and spiral.
172
+ * * If a result is not already an intersection, refine it via Newton iteration unless it doesn't converge, in which
173
+ * case remove it.
174
+ * @param curveA The other curve primitive. May also be a transition spiral.
175
+ * @param spiralB The transition spiral.
176
+ * @param index0 index of first entry in tail of `this._results` to refine.
177
+ * @param reversed Whether `spiralB` data is in `detailA` of each recorded pair, and `curveA` data in `detailB`.
167
178
  */
168
179
  private refineSpiralResultsByNewton;
180
+ /**
181
+ * Append stroke points and return the line string.
182
+ * * This is a convenient wrapper for [[CurvePrimitive.emitStrokes]] but the analogous instance method cannot be added
183
+ * to that class due to the ensuing recursion with subclass [[LineString3d]].
184
+ * @param options options for stroking the instance curve.
185
+ * @param result object to receive appended stroke points; if omitted, a new object is created, populated, and returned.
186
+ */
187
+ private strokeCurve;
188
+ /** Compute an approximation to the max chord height error of the stroked spiral, and another curve if a spiral. */
189
+ private computeMaxSpiralStrokeError;
190
+ /**
191
+ * Solve the intersection problem for stroked, unextended curveB.
192
+ * * @return the number of results appended.
193
+ */
194
+ private appendDiscreteIntersectionResults;
195
+ /**
196
+ * Solve the close approach problem for stroked, unextended curveB.
197
+ * * Sort the results shortest projection distance first.
198
+ * @return the number of results appended.
199
+ */
200
+ private appendDiscreteCloseApproachResults;
201
+ /**
202
+ * Compute the xy-intersection of a curve and a spiral.
203
+ * * When `curveA` is extended, duplicate solutions may be returned.
204
+ * @param curveA curve to intersect with spiralB. May also be a transition spiral.
205
+ * @param extendA0 whether to compute xy-intersections with curveA extended beyond its start.
206
+ * @param extendA1 whether to compute xy-intersections with curveA extended beyond its end.
207
+ * @param spiralB transition spiral to intersect with curveA.
208
+ * @param reversed whether `spiralB` data will be recorded in `detailA` of each result, and `curveA` data in `detailB`.
209
+ */
210
+ private dispatchCurveSpiral;
169
211
  /** Double dispatch handler for strongly typed spiral curve. */
170
212
  handleTransitionSpiral(spiral: TransitionSpiral3d): any;
171
213
  /** Double dispatch handler for strongly typed CurveChainWithDistanceIndex. */
@@ -1 +1 @@
1
- {"version":3,"file":"CurveCurveIntersectXY.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CurveCurveIntersectXY.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,cAAc,EAAsB,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAOlF,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAMrD,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAE7E,OAAO,EAA0C,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACzG,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,k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vD,QAAQ,EAAE,OAAO,GAChB,GAAG;IAqBN,iEAAiE;IACjE,OAAO,CAAC,2BAA2B;IAqCnC,OAAO,CAAC,MAAM,CAAC,wBAAwB;IAQvC;;;OAGG;IACH,OAAO,CAAC,uBAAuB;IAyB/B;;;OAGG;IACH,OAAO,CAAC,mCAAmC;IAe3C;;;OAGG;IACa,cAAc,CAAC,CAAC,EAAE,aAAa,GAAG,GAAG;IAwBrD,0DAA0D;IAC1C,mBAAmB,CAAC,QAAQ,EAAE,aAAa,GAAG,GAAG;IA+BjE,6DAA6D;IAC7C,kBAAkB,CAAC,GAAG,EAAE,YAAY,GAAG,GAAG;IAyB1D,sDAAsD;IACtC,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,GAAG;IAyB7C,gEAAgE;IAChD,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,GAAG;IAyBjE;;;;;;;;OAQG;IACH,OAAO,CAAC,2BAA2B;IAwDnC;;;;;;OAMG;IACH,OAAO,CAAC,WAAW;IAKnB,mHAAmH;IACnH,OAAO,CAAC,2BAA2B;IAuBnC;;;OAGG;IACH,OAAO,CAAC,iCAAiC;IAmBzC;;;;OAIG;IACH,OAAO,CAAC,kCAAkC;IAW1C;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;IAgB3B,+DAA+D;IAC/C,sBAAsB,CAAC,MAAM,EAAE,kBAAkB,GAAG,GAAG;IAUvE,8EAA8E;IAC9D,iCAAiC,CAAC,KAAK,EAAE,2BAA2B,GAAG,GAAG;IAK1F,4EAA4E;IAC5D,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,GAAG;CAgBpE"}
@@ -24,6 +24,7 @@ const SmallSystem_1 = require("../../numerics/SmallSystem");
24
24
  const Arc3d_1 = require("../Arc3d");
25
25
  const CurveChainWithDistanceIndex_1 = require("../CurveChainWithDistanceIndex");
26
26
  const CurveCollection_1 = require("../CurveCollection");
27
+ const CurveCurve_1 = require("../CurveCurve");
27
28
  const CurveLocationDetail_1 = require("../CurveLocationDetail");
28
29
  const CurvePrimitive_1 = require("../CurvePrimitive");
29
30
  const LineSegment3d_1 = require("../LineSegment3d");
@@ -90,9 +91,29 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
90
91
  this._coincidentGeometryContext = CoincidentGeometryOps_1.CoincidentGeometryQuery.create(tolerance);
91
92
  this._results = [];
92
93
  }
93
- /** Reset the geometry, leaving all other parts unchanged (and preserving accumulated intersections). */
94
- resetGeometry(geometryB) {
95
- this._geometryB = geometryB;
94
+ /**
95
+ * Reset geometryA extension flags.
96
+ * * Undefined inputs are ignored.
97
+ * * All other instance data is unchanged, including accumulated intersections.
98
+ */
99
+ resetGeometryA(extendA0, extendA1) {
100
+ if (extendA0 !== undefined)
101
+ this._extendA0 = extendA0;
102
+ if (extendA1 !== undefined)
103
+ this._extendA1 = extendA1;
104
+ }
105
+ /**
106
+ * Reset geometryB and its extension flags.
107
+ * * Undefined inputs are ignored.
108
+ * * All other instance data is unchanged, including accumulated intersections.
109
+ */
110
+ resetGeometryB(geometryB, extendB0, extendB1) {
111
+ if (geometryB)
112
+ this._geometryB = geometryB;
113
+ if (extendB0 !== undefined)
114
+ this._extendB0 = extendB0;
115
+ if (extendB1 !== undefined)
116
+ this._extendB1 = extendB1;
96
117
  }
97
118
  /** Accept the fraction if it falls inside (possibly extended) fraction range. */
98
119
  acceptFraction(extend0, fraction, extend1, fractionTol = 1.0e-12) {
@@ -134,14 +155,14 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
134
155
  * @param fractionB1 end of the subcurve of cpB
135
156
  * @param reversed whether to reverse the details in the recorded intersection pair
136
157
  * @param intervalDetails optional data for a coincident segment intersection
158
+ * @param fractionTol relative tolerance for comparing fractions to avoid duplicating the last intersection. Defaults to [[Geometry.smallAngleRadians]].
137
159
  */
138
- recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, cpB, fractionB0, fractionB1, reversed, intervalDetails) {
160
+ recordPointWithLocalFractions(localFractionA, cpA, fractionA0, fractionA1, localFractionB, cpB, fractionB0, fractionB1, reversed, intervalDetails, fractionTol) {
139
161
  let globalFractionA, globalFractionB;
140
162
  let globalFractionA1, globalFractionB1;
141
- const isInterval = intervalDetails !== undefined &&
142
- intervalDetails.detailA.hasFraction1 &&
143
- intervalDetails.detailB.hasFraction1;
144
- if (isInterval) {
163
+ let isInterval = false;
164
+ if (intervalDetails && intervalDetails.detailA.isInterval() && intervalDetails.detailB.isInterval()) {
165
+ isInterval = true;
145
166
  globalFractionA = Geometry_1.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction, fractionA1);
146
167
  globalFractionB = Geometry_1.Geometry.interpolate(fractionB0, intervalDetails.detailB.fraction, fractionB1);
147
168
  globalFractionA1 = Geometry_1.Geometry.interpolate(fractionA0, intervalDetails.detailA.fraction1, fractionA1);
@@ -157,13 +178,13 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
157
178
  const oldDetailA = this._results[numPrevious - 1].detailA;
158
179
  const oldDetailB = this._results[numPrevious - 1].detailB;
159
180
  if (reversed) {
160
- if (oldDetailB.isSameCurveAndFraction({ curve: cpA, fraction: globalFractionA }) &&
161
- oldDetailA.isSameCurveAndFraction({ curve: cpB, fraction: globalFractionB }))
181
+ if (oldDetailB.isSameCurveAndFraction({ curve: cpA, fraction: globalFractionA }, fractionTol) &&
182
+ oldDetailA.isSameCurveAndFraction({ curve: cpB, fraction: globalFractionB }, fractionTol))
162
183
  return;
163
184
  }
164
185
  else {
165
- if (oldDetailA.isSameCurveAndFraction({ curve: cpA, fraction: globalFractionA }) &&
166
- oldDetailB.isSameCurveAndFraction({ curve: cpB, fraction: globalFractionB }))
186
+ if (oldDetailA.isSameCurveAndFraction({ curve: cpA, fraction: globalFractionA }, fractionTol) &&
187
+ oldDetailB.isSameCurveAndFraction({ curve: cpB, fraction: globalFractionB }, fractionTol))
167
188
  return;
168
189
  }
169
190
  }
@@ -227,6 +248,8 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
227
248
  * fraction mapping. Assumes caller knows the _worldToLocal is present.
228
249
  */
229
250
  computeSegmentSegment3DH(cpA, extendA0, pointA0, fractionA0, pointA1, fractionA1, extendA1, cpB, extendB0, pointB0, fractionB0, pointB1, fractionB1, extendB1, reversed) {
251
+ if (undefined === this._worldToLocalPerspective)
252
+ return;
230
253
  const hA0 = CurveCurveIntersectXY._workPointA0H;
231
254
  const hA1 = CurveCurveIntersectXY._workPointA1H;
232
255
  const hB0 = CurveCurveIntersectXY._workPointB0H;
@@ -781,30 +804,30 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
781
804
  * We take care of extend variables of geometry's children here if geometry is Path or Loop.
782
805
  */
783
806
  dispatchCurveCollection(geomA, geomAHandler) {
784
- const geomB = this._geometryB; // save
807
+ const geomB = this._geometryB;
785
808
  if (!geomB || !geomB.children || !(geomB instanceof CurveCollection_1.CurveCollection))
786
809
  return;
787
810
  const children = geomB.children;
788
- const extendB0 = this._extendB0; // save
789
- const extendB1 = this._extendB1; // save
811
+ const saveExtendB0 = this._extendB0;
812
+ const saveExtendB1 = this._extendB1;
790
813
  for (let i = 0; i < children.length; i++) {
791
- this.resetGeometry(children[i]);
814
+ let extendB0 = saveExtendB0;
815
+ let extendB1 = saveExtendB1;
792
816
  if (geomB instanceof Path_1.Path && children.length > 1) {
793
817
  if (i === 0)
794
- this._extendB1 = false; // first child can only extend from start
818
+ extendB1 = false; // first child can only extend from start
795
819
  else if (i === children.length - 1)
796
- this._extendB0 = false; // last child can only extend from end
820
+ extendB0 = false; // last child can only extend from end
797
821
  else
798
- this._extendB0 = this._extendB1 = false; // middle children cannot extend
822
+ extendB0 = extendB1 = false; // middle children cannot extend
799
823
  }
800
824
  else if (geomB instanceof Loop_1.Loop) {
801
- this._extendB0 = this._extendB1 = false; // Loops cannot extend
825
+ extendB0 = extendB1 = false; // Loops cannot extend
802
826
  }
827
+ this.resetGeometryB(children[i], extendB0, extendB1);
803
828
  geomAHandler(geomA);
804
- this._extendB0 = extendB0; // restore
805
- this._extendB1 = extendB1; // restore
806
829
  }
807
- this.resetGeometry(geomB); // restore
830
+ this.resetGeometryB(geomB, saveExtendB0, saveExtendB1);
808
831
  }
809
832
  /**
810
833
  * Low level dispatch of CurveChainWithDistanceIndex.
@@ -818,36 +841,39 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
818
841
  }
819
842
  const index0 = this._results.length;
820
843
  const geomB = this._geometryB; // save
821
- this.resetGeometry(geomB.path);
844
+ this.resetGeometryB(geomB.path);
822
845
  this.dispatchCurveCollection(geomA, geomAHandler);
823
- this.resetGeometry(geomB); // restore
846
+ this.resetGeometryB(geomB); // restore
824
847
  this._results = CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex.convertChildDetailToChainDetail(this._results, index0, undefined, geomB, true);
825
848
  }
826
849
  /**
827
- * Invoke `child.dispatchToGeometryHandler(this)` for each child in the array returned by the query `g.children`.
828
- * We take care of extend variables of geometry's children here if geometry is Path or Loop.
850
+ * Invoke dispatch on each child of `g` as "geometryA".
851
+ * * If `g` is a `Path` or `Loop`, adjust extension flags for geometryA accordingly.
829
852
  */
830
853
  handleChildren(g) {
831
854
  const children = g.children;
832
- const extendA0 = this._extendA0; // save
833
- const extendA1 = this._extendA1; // save
834
- if (children)
835
- for (let i = 0; i < children.length; i++) {
836
- if (g instanceof Path_1.Path && children.length > 1) {
837
- if (i === 0)
838
- this._extendA1 = false; // first child can only extend from start
839
- else if (i === children.length - 1)
840
- this._extendA0 = false; // last child can only extend from end
841
- else
842
- this._extendA0 = this._extendA1 = false; // middle children cannot extend
843
- }
844
- else if (g instanceof Loop_1.Loop) {
845
- this._extendA0 = this._extendA1 = false; // Loops cannot extend
846
- }
847
- children[i].dispatchToGeometryHandler(this);
848
- this._extendA0 = extendA0; // restore
849
- this._extendA1 = extendA1; // restore
855
+ if (!children)
856
+ return;
857
+ const saveExtendA0 = this._extendA0;
858
+ const saveExtendA1 = this._extendA1;
859
+ for (let i = 0; i < children.length; i++) {
860
+ let extendA0 = saveExtendA0;
861
+ let extendA1 = saveExtendA1;
862
+ if (g instanceof Path_1.Path && children.length > 1) {
863
+ if (i === 0)
864
+ extendA1 = false; // first child can only extend from start
865
+ else if (i === children.length - 1)
866
+ extendA0 = false; // last child can only extend from end
867
+ else
868
+ extendA0 = extendA1 = false; // middle children cannot extend
869
+ }
870
+ else if (g instanceof Loop_1.Loop) {
871
+ extendA0 = extendA1 = false; // Loops cannot extend
850
872
  }
873
+ this.resetGeometryA(extendA0, extendA1);
874
+ children[i].dispatchToGeometryHandler(this);
875
+ }
876
+ this.resetGeometryA(saveExtendA0, saveExtendA1);
851
877
  }
852
878
  /** Double dispatch handler for strongly typed segment. */
853
879
  handleLineSegment3d(segmentA) {
@@ -865,12 +891,7 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
865
891
  this.dispatchSegmentBsplineCurve(segmentA, this._extendA0, segmentA.point0Ref, 0.0, segmentA.point1Ref, 1.0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
866
892
  }
867
893
  else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
868
- const spiralApproximation = LineString3d_1.LineString3d.create();
869
- this._geometryB.emitStrokes(spiralApproximation);
870
- const numPreviousResults = this._results.length;
871
- this.computeSegmentLineString(segmentA, this._extendA0, this._extendA1, spiralApproximation, false, false, false);
872
- const numberOfNewResults = this._results.length - numPreviousResults;
873
- this.refineSpiralResultsByNewton(segmentA, this._geometryB, numberOfNewResults);
894
+ this.dispatchCurveSpiral(segmentA, this._extendA0, this._extendA1, this._geometryB, false);
874
895
  }
875
896
  else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
876
897
  this.dispatchCurveCollection(segmentA, this.handleLineSegment3d.bind(this));
@@ -896,12 +917,7 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
896
917
  this.dispatchLineStringBSplineCurve(lsA, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
897
918
  }
898
919
  else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
899
- const spiralApproximation = LineString3d_1.LineString3d.create();
900
- this._geometryB.emitStrokes(spiralApproximation);
901
- const numPreviousResults = this._results.length;
902
- this.computeLineStringLineString(lsA, this._extendA0, this._extendA1, spiralApproximation, false, false, false);
903
- const numberOfNewResults = this._results.length - numPreviousResults;
904
- this.refineSpiralResultsByNewton(lsA, this._geometryB, numberOfNewResults);
920
+ this.dispatchCurveSpiral(lsA, this._extendA0, this._extendA1, this._geometryB, false);
905
921
  }
906
922
  else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
907
923
  this.dispatchCurveCollection(lsA, this.handleLineString3d.bind(this));
@@ -912,100 +928,212 @@ class CurveCurveIntersectXY extends GeometryHandler_1.RecurseToCurvesGeometryHan
912
928
  return undefined;
913
929
  }
914
930
  /** Double dispatch handler for strongly typed arc. */
915
- handleArc3d(arc0) {
931
+ handleArc3d(arcA) {
916
932
  if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
917
- this.dispatchSegmentArc(this._geometryB, this._extendB0, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB1, arc0, this._extendA0, this._extendA1, true);
933
+ this.dispatchSegmentArc(this._geometryB, this._extendB0, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB1, arcA, this._extendA0, this._extendA1, true);
918
934
  }
919
935
  else if (this._geometryB instanceof LineString3d_1.LineString3d) {
920
- this.computeArcLineString(arc0, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
936
+ this.computeArcLineString(arcA, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
921
937
  }
922
938
  else if (this._geometryB instanceof Arc3d_1.Arc3d) {
923
- this.dispatchArcArc(arc0, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
939
+ this.dispatchArcArc(arcA, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
924
940
  }
925
941
  else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
926
- this.dispatchArcBsplineCurve3d(arc0, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
942
+ this.dispatchArcBsplineCurve3d(arcA, this._extendA0, this._extendA1, this._geometryB, this._extendB0, this._extendB1, false);
927
943
  }
928
944
  else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
929
- const spiralApproximation = LineString3d_1.LineString3d.create();
930
- this._geometryB.emitStrokes(spiralApproximation);
931
- const numPreviousResults = this._results.length;
932
- this.computeArcLineString(arc0, this._extendA0, this._extendA1, spiralApproximation, false, false, false);
933
- const numberOfNewResults = this._results.length - numPreviousResults;
934
- this.refineSpiralResultsByNewton(arc0, this._geometryB, numberOfNewResults);
945
+ this.dispatchCurveSpiral(arcA, this._extendA0, this._extendA1, this._geometryB, false);
935
946
  }
936
947
  else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
937
- this.dispatchCurveCollection(arc0, this.handleArc3d.bind(this));
948
+ this.dispatchCurveCollection(arcA, this.handleArc3d.bind(this));
938
949
  }
939
950
  else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
940
- this.dispatchCurveChainWithDistanceIndex(arc0, this.handleArc3d.bind(this));
951
+ this.dispatchCurveChainWithDistanceIndex(arcA, this.handleArc3d.bind(this));
941
952
  }
942
953
  return undefined;
943
954
  }
944
955
  /** Double dispatch handler for strongly typed bspline curve. */
945
- handleBSplineCurve3d(curve) {
956
+ handleBSplineCurve3d(curveA) {
946
957
  if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
947
- this.dispatchSegmentBsplineCurve(this._geometryB, this._extendB0, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB1, curve, this._extendA0, this._extendA1, true);
958
+ this.dispatchSegmentBsplineCurve(this._geometryB, this._extendB0, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB1, curveA, this._extendA0, this._extendA1, true);
948
959
  }
949
960
  else if (this._geometryB instanceof LineString3d_1.LineString3d) {
950
- this.dispatchLineStringBSplineCurve(this._geometryB, this._extendB0, this._extendB1, curve, this._extendA0, this._extendA1, true);
961
+ this.dispatchLineStringBSplineCurve(this._geometryB, this._extendB0, this._extendB1, curveA, this._extendA0, this._extendA1, true);
951
962
  }
952
963
  else if (this._geometryB instanceof Arc3d_1.Arc3d) {
953
- this.dispatchArcBsplineCurve3d(this._geometryB, this._extendB0, this._extendB1, curve, this._extendA0, this._extendA1, true);
964
+ this.dispatchArcBsplineCurve3d(this._geometryB, this._extendB0, this._extendB1, curveA, this._extendA0, this._extendA1, true);
954
965
  }
955
966
  else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3dBase) {
956
- this.dispatchBSplineCurve3dBSplineCurve3d(curve, this._geometryB, false);
967
+ this.dispatchBSplineCurve3dBSplineCurve3d(curveA, this._geometryB, false);
957
968
  }
958
969
  else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
959
- const spiralApproximation = LineString3d_1.LineString3d.create();
960
- this._geometryB.emitStrokes(spiralApproximation);
961
- const numPreviousResults = this._results.length;
962
- this.dispatchLineStringBSplineCurve(spiralApproximation, false, false, curve, this._extendA0, this._extendA1, true);
963
- const numberOfNewResults = this._results.length - numPreviousResults;
964
- this.refineSpiralResultsByNewton(curve, this._geometryB, numberOfNewResults);
970
+ this.dispatchCurveSpiral(curveA, this._extendA0, this._extendA1, this._geometryB, false);
965
971
  }
966
972
  else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
967
- this.dispatchCurveCollection(curve, this.handleBSplineCurve3d.bind(this));
973
+ this.dispatchCurveCollection(curveA, this.handleBSplineCurve3d.bind(this));
968
974
  }
969
975
  else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
970
- this.dispatchCurveChainWithDistanceIndex(curve, this.handleBSplineCurve3d.bind(this));
976
+ this.dispatchCurveChainWithDistanceIndex(curveA, this.handleBSplineCurve3d.bind(this));
971
977
  }
972
978
  return undefined;
973
979
  }
974
980
  /**
975
- * Assuming the tail of `this._results` holds the given number of approximate solutions to the curve-spiral
976
- * xy-intersection problem, replace each with its Newton refinement, unless it doesn't converge, in which case
977
- * it is removed.
978
- * @param spiral The transition spiral.
979
- * @param otherCurve The other curve primitive.
980
- * @param numberOfNewResults The number of results in the tail of `this._results` to be refined.
981
- * @param reversed Whether the spiral is geometryA (true) or geometryB (false).
981
+ * Process tail of `this._results` for xy-intersections between the curve and spiral.
982
+ * * If a result is not already an intersection, refine it via Newton iteration unless it doesn't converge, in which
983
+ * case remove it.
984
+ * @param curveA The other curve primitive. May also be a transition spiral.
985
+ * @param spiralB The transition spiral.
986
+ * @param index0 index of first entry in tail of `this._results` to refine.
987
+ * @param reversed Whether `spiralB` data is in `detailA` of each recorded pair, and `curveA` data in `detailB`.
982
988
  */
983
- refineSpiralResultsByNewton(otherCurve, spiral, numberOfNewResults, reversed = false) {
984
- const resultsToBeRefined = this._results.slice(this._results.length - numberOfNewResults);
985
- this._results.length -= numberOfNewResults; // keep already refined results
986
- for (const detail of resultsToBeRefined) {
987
- let spiralFraction = reversed ? detail.detailA.fraction : detail.detailB.fraction;
988
- let otherFraction = reversed ? detail.detailB.fraction : detail.detailA.fraction;
989
- const xyMatchingFunction = new Newton_1.CurveCurveIntersectionXYRRToRRD(spiral, otherCurve);
990
- const newtonSearcher = new Newton_1.Newton2dUnboundedWithDerivative(xyMatchingFunction);
991
- newtonSearcher.setUV(spiralFraction, otherFraction);
989
+ refineSpiralResultsByNewton(curveA, spiralB, index0, reversed = false) {
990
+ if (index0 >= this._results.length)
991
+ return;
992
+ // ASSUME: seeds in results tail are ordered by most accurate first, as only the first convergence within tolerance is recorded.
993
+ const xyMatchingFunction = new Newton_1.CurveCurveIntersectionXYRRToRRD(curveA, spiralB);
994
+ const maxIterations = 100; // observed 73 iterations to convergence in tangent case
995
+ const newtonSearcher = new Newton_1.Newton2dUnboundedWithDerivative(xyMatchingFunction, maxIterations);
996
+ const fractionTol = 2 * newtonSearcher.stepSizeTolerance; // relative cluster diameter for Newton convergence
997
+ const comparePairs = (a, b) => {
998
+ (0, core_bentley_1.assert)(() => a.detailA.curve === b.detailA.curve && a.detailB.curve === b.detailB.curve, "pairs are compatible");
999
+ // sort on either fraction, then on the point, using appropriate tolerances for each
1000
+ if (Geometry_1.Geometry.isAlmostEqualNumber(a.detailA.fraction, b.detailA.fraction, fractionTol))
1001
+ return 0;
1002
+ if (a.detailA.point.isAlmostEqualXY(b.detailA.point, this._coincidentGeometryContext.tolerance))
1003
+ return 0;
1004
+ return a.detailA.fraction - b.detailA.fraction;
1005
+ };
1006
+ const myResults = new core_bentley_1.SortedArray(comparePairs, core_bentley_1.DuplicatePolicy.Retain);
1007
+ const pushToMyResults = (cpA, fA, cpB, fB) => {
1008
+ const detailA = CurveLocationDetail_1.CurveLocationDetail.createCurveFractionPoint(cpA, fA, cpA.fractionToPoint(fA));
1009
+ const detailB = CurveLocationDetail_1.CurveLocationDetail.createCurveFractionPoint(cpB, fB, cpB.fractionToPoint(fB));
1010
+ detailA.setIntervalRole(CurveLocationDetail_1.CurveIntervalRole.isolated);
1011
+ detailB.setIntervalRole(CurveLocationDetail_1.CurveIntervalRole.isolated);
1012
+ let pushed = false;
1013
+ myResults.insert(new CurveLocationDetail_1.CurveLocationDetailPair(reversed ? detailB : detailA, reversed ? detailA : detailB), () => pushed = true);
1014
+ return pushed;
1015
+ };
1016
+ for (let i = index0; i < this._results.length; i++) {
1017
+ const pair = this._results[i];
1018
+ const detailA = reversed ? pair.detailB : pair.detailA;
1019
+ const detailB = reversed ? pair.detailA : pair.detailB;
1020
+ (0, core_bentley_1.assert)(detailB.curve instanceof LineString3d_1.LineString3d, "Caller has discretized the spiral");
1021
+ const extendA0 = reversed ? this._extendB0 : this._extendA0;
1022
+ const extendA1 = reversed ? this._extendB1 : this._extendA1;
1023
+ newtonSearcher.setUV(detailA.fraction, detailB.fraction); // use linestring fraction as spiral param; it generally yields a closer point than fractional length!
992
1024
  if (newtonSearcher.runIterations()) {
993
- spiralFraction = newtonSearcher.getU();
994
- otherFraction = newtonSearcher.getV();
995
- if (this.acceptFraction(false, spiralFraction, false) && this.acceptFraction(false, otherFraction, false))
996
- this.recordPointWithLocalFractions(otherFraction, otherCurve, 0, 1, spiralFraction, spiral, 0, 1, reversed);
1025
+ const fractionA = newtonSearcher.getU();
1026
+ const fractionB = newtonSearcher.getV();
1027
+ if (this.acceptFraction(extendA0, fractionA, extendA1) && this.acceptFraction(false, fractionB, false))
1028
+ pushToMyResults(curveA, fractionA, spiralB, fractionB);
1029
+ }
1030
+ else if (newtonSearcher.numIterations < 10) {
1031
+ // if Newton failed early due to vanishing (partial) derivative, check for a root there
1032
+ const fractionA = newtonSearcher.getU();
1033
+ const fractionB = newtonSearcher.getV();
1034
+ if (curveA.fractionToPoint(fractionA).isAlmostEqualXY(spiralB.fractionToPoint(fractionB), this._coincidentGeometryContext.tolerance))
1035
+ pushToMyResults(curveA, fractionA, spiralB, fractionB);
1036
+ }
1037
+ }
1038
+ this._results.splice(index0, this._results.length - index0, ...myResults.extractArray());
1039
+ }
1040
+ /**
1041
+ * Append stroke points and return the line string.
1042
+ * * This is a convenient wrapper for [[CurvePrimitive.emitStrokes]] but the analogous instance method cannot be added
1043
+ * to that class due to the ensuing recursion with subclass [[LineString3d]].
1044
+ * @param options options for stroking the instance curve.
1045
+ * @param result object to receive appended stroke points; if omitted, a new object is created, populated, and returned.
1046
+ */
1047
+ strokeCurve(curve, options, result) {
1048
+ const ls = result ? result : LineString3d_1.LineString3d.create();
1049
+ curve.emitStrokes(ls, options);
1050
+ return ls;
1051
+ }
1052
+ /** Compute an approximation to the max chord height error of the stroked spiral, and another curve if a spiral. */
1053
+ computeMaxSpiralStrokeError(spiral0, ls0, spiral1, ls1) {
1054
+ let maxError = 0;
1055
+ if (ls0.numEdges() > 0) {
1056
+ // the max error occurs at the spiral end with higher curvature
1057
+ const k0 = spiral0.fractionToCurvature(0);
1058
+ const k1 = spiral0.fractionToCurvature(1);
1059
+ const iChord = (k0 !== undefined && k1 !== undefined && Math.abs(k0) > Math.abs(k1)) ? 0 : ls0.numEdges() - 1;
1060
+ const midPoint = Point3dVector3d_1.Point3d.create();
1061
+ const detail = CurveLocationDetail_1.CurveLocationDetail.create();
1062
+ if (ls0.packedPoints.interpolateIndexIndex(iChord, 0.5, iChord + 1, midPoint)) {
1063
+ if (spiral0.closestPoint(midPoint, false, detail))
1064
+ maxError = detail.a;
1065
+ }
1066
+ if (spiral1 && spiral1 instanceof TransitionSpiral3d_1.TransitionSpiral3d && ls1 && ls1 instanceof LineString3d_1.LineString3d) {
1067
+ const maxError1 = this.computeMaxSpiralStrokeError(spiral1, ls1);
1068
+ if (maxError1 > maxError)
1069
+ maxError = maxError1;
997
1070
  }
998
1071
  }
1072
+ return maxError;
1073
+ }
1074
+ /**
1075
+ * Solve the intersection problem for stroked, unextended curveB.
1076
+ * * @return the number of results appended.
1077
+ */
1078
+ appendDiscreteIntersectionResults(curveA, extendA0, extendA1, lsB, reversed) {
1079
+ const i0 = this._results.length;
1080
+ // handleLineString3d requires us to swap geometries:
1081
+ const geomB = this._geometryB;
1082
+ const extendB0 = this._extendB0;
1083
+ const extendB1 = this._extendB1;
1084
+ this.resetGeometryA(false, false); // lsB is never extended
1085
+ this.resetGeometryB(curveA, extendA0, extendA1);
1086
+ this.handleLineString3d(lsB); // this puts lsB data in detailA, as expected when reversed is true
1087
+ if (!reversed) { // swap lsB data to detailB
1088
+ for (let i = i0; i < this._results.length; i++)
1089
+ this._results[i].swapDetails();
1090
+ }
1091
+ this.resetGeometryA(extendA0, extendA1);
1092
+ this.resetGeometryB(geomB, extendB0, extendB1);
1093
+ return this._results.length - i0;
1094
+ }
1095
+ /**
1096
+ * Solve the close approach problem for stroked, unextended curveB.
1097
+ * * Sort the results shortest projection distance first.
1098
+ * @return the number of results appended.
1099
+ */
1100
+ appendDiscreteCloseApproachResults(curveA, lsB, maxDistance, reversed) {
1101
+ const i0 = this._results.length;
1102
+ const closeApproachPairs = CurveCurve_1.CurveCurve.closeApproachProjectedXYPairs(reversed ? lsB : curveA, reversed ? curveA : lsB, maxDistance);
1103
+ closeApproachPairs.sort((p0, p1) => p0.detailA.a - p1.detailA.a);
1104
+ this._results.push(...closeApproachPairs);
1105
+ return this._results.length - i0;
1106
+ }
1107
+ /**
1108
+ * Compute the xy-intersection of a curve and a spiral.
1109
+ * * When `curveA` is extended, duplicate solutions may be returned.
1110
+ * @param curveA curve to intersect with spiralB. May also be a transition spiral.
1111
+ * @param extendA0 whether to compute xy-intersections with curveA extended beyond its start.
1112
+ * @param extendA1 whether to compute xy-intersections with curveA extended beyond its end.
1113
+ * @param spiralB transition spiral to intersect with curveA.
1114
+ * @param reversed whether `spiralB` data will be recorded in `detailA` of each result, and `curveA` data in `detailB`.
1115
+ */
1116
+ dispatchCurveSpiral(curveA, extendA0, extendA1, spiralB, reversed) {
1117
+ let cpA = curveA;
1118
+ if (curveA instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
1119
+ cpA = this.strokeCurve(curveA);
1120
+ extendA0 = extendA1 = false;
1121
+ }
1122
+ const cpB = this.strokeCurve(spiralB);
1123
+ const maxError = 1.01 * this.computeMaxSpiralStrokeError(spiralB, cpB, curveA, cpA);
1124
+ const index0 = this._results.length;
1125
+ // append seeds computed by solving discretized spiral problems, then refine the seeds via Newton
1126
+ this.appendDiscreteIntersectionResults(cpA, extendA0, extendA1, cpB, reversed); // recorded first because more accurate
1127
+ this.appendDiscreteCloseApproachResults(cpA, cpB, maxError, reversed); // seeds for finding tangent intersections
1128
+ this.refineSpiralResultsByNewton(curveA, spiralB, index0, reversed);
999
1129
  }
1000
1130
  /** Double dispatch handler for strongly typed spiral curve. */
1001
1131
  handleTransitionSpiral(spiral) {
1002
- if (this._geometryB instanceof CurvePrimitive_1.CurvePrimitive) { // this also handles CurveChainWithDistanceIndex
1003
- const spiralApproximation = LineString3d_1.LineString3d.create();
1004
- spiral.emitStrokes(spiralApproximation);
1005
- const numPreviousResults = this._results.length;
1006
- this.handleLineString3d(spiralApproximation);
1007
- const numberOfNewResults = this._results.length - numPreviousResults;
1008
- this.refineSpiralResultsByNewton(this._geometryB, spiral, numberOfNewResults, true);
1132
+ if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
1133
+ this.dispatchCurveChainWithDistanceIndex(spiral, this.handleTransitionSpiral.bind(this));
1134
+ }
1135
+ else if (this._geometryB instanceof CurvePrimitive_1.CurvePrimitive) {
1136
+ this.dispatchCurveSpiral(this._geometryB, this._extendB0, this._extendB1, spiral, true);
1009
1137
  }
1010
1138
  else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
1011
1139
  this.dispatchCurveCollection(spiral, this.handleTransitionSpiral.bind(this));