@itwin/core-geometry 5.9.0-dev.9 → 5.10.0-dev.3

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 (494) hide show
  1. package/CHANGELOG.md +16 -1
  2. package/lib/cjs/Constant.js.map +1 -1
  3. package/lib/cjs/Geometry.js.map +1 -1
  4. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  5. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  7. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  8. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  9. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  10. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  11. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  12. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  13. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  14. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  15. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  16. package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
  17. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  18. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  19. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  20. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  21. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  22. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  23. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  24. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  25. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  26. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  27. package/lib/cjs/core-geometry.js.map +1 -1
  28. package/lib/cjs/curve/Arc3d.js.map +1 -1
  29. package/lib/cjs/curve/ConstrainedCurve2d.js.map +1 -1
  30. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  31. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  32. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  33. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  34. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  35. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  36. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  37. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  38. package/lib/cjs/curve/CurveOps.js.map +1 -1
  39. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  40. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  41. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  42. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  43. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  44. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  45. package/lib/cjs/curve/LineString3d.js.map +1 -1
  46. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  47. package/lib/cjs/curve/Loop.js +3 -1
  48. package/lib/cjs/curve/Loop.js.map +1 -1
  49. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  50. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  51. package/lib/cjs/curve/Path.js.map +1 -1
  52. package/lib/cjs/curve/PointString3d.js.map +1 -1
  53. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  54. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  55. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  56. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  57. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  58. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  59. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  60. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  61. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  62. package/lib/cjs/curve/RegionOps.js.map +1 -1
  63. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  64. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  65. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  66. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  67. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  68. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  69. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  70. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  71. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  72. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  73. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +21 -27
  74. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  75. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +97 -152
  76. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  77. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts +15 -14
  78. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  79. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +144 -163
  80. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  81. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  82. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  83. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  84. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  85. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  86. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  87. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  88. package/lib/cjs/curve/internalContexts/PointToCurveTangentHandler.js.map +1 -1
  89. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  90. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  91. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  92. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  93. package/lib/cjs/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js.map +1 -1
  94. package/lib/cjs/curve/internalContexts/geometry2d/ConstraintSet.js.map +1 -1
  95. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2d.js.map +1 -1
  96. package/lib/cjs/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js.map +1 -1
  97. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedCircle2d.js.map +1 -1
  98. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedEllipse2d.js.map +1 -1
  99. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js.map +1 -1
  100. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedLine2d.js.map +1 -1
  101. package/lib/cjs/curve/internalContexts/geometry2d/UnboundedParabola2d.js.map +1 -1
  102. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  103. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  104. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  105. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  106. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  107. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  108. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  109. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  110. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  111. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  112. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  113. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  114. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  115. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  116. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  117. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  118. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  119. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  120. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  121. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  122. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  123. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  124. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  125. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  126. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  127. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  128. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  129. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  130. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  131. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  132. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  133. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  134. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  135. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  136. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  137. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  138. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  139. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  140. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  141. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  142. package/lib/cjs/geometry3d/PointHelpers.js +6 -7
  143. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  144. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  145. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  146. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  147. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  148. package/lib/cjs/geometry3d/Range.js.map +1 -1
  149. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  150. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  151. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  152. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  153. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  154. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  155. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  156. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  157. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  158. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  159. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  160. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  161. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  162. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  163. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  164. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  165. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  166. package/lib/cjs/numerics/Complex.js.map +1 -1
  167. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  168. package/lib/cjs/numerics/Newton.d.ts +10 -2
  169. package/lib/cjs/numerics/Newton.d.ts.map +1 -1
  170. package/lib/cjs/numerics/Newton.js.map +1 -1
  171. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  172. package/lib/cjs/numerics/PolarData.js.map +1 -1
  173. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  174. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  175. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  176. package/lib/cjs/numerics/SmallSystem.js.map +1 -1
  177. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  178. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  179. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  180. package/lib/cjs/polyface/AuxData.js.map +1 -1
  181. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  182. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  183. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  184. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  185. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  186. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  187. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  188. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
  189. package/lib/cjs/polyface/Polyface.js.map +1 -1
  190. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  191. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  192. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  193. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  194. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  195. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  196. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  197. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  198. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  199. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  200. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  201. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  202. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  203. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  204. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  205. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  206. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  207. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  208. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  209. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  210. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  211. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  212. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  213. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  214. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  215. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  216. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  217. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  218. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  219. package/lib/cjs/solid/Box.js.map +1 -1
  220. package/lib/cjs/solid/Cone.js.map +1 -1
  221. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  222. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  223. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  224. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  225. package/lib/cjs/solid/Sphere.js.map +1 -1
  226. package/lib/cjs/solid/SweepContour.js.map +1 -1
  227. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  228. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  229. package/lib/cjs/topology/Graph.js.map +1 -1
  230. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  231. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  232. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  233. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  234. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  235. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  236. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  237. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  238. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  239. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  240. package/lib/cjs/topology/MaskManager.js.map +1 -1
  241. package/lib/cjs/topology/Merging.js.map +1 -1
  242. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  243. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  244. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  245. package/lib/cjs/topology/Triangulation.js.map +1 -1
  246. package/lib/cjs/topology/Voronoi.js.map +1 -1
  247. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  248. package/lib/esm/Constant.js.map +1 -1
  249. package/lib/esm/Geometry.js.map +1 -1
  250. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  251. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  252. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  253. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  254. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  255. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  256. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  257. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  258. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  259. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  260. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  261. package/lib/esm/bspline/KnotVector.js.map +1 -1
  262. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  263. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  264. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  265. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  266. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  267. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  268. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  269. package/lib/esm/clipping/ClipVector.js.map +1 -1
  270. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  271. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  272. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  273. package/lib/esm/core-geometry.js.map +1 -1
  274. package/lib/esm/curve/Arc3d.js.map +1 -1
  275. package/lib/esm/curve/ConstrainedCurve2d.js.map +1 -1
  276. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  277. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  278. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  279. package/lib/esm/curve/CurveCollection.js.map +1 -1
  280. package/lib/esm/curve/CurveCurve.js.map +1 -1
  281. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  282. package/lib/esm/curve/CurveFactory.js.map +1 -1
  283. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  284. package/lib/esm/curve/CurveOps.js.map +1 -1
  285. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  286. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  287. package/lib/esm/curve/CurveTypes.js.map +1 -1
  288. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  289. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  290. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  291. package/lib/esm/curve/LineString3d.js.map +1 -1
  292. package/lib/esm/curve/Loop.d.ts.map +1 -1
  293. package/lib/esm/curve/Loop.js +3 -1
  294. package/lib/esm/curve/Loop.js.map +1 -1
  295. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  296. package/lib/esm/curve/ParityRegion.js.map +1 -1
  297. package/lib/esm/curve/Path.js.map +1 -1
  298. package/lib/esm/curve/PointString3d.js.map +1 -1
  299. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  300. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  301. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  302. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  303. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  304. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  305. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  306. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  307. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  308. package/lib/esm/curve/RegionOps.js.map +1 -1
  309. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  310. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  311. package/lib/esm/curve/UnionRegion.js.map +1 -1
  312. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  313. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  314. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  315. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  316. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  317. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  318. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  319. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +21 -27
  320. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  321. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +98 -153
  322. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  323. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts +15 -14
  324. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  325. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +144 -163
  326. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  327. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  328. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  329. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  330. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  331. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  332. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  333. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  334. package/lib/esm/curve/internalContexts/PointToCurveTangentHandler.js.map +1 -1
  335. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  336. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  337. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  338. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  339. package/lib/esm/curve/internalContexts/geometry2d/ConstrainedImplicitCurve2d.js.map +1 -1
  340. package/lib/esm/curve/internalContexts/geometry2d/ConstraintSet.js.map +1 -1
  341. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2d.js.map +1 -1
  342. package/lib/esm/curve/internalContexts/geometry2d/ImplicitCurve2dConverter.js.map +1 -1
  343. package/lib/esm/curve/internalContexts/geometry2d/UnboundedCircle2d.js.map +1 -1
  344. package/lib/esm/curve/internalContexts/geometry2d/UnboundedEllipse2d.js.map +1 -1
  345. package/lib/esm/curve/internalContexts/geometry2d/UnboundedHyperbola2d.js.map +1 -1
  346. package/lib/esm/curve/internalContexts/geometry2d/UnboundedLine2d.js.map +1 -1
  347. package/lib/esm/curve/internalContexts/geometry2d/UnboundedParabola2d.js.map +1 -1
  348. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  349. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  350. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  351. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  352. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  353. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  354. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  355. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  356. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  357. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  358. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  359. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  360. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  361. package/lib/esm/geometry3d/Angle.js.map +1 -1
  362. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  363. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  364. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  365. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  366. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  367. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  368. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  369. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  370. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  371. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  372. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  373. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  374. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  375. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  376. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  377. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  378. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  379. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  380. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  381. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  382. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  383. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  384. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  385. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  386. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  387. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  388. package/lib/esm/geometry3d/PointHelpers.js +6 -7
  389. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  390. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  391. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  392. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  393. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  394. package/lib/esm/geometry3d/Range.js.map +1 -1
  395. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  396. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  397. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  398. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  399. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  400. package/lib/esm/geometry3d/Transform.js.map +1 -1
  401. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  402. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  403. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  404. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  405. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  406. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  407. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  408. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  409. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  410. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  411. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  412. package/lib/esm/numerics/Complex.js.map +1 -1
  413. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  414. package/lib/esm/numerics/Newton.d.ts +10 -2
  415. package/lib/esm/numerics/Newton.d.ts.map +1 -1
  416. package/lib/esm/numerics/Newton.js.map +1 -1
  417. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  418. package/lib/esm/numerics/PolarData.js.map +1 -1
  419. package/lib/esm/numerics/Polynomials.js.map +1 -1
  420. package/lib/esm/numerics/Quadrature.js.map +1 -1
  421. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  422. package/lib/esm/numerics/SmallSystem.js.map +1 -1
  423. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  424. package/lib/esm/numerics/UnionFind.js.map +1 -1
  425. package/lib/esm/numerics/UsageSums.js.map +1 -1
  426. package/lib/esm/polyface/AuxData.js.map +1 -1
  427. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  428. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  429. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  430. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  431. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  432. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  433. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  434. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
  435. package/lib/esm/polyface/Polyface.js.map +1 -1
  436. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  437. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  438. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  439. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  440. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  441. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  442. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  443. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  444. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  445. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  446. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  447. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  448. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  449. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  450. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  451. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  452. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  453. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  454. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  455. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  456. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  457. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  458. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  459. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  460. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  461. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  462. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  463. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  464. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  465. package/lib/esm/solid/Box.js.map +1 -1
  466. package/lib/esm/solid/Cone.js.map +1 -1
  467. package/lib/esm/solid/LinearSweep.js.map +1 -1
  468. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  469. package/lib/esm/solid/RuledSweep.js.map +1 -1
  470. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  471. package/lib/esm/solid/Sphere.js.map +1 -1
  472. package/lib/esm/solid/SweepContour.js.map +1 -1
  473. package/lib/esm/solid/TorusPipe.js.map +1 -1
  474. package/lib/esm/topology/ChainMerge.js.map +1 -1
  475. package/lib/esm/topology/Graph.js.map +1 -1
  476. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  477. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  478. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  479. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  480. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  481. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  482. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  483. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  484. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  485. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  486. package/lib/esm/topology/MaskManager.js.map +1 -1
  487. package/lib/esm/topology/Merging.js.map +1 -1
  488. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  489. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  490. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  491. package/lib/esm/topology/Triangulation.js.map +1 -1
  492. package/lib/esm/topology/Voronoi.js.map +1 -1
  493. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  494. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"ChainCollectorContext.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/ChainCollectorContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAM/F,wDAAiD;AACjD,sDAAmD;AACnD,kCAA+B;AAC/B,kCAA+B;AAE/B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,qBAAqB;IACxB,OAAO,CAAqB;IAC5B,WAAW,CAAU;IAErB,MAAM,CAAC,aAAa,CAAU;IAC9B,MAAM,CAAC,aAAa,CAAU;IAEtC;;OAEG;IACK,YAAY,CAAC,SAA0B;QAC7C,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,IAAI,SAAS;YACX,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IACO,qBAAqB;QAC3B,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC;YAC3B,IAAI,CAAC,YAA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AC;QAC/F,qBAAqB,CAAC,aAAa,GAAG,UAAU,CAAC,UAAU,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;QACjG,OAAO,QAAQ;YACb,CAAC,CAAC,CAAC,qBAAqB,CAAC,aAAa,CAAC,eAAe,CAAC,qBAAqB,CAAC,aAAa,CAAC;YAC3F,CAAC,CAAC,CAAC,qBAAqB,CAAC,aAAa,CAAC,aAAa,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC9F,CAAC;CACF;AAxJD,sDAwJC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\nimport { BagOfCurves } from \"../CurveCollection\";\nimport { CurvePrimitive } from \"../CurvePrimitive\";\nimport { Loop } from \"../Loop\";\nimport { Path } from \"../Path\";\n\n/**\n * Manage a growing array of arrays of curve primitives that are to be joined \"head to tail\" in paths.\n * * The caller makes a sequence of calls to announce individual primitives.\n * * The collector has 2 use cases in mind, controlled by `searchAllPaths` flag on `chainCollectorContext.announceCurvePrimitive`\n * * (a) \"simple chains\" -- the caller has the curve primitives in order and just needs to have them monitored for coordinate breaks that indicate transition to a new chain.\n * * The collector needs to watch for connection to the most recent path but not search for prior paths to join to instead.\n * * (b) \"mixed\" primitives -- primitive order is NOT significant for chain assembly.\n * * The collector needs to search all prior paths at both start and end, and consider connection to both the start and end of each new primitive.\n * * The per-curve announcement is\n * * chainCollector.announceCurvePrimitive (curve, searchAllPaths).\n * * When all curves have been announced, the call to grab the paths option\n * * formLoopsIfClosed\n * * If true, convert closed paths to `Loop`, open paths to `Path`\n * * If false, convert all paths (open or not) to `Path`\n * * Usage pattern is\n * * initialization: `context = new ChainCollectorContext (makeClones: boolean)`\n * * many times: ` context.announceCurvePrimitive (primitive, searchAllPaths)`\n * * end: ` result = context.grabResults (formLoopsIfClosed)`\n * @internal\n */\nexport class ChainCollectorContext {\n private _chains: CurvePrimitive[][];\n private _makeClones: boolean;\n\n private static _staticPointA: Point3d;\n private static _staticPointB: Point3d;\n\n /**\n * Push a new chain with an optional first primitive.\n */\n private pushNewChain(primitive?: CurvePrimitive) {\n const chain = [];\n if (primitive)\n chain.push(primitive);\n this._chains.push(chain);\n }\n private findOrCreateTailChain(): CurvePrimitive[] {\n if (this._chains.length === 0)\n this.pushNewChain();\n return this._chains[this._chains.length - 1];\n }\n private _xyzWork0?: Point3d;\n private findAnyChainToConnect(xyz: Point3d): { chainIndex: number, atEnd: boolean } | undefined {\n\n for (let chainIndexA = 0; chainIndexA < this._chains.length; chainIndexA++) {\n const path = this._chains[chainIndexA];\n this._xyzWork1 = path[path.length - 1].endPoint(this._xyzWork1);\n if (this._xyzWork1.isAlmostEqual(xyz))\n return { chainIndex: chainIndexA, atEnd: true };\n this._xyzWork1 = path[0].startPoint(this._xyzWork1);\n if (this._xyzWork1.isAlmostEqual(xyz))\n return { chainIndex: chainIndexA, atEnd: false };\n }\n return undefined;\n }\n\n /** Initialize with an empty array of chains.\n * @param makeClones if true, all CurvePrimitives sent to `announceCurvePrimitive` is immediately cloned. If false, the reference to the original curve is maintained.\n */\n public constructor(makeClones: boolean) {\n this._chains = [];\n this._makeClones = makeClones;\n }\n\n private _xyzWork1?: Point3d;\n\n /** Announce a curve primitive\n * * searchAllChains controls the extent of search for connecting points.\n * * false ==> only consider connection to most recent chain.\n * * true ==> search for any connection, reversing direction as needed.\n * * Otherwise start a new chain.\n */\n public announceCurvePrimitive(candidate: CurvePrimitive, searchAllChains: boolean = false) {\n if (candidate) {\n if (this._makeClones) {\n const candidate1 = candidate.clone();\n if (!candidate1 || !(candidate1 instanceof CurvePrimitive))\n return;\n this.transferMarkup(candidate, candidate1);\n candidate = candidate1;\n }\n if (!searchAllChains) {\n const activeChain = this.findOrCreateTailChain();\n if (activeChain.length === 0 || !ChainCollectorContext.needBreakBetweenPrimitives(activeChain[activeChain.length - 1], candidate))\n activeChain.push(candidate);\n else\n this.pushNewChain(candidate);\n } else {\n this._xyzWork0 = candidate.startPoint(this._xyzWork0);\n let connect = this.findAnyChainToConnect(this._xyzWork0);\n if (connect) {\n if (connect.atEnd) {\n this._chains[connect.chainIndex].push(candidate);\n } else {\n candidate.reverseInPlace();\n this._chains[connect.chainIndex].splice(0, 0, candidate);\n }\n } else {\n this._xyzWork0 = candidate.endPoint(this._xyzWork0);\n connect = this.findAnyChainToConnect(this._xyzWork0);\n if (connect) { // START of new primitive ..\n if (connect.atEnd) {\n candidate.reverseInPlace();\n this._chains[connect.chainIndex].push(candidate);\n } else {\n this._chains[connect.chainIndex].splice(0, 0, candidate);\n }\n } else {\n this._chains.push([candidate]);\n }\n }\n }\n }\n }\n /** Transfer markup (e.g. startCut, endCut) from source to destination */\n private transferMarkup(source: CurvePrimitive, dest: CurvePrimitive) {\n if (source && dest) {\n dest.startCut = source.startCut;\n dest.endCut = source.endCut;\n }\n }\n /** turn an array of curve primitives into the simplest possible strongly typed curve structure.\n * * The input array is assumed to be connected appropriately to act as the curves of a Path.\n * * When a path is created the curves array is CAPTURED.\n */\n private promoteArrayToCurves(curves: CurvePrimitive[], makeLoopIfClosed: boolean): CurvePrimitive | Path | Loop | undefined {\n if (curves.length === 0)\n return undefined;\n if (makeLoopIfClosed) {\n ChainCollectorContext._staticPointA = curves[0].startPoint(ChainCollectorContext._staticPointA);\n ChainCollectorContext._staticPointB = curves[curves.length - 1].endPoint(ChainCollectorContext._staticPointB);\n if (ChainCollectorContext._staticPointA.isAlmostEqual(ChainCollectorContext._staticPointB))\n return Loop.createArray(curves);\n }\n if (curves.length === 1)\n return curves[0];\n return Path.createArray(curves);\n }\n /** Return the collected results, structured as the simplest possible type. */\n public grabResult(makeLoopIfClosed: boolean = false): CurvePrimitive | Path | BagOfCurves | Loop | undefined {\n const chains = this._chains;\n if (chains.length === 0)\n return undefined;\n if (chains.length === 1)\n return this.promoteArrayToCurves(chains[0], makeLoopIfClosed);\n const bag = BagOfCurves.create();\n for (const chain of chains) {\n const q = this.promoteArrayToCurves(chain, makeLoopIfClosed);\n bag.tryAddChild(q);\n }\n return bag;\n }\n /** test if there is a break between primitiveA and primitiveB, due to any condition such as\n * * primitiveA.endCut\n * * primitiveB.startCut\n * * physical gap between primitives.\n */\n public static needBreakBetweenPrimitives(primitiveA: CurvePrimitive | undefined, primitiveB: CurvePrimitive | undefined, isXYOnly: boolean = false): boolean {\n if (primitiveA === undefined)\n return true;\n if (primitiveB === undefined)\n return true;\n if (primitiveA.endCut !== undefined)\n return true;\n if (primitiveB.startCut !== undefined)\n return true;\n ChainCollectorContext._staticPointA = primitiveA.endPoint(ChainCollectorContext._staticPointA);\n ChainCollectorContext._staticPointB = primitiveB.startPoint(ChainCollectorContext._staticPointB);\n return isXYOnly\n ? !ChainCollectorContext._staticPointA.isAlmostEqualXY(ChainCollectorContext._staticPointB)\n : !ChainCollectorContext._staticPointA.isAlmostEqual(ChainCollectorContext._staticPointB);\n }\n}\n"]}
