@itwin/core-geometry 5.3.1 → 5.3.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 (452) hide show
  1. package/CHANGELOG.md +26 -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/ConstructCurveBetweenCurves.js.map +1 -1
  30. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  31. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  32. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  33. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  34. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  35. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  36. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  37. package/lib/cjs/curve/CurveOps.js.map +1 -1
  38. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  39. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  40. package/lib/cjs/curve/CurveTypes.js.map +1 -1
  41. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  42. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  43. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  44. package/lib/cjs/curve/LineString3d.js.map +1 -1
  45. package/lib/cjs/curve/Loop.js.map +1 -1
  46. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  47. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  48. package/lib/cjs/curve/Path.js.map +1 -1
  49. package/lib/cjs/curve/PointString3d.js.map +1 -1
  50. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  51. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  52. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  53. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  54. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  55. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  56. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  57. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  58. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  59. package/lib/cjs/curve/RegionOps.js.map +1 -1
  60. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  61. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  62. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  63. package/lib/cjs/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  64. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  65. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  66. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  67. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  68. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  69. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  70. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  71. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  72. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  73. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  74. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  75. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  76. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  77. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  78. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  79. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  80. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  81. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  82. package/lib/cjs/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  83. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  84. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  85. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  86. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  87. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  88. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  89. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  90. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  91. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  92. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  93. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  94. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  95. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  96. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  97. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  98. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  99. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  100. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  101. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  102. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  103. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  104. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  105. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  106. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  107. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  108. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  109. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  110. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  111. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  112. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  113. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  114. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  115. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  116. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  117. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  118. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  119. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  120. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  121. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  122. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  123. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  124. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  125. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  126. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  127. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  128. package/lib/cjs/geometry3d/Range.js.map +1 -1
  129. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  130. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  131. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  132. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  133. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  134. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  135. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  136. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  137. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  138. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  139. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  140. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  141. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  142. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  143. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  144. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  145. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  146. package/lib/cjs/numerics/Complex.js.map +1 -1
  147. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  148. package/lib/cjs/numerics/Newton.js.map +1 -1
  149. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  150. package/lib/cjs/numerics/PolarData.js.map +1 -1
  151. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  152. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  153. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  154. package/lib/cjs/numerics/SmallSystem.js.map +1 -1
  155. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  156. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  157. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  158. package/lib/cjs/polyface/AuxData.js.map +1 -1
  159. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  160. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  161. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  162. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  163. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  164. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  165. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  166. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -1
  167. package/lib/cjs/polyface/Polyface.js.map +1 -1
  168. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  169. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  170. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  171. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  172. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  173. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  174. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  175. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  176. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  177. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  178. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  179. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  180. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  181. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  182. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  183. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  184. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  185. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  186. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  187. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  188. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  189. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  190. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  191. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  192. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  193. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  194. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  195. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  196. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  197. package/lib/cjs/serialization/SerializationHelpers.js.map +1 -1
  198. package/lib/cjs/solid/Box.js.map +1 -1
  199. package/lib/cjs/solid/Cone.js.map +1 -1
  200. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  201. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  202. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  203. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  204. package/lib/cjs/solid/Sphere.js.map +1 -1
  205. package/lib/cjs/solid/SweepContour.js.map +1 -1
  206. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  207. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  208. package/lib/cjs/topology/Graph.js.map +1 -1
  209. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  210. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  211. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  212. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  213. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  214. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  215. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  216. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  217. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  218. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  219. package/lib/cjs/topology/MaskManager.js.map +1 -1
  220. package/lib/cjs/topology/Merging.js.map +1 -1
  221. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  222. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  223. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  224. package/lib/cjs/topology/Triangulation.js.map +1 -1
  225. package/lib/cjs/topology/Voronoi.js.map +1 -1
  226. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  227. package/lib/esm/Constant.js.map +1 -1
  228. package/lib/esm/Geometry.js.map +1 -1
  229. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  230. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  231. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  232. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  233. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  234. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  235. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  236. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  237. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  238. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  239. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  240. package/lib/esm/bspline/KnotVector.js.map +1 -1
  241. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  242. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  243. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  244. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  245. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  246. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  247. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  248. package/lib/esm/clipping/ClipVector.js.map +1 -1
  249. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  250. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  251. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  252. package/lib/esm/core-geometry.js.map +1 -1
  253. package/lib/esm/curve/Arc3d.js.map +1 -1
  254. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  255. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  256. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  257. package/lib/esm/curve/CurveCollection.js.map +1 -1
  258. package/lib/esm/curve/CurveCurve.js.map +1 -1
  259. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  260. package/lib/esm/curve/CurveFactory.js.map +1 -1
  261. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  262. package/lib/esm/curve/CurveOps.js.map +1 -1
  263. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  264. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  265. package/lib/esm/curve/CurveTypes.js.map +1 -1
  266. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  267. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  268. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  269. package/lib/esm/curve/LineString3d.js.map +1 -1
  270. package/lib/esm/curve/Loop.js.map +1 -1
  271. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  272. package/lib/esm/curve/ParityRegion.js.map +1 -1
  273. package/lib/esm/curve/Path.js.map +1 -1
  274. package/lib/esm/curve/PointString3d.js.map +1 -1
  275. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  276. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  277. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  278. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  279. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  280. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  281. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  282. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  283. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  284. package/lib/esm/curve/RegionOps.js.map +1 -1
  285. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  286. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  287. package/lib/esm/curve/UnionRegion.js.map +1 -1
  288. package/lib/esm/curve/internalContexts/AnnounceTangentStrokeHandler.js.map +1 -1
  289. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  290. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  291. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  292. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  293. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  294. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  295. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  296. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  297. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  298. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  299. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  300. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  301. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  302. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  303. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  304. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  305. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  306. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  307. package/lib/esm/curve/internalContexts/TransferWithSplitArcs.js.map +1 -1
  308. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  309. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  310. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  311. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  312. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  313. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  314. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  315. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  316. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  317. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  318. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  319. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  320. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  321. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  322. package/lib/esm/geometry3d/Angle.js.map +1 -1
  323. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  324. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  325. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  326. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  327. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  328. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  329. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  330. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  331. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  332. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  333. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  334. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  335. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  336. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  337. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  338. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  339. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  340. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  341. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  342. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  343. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  344. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  345. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  346. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  347. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  348. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  349. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  350. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  351. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  352. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  353. package/lib/esm/geometry3d/Range.js.map +1 -1
  354. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  355. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  356. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  357. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  358. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  359. package/lib/esm/geometry3d/Transform.js.map +1 -1
  360. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  361. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  362. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  363. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  364. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  365. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  366. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  367. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  368. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  369. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  370. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  371. package/lib/esm/numerics/Complex.js.map +1 -1
  372. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  373. package/lib/esm/numerics/Newton.js.map +1 -1
  374. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  375. package/lib/esm/numerics/PolarData.js.map +1 -1
  376. package/lib/esm/numerics/Polynomials.js.map +1 -1
  377. package/lib/esm/numerics/Quadrature.js.map +1 -1
  378. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  379. package/lib/esm/numerics/SmallSystem.js.map +1 -1
  380. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  381. package/lib/esm/numerics/UnionFind.js.map +1 -1
  382. package/lib/esm/numerics/UsageSums.js.map +1 -1
  383. package/lib/esm/polyface/AuxData.js.map +1 -1
  384. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  385. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  386. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  387. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  388. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  389. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  390. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  391. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -1
  392. package/lib/esm/polyface/Polyface.js.map +1 -1
  393. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  394. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  395. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  396. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  397. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  398. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  399. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  400. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  401. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  402. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  403. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  404. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  405. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  406. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  407. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  408. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  409. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  410. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  411. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  412. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  413. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  414. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  415. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  416. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  417. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  418. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  419. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  420. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  421. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  422. package/lib/esm/serialization/SerializationHelpers.js.map +1 -1
  423. package/lib/esm/solid/Box.js.map +1 -1
  424. package/lib/esm/solid/Cone.js.map +1 -1
  425. package/lib/esm/solid/LinearSweep.js.map +1 -1
  426. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  427. package/lib/esm/solid/RuledSweep.js.map +1 -1
  428. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  429. package/lib/esm/solid/Sphere.js.map +1 -1
  430. package/lib/esm/solid/SweepContour.js.map +1 -1
  431. package/lib/esm/solid/TorusPipe.js.map +1 -1
  432. package/lib/esm/topology/ChainMerge.js.map +1 -1
  433. package/lib/esm/topology/Graph.js.map +1 -1
  434. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  435. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  436. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  437. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  438. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  439. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  440. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  441. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  442. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  443. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  444. package/lib/esm/topology/MaskManager.js.map +1 -1
  445. package/lib/esm/topology/Merging.js.map +1 -1
  446. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  447. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  448. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  449. package/lib/esm/topology/Triangulation.js.map +1 -1
  450. package/lib/esm/topology/Voronoi.js.map +1 -1
  451. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  452. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"CurveOps.js","sourceRoot":"","sources":["../../../src/curve/CurveOps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE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A2C;YACtF,OAAO,SAAS,CAAC,CAAC,kBAAkB;QAEtC,IAAI,OAAO,GAAG,OAAO;YACnB,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;;YAE3C,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC7C,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,CAAC;QACtB,OAAO,GAAG,CAAC,CAAC,kCAAkC;IAChD,CAAC;CACF","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 { AxisIndex, Geometry } from \"../Geometry\";\r\nimport { FrameBuilder } from \"../geometry3d/FrameBuilder\";\r\nimport { MultiLineStringDataVariant } from \"../geometry3d/IndexedXYZCollection\";\r\nimport { Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { BagOfCurves, CurveCollection } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { AnyChain, AnyCurve } from \"./CurveTypes\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { MultiChainCollector } from \"./internalContexts/MultiChainCollector\";\r\nimport { CurveChainWireOffsetContext } from \"./internalContexts/PolygonOffsetContext\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { Loop } from \"./Loop\";\r\nimport { OffsetOptions } from \"./OffsetOptions\";\r\nimport { Path } from \"./Path\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n /**\r\n * Options bundle for use in [[CurveOps.isPlanar]] and [[CurveOps.isColinear]].\r\n * @public\r\n */\r\n export interface PlanarColinearOptions {\r\n /** Maximum allowable distance that geometry can deviate from planarity/colinearity. Default is [[Geometry.smallMetricDistance]]. */\r\n maxDeviation?: number;\r\n /** Whether colinearity test ignores z-coordinates. Default is `false`. */\r\n xyColinear?: boolean;\r\n /** Radian tolerance for xy-colinearity, measuring maximum angular deviation from a vertical plane. Default is [[Geometry.smallAngleRadians]]. */\r\n radianTolerance?: number;\r\n /** Pre-allocated object to populate with the computed plane-to-world transformation and return when planarity test succeeds. */\r\n localToWorld?: Transform;\r\n /** Pre-allocated object to populate with the computed line and return when colinear test succeeds. */\r\n colinearRay?: Ray3d;\r\n }\r\n\r\n/**\r\n * Static methods for miscellaneous curve operations.\r\n * @public\r\n */\r\nexport class CurveOps {\r\n /** Recursively sum curve lengths, allowing CurvePrimitive, CurveCollection, or array of such at any level. */\r\n public static sumLengths(curves: AnyCurve | AnyCurve[]): number {\r\n let mySum = 0;\r\n if (curves instanceof CurvePrimitive) {\r\n mySum += curves.curveLength();\r\n } else if (curves instanceof CurveCollection) {\r\n mySum += curves.sumLengths();\r\n } else if (Array.isArray(curves)) {\r\n for (const data1 of curves)\r\n mySum += this.sumLengths(data1);\r\n }\r\n return mySum;\r\n }\r\n /** Recursively extend the range by each curve's range, allowing CurvePrimitive, CurveCollection, or array of such at any level. */\r\n public static extendRange(range: Range3d, curves: AnyCurve | AnyCurve[], transform?: Transform): Range3d {\r\n if (Array.isArray(curves)) {\r\n for (const data1 of curves)\r\n this.extendRange(range, data1, transform);\r\n } else {\r\n curves.extendRange(range, transform);\r\n }\r\n return range;\r\n }\r\n /**\r\n * Construct a separate xy-offset for each input curve.\r\n * * For best offset results, the inputs should be parallel to the xy-plane.\r\n * @param curves input curve(s), z-coordinates ignored. Only curves of type [[AnyChain]] are handled.\r\n * @param offset offset distance (positive to left of curve, negative to right)\r\n * @param result array to collect offset curves\r\n * @returns summed length of offset curves\r\n */\r\n public static appendXYOffsets(curves: AnyCurve | AnyCurve[] | undefined, offset: number, result: AnyCurve[]): number {\r\n let summedLengths = 0;\r\n if (curves instanceof CurvePrimitive) {\r\n const resultA = CurveChainWireOffsetContext.constructCurveXYOffset(Path.create(curves), offset);\r\n if (resultA) {\r\n summedLengths += this.sumLengths(resultA);\r\n result.push(resultA);\r\n }\r\n } else if (curves instanceof Loop || curves instanceof Path) {\r\n const resultA = CurveChainWireOffsetContext.constructCurveXYOffset(curves, offset);\r\n if (resultA) {\r\n summedLengths += this.sumLengths(resultA);\r\n result.push(resultA);\r\n }\r\n } else if (curves instanceof BagOfCurves) {\r\n for (const q of curves.children)\r\n summedLengths += this.appendXYOffsets(q, offset, result);\r\n } else if (Array.isArray(curves)) {\r\n for (const q of curves)\r\n summedLengths += this.appendXYOffsets(q, offset, result);\r\n }\r\n return summedLengths;\r\n }\r\n /**\r\n * Restructure curve fragments as Paths and Loops, and construct xy-offsets of the chains.\r\n * * If the inputs do not form Loop(s), the classification of offsets is suspect.\r\n * * For best offset results, the inputs should be parallel to the xy-plane.\r\n * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.\r\n * @param fragments fragments to be chained and offset\r\n * @param offsetDistance offset distance, applied to both sides of each fragment to produce inside and outside xy-offset curves.\r\n * @param gapTolerance distance to be treated as \"effectively zero\" when joining head-to-tail\r\n * @returns object with named chains, insideOffsets, outsideOffsets\r\n */\r\n public static collectInsideAndOutsideXYOffsets(fragments: AnyCurve[], offsetDistance: number, gapTolerance: number): { insideOffsets: AnyCurve[], outsideOffsets: AnyCurve[], chains?: AnyChain } {\r\n const collector = new MultiChainCollector(gapTolerance, gapTolerance);\r\n for (const s of fragments) {\r\n collector.captureCurve(s);\r\n }\r\n const chains = collector.grabResult(true);\r\n const myOffsetA: CurveCollection[] = [];\r\n const myOffsetB: CurveCollection[] = [];\r\n const offsetLengthA = CurveOps.appendXYOffsets(chains, offsetDistance, myOffsetA);\r\n const offsetLengthB = CurveOps.appendXYOffsets(chains, -offsetDistance, myOffsetB);\r\n if (offsetLengthA > offsetLengthB) {\r\n return { outsideOffsets: myOffsetA, insideOffsets: myOffsetB, chains };\r\n } else {\r\n return { insideOffsets: myOffsetA, outsideOffsets: myOffsetB, chains };\r\n }\r\n }\r\n /**\r\n * Construct curves that are offset from a Path or Loop as viewed in xy-plane (ignoring z).\r\n * * The construction will remove \"some\" local effects of features smaller than the offset distance, but will not detect self intersection among widely separated edges.\r\n * @param curves base curves.\r\n * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.\r\n */\r\n public static constructCurveXYOffset(curves: Path | Loop, offsetDistanceOrOptions: number | OffsetOptions): CurveCollection | undefined {\r\n return CurveChainWireOffsetContext.constructCurveXYOffset(curves, offsetDistanceOrOptions);\r\n }\r\n /**\r\n * Create the offset of a single curve primitive as viewed in the xy-plane (ignoring z).\r\n * @param curve primitive to offset\r\n * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object\r\n */\r\n public static createSingleOffsetPrimitiveXY(curve: CurvePrimitive, offsetDistanceOrOptions: number | OffsetOptions): CurvePrimitive | CurvePrimitive[] | undefined {\r\n return CurveChainWireOffsetContext.createSingleOffsetPrimitiveXY(curve, offsetDistanceOrOptions);\r\n }\r\n /**\r\n * Restructure curve fragments as Paths and Loops.\r\n * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.\r\n * @param fragments fragments to be chained\r\n * @param gapTolerance distance to be treated as \"effectively zero\" when assembling fragments head-to-tail\r\n * @param planeTolerance tolerance for considering a closed chain to be planar. If undefined, only create Path. If defined, create Loops for closed chains within tolerance of a plane.\r\n * @returns chains, possibly wrapped in a [[BagOfCurves]].\r\n */\r\n public static collectChains(fragments: AnyCurve[], gapTolerance: number = Geometry.smallMetricDistance, planeTolerance?: number): AnyChain | undefined {\r\n const collector = new MultiChainCollector(gapTolerance, planeTolerance);\r\n for (const s of fragments) {\r\n collector.captureCurve(s);\r\n }\r\n return collector.grabResult(true);\r\n }\r\n /**\r\n * Restructure curve fragments, to be stroked and passed into the callback.\r\n * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.\r\n * @param fragments fragments to be chained and stroked\r\n * @param announceChain callback to process each stroked Path and Loop\r\n * @param strokeOptions options for stroking the chains\r\n * @param gapTolerance distance to be treated as \"effectively zero\" when assembling fragments head-to-tail. Also used for removing duplicate points in the stroked chains.\r\n * @param _planeTolerance unused, pass undefined\r\n */\r\n public static collectChainsAsLineString3d(fragments: AnyCurve[], announceChain: (chainPoints: LineString3d) => void, strokeOptions?: StrokeOptions, gapTolerance: number = Geometry.smallMetricDistance, _planeTolerance?: number) {\r\n const collector = new MultiChainCollector(gapTolerance); // no planarity tolerance needed\r\n for (const s of fragments) {\r\n collector.captureCurve(s);\r\n }\r\n collector.announceChainsAsLineString3d(announceChain, strokeOptions);\r\n }\r\n /**\r\n * Compute the range of the curves in the local coordinates of a constructed localToWorld frame.\r\n * @param curves input geometry: curves or points.\r\n * @param localRange pre-allocated object to populate with the computed local range.\r\n * @param localToWorld optional pre-allocated object to populate with the computed frame.\r\n * @returns whether the frame was successfully computed.\r\n */\r\n public static computeLocalRange(curves: AnyCurve | MultiLineStringDataVariant, localRange: Range3d, localToWorld?: Transform): boolean {\r\n const builderData: any[] = [curves];\r\n if (localToWorld)\r\n builderData.push(localToWorld);\r\n localToWorld = FrameBuilder.createRightHandedFrame(Vector3d.unitZ(), ...builderData);\r\n if (!localToWorld)\r\n return false;\r\n const worldToLocal = localToWorld.inverse();\r\n localRange.setNull();\r\n if (Array.isArray(curves) || !(curves instanceof GeometryQuery))\r\n Range3d.createFromVariantData(curves, worldToLocal, localRange);\r\n else\r\n this.extendRange(localRange, curves, worldToLocal);\r\n return true;\r\n }\r\n /**\r\n * Check whether or not the curves are planar, and if so, return a localToWorld frame.\r\n * @param curves input geometry: curves or points.\r\n * @param options bundle of options.\r\n * @returns localToWorld frame `T` for coplanar curves, or undefined if they are not coplanar.\r\n * `T` satisfies:\r\n * * `T.origin` is in the plane.\r\n * * `T.matrix.columnZ()` is the plane unit normal (or its negative).\r\n * * `T.matrix.isRigid()` returns true.\r\n * * `T.inverse()` is worldToLocal; apply to input geometry to rotate it into the xy-plane.\r\n */\r\n public static isPlanar(curves: AnyCurve | MultiLineStringDataVariant, options?: PlanarColinearOptions): Transform | undefined {\r\n const localRange = Range3d.create();\r\n const localToWorld = options?.localToWorld ?? Transform.createIdentity();\r\n if (!this.computeLocalRange(curves, localRange, localToWorld))\r\n return undefined;\r\n const maxAltitude = options?.maxDeviation ?? Geometry.smallMetricDistance;\r\n return (localRange.zLength() <= Math.abs(maxAltitude)) ? localToWorld : undefined;\r\n }\r\n /**\r\n * Check whether or not the curves lie in a straight line, and if so, return a colinear ray.\r\n * * This test does not take curve traversal or point order into account.\r\n * @param curves input geometry: curves or points.\r\n * @param options bundle of options.\r\n * @returns ray colinear with input, or undefined if input is not colinear.\r\n */\r\n public static isColinear(curves: AnyCurve | MultiLineStringDataVariant, options?: PlanarColinearOptions): Ray3d | undefined {\r\n const localRange = Range3d.create();\r\n const localToWorld = options?.localToWorld ?? Transform.createIdentity();\r\n if (!this.computeLocalRange(curves, localRange, localToWorld))\r\n return undefined;\r\n const maxAltitude = Math.abs(options?.maxDeviation ?? Geometry.smallMetricDistance);\r\n if (localRange.zLength() > maxAltitude)\r\n return undefined; // non-planar\r\n\r\n const ray = options?.colinearRay ?? Ray3d.createZero();\r\n ray.origin.setFrom(localToWorld.origin);\r\n\r\n const xLength = localRange.xLength();\r\n const yLength = localRange.yLength();\r\n if (xLength <= maxAltitude && yLength <= maxAltitude) {\r\n ray.direction.setZero();\r\n return ray; // the input is essentially a point\r\n }\r\n if (yLength <= maxAltitude) {\r\n localToWorld.matrix.columnX(ray.direction);\r\n return ray; // the input lies along local x-axis\r\n }\r\n if (xLength <= maxAltitude) {\r\n localToWorld.matrix.columnY(ray.direction);\r\n return ray; // the input lies along local y-axis\r\n }\r\n if (!options?.xyColinear)\r\n return undefined; // non-colinear\r\n\r\n const angleTolerance = Math.abs(options?.radianTolerance ?? Geometry.smallAngleRadians);\r\n const verticalPlaneDeviation = Math.abs(localToWorld.matrix.columnDotXYZ(AxisIndex.Z, 0, 0, 1));\r\n if (verticalPlaneDeviation > angleTolerance) // cos(t + pi/2) = -sin(t) ~ -t for small t\r\n return undefined; // non-xy-colinear\r\n\r\n if (xLength > yLength)\r\n localToWorld.matrix.columnX(ray.direction);\r\n else\r\n localToWorld.matrix.columnY(ray.direction);\r\n ray.direction.z = 0.0;\r\n return ray; // xy-colinear (plane is vertical)\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CurveOps.js","sourceRoot":"","sources":["../../../src/curve/CurveOps.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAE1D,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,mBAAmB,EAAE,MAAM,wCAAwC,CAAC;AAC7E,OAAO,EAAE,2BAA2B,EAAE,MAAM,yCAAyC,CAAC;AAEtF,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAoB9B;;;GAGG;AACH,MAAM,OAAO,QAAQ;IACnB,8GAA8G;IACvG,MAAM,CAAC,UAAU,CAAC,MAA6B;QACpD,IAAI,KAAK,GAAG,CAAC,CAA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YAC3C,OAAO,GAAG,CAAC,CAAC,oCAAoC;QAClD,CAAC;QACD,IAAI,OAAO,IAAI,WAAW,EAAE,CAAC;YAC3B,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAC3C,OAAO,GAAG,CAAC,CAAC,oCAAoC;QAClD,CAAC;QACD,IAAI,CAAC,OAAO,EAAE,UAAU;YACtB,OAAO,SAAS,CAAC,CAAC,eAAe;QAEnC,MAAM,cAAc,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,eAAe,IAAI,QAAQ,CAAC,iBAAiB,CAAC,CAAC;QACxF,MAAM,sBAAsB,GAAG,IAAI,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAChG,IAAI,sBAAsB,GAAG,cAAc,EAAE,2CAA2C;YACtF,OAAO,SAAS,CAAC,CAAC,kBAAkB;QAEtC,IAAI,OAAO,GAAG,OAAO;YACnB,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;;YAE3C,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC7C,GAAG,CAAC,SAAS,CAAC,CAAC,GAAG,GAAG,CAAC;QACtB,OAAO,GAAG,CAAC,CAAC,kCAAkC;IAChD,CAAC;CACF","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 { AxisIndex, Geometry } from \"../Geometry\";\nimport { FrameBuilder } from \"../geometry3d/FrameBuilder\";\nimport { MultiLineStringDataVariant } from \"../geometry3d/IndexedXYZCollection\";\nimport { Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { BagOfCurves, CurveCollection } from \"./CurveCollection\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\nimport { AnyChain, AnyCurve } from \"./CurveTypes\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { MultiChainCollector } from \"./internalContexts/MultiChainCollector\";\nimport { CurveChainWireOffsetContext } from \"./internalContexts/PolygonOffsetContext\";\nimport { LineString3d } from \"./LineString3d\";\nimport { Loop } from \"./Loop\";\nimport { OffsetOptions } from \"./OffsetOptions\";\nimport { Path } from \"./Path\";\nimport { StrokeOptions } from \"./StrokeOptions\";\n\n /**\n * Options bundle for use in [[CurveOps.isPlanar]] and [[CurveOps.isColinear]].\n * @public\n */\n export interface PlanarColinearOptions {\n /** Maximum allowable distance that geometry can deviate from planarity/colinearity. Default is [[Geometry.smallMetricDistance]]. */\n maxDeviation?: number;\n /** Whether colinearity test ignores z-coordinates. Default is `false`. */\n xyColinear?: boolean;\n /** Radian tolerance for xy-colinearity, measuring maximum angular deviation from a vertical plane. Default is [[Geometry.smallAngleRadians]]. */\n radianTolerance?: number;\n /** Pre-allocated object to populate with the computed plane-to-world transformation and return when planarity test succeeds. */\n localToWorld?: Transform;\n /** Pre-allocated object to populate with the computed line and return when colinear test succeeds. */\n colinearRay?: Ray3d;\n }\n\n/**\n * Static methods for miscellaneous curve operations.\n * @public\n */\nexport class CurveOps {\n /** Recursively sum curve lengths, allowing CurvePrimitive, CurveCollection, or array of such at any level. */\n public static sumLengths(curves: AnyCurve | AnyCurve[]): number {\n let mySum = 0;\n if (curves instanceof CurvePrimitive) {\n mySum += curves.curveLength();\n } else if (curves instanceof CurveCollection) {\n mySum += curves.sumLengths();\n } else if (Array.isArray(curves)) {\n for (const data1 of curves)\n mySum += this.sumLengths(data1);\n }\n return mySum;\n }\n /** Recursively extend the range by each curve's range, allowing CurvePrimitive, CurveCollection, or array of such at any level. */\n public static extendRange(range: Range3d, curves: AnyCurve | AnyCurve[], transform?: Transform): Range3d {\n if (Array.isArray(curves)) {\n for (const data1 of curves)\n this.extendRange(range, data1, transform);\n } else {\n curves.extendRange(range, transform);\n }\n return range;\n }\n /**\n * Construct a separate xy-offset for each input curve.\n * * For best offset results, the inputs should be parallel to the xy-plane.\n * @param curves input curve(s), z-coordinates ignored. Only curves of type [[AnyChain]] are handled.\n * @param offset offset distance (positive to left of curve, negative to right)\n * @param result array to collect offset curves\n * @returns summed length of offset curves\n */\n public static appendXYOffsets(curves: AnyCurve | AnyCurve[] | undefined, offset: number, result: AnyCurve[]): number {\n let summedLengths = 0;\n if (curves instanceof CurvePrimitive) {\n const resultA = CurveChainWireOffsetContext.constructCurveXYOffset(Path.create(curves), offset);\n if (resultA) {\n summedLengths += this.sumLengths(resultA);\n result.push(resultA);\n }\n } else if (curves instanceof Loop || curves instanceof Path) {\n const resultA = CurveChainWireOffsetContext.constructCurveXYOffset(curves, offset);\n if (resultA) {\n summedLengths += this.sumLengths(resultA);\n result.push(resultA);\n }\n } else if (curves instanceof BagOfCurves) {\n for (const q of curves.children)\n summedLengths += this.appendXYOffsets(q, offset, result);\n } else if (Array.isArray(curves)) {\n for (const q of curves)\n summedLengths += this.appendXYOffsets(q, offset, result);\n }\n return summedLengths;\n }\n /**\n * Restructure curve fragments as Paths and Loops, and construct xy-offsets of the chains.\n * * If the inputs do not form Loop(s), the classification of offsets is suspect.\n * * For best offset results, the inputs should be parallel to the xy-plane.\n * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.\n * @param fragments fragments to be chained and offset\n * @param offsetDistance offset distance, applied to both sides of each fragment to produce inside and outside xy-offset curves.\n * @param gapTolerance distance to be treated as \"effectively zero\" when joining head-to-tail\n * @returns object with named chains, insideOffsets, outsideOffsets\n */\n public static collectInsideAndOutsideXYOffsets(fragments: AnyCurve[], offsetDistance: number, gapTolerance: number): { insideOffsets: AnyCurve[], outsideOffsets: AnyCurve[], chains?: AnyChain } {\n const collector = new MultiChainCollector(gapTolerance, gapTolerance);\n for (const s of fragments) {\n collector.captureCurve(s);\n }\n const chains = collector.grabResult(true);\n const myOffsetA: CurveCollection[] = [];\n const myOffsetB: CurveCollection[] = [];\n const offsetLengthA = CurveOps.appendXYOffsets(chains, offsetDistance, myOffsetA);\n const offsetLengthB = CurveOps.appendXYOffsets(chains, -offsetDistance, myOffsetB);\n if (offsetLengthA > offsetLengthB) {\n return { outsideOffsets: myOffsetA, insideOffsets: myOffsetB, chains };\n } else {\n return { insideOffsets: myOffsetA, outsideOffsets: myOffsetB, chains };\n }\n }\n /**\n * Construct curves that are offset from a Path or Loop as viewed in xy-plane (ignoring z).\n * * The construction will remove \"some\" local effects of features smaller than the offset distance, but will not detect self intersection among widely separated edges.\n * @param curves base curves.\n * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object.\n */\n public static constructCurveXYOffset(curves: Path | Loop, offsetDistanceOrOptions: number | OffsetOptions): CurveCollection | undefined {\n return CurveChainWireOffsetContext.constructCurveXYOffset(curves, offsetDistanceOrOptions);\n }\n /**\n * Create the offset of a single curve primitive as viewed in the xy-plane (ignoring z).\n * @param curve primitive to offset\n * @param offsetDistanceOrOptions offset distance (positive to left of curve, negative to right) or options object\n */\n public static createSingleOffsetPrimitiveXY(curve: CurvePrimitive, offsetDistanceOrOptions: number | OffsetOptions): CurvePrimitive | CurvePrimitive[] | undefined {\n return CurveChainWireOffsetContext.createSingleOffsetPrimitiveXY(curve, offsetDistanceOrOptions);\n }\n /**\n * Restructure curve fragments as Paths and Loops.\n * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.\n * @param fragments fragments to be chained\n * @param gapTolerance distance to be treated as \"effectively zero\" when assembling fragments head-to-tail\n * @param planeTolerance tolerance for considering a closed chain to be planar. If undefined, only create Path. If defined, create Loops for closed chains within tolerance of a plane.\n * @returns chains, possibly wrapped in a [[BagOfCurves]].\n */\n public static collectChains(fragments: AnyCurve[], gapTolerance: number = Geometry.smallMetricDistance, planeTolerance?: number): AnyChain | undefined {\n const collector = new MultiChainCollector(gapTolerance, planeTolerance);\n for (const s of fragments) {\n collector.captureCurve(s);\n }\n return collector.grabResult(true);\n }\n /**\n * Restructure curve fragments, to be stroked and passed into the callback.\n * * Chain formation is dependent upon input fragment order, as a greedy algorithm is employed.\n * @param fragments fragments to be chained and stroked\n * @param announceChain callback to process each stroked Path and Loop\n * @param strokeOptions options for stroking the chains\n * @param gapTolerance distance to be treated as \"effectively zero\" when assembling fragments head-to-tail. Also used for removing duplicate points in the stroked chains.\n * @param _planeTolerance unused, pass undefined\n */\n public static collectChainsAsLineString3d(fragments: AnyCurve[], announceChain: (chainPoints: LineString3d) => void, strokeOptions?: StrokeOptions, gapTolerance: number = Geometry.smallMetricDistance, _planeTolerance?: number) {\n const collector = new MultiChainCollector(gapTolerance); // no planarity tolerance needed\n for (const s of fragments) {\n collector.captureCurve(s);\n }\n collector.announceChainsAsLineString3d(announceChain, strokeOptions);\n }\n /**\n * Compute the range of the curves in the local coordinates of a constructed localToWorld frame.\n * @param curves input geometry: curves or points.\n * @param localRange pre-allocated object to populate with the computed local range.\n * @param localToWorld optional pre-allocated object to populate with the computed frame.\n * @returns whether the frame was successfully computed.\n */\n public static computeLocalRange(curves: AnyCurve | MultiLineStringDataVariant, localRange: Range3d, localToWorld?: Transform): boolean {\n const builderData: any[] = [curves];\n if (localToWorld)\n builderData.push(localToWorld);\n localToWorld = FrameBuilder.createRightHandedFrame(Vector3d.unitZ(), ...builderData);\n if (!localToWorld)\n return false;\n const worldToLocal = localToWorld.inverse();\n localRange.setNull();\n if (Array.isArray(curves) || !(curves instanceof GeometryQuery))\n Range3d.createFromVariantData(curves, worldToLocal, localRange);\n else\n this.extendRange(localRange, curves, worldToLocal);\n return true;\n }\n /**\n * Check whether or not the curves are planar, and if so, return a localToWorld frame.\n * @param curves input geometry: curves or points.\n * @param options bundle of options.\n * @returns localToWorld frame `T` for coplanar curves, or undefined if they are not coplanar.\n * `T` satisfies:\n * * `T.origin` is in the plane.\n * * `T.matrix.columnZ()` is the plane unit normal (or its negative).\n * * `T.matrix.isRigid()` returns true.\n * * `T.inverse()` is worldToLocal; apply to input geometry to rotate it into the xy-plane.\n */\n public static isPlanar(curves: AnyCurve | MultiLineStringDataVariant, options?: PlanarColinearOptions): Transform | undefined {\n const localRange = Range3d.create();\n const localToWorld = options?.localToWorld ?? Transform.createIdentity();\n if (!this.computeLocalRange(curves, localRange, localToWorld))\n return undefined;\n const maxAltitude = options?.maxDeviation ?? Geometry.smallMetricDistance;\n return (localRange.zLength() <= Math.abs(maxAltitude)) ? localToWorld : undefined;\n }\n /**\n * Check whether or not the curves lie in a straight line, and if so, return a colinear ray.\n * * This test does not take curve traversal or point order into account.\n * @param curves input geometry: curves or points.\n * @param options bundle of options.\n * @returns ray colinear with input, or undefined if input is not colinear.\n */\n public static isColinear(curves: AnyCurve | MultiLineStringDataVariant, options?: PlanarColinearOptions): Ray3d | undefined {\n const localRange = Range3d.create();\n const localToWorld = options?.localToWorld ?? Transform.createIdentity();\n if (!this.computeLocalRange(curves, localRange, localToWorld))\n return undefined;\n const maxAltitude = Math.abs(options?.maxDeviation ?? Geometry.smallMetricDistance);\n if (localRange.zLength() > maxAltitude)\n return undefined; // non-planar\n\n const ray = options?.colinearRay ?? Ray3d.createZero();\n ray.origin.setFrom(localToWorld.origin);\n\n const xLength = localRange.xLength();\n const yLength = localRange.yLength();\n if (xLength <= maxAltitude && yLength <= maxAltitude) {\n ray.direction.setZero();\n return ray; // the input is essentially a point\n }\n if (yLength <= maxAltitude) {\n localToWorld.matrix.columnX(ray.direction);\n return ray; // the input lies along local x-axis\n }\n if (xLength <= maxAltitude) {\n localToWorld.matrix.columnY(ray.direction);\n return ray; // the input lies along local y-axis\n }\n if (!options?.xyColinear)\n return undefined; // non-colinear\n\n const angleTolerance = Math.abs(options?.radianTolerance ?? Geometry.smallAngleRadians);\n const verticalPlaneDeviation = Math.abs(localToWorld.matrix.columnDotXYZ(AxisIndex.Z, 0, 0, 1));\n if (verticalPlaneDeviation > angleTolerance) // cos(t + pi/2) = -sin(t) ~ -t for small t\n return undefined; // non-xy-colinear\n\n if (xLength > yLength)\n localToWorld.matrix.columnX(ray.direction);\n else\n localToWorld.matrix.columnY(ray.direction);\n ray.direction.z = 0.0;\n return ray; // xy-colinear (plane is vertical)\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CurvePrimitive.js","sourceRoot":"","sources":["../../../src/curve/CurvePrimitive.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAA+B,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAiB,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAgB,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oCAAoC,EAAE,MAAM,yDAAyD,CAAC;AAC/G,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAkG3E;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAgB,cAAe,SAAQ,aAAa;IACxD,w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AC7G,IAAI,SAAS;YACX,SAAS,CAAC,mBAAmB,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC1E,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;IAC9B,CAAC;IACD;;;;;;;;OAQG;IACI,wBAAwB,CAC7B,cAAgC,EAAE,2BAAoC,EAAE,sBAA+B,KAAK;QAE5G,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IACD;;;;;;;OAOG;IACI,sBAAsB,CAC3B,cAAiC,EAAE,6BAAsC,KAAK,EAAE,qBAA8B,KAAK;QAEnH,MAAM,OAAO,GAAqB,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;QACrF,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,CAAC,CAAC;QACvF,OAAO,OAAO,CAAC;IACjB,CAAC;IAYD;;;;;;;OAOG;IACI,uBAAuB,CAAC,IAAsB,EAAE,QAAkB;QACvE,OAAO,SAAS,CAAC,CAAC,6EAA6E;IACjG,CAAC;CACF","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\nimport { assert } from \"@itwin/core-bentley\";\r\nimport { StrokeCountMap } from \"../curve/Query/StrokeCountMap\";\r\nimport { AxisOrder, Geometry, type PlaneAltitudeEvaluator } from \"../Geometry\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Point3d, type Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { type Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { CurveIntervalRole, CurveLocationDetail, CurveSearchStatus } from \"./CurveLocationDetail\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { AppendPlaneIntersectionStrokeHandler } from \"./internalContexts/AppendPlaneIntersectionStrokeHandler\";\r\nimport { ClosestPointStrokeHandler } from \"./internalContexts/ClosestPointStrokeHandler\";\r\nimport { AnnounceTangentStrokeHandler } from \"./internalContexts/AnnounceTangentStrokeHandler\";\r\nimport { CurveLengthContext } from \"./internalContexts/CurveLengthContext\";\r\nimport { LineString3d } from \"./LineString3d\";\r\n\r\nimport type { AkimaCurve3d } from \"../bspline/AkimaCurve3d\";\r\nimport type { Arc3d } from \"./Arc3d\";\r\nimport type { BezierCurve3d } from \"../bspline/BezierCurve3d\";\r\nimport type { BSplineCurve3d } from \"../bspline/BSplineCurve\";\r\nimport type { Clipper } from \"../clipping/ClipUtils\";\r\nimport type { CurveChainWithDistanceIndex } from \"./CurveChainWithDistanceIndex\";\r\nimport type { DirectSpiral3d } from \"./spiral/DirectSpiral3d\";\r\nimport type { IntegratedSpiral3d } from \"./spiral/IntegratedSpiral3d\";\r\nimport type { InterpolationCurve3d } from \"../bspline/InterpolationCurve3d\";\r\nimport type { IStrokeHandler } from \"../geometry3d/GeometryHandler\";\r\nimport type { LineSegment3d } from \"./LineSegment3d\";\r\nimport type { OffsetOptions } from \"./OffsetOptions\";\r\nimport type { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\r\nimport type { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\r\nimport type { StrokeOptions } from \"./StrokeOptions\";\r\nimport type { VariantCurveExtendParameter } from \"./CurveExtendMode\";\r\n\r\n/**\r\n * Describes the concrete type of a [[CurvePrimitive]]. Each type name maps to a specific subclass and can be used\r\n * for type-switching in conditional statements.\r\n * - \"arc\" => [[Arc3d]]\r\n * - \"lineSegment\" => [[LineSegment3d]]\r\n * - \"lineString\" => [[LineString3d]]\r\n * - \"bsplineCurve\" => [[BSplineCurve3dBase]] which is an intermediate class implemented by [[BSplineCurve3d]] and\r\n * [[BSplineCurve3dH]]\r\n * - \"bezierCurve\" => [[BezierCurveBase]] which is an intermediate class implemented by [[BezierCurve3d]] and\r\n * [[BezierCurve3dH]]\r\n * - \"transitionSpiral\" => [[TransitionSpiral3d]]\r\n * - \"curveChainWithDistanceIndex\" => [[CurveChainWithDistanceIndex]]\r\n * @see [Curve Collections]($docs/learning/geometry/CurvePrimitive.md) learning article.\r\n * @see [[AnyCurvePrimitive]] for a union type that supports compile-time type narrowing.\r\n * @public\r\n */\r\nexport type CurvePrimitiveType = \"arc\" | \"lineSegment\" | \"lineString\" | \"bsplineCurve\" | \"bezierCurve\" | \"transitionSpiral\" | \"curveChainWithDistanceIndex\" | \"interpolationCurve\" | \"akimaCurve\";\r\n/**\r\n * Union type for subclasses of [[CurvePrimitive]]. Specific subclasses can be discriminated at compile- or run-time\r\n * using [[CurvePrimitive.curvePrimitiveType]].\r\n * @public\r\n */\r\nexport type AnyCurvePrimitive = Arc3d | LineSegment3d | LineString3d | BSplineCurve3d | BezierCurve3d | DirectSpiral3d | IntegratedSpiral3d | CurveChainWithDistanceIndex | InterpolationCurve3d | AkimaCurve3d;\r\n/**\r\n * Union type for a linear [[CurvePrimitive]].\r\n * @public\r\n */\r\nexport type LinearCurvePrimitive = LineSegment3d | LineString3d;\r\n/**\r\n * Function signature for callback which announces a pair of numbers, such as a fractional interval, along with a\r\n * containing CurvePrimitive.\r\n * @public\r\n */\r\nexport type AnnounceNumberNumberCurvePrimitive = (a0: number, a1: number, cp: CurvePrimitive) => void;\r\n/**\r\n * Function signature for a callback which announces a pair of numbers\r\n * @public\r\n */\r\nexport type AnnounceNumberNumber = (a0: number, a1: number) => void;\r\n/** Function signature for a callback which announces a curve primitive\r\n * @public\r\n */\r\nexport type AnnounceCurvePrimitive = (cp: CurvePrimitive) => void;\r\n\r\n/**\r\n * Options for computing tangents to a curve from a fixed point `P`.\r\n * See [[CurvePrimitive.emitTangents]], [[CurvePrimitive.allTangents]], and [[CurvePrimitive.closestTangent]].\r\n * @public\r\n */\r\nexport interface TangentOptions {\r\n /**\r\n * The tangent point returned by [[CurvePrimitive.closestTangent]] is nearest to this point as seen in the view plane.\r\n * * Default value is the fixed point `P`.\r\n */\r\n hintPoint?: Point3d,\r\n /**\r\n * Tangents are computed as seen in a view plane perpendicular to this vector.\r\n * * Default value is (0,0,1), i.e., tangents are computed as seen in the top view.\r\n */\r\n vectorToEye?: Vector3d,\r\n /** Stroke options for default stroke-based implementations. */\r\n strokeOptions?: StrokeOptions,\r\n /**\r\n * Compute tangents to the curve extended according to variant type.\r\n * * This option is ignored for linear segments and linestrings.\r\n * * Default value is `false`.\r\n */\r\n extend?: VariantCurveExtendParameter,\r\n /**\r\n * Distance tolerance, interpreted as follows:\r\n * * Maximum distance of `P` from the tangent plane at curve point `Q` in order for `Q-P` to be considered a\r\n * tangent to the curve.\r\n * * Minimum length of a line/stroke segment for which to consider computing a tangent.\r\n * * Default value is [[Geometry.smallMetricDistance]].\r\n */\r\n distanceTol?: number,\r\n}\r\n\r\n/**\r\n * A curve primitive is bounded.\r\n * A curve primitive maps fractions in 0..1 to points in space.\r\n * As the fraction proceeds from 0 towards 1, the point moves \"forward\" along the curve.\r\n * True distance along the curve is not always strictly proportional to fraction.\r\n * * A LineSegment3d always has proportional fraction and distance.\r\n * * An Arc3d which is true circular has proportional fraction and distance.\r\n * * A LineString3d is not proportional (except for special case of all segments of equal length).\r\n * * A Spiral3d is proportional.\r\n * * A BsplineCurve3d is only proportional for special cases.\r\n * For fractions outside 0..1, the curve primitive class may either (a) return the near endpoint or (b) evaluate\r\n * an extended curve.\r\n * @public\r\n */\r\nexport abstract class CurvePrimitive extends GeometryQuery {\r\n /** String name for schema properties */\r\n public readonly geometryCategory = \"curvePrimitive\";\r\n /** String name for schema properties */\r\n public abstract readonly curvePrimitiveType: CurvePrimitiveType;\r\n /** Constructor */\r\n protected constructor() {\r\n super();\r\n }\r\n /**\r\n * Data attached during stroking for facets.\r\n */\r\n public strokeData?: StrokeCountMap;\r\n /**\r\n * Data attached in curve cutting.\r\n * @internal\r\n */\r\n public startCut?: CurveLocationDetail;\r\n /**\r\n * Data attached in curve cutting.\r\n * @internal\r\n */\r\n public endCut?: CurveLocationDetail;\r\n /**\r\n * Data attached by various algorithms (e.g. Region booleans)\r\n */\r\n public parent?: any;\r\n /**\r\n * Return the point (x,y,z) on the curve at fractional position.\r\n * @param fraction fractional position along the geometry.\r\n * @returns Returns a point on the curve.\r\n */\r\n public abstract fractionToPoint(fraction: number, result?: Point3d): Point3d;\r\n /**\r\n * Return the point (x,y,z) and derivative on the curve at fractional position.\r\n * * Note that this derivative is \"derivative of xyz with respect to fraction\".\r\n * * This derivative shows the speed of the \"fractional point\" moving along the curve.\r\n * * This is not generally a unit vector. Use fractionToPointAndUnitTangent for a unit vector.\r\n * @param fraction fractional position along the geometry.\r\n * @returns Returns a ray whose origin is the curve point and direction is the derivative with respect to the fraction.\r\n */\r\n public abstract fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d;\r\n /**\r\n * Returns a ray whose origin is the curve point and direction is the unit tangent.\r\n * @param fraction fractional position on the curve\r\n * @param result optional preallocated ray.\r\n */\r\n public fractionToPointAndUnitTangent(fraction: number, result?: Ray3d): Ray3d {\r\n const ray = this.fractionToPointAndDerivative(fraction, result);\r\n ray.trySetDirectionMagnitudeInPlace(1.0);\r\n return ray;\r\n }\r\n /**\r\n * Returns the (absolute) curvature magnitude.\r\n * * Base implementation in CurvePrimitive computes curvature from the first and second derivative vectors.\r\n * @param fraction fractional position on the curve\r\n */\r\n public fractionToCurvature(fraction: number): number | undefined {\r\n const data = this.fractionToPointAnd2Derivatives(fraction)!;\r\n const cross = data.vectorU.crossProduct(data.vectorV);\r\n const a = cross.magnitude();\r\n const b = data.vectorU.magnitude();\r\n return Geometry.conditionalDivideFraction(a, b * b * b);\r\n }\r\n /**\r\n * Return a plane with\r\n * * origin at fractional position along the curve\r\n * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to\r\n * the fraction.\r\n * * vectorV is the second derivative, i.e. derivative of vectorU which points in the direction of the curve's\r\n * derivative's change.\r\n * * **Note:** We are dealing with a parametric equation of the curve (a function f : R -> R^3) so first and\r\n * second derivatives are in fact derivatives of the parametric equation.\r\n */\r\n public abstract fractionToPointAnd2Derivatives(\r\n fraction: number, result?: Plane3dByOriginAndVectors\r\n ): Plane3dByOriginAndVectors | undefined;\r\n /**\r\n * Construct a frenet frame:\r\n * * origin at the point on the curve\r\n * * x axis is unit vector along the curve (tangent)\r\n * * y axis is perpendicular and in the plane of the osculating circle. y axis is called \"main normal\"\r\n * * z axis perpendicular to those. z axis is called \"bi-normal\"\r\n */\r\n public fractionToFrenetFrame(fraction: number, result?: Transform): Transform | undefined {\r\n const plane = this.fractionToPointAnd2Derivatives(fraction);\r\n if (!plane)\r\n return undefined;\r\n // first derivative (plane.vectorU) and second derivative (plane.vectorV) are not essentially\r\n // perpendicular so we use createRigidFromColumns to make 3 perpendicular vectors.\r\n let axes = Matrix3d.createRigidFromColumns(plane.vectorU, plane.vectorV, AxisOrder.XYZ);\r\n if (axes)\r\n return Transform.createRefs(plane.origin, axes, result);\r\n // 2nd derivative not distinct. for example if curve is linear at fraction so second derivative is 0.\r\n // in this case we find perpendicular vector to plane.vectorU and pass it to createRigidFromColumns.\r\n const perpVector = Matrix3d.createPerpendicularVectorFavorXYPlane(plane.vectorU, plane.vectorV);\r\n axes = Matrix3d.createRigidFromColumns(plane.vectorU, perpVector, AxisOrder.XYZ);\r\n if (axes)\r\n return Transform.createRefs(plane.origin, axes, result);\r\n return undefined;\r\n }\r\n /**\r\n * Construct signed distance from a point on the planar curve to its center of curvature (in xy only).\r\n * * Positive distance means the center is to the left of the curve at fraction.\r\n * * Negative distance means the center is to the right of the curve at fraction.\r\n * * Zero distance means curve is linear at fraction.\r\n */\r\n public fractionToSignedXYRadiusOfCurvature(fraction: number): number {\r\n const plane = this.fractionToPointAnd2Derivatives(fraction);\r\n if (!plane)\r\n return 0.0;\r\n const cross = plane.vectorU.crossProductXY(plane.vectorV);\r\n const b = plane.vectorU.magnitude();\r\n if (b === 0.0)\r\n return 0.0;\r\n const r = Geometry.conditionalDivideCoordinate(b * b * b, cross);\r\n if (r !== undefined)\r\n return r;\r\n return 0.0;\r\n }\r\n /**\r\n * Construct a point extrapolated along tangent at fraction.\r\n * @param fraction fractional position on the primitive\r\n * @param distance (signed) distance to move on the tangent.\r\n */\r\n public fractionAndDistanceToPointOnTangent(fraction: number, distance: number): Point3d {\r\n const ray = this.fractionToPointAndUnitTangent(fraction);\r\n return ray.fractionToPoint(distance);\r\n }\r\n /**\r\n * Return the length of the curve.\r\n * * Curve length is always positive.\r\n */\r\n public curveLength(): number {\r\n const context = new CurveLengthContext();\r\n this.emitStrokableParts(context);\r\n return context.getSum();\r\n }\r\n /**\r\n * Returns a (high accuracy) length of the curve between fractional positions.\r\n * * Curve length is always positive.\r\n * * Default implementation applies a generic Gaussian integration.\r\n * * Most curve classes (certainly LineSegment, LineString, Arc) are expected to provide efficient implementations.\r\n */\r\n public curveLengthBetweenFractions(fraction0: number, fraction1: number): number {\r\n if (fraction0 === fraction1)\r\n return 0.0;\r\n const scale = this.getFractionToDistanceScale();\r\n if (scale !== undefined) {\r\n // We are in luck! simple proportions determine it all !!!\r\n // (for example, a LineSegment3d or a circular arc)\r\n const totalLength = this.curveLength();\r\n return Math.abs((fraction1 - fraction0) * totalLength);\r\n }\r\n const context = new CurveLengthContext(fraction0, fraction1);\r\n this.emitStrokableParts(context);\r\n return Math.abs(context.getSum());\r\n }\r\n /**\r\n * Returns the range of the curve between fractional positions.\r\n * * Default implementation calls [[rangeBetweenFractionsByClone]].\r\n */\r\n public rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\r\n return this.rangeBetweenFractionsByClone(fraction0, fraction1, transform);\r\n }\r\n /** Returns a high accuracy range of the curve between fractional positions using [[clonePartialCurve]]. */\r\n public rangeBetweenFractionsByClone(fraction0: number, fraction1: number, transform?: Transform): Range3d {\r\n if (fraction0 === fraction1)\r\n return Range3d.create(this.fractionToPoint(fraction0));\r\n const fragment = this.clonePartialCurve(fraction0, fraction1);\r\n if (fragment)\r\n return fragment.range(transform);\r\n return Range3d.createNull();\r\n }\r\n /**\r\n * Returns an approximate range based on a fixed number of evaluations.\r\n * * Default implementation returns a range determined by evaluating a specified number of points on the curve.\r\n * * Optionally evaluate again at interval midpoints and extrapolate any increase.\r\n * * For a smooth curve, Richardson extrapolation suggests each subdivision moves 3/4 of the way to final. So\r\n * extrapolationFactor of 1/3 speculatively moves closer to the tight range, and larger multipliers increase\r\n * confidence in being safely larger.\r\n * * This function is faster to compute the range of a portion of a curve, because some curves can be\r\n * expensive to compute the partial curve and/or to compute the partial curve's range.\r\n * @param fraction0 start fraction for evaluation\r\n * @param fraction1 end fraction for evaluation\r\n * @param count number of points to evaluate\r\n * @param transform optional transform to be applied to the curve\r\n * @param extrapolationFactor if positive, evaluate again at interval midpoints and apply this fraction multiplier\r\n * to any increase in size.\r\n */\r\n public rangeBetweenFractionsByCount(\r\n fraction0: number, fraction1: number, count: number, transform?: Transform, extrapolationFactor: number = 0.0,\r\n ): Range3d {\r\n const range = Range3d.createNull();\r\n const workPoint = Point3d.create();\r\n range.extendPoint(this.startPoint(workPoint));\r\n range.extendPoint(this.endPoint(workPoint));\r\n // Evaluate at count fractions (fraction0 + i * fractionStep)\r\n const evaluateSteps = (fractionA: number, fractionStep: number, countA: number) => {\r\n let f = fractionA;\r\n for (let i = 0; i < countA; i++, f += fractionStep) {\r\n this.fractionToPoint(f, workPoint);\r\n if (transform)\r\n range.extendTransformedPoint(transform, workPoint);\r\n else\r\n range.extendPoint(workPoint);\r\n }\r\n };\r\n const interiorCount = count - 2;\r\n if (interiorCount > 0) {\r\n const localFraction0 = 1.0 / (interiorCount + 1);\r\n const globalFractionStep = localFraction0 * (fraction1 - fraction0);\r\n evaluateSteps(fraction0 + globalFractionStep, globalFractionStep, interiorCount);\r\n }\r\n if (extrapolationFactor > 0.0) {\r\n // Evaluate at midpoints. Where this makes the range larger, apply extrapolationFactor to move it to safer\r\n // excess value. same interior step, but shift to interval midpoints.\r\n const baseRange = range.clone();\r\n const interiorCount1 = interiorCount + 1;\r\n const localFraction0 = 0.5 / interiorCount1; // we only evaluate at new midpoints.\r\n const globalFractionStep = 2 * localFraction0 * (fraction1 - fraction0); // same as above, but avoids special logic for interiorCount = 0\r\n evaluateSteps(fraction0 + globalFractionStep * 0.5, globalFractionStep, interiorCount1);\r\n range.extendWhenLarger(baseRange, extrapolationFactor);\r\n }\r\n return range;\r\n }\r\n /**\r\n * Run an integration (with a default Gaussian quadrature) with a fixed fractional step\r\n * * This is typically called by specific curve type implementations of curveLengthBetweenFractions.\r\n * * For example, in Arc3d implementation of curveLengthBetweenFractions:\r\n * * If the Arc3d is true circular, it the arc is true circular, use the direct `arcLength = radius * sweepRadians`\r\n * * If the Arc3d is not true circular, call this method with an interval count appropriate to eccentricity and\r\n * sweepRadians.\r\n * @returns Returns the curve length via an integral estimated by numerical quadrature between the fractional positions.\r\n * @param fraction0 start fraction for integration\r\n * @param fraction1 end fraction for integration\r\n * @param numInterval number of quadrature intervals\r\n */\r\n public curveLengthWithFixedIntervalCountQuadrature(\r\n fraction0: number, fraction1: number, numInterval: number, numGauss: number = 5,\r\n ): number {\r\n if (fraction0 > fraction1) {\r\n const fSave = fraction0;\r\n fraction0 = fraction1;\r\n fraction1 = fSave;\r\n }\r\n const context = new CurveLengthContext(fraction0, fraction1, numGauss);\r\n context.announceIntervalForUniformStepStrokes(this, numInterval, fraction0, fraction1);\r\n return Math.abs(context.getSum());\r\n }\r\n /**\r\n * (Attempt to) find a position on the curve at a signed distance from start fraction.\r\n * * Return the position as a CurveLocationDetail.\r\n * * In the `CurveLocationDetail`, record:\r\n * * `fraction` = fractional position\r\n * * `point` = coordinates of the point\r\n * * `a` = (signed!) distance moved. If `allowExtension` is false and the move reached the start or end of the\r\n * curve, this distance is smaller than the requested signedDistance.\r\n * * `curveSearchStatus` indicates one of:\r\n * * `error` (unusual) computation failed not supported for this curve.\r\n * * `success` full movement completed\r\n * * `stoppedAtBoundary` partial movement completed. This can be due to either\r\n * * `allowExtension` parameter sent as `false`\r\n * * the curve type (e.g. bspline) does not support extended range.\r\n * * if `allowExtension` is true, movement may still end at the startPoint or end point for curves that do not support\r\n * extended geometry (specifically bsplines)\r\n * * if the curve returns a value (i.e. not `undefined`) for `curve.getFractionToDistanceScale()`, the base class\r\n * carries out the computation\r\n * and returns a final location.\r\n * * LineSegment3d relies on this.\r\n * * If the curve does not implement the computation or the curve has zero length, the returned `CurveLocationDetail`\r\n * has\r\n * * `fraction` = the value of `startFraction`\r\n * * `point` = result of `curve.fractionToPoint(startFraction)`\r\n * * `a` = 0\r\n * * `curveStartState` = `CurveSearchStatus.error`\r\n * @param startFraction fractional position where the move starts\r\n * @param signedDistance distance to move. Negative distance is backwards in the fraction space\r\n * @param allowExtension if true, allow the move to go beyond the startPoint or endpoint of the curve. If false,\r\n * do not allow movement beyond the startPoint or endpoint\r\n * @param result optional result.\r\n * @returns A CurveLocationDetail annotated as above. Note that if the curve does not support the calculation, there is\r\n * still a result which contains the point at the input startFraction, with failure indicated in the `curveStartState`\r\n * member\r\n */\r\n public moveSignedDistanceFromFraction(\r\n startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n const scale = this.getFractionToDistanceScale();\r\n if (scale !== undefined) {\r\n // We are in luck! simple proportions determine it all !!!\r\n // (for example, a LineSegment3d or a circular arc)\r\n const totalLength = this.curveLength();\r\n const signedFractionMove = Geometry.conditionalDivideFraction(signedDistance, totalLength);\r\n if (signedFractionMove === undefined) {\r\n return CurveLocationDetail.createCurveFractionPointDistanceCurveSearchStatus(\r\n this, startFraction, this.fractionToPoint(startFraction), 0.0, CurveSearchStatus.error);\r\n }\r\n return CurveLocationDetail.createConditionalMoveSignedDistance(\r\n allowExtension,\r\n this,\r\n startFraction,\r\n startFraction + signedFractionMove,\r\n signedDistance,\r\n result,\r\n );\r\n }\r\n return this.moveSignedDistanceFromFractionGeneric(startFraction, signedDistance, allowExtension, result);\r\n }\r\n /**\r\n * Generic algorithm to search for point at signed distance from a fractional startPoint.\r\n * * This will work for well for smooth curves.\r\n * * Curves with tangent or other low-order-derivative discontinuities may need to implement specialized algorithms.\r\n * * We need to find an endFraction which is the end-of-interval (usually upper) limit of integration of the tangent\r\n * magnitude from startFraction to endFraction\r\n * * That integral is a function of endFraction.\r\n * * The derivative of that integral with respect to end fraction is the tangent magnitude at end fraction.\r\n * * Use that function and (easily evaluated!) derivative for a Newton iteration\r\n * * TO ALL WHO HAVE FUZZY MEMORIES OF CALCULUS CLASS: \"The derivative of the integral wrt upper limit is the value\r\n * of the integrand there\" is the fundamental theorem of integral calculus !!! The fundamental theorem is not just\r\n * an abstraction !!! It is being used here in its barest possible form !!!\r\n * * See https://en.wikipedia.org/wiki/Fundamental_theorem_of_calculus\r\n * @param startFraction\r\n * @param signedDistance\r\n * @param _allowExtension\r\n * @param result\r\n */\r\n protected moveSignedDistanceFromFractionGeneric(\r\n startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n let limitFraction: number;\r\n const slackFraction = 0.1; // slack to use when integration would otherwise have no room to work\r\n if (signedDistance === 0.0)\r\n return CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result); // no movement, just evaluate at startFraction\r\n if (signedDistance > 0.0) {\r\n limitFraction = 1.0;\r\n if (startFraction >= 1.0) {\r\n const newStartFraction = 1.0 - slackFraction;\r\n signedDistance += this.curveLengthBetweenFractions(newStartFraction, startFraction);\r\n startFraction = newStartFraction;\r\n }\r\n } else { // signedDistance < 0.0\r\n limitFraction = 0.0;\r\n if (startFraction <= 0.0) {\r\n const newStartFraction = 0.0 + slackFraction;\r\n signedDistance -= this.curveLengthBetweenFractions(startFraction, newStartFraction);\r\n startFraction = newStartFraction;\r\n }\r\n }\r\n const availableLength = this.curveLengthBetweenFractions(startFraction, limitFraction);\r\n assert(availableLength > 0.0);\r\n const absDistance = Math.abs(signedDistance);\r\n if (availableLength < absDistance && !allowExtension)\r\n return CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, limitFraction, signedDistance, result);\r\n\r\n const fractionStep = Geometry.conditionalDivideCoordinate(absDistance, availableLength);\r\n if (undefined === fractionStep) {\r\n // no available length!\r\n result = CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result);\r\n result.curveSearchStatus = CurveSearchStatus.error;\r\n return result;\r\n }\r\n const directionFactor = signedDistance < 0.0 ? -1.0 : 1.0;\r\n let fractionB = Geometry.interpolate(startFraction, fractionStep, limitFraction);\r\n let fractionA = startFraction;\r\n let distanceA = 0.0;\r\n const tol = 1.0e-12 * availableLength;\r\n let numConverged = 0;\r\n const tangent = Ray3d.createXAxis();\r\n // on each loop entry:\r\n // fractionA is the most recent endOfInterval. (It may have been reached by a mixture of forward and backward step.)\r\n // distanceA is the distance to (the point at) fractionA\r\n // fractionB is the next end fraction\r\n for (let iterations = 0; iterations < 10; iterations++) {\r\n const distanceAB = this.curveLengthBetweenFractions(fractionA, fractionB);\r\n const directionAB = fractionB > fractionA ? directionFactor : -directionFactor;\r\n const distance0B = distanceA + directionAB * distanceAB;\r\n const distanceError = absDistance - distance0B;\r\n if (Math.abs(distanceError) < tol) {\r\n numConverged++;\r\n if (numConverged > 1)\r\n break;\r\n } else {\r\n numConverged = 0;\r\n }\r\n this.fractionToPointAndDerivative(fractionB, tangent);\r\n const tangentMagnitude = tangent.direction.magnitude();\r\n fractionA = fractionB;\r\n fractionB = fractionA + directionFactor * distanceError / tangentMagnitude;\r\n if (fractionA === fractionB) { // YES -- that is an exact equality test. When it happens, there's no need for confirming with another iteration.\r\n numConverged = 100;\r\n break;\r\n }\r\n distanceA = distance0B;\r\n }\r\n if (numConverged > 1)\r\n return CurveLocationDetail.createConditionalMoveSignedDistance(\r\n allowExtension, this, startFraction, fractionB, signedDistance, result,\r\n );\r\n result = CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result);\r\n result.curveSearchStatus = CurveSearchStatus.error;\r\n return result;\r\n }\r\n /**\r\n * * Returns true if the curve can be easily extended past its start/end point (i.e., beyond the usual\r\n * fraction space [0,1]). Otherwise, returns false.\r\n * * Base class default implementation returns false.\r\n * * These classes (and perhaps others in the future) will return true:\r\n * * LineSegment3d\r\n * * LineString3d\r\n * * Arc3d\r\n */\r\n public get isExtensibleFractionSpace(): boolean {\r\n return false;\r\n }\r\n /**\r\n * Compute a length for curve which may be a fast approximation to the true length.\r\n * This is expected to be either (a) exact or (b) larger than the actual length, but by no more than\r\n * a small multiple, perhaps up to PI/2, but commonly much closer to 1.\r\n *\r\n * * An example use of this is for setting a tolerance which is a small multiple of the curve length.\r\n * * Simple line, circular arc, and transition spiral may return exact length\r\n * * Ellipse may return circumference of some circle or polygon that encloses the ellipse.\r\n * * bspline curve may return control polygon length\r\n * *\r\n */\r\n public abstract quickLength(): number;\r\n /**\r\n * Search for a point on the curve that is closest to the spacePoint.\r\n * * If the space point is exactly on the curve, this is the reverse of fractionToPoint.\r\n * * Since CurvePrimitive should always have start and end available as candidate points, this method should always\r\n * succeed.\r\n * @param spacePoint point in space.\r\n * @param extend (optional) compute the closest point to the curve extended according to variant type (default false)\r\n * @param result (optional) pre-allocated detail to populate and return.\r\n * @returns details of the closest point.\r\n */\r\n public closestPoint(\r\n spacePoint: Point3d, extend?: VariantCurveExtendParameter, result?: CurveLocationDetail,\r\n ): CurveLocationDetail | undefined {\r\n const strokeHandler = new ClosestPointStrokeHandler(spacePoint, extend, result);\r\n this.emitStrokableParts(strokeHandler);\r\n return strokeHandler.claimResult();\r\n }\r\n /**\r\n * Announce all points `P` on the curve such that the line containing `spacePoint` and `P` is tangent to the curve in\r\n * the view defined by `options.vectorToEye`.\r\n * * Strictly speaking, each tangent line lies in the plane through `P` whose normal is the cross product of the curve\r\n * tangent at `P` and `options.vectorToEye`. This is equivalent to tangency as seen in a view plane perpendicular to\r\n * `options.vectorToEye`.\r\n * @param spacePoint point in space.\r\n * @param announceTangent callback to announce each computed tangent. The received [[CurveLocationDetail]] is reused\r\n * internally, so it should be cloned in the callback if it needs to be saved.\r\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\r\n */\r\n public emitTangents(\r\n spacePoint: Point3d, announceTangent: (tangent: CurveLocationDetail) => any, options?: TangentOptions,\r\n ): void {\r\n const strokeHandler = new AnnounceTangentStrokeHandler(spacePoint, announceTangent, options);\r\n this.emitStrokableParts(strokeHandler, options?.strokeOptions);\r\n }\r\n /**\r\n * Return all points `P` on the curve such that the line containing `spacePoint` and `P` is tangent to the curve in\r\n * the view defined by `options.vectorToEye`.\r\n * * See [[emitTangents]] for the definition of tangency employed.\r\n * @param spacePoint point in space.\r\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\r\n * @returns an array of details of all tangent points or undefined if no tangent was found.\r\n */\r\n public allTangents(spacePoint: Point3d, options?: TangentOptions): CurveLocationDetail[] | undefined {\r\n const tangents: CurveLocationDetail[] = [];\r\n this.emitTangents(spacePoint, (t: CurveLocationDetail) => tangents.push(t.clone()), options);\r\n return (tangents.length === 0) ? undefined : tangents;\r\n }\r\n /**\r\n * Return the point `P` on the curve such that the line containing `spacePoint` and `P` is tangent to the curve in\r\n * the view defined by `options.vectorToEye`, and `P` is closest to `options.hintPoint` in this view.\r\n * * See [[emitTangents]] for the definition of tangency employed.\r\n * @param spacePoint point in space.\r\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\r\n * @returns the detail of the closest tangent point or undefined if no tangent was found.\r\n */\r\n public closestTangent(spacePoint: Point3d, options?: TangentOptions): CurveLocationDetail | undefined {\r\n const hint = options?.hintPoint ?? spacePoint;\r\n let toLocal: Matrix3d | undefined;\r\n if (options?.vectorToEye && !options.vectorToEye.isExactEqual({ x: 0, y: 0, z: 1 }))\r\n toLocal = Matrix3d.createRigidViewAxesZTowardsEye(options.vectorToEye.x, options.vectorToEye.y, options.vectorToEye.z);\r\n const measureHintDist2 = (pt: Point3d): number => { // measure distance to hint in view plane coordinates\r\n return toLocal?.multiplyTransposeXYZ(hint.x - pt.x, hint.y - pt.y, hint.z - pt.z).magnitudeSquaredXY() ?? pt.distanceSquaredXY(hint);\r\n };\r\n let closestTangent: CurveLocationDetail | undefined;\r\n let closestDist2 = Geometry.largeCoordinateResult;\r\n const collectClosestTangent = (tangent: CurveLocationDetail) => {\r\n const dist2 = measureHintDist2(tangent.point);\r\n if (!closestTangent || dist2 < closestDist2) {\r\n closestTangent = tangent.clone(closestTangent);\r\n closestDist2 = dist2;\r\n }\r\n };\r\n this.emitTangents(spacePoint, collectClosestTangent, options);\r\n return closestTangent;\r\n }\r\n /**\r\n * Find intervals of this curvePrimitive that are interior to a clipper\r\n * @param clipper clip structure (e.g. clip planes)\r\n * @param announce (optional) function to be called announcing fractional intervals\r\n * `announce(fraction0, fraction1, curvePrimitive)`\r\n * @returns true if any \"in\" segments are announced.\r\n */\r\n public announceClipIntervals(_clipper: Clipper, _announce?: AnnounceNumberNumberCurvePrimitive): boolean {\r\n // DEFAULT IMPLEMENTATION -- no interior parts\r\n return false;\r\n }\r\n /** Return a deep clone. */\r\n public abstract override clone(): CurvePrimitive;\r\n /** Return a transformed deep clone. */\r\n public abstract override cloneTransformed(transform: Transform): CurvePrimitive | undefined;\r\n /**\r\n * Return (if possible) a curve primitive which is a portion of this curve.\r\n * @param _fractionA [in] start fraction\r\n * @param _fractionB [in] end fraction\r\n */\r\n public clonePartialCurve(_fractionA: number, _fractionB: number): CurvePrimitive | undefined {\r\n return undefined;\r\n }\r\n /**\r\n * If the curve primitive has distance-along-curve strictly proportional to curve fraction, return the scale factor.\r\n * If distance-along-the-curve is not proportional, return undefined.\r\n * * When defined, the scale factor is always the length of the curve.\r\n * * This scale factor is typically available for these curve types:\r\n * * * All `LineSegment3d`\r\n * * * Arc3d which is a true circular arc (axes perpendicular and of equal length).\r\n * * * CurveChainWithDistanceIndex\r\n * * This scale factor is undefined for these curve types:\r\n * * * Arc3d which is a true ellipse, i.e. unequal lengths of defining vectors or non-perpendicular defining vectors.\r\n * * * bspline and bezier curves\r\n * @returns scale factor or undefined\r\n */\r\n public getFractionToDistanceScale(): number | undefined {\r\n return undefined;\r\n }\r\n /** Reverse the curve's data so that its fractional stroking moves in the opposite direction. */\r\n public abstract reverseInPlace(): void;\r\n /**\r\n * Compute intersections of the curve with a plane.\r\n * * The intersections are appended to the result array.\r\n * * The base class implementation emits strokes to an AppendPlaneIntersectionStrokeHandler object, which uses a\r\n * Newton iteration to get high-accuracy intersection points within strokes.\r\n * * Derived classes should override this default implementation if there are easy analytic solutions.\r\n * * Derived classes are free to implement extended intersections (e.g. arc!!!)\r\n * @param plane The plane to be intersected.\r\n * @param result Array to receive intersections\r\n * @returns Return the number of CurveLocationDetail's added to the result array.\r\n */\r\n public appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\r\n const strokeHandler = new AppendPlaneIntersectionStrokeHandler(plane, result);\r\n const n0 = result.length;\r\n this.emitStrokableParts(strokeHandler);\r\n return result.length - n0;\r\n }\r\n /**\r\n * Examine contents of an array of CurveLocationDetail.\r\n * Filter the intersections according to the parameters.\r\n * @param allowExtend if false, remove points on the extension.\r\n * @param applySnappedCoordinates if true, change the stored fractions and coordinates to exact end values.\r\n * Otherwise use the exact values only for purpose of updating the curveIntervalRole.\r\n * @param startEndFractionTolerance if nonzero, adjust fraction to 0 or 1 with this tolerance.\r\n * @param startEndXYZTolerance if nonzero, adjust to endpoint with this tolerance.\r\n * @internal\r\n */\r\n public static snapAndRestrictDetails(\r\n details: CurveLocationDetail[],\r\n allowExtend: boolean = true,\r\n applySnappedCoordinates: boolean = false,\r\n startEndFractionTolerance = Geometry.smallAngleRadians,\r\n startEndXYZTolerance = Geometry.smallMetricDistance,\r\n ): void {\r\n const n0 = details.length;\r\n let acceptIndex = 0;\r\n const point0 = Point3d.create();\r\n const point1 = Point3d.create();\r\n let snappedCoordinates: Point3d | undefined;\r\n for (let candidateIndex = 0; candidateIndex < n0; candidateIndex++) {\r\n snappedCoordinates = undefined;\r\n const detail = details[candidateIndex];\r\n let fraction = detail.fraction;\r\n let accept = allowExtend || Geometry.isIn01(fraction);\r\n if (detail.curve) {\r\n detail.curve.startPoint(point0);\r\n detail.curve.endPoint(point1);\r\n }\r\n if (startEndFractionTolerance > 0) {\r\n if (Math.abs(fraction) < startEndFractionTolerance) {\r\n fraction = 0.0;\r\n accept = true;\r\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\r\n snappedCoordinates = point0;\r\n }\r\n if (Math.abs(fraction - 1.0) < startEndFractionTolerance) {\r\n fraction = 1.0;\r\n accept = true;\r\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\r\n snappedCoordinates = point1;\r\n if (detail.curve)\r\n snappedCoordinates = detail.curve.startPoint(point1);\r\n }\r\n }\r\n if (startEndXYZTolerance > 0 && detail.curve !== undefined) {\r\n // REMARK: always test both endpoints. If there is a cyclic fraction space, an intersection marked as \"after\" the end might have wrapped all the way to the beginning.\r\n if (detail.point.distance(point0) <= startEndXYZTolerance) {\r\n fraction = 0.0;\r\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\r\n snappedCoordinates = point0;\r\n } else if (detail.point.distance(point1) <= startEndXYZTolerance) {\r\n fraction = 1.0;\r\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\r\n snappedCoordinates = point1;\r\n }\r\n }\r\n if (accept) {\r\n if (applySnappedCoordinates) {\r\n detail.fraction = fraction;\r\n if (snappedCoordinates !== undefined)\r\n detail.point.setFrom(snappedCoordinates);\r\n }\r\n if (acceptIndex < candidateIndex)\r\n details[acceptIndex] = detail;\r\n acceptIndex++;\r\n }\r\n }\r\n if (acceptIndex < n0)\r\n details.length = acceptIndex;\r\n }\r\n /**\r\n * Ask if the curve is within tolerance of a plane.\r\n * @returns Returns true if the curve is completely within tolerance of the plane.\r\n */\r\n public abstract isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean;\r\n /** Return the startPoint of the primitive. The default implementation returns fractionToPoint(0.0) */\r\n public startPoint(result?: Point3d): Point3d {\r\n return this.fractionToPoint(0.0, result);\r\n }\r\n /** Return the end point of the primitive. The default implementation returns fractionToPoint(1.0) */\r\n public endPoint(result?: Point3d): Point3d {\r\n return this.fractionToPoint(1.0, result);\r\n }\r\n /**\r\n * Whether the start and end points are defined and within tolerance.\r\n * * Does not check for planarity or degeneracy.\r\n * @param tolerance optional distance tolerance (default is [[Geometry.smallMetricDistance]])\r\n * @param xyOnly if true, ignore z coordinate (default is `false`)\r\n */\r\n public isPhysicallyClosedCurve(tolerance: number = Geometry.smallMetricDistance, xyOnly: boolean = false): boolean {\r\n const p0 = this.startPoint();\r\n const p1 = this.endPoint();\r\n return p0 !== undefined && p1 !== undefined && (xyOnly ? p0.isAlmostEqualXY(p1, tolerance) : p0.isAlmostEqual(p1, tolerance));\r\n }\r\n\r\n /** Append stroke points to caller-supplied linestring. */\r\n public abstract emitStrokes(dest: LineString3d, options?: StrokeOptions): void;\r\n /**\r\n * Ask the curve to announce points and simple subcurve fragments for stroking.\r\n * See IStrokeHandler for description of the sequence of the method calls.\r\n */\r\n public abstract emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void;\r\n /**\r\n * Return the stroke count required for given options.\r\n * * This returns a single number\r\n * * See computeComponentStrokeCountForOptions to get structured per-component counts and fraction mappings.\r\n * @param options StrokeOptions that determine count\r\n */\r\n public abstract computeStrokeCountForOptions(options?: StrokeOptions): number;\r\n /**\r\n * Attach StrokeCountMap structure to this primitive (and recursively to any children)\r\n * * Base class implementation (here) gets the simple count from computeStrokeCountForOptions and attaches it.\r\n * * LineString3d, arc3d, BezierCurve3d, BezierCurve3dH accept that default.\r\n * * Subdivided primitives (linestring, bspline curve) implement themselves and attach a StrokeCountMap containing the\r\n * total count, and also containing an array of StrokeCountMap per component.\r\n * * For CurvePrimitiveWithDistanceIndex, the top level gets (only) a total count, and each child gets\r\n * its own StrokeCountMap with appropriate structure.\r\n * @param options StrokeOptions that determine count\r\n * @param parentStrokeMap optional map from parent. Its count, curveLength, and a1 values are increased with count\r\n * and distance from this primitive.\r\n * @return sum of `a0+this.curveLength()`, for use as `a0` of successor in chain.\r\n */\r\n public computeAndAttachRecursiveStrokeCounts(options?: StrokeOptions, parentMap?: StrokeCountMap) {\r\n const n = this.computeStrokeCountForOptions(options);\r\n const a = this.curveLength();\r\n CurvePrimitive.installStrokeCountMap(\r\n this,\r\n StrokeCountMap.createWithCurvePrimitive(this, n, a, 0, a),\r\n parentMap);\r\n }\r\n /**\r\n * Evaluate strokes at fractions indicated in a StrokeCountMap.\r\n * * Base class implementation (here) gets the simple count from computeStrokeCountForOptions and strokes at\r\n * uniform fractions.\r\n * * LineString3d, arc3d, BezierCurve3d, BezierCurve3dH accept that default.\r\n * * Subdivided primitives (linestring, bspline curve) implement themselves and evaluate within components.\r\n * * CurvePrimitiveWithDistanceIndex recurses to its children.\r\n * * if packedFraction and packedDerivative arrays are present in the LineString3d, fill them.\r\n * @param map = stroke count data.\r\n * @param linestring = receiver linestring.\r\n * @return number of strokes added. 0 if any errors matching the map to the curve primitive.\r\n */\r\n public addMappedStrokesToLineString3D(map: StrokeCountMap, linestring: LineString3d): number {\r\n const numPoint0 = linestring.numPoints();\r\n if (map.primitive && map.primitive === this && map.numStroke > 0) {\r\n for (let i = 0; i <= map.numStroke; i++) {\r\n const fraction = i / map.numStroke;\r\n linestring.appendFractionToPoint(this, fraction);\r\n }\r\n }\r\n return linestring.numPoints() - numPoint0;\r\n }\r\n /**\r\n * Final install step to save curveMap in curve. If parentMap is given, update its length, count, and a1 fields\r\n * @param curve curve to receive the annotation\r\n * @param map\r\n * @param parentMap\r\n */\r\n public static installStrokeCountMap(curve: CurvePrimitive, curveMap: StrokeCountMap, parentMap?: StrokeCountMap) {\r\n if (parentMap)\r\n parentMap.addToCountAndLength(curveMap.numStroke, curveMap.curveLength);\r\n curve.strokeData = curveMap;\r\n }\r\n /**\r\n * Return an array containing only the curve primitives.\r\n * * This DEFAULT implementation simply pushes `this` to the collectorArray.\r\n * @param collectorArray array to receive primitives (pushed -- the array is not cleared)\r\n * @param smallestPossiblePrimitives if true, a [[CurvePrimitiveWithDistanceIndex]] recurses on its (otherwise hidden)\r\n * children. If false, it returns only itself.\r\n * @param explodeLinestrings if true, push a [[LineSegment3d]] for each segment of a [[LineString3d]]. If false,\r\n * push only the [[LineString3d]].\r\n */\r\n public collectCurvePrimitivesGo(\r\n collectorArray: CurvePrimitive[], _smallestPossiblePrimitives: boolean, _explodeLinestrings: boolean = false,\r\n ): void {\r\n collectorArray.push(this);\r\n }\r\n /**\r\n * Return an array containing only the curve primitives.\r\n * * This DEFAULT implementation captures the optional collector and calls [[collectCurvePrimitivesGo]].\r\n * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without\r\n * clearing the array.)\r\n * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,\r\n * it recurses to its (otherwise hidden) children.\r\n */\r\n public collectCurvePrimitives(\r\n collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLinestrings: boolean = false,\r\n ): CurvePrimitive[] {\r\n const results: CurvePrimitive[] = collectorArray === undefined ? [] : collectorArray;\r\n this.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\r\n return results;\r\n }\r\n /**\r\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\r\n * * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset\r\n * for an aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use [[CurveOps.constructCurveXYOffset]]\r\n * instead.\r\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\r\n */\r\n public abstract constructOffsetXY(\r\n offsetDistanceOrOptions: number | OffsetOptions\r\n ): CurvePrimitive | CurvePrimitive[] | undefined;\r\n\r\n /**\r\n * Project instance geometry (via dispatch) onto the line of the given ray, and return the extreme fractional\r\n * parameters of projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\r\n * end of the ray.\r\n */\r\n public projectedParameterRange(_ray: Vector3d | Ray3d, _lowHigh?: Range1d): Range1d | undefined {\r\n return undefined; // common implementation delegated to subclasses to avoid circular dependency\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CurvePrimitive.js","sourceRoot":"","sources":["../../../src/curve/CurvePrimitive.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,QAAQ,EAA+B,MAAM,aAAa,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAiB,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAgB,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,oCAAoC,EAAE,MAAM,yDAAyD,CAAC;AAC/G,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAC/F,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;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;OAKG;IACI,MAAM,CAAC,qBAAqB,CAAC,KAAqB,EAAE,QAAwB,EAAE,SAA0B;QAC7G,IAAI,SAAS;YACX,SAAS,CAAC,mBAAmB,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;QAC1E,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAC;IAC9B,CAAC;IACD;;;;;;;;OAQG;IACI,wBAAwB,CAC7B,cAAgC,EAAE,2BAAoC,EAAE,sBAA+B,KAAK;QAE5G,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IACD;;;;;;;OAOG;IACI,sBAAsB,CAC3B,cAAiC,EAAE,6BAAsC,KAAK,EAAE,qBAA8B,KAAK;QAEnH,MAAM,OAAO,GAAqB,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,cAAc,CAAC;QACrF,IAAI,CAAC,wBAAwB,CAAC,OAAO,EAAE,0BAA0B,EAAE,kBAAkB,CAAC,CAAC;QACvF,OAAO,OAAO,CAAC;IACjB,CAAC;IAYD;;;;;;;OAOG;IACI,uBAAuB,CAAC,IAAsB,EAAE,QAAkB;QACvE,OAAO,SAAS,CAAC,CAAC,6EAA6E;IACjG,CAAC;CACF","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 */\nimport { assert } from \"@itwin/core-bentley\";\nimport { StrokeCountMap } from \"../curve/Query/StrokeCountMap\";\nimport { AxisOrder, Geometry, type PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\nimport { Point3d, type Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { type Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { CurveIntervalRole, CurveLocationDetail, CurveSearchStatus } from \"./CurveLocationDetail\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { AppendPlaneIntersectionStrokeHandler } from \"./internalContexts/AppendPlaneIntersectionStrokeHandler\";\nimport { ClosestPointStrokeHandler } from \"./internalContexts/ClosestPointStrokeHandler\";\nimport { AnnounceTangentStrokeHandler } from \"./internalContexts/AnnounceTangentStrokeHandler\";\nimport { CurveLengthContext } from \"./internalContexts/CurveLengthContext\";\nimport { LineString3d } from \"./LineString3d\";\n\nimport type { AkimaCurve3d } from \"../bspline/AkimaCurve3d\";\nimport type { Arc3d } from \"./Arc3d\";\nimport type { BezierCurve3d } from \"../bspline/BezierCurve3d\";\nimport type { BSplineCurve3d } from \"../bspline/BSplineCurve\";\nimport type { Clipper } from \"../clipping/ClipUtils\";\nimport type { CurveChainWithDistanceIndex } from \"./CurveChainWithDistanceIndex\";\nimport type { DirectSpiral3d } from \"./spiral/DirectSpiral3d\";\nimport type { IntegratedSpiral3d } from \"./spiral/IntegratedSpiral3d\";\nimport type { InterpolationCurve3d } from \"../bspline/InterpolationCurve3d\";\nimport type { IStrokeHandler } from \"../geometry3d/GeometryHandler\";\nimport type { LineSegment3d } from \"./LineSegment3d\";\nimport type { OffsetOptions } from \"./OffsetOptions\";\nimport type { Plane3dByOriginAndUnitNormal } from \"../geometry3d/Plane3dByOriginAndUnitNormal\";\nimport type { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport type { StrokeOptions } from \"./StrokeOptions\";\nimport type { VariantCurveExtendParameter } from \"./CurveExtendMode\";\n\n/**\n * Describes the concrete type of a [[CurvePrimitive]]. Each type name maps to a specific subclass and can be used\n * for type-switching in conditional statements.\n * - \"arc\" => [[Arc3d]]\n * - \"lineSegment\" => [[LineSegment3d]]\n * - \"lineString\" => [[LineString3d]]\n * - \"bsplineCurve\" => [[BSplineCurve3dBase]] which is an intermediate class implemented by [[BSplineCurve3d]] and\n * [[BSplineCurve3dH]]\n * - \"bezierCurve\" => [[BezierCurveBase]] which is an intermediate class implemented by [[BezierCurve3d]] and\n * [[BezierCurve3dH]]\n * - \"transitionSpiral\" => [[TransitionSpiral3d]]\n * - \"curveChainWithDistanceIndex\" => [[CurveChainWithDistanceIndex]]\n * @see [Curve Collections]($docs/learning/geometry/CurvePrimitive.md) learning article.\n * @see [[AnyCurvePrimitive]] for a union type that supports compile-time type narrowing.\n * @public\n */\nexport type CurvePrimitiveType = \"arc\" | \"lineSegment\" | \"lineString\" | \"bsplineCurve\" | \"bezierCurve\" | \"transitionSpiral\" | \"curveChainWithDistanceIndex\" | \"interpolationCurve\" | \"akimaCurve\";\n/**\n * Union type for subclasses of [[CurvePrimitive]]. Specific subclasses can be discriminated at compile- or run-time\n * using [[CurvePrimitive.curvePrimitiveType]].\n * @public\n */\nexport type AnyCurvePrimitive = Arc3d | LineSegment3d | LineString3d | BSplineCurve3d | BezierCurve3d | DirectSpiral3d | IntegratedSpiral3d | CurveChainWithDistanceIndex | InterpolationCurve3d | AkimaCurve3d;\n/**\n * Union type for a linear [[CurvePrimitive]].\n * @public\n */\nexport type LinearCurvePrimitive = LineSegment3d | LineString3d;\n/**\n * Function signature for callback which announces a pair of numbers, such as a fractional interval, along with a\n * containing CurvePrimitive.\n * @public\n */\nexport type AnnounceNumberNumberCurvePrimitive = (a0: number, a1: number, cp: CurvePrimitive) => void;\n/**\n * Function signature for a callback which announces a pair of numbers\n * @public\n */\nexport type AnnounceNumberNumber = (a0: number, a1: number) => void;\n/** Function signature for a callback which announces a curve primitive\n * @public\n */\nexport type AnnounceCurvePrimitive = (cp: CurvePrimitive) => void;\n\n/**\n * Options for computing tangents to a curve from a fixed point `P`.\n * See [[CurvePrimitive.emitTangents]], [[CurvePrimitive.allTangents]], and [[CurvePrimitive.closestTangent]].\n * @public\n */\nexport interface TangentOptions {\n /**\n * The tangent point returned by [[CurvePrimitive.closestTangent]] is nearest to this point as seen in the view plane.\n * * Default value is the fixed point `P`.\n */\n hintPoint?: Point3d,\n /**\n * Tangents are computed as seen in a view plane perpendicular to this vector.\n * * Default value is (0,0,1), i.e., tangents are computed as seen in the top view.\n */\n vectorToEye?: Vector3d,\n /** Stroke options for default stroke-based implementations. */\n strokeOptions?: StrokeOptions,\n /**\n * Compute tangents to the curve extended according to variant type.\n * * This option is ignored for linear segments and linestrings.\n * * Default value is `false`.\n */\n extend?: VariantCurveExtendParameter,\n /**\n * Distance tolerance, interpreted as follows:\n * * Maximum distance of `P` from the tangent plane at curve point `Q` in order for `Q-P` to be considered a\n * tangent to the curve.\n * * Minimum length of a line/stroke segment for which to consider computing a tangent.\n * * Default value is [[Geometry.smallMetricDistance]].\n */\n distanceTol?: number,\n}\n\n/**\n * A curve primitive is bounded.\n * A curve primitive maps fractions in 0..1 to points in space.\n * As the fraction proceeds from 0 towards 1, the point moves \"forward\" along the curve.\n * True distance along the curve is not always strictly proportional to fraction.\n * * A LineSegment3d always has proportional fraction and distance.\n * * An Arc3d which is true circular has proportional fraction and distance.\n * * A LineString3d is not proportional (except for special case of all segments of equal length).\n * * A Spiral3d is proportional.\n * * A BsplineCurve3d is only proportional for special cases.\n * For fractions outside 0..1, the curve primitive class may either (a) return the near endpoint or (b) evaluate\n * an extended curve.\n * @public\n */\nexport abstract class CurvePrimitive extends GeometryQuery {\n /** String name for schema properties */\n public readonly geometryCategory = \"curvePrimitive\";\n /** String name for schema properties */\n public abstract readonly curvePrimitiveType: CurvePrimitiveType;\n /** Constructor */\n protected constructor() {\n super();\n }\n /**\n * Data attached during stroking for facets.\n */\n public strokeData?: StrokeCountMap;\n /**\n * Data attached in curve cutting.\n * @internal\n */\n public startCut?: CurveLocationDetail;\n /**\n * Data attached in curve cutting.\n * @internal\n */\n public endCut?: CurveLocationDetail;\n /**\n * Data attached by various algorithms (e.g. Region booleans)\n */\n public parent?: any;\n /**\n * Return the point (x,y,z) on the curve at fractional position.\n * @param fraction fractional position along the geometry.\n * @returns Returns a point on the curve.\n */\n public abstract fractionToPoint(fraction: number, result?: Point3d): Point3d;\n /**\n * Return the point (x,y,z) and derivative on the curve at fractional position.\n * * Note that this derivative is \"derivative of xyz with respect to fraction\".\n * * This derivative shows the speed of the \"fractional point\" moving along the curve.\n * * This is not generally a unit vector. Use fractionToPointAndUnitTangent for a unit vector.\n * @param fraction fractional position along the geometry.\n * @returns Returns a ray whose origin is the curve point and direction is the derivative with respect to the fraction.\n */\n public abstract fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d;\n /**\n * Returns a ray whose origin is the curve point and direction is the unit tangent.\n * @param fraction fractional position on the curve\n * @param result optional preallocated ray.\n */\n public fractionToPointAndUnitTangent(fraction: number, result?: Ray3d): Ray3d {\n const ray = this.fractionToPointAndDerivative(fraction, result);\n ray.trySetDirectionMagnitudeInPlace(1.0);\n return ray;\n }\n /**\n * Returns the (absolute) curvature magnitude.\n * * Base implementation in CurvePrimitive computes curvature from the first and second derivative vectors.\n * @param fraction fractional position on the curve\n */\n public fractionToCurvature(fraction: number): number | undefined {\n const data = this.fractionToPointAnd2Derivatives(fraction)!;\n const cross = data.vectorU.crossProduct(data.vectorV);\n const a = cross.magnitude();\n const b = data.vectorU.magnitude();\n return Geometry.conditionalDivideFraction(a, b * b * b);\n }\n /**\n * Return a plane with\n * * origin at fractional position along the curve\n * * vectorU is the first derivative, i.e. tangent vector with length equal to the rate of change with respect to\n * the fraction.\n * * vectorV is the second derivative, i.e. derivative of vectorU which points in the direction of the curve's\n * derivative's change.\n * * **Note:** We are dealing with a parametric equation of the curve (a function f : R -> R^3) so first and\n * second derivatives are in fact derivatives of the parametric equation.\n */\n public abstract fractionToPointAnd2Derivatives(\n fraction: number, result?: Plane3dByOriginAndVectors\n ): Plane3dByOriginAndVectors | undefined;\n /**\n * Construct a frenet frame:\n * * origin at the point on the curve\n * * x axis is unit vector along the curve (tangent)\n * * y axis is perpendicular and in the plane of the osculating circle. y axis is called \"main normal\"\n * * z axis perpendicular to those. z axis is called \"bi-normal\"\n */\n public fractionToFrenetFrame(fraction: number, result?: Transform): Transform | undefined {\n const plane = this.fractionToPointAnd2Derivatives(fraction);\n if (!plane)\n return undefined;\n // first derivative (plane.vectorU) and second derivative (plane.vectorV) are not essentially\n // perpendicular so we use createRigidFromColumns to make 3 perpendicular vectors.\n let axes = Matrix3d.createRigidFromColumns(plane.vectorU, plane.vectorV, AxisOrder.XYZ);\n if (axes)\n return Transform.createRefs(plane.origin, axes, result);\n // 2nd derivative not distinct. for example if curve is linear at fraction so second derivative is 0.\n // in this case we find perpendicular vector to plane.vectorU and pass it to createRigidFromColumns.\n const perpVector = Matrix3d.createPerpendicularVectorFavorXYPlane(plane.vectorU, plane.vectorV);\n axes = Matrix3d.createRigidFromColumns(plane.vectorU, perpVector, AxisOrder.XYZ);\n if (axes)\n return Transform.createRefs(plane.origin, axes, result);\n return undefined;\n }\n /**\n * Construct signed distance from a point on the planar curve to its center of curvature (in xy only).\n * * Positive distance means the center is to the left of the curve at fraction.\n * * Negative distance means the center is to the right of the curve at fraction.\n * * Zero distance means curve is linear at fraction.\n */\n public fractionToSignedXYRadiusOfCurvature(fraction: number): number {\n const plane = this.fractionToPointAnd2Derivatives(fraction);\n if (!plane)\n return 0.0;\n const cross = plane.vectorU.crossProductXY(plane.vectorV);\n const b = plane.vectorU.magnitude();\n if (b === 0.0)\n return 0.0;\n const r = Geometry.conditionalDivideCoordinate(b * b * b, cross);\n if (r !== undefined)\n return r;\n return 0.0;\n }\n /**\n * Construct a point extrapolated along tangent at fraction.\n * @param fraction fractional position on the primitive\n * @param distance (signed) distance to move on the tangent.\n */\n public fractionAndDistanceToPointOnTangent(fraction: number, distance: number): Point3d {\n const ray = this.fractionToPointAndUnitTangent(fraction);\n return ray.fractionToPoint(distance);\n }\n /**\n * Return the length of the curve.\n * * Curve length is always positive.\n */\n public curveLength(): number {\n const context = new CurveLengthContext();\n this.emitStrokableParts(context);\n return context.getSum();\n }\n /**\n * Returns a (high accuracy) length of the curve between fractional positions.\n * * Curve length is always positive.\n * * Default implementation applies a generic Gaussian integration.\n * * Most curve classes (certainly LineSegment, LineString, Arc) are expected to provide efficient implementations.\n */\n public curveLengthBetweenFractions(fraction0: number, fraction1: number): number {\n if (fraction0 === fraction1)\n return 0.0;\n const scale = this.getFractionToDistanceScale();\n if (scale !== undefined) {\n // We are in luck! simple proportions determine it all !!!\n // (for example, a LineSegment3d or a circular arc)\n const totalLength = this.curveLength();\n return Math.abs((fraction1 - fraction0) * totalLength);\n }\n const context = new CurveLengthContext(fraction0, fraction1);\n this.emitStrokableParts(context);\n return Math.abs(context.getSum());\n }\n /**\n * Returns the range of the curve between fractional positions.\n * * Default implementation calls [[rangeBetweenFractionsByClone]].\n */\n public rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\n return this.rangeBetweenFractionsByClone(fraction0, fraction1, transform);\n }\n /** Returns a high accuracy range of the curve between fractional positions using [[clonePartialCurve]]. */\n public rangeBetweenFractionsByClone(fraction0: number, fraction1: number, transform?: Transform): Range3d {\n if (fraction0 === fraction1)\n return Range3d.create(this.fractionToPoint(fraction0));\n const fragment = this.clonePartialCurve(fraction0, fraction1);\n if (fragment)\n return fragment.range(transform);\n return Range3d.createNull();\n }\n /**\n * Returns an approximate range based on a fixed number of evaluations.\n * * Default implementation returns a range determined by evaluating a specified number of points on the curve.\n * * Optionally evaluate again at interval midpoints and extrapolate any increase.\n * * For a smooth curve, Richardson extrapolation suggests each subdivision moves 3/4 of the way to final. So\n * extrapolationFactor of 1/3 speculatively moves closer to the tight range, and larger multipliers increase\n * confidence in being safely larger.\n * * This function is faster to compute the range of a portion of a curve, because some curves can be\n * expensive to compute the partial curve and/or to compute the partial curve's range.\n * @param fraction0 start fraction for evaluation\n * @param fraction1 end fraction for evaluation\n * @param count number of points to evaluate\n * @param transform optional transform to be applied to the curve\n * @param extrapolationFactor if positive, evaluate again at interval midpoints and apply this fraction multiplier\n * to any increase in size.\n */\n public rangeBetweenFractionsByCount(\n fraction0: number, fraction1: number, count: number, transform?: Transform, extrapolationFactor: number = 0.0,\n ): Range3d {\n const range = Range3d.createNull();\n const workPoint = Point3d.create();\n range.extendPoint(this.startPoint(workPoint));\n range.extendPoint(this.endPoint(workPoint));\n // Evaluate at count fractions (fraction0 + i * fractionStep)\n const evaluateSteps = (fractionA: number, fractionStep: number, countA: number) => {\n let f = fractionA;\n for (let i = 0; i < countA; i++, f += fractionStep) {\n this.fractionToPoint(f, workPoint);\n if (transform)\n range.extendTransformedPoint(transform, workPoint);\n else\n range.extendPoint(workPoint);\n }\n };\n const interiorCount = count - 2;\n if (interiorCount > 0) {\n const localFraction0 = 1.0 / (interiorCount + 1);\n const globalFractionStep = localFraction0 * (fraction1 - fraction0);\n evaluateSteps(fraction0 + globalFractionStep, globalFractionStep, interiorCount);\n }\n if (extrapolationFactor > 0.0) {\n // Evaluate at midpoints. Where this makes the range larger, apply extrapolationFactor to move it to safer\n // excess value. same interior step, but shift to interval midpoints.\n const baseRange = range.clone();\n const interiorCount1 = interiorCount + 1;\n const localFraction0 = 0.5 / interiorCount1; // we only evaluate at new midpoints.\n const globalFractionStep = 2 * localFraction0 * (fraction1 - fraction0); // same as above, but avoids special logic for interiorCount = 0\n evaluateSteps(fraction0 + globalFractionStep * 0.5, globalFractionStep, interiorCount1);\n range.extendWhenLarger(baseRange, extrapolationFactor);\n }\n return range;\n }\n /**\n * Run an integration (with a default Gaussian quadrature) with a fixed fractional step\n * * This is typically called by specific curve type implementations of curveLengthBetweenFractions.\n * * For example, in Arc3d implementation of curveLengthBetweenFractions:\n * * If the Arc3d is true circular, it the arc is true circular, use the direct `arcLength = radius * sweepRadians`\n * * If the Arc3d is not true circular, call this method with an interval count appropriate to eccentricity and\n * sweepRadians.\n * @returns Returns the curve length via an integral estimated by numerical quadrature between the fractional positions.\n * @param fraction0 start fraction for integration\n * @param fraction1 end fraction for integration\n * @param numInterval number of quadrature intervals\n */\n public curveLengthWithFixedIntervalCountQuadrature(\n fraction0: number, fraction1: number, numInterval: number, numGauss: number = 5,\n ): number {\n if (fraction0 > fraction1) {\n const fSave = fraction0;\n fraction0 = fraction1;\n fraction1 = fSave;\n }\n const context = new CurveLengthContext(fraction0, fraction1, numGauss);\n context.announceIntervalForUniformStepStrokes(this, numInterval, fraction0, fraction1);\n return Math.abs(context.getSum());\n }\n /**\n * (Attempt to) find a position on the curve at a signed distance from start fraction.\n * * Return the position as a CurveLocationDetail.\n * * In the `CurveLocationDetail`, record:\n * * `fraction` = fractional position\n * * `point` = coordinates of the point\n * * `a` = (signed!) distance moved. If `allowExtension` is false and the move reached the start or end of the\n * curve, this distance is smaller than the requested signedDistance.\n * * `curveSearchStatus` indicates one of:\n * * `error` (unusual) computation failed not supported for this curve.\n * * `success` full movement completed\n * * `stoppedAtBoundary` partial movement completed. This can be due to either\n * * `allowExtension` parameter sent as `false`\n * * the curve type (e.g. bspline) does not support extended range.\n * * if `allowExtension` is true, movement may still end at the startPoint or end point for curves that do not support\n * extended geometry (specifically bsplines)\n * * if the curve returns a value (i.e. not `undefined`) for `curve.getFractionToDistanceScale()`, the base class\n * carries out the computation\n * and returns a final location.\n * * LineSegment3d relies on this.\n * * If the curve does not implement the computation or the curve has zero length, the returned `CurveLocationDetail`\n * has\n * * `fraction` = the value of `startFraction`\n * * `point` = result of `curve.fractionToPoint(startFraction)`\n * * `a` = 0\n * * `curveStartState` = `CurveSearchStatus.error`\n * @param startFraction fractional position where the move starts\n * @param signedDistance distance to move. Negative distance is backwards in the fraction space\n * @param allowExtension if true, allow the move to go beyond the startPoint or endpoint of the curve. If false,\n * do not allow movement beyond the startPoint or endpoint\n * @param result optional result.\n * @returns A CurveLocationDetail annotated as above. Note that if the curve does not support the calculation, there is\n * still a result which contains the point at the input startFraction, with failure indicated in the `curveStartState`\n * member\n */\n public moveSignedDistanceFromFraction(\n startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n const scale = this.getFractionToDistanceScale();\n if (scale !== undefined) {\n // We are in luck! simple proportions determine it all !!!\n // (for example, a LineSegment3d or a circular arc)\n const totalLength = this.curveLength();\n const signedFractionMove = Geometry.conditionalDivideFraction(signedDistance, totalLength);\n if (signedFractionMove === undefined) {\n return CurveLocationDetail.createCurveFractionPointDistanceCurveSearchStatus(\n this, startFraction, this.fractionToPoint(startFraction), 0.0, CurveSearchStatus.error);\n }\n return CurveLocationDetail.createConditionalMoveSignedDistance(\n allowExtension,\n this,\n startFraction,\n startFraction + signedFractionMove,\n signedDistance,\n result,\n );\n }\n return this.moveSignedDistanceFromFractionGeneric(startFraction, signedDistance, allowExtension, result);\n }\n /**\n * Generic algorithm to search for point at signed distance from a fractional startPoint.\n * * This will work for well for smooth curves.\n * * Curves with tangent or other low-order-derivative discontinuities may need to implement specialized algorithms.\n * * We need to find an endFraction which is the end-of-interval (usually upper) limit of integration of the tangent\n * magnitude from startFraction to endFraction\n * * That integral is a function of endFraction.\n * * The derivative of that integral with respect to end fraction is the tangent magnitude at end fraction.\n * * Use that function and (easily evaluated!) derivative for a Newton iteration\n * * TO ALL WHO HAVE FUZZY MEMORIES OF CALCULUS CLASS: \"The derivative of the integral wrt upper limit is the value\n * of the integrand there\" is the fundamental theorem of integral calculus !!! The fundamental theorem is not just\n * an abstraction !!! It is being used here in its barest possible form !!!\n * * See https://en.wikipedia.org/wiki/Fundamental_theorem_of_calculus\n * @param startFraction\n * @param signedDistance\n * @param _allowExtension\n * @param result\n */\n protected moveSignedDistanceFromFractionGeneric(\n startFraction: number, signedDistance: number, allowExtension: boolean, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n let limitFraction: number;\n const slackFraction = 0.1; // slack to use when integration would otherwise have no room to work\n if (signedDistance === 0.0)\n return CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result); // no movement, just evaluate at startFraction\n if (signedDistance > 0.0) {\n limitFraction = 1.0;\n if (startFraction >= 1.0) {\n const newStartFraction = 1.0 - slackFraction;\n signedDistance += this.curveLengthBetweenFractions(newStartFraction, startFraction);\n startFraction = newStartFraction;\n }\n } else { // signedDistance < 0.0\n limitFraction = 0.0;\n if (startFraction <= 0.0) {\n const newStartFraction = 0.0 + slackFraction;\n signedDistance -= this.curveLengthBetweenFractions(startFraction, newStartFraction);\n startFraction = newStartFraction;\n }\n }\n const availableLength = this.curveLengthBetweenFractions(startFraction, limitFraction);\n assert(availableLength > 0.0);\n const absDistance = Math.abs(signedDistance);\n if (availableLength < absDistance && !allowExtension)\n return CurveLocationDetail.createConditionalMoveSignedDistance(allowExtension, this, startFraction, limitFraction, signedDistance, result);\n\n const fractionStep = Geometry.conditionalDivideCoordinate(absDistance, availableLength);\n if (undefined === fractionStep) {\n // no available length!\n result = CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result);\n result.curveSearchStatus = CurveSearchStatus.error;\n return result;\n }\n const directionFactor = signedDistance < 0.0 ? -1.0 : 1.0;\n let fractionB = Geometry.interpolate(startFraction, fractionStep, limitFraction);\n let fractionA = startFraction;\n let distanceA = 0.0;\n const tol = 1.0e-12 * availableLength;\n let numConverged = 0;\n const tangent = Ray3d.createXAxis();\n // on each loop entry:\n // fractionA is the most recent endOfInterval. (It may have been reached by a mixture of forward and backward step.)\n // distanceA is the distance to (the point at) fractionA\n // fractionB is the next end fraction\n for (let iterations = 0; iterations < 10; iterations++) {\n const distanceAB = this.curveLengthBetweenFractions(fractionA, fractionB);\n const directionAB = fractionB > fractionA ? directionFactor : -directionFactor;\n const distance0B = distanceA + directionAB * distanceAB;\n const distanceError = absDistance - distance0B;\n if (Math.abs(distanceError) < tol) {\n numConverged++;\n if (numConverged > 1)\n break;\n } else {\n numConverged = 0;\n }\n this.fractionToPointAndDerivative(fractionB, tangent);\n const tangentMagnitude = tangent.direction.magnitude();\n fractionA = fractionB;\n fractionB = fractionA + directionFactor * distanceError / tangentMagnitude;\n if (fractionA === fractionB) { // YES -- that is an exact equality test. When it happens, there's no need for confirming with another iteration.\n numConverged = 100;\n break;\n }\n distanceA = distance0B;\n }\n if (numConverged > 1)\n return CurveLocationDetail.createConditionalMoveSignedDistance(\n allowExtension, this, startFraction, fractionB, signedDistance, result,\n );\n result = CurveLocationDetail.createCurveEvaluatedFraction(this, startFraction, result);\n result.curveSearchStatus = CurveSearchStatus.error;\n return result;\n }\n /**\n * * Returns true if the curve can be easily extended past its start/end point (i.e., beyond the usual\n * fraction space [0,1]). Otherwise, returns false.\n * * Base class default implementation returns false.\n * * These classes (and perhaps others in the future) will return true:\n * * LineSegment3d\n * * LineString3d\n * * Arc3d\n */\n public get isExtensibleFractionSpace(): boolean {\n return false;\n }\n /**\n * Compute a length for curve which may be a fast approximation to the true length.\n * This is expected to be either (a) exact or (b) larger than the actual length, but by no more than\n * a small multiple, perhaps up to PI/2, but commonly much closer to 1.\n *\n * * An example use of this is for setting a tolerance which is a small multiple of the curve length.\n * * Simple line, circular arc, and transition spiral may return exact length\n * * Ellipse may return circumference of some circle or polygon that encloses the ellipse.\n * * bspline curve may return control polygon length\n * *\n */\n public abstract quickLength(): number;\n /**\n * Search for a point on the curve that is closest to the spacePoint.\n * * If the space point is exactly on the curve, this is the reverse of fractionToPoint.\n * * Since CurvePrimitive should always have start and end available as candidate points, this method should always\n * succeed.\n * @param spacePoint point in space.\n * @param extend (optional) compute the closest point to the curve extended according to variant type (default false)\n * @param result (optional) pre-allocated detail to populate and return.\n * @returns details of the closest point.\n */\n public closestPoint(\n spacePoint: Point3d, extend?: VariantCurveExtendParameter, result?: CurveLocationDetail,\n ): CurveLocationDetail | undefined {\n const strokeHandler = new ClosestPointStrokeHandler(spacePoint, extend, result);\n this.emitStrokableParts(strokeHandler);\n return strokeHandler.claimResult();\n }\n /**\n * Announce all points `P` on the curve such that the line containing `spacePoint` and `P` is tangent to the curve in\n * the view defined by `options.vectorToEye`.\n * * Strictly speaking, each tangent line lies in the plane through `P` whose normal is the cross product of the curve\n * tangent at `P` and `options.vectorToEye`. This is equivalent to tangency as seen in a view plane perpendicular to\n * `options.vectorToEye`.\n * @param spacePoint point in space.\n * @param announceTangent callback to announce each computed tangent. The received [[CurveLocationDetail]] is reused\n * internally, so it should be cloned in the callback if it needs to be saved.\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\n */\n public emitTangents(\n spacePoint: Point3d, announceTangent: (tangent: CurveLocationDetail) => any, options?: TangentOptions,\n ): void {\n const strokeHandler = new AnnounceTangentStrokeHandler(spacePoint, announceTangent, options);\n this.emitStrokableParts(strokeHandler, options?.strokeOptions);\n }\n /**\n * Return all points `P` on the curve such that the line containing `spacePoint` and `P` is tangent to the curve in\n * the view defined by `options.vectorToEye`.\n * * See [[emitTangents]] for the definition of tangency employed.\n * @param spacePoint point in space.\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\n * @returns an array of details of all tangent points or undefined if no tangent was found.\n */\n public allTangents(spacePoint: Point3d, options?: TangentOptions): CurveLocationDetail[] | undefined {\n const tangents: CurveLocationDetail[] = [];\n this.emitTangents(spacePoint, (t: CurveLocationDetail) => tangents.push(t.clone()), options);\n return (tangents.length === 0) ? undefined : tangents;\n }\n /**\n * Return the point `P` on the curve such that the line containing `spacePoint` and `P` is tangent to the curve in\n * the view defined by `options.vectorToEye`, and `P` is closest to `options.hintPoint` in this view.\n * * See [[emitTangents]] for the definition of tangency employed.\n * @param spacePoint point in space.\n * @param options (optional) options for computing tangents. See [[TangentOptions]] for defaults.\n * @returns the detail of the closest tangent point or undefined if no tangent was found.\n */\n public closestTangent(spacePoint: Point3d, options?: TangentOptions): CurveLocationDetail | undefined {\n const hint = options?.hintPoint ?? spacePoint;\n let toLocal: Matrix3d | undefined;\n if (options?.vectorToEye && !options.vectorToEye.isExactEqual({ x: 0, y: 0, z: 1 }))\n toLocal = Matrix3d.createRigidViewAxesZTowardsEye(options.vectorToEye.x, options.vectorToEye.y, options.vectorToEye.z);\n const measureHintDist2 = (pt: Point3d): number => { // measure distance to hint in view plane coordinates\n return toLocal?.multiplyTransposeXYZ(hint.x - pt.x, hint.y - pt.y, hint.z - pt.z).magnitudeSquaredXY() ?? pt.distanceSquaredXY(hint);\n };\n let closestTangent: CurveLocationDetail | undefined;\n let closestDist2 = Geometry.largeCoordinateResult;\n const collectClosestTangent = (tangent: CurveLocationDetail) => {\n const dist2 = measureHintDist2(tangent.point);\n if (!closestTangent || dist2 < closestDist2) {\n closestTangent = tangent.clone(closestTangent);\n closestDist2 = dist2;\n }\n };\n this.emitTangents(spacePoint, collectClosestTangent, options);\n return closestTangent;\n }\n /**\n * Find intervals of this curvePrimitive that are interior to a clipper\n * @param clipper clip structure (e.g. clip planes)\n * @param announce (optional) function to be called announcing fractional intervals\n * `announce(fraction0, fraction1, curvePrimitive)`\n * @returns true if any \"in\" segments are announced.\n */\n public announceClipIntervals(_clipper: Clipper, _announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n // DEFAULT IMPLEMENTATION -- no interior parts\n return false;\n }\n /** Return a deep clone. */\n public abstract override clone(): CurvePrimitive;\n /** Return a transformed deep clone. */\n public abstract override cloneTransformed(transform: Transform): CurvePrimitive | undefined;\n /**\n * Return (if possible) a curve primitive which is a portion of this curve.\n * @param _fractionA [in] start fraction\n * @param _fractionB [in] end fraction\n */\n public clonePartialCurve(_fractionA: number, _fractionB: number): CurvePrimitive | undefined {\n return undefined;\n }\n /**\n * If the curve primitive has distance-along-curve strictly proportional to curve fraction, return the scale factor.\n * If distance-along-the-curve is not proportional, return undefined.\n * * When defined, the scale factor is always the length of the curve.\n * * This scale factor is typically available for these curve types:\n * * * All `LineSegment3d`\n * * * Arc3d which is a true circular arc (axes perpendicular and of equal length).\n * * * CurveChainWithDistanceIndex\n * * This scale factor is undefined for these curve types:\n * * * Arc3d which is a true ellipse, i.e. unequal lengths of defining vectors or non-perpendicular defining vectors.\n * * * bspline and bezier curves\n * @returns scale factor or undefined\n */\n public getFractionToDistanceScale(): number | undefined {\n return undefined;\n }\n /** Reverse the curve's data so that its fractional stroking moves in the opposite direction. */\n public abstract reverseInPlace(): void;\n /**\n * Compute intersections of the curve with a plane.\n * * The intersections are appended to the result array.\n * * The base class implementation emits strokes to an AppendPlaneIntersectionStrokeHandler object, which uses a\n * Newton iteration to get high-accuracy intersection points within strokes.\n * * Derived classes should override this default implementation if there are easy analytic solutions.\n * * Derived classes are free to implement extended intersections (e.g. arc!!!)\n * @param plane The plane to be intersected.\n * @param result Array to receive intersections\n * @returns Return the number of CurveLocationDetail's added to the result array.\n */\n public appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\n const strokeHandler = new AppendPlaneIntersectionStrokeHandler(plane, result);\n const n0 = result.length;\n this.emitStrokableParts(strokeHandler);\n return result.length - n0;\n }\n /**\n * Examine contents of an array of CurveLocationDetail.\n * Filter the intersections according to the parameters.\n * @param allowExtend if false, remove points on the extension.\n * @param applySnappedCoordinates if true, change the stored fractions and coordinates to exact end values.\n * Otherwise use the exact values only for purpose of updating the curveIntervalRole.\n * @param startEndFractionTolerance if nonzero, adjust fraction to 0 or 1 with this tolerance.\n * @param startEndXYZTolerance if nonzero, adjust to endpoint with this tolerance.\n * @internal\n */\n public static snapAndRestrictDetails(\n details: CurveLocationDetail[],\n allowExtend: boolean = true,\n applySnappedCoordinates: boolean = false,\n startEndFractionTolerance = Geometry.smallAngleRadians,\n startEndXYZTolerance = Geometry.smallMetricDistance,\n ): void {\n const n0 = details.length;\n let acceptIndex = 0;\n const point0 = Point3d.create();\n const point1 = Point3d.create();\n let snappedCoordinates: Point3d | undefined;\n for (let candidateIndex = 0; candidateIndex < n0; candidateIndex++) {\n snappedCoordinates = undefined;\n const detail = details[candidateIndex];\n let fraction = detail.fraction;\n let accept = allowExtend || Geometry.isIn01(fraction);\n if (detail.curve) {\n detail.curve.startPoint(point0);\n detail.curve.endPoint(point1);\n }\n if (startEndFractionTolerance > 0) {\n if (Math.abs(fraction) < startEndFractionTolerance) {\n fraction = 0.0;\n accept = true;\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\n snappedCoordinates = point0;\n }\n if (Math.abs(fraction - 1.0) < startEndFractionTolerance) {\n fraction = 1.0;\n accept = true;\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\n snappedCoordinates = point1;\n if (detail.curve)\n snappedCoordinates = detail.curve.startPoint(point1);\n }\n }\n if (startEndXYZTolerance > 0 && detail.curve !== undefined) {\n // REMARK: always test both endpoints. If there is a cyclic fraction space, an intersection marked as \"after\" the end might have wrapped all the way to the beginning.\n if (detail.point.distance(point0) <= startEndXYZTolerance) {\n fraction = 0.0;\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\n snappedCoordinates = point0;\n } else if (detail.point.distance(point1) <= startEndXYZTolerance) {\n fraction = 1.0;\n detail.intervalRole = CurveIntervalRole.isolatedAtVertex;\n snappedCoordinates = point1;\n }\n }\n if (accept) {\n if (applySnappedCoordinates) {\n detail.fraction = fraction;\n if (snappedCoordinates !== undefined)\n detail.point.setFrom(snappedCoordinates);\n }\n if (acceptIndex < candidateIndex)\n details[acceptIndex] = detail;\n acceptIndex++;\n }\n }\n if (acceptIndex < n0)\n details.length = acceptIndex;\n }\n /**\n * Ask if the curve is within tolerance of a plane.\n * @returns Returns true if the curve is completely within tolerance of the plane.\n */\n public abstract isInPlane(plane: Plane3dByOriginAndUnitNormal): boolean;\n /** Return the startPoint of the primitive. The default implementation returns fractionToPoint(0.0) */\n public startPoint(result?: Point3d): Point3d {\n return this.fractionToPoint(0.0, result);\n }\n /** Return the end point of the primitive. The default implementation returns fractionToPoint(1.0) */\n public endPoint(result?: Point3d): Point3d {\n return this.fractionToPoint(1.0, result);\n }\n /**\n * Whether the start and end points are defined and within tolerance.\n * * Does not check for planarity or degeneracy.\n * @param tolerance optional distance tolerance (default is [[Geometry.smallMetricDistance]])\n * @param xyOnly if true, ignore z coordinate (default is `false`)\n */\n public isPhysicallyClosedCurve(tolerance: number = Geometry.smallMetricDistance, xyOnly: boolean = false): boolean {\n const p0 = this.startPoint();\n const p1 = this.endPoint();\n return p0 !== undefined && p1 !== undefined && (xyOnly ? p0.isAlmostEqualXY(p1, tolerance) : p0.isAlmostEqual(p1, tolerance));\n }\n\n /** Append stroke points to caller-supplied linestring. */\n public abstract emitStrokes(dest: LineString3d, options?: StrokeOptions): void;\n /**\n * Ask the curve to announce points and simple subcurve fragments for stroking.\n * See IStrokeHandler for description of the sequence of the method calls.\n */\n public abstract emitStrokableParts(dest: IStrokeHandler, options?: StrokeOptions): void;\n /**\n * Return the stroke count required for given options.\n * * This returns a single number\n * * See computeComponentStrokeCountForOptions to get structured per-component counts and fraction mappings.\n * @param options StrokeOptions that determine count\n */\n public abstract computeStrokeCountForOptions(options?: StrokeOptions): number;\n /**\n * Attach StrokeCountMap structure to this primitive (and recursively to any children)\n * * Base class implementation (here) gets the simple count from computeStrokeCountForOptions and attaches it.\n * * LineString3d, arc3d, BezierCurve3d, BezierCurve3dH accept that default.\n * * Subdivided primitives (linestring, bspline curve) implement themselves and attach a StrokeCountMap containing the\n * total count, and also containing an array of StrokeCountMap per component.\n * * For CurvePrimitiveWithDistanceIndex, the top level gets (only) a total count, and each child gets\n * its own StrokeCountMap with appropriate structure.\n * @param options StrokeOptions that determine count\n * @param parentStrokeMap optional map from parent. Its count, curveLength, and a1 values are increased with count\n * and distance from this primitive.\n * @return sum of `a0+this.curveLength()`, for use as `a0` of successor in chain.\n */\n public computeAndAttachRecursiveStrokeCounts(options?: StrokeOptions, parentMap?: StrokeCountMap) {\n const n = this.computeStrokeCountForOptions(options);\n const a = this.curveLength();\n CurvePrimitive.installStrokeCountMap(\n this,\n StrokeCountMap.createWithCurvePrimitive(this, n, a, 0, a),\n parentMap);\n }\n /**\n * Evaluate strokes at fractions indicated in a StrokeCountMap.\n * * Base class implementation (here) gets the simple count from computeStrokeCountForOptions and strokes at\n * uniform fractions.\n * * LineString3d, arc3d, BezierCurve3d, BezierCurve3dH accept that default.\n * * Subdivided primitives (linestring, bspline curve) implement themselves and evaluate within components.\n * * CurvePrimitiveWithDistanceIndex recurses to its children.\n * * if packedFraction and packedDerivative arrays are present in the LineString3d, fill them.\n * @param map = stroke count data.\n * @param linestring = receiver linestring.\n * @return number of strokes added. 0 if any errors matching the map to the curve primitive.\n */\n public addMappedStrokesToLineString3D(map: StrokeCountMap, linestring: LineString3d): number {\n const numPoint0 = linestring.numPoints();\n if (map.primitive && map.primitive === this && map.numStroke > 0) {\n for (let i = 0; i <= map.numStroke; i++) {\n const fraction = i / map.numStroke;\n linestring.appendFractionToPoint(this, fraction);\n }\n }\n return linestring.numPoints() - numPoint0;\n }\n /**\n * Final install step to save curveMap in curve. If parentMap is given, update its length, count, and a1 fields\n * @param curve curve to receive the annotation\n * @param map\n * @param parentMap\n */\n public static installStrokeCountMap(curve: CurvePrimitive, curveMap: StrokeCountMap, parentMap?: StrokeCountMap) {\n if (parentMap)\n parentMap.addToCountAndLength(curveMap.numStroke, curveMap.curveLength);\n curve.strokeData = curveMap;\n }\n /**\n * Return an array containing only the curve primitives.\n * * This DEFAULT implementation simply pushes `this` to the collectorArray.\n * @param collectorArray array to receive primitives (pushed -- the array is not cleared)\n * @param smallestPossiblePrimitives if true, a [[CurvePrimitiveWithDistanceIndex]] recurses on its (otherwise hidden)\n * children. If false, it returns only itself.\n * @param explodeLinestrings if true, push a [[LineSegment3d]] for each segment of a [[LineString3d]]. If false,\n * push only the [[LineString3d]].\n */\n public collectCurvePrimitivesGo(\n collectorArray: CurvePrimitive[], _smallestPossiblePrimitives: boolean, _explodeLinestrings: boolean = false,\n ): void {\n collectorArray.push(this);\n }\n /**\n * Return an array containing only the curve primitives.\n * * This DEFAULT implementation captures the optional collector and calls [[collectCurvePrimitivesGo]].\n * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without\n * clearing the array.)\n * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,\n * it recurses to its (otherwise hidden) children.\n */\n public collectCurvePrimitives(\n collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLinestrings: boolean = false,\n ): CurvePrimitive[] {\n const results: CurvePrimitive[] = collectorArray === undefined ? [] : collectorArray;\n this.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\n return results;\n }\n /**\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\n * * No attempt is made to join the offsets of smaller constituent primitives. To construct a fully joined offset\n * for an aggregate instance (e.g., LineString3d, CurveChainWithDistanceIndex), use [[CurveOps.constructCurveXYOffset]]\n * instead.\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\n */\n public abstract constructOffsetXY(\n offsetDistanceOrOptions: number | OffsetOptions\n ): CurvePrimitive | CurvePrimitive[] | undefined;\n\n /**\n * Project instance geometry (via dispatch) onto the line of the given ray, and return the extreme fractional\n * parameters of projection.\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\n * @param lowHigh optional receiver for output\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\n * end of the ray.\n */\n public projectedParameterRange(_ray: Vector3d | Ray3d, _lowHigh?: Range1d): Range1d | undefined {\n return undefined; // common implementation delegated to subclasses to avoid circular dependency\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CurveProcessor.js","sourceRoot":"","sources":["../../../src/curve/CurveProcessor.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD;;;;GAIG;AACH,MAAM,OAAgB,uBAAuB;IAC3C;IACA,CAAC;IAED,4BAA4B;IACrB,kBAAkB,CAAC,KAAe,EAAE,cAAsB,IAAI,CAAC;IACtE,gCAAgC;IACzB,sBAAsB,CAAC,KAAqB,EAAE,cAAc,GAAG,CAAC,CAAC,IAAU,CAAC;IAEnF,4CAA4C;IACrC,YAAY,CAAC,IAAU,EAAE,iBAAyB,CAAC,CAAC;QACzD,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;YAC/B,IAAI,CAAC,sBAAsB,CAAC,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ACjB,KAAK,CAAC,mBAAmB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IACD;;;;;;;OAOG;IACa,mBAAmB,CAAC,IAAiB,EAAE,iBAAyB,CAAC,CAAC;QAChF,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjB,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClC,IAAI,KAAK,YAAY,cAAc;gBACjC,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;;gBAExC,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CACF","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\nimport { AnyCurve } from \"./CurveTypes\";\r\nimport { BagOfCurves, CurveCollection } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { Loop } from \"./Loop\";\r\nimport { ParityRegion } from \"./ParityRegion\";\r\nimport { Path } from \"./Path\";\r\nimport { UnionRegion } from \"./UnionRegion\";\r\n\r\n/** base class for detailed traversal of curve artifacts.\r\n * * This recurses to children in the quickest way (no records of path)\r\n * * Use the RecursiveCurveProcessorWithStack to record the path along the visit.\r\n * @public\r\n */\r\nexport abstract class RecursiveCurveProcessor {\r\n protected constructor() {\r\n }\r\n\r\n /** process error content */\r\n public announceUnexpected(_data: AnyCurve, _indexInParent: number) { }\r\n /** process a leaf primitive. */\r\n public announceCurvePrimitive(_data: CurvePrimitive, _indexInParent = -1): void { }\r\n\r\n /** announce a path (recurse to children) */\r\n public announcePath(data: Path, _indexInParent: number = -1): void {\r\n let i = 0;\r\n for (const curve of data.children)\r\n this.announceCurvePrimitive(curve, i++);\r\n }\r\n /** announce a loop (recurse to children) */\r\n public announceLoop(data: Loop, _indexInParent: number = -1): void {\r\n let i = 0;\r\n for (const curve of data.children)\r\n this.announceCurvePrimitive(curve, i++);\r\n }\r\n\r\n /** announce beginning or end of loops in a parity region */\r\n public announceParityRegion(data: ParityRegion, _indexInParent: number = -1): void {\r\n let i = 0;\r\n for (const loop of data.children)\r\n this.announceLoop(loop, i++);\r\n }\r\n /** announce beginning or end of a parity region */\r\n public announceUnionRegion(data: UnionRegion, _indexInParent: number = -1): void {\r\n let i = 0;\r\n for (const child of data.children) {\r\n child.announceToCurveProcessor(this, i++);\r\n }\r\n }\r\n\r\n /** announce a bag of curves.\r\n * * The default implementation visits each child and calls the appropriate dispatch to\r\n * * `this.announceCurvePrimitive(child)`\r\n * * `child.announceToCurveProcessor(this)`\r\n */\r\n public announceBagOfCurves(data: BagOfCurves, _indexInParent: number = -1): void {\r\n for (const child of data.children) {\r\n if (child instanceof CurvePrimitive)\r\n this.announceCurvePrimitive(child);\r\n else\r\n child.announceToCurveProcessor(this);\r\n }\r\n }\r\n}\r\n\r\n/** base class for detailed traversal of curve artifacts\r\n * * During recursion, maintains a stack that shows complete path to each artifact.\r\n * * Use the QuickRecursiveCurveProcessor to visit without recording the path.\r\n * @public\r\n */\r\nexport abstract class RecursiveCurveProcessorWithStack extends RecursiveCurveProcessor {\r\n /** Stack of curve collections that are \"up the tree\" from the current point of the traversal. */\r\n protected _stack: CurveCollection[];\r\n protected constructor() {\r\n super();\r\n this._stack = [];\r\n }\r\n /** Push `data` onto the stack so its status is available during processing of children.\r\n * * Called when `data` is coming into scope.\r\n */\r\n public enter(data: CurveCollection) { this._stack.push(data); }\r\n /** Pop the stack\r\n * * called when the top of the stack goes out of scope\r\n */\r\n public leave(): CurveCollection | undefined { return this._stack.pop(); }\r\n\r\n /** process error content */\r\n public override announceUnexpected(_data: AnyCurve, _indexInParent: number) { }\r\n /** process a leaf primitive. */\r\n public override announceCurvePrimitive(_data: CurvePrimitive, _indexInParent = -1): void { }\r\n\r\n /** announce a path (recurse to children) */\r\n public override announcePath(data: Path, indexInParent: number = -1): void {\r\n this.enter(data);\r\n super.announcePath(data, indexInParent);\r\n this.leave();\r\n }\r\n /** announce a loop (recurse to children) */\r\n public override announceLoop(data: Loop, indexInParent: number = -1): void {\r\n this.enter(data);\r\n super.announceLoop(data, indexInParent);\r\n this.leave();\r\n }\r\n\r\n /** announce beginning or end of loops in a parity region */\r\n public override announceParityRegion(data: ParityRegion, _indexInParent: number = -1): void {\r\n this.enter(data);\r\n let i = 0;\r\n for (const loop of data.children)\r\n this.announceLoop(loop, i++);\r\n this.leave();\r\n }\r\n /** announce beginning or end of a parity region */\r\n public override announceUnionRegion(data: UnionRegion, indexInParent: number = -1): void {\r\n this.enter(data);\r\n super.announceUnionRegion(data, indexInParent);\r\n this.leave();\r\n }\r\n /**\r\n * Announce members of an unstructured collection.\r\n * * push the collection reference on the stack\r\n * * announce children\r\n * * pop the stack\r\n * @param data the collection\r\n * @param _indexInParent index where the collection appears in its parent.\r\n */\r\n public override announceBagOfCurves(data: BagOfCurves, _indexInParent: number = -1): void {\r\n this.enter(data);\r\n let i = 0;\r\n for (const child of data.children) {\r\n if (child instanceof CurvePrimitive)\r\n this.announceCurvePrimitive(child, i++);\r\n else\r\n child.announceToCurveProcessor(this);\r\n }\r\n this.leave();\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CurveProcessor.js","sourceRoot":"","sources":["../../../src/curve/CurveProcessor.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAMlD;;;;GAIG;AACH,MAAM,OAAgB,uBAAuB;IAC3C;IACA,CAAC;IAED,4BAA4B;IACrB,kBAAkB,CAAC,KAAe,EAAE,cAAsB,IAAI,CAAC;IACtE,gCAAgC;IAC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AAI,CAAC,QAAQ;YAC9B,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC;QAC/B,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IACD,mDAAmD;IACnC,mBAAmB,CAAC,IAAiB,EAAE,gBAAwB,CAAC,CAAC;QAC/E,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjB,KAAK,CAAC,mBAAmB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;QAC/C,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;IACD;;;;;;;OAOG;IACa,mBAAmB,CAAC,IAAiB,EAAE,iBAAyB,CAAC,CAAC;QAChF,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACjB,IAAI,CAAC,GAAG,CAAC,CAAC;QACV,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAClC,IAAI,KAAK,YAAY,cAAc;gBACjC,IAAI,CAAC,sBAAsB,CAAC,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;;gBAExC,KAAK,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;QACzC,CAAC;QACD,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;CACF","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 */\nimport { AnyCurve } from \"./CurveTypes\";\nimport { BagOfCurves, CurveCollection } from \"./CurveCollection\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\nimport { Loop } from \"./Loop\";\nimport { ParityRegion } from \"./ParityRegion\";\nimport { Path } from \"./Path\";\nimport { UnionRegion } from \"./UnionRegion\";\n\n/** base class for detailed traversal of curve artifacts.\n * * This recurses to children in the quickest way (no records of path)\n * * Use the RecursiveCurveProcessorWithStack to record the path along the visit.\n * @public\n */\nexport abstract class RecursiveCurveProcessor {\n protected constructor() {\n }\n\n /** process error content */\n public announceUnexpected(_data: AnyCurve, _indexInParent: number) { }\n /** process a leaf primitive. */\n public announceCurvePrimitive(_data: CurvePrimitive, _indexInParent = -1): void { }\n\n /** announce a path (recurse to children) */\n public announcePath(data: Path, _indexInParent: number = -1): void {\n let i = 0;\n for (const curve of data.children)\n this.announceCurvePrimitive(curve, i++);\n }\n /** announce a loop (recurse to children) */\n public announceLoop(data: Loop, _indexInParent: number = -1): void {\n let i = 0;\n for (const curve of data.children)\n this.announceCurvePrimitive(curve, i++);\n }\n\n /** announce beginning or end of loops in a parity region */\n public announceParityRegion(data: ParityRegion, _indexInParent: number = -1): void {\n let i = 0;\n for (const loop of data.children)\n this.announceLoop(loop, i++);\n }\n /** announce beginning or end of a parity region */\n public announceUnionRegion(data: UnionRegion, _indexInParent: number = -1): void {\n let i = 0;\n for (const child of data.children) {\n child.announceToCurveProcessor(this, i++);\n }\n }\n\n /** announce a bag of curves.\n * * The default implementation visits each child and calls the appropriate dispatch to\n * * `this.announceCurvePrimitive(child)`\n * * `child.announceToCurveProcessor(this)`\n */\n public announceBagOfCurves(data: BagOfCurves, _indexInParent: number = -1): void {\n for (const child of data.children) {\n if (child instanceof CurvePrimitive)\n this.announceCurvePrimitive(child);\n else\n child.announceToCurveProcessor(this);\n }\n }\n}\n\n/** base class for detailed traversal of curve artifacts\n * * During recursion, maintains a stack that shows complete path to each artifact.\n * * Use the QuickRecursiveCurveProcessor to visit without recording the path.\n * @public\n */\nexport abstract class RecursiveCurveProcessorWithStack extends RecursiveCurveProcessor {\n /** Stack of curve collections that are \"up the tree\" from the current point of the traversal. */\n protected _stack: CurveCollection[];\n protected constructor() {\n super();\n this._stack = [];\n }\n /** Push `data` onto the stack so its status is available during processing of children.\n * * Called when `data` is coming into scope.\n */\n public enter(data: CurveCollection) { this._stack.push(data); }\n /** Pop the stack\n * * called when the top of the stack goes out of scope\n */\n public leave(): CurveCollection | undefined { return this._stack.pop(); }\n\n /** process error content */\n public override announceUnexpected(_data: AnyCurve, _indexInParent: number) { }\n /** process a leaf primitive. */\n public override announceCurvePrimitive(_data: CurvePrimitive, _indexInParent = -1): void { }\n\n /** announce a path (recurse to children) */\n public override announcePath(data: Path, indexInParent: number = -1): void {\n this.enter(data);\n super.announcePath(data, indexInParent);\n this.leave();\n }\n /** announce a loop (recurse to children) */\n public override announceLoop(data: Loop, indexInParent: number = -1): void {\n this.enter(data);\n super.announceLoop(data, indexInParent);\n this.leave();\n }\n\n /** announce beginning or end of loops in a parity region */\n public override announceParityRegion(data: ParityRegion, _indexInParent: number = -1): void {\n this.enter(data);\n let i = 0;\n for (const loop of data.children)\n this.announceLoop(loop, i++);\n this.leave();\n }\n /** announce beginning or end of a parity region */\n public override announceUnionRegion(data: UnionRegion, indexInParent: number = -1): void {\n this.enter(data);\n super.announceUnionRegion(data, indexInParent);\n this.leave();\n }\n /**\n * Announce members of an unstructured collection.\n * * push the collection reference on the stack\n * * announce children\n * * pop the stack\n * @param data the collection\n * @param _indexInParent index where the collection appears in its parent.\n */\n public override announceBagOfCurves(data: BagOfCurves, _indexInParent: number = -1): void {\n this.enter(data);\n let i = 0;\n for (const child of data.children) {\n if (child instanceof CurvePrimitive)\n this.announceCurvePrimitive(child, i++);\n else\n child.announceToCurveProcessor(this);\n }\n this.leave();\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CurveTypes.js","sourceRoot":"","sources":["../../../src/curve/CurveTypes.ts"],"names":[],"mappings":"AAAA;;;+FAG+F","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 type { BagOfCurves, CurveCollection } from \"./CurveCollection\";\r\nimport type { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport type { Loop } from \"./Loop\";\r\nimport type { Path } from \"./Path\";\r\nimport type { ParityRegion } from \"./ParityRegion\";\r\nimport type { UnionRegion } from \"./UnionRegion\";\r\n\r\n/**\r\n * Union type for `GeometryQuery` classes that have contain curves, either as individual parameter space or as collections.\r\n * @public\r\n */\r\nexport type AnyCurve = CurvePrimitive | CurveCollection;\r\n\r\n/**\r\n * Union type for `GeometryQuery` classes that bound (planar) regions.\r\n * @public\r\n */\r\nexport type AnyRegion = Loop | ParityRegion | UnionRegion;\r\n\r\n/**\r\n * Union type for a general curve chain, or a `BagOfCurves` understood to be a collection of unrelated chains.\r\n * @public\r\n * @deprecated in 4.3.0 - will not be removed until after 2026-06-13. Use AnyChain | undefined.\r\n */\r\nexport type ChainTypes = CurvePrimitive | Path | BagOfCurves | Loop | undefined;\r\n\r\n/**\r\n * Union type for a general curve chain, or a `BagOfCurves` understood to be a collection of unrelated chains.\r\n * @public\r\n */\r\nexport type AnyChain = CurvePrimitive | Path | BagOfCurves | Loop;\r\n"]}
1
+ {"version":3,"file":"CurveTypes.js","sourceRoot":"","sources":["../../../src/curve/CurveTypes.ts"],"names":[],"mappings":"AAAA;;;+FAG+F","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 type { BagOfCurves, CurveCollection } from \"./CurveCollection\";\nimport type { CurvePrimitive } from \"./CurvePrimitive\";\nimport type { Loop } from \"./Loop\";\nimport type { Path } from \"./Path\";\nimport type { ParityRegion } from \"./ParityRegion\";\nimport type { UnionRegion } from \"./UnionRegion\";\n\n/**\n * Union type for `GeometryQuery` classes that have contain curves, either as individual parameter space or as collections.\n * @public\n */\nexport type AnyCurve = CurvePrimitive | CurveCollection;\n\n/**\n * Union type for `GeometryQuery` classes that bound (planar) regions.\n * @public\n */\nexport type AnyRegion = Loop | ParityRegion | UnionRegion;\n\n/**\n * Union type for a general curve chain, or a `BagOfCurves` understood to be a collection of unrelated chains.\n * @public\n * @deprecated in 4.3.0 - will not be removed until after 2026-06-13. Use AnyChain | undefined.\n */\nexport type ChainTypes = CurvePrimitive | Path | BagOfCurves | Loop | undefined;\n\n/**\n * Union type for a general curve chain, or a `BagOfCurves` understood to be a collection of unrelated chains.\n * @public\n */\nexport type AnyChain = CurvePrimitive | Path | BagOfCurves | Loop;\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CurveWireMomentsXYZ.js","sourceRoot":"","sources":["../../../src/curve/CurveWireMomentsXYZ.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,6DAA6D;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IACtB,iBAAiB,CAAa;IAC9B,YAAY,CAAc;IAElC,YAAmB,iBAAyB,CAAC;QAC3C,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC;QAC7C,IAAI,CAAC,iBAAiB,CAAC,UAAU,GAAG,IAAI,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,IAAI,WAAW,CAAC,cAAc,CAAC,CAAC;IACtD,CAAC;IACD,IAAW,UAAU,KAAiB,OAAO,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAE/D,yBAAyB,CAAC,GAAmB,IAAI,CAAC;IAClD,mBAAmB,CAAC,GAAmB,IAAI,CAAC;IAC5C,iBAAiB,CAAC,GAAmB,IAAI,CAAC;IAC1C,uBAAuB,CAAC,GAA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CAAC;IACH,CAAC;IAEM,uBAAuB,CAC5B,GAAmB,EACnB,MAAe,EACf,MAAe,EACf,WAAmB,EACnB,UAAkB,EAClB,UAAkB;QAClB,IAAI,CAAC,iBAAiB,CAAC,wBAAwB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClE,CAAC;IACM,oBAAoB,CAAC,IAAa,EAAE,SAAiB,EAAE,QAAkB;QAC9E,8GAA8G;IAChH,CAAC;IACD,uCAAuC;IAChC,WAAW,CAAC,IAAc;QAC/B,IAAI,IAAI,YAAY,cAAc;YAChC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;aAC3B,IAAI,IAAI,YAAY,eAAe,EAAE,CAAC;YACzC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;gBAC/B,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;CACF","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\n// import { Geometry, Angle, AngleSweep } from \"../Geometry\";\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { IStrokeHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { MomentData } from \"../geometry4d/MomentData\";\r\nimport { GaussMapper } from \"../numerics/Quadrature\";\r\nimport { AnyCurve } from \"./CurveTypes\";\r\nimport { CurveCollection } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\n\r\n/**\r\n * Class to visit curve primitives and accumulate wire moment integrations.\r\n * @internal\r\n */\r\nexport class CurveWireMomentsXYZ implements IStrokeHandler {\r\n private _activeMomentData: MomentData;\r\n private _gaussMapper: GaussMapper;\r\n\r\n public constructor(numGaussPoints: number = 5) {\r\n this._activeMomentData = MomentData.create();\r\n this._activeMomentData.needOrigin = true;\r\n this._gaussMapper = new GaussMapper(numGaussPoints);\r\n }\r\n public get momentData(): MomentData { return this._activeMomentData; }\r\n\r\n public startParentCurvePrimitive(_cp: CurvePrimitive) { }\r\n public startCurvePrimitive(_cp: CurvePrimitive) { }\r\n public endCurvePrimitive(_cp: CurvePrimitive) { }\r\n public endParentCurvePrimitive(_cp: CurvePrimitive) { }\r\n public announceIntervalForUniformStepStrokes(\r\n cp: CurvePrimitive,\r\n numStrokes: number,\r\n fraction0: number,\r\n fraction1: number): void {\r\n this.startCurvePrimitive(cp);\r\n if (numStrokes < 1) numStrokes = 1;\r\n const df = 1.0 / numStrokes;\r\n let scaleFactor, fraction;\r\n for (let i = 1; i <= numStrokes; i++) {\r\n const fractionA = Geometry.interpolate(fraction0, (i - 1) * df, fraction1);\r\n const fractionB = i === numStrokes ? fraction1 : Geometry.interpolate(fraction0, (i) * df, fraction1);\r\n const numGauss = this._gaussMapper.mapXAndW(fractionA, fractionB);\r\n for (let k = 0; k < numGauss; k++) {\r\n fraction = this._gaussMapper.gaussX[k];\r\n const ray = cp.fractionToPointAndDerivative(fraction);\r\n scaleFactor = this._gaussMapper.gaussW[k] * ray.direction.magnitude();\r\n this._activeMomentData.accumulateScaledOuterProduct(ray.origin, scaleFactor);\r\n }\r\n }\r\n }\r\n\r\n public announceSegmentInterval(\r\n _cp: CurvePrimitive,\r\n point0: Point3d,\r\n point1: Point3d,\r\n _numStrokes: number,\r\n _fraction0: number,\r\n _fraction1: number): void {\r\n this._activeMomentData.accumulateLineMomentsXYZ(point0, point1);\r\n }\r\n public announcePointTangent(_xyz: Point3d, _fraction: number, _tangent: Vector3d): void {\r\n // umm ... this should not happen. We need to know intervals. The other functions should have prevented this.\r\n }\r\n /** Recurse to leaf-level primitives */\r\n public visitLeaves(root: AnyCurve) {\r\n if (root instanceof CurvePrimitive)\r\n root.emitStrokableParts(this);\r\n else if (root instanceof CurveCollection) {\r\n for (const child of root.children)\r\n this.visitLeaves(child);\r\n }\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CurveWireMomentsXYZ.js","sourceRoot":"","sources":["../../../src/curve/CurveWireMomentsXYZ.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,6DAA6D;AAE7D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,MAAM,OAAO,mBAAmB;IACtB,iBAAiB,CAAa;IAC9B,YAAY,CAAc;IAElC,YAAmB,iBAAyB,CAAC;QAC3C,IAAI,CAAC,iBAAiB,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC;QAC7C,IAAI,CAAC,iBAAiB,CAAC,UAAU,GAAG,IAAI,CAAC;QACzC,IAAI,CAAC,YAAY,GAAG,IAAI,WAAW,CAAC,cAAc,CAAC,CAAC;IACtD,CAAC;IACD,IAAW,UAAU,KAAiB,OAAO,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAE/D,yBAAyB,CAAC,GAAmB,IAAI,CAAC;IAClD,mBAAmB,CAAC,GAAmB,IAAI,CAAC;IAC5C,iBAAiB,CAAC,GAAmB,IAAI,CAAC;IAC1C,uBAAuB,CAAC,GAAmB,IAAI,CAAC;IAChD,qCAAqC,CAC1C,EAAkB,EAClB,UAAkB,EAClB,SAAiB,EACjB,SAAiB;QACjB,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC;QAC7B,IAAI,UAAU,GAAG,CAAC;YAAE,UAAU,GAAG,CAAC,CAAC;QACnC,MAAM,EAAE,GAAG,GAAG,GAAG,UAAU,CA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QAAkB;QAC9E,8GAA8G;IAChH,CAAC;IACD,uCAAuC;IAChC,WAAW,CAAC,IAAc;QAC/B,IAAI,IAAI,YAAY,cAAc;YAChC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;aAC3B,IAAI,IAAI,YAAY,eAAe,EAAE,CAAC;YACzC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ;gBAC/B,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;IACH,CAAC;CACF","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\n// import { Geometry, Angle, AngleSweep } from \"../Geometry\";\n\nimport { Geometry } from \"../Geometry\";\nimport { IStrokeHandler } from \"../geometry3d/GeometryHandler\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { MomentData } from \"../geometry4d/MomentData\";\nimport { GaussMapper } from \"../numerics/Quadrature\";\nimport { AnyCurve } from \"./CurveTypes\";\nimport { CurveCollection } from \"./CurveCollection\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\n\n/**\n * Class to visit curve primitives and accumulate wire moment integrations.\n * @internal\n */\nexport class CurveWireMomentsXYZ implements IStrokeHandler {\n private _activeMomentData: MomentData;\n private _gaussMapper: GaussMapper;\n\n public constructor(numGaussPoints: number = 5) {\n this._activeMomentData = MomentData.create();\n this._activeMomentData.needOrigin = true;\n this._gaussMapper = new GaussMapper(numGaussPoints);\n }\n public get momentData(): MomentData { return this._activeMomentData; }\n\n public startParentCurvePrimitive(_cp: CurvePrimitive) { }\n public startCurvePrimitive(_cp: CurvePrimitive) { }\n public endCurvePrimitive(_cp: CurvePrimitive) { }\n public endParentCurvePrimitive(_cp: CurvePrimitive) { }\n public announceIntervalForUniformStepStrokes(\n cp: CurvePrimitive,\n numStrokes: number,\n fraction0: number,\n fraction1: number): void {\n this.startCurvePrimitive(cp);\n if (numStrokes < 1) numStrokes = 1;\n const df = 1.0 / numStrokes;\n let scaleFactor, fraction;\n for (let i = 1; i <= numStrokes; i++) {\n const fractionA = Geometry.interpolate(fraction0, (i - 1) * df, fraction1);\n const fractionB = i === numStrokes ? fraction1 : Geometry.interpolate(fraction0, (i) * df, fraction1);\n const numGauss = this._gaussMapper.mapXAndW(fractionA, fractionB);\n for (let k = 0; k < numGauss; k++) {\n fraction = this._gaussMapper.gaussX[k];\n const ray = cp.fractionToPointAndDerivative(fraction);\n scaleFactor = this._gaussMapper.gaussW[k] * ray.direction.magnitude();\n this._activeMomentData.accumulateScaledOuterProduct(ray.origin, scaleFactor);\n }\n }\n }\n\n public announceSegmentInterval(\n _cp: CurvePrimitive,\n point0: Point3d,\n point1: Point3d,\n _numStrokes: number,\n _fraction0: number,\n _fraction1: number): void {\n this._activeMomentData.accumulateLineMomentsXYZ(point0, point1);\n }\n public announcePointTangent(_xyz: Point3d, _fraction: number, _tangent: Vector3d): void {\n // umm ... this should not happen. We need to know intervals. The other functions should have prevented this.\n }\n /** Recurse to leaf-level primitives */\n public visitLeaves(root: AnyCurve) {\n if (root instanceof CurvePrimitive)\n root.emitStrokableParts(this);\n else if (root instanceof CurveCollection) {\n for (const child of root.children)\n this.visitLeaves(child);\n }\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"GeometryQuery.js","sourceRoot":"","sources":["../../../src/curve/GeometryQuery.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAsCpD;;;;;GAKG;AACH,MAAM,OAAgB,aAAa;IAGjC,yDAAyD;IAClD,KAAK,CAAC,SAAqB,EAAE,MAAgB;QAClD,IAAI,MAAM;YACR,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,KAAK,GA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D,OAAO,KAAK,CAAC;IACf,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,cAAc,CAAC,CAA4B,EAAE,CAA4B;QACrF,IAAI,CAAC,YAAY,aAAa,IAAI,CAAC,YAAY,aAAa;YAC1D,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC,CAAC,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,SAAS,CAAC;YACxC,OAAO,IAAI,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;CAWF","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\nimport { BSpline2dNd } from \"../bspline/BSplineSurface\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { Range3d } from \"../geometry3d/Range\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { Polyface } from \"../polyface/Polyface\";\r\nimport { SolidPrimitive } from \"../solid/SolidPrimitive\";\r\nimport { CoordinateXYZ } from \"./CoordinateXYZ\";\r\nimport { CurveCollection } from \"./CurveCollection\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { PointString3d } from \"./PointString3d\";\r\n\r\n/**\r\n * Describes the category of a [[GeometryQuery]], enabling type-switching like:\r\n * ```ts\r\n * function processGeometryQuery(q: GeometryQuery): void {\r\n * if (\"solid\" === q.geometryCategory)\r\n * alert(\"Solid type = \" + q.solidPrimitiveType); // compiler knows q is an instance of SolidPrimitive\r\n * // ...etc...\r\n * ```\r\n *\r\n * Each string maps to a particular subclass of [[GeometryQuery]]:\r\n * - \"polyface\" => [[Polyface]]\r\n * - \"curvePrimitive\" => [[CurvePrimitive]]\r\n * - \"curveCollection\" => [[CurveCollection]]\r\n * - \"solid\" => [[SolidPrimitive]]\r\n * - \"point\" => [[CoordinateXYZ]]\r\n * - \"pointCollection\" => [[PointString3d]]\r\n * - \"bsurf\" => [[BSpline2dNd]] (which is an intermediate class shared by [[BSplineSurface3d]] and [[BSplineSurface3dH]])\r\n *\r\n * @see [[AnyGeometryQuery]]\r\n * @public\r\n */\r\nexport type GeometryQueryCategory = \"polyface\" | \"curvePrimitive\" | \"curveCollection\" | \"solid\" | \"point\" | \"pointCollection\" | \"bsurf\";\r\n\r\n/**\r\n * Union type for subclasses of [[GeometryQuery]]. Specific subclasses can be discriminated at compile- or run-time\r\n * using [[GeometryQuery.geometryCategory]].\r\n * @public\r\n */\r\nexport type AnyGeometryQuery = Polyface | CurvePrimitive | CurveCollection | SolidPrimitive | CoordinateXYZ | PointString3d | BSpline2dNd;\r\n\r\n/**\r\n * Queries to be supported by Curve, Surface, and Solid objects.\r\n * * `GeometryQuery` is an abstract base class with (abstract) methods for querying curve, solid primitive, mesh,\r\n * and bspline surfaces.\r\n * @public\r\n */\r\nexport abstract class GeometryQuery {\r\n /** Type discriminator. */\r\n public abstract readonly geometryCategory: GeometryQueryCategory;\r\n /** Return the range of the entire GeometryQuery tree. */\r\n public range(transform?: Transform, result?: Range3d): Range3d {\r\n if (result)\r\n result.setNull();\r\n const range = result ? result : Range3d.createNull();\r\n this.extendRange(range, transform);\r\n return range;\r\n }\r\n /** Extend `rangeToExtend` by the range of this geometry multiplied by the `transform`. */\r\n public abstract extendRange(rangeToExtend: Range3d, transform?: Transform): void;\r\n /**\r\n * Attempt to transform in place.\r\n * * LineSegment3d, Arc3d, LineString3d, BsplineCurve3d always succeed.\r\n * * Some geometry types may fail if scaling is non-uniform.\r\n */\r\n public abstract tryTransformInPlace(transform: Transform): boolean;\r\n /** Try to move the geometry by dx,dy,dz. */\r\n public tryTranslateInPlace(dx: number, dy: number = 0.0, dz: number = 0.0): boolean {\r\n return this.tryTransformInPlace(Transform.createTranslationXYZ(dx, dy, dz));\r\n }\r\n /** Return a transformed clone. */\r\n public abstract cloneTransformed(transform: Transform): GeometryQuery | undefined;\r\n /** Return a clone */\r\n public abstract clone(): GeometryQuery | undefined;\r\n /**\r\n * Return GeometryQuery children for recursive queries.\r\n * * leaf classes do not need to implement.\r\n */\r\n public get children(): GeometryQuery[] | undefined {\r\n return undefined;\r\n }\r\n /** Test `if (other instanceof this.Type)`. REQUIRED IN ALL CONCRETE CLASSES. */\r\n public abstract isSameGeometryClass(other: GeometryQuery): boolean;\r\n /**\r\n * Test for exact structure and nearly identical geometry.\r\n * * Leaf classes must implement.\r\n * * Base class implementation recurses through children.\r\n * * Base implementation is complete for classes with children and no properties.\r\n * * Classes with both children and properties must implement for properties, call super for children.\r\n */\r\n public isAlmostEqual(other: GeometryQuery): boolean {\r\n if (this.isSameGeometryClass(other)) {\r\n const childrenA = this.children;\r\n const childrenB = other.children;\r\n if (childrenA && childrenB) {\r\n if (childrenA.length !== childrenB.length)\r\n return false;\r\n for (let i = 0; i < childrenA.length; i++) {\r\n if (!childrenA[i].isAlmostEqual(childrenB[i]))\r\n return false;\r\n }\r\n return true;\r\n } else if (childrenA || childrenB) { // CurveCollections start with empty arrays for children so these null pointer cases are never reached.\r\n return false; // plainly different\r\n } else {\r\n return true; // both children null; call it equal\r\n }\r\n }\r\n return false;\r\n }\r\n /**\r\n * Apply instance method [[isAlmostEqual]] if both are defined.\r\n * * Both undefined returns true.\r\n * * Single defined returns false.\r\n */\r\n public static areAlmostEqual(a: GeometryQuery | undefined, b: GeometryQuery | undefined): boolean {\r\n if (a instanceof GeometryQuery && b instanceof GeometryQuery)\r\n return a.isAlmostEqual(b);\r\n if ((a === undefined) && (b === undefined))\r\n return true;\r\n return false;\r\n }\r\n /**\r\n * Double Dispatch call pattern.\r\n * * User code implements a `GeometryHandler` with specialized methods to handle `LineSegment3d`, `Arc3d`, etc as\r\n * relevant to its use case.\r\n * * Each such `GeometryQuery` class implements this method as a one-line method containing the appropriate call\r\n * such as `handler.handleLineSegment3d())`\r\n * * This allows each type-specific method to be called without a switch or `instanceof` test.\r\n * @param handler handler to be called by the particular geometry class\r\n */\r\n public abstract dispatchToGeometryHandler(handler: GeometryHandler): any;\r\n}\r\n"]}
1
+ {"version":3,"file":"GeometryQuery.js","sourceRoot":"","sources":["../../../src/curve/GeometryQuery.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAsCpD;;;;;GAKG;AACH,MAAM,OAAgB,aAAa;IAGjC,yDAAyD;IAClD,KAAK,CAAC,SAAqB,EAAE,MAAgB;QAClD,IAAI,MAAM;YACR,MAAM,CAAC,OAAO,EAAE,CAAC;QACnB,MAAM,KAAK,GAAG,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACrD,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,SAAS,CAAC,CAAC;QACnC,OAAO,KAAK,CAAC;IACf,CAAC;IASD,4CAA4C;IACrC,mBAAmB,CAAC,EAAU,EAAE,KAAa,GAAG,EAAE,KAAa,GAAG;QACvE,OAAO,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,oBAAoB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC;IAC9E,CAAC;IAKD;;;OAGG;IACH,IAAW,QAAQ;QACjB,OAAO,SAAS,CAAC;IACnB,CAAC;IAGD;;;;;;OAMG;IACI,aAAa,CAAC,KAAoB;QACvC,IAAI,IAAI,CAAC,mBAAmB,CAAC,KAAK,CAAC,EAAE,CAAC;YACpC,MAAM,SAAS,GAAG,IAAI,CAAC,QAAQ,CAAC;YAChC,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC;YACjC,IAAI,SAAS,IAAI,SAAS,EAAE,CAAC;gBAC3B,IAAI,SAAS,CAAC,MAAM,KAAK,SAAS,CAAC,MAAM;oBACvC,OAAO,KAAK,CAAC;gBACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBAC1C,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;wBAC3C,OAAO,KAAK,CAAC;gBACjB,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;iBAAM,IAAI,SAAS,IAAI,SAAS,EAAE,CAAC,CAAC,uGAAuG;gBAC1I,OAAO,KAAK,CAAC,CAAC,oBAAoB;YACpC,CAAC;iBAAM,CAAC;gBACN,OAAO,IAAI,CAAC,CAAC,oCAAoC;YACnD,CAAC;QACH,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,cAAc,CAAC,CAA4B,EAAE,CAA4B;QACrF,IAAI,CAAC,YAAY,aAAa,IAAI,CAAC,YAAY,aAAa;YAC1D,OAAO,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QAC5B,IAAI,CAAC,CAAC,KAAK,SAAS,CAAC,IAAI,CAAC,CAAC,KAAK,SAAS,CAAC;YACxC,OAAO,IAAI,CAAC;QACd,OAAO,KAAK,CAAC;IACf,CAAC;CAWF","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 */\nimport { BSpline2dNd } from \"../bspline/BSplineSurface\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { Range3d } from \"../geometry3d/Range\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { Polyface } from \"../polyface/Polyface\";\nimport { SolidPrimitive } from \"../solid/SolidPrimitive\";\nimport { CoordinateXYZ } from \"./CoordinateXYZ\";\nimport { CurveCollection } from \"./CurveCollection\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\nimport { PointString3d } from \"./PointString3d\";\n\n/**\n * Describes the category of a [[GeometryQuery]], enabling type-switching like:\n * ```ts\n * function processGeometryQuery(q: GeometryQuery): void {\n * if (\"solid\" === q.geometryCategory)\n * alert(\"Solid type = \" + q.solidPrimitiveType); // compiler knows q is an instance of SolidPrimitive\n * // ...etc...\n * ```\n *\n * Each string maps to a particular subclass of [[GeometryQuery]]:\n * - \"polyface\" => [[Polyface]]\n * - \"curvePrimitive\" => [[CurvePrimitive]]\n * - \"curveCollection\" => [[CurveCollection]]\n * - \"solid\" => [[SolidPrimitive]]\n * - \"point\" => [[CoordinateXYZ]]\n * - \"pointCollection\" => [[PointString3d]]\n * - \"bsurf\" => [[BSpline2dNd]] (which is an intermediate class shared by [[BSplineSurface3d]] and [[BSplineSurface3dH]])\n *\n * @see [[AnyGeometryQuery]]\n * @public\n */\nexport type GeometryQueryCategory = \"polyface\" | \"curvePrimitive\" | \"curveCollection\" | \"solid\" | \"point\" | \"pointCollection\" | \"bsurf\";\n\n/**\n * Union type for subclasses of [[GeometryQuery]]. Specific subclasses can be discriminated at compile- or run-time\n * using [[GeometryQuery.geometryCategory]].\n * @public\n */\nexport type AnyGeometryQuery = Polyface | CurvePrimitive | CurveCollection | SolidPrimitive | CoordinateXYZ | PointString3d | BSpline2dNd;\n\n/**\n * Queries to be supported by Curve, Surface, and Solid objects.\n * * `GeometryQuery` is an abstract base class with (abstract) methods for querying curve, solid primitive, mesh,\n * and bspline surfaces.\n * @public\n */\nexport abstract class GeometryQuery {\n /** Type discriminator. */\n public abstract readonly geometryCategory: GeometryQueryCategory;\n /** Return the range of the entire GeometryQuery tree. */\n public range(transform?: Transform, result?: Range3d): Range3d {\n if (result)\n result.setNull();\n const range = result ? result : Range3d.createNull();\n this.extendRange(range, transform);\n return range;\n }\n /** Extend `rangeToExtend` by the range of this geometry multiplied by the `transform`. */\n public abstract extendRange(rangeToExtend: Range3d, transform?: Transform): void;\n /**\n * Attempt to transform in place.\n * * LineSegment3d, Arc3d, LineString3d, BsplineCurve3d always succeed.\n * * Some geometry types may fail if scaling is non-uniform.\n */\n public abstract tryTransformInPlace(transform: Transform): boolean;\n /** Try to move the geometry by dx,dy,dz. */\n public tryTranslateInPlace(dx: number, dy: number = 0.0, dz: number = 0.0): boolean {\n return this.tryTransformInPlace(Transform.createTranslationXYZ(dx, dy, dz));\n }\n /** Return a transformed clone. */\n public abstract cloneTransformed(transform: Transform): GeometryQuery | undefined;\n /** Return a clone */\n public abstract clone(): GeometryQuery | undefined;\n /**\n * Return GeometryQuery children for recursive queries.\n * * leaf classes do not need to implement.\n */\n public get children(): GeometryQuery[] | undefined {\n return undefined;\n }\n /** Test `if (other instanceof this.Type)`. REQUIRED IN ALL CONCRETE CLASSES. */\n public abstract isSameGeometryClass(other: GeometryQuery): boolean;\n /**\n * Test for exact structure and nearly identical geometry.\n * * Leaf classes must implement.\n * * Base class implementation recurses through children.\n * * Base implementation is complete for classes with children and no properties.\n * * Classes with both children and properties must implement for properties, call super for children.\n */\n public isAlmostEqual(other: GeometryQuery): boolean {\n if (this.isSameGeometryClass(other)) {\n const childrenA = this.children;\n const childrenB = other.children;\n if (childrenA && childrenB) {\n if (childrenA.length !== childrenB.length)\n return false;\n for (let i = 0; i < childrenA.length; i++) {\n if (!childrenA[i].isAlmostEqual(childrenB[i]))\n return false;\n }\n return true;\n } else if (childrenA || childrenB) { // CurveCollections start with empty arrays for children so these null pointer cases are never reached.\n return false; // plainly different\n } else {\n return true; // both children null; call it equal\n }\n }\n return false;\n }\n /**\n * Apply instance method [[isAlmostEqual]] if both are defined.\n * * Both undefined returns true.\n * * Single defined returns false.\n */\n public static areAlmostEqual(a: GeometryQuery | undefined, b: GeometryQuery | undefined): boolean {\n if (a instanceof GeometryQuery && b instanceof GeometryQuery)\n return a.isAlmostEqual(b);\n if ((a === undefined) && (b === undefined))\n return true;\n return false;\n }\n /**\n * Double Dispatch call pattern.\n * * User code implements a `GeometryHandler` with specialized methods to handle `LineSegment3d`, `Arc3d`, etc as\n * relevant to its use case.\n * * Each such `GeometryQuery` class implements this method as a one-line method containing the appropriate call\n * such as `handler.handleLineSegment3d())`\n * * This allows each type-specific method to be called without a switch or `instanceof` test.\n * @param handler handler to be called by the particular geometry class\n */\n public abstract dispatchToGeometryHandler(handler: GeometryHandler): any;\n}\n"]}