1
+ {"version":3,"file":"ChainCollectorContext.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/ChainCollectorContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAM/F,wDAAiD;AACjD,sDAAmD;AACnD,kCAA+B;AAC/B,kCAA+B;AAE/B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,qBAAqB;IACxB,OAAO,CAAqB;IAC5B,WAAW,CAAU;IAErB,MAAM,CAAC,aAAa,CAAU;IAC9B,MAAM,CAAC,aAAa,CAAU;IAEtC;;OAEG;IACK,YAAY,CAAC,SAA0B;QAC7C,MAAM,KAAK,GAAG,EAAE,CAAC;QACjB,IAAI,SAAS;YACX,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACxB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IACO,qBAAqB;QAC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B,CAAC,aAAa,GAAG,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;QAC/F,qBAAqB,CAAC,aAAa,GAAG,UAAU,CAAC,UAAU,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;QACjG,OAAO,QAAQ;YACb,CAAC,CAAC,CAAC,qBAAqB,CAAC,aAAa,CAAC,eAAe,CAAC,qBAAqB,CAAC,aAAa,CAAC;YAC3F,CAAC,CAAC,CAAC,qBAAqB,CAAC,aAAa,CAAC,aAAa,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC;IAC9F,CAAC;CACF;AAxJD,sDAwJC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Point3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { BagOfCurves } from \"../CurveCollection\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\nimport { Loop } from \"../Loop\";\r\nimport { Path } from \"../Path\";\r\n\r\n/**\r\n * Manage a growing array of arrays of curve primitives that are to be joined \"head to tail\" in paths.\r\n * * The caller makes a sequence of calls to announce individual primitives.\r\n * * The collector has 2 use cases in mind, controlled by `searchAllPaths` flag on `chainCollectorContext.announceCurvePrimitive`\r\n * * (a) \"simple chains\" -- the caller has the curve primitives in order and just needs to have them monitored for coordinate breaks that indicate transition to a new chain.\r\n * * The collector needs to watch for connection to the most recent path but not search for prior paths to join to instead.\r\n * * (b) \"mixed\" primitives -- primitive order is NOT significant for chain assembly.\r\n * * The collector needs to search all prior paths at both start and end, and consider connection to both the start and end of each new primitive.\r\n * * The per-curve announcement is\r\n * * chainCollector.announceCurvePrimitive (curve, searchAllPaths).\r\n * * When all curves have been announced, the call to grab the paths option\r\n * * formLoopsIfClosed\r\n * * If true, convert closed paths to `Loop`, open paths to `Path`\r\n * * If false, convert all paths (open or not) to `Path`\r\n * * Usage pattern is\r\n * * initialization: `context = new ChainCollectorContext (makeClones: boolean)`\r\n * * many times: ` context.announceCurvePrimitive (primitive, searchAllPaths)`\r\n * * end: ` result = context.grabResults (formLoopsIfClosed)`\r\n * @internal\r\n */\r\nexport class ChainCollectorContext {\r\n private _chains: CurvePrimitive[][];\r\n private _makeClones: boolean;\r\n\r\n private static _staticPointA: Point3d;\r\n private static _staticPointB: Point3d;\r\n\r\n /**\r\n * Push a new chain with an optional first primitive.\r\n */\r\n private pushNewChain(primitive?: CurvePrimitive) {\r\n const chain = [];\r\n if (primitive)\r\n chain.push(primitive);\r\n this._chains.push(chain);\r\n }\r\n private findOrCreateTailChain(): CurvePrimitive[] {\r\n if (this._chains.length === 0)\r\n this.pushNewChain();\r\n return this._chains[this._chains.length - 1];\r\n }\r\n private _xyzWork0?: Point3d;\r\n private findAnyChainToConnect(xyz: Point3d): { chainIndex: number, atEnd: boolean } | undefined {\r\n\r\n for (let chainIndexA = 0; chainIndexA < this._chains.length; chainIndexA++) {\r\n const path = this._chains[chainIndexA];\r\n this._xyzWork1 = path[path.length - 1].endPoint(this._xyzWork1);\r\n if (this._xyzWork1.isAlmostEqual(xyz))\r\n return { chainIndex: chainIndexA, atEnd: true };\r\n this._xyzWork1 = path[0].startPoint(this._xyzWork1);\r\n if (this._xyzWork1.isAlmostEqual(xyz))\r\n return { chainIndex: chainIndexA, atEnd: false };\r\n }\r\n return undefined;\r\n }\r\n\r\n /** Initialize with an empty array of chains.\r\n * @param makeClones if true, all CurvePrimitives sent to `announceCurvePrimitive` is immediately cloned. If false, the reference to the original curve is maintained.\r\n */\r\n public constructor(makeClones: boolean) {\r\n this._chains = [];\r\n this._makeClones = makeClones;\r\n }\r\n\r\n private _xyzWork1?: Point3d;\r\n\r\n /** Announce a curve primitive\r\n * * searchAllChains controls the extent of search for connecting points.\r\n * * false ==> only consider connection to most recent chain.\r\n * * true ==> search for any connection, reversing direction as needed.\r\n * * Otherwise start a new chain.\r\n */\r\n public announceCurvePrimitive(candidate: CurvePrimitive, searchAllChains: boolean = false) {\r\n if (candidate) {\r\n if (this._makeClones) {\r\n const candidate1 = candidate.clone();\r\n if (!candidate1 || !(candidate1 instanceof CurvePrimitive))\r\n return;\r\n this.transferMarkup(candidate, candidate1);\r\n candidate = candidate1;\r\n }\r\n if (!searchAllChains) {\r\n const activeChain = this.findOrCreateTailChain();\r\n if (activeChain.length === 0 || !ChainCollectorContext.needBreakBetweenPrimitives(activeChain[activeChain.length - 1], candidate))\r\n activeChain.push(candidate);\r\n else\r\n this.pushNewChain(candidate);\r\n } else {\r\n this._xyzWork0 = candidate.startPoint(this._xyzWork0);\r\n let connect = this.findAnyChainToConnect(this._xyzWork0);\r\n if (connect) {\r\n if (connect.atEnd) {\r\n this._chains[connect.chainIndex].push(candidate);\r\n } else {\r\n candidate.reverseInPlace();\r\n this._chains[connect.chainIndex].splice(0, 0, candidate);\r\n }\r\n } else {\r\n this._xyzWork0 = candidate.endPoint(this._xyzWork0);\r\n connect = this.findAnyChainToConnect(this._xyzWork0);\r\n if (connect) { // START of new primitive ..\r\n if (connect.atEnd) {\r\n candidate.reverseInPlace();\r\n this._chains[connect.chainIndex].push(candidate);\r\n } else {\r\n this._chains[connect.chainIndex].splice(0, 0, candidate);\r\n }\r\n } else {\r\n this._chains.push([candidate]);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n /** Transfer markup (e.g. startCut, endCut) from source to destination */\r\n private transferMarkup(source: CurvePrimitive, dest: CurvePrimitive) {\r\n if (source && dest) {\r\n dest.startCut = source.startCut;\r\n dest.endCut = source.endCut;\r\n }\r\n }\r\n /** turn an array of curve primitives into the simplest possible strongly typed curve structure.\r\n * * The input array is assumed to be connected appropriately to act as the curves of a Path.\r\n * * When a path is created the curves array is CAPTURED.\r\n */\r\n private promoteArrayToCurves(curves: CurvePrimitive[], makeLoopIfClosed: boolean): CurvePrimitive | Path | Loop | undefined {\r\n if (curves.length === 0)\r\n return undefined;\r\n if (makeLoopIfClosed) {\r\n ChainCollectorContext._staticPointA = curves[0].startPoint(ChainCollectorContext._staticPointA);\r\n ChainCollectorContext._staticPointB = curves[curves.length - 1].endPoint(ChainCollectorContext._staticPointB);\r\n if (ChainCollectorContext._staticPointA.isAlmostEqual(ChainCollectorContext._staticPointB))\r\n return Loop.createArray(curves);\r\n }\r\n if (curves.length === 1)\r\n return curves[0];\r\n return Path.createArray(curves);\r\n }\r\n /** Return the collected results, structured as the simplest possible type. */\r\n public grabResult(makeLoopIfClosed: boolean = false): CurvePrimitive | Path | BagOfCurves | Loop | undefined {\r\n const chains = this._chains;\r\n if (chains.length === 0)\r\n return undefined;\r\n if (chains.length === 1)\r\n return this.promoteArrayToCurves(chains[0], makeLoopIfClosed);\r\n const bag = BagOfCurves.create();\r\n for (const chain of chains) {\r\n const q = this.promoteArrayToCurves(chain, makeLoopIfClosed);\r\n bag.tryAddChild(q);\r\n }\r\n return bag;\r\n }\r\n /** test if there is a break between primitiveA and primitiveB, due to any condition such as\r\n * * primitiveA.endCut\r\n * * primitiveB.startCut\r\n * * physical gap between primitives.\r\n */\r\n public static needBreakBetweenPrimitives(primitiveA: CurvePrimitive | undefined, primitiveB: CurvePrimitive | undefined, isXYOnly: boolean = false): boolean {\r\n if (primitiveA === undefined)\r\n return true;\r\n if (primitiveB === undefined)\r\n return true;\r\n if (primitiveA.endCut !== undefined)\r\n return true;\r\n if (primitiveB.startCut !== undefined)\r\n return true;\r\n ChainCollectorContext._staticPointA = primitiveA.endPoint(ChainCollectorContext._staticPointA);\r\n ChainCollectorContext._staticPointB = primitiveB.startPoint(ChainCollectorContext._staticPointB);\r\n return isXYOnly\r\n ? !ChainCollectorContext._staticPointA.isAlmostEqualXY(ChainCollectorContext._staticPointB)\r\n : !ChainCollectorContext._staticPointA.isAlmostEqual(ChainCollectorContext._staticPointB);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CloneCur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,CAAC;QACrD,OAAO,SAAS,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IACe,sBAAsB,CAAC,SAAyB,EAAE,cAAsB;QACtF,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAClC,IAAI,CAAC,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC9C,MAAM,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;YACnD,IAAI,MAAM,YAAY,4BAAU,IAAI,MAAM,YAAY,6BAAW;gBAC/D,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC;oBACrB,KAAK,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;wBACnB,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;oBACzB,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gBACxB,CAAC;QACL,CAAC;IACH,CAAC;CACF;AA/CD,gDA+CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { Transform } from \"../../geometry3d/Transform\";\nimport { BagOfCurves, CurveChain, CurveCollection } from \"../CurveCollection\";\nimport { CurvePrimitive } from \"../CurvePrimitive\";\nimport { RecursiveCurveProcessorWithStack } from \"../CurveProcessor\";\n\n/**\n * Algorithmic class for cloning curve collections.\n * * recurse through collection nodes, building image nodes as needed and inserting clones of children.\n * * for individual primitive, invoke doClone (protected) for direct clone; insert into parent\n */\nexport class CloneCurvesContext extends RecursiveCurveProcessorWithStack {\n protected _result: CurveCollection | undefined;\n private _transform: Transform | undefined;\n protected constructor(transform?: Transform) {\n super();\n this._transform = transform;\n this._result = undefined;\n }\n public static clone(target: CurveCollection, transform?: Transform): CurveCollection | undefined {\n const context = new CloneCurvesContext(transform);\n target.announceToCurveProcessor(context);\n return context._result;\n }\n public override enter(c: CurveCollection) {\n if (c instanceof CurveCollection)\n super.enter(c.cloneEmptyPeer());\n }\n public override leave(): CurveCollection | undefined {\n const result = super.leave();\n if (result) {\n if (this._stack.length === 0) // this should only happen once !!!\n this._result = result;\n else // push this result to top of stack.\n this._stack[this._stack.length - 1].tryAddChild(result);\n }\n return result;\n }\n // specialized clone methods override this (and allow announceCurvePrimitive to insert to parent)\n protected doClone(primitive: CurvePrimitive): CurvePrimitive | CurvePrimitive[] | undefined {\n if (this._transform)\n return primitive.cloneTransformed(this._transform);\n return primitive.clone();\n }\n public override announceCurvePrimitive(primitive: CurvePrimitive, _indexInParent: number): void {\n const c = this.doClone(primitive);\n if (c !== undefined && this._stack.length > 0) {\n const parent = this._stack[this._stack.length - 1];\n if (parent instanceof CurveChain || parent instanceof BagOfCurves)\n if (Array.isArray(c)) {\n for (const c1 of c) {\n parent.tryAddChild(c1);\n }\n } else {\n parent.tryAddChild(c);\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"CloneCurvesContext.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CloneCurvesContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAGH,wDAA8E;AAE9E,sDAAqE;AAErE;;;;GAIG;AACH,MAAa,kBAAmB,SAAQ,iDAAgC;IAC5D,OAAO,CAA8B;IACvC,UAAU,CAAwB;IAC1C,YAAsB,SAAqB;QACzC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,SAAS,CAAC;IAC3B,CAAC;IACM,MAAM,CAAC,KAAK,CAAC,MAAuB,EAAE,SAAqB;QAChE,MAAM,OAAO,GAAG,IAAI,kBAAkB,CAAC,SAA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C,EAAE,CAAC;oBACrB,KAAK,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;wBACnB,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC;oBACzB,CAAC;gBACH,CAAC;qBAAM,CAAC;oBACN,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gBACxB,CAAC;QACL,CAAC;IACH,CAAC;CACF;AA/CD,gDA+CC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Transform } from \"../../geometry3d/Transform\";\r\nimport { BagOfCurves, CurveChain, CurveCollection } from \"../CurveCollection\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\nimport { RecursiveCurveProcessorWithStack } from \"../CurveProcessor\";\r\n\r\n/**\r\n * Algorithmic class for cloning curve collections.\r\n * * recurse through collection nodes, building image nodes as needed and inserting clones of children.\r\n * * for individual primitive, invoke doClone (protected) for direct clone; insert into parent\r\n */\r\nexport class CloneCurvesContext extends RecursiveCurveProcessorWithStack {\r\n protected _result: CurveCollection | undefined;\r\n private _transform: Transform | undefined;\r\n protected constructor(transform?: Transform) {\r\n super();\r\n this._transform = transform;\r\n this._result = undefined;\r\n }\r\n public static clone(target: CurveCollection, transform?: Transform): CurveCollection | undefined {\r\n const context = new CloneCurvesContext(transform);\r\n target.announceToCurveProcessor(context);\r\n return context._result;\r\n }\r\n public override enter(c: CurveCollection) {\r\n if (c instanceof CurveCollection)\r\n super.enter(c.cloneEmptyPeer());\r\n }\r\n public override leave(): CurveCollection | undefined {\r\n const result = super.leave();\r\n if (result) {\r\n if (this._stack.length === 0) // this should only happen once !!!\r\n this._result = result;\r\n else // push this result to top of stack.\r\n this._stack[this._stack.length - 1].tryAddChild(result);\r\n }\r\n return result;\r\n }\r\n // specialized clone methods override this (and allow announceCurvePrimitive to insert to parent)\r\n protected doClone(primitive: CurvePrimitive): CurvePrimitive | CurvePrimitive[] | undefined {\r\n if (this._transform)\r\n return primitive.cloneTransformed(this._transform);\r\n return primitive.clone();\r\n }\r\n public override announceCurvePrimitive(primitive: CurvePrimitive, _indexInParent: number): void {\r\n const c = this.doClone(primitive);\r\n if (c !== undefined && this._stack.length > 0) {\r\n const parent = this._stack[this._stack.length - 1];\r\n if (parent instanceof CurveChain || parent instanceof BagOfCurves)\r\n if (Array.isArray(c)) {\r\n for (const c1 of c) {\r\n parent.tryAddChild(c1);\r\n }\r\n } else {\r\n parent.tryAddChild(c);\r\n }\r\n }\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CloneWithExpandedLineStrings.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CloneWithExpandedLineStrings.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAQ/F,oDAAiD;AACjD,kDAA+C;AAC/C,6DAA0D;AAE1D;;;GAGG;AACH,MAAa,4BAA6B,SAAQ,uCAAkB;IAClE;QACE,4BAA4B;QAC5B,KAAK,CAAC,SAAS,CAAC,CAAC;IACnB,CAAC;IACD,mCAAmC;IAChB,OAAO,CAAC,SAAyB;QAClD,IAAI,SAAS,YAAY,2BAAY,IAAI,SAAS,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,CAAC;YACnE,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;YAC5C,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC;YAC9B,MAAM,QAAQ,GAAG,EAAE,CAAC;YACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC/B,QAAQ,CAAC,IAAI,CAAC,6BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,+BAA+B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACnJ,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,OAAO,SAAS,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IACM,MAAM,CAAU,KAAK,CAAC,MAAuB;QAClD,MAAM,OAAO,GAAG,IAAI,4BAA4B,EAAE,CAAC;QACnD,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,OAAO,CAAC,OAA0B,CAAC;IAC5C,CAAC;CACF;AAvBD,oEAuBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { CurveCollection } from \"../CurveCollection\";\nimport { CurvePrimitive } from \"../CurvePrimitive\";\nimport { LineSegment3d } from \"../LineSegment3d\";\nimport { LineString3d } from \"../LineString3d\";\nimport { CloneCurvesContext } from \"./CloneCurvesContext\";\n\n/**\n * Algorithmic class for cloning with linestrings expanded to line segments\n * @internal\n */\nexport class CloneWithExpandedLineStrings extends CloneCurvesContext {\n public constructor() {\n // we have no transform ....\n super(undefined);\n }\n // We know we have no transform !!!\n protected override doClone(primitive: CurvePrimitive): CurvePrimitive | CurvePrimitive[] {\n if (primitive instanceof LineString3d && primitive.numPoints() > 1) {\n const packedPoints = primitive.packedPoints;\n const n = packedPoints.length;\n const segments = [];\n for (let i = 0; i + 1 < n; i++) {\n segments.push(LineSegment3d.createCapture(packedPoints.getPoint3dAtUncheckedPointIndex(i), packedPoints.getPoint3dAtUncheckedPointIndex(i + 1)));\n }\n return segments;\n }\n return primitive.clone();\n }\n public static override clone(target: CurveCollection): CurveCollection {\n const context = new CloneWithExpandedLineStrings();\n target.announceToCurveProcessor(context);\n return context._result as CurveCollection;\n }\n}\n"]}
1
+ {"version":3,"file":"CloneWithExpandedLineStrings.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CloneWithExpandedLineStrings.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAQ/F,oDAAiD;AACjD,kDAA+C;AAC/C,6DAA0D;AAE1D;;;GAGG;AACH,MAAa,4BAA6B,SAAQ,uCAAkB;IAClE;QACE,4BAA4B;QAC5B,KAAK,CAAC,SAAS,CAAC,CAAC;IACnB,CAAC;IACD,mCAAmC;IAChB,OAAO,CAAC,SAAyB;QAClD,IAAI,SAAS,YAAY,2BAAY,IAAI,SAAS,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,CAAC;YACnE,MAAM,YAAY,GAAG,SAAS,CAAC,YAAY,CAAC;YAC5C,MAAM,CAAC,GAAG,YAAY,CAAC,MAAM,CAAC;YAC9B,MAAM,QAAQ,GAAG,EAAE,CAAC;YACpB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;gBAC/B,QAAQ,CAAC,IAAI,CAAC,6BAAa,CAAC,aAAa,CAAC,YAAY,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,+BAA+B,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;YACnJ,CAAC;YACD,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,OAAO,SAAS,CAAC,KAAK,EAAE,CAAC;IAC3B,CAAC;IACM,MAAM,CAAU,KAAK,CAAC,MAAuB;QAClD,MAAM,OAAO,GAAG,IAAI,4BAA4B,EAAE,CAAC;QACnD,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,OAAO,CAAC,OAA0B,CAAC;IAC5C,CAAC;CACF;AAvBD,oEAuBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { CurveCollection } from \"../CurveCollection\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\nimport { LineSegment3d } from \"../LineSegment3d\";\r\nimport { LineString3d } from \"../LineString3d\";\r\nimport { CloneCurvesContext } from \"./CloneCurvesContext\";\r\n\r\n/**\r\n * Algorithmic class for cloning with linestrings expanded to line segments\r\n * @internal\r\n */\r\nexport class CloneWithExpandedLineStrings extends CloneCurvesContext {\r\n public constructor() {\r\n // we have no transform ....\r\n super(undefined);\r\n }\r\n // We know we have no transform !!!\r\n protected override doClone(primitive: CurvePrimitive): CurvePrimitive | CurvePrimitive[] {\r\n if (primitive instanceof LineString3d && primitive.numPoints() > 1) {\r\n const packedPoints = primitive.packedPoints;\r\n const n = packedPoints.length;\r\n const segments = [];\r\n for (let i = 0; i + 1 < n; i++) {\r\n segments.push(LineSegment3d.createCapture(packedPoints.getPoint3dAtUncheckedPointIndex(i), packedPoints.getPoint3dAtUncheckedPointIndex(i + 1)));\r\n }\r\n return segments;\r\n }\r\n return primitive.clone();\r\n }\r\n public static override clone(target: CurveCollection): CurveCollection {\r\n const context = new CloneWithExpandedLineStrings();\r\n target.announceToCurveProcessor(context);\r\n return context._result as CurveCollection;\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ClosestPointStrokeHandler.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/ClosestPointStrokeHandler.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,6CAA0C;AAE1C,sEAAqE;AACrE,kDAA+C;AAC/C,kDAAwG;AACxG,4DAAyD;AACzD,wDAAsG;AACtG,gEAA6D;AAG7D;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,gCAAuB;IAC5D,MAAM,CAA6B;IACnC,aAAa,CAAkC;IAC/C,WAAW,CAAU;IACrB,OAAO,CAA8B;IACrC,OAAO,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B,OAAO,IAAI,CAAC;IACd,CAAC;IACO,WAAW,CAAC,QAAgB,EAAE,IAAW;QAC/C,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAA,qBAAM,EAAC,KAAK,KAAK,SAAS,EAAE,iFAAiF,CAAC,CAAC;QAC/G,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,QAAQ,CAAC;QAC3B,IAAI,IAAI,CAAC,aAAa,EAAE,GAAG,CAAC,EAAE,oFAAoF;YAChH,IAAI,CAAC,cAAc,EAAE,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;QAClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACpC,CAAC;IACM,oBAAoB,CAAC,KAAc,EAAE,QAAgB,EAAE,OAAiB;QAC7E,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;CACF;AAvKD,8DAuKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { Geometry } from \"../../Geometry\";\nimport { IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\nimport { Newton1dUnboundedApproximateDerivative, NewtonRtoRStrokeHandler } from \"../../numerics/Newton\";\nimport { SmallSystem } from \"../../numerics/SmallSystem\";\nimport { CurveExtendMode, CurveExtendOptions, VariantCurveExtendParameter } from \"../CurveExtendMode\";\nimport { CurveLocationDetail } from \"../CurveLocationDetail\";\nimport { CurvePrimitive } from \"../CurvePrimitive\";\n\n/**\n * Context for searching for the closest point to a CurvePrimitive.\n * @internal\n */\nexport class ClosestPointStrokeHandler extends NewtonRtoRStrokeHandler implements IStrokeHandler {\n private _curve: CurvePrimitive | undefined;\n private _closestPoint: CurveLocationDetail | undefined;\n private _spacePoint: Point3d;\n private _extend: VariantCurveExtendParameter;\n private _xyOnly: boolean;\n // fraction and function value on one side of an interval that may bracket a root\n private _fractionA: number = 0;\n private _functionA: number = 0;\n // fraction and function value on the other side of an interval that may bracket a root\n private _fractionB: number = 0;\n private _functionB: number = 0;\n private _numThisCurve: number = 0;\n // scratch vars to use within methods\n private _workPoint: Point3d;\n private _workRay: Ray3d;\n private _newtonSolver: Newton1dUnboundedApproximateDerivative;\n /** Constructor */\n public constructor(spacePoint: Point3d, extend?: VariantCurveExtendParameter, result?: CurveLocationDetail, xyOnly?: boolean) {\n super();\n this._spacePoint = spacePoint;\n this._workPoint = Point3d.create();\n this._workRay = Ray3d.createZero();\n this._closestPoint = result;\n if (this._closestPoint)\n this._closestPoint.a = Geometry.largeCoordinateResult\n this._extend = extend ?? false;\n this._xyOnly = xyOnly ?? false;\n this.startCurvePrimitive(undefined);\n this._newtonSolver = new Newton1dUnboundedApproximateDerivative(this);\n }\n public claimResult(): CurveLocationDetail | undefined {\n if (this._closestPoint) {\n this._newtonSolver.setX(this._closestPoint.fraction);\n this._curve = this._closestPoint.curve;\n if (this._newtonSolver.runIterations()) {\n let fraction = this._newtonSolver.getX();\n fraction = CurveExtendOptions.correctFraction(this._extend, fraction);\n this.announceSolutionFraction(fraction);\n }\n }\n return this._closestPoint;\n }\n public needPrimaryGeometryForStrokes() {\n return true;\n }\n public startCurvePrimitive(curve: CurvePrimitive | undefined) {\n this._curve = curve;\n this._fractionA = 0.0;\n this._numThisCurve = 0;\n this._functionA = 0.0;\n }\n public endCurvePrimitive() {\n }\n public announceIntervalForUniformStepStrokes(\n cp: CurvePrimitive, numStrokes: number, fraction0: number, fraction1: number,\n ): void {\n this.startCurvePrimitive(cp);\n this.announceSolutionFraction(0.0); // test start point as closest\n this.announceSolutionFraction(1.0); // test end point as closest\n if (numStrokes < 1)\n numStrokes = 1;\n const df = 1.0 / numStrokes;\n for (let i = 0; i <= numStrokes; i++) {\n const fraction = Geometry.interpolate(fraction0, i * df, fraction1);\n cp.fractionToPointAndDerivative(fraction, this._workRay);\n this.announceRay(fraction, this._workRay);\n }\n }\n private announceCandidate(cp: CurvePrimitive, fraction: number, point: Point3d) {\n const distance = this._xyOnly ? this._spacePoint.distanceXY(point) : this._spacePoint.distance(point);\n if (this._closestPoint && distance > this._closestPoint.a)\n return;\n this._closestPoint = CurveLocationDetail.createCurveFractionPoint(cp, fraction, point, this._closestPoint);\n this._closestPoint.a = distance;\n if (this._parentCurvePrimitive !== undefined)\n this._closestPoint.curve = this._parentCurvePrimitive;\n }\n public announceSegmentInterval(\n cp: CurvePrimitive, point0: Point3d, point1: Point3d, _numStrokes: number, fraction0: number, fraction1: number,\n ): void {\n let localFraction = 0;\n if (this._xyOnly)\n localFraction = SmallSystem.lineSegment3dXYClosestPointUnbounded(point0, point1, this._spacePoint) ?? 0;\n else\n localFraction = this._spacePoint.fractionOfProjectionToLine(point0, point1, 0.0);\n // only consider segment extension at a parent curve endpoint, i.e. when fraction0 is 0 or fraction1 is 1\n const extend0 = (fraction0 === 0) ? CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(this._extend, 0) : CurveExtendMode.None;\n const extend1 = (fraction1 === 1) ? CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(this._extend, 1) : CurveExtendMode.None;\n localFraction = CurveExtendOptions.correctFraction([extend0, extend1], localFraction);\n this._workPoint = point0.interpolate(localFraction, point1);\n const globalFraction = Geometry.interpolate(fraction0, localFraction, fraction1);\n this.announceCandidate(cp, globalFraction, this._workPoint);\n }\n /**\n * Given a function `f` and (unordered) fractions `a` and `b`, search for and announce a root of `f` in this\n * fractional interval.\n * * This method searches for a root of `f` if and only if the stroke segment defined by `(a, f(a))` and\n * `(b, f(b))` has a root. This is a HEURISTIC: given continuous `f` between `a` and `b`, a root of the stroke\n * segment implies a root of `f`, but not vice-versa. Therefore, if the strokes are not sufficiently dense,\n * this method can miss a root of `f`.\n */\n private searchInterval() {\n if (this._functionA * this._functionB > 0)\n return; // stroke segment has no root; ASSUME the function has no root either\n if (this._functionA === 0)\n this.announceSolutionFraction(this._fractionA);\n if (this._functionB === 0)\n this.announceSolutionFraction(this._fractionB);\n // by the Intermediate Value Theorem, a root lies between fractionA and fractionB; use Newton to find it.\n if (this._functionA * this._functionB < 0) {\n const fraction = Geometry.inverseInterpolate(this._fractionA, this._functionA, this._fractionB, this._functionB);\n if (fraction) {\n this._newtonSolver.setX(fraction);\n if (this._newtonSolver.runIterations())\n this.announceSolutionFraction(this._newtonSolver.getX());\n }\n }\n }\n private announceSolutionFraction(fraction: number) {\n if (this._curve)\n this.announceCandidate(this._curve, fraction, this._curve.fractionToPoint(fraction));\n }\n /**\n * Evaluate the univariate real-valued function for which we are finding roots.\n * * For finding the closest point to curve X from point Q, this function is `f(t) := Q-X(t) dot X'(t)`.\n * * Either `pointAndDerivative` must be defined, or both `fraction` and `curve`.\n * @param pointAndDerivative pre-evaluated curve\n * @param fraction fraction at which to evaluate `curve`\n * @param curve curve to evaluate at `fraction`\n */\n private evaluateFunction(pointAndDerivative?: Ray3d, fraction?: number, curve?: CurvePrimitive): number | undefined {\n if (pointAndDerivative)\n this._workRay.setFrom(pointAndDerivative);\n else if (fraction !== undefined && curve)\n this._workRay = curve.fractionToPointAndDerivative(fraction, this._workRay);\n else\n return undefined;\n if (this._xyOnly)\n return this._workRay.dotProductToPointXY(this._spacePoint);\n else\n return this._workRay.dotProductToPoint(this._spacePoint);\n }\n public evaluate(fraction: number): boolean {\n let curve = this._curve;\n if (this._parentCurvePrimitive)\n curve = this._parentCurvePrimitive;\n const value = this.evaluateFunction(undefined, fraction, curve);\n if (value === undefined)\n return false;\n this.currentF = value;\n return true;\n }\n private announceRay(fraction: number, data: Ray3d): void {\n const value = this.evaluateFunction(data);\n assert(value !== undefined, \"expect defined because evaluateFunction never returns undefined for input Ray3d\");\n this._functionB = value;\n this._fractionB = fraction;\n if (this._numThisCurve++ > 0) // after the first stroke point, a stroke segment is defined, so we have an interval\n this.searchInterval();\n this._functionA = this._functionB;\n this._fractionA = this._fractionB;\n }\n public announcePointTangent(point: Point3d, fraction: number, tangent: Vector3d) {\n this._workRay.set(point, tangent);\n this.announceRay(fraction, this._workRay);\n }\n}\n"]}
1
+ {"version":3,"file":"ClosestPointStrokeHandler.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/ClosestPointStrokeHandler.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,sDAA6C;AAC7C,6CAA0C;AAE1C,sEAAqE;AACrE,kDAA+C;AAC/C,kDAAwG;AACxG,4DAAyD;AACzD,wDAAsG;AACtG,gEAA6D;AAG7D;;;GAGG;AACH,MAAa,yBAA0B,SAAQ,gCAAuB;IAC5D,MAAM,CAA6B;IACnC,aAAa,CAAkC;IAC/C,WAAW,CAAU;IACrB,OAAO,CAA8B;IACrC,OAAO,CAAU;IACzB,iFAAiF;IACzE,UAAU,GAAW,CAAC,CAAC;IACvB,UAAU,GAAW,CAAC,CAAC;IAC/B,uFAAuF;IAC/E,UAAU,GAAW,CAAC,CAAC;IACvB,UAAU,GAAW,CAAC,CAAC;IACvB,aAAa,GAAW,CAAC,CAAC;IAClC,qCAAqC;IAC7B,UAAU,CAAU;IACpB,QAAQ,CAAQ;IAChB,aAAa,CAAyC;IAC9D,kBAAkB;IAClB,YAAmB,UAAmB,EAAE,MAAoC,EAAE,MAA4B,EAAE,MAAgB;QAC1H,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAC9B,IAAI,CAAC,UAAU,GAAG,yBAAO,CAAC,MA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AClC,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC;IACpC,CAAC;IACM,oBAAoB,CAAC,KAAc,EAAE,QAAgB,EAAE,OAAiB;QAC7E,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC;CACF;AAvKD,8DAuKC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { Geometry } from \"../../Geometry\";\r\nimport { IStrokeHandler } from \"../../geometry3d/GeometryHandler\";\r\nimport { Point3d, Vector3d } from \"../../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../../geometry3d/Ray3d\";\r\nimport { Newton1dUnboundedApproximateDerivative, NewtonRtoRStrokeHandler } from \"../../numerics/Newton\";\r\nimport { SmallSystem } from \"../../numerics/SmallSystem\";\r\nimport { CurveExtendMode, CurveExtendOptions, VariantCurveExtendParameter } from \"../CurveExtendMode\";\r\nimport { CurveLocationDetail } from \"../CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\n\r\n/**\r\n * Context for searching for the closest point to a CurvePrimitive.\r\n * @internal\r\n */\r\nexport class ClosestPointStrokeHandler extends NewtonRtoRStrokeHandler implements IStrokeHandler {\r\n private _curve: CurvePrimitive | undefined;\r\n private _closestPoint: CurveLocationDetail | undefined;\r\n private _spacePoint: Point3d;\r\n private _extend: VariantCurveExtendParameter;\r\n private _xyOnly: boolean;\r\n // fraction and function value on one side of an interval that may bracket a root\r\n private _fractionA: number = 0;\r\n private _functionA: number = 0;\r\n // fraction and function value on the other side of an interval that may bracket a root\r\n private _fractionB: number = 0;\r\n private _functionB: number = 0;\r\n private _numThisCurve: number = 0;\r\n // scratch vars to use within methods\r\n private _workPoint: Point3d;\r\n private _workRay: Ray3d;\r\n private _newtonSolver: Newton1dUnboundedApproximateDerivative;\r\n /** Constructor */\r\n public constructor(spacePoint: Point3d, extend?: VariantCurveExtendParameter, result?: CurveLocationDetail, xyOnly?: boolean) {\r\n super();\r\n this._spacePoint = spacePoint;\r\n this._workPoint = Point3d.create();\r\n this._workRay = Ray3d.createZero();\r\n this._closestPoint = result;\r\n if (this._closestPoint)\r\n this._closestPoint.a = Geometry.largeCoordinateResult;\r\n this._extend = extend ?? false;\r\n this._xyOnly = xyOnly ?? false;\r\n this.startCurvePrimitive(undefined);\r\n this._newtonSolver = new Newton1dUnboundedApproximateDerivative(this);\r\n }\r\n public claimResult(): CurveLocationDetail | undefined {\r\n if (this._closestPoint) {\r\n this._newtonSolver.setX(this._closestPoint.fraction);\r\n this._curve = this._closestPoint.curve;\r\n if (this._newtonSolver.runIterations()) {\r\n let fraction = this._newtonSolver.getX();\r\n fraction = CurveExtendOptions.correctFraction(this._extend, fraction);\r\n this.announceSolutionFraction(fraction);\r\n }\r\n }\r\n return this._closestPoint;\r\n }\r\n public needPrimaryGeometryForStrokes() {\r\n return true;\r\n }\r\n public startCurvePrimitive(curve: CurvePrimitive | undefined) {\r\n this._curve = curve;\r\n this._fractionA = 0.0;\r\n this._numThisCurve = 0;\r\n this._functionA = 0.0;\r\n }\r\n public endCurvePrimitive() {\r\n }\r\n public announceIntervalForUniformStepStrokes(\r\n cp: CurvePrimitive, numStrokes: number, fraction0: number, fraction1: number,\r\n ): void {\r\n this.startCurvePrimitive(cp);\r\n this.announceSolutionFraction(0.0); // test start point as closest\r\n this.announceSolutionFraction(1.0); // test end point as closest\r\n if (numStrokes < 1)\r\n numStrokes = 1;\r\n const df = 1.0 / numStrokes;\r\n for (let i = 0; i <= numStrokes; i++) {\r\n const fraction = Geometry.interpolate(fraction0, i * df, fraction1);\r\n cp.fractionToPointAndDerivative(fraction, this._workRay);\r\n this.announceRay(fraction, this._workRay);\r\n }\r\n }\r\n private announceCandidate(cp: CurvePrimitive, fraction: number, point: Point3d) {\r\n const distance = this._xyOnly ? this._spacePoint.distanceXY(point) : this._spacePoint.distance(point);\r\n if (this._closestPoint && distance > this._closestPoint.a)\r\n return;\r\n this._closestPoint = CurveLocationDetail.createCurveFractionPoint(cp, fraction, point, this._closestPoint);\r\n this._closestPoint.a = distance;\r\n if (this._parentCurvePrimitive !== undefined)\r\n this._closestPoint.curve = this._parentCurvePrimitive;\r\n }\r\n public announceSegmentInterval(\r\n cp: CurvePrimitive, point0: Point3d, point1: Point3d, _numStrokes: number, fraction0: number, fraction1: number,\r\n ): void {\r\n let localFraction = 0;\r\n if (this._xyOnly)\r\n localFraction = SmallSystem.lineSegment3dXYClosestPointUnbounded(point0, point1, this._spacePoint) ?? 0;\r\n else\r\n localFraction = this._spacePoint.fractionOfProjectionToLine(point0, point1, 0.0);\r\n // only consider segment extension at a parent curve endpoint, i.e. when fraction0 is 0 or fraction1 is 1\r\n const extend0 = (fraction0 === 0) ? CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(this._extend, 0) : CurveExtendMode.None;\r\n const extend1 = (fraction1 === 1) ? CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(this._extend, 1) : CurveExtendMode.None;\r\n localFraction = CurveExtendOptions.correctFraction([extend0, extend1], localFraction);\r\n this._workPoint = point0.interpolate(localFraction, point1);\r\n const globalFraction = Geometry.interpolate(fraction0, localFraction, fraction1);\r\n this.announceCandidate(cp, globalFraction, this._workPoint);\r\n }\r\n /**\r\n * Given a function `f` and (unordered) fractions `a` and `b`, search for and announce a root of `f` in this\r\n * fractional interval.\r\n * * This method searches for a root of `f` if and only if the stroke segment defined by `(a, f(a))` and\r\n * `(b, f(b))` has a root. This is a HEURISTIC: given continuous `f` between `a` and `b`, a root of the stroke\r\n * segment implies a root of `f`, but not vice-versa. Therefore, if the strokes are not sufficiently dense,\r\n * this method can miss a root of `f`.\r\n */\r\n private searchInterval() {\r\n if (this._functionA * this._functionB > 0)\r\n return; // stroke segment has no root; ASSUME the function has no root either\r\n if (this._functionA === 0)\r\n this.announceSolutionFraction(this._fractionA);\r\n if (this._functionB === 0)\r\n this.announceSolutionFraction(this._fractionB);\r\n // by the Intermediate Value Theorem, a root lies between fractionA and fractionB; use Newton to find it.\r\n if (this._functionA * this._functionB < 0) {\r\n const fraction = Geometry.inverseInterpolate(this._fractionA, this._functionA, this._fractionB, this._functionB);\r\n if (fraction) {\r\n this._newtonSolver.setX(fraction);\r\n if (this._newtonSolver.runIterations())\r\n this.announceSolutionFraction(this._newtonSolver.getX());\r\n }\r\n }\r\n }\r\n private announceSolutionFraction(fraction: number) {\r\n if (this._curve)\r\n this.announceCandidate(this._curve, fraction, this._curve.fractionToPoint(fraction));\r\n }\r\n /**\r\n * Evaluate the univariate real-valued function for which we are finding roots.\r\n * * For finding the closest point to curve X from point Q, this function is `f(t) := Q-X(t) dot X'(t)`.\r\n * * Either `pointAndDerivative` must be defined, or both `fraction` and `curve`.\r\n * @param pointAndDerivative pre-evaluated curve\r\n * @param fraction fraction at which to evaluate `curve`\r\n * @param curve curve to evaluate at `fraction`\r\n */\r\n private evaluateFunction(pointAndDerivative?: Ray3d, fraction?: number, curve?: CurvePrimitive): number | undefined {\r\n if (pointAndDerivative)\r\n this._workRay.setFrom(pointAndDerivative);\r\n else if (fraction !== undefined && curve)\r\n this._workRay = curve.fractionToPointAndDerivative(fraction, this._workRay);\r\n else\r\n return undefined;\r\n if (this._xyOnly)\r\n return this._workRay.dotProductToPointXY(this._spacePoint);\r\n else\r\n return this._workRay.dotProductToPoint(this._spacePoint);\r\n }\r\n public evaluate(fraction: number): boolean {\r\n let curve = this._curve;\r\n if (this._parentCurvePrimitive)\r\n curve = this._parentCurvePrimitive;\r\n const value = this.evaluateFunction(undefined, fraction, curve);\r\n if (value === undefined)\r\n return false;\r\n this.currentF = value;\r\n return true;\r\n }\r\n private announceRay(fraction: number, data: Ray3d): void {\r\n const value = this.evaluateFunction(data);\r\n assert(value !== undefined, \"expect defined because evaluateFunction never returns undefined for input Ray3d\");\r\n this._functionB = value;\r\n this._fractionB = fraction;\r\n if (this._numThisCurve++ > 0) // after the first stroke point, a stroke segment is defined, so we have an interval\r\n this.searchInterval();\r\n this._functionA = this._functionB;\r\n this._fractionA = this._fractionB;\r\n }\r\n public announcePointTangent(point: Point3d, fraction: number, tangent: Vector3d) {\r\n this._workRay.set(point, tangent);\r\n this.announceRay(fraction, this._workRay);\r\n }\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CountLinearPartsSearchContext.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CountLinearPartsSearchContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAO/F,sDAAqE;AACrE,oDAAiD;AACjD,kDAA+C;AAE/C;;GAEG;AACH,MAAa,6BAA8B,SAAQ,iDAAgC;IAC1E,cAAc,CAAS;IACvB,aAAa,CAAS;IACtB,QAAQ,CAAS;IACxB;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IACpB,CAAC;IACM,MAAM,CAAC,sBAAsB,CAAC,MAAuB;QAC1D,MAAM,OAAO,GAAG,IAAI,6BAA6B,EAAE,CAAC;QACpD,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IAC9B,CAAC;IACe,sBAAsB,CAAC,KAAqB,EAAE,cAAsB;QAClF,IAAI,KAAK,YAAY,6BAAa;YAChC,IAAI,CAAC,cAAc,EAAE,CAAC;aACnB,IAAI,KAAK,YAAY,2BAAY;YACpC,IAAI,CAAC,aAAa,EAAE,CAAC;;YAErB,IAAI,CAAC,QAAQ,EAAE,CAAC;IACpB,CAAC;CACF;AAvBD,sEAuBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { CurveCollection } from \"../CurveCollection\";\nimport { CurvePrimitive } from \"../CurvePrimitive\";\nimport { RecursiveCurveProcessorWithStack } from \"../CurveProcessor\";\nimport { LineSegment3d } from \"../LineSegment3d\";\nimport { LineString3d } from \"../LineString3d\";\n\n/** Algorithmic class: Count LineSegment3d and LineString3d primitives.\n * @internal\n */\nexport class CountLinearPartsSearchContext extends RecursiveCurveProcessorWithStack {\n public numLineSegment: number;\n public numLineString: number;\n public numOther: number;\n constructor() {\n super();\n this.numLineSegment = 0;\n this.numLineString = 0;\n this.numOther = 0;\n }\n public static hasNonLinearPrimitives(target: CurveCollection): boolean {\n const context = new CountLinearPartsSearchContext();\n target.announceToCurveProcessor(context);\n return context.numOther > 0;\n }\n public override announceCurvePrimitive(curve: CurvePrimitive, _indexInParent: number): void {\n if (curve instanceof LineSegment3d)\n this.numLineSegment++;\n else if (curve instanceof LineString3d)\n this.numLineString++;\n else\n this.numOther++;\n }\n}\n"]}
1
+ {"version":3,"file":"CountLinearPartsSearchContext.js","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CountLinearPartsSearchContext.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAO/F,sDAAqE;AACrE,oDAAiD;AACjD,kDAA+C;AAE/C;;GAEG;AACH,MAAa,6BAA8B,SAAQ,iDAAgC;IAC1E,cAAc,CAAS;IACvB,aAAa,CAAS;IACtB,QAAQ,CAAS;IACxB;QACE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,cAAc,GAAG,CAAC,CAAC;QACxB,IAAI,CAAC,aAAa,GAAG,CAAC,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,CAAC,CAAC;IACpB,CAAC;IACM,MAAM,CAAC,sBAAsB,CAAC,MAAuB;QAC1D,MAAM,OAAO,GAAG,IAAI,6BAA6B,EAAE,CAAC;QACpD,MAAM,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC;QACzC,OAAO,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IAC9B,CAAC;IACe,sBAAsB,CAAC,KAAqB,EAAE,cAAsB;QAClF,IAAI,KAAK,YAAY,6BAAa;YAChC,IAAI,CAAC,cAAc,EAAE,CAAC;aACnB,IAAI,KAAK,YAAY,2BAAY;YACpC,IAAI,CAAC,aAAa,EAAE,CAAC;;YAErB,IAAI,CAAC,QAAQ,EAAE,CAAC;IACpB,CAAC;CACF;AAvBD,sEAuBC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { CurveCollection } from \"../CurveCollection\";\r\nimport { CurvePrimitive } from \"../CurvePrimitive\";\r\nimport { RecursiveCurveProcessorWithStack } from \"../CurveProcessor\";\r\nimport { LineSegment3d } from \"../LineSegment3d\";\r\nimport { LineString3d } from \"../LineString3d\";\r\n\r\n/** Algorithmic class: Count LineSegment3d and LineString3d primitives.\r\n * @internal\r\n */\r\nexport class CountLinearPartsSearchContext extends RecursiveCurveProcessorWithStack {\r\n public numLineSegment: number;\r\n public numLineString: number;\r\n public numOther: number;\r\n constructor() {\r\n super();\r\n this.numLineSegment = 0;\r\n this.numLineString = 0;\r\n this.numOther = 0;\r\n }\r\n public static hasNonLinearPrimitives(target: CurveCollection): boolean {\r\n const context = new CountLinearPartsSearchContext();\r\n target.announceToCurveProcessor(context);\r\n return context.numOther > 0;\r\n }\r\n public override announceCurvePrimitive(curve: CurvePrimitive, _indexInParent: number): void {\r\n if (curve instanceof LineSegment3d)\r\n this.numLineSegment++;\r\n else if (curve instanceof LineString3d)\r\n this.numLineString++;\r\n else\r\n this.numOther++;\r\n }\r\n}\r\n"]}
@@ -167,14 +167,6 @@ export declare class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHa
167
167
  allPerpendicularsArcArcBounded(arcA: Arc3d, arcB: Arc3d, reversed?: boolean): void;
168
168
  /** Low level dispatch of arc with Arc3d. */
169
169
  private dispatchArcArc;
170
- /** Low level dispatch of arc with (beziers of) a bspline curve */
171
- private dispatchArcBsplineCurve3d;
172
- /** Low level dispatch of (beziers of) a bspline curve with (beziers of) a bspline curve */
173
- private dispatchBSplineCurve3dBSplineCurve3d;
174
- /** Low level dispatch of linestring with (beziers of) a bspline curve */
175
- private dispatchLineStringBSplineCurve;
176
- /** Low level dispatch of segment with (beziers of) a bspline curve */
177
- private dispatchSegmentBsplineCurve;
178
170
  /** Detail computation for segment approaching linestring. */
179
171
  private computeSegmentLineString;
180
172
  /** Detail computation for arc approaching linestring. */
@@ -202,23 +194,17 @@ export declare class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHa
202
194
  private dispatchCurveCollection;
203
195
  /** Low level dispatch to geomA given a CurveChainWithDistanceIndex in geometryB. */
204
196
  private dispatchCurveChainWithDistanceIndex;
205
- /** Double dispatch handler for strongly typed segment. */
206
- handleLineSegment3d(segmentA: LineSegment3d): any;
207
- /** Double dispatch handler for strongly typed linestring. */
208
- handleLineString3d(lsA: LineString3d): any;
209
- /** Double dispatch handler for strongly typed arc. */
210
- handleArc3d(arcA: Arc3d): any;
211
- /** Double dispatch handler for strongly typed bspline curve. */
212
- handleBSplineCurve3d(curveA: BSplineCurve3d): any;
197
+ /** Specifies whether the curve needs to be stroked for close approach computation. */
198
+ private needsStroking;
213
199
  /**
214
- * Process seeds for xy close approach between the curve and spiral.
200
+ * Process seeds for xy close approach between one curve and another curve to be stroked.
215
201
  * * Refine each result via Newton iteration. If it doesn't converge, remove it.
216
- * @param seeds The initial seed results to refine.
217
- * @param curveA The other curve primitive. May also be a transition spiral.
218
- * @param spiralB The transition spiral.
219
- * @param reversed whether `spiralB` data is in `detailA` of each recorded pair, and `curveA` data in `detailB`.
202
+ * @param seeds the initial seed results to refine.
203
+ * @param curveA curve to find its XY close approach with curveB.
204
+ * @param curveB the other curve to be stroked.
205
+ * @param reversed whether `curveB` data is in `detailA` of each recorded pair, and `curveA` data in `detailB`.
220
206
  */
221
- private refineSpiralResultsByNewton;
207
+ private refineStrokedResultsByNewton;
222
208
  /**
223
209
  * Append stroke points and return the line string.
224
210
  * * This is a convenient wrapper for [[CurvePrimitive.emitStrokes]] but the analogous instance method cannot be added
@@ -230,12 +216,20 @@ export declare class CurveCurveCloseApproachXY extends RecurseToCurvesGeometryHa
230
216
  /** Find and return the close approaches between curveA and the discretization of curveB. */
231
217
  private computeDiscreteCloseApproachResults;
232
218
  /**
233
- * Compute the XY close approach of a curve and a spiral.
234
- * @param curveA curve to find its close approach with spiralB. May also be a transition spiral.
235
- * @param spiralB transition spiral to find its close approach with curveA.
236
- * @param reversed whether `spiralB` data will be recorded in `detailA` of each result, and `curveA` data in `detailB`.
219
+ * Compute the XY close approach of a curve and another curve to be stroked.
220
+ * @param curveA curve to find its XY close approach with curveB.
221
+ * @param curveB the other curve to be stroked.
222
+ * @param reversed whether `curveB` data will be recorded in `detailA` of each result, and `curveA` data in `detailB`.
237
223
  */
238
- private dispatchCurveSpiral;
224
+ private dispatchCurveStrokedCurve;
225
+ /** Double dispatch handler for strongly typed segment. */
226
+ handleLineSegment3d(segmentA: LineSegment3d): any;
227
+ /** Double dispatch handler for strongly typed linestring. */
228
+ handleLineString3d(lsA: LineString3d): any;
229
+ /** Double dispatch handler for strongly typed arc. */
230
+ handleArc3d(arcA: Arc3d): any;
231
+ /** Double dispatch handler for strongly typed bspline curve. */
232
+ handleBSplineCurve3d(curveA: BSplineCurve3d): any;
239
233
  /** Double dispatch handler for strongly typed spiral curve. */
240
234
  handleTransitionSpiral(spiral: TransitionSpiral3d): any;
241
235
  /** Double dispatch handler for strongly typed CurveChainWithDistanceIndex. */
@@ -1 +1 @@
1
- {"version":3,"file":"CurveCurveCloseApproachXY.d.ts","sourceRoot":"","sources":["../../../../src/curve/internalContexts/CurveCurveCloseApproachXY.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,cAAc,EAAsB,MAAM,4BAA4B,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAEhE,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAOlF,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACjC,OAAO,EAAE,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAG7E,OAAO,EAA0C,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEzG,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAKlE;;;;;;;;;;;;;GAaG;AACH,qBAAa,yBAA0B,SAAQ,8BAA8B;IAC3E,OAAO,CAAC,UAAU,CAAuB;IACzC;;;OAGG;IACH,OAAO,CAAC,oBAAoB,CAAqB;IACjD,gFAAgF;IAChF,OAAO,CAAC,mBAAmB,CAAS;IACpC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,gBAAgB,CAAS;IACjC;;;OAGG;IACH,OAAO,CAAC,QAAQ,CAAuC;IAEvD,OAAO,CAAC,MAAM,CAAC,aAAa,CAAoB;IAChD,OAAO,CAAC,MAAM,CAAC,aAAa,CAAoB;IAChD,OAAO,CAAC,MAAM,CAAC,aAAa,CAAoB;IAChD,OAAO,CAAC,MAAM,CAAC,aAAa,CAAoB;IAChD,OAAO,CAAC,MAAM,CAAC,WAAW,CAAoB;IAE9C;;;;;OAKG;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BAAyB;IAoBjC,0DAA0D;IAC1C,mBAAmB,CAAC,QAAQ,EAAE,aAAa,GAAG,GAAG;IAqBjE,6DAA6D;IAC7C,kBAAkB,CAAC,GAAG,EAAE,YAAY,GAAG,GAAG;IAgB1D,sDAAsD;IACtC,WAAW,CAAC,IAAI,EAAE,KAAK,GAAG,GAAG;IAgB7C,gEAAgE;IAChD,oBAAoB,CAAC,MAAM,EAAE,cAAc,GAAG,GAAG;IAUjE,+DAA+D;IAC/C,sBAAsB,CAAC,MAAM,EAAE,kBAAkB,GAAG,GAAG;IAUvE,8EAA8E;IAC9D,iCAAiC,CAAC,KAAK,EAAE,2BAA2B,GAAG,GAAG;IAS1F,8EAA8E;IAC9D,qBAAqB,CAAC,MAAM,EAAE,eAAe,GAAG,GAAG;CAIpE"}
@@ -434,32 +434,6 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
434
434
  // 2) perpendicular line between 2 arcs (includes intersections)
435
435
  this.allPerpendicularsArcArcBounded(cpA, cpB, reversed);
436
436
  }
437
- /** Low level dispatch of arc with (beziers of) a bspline curve */
438
- dispatchArcBsplineCurve3d(cpA, cpB, reversed) {
439
- const ls = LineString3d_1.LineString3d.create();
440
- cpB.emitStrokes(ls);
441
- this.computeArcLineString(cpA, ls, reversed);
442
- }
443
- /** Low level dispatch of (beziers of) a bspline curve with (beziers of) a bspline curve */
444
- dispatchBSplineCurve3dBSplineCurve3d(bcurveA, bcurveB, reversed) {
445
- const lsA = LineString3d_1.LineString3d.create();
446
- bcurveA.emitStrokes(lsA);
447
- const lsB = LineString3d_1.LineString3d.create();
448
- bcurveB.emitStrokes(lsB);
449
- this.computeLineStringLineString(lsA, lsB, reversed);
450
- }
451
- /** Low level dispatch of linestring with (beziers of) a bspline curve */
452
- dispatchLineStringBSplineCurve(lsA, curveB, reversed) {
453
- const lsB = LineString3d_1.LineString3d.create();
454
- curveB.emitStrokes(lsB);
455
- this.computeLineStringLineString(lsA, lsB, reversed);
456
- }
457
- /** Low level dispatch of segment with (beziers of) a bspline curve */
458
- dispatchSegmentBsplineCurve(segA, curveB, reversed) {
459
- const lsB = LineString3d_1.LineString3d.create();
460
- curveB.emitStrokes(lsB);
461
- this.computeSegmentLineString(segA, lsB, reversed);
462
- }
463
437
  /** Detail computation for segment approaching linestring. */
464
438
  computeSegmentLineString(segA, lsB, reversed) {
465
439
  const numB = lsB.numPoints();
@@ -615,6 +589,91 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
615
589
  });
616
590
  saveResults.forEach((pair) => this._results.insert(pair));
617
591
  }
592
+ /** Specifies whether the curve needs to be stroked for close approach computation. */
593
+ needsStroking(curve) {
594
+ return curve instanceof BSplineCurve_1.BSplineCurve3dBase || curve instanceof TransitionSpiral3d_1.TransitionSpiral3d;
595
+ }
596
+ /**
597
+ * Process seeds for xy close approach between one curve and another curve to be stroked.
598
+ * * Refine each result via Newton iteration. If it doesn't converge, remove it.
599
+ * @param seeds the initial seed results to refine.
600
+ * @param curveA curve to find its XY close approach with curveB.
601
+ * @param curveB the other curve to be stroked.
602
+ * @param reversed whether `curveB` data is in `detailA` of each recorded pair, and `curveA` data in `detailB`.
603
+ */
604
+ refineStrokedResultsByNewton(seeds, curveA, curveB, reversed = false) {
605
+ const xyMatchingFunction = new Newton_1.CurveCurveCloseApproachXYRRtoRRD(curveA, curveB);
606
+ const newtonSearcher = new Newton_1.Newton2dUnboundedWithDerivative(xyMatchingFunction, 50, this._newtonTolerance); // seen: 47
607
+ for (const seed of seeds) {
608
+ const detailA = reversed ? seed.detailB : seed.detailA;
609
+ const detailB = reversed ? seed.detailA : seed.detailB;
610
+ (0, core_bentley_1.assert)(detailB.curve instanceof LineString3d_1.LineString3d, "Caller has discretized the curve");
611
+ newtonSearcher.setUV(detailA.fraction, detailB.fraction); // use the linestring fraction as initial curveB fraction (ASSUME it's close enough)
612
+ if (newtonSearcher.runIterations()) {
613
+ const fractionA = newtonSearcher.getU();
614
+ const fractionB = newtonSearcher.getV();
615
+ if (this.acceptFraction(fractionA) && this.acceptFraction(fractionB))
616
+ this.testAndRecordPointPair(curveA, fractionA, undefined, curveB, fractionB, undefined, reversed);
617
+ } // ignore failure to converge
618
+ }
619
+ }
620
+ /**
621
+ * Append stroke points and return the line string.
622
+ * * This is a convenient wrapper for [[CurvePrimitive.emitStrokes]] but the analogous instance method cannot be added
623
+ * to that class due to the ensuing recursion with subclass [[LineString3d]].
624
+ * @param options options for stroking the instance curve.
625
+ * @param result object to receive appended stroke points; if omitted, a new object is created, populated, and returned.
626
+ */
627
+ strokeCurve(curve, options, result) {
628
+ const ls = result ? result : LineString3d_1.LineString3d.create();
629
+ curve.emitStrokes(ls, options);
630
+ return ls;
631
+ }
632
+ /** Find and return the close approaches between curveA and the discretization of curveB. */
633
+ computeDiscreteCloseApproachResults(curveA, lsB, reversed) {
634
+ const maxDist = this.maxDistanceToAccept;
635
+ const saveResults = this.grabPairedResults(); // save current results
636
+ const geomB = this._geometryB;
637
+ this.maxDistanceToAccept = maxDist ? maxDist * 1.2 : undefined; // HEURISTIC: allow slack for Newton seeds
638
+ this.resetGeometry(curveA);
639
+ this.handleLineString3d(lsB); // populate empty results with discrete solutions
640
+ if (!reversed) {
641
+ // handleLineString3d put lsB data into detailA, so if we aren't reversing, we need to swap
642
+ for (const result of this._results)
643
+ result.swapDetails();
644
+ }
645
+ this.resetGeometry(geomB);
646
+ this.maxDistanceToAccept = maxDist;
647
+ const discreteResults = this._results.extractArray();
648
+ saveResults.forEach((pair) => this._results.insert(pair)); // restore current results
649
+ return discreteResults;
650
+ }
651
+ /**
652
+ * Compute the XY close approach of a curve and another curve to be stroked.
653
+ * @param curveA curve to find its XY close approach with curveB.
654
+ * @param curveB the other curve to be stroked.
655
+ * @param reversed whether `curveB` data will be recorded in `detailA` of each result, and `curveA` data in `detailB`.
656
+ */
657
+ dispatchCurveStrokedCurve(curveA, curveB, reversed) {
658
+ // explicit search for intersections (Newton converges too slowly on DirectSpiral3d tangent intersections)
659
+ const intersections = CurveCurve_1.CurveCurve.intersectionXYPairs(curveA, false, curveB, false, this._xyTolerance);
660
+ for (const intersection of intersections)
661
+ this.testAndRecordPair(intersection, reversed);
662
+ // append seeds computed by solving the discretized spiral close approach problem, then refine the seeds via Newton
663
+ let cpA = curveA;
664
+ if (this.needsStroking(curveA))
665
+ cpA = this.strokeCurve(curveA);
666
+ const cpB = this.strokeCurve(curveB);
667
+ const seeds = this.computeDiscreteCloseApproachResults(cpA, cpB, reversed);
668
+ this.refineStrokedResultsByNewton(seeds, curveA, curveB, reversed);
669
+ if (curveA instanceof LineString3d_1.LineString3d) { // explicitly test corners (where Newton converges too slowly)
670
+ const fStep = Geometry_1.Geometry.safeDivideFraction(1.0, curveA.numEdges(), 0);
671
+ const v0 = CurveCurveCloseApproachXY._workPointBB0;
672
+ for (let i = 1; i < curveA.numEdges(); ++i)
673
+ this.testAndRecordProjection(curveA, i * fStep, curveA.pointAtUnchecked(i, v0), curveB, reversed);
674
+ }
675
+ this.testAndRecordEndPointApproaches(curveA, curveB, reversed);
676
+ }
618
677
  /** Double dispatch handler for strongly typed segment. */
619
678
  handleLineSegment3d(segmentA) {
620
679
  if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
@@ -627,11 +686,8 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
627
686
  else if (this._geometryB instanceof Arc3d_1.Arc3d) {
628
687
  this.computeSegmentArc(segmentA, this._geometryB, false);
629
688
  }
630
- else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
631
- this.dispatchSegmentBsplineCurve(segmentA, this._geometryB, false);
632
- }
633
- else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
634
- this.dispatchCurveSpiral(segmentA, this._geometryB, false);
689
+ else if (this.needsStroking(this._geometryB)) {
690
+ this.dispatchCurveStrokedCurve(segmentA, this._geometryB, false);
635
691
  }
636
692
  else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
637
693
  this.dispatchCurveCollection(segmentA, this.handleLineSegment3d.bind(this));
@@ -652,11 +708,8 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
652
708
  else if (this._geometryB instanceof Arc3d_1.Arc3d) {
653
709
  this.computeArcLineString(this._geometryB, lsA, true);
654
710
  }
655
- else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
656
- this.dispatchLineStringBSplineCurve(lsA, this._geometryB, false);
657
- }
658
- else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
659
- this.dispatchCurveSpiral(lsA, this._geometryB, false);
711
+ else if (this.needsStroking(this._geometryB)) {
712
+ this.dispatchCurveStrokedCurve(lsA, this._geometryB, false);
660
713
  }
661
714
  else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
662
715
  this.dispatchCurveCollection(lsA, this.handleLineString3d.bind(this));
@@ -677,11 +730,8 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
677
730
  else if (this._geometryB instanceof Arc3d_1.Arc3d) {
678
731
  this.dispatchArcArc(arcA, this._geometryB, false);
679
732
  }
680
- else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3d) {
681
- this.dispatchArcBsplineCurve3d(arcA, this._geometryB, false);
682
- }
683
- else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
684
- this.dispatchCurveSpiral(arcA, this._geometryB, false);
733
+ else if (this.needsStroking(this._geometryB)) {
734
+ this.dispatchCurveStrokedCurve(arcA, this._geometryB, false);
685
735
  }
686
736
  else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
687
737
  this.dispatchCurveCollection(arcA, this.handleArc3d.bind(this));
@@ -693,117 +743,24 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
693
743
  }
694
744
  /** Double dispatch handler for strongly typed bspline curve. */
695
745
  handleBSplineCurve3d(curveA) {
696
- if (this._geometryB instanceof LineSegment3d_1.LineSegment3d) {
697
- this.dispatchSegmentBsplineCurve(this._geometryB, curveA, true);
698
- }
699
- else if (this._geometryB instanceof LineString3d_1.LineString3d) {
700
- this.dispatchLineStringBSplineCurve(this._geometryB, curveA, true);
701
- }
702
- else if (this._geometryB instanceof Arc3d_1.Arc3d) {
703
- this.dispatchArcBsplineCurve3d(this._geometryB, curveA, true);
704
- }
705
- else if (this._geometryB instanceof BSplineCurve_1.BSplineCurve3dBase) {
706
- this.dispatchBSplineCurve3dBSplineCurve3d(curveA, this._geometryB, false);
746
+ if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
747
+ this.dispatchCurveChainWithDistanceIndex(curveA, this.handleBSplineCurve3d.bind(this));
707
748
  }
708
- else if (this._geometryB instanceof TransitionSpiral3d_1.TransitionSpiral3d) {
709
- this.dispatchCurveSpiral(curveA, this._geometryB, false);
749
+ else if (this._geometryB instanceof CurvePrimitive_1.CurvePrimitive) {
750
+ this.dispatchCurveStrokedCurve(this._geometryB, curveA, true);
710
751
  }
711
752
  else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
712
753
  this.dispatchCurveCollection(curveA, this.handleBSplineCurve3d.bind(this));
713
754
  }
714
- else if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
715
- this.dispatchCurveChainWithDistanceIndex(curveA, this.handleBSplineCurve3d.bind(this));
716
- }
717
755
  return undefined;
718
756
  }
719
- /**
720
- * Process seeds for xy close approach between the curve and spiral.
721
- * * Refine each result via Newton iteration. If it doesn't converge, remove it.
722
- * @param seeds The initial seed results to refine.
723
- * @param curveA The other curve primitive. May also be a transition spiral.
724
- * @param spiralB The transition spiral.
725
- * @param reversed whether `spiralB` data is in `detailA` of each recorded pair, and `curveA` data in `detailB`.
726
- */
727
- refineSpiralResultsByNewton(seeds, curveA, spiralB, reversed = false) {
728
- const xyMatchingFunction = new Newton_1.CurveCurveCloseApproachXYRRtoRRD(curveA, spiralB);
729
- const newtonSearcher = new Newton_1.Newton2dUnboundedWithDerivative(xyMatchingFunction, 50, this._newtonTolerance); // seen: 47
730
- for (const seed of seeds) {
731
- const detailA = reversed ? seed.detailB : seed.detailA;
732
- const detailB = reversed ? seed.detailA : seed.detailB;
733
- (0, core_bentley_1.assert)(detailB.curve instanceof LineString3d_1.LineString3d, "Caller has discretized the spiral");
734
- newtonSearcher.setUV(detailA.fraction, detailB.fraction); // use linestring fraction as spiral param; it generally yields a closer point than fractional length!
735
- if (newtonSearcher.runIterations()) {
736
- const fractionA = newtonSearcher.getU();
737
- const fractionB = newtonSearcher.getV();
738
- if (this.acceptFraction(fractionA) && this.acceptFraction(fractionB))
739
- this.testAndRecordPointPair(curveA, fractionA, undefined, spiralB, fractionB, undefined, reversed);
740
- } // ignore failure to converge
741
- }
742
- }
743
- /**
744
- * Append stroke points and return the line string.
745
- * * This is a convenient wrapper for [[CurvePrimitive.emitStrokes]] but the analogous instance method cannot be added
746
- * to that class due to the ensuing recursion with subclass [[LineString3d]].
747
- * @param options options for stroking the instance curve.
748
- * @param result object to receive appended stroke points; if omitted, a new object is created, populated, and returned.
749
- */
750
- strokeCurve(curve, options, result) {
751
- const ls = result ? result : LineString3d_1.LineString3d.create();
752
- curve.emitStrokes(ls, options);
753
- return ls;
754
- }
755
- /** Find and return the close approaches between curveA and the discretization of curveB. */
756
- computeDiscreteCloseApproachResults(curveA, lsB, reversed) {
757
- const maxDist = this.maxDistanceToAccept;
758
- const saveResults = this.grabPairedResults(); // save current results
759
- const geomB = this._geometryB;
760
- this.maxDistanceToAccept = maxDist ? maxDist * 1.2 : undefined; // HEURISTIC: allow slack for Newton seeds
761
- this.resetGeometry(curveA);
762
- this.handleLineString3d(lsB); // populate empty results with discrete solutions
763
- if (!reversed) {
764
- // handleLineString3d put lsB data into detailA, so if we aren't reversing, we need to swap
765
- for (const result of this._results)
766
- result.swapDetails();
767
- }
768
- this.resetGeometry(geomB);
769
- this.maxDistanceToAccept = maxDist;
770
- const discreteResults = this._results.extractArray();
771
- saveResults.forEach((pair) => this._results.insert(pair)); // restore current results
772
- return discreteResults;
773
- }
774
- /**
775
- * Compute the XY close approach of a curve and a spiral.
776
- * @param curveA curve to find its close approach with spiralB. May also be a transition spiral.
777
- * @param spiralB transition spiral to find its close approach with curveA.
778
- * @param reversed whether `spiralB` data will be recorded in `detailA` of each result, and `curveA` data in `detailB`.
779
- */
780
- dispatchCurveSpiral(curveA, spiralB, reversed) {
781
- // explicit search for intersections (Newton converges too slowly on DirectSpiral3d tangent intersections)
782
- const intersections = CurveCurve_1.CurveCurve.intersectionXYPairs(curveA, false, spiralB, false, this._xyTolerance);
783
- for (const intersection of intersections)
784
- this.testAndRecordPair(intersection, reversed);
785
- // append seeds computed by solving the discretized spiral close approach problem, then refine the seeds via Newton
786
- let cpA = curveA;
787
- if (curveA instanceof TransitionSpiral3d_1.TransitionSpiral3d)
788
- cpA = this.strokeCurve(curveA);
789
- const cpB = this.strokeCurve(spiralB);
790
- const seeds = this.computeDiscreteCloseApproachResults(cpA, cpB, reversed);
791
- this.refineSpiralResultsByNewton(seeds, curveA, spiralB, reversed);
792
- if (curveA instanceof LineString3d_1.LineString3d) { // explicitly test corners (where Newton converges too slowly)
793
- const fStep = Geometry_1.Geometry.safeDivideFraction(1.0, curveA.numEdges(), 0);
794
- const v0 = CurveCurveCloseApproachXY._workPointBB0;
795
- for (let i = 1; i < curveA.numEdges(); ++i)
796
- this.testAndRecordProjection(curveA, i * fStep, curveA.pointAtUnchecked(i, v0), spiralB, reversed);
797
- }
798
- this.testAndRecordEndPointApproaches(curveA, spiralB, reversed);
799
- }
800
757
  /** Double dispatch handler for strongly typed spiral curve. */
801
758
  handleTransitionSpiral(spiral) {
802
759
  if (this._geometryB instanceof CurveChainWithDistanceIndex_1.CurveChainWithDistanceIndex) {
803
760
  this.dispatchCurveChainWithDistanceIndex(spiral, this.handleTransitionSpiral.bind(this));
804
761
  }
805
762
  else if (this._geometryB instanceof CurvePrimitive_1.CurvePrimitive) {
806
- this.dispatchCurveSpiral(this._geometryB, spiral, true);
763
+ this.dispatchCurveStrokedCurve(this._geometryB, spiral, true);
807
764
  }
808
765
  else if (this._geometryB instanceof CurveCollection_1.CurveCollection) {
809
766
  this.dispatchCurveCollection(spiral, this.handleTransitionSpiral.bind(this));
@@ -822,19 +779,7 @@ class CurveCurveCloseApproachXY extends GeometryHandler_1.RecurseToCurvesGeometr
822
779
  }
823
780
  /** Double dispatch handler for strongly typed homogeneous bspline curve .. */
824
781
  handleBSplineCurve3dH(_curve) {
825
- /*
826
- //NEEDS WORK -- make "dispatch" methods tolerant of both 3d and 3dH.
827
- // "easy" if both present BezierCurve3dH span loaders
828
- if (this._geometryB instanceof LineSegment3d) {
829
- this.dispatchSegmentBsplineCurve(
830
- this._geometryB, this._extendB, this._geometryB.point0Ref, 0.0, this._geometryB.point1Ref, 1.0, this._extendB,
831
- curve, this._extendA, true);
832
- } else if (this._geometryB instanceof LineString3d) {
833
- this.dispatchLineStringBSplineCurve(this._geometryB, this._extendB, curve, this._extendA, true);
834
- } else if (this._geometryB instanceof Arc3d) {
835
- this.dispatchArcBsplineCurve3d(this._geometryB, this._extendB, curve, this._extendA, true);
836
- }
837
- */
782
+ // NEEDS WORK -- make "dispatch" methods tolerant of both 3d and 3dH
838
783
  return undefined;
839
784
  }
840
785
  }