@itwin/core-geometry 4.1.0-dev.4 → 4.1.0-dev.40

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 (570) hide show
  1. package/CHANGELOG.md +32 -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.d.ts +1 -0
  28. package/lib/cjs/core-geometry.d.ts.map +1 -1
  29. package/lib/cjs/core-geometry.js +4 -1
  30. package/lib/cjs/core-geometry.js.map +1 -1
  31. package/lib/cjs/curve/Arc3d.d.ts +71 -86
  32. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  33. package/lib/cjs/curve/Arc3d.js +110 -96
  34. package/lib/cjs/curve/Arc3d.js.map +1 -1
  35. package/lib/cjs/curve/ChainCollectorContext.js.map +1 -1
  36. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  37. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  38. package/lib/cjs/curve/CurveChain.js.map +1 -1
  39. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +61 -41
  40. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  41. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +69 -46
  42. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  43. package/lib/cjs/curve/CurveCollection.d.ts +73 -46
  44. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  45. package/lib/cjs/curve/CurveCollection.js +100 -64
  46. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  47. package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
  48. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  49. package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +1 -1
  50. package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
  51. package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +1 -1
  52. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  53. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  54. package/lib/cjs/curve/CurveLocationDetail.d.ts +45 -46
  55. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  56. package/lib/cjs/curve/CurveLocationDetail.js +39 -41
  57. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  58. package/lib/cjs/curve/CurvePrimitive.d.ts +138 -92
  59. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  60. package/lib/cjs/curve/CurvePrimitive.js +115 -75
  61. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  62. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  63. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  64. package/lib/cjs/curve/GeometryQuery.d.ts +26 -20
  65. package/lib/cjs/curve/GeometryQuery.d.ts.map +1 -1
  66. package/lib/cjs/curve/GeometryQuery.js +11 -9
  67. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  68. package/lib/cjs/curve/LineSegment3d.d.ts +38 -27
  69. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  70. package/lib/cjs/curve/LineSegment3d.js +77 -39
  71. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  72. package/lib/cjs/curve/LineString3d.d.ts +70 -51
  73. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  74. package/lib/cjs/curve/LineString3d.js +120 -71
  75. package/lib/cjs/curve/LineString3d.js.map +1 -1
  76. package/lib/cjs/curve/Loop.d.ts +7 -5
  77. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  78. package/lib/cjs/curve/Loop.js +18 -6
  79. package/lib/cjs/curve/Loop.js.map +1 -1
  80. package/lib/cjs/curve/ParityRegion.d.ts +7 -7
  81. package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
  82. package/lib/cjs/curve/ParityRegion.js +19 -11
  83. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  84. package/lib/cjs/curve/Path.d.ts +6 -6
  85. package/lib/cjs/curve/Path.d.ts.map +1 -1
  86. package/lib/cjs/curve/Path.js +15 -9
  87. package/lib/cjs/curve/Path.js.map +1 -1
  88. package/lib/cjs/curve/PointString3d.js.map +1 -1
  89. package/lib/cjs/curve/ProxyCurve.d.ts +4 -6
  90. package/lib/cjs/curve/ProxyCurve.d.ts.map +1 -1
  91. package/lib/cjs/curve/ProxyCurve.js +7 -7
  92. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  93. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  94. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  95. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  96. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  97. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  98. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  99. package/lib/cjs/curve/Query/StrokeCountMap.d.ts +14 -13
  100. package/lib/cjs/curve/Query/StrokeCountMap.d.ts.map +1 -1
  101. package/lib/cjs/curve/Query/StrokeCountMap.js +9 -8
  102. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  103. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  104. package/lib/cjs/curve/RegionOps.d.ts +69 -47
  105. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  106. package/lib/cjs/curve/RegionOps.js +70 -47
  107. package/lib/cjs/curve/RegionOps.js.map +1 -1
  108. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  109. package/lib/cjs/curve/StrokeOptions.d.ts +29 -21
  110. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  111. package/lib/cjs/curve/StrokeOptions.js +50 -24
  112. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  113. package/lib/cjs/curve/UnionRegion.d.ts +6 -5
  114. package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
  115. package/lib/cjs/curve/UnionRegion.js +17 -8
  116. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  117. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  118. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  119. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  120. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  121. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  122. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  123. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  124. package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts +2 -1
  125. package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
  126. package/lib/cjs/curve/internalContexts/GapSearchContext.js +6 -2
  127. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  128. package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +4 -0
  129. package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
  130. package/lib/cjs/curve/internalContexts/MultiChainCollector.js +5 -2
  131. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  132. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  133. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +14 -8
  134. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
  135. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
  136. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  137. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +56 -34
  138. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  139. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +152 -87
  140. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  141. package/lib/cjs/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
  142. package/lib/cjs/curve/internalContexts/SumLengthsContext.js +4 -1
  143. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  144. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  145. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  146. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  147. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  148. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  149. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  150. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  151. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  152. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  153. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  154. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  155. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  156. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  157. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  158. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  159. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  160. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  161. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  162. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  163. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  164. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  165. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  166. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  167. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  168. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  169. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  170. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  171. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  172. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  173. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  174. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  175. package/lib/cjs/geometry3d/Matrix3d.d.ts +2 -2
  176. package/lib/cjs/geometry3d/Matrix3d.js +2 -2
  177. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  178. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  179. package/lib/cjs/geometry3d/Plane3d.js.map +1 -1
  180. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  181. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +36 -32
  182. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  183. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +35 -32
  184. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  185. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  186. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  187. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  188. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  189. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  190. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  191. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  192. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  193. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  194. package/lib/cjs/geometry3d/Range.d.ts +133 -93
  195. package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
  196. package/lib/cjs/geometry3d/Range.js +296 -144
  197. package/lib/cjs/geometry3d/Range.js.map +1 -1
  198. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  199. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  200. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  201. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  202. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  203. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  204. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  205. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  206. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  207. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  208. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  209. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  210. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  211. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  212. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  213. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  214. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  215. package/lib/cjs/numerics/Complex.js.map +1 -1
  216. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  217. package/lib/cjs/numerics/Newton.js.map +1 -1
  218. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  219. package/lib/cjs/numerics/PolarData.js.map +1 -1
  220. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  221. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  222. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  223. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  224. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  225. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  226. package/lib/cjs/polyface/AuxData.js.map +1 -1
  227. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  228. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  229. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  230. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  231. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  232. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  233. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  234. package/lib/cjs/polyface/Polyface.js.map +1 -1
  235. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  236. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  237. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  238. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  239. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  240. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  241. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  242. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  243. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  244. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  245. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  246. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  247. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  248. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  249. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  250. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  251. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  252. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  253. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  254. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  255. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  256. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  257. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  258. package/lib/cjs/solid/Box.js.map +1 -1
  259. package/lib/cjs/solid/Cone.js.map +1 -1
  260. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  261. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  262. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  263. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  264. package/lib/cjs/solid/Sphere.js.map +1 -1
  265. package/lib/cjs/solid/SweepContour.js.map +1 -1
  266. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  267. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  268. package/lib/cjs/topology/Graph.js.map +1 -1
  269. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  270. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  271. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  272. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  273. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  274. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  275. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  276. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  277. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  278. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  279. package/lib/cjs/topology/MaskManager.js.map +1 -1
  280. package/lib/cjs/topology/Merging.js.map +1 -1
  281. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  282. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  283. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  284. package/lib/cjs/topology/Triangulation.js.map +1 -1
  285. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  286. package/lib/esm/Constant.js.map +1 -1
  287. package/lib/esm/Geometry.js.map +1 -1
  288. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  289. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  290. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  291. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  292. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  293. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  294. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  295. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  296. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  297. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  298. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  299. package/lib/esm/bspline/KnotVector.js.map +1 -1
  300. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  301. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  302. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  303. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  304. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  305. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  306. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  307. package/lib/esm/clipping/ClipVector.js.map +1 -1
  308. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  309. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  310. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  311. package/lib/esm/core-geometry.d.ts +1 -0
  312. package/lib/esm/core-geometry.d.ts.map +1 -1
  313. package/lib/esm/core-geometry.js +2 -0
  314. package/lib/esm/core-geometry.js.map +1 -1
  315. package/lib/esm/curve/Arc3d.d.ts +71 -86
  316. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  317. package/lib/esm/curve/Arc3d.js +110 -96
  318. package/lib/esm/curve/Arc3d.js.map +1 -1
  319. package/lib/esm/curve/ChainCollectorContext.js.map +1 -1
  320. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  321. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  322. package/lib/esm/curve/CurveChain.js.map +1 -1
  323. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +61 -41
  324. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  325. package/lib/esm/curve/CurveChainWithDistanceIndex.js +69 -46
  326. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  327. package/lib/esm/curve/CurveCollection.d.ts +73 -46
  328. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  329. package/lib/esm/curve/CurveCollection.js +100 -64
  330. package/lib/esm/curve/CurveCollection.js.map +1 -1
  331. package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
  332. package/lib/esm/curve/CurveCurve.js.map +1 -1
  333. package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +1 -1
  334. package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
  335. package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +1 -1
  336. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  337. package/lib/esm/curve/CurveFactory.js.map +1 -1
  338. package/lib/esm/curve/CurveLocationDetail.d.ts +45 -46
  339. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  340. package/lib/esm/curve/CurveLocationDetail.js +39 -41
  341. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  342. package/lib/esm/curve/CurvePrimitive.d.ts +138 -92
  343. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  344. package/lib/esm/curve/CurvePrimitive.js +115 -75
  345. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  346. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  347. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  348. package/lib/esm/curve/GeometryQuery.d.ts +26 -20
  349. package/lib/esm/curve/GeometryQuery.d.ts.map +1 -1
  350. package/lib/esm/curve/GeometryQuery.js +11 -9
  351. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  352. package/lib/esm/curve/LineSegment3d.d.ts +38 -27
  353. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  354. package/lib/esm/curve/LineSegment3d.js +77 -39
  355. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  356. package/lib/esm/curve/LineString3d.d.ts +70 -51
  357. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  358. package/lib/esm/curve/LineString3d.js +120 -71
  359. package/lib/esm/curve/LineString3d.js.map +1 -1
  360. package/lib/esm/curve/Loop.d.ts +7 -5
  361. package/lib/esm/curve/Loop.d.ts.map +1 -1
  362. package/lib/esm/curve/Loop.js +18 -6
  363. package/lib/esm/curve/Loop.js.map +1 -1
  364. package/lib/esm/curve/ParityRegion.d.ts +7 -7
  365. package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
  366. package/lib/esm/curve/ParityRegion.js +19 -11
  367. package/lib/esm/curve/ParityRegion.js.map +1 -1
  368. package/lib/esm/curve/Path.d.ts +6 -6
  369. package/lib/esm/curve/Path.d.ts.map +1 -1
  370. package/lib/esm/curve/Path.js +15 -9
  371. package/lib/esm/curve/Path.js.map +1 -1
  372. package/lib/esm/curve/PointString3d.js.map +1 -1
  373. package/lib/esm/curve/ProxyCurve.d.ts +4 -6
  374. package/lib/esm/curve/ProxyCurve.d.ts.map +1 -1
  375. package/lib/esm/curve/ProxyCurve.js +7 -7
  376. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  377. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  378. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  379. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  380. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  381. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  382. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  383. package/lib/esm/curve/Query/StrokeCountMap.d.ts +14 -13
  384. package/lib/esm/curve/Query/StrokeCountMap.d.ts.map +1 -1
  385. package/lib/esm/curve/Query/StrokeCountMap.js +9 -8
  386. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  387. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  388. package/lib/esm/curve/RegionOps.d.ts +69 -47
  389. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  390. package/lib/esm/curve/RegionOps.js +70 -47
  391. package/lib/esm/curve/RegionOps.js.map +1 -1
  392. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  393. package/lib/esm/curve/StrokeOptions.d.ts +29 -21
  394. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  395. package/lib/esm/curve/StrokeOptions.js +50 -24
  396. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  397. package/lib/esm/curve/UnionRegion.d.ts +6 -5
  398. package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
  399. package/lib/esm/curve/UnionRegion.js +17 -8
  400. package/lib/esm/curve/UnionRegion.js.map +1 -1
  401. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  402. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  403. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  404. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  405. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  406. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  407. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  408. package/lib/esm/curve/internalContexts/GapSearchContext.d.ts +2 -1
  409. package/lib/esm/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
  410. package/lib/esm/curve/internalContexts/GapSearchContext.js +6 -2
  411. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  412. package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +4 -0
  413. package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
  414. package/lib/esm/curve/internalContexts/MultiChainCollector.js +5 -2
  415. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  416. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  417. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +14 -8
  418. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
  419. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
  420. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  421. package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +56 -34
  422. package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  423. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +152 -87
  424. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  425. package/lib/esm/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
  426. package/lib/esm/curve/internalContexts/SumLengthsContext.js +4 -1
  427. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  428. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  429. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  430. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  431. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  432. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  433. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  434. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  435. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  436. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  437. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  438. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  439. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  440. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  441. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  442. package/lib/esm/geometry3d/Angle.js.map +1 -1
  443. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  444. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  445. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  446. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  447. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  448. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  449. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  450. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  451. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  452. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  453. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  454. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  455. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  456. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  457. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  458. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  459. package/lib/esm/geometry3d/Matrix3d.d.ts +2 -2
  460. package/lib/esm/geometry3d/Matrix3d.js +2 -2
  461. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  462. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  463. package/lib/esm/geometry3d/Plane3d.js.map +1 -1
  464. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  465. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +36 -32
  466. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  467. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +35 -32
  468. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  469. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  470. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  471. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  472. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  473. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  474. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  475. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  476. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  477. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  478. package/lib/esm/geometry3d/Range.d.ts +133 -93
  479. package/lib/esm/geometry3d/Range.d.ts.map +1 -1
  480. package/lib/esm/geometry3d/Range.js +296 -144
  481. package/lib/esm/geometry3d/Range.js.map +1 -1
  482. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  483. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  484. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  485. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  486. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  487. package/lib/esm/geometry3d/Transform.js.map +1 -1
  488. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  489. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  490. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  491. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  492. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  493. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  494. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  495. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  496. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  497. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  498. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  499. package/lib/esm/numerics/Complex.js.map +1 -1
  500. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  501. package/lib/esm/numerics/Newton.js.map +1 -1
  502. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  503. package/lib/esm/numerics/PolarData.js.map +1 -1
  504. package/lib/esm/numerics/Polynomials.js.map +1 -1
  505. package/lib/esm/numerics/Quadrature.js.map +1 -1
  506. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  507. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  508. package/lib/esm/numerics/UnionFind.js.map +1 -1
  509. package/lib/esm/numerics/UsageSums.js.map +1 -1
  510. package/lib/esm/polyface/AuxData.js.map +1 -1
  511. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  512. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  513. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  514. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  515. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  516. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  517. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  518. package/lib/esm/polyface/Polyface.js.map +1 -1
  519. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  520. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  521. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  522. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  523. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  524. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  525. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  526. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  527. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  528. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  529. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  530. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  531. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  532. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  533. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  534. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  535. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  536. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  537. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  538. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  539. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  540. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  541. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  542. package/lib/esm/solid/Box.js.map +1 -1
  543. package/lib/esm/solid/Cone.js.map +1 -1
  544. package/lib/esm/solid/LinearSweep.js.map +1 -1
  545. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  546. package/lib/esm/solid/RuledSweep.js.map +1 -1
  547. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  548. package/lib/esm/solid/Sphere.js.map +1 -1
  549. package/lib/esm/solid/SweepContour.js.map +1 -1
  550. package/lib/esm/solid/TorusPipe.js.map +1 -1
  551. package/lib/esm/topology/ChainMerge.js.map +1 -1
  552. package/lib/esm/topology/Graph.js.map +1 -1
  553. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  554. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  555. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  556. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  557. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  558. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  559. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  560. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  561. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  562. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  563. package/lib/esm/topology/MaskManager.js.map +1 -1
  564. package/lib/esm/topology/Merging.js.map +1 -1
  565. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  566. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  567. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  568. package/lib/esm/topology/Triangulation.js.map +1 -1
  569. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  570. package/package.json +3 -3
@@ -23,11 +23,14 @@ const LineString3d_1 = require("./LineString3d");
23
23
  const ProxyCurve_1 = require("./ProxyCurve");
24
24
  /**
25
25
  * A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:
26
- * - `CurveChain` is a (non-instantiable) intermediate class for a sequence of `CurvePrimitive ` joining head-to-tail. The two instantiable forms of `CurveChain` are
27
- * - `Path` - A chain not required to close, and not enclosing a planar area
28
- * - `Loop` - A chain required to close from last to first so that a planar area is enclosed.
29
- * - `ParityRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by parity rules
30
- * - `UnionRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by union rules
26
+ * - `CurveChain` is a (non-instantiable) intermediate class for a sequence of `CurvePrimitive` joining head-to-tail.
27
+ * The two instantiable forms of `CurveChain` are
28
+ * - `Path` - A chain not required to close and not enclosing a planar area (so curves do not have to be on the
29
+ * same plane).
30
+ * - `Loop` - A chain required to close from last to first so that a planar area is enclosed (so curves have to
31
+ * be on the same plane).
32
+ * - `ParityRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by parity rules.
33
+ * - `UnionRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by union rules.
31
34
  * - `BagOfCurves` -- a collection of `AnyCurve` with no implied structure.
32
35
  *
33
36
  * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.
@@ -39,11 +42,13 @@ class CurveCollection extends GeometryQuery_1.GeometryQuery {
39
42
  /** String name for schema properties */
40
43
  this.geometryCategory = "curveCollection";
41
44
  /* eslint-disable @typescript-eslint/naming-convention, no-empty */
42
- /** Flag for inner loop status. Only used by `Loop`. */
45
+ /** Flag for inner loop status. Only used by `Loop`. */
43
46
  this.isInner = false;
44
47
  }
45
48
  /** Return the sum of the lengths of all contained curves. */
46
- sumLengths() { return SumLengthsContext_1.SumLengthsContext.sumLengths(this); }
49
+ sumLengths() {
50
+ return SumLengthsContext_1.SumLengthsContext.sumLengths(this);
51
+ }
47
52
  /** Return the closest point on the contained curves */
48
53
  closestPoint(spacePoint) {
49
54
  let detailA;
@@ -61,17 +66,24 @@ class CurveCollection extends GeometryQuery_1.GeometryQuery {
61
66
  }
62
67
  return detailA;
63
68
  }
64
- /** return the max gap between adjacent primitives in Path and Loop collections.
65
- *
69
+ /**
70
+ * Return the max gap between adjacent primitives in Path and Loop collections.
66
71
  * * In a Path, gaps are computed between consecutive primitives.
67
72
  * * In a Loop, gaps are computed between consecutive primitives and between last and first.
68
- * * gaps are NOT computed between consecutive CurvePrimitives in "unstructured" collections. The type is "unstructured" so gaps should not be semantically meaningful.
73
+ * * Gaps are NOT computed between consecutive CurvePrimitives in "unstructured" collections. The type is
74
+ * "unstructured" so gaps should not be semantically meaningful.
69
75
  */
70
- maxGap() { return GapSearchContext_1.GapSearchContext.maxGap(this); }
71
- /** return true if the curve collection has any primitives other than LineSegment3d and LineString3d */
72
- checkForNonLinearPrimitives() { return CountLinearPartsSearchContext_1.CountLinearPartsSearchContext.hasNonLinearPrimitives(this); }
76
+ maxGap() {
77
+ return GapSearchContext_1.GapSearchContext.maxGap(this);
78
+ }
79
+ /** Return true if the curve collection has any primitives other than LineSegment3d and LineString3d */
80
+ checkForNonLinearPrimitives() {
81
+ return CountLinearPartsSearchContext_1.CountLinearPartsSearchContext.hasNonLinearPrimitives(this);
82
+ }
73
83
  /** Apply transform recursively to children */
74
- tryTransformInPlace(transform) { return TransformInPlaceContext_1.TransformInPlaceContext.tryTransformInPlace(this, transform); }
84
+ tryTransformInPlace(transform) {
85
+ return TransformInPlaceContext_1.TransformInPlaceContext.tryTransformInPlace(this, transform);
86
+ }
75
87
  /** Return a deep copy. */
76
88
  clone() {
77
89
  return CloneCurvesContext_1.CloneCurvesContext.clone(this);
@@ -80,11 +92,15 @@ class CurveCollection extends GeometryQuery_1.GeometryQuery {
80
92
  cloneTransformed(transform) {
81
93
  return CloneCurvesContext_1.CloneCurvesContext.clone(this, transform);
82
94
  }
83
- /** Create a deep copy with all linestrings expanded to multiple LineSegment3d. */
95
+ /** Create a deep copy with all linestrings broken down into multiple LineSegment3d. */
84
96
  cloneWithExpandedLineStrings() {
85
97
  return CloneWithExpandedLineStrings_1.CloneWithExpandedLineStrings.clone(this);
86
98
  }
87
- /** Recurse through children to collect CurvePrimitive's in flat array. */
99
+ /**
100
+ * Push all CurvePrimitives contained in the instance onto the `results` array.
101
+ * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives
102
+ * of the Loop are pushed onto `results`.
103
+ */
88
104
  collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings = false) {
89
105
  if (this.children) {
90
106
  for (const child of this.children) {
@@ -96,35 +112,44 @@ class CurveCollection extends GeometryQuery_1.GeometryQuery {
96
112
  }
97
113
  }
98
114
  /**
99
- * Return an array containing only the curve primitives.
100
- * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without clearing the array.)
101
- * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true, it recurses to its (otherwise hidden) children.
115
+ * Return an array containing all CurvePrimitives in the instance.
116
+ * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives of
117
+ * the Loop are pushed onto the returned array.
118
+ * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without
119
+ * clearing the array).
120
+ * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,
121
+ * it recurses to its (otherwise hidden) children.
102
122
  */
103
123
  collectCurvePrimitives(collectorArray, smallestPossiblePrimitives = false, explodeLineStrings = false) {
104
124
  const results = collectorArray === undefined ? [] : collectorArray;
105
125
  this.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLineStrings);
106
126
  return results;
107
127
  }
108
- /** Return true for planar region types:
128
+ /**
129
+ * Return true for planar region types:
109
130
  * * `Loop`
110
131
  * * `ParityRegion`
111
132
  * * `UnionRegion`
112
133
  */
113
134
  get isAnyRegionType() {
114
- return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 5 || this.dgnBoundaryType() === 4;
135
+ return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 4 || this.dgnBoundaryType() === 5;
115
136
  }
116
- /** Return true for a `Path`, i.e. a chain of curves joined head-to-tail
117
- */
137
+ /** Return true for a `Path`, i.e. a chain of curves joined head-to-tail */
118
138
  get isOpenPath() {
119
139
  return this.dgnBoundaryType() === 1;
120
140
  }
121
- /** Return true for a single-loop planar region type, i.e. `Loop`.
122
- * * This is _not- a test for physical closure of a `Path`
141
+ /**
142
+ * Return true for a single-loop planar region type, i.e. `Loop`.
143
+ * * This is NOT a test for physical closure of a `Path`.
123
144
  */
124
145
  get isClosedPath() {
125
146
  return this.dgnBoundaryType() === 2;
126
147
  }
127
- /** Extend (increase) `rangeToExtend` as needed to include these curves (optionally transformed) */
148
+ /**
149
+ * Extend (increase) the given range as needed to encompass all curves in the curve collection.
150
+ * @param rangeToExtend the given range.
151
+ * @param transform if supplied, the range is extended with transformed curves.
152
+ */
128
153
  extendRange(rangeToExtend, transform) {
129
154
  const children = this.children;
130
155
  if (children) {
@@ -134,8 +159,8 @@ class CurveCollection extends GeometryQuery_1.GeometryQuery {
134
159
  }
135
160
  }
136
161
  /**
137
- * * Find any curve primitive in the source.
138
- * * Evaluate it at a fraction (which by default is an interior fraction)
162
+ * Find any CurvePrimitive in the source and evaluate it at the given fraction.
163
+ * * The first CurvePrimitive found is evaluated. Any other CurvePrimitives are ignored.
139
164
  * @param source containing `CurvePrimitive` or `CurveCollection`
140
165
  * @param fraction fraction to use in `curve.fractionToPoint(fraction)`
141
166
  */
@@ -153,28 +178,35 @@ class CurveCollection extends GeometryQuery_1.GeometryQuery {
153
178
  }
154
179
  return undefined;
155
180
  }
156
- /** Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of projection.
181
+ /**
182
+ * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters
183
+ * of projection.
157
184
  * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.
158
185
  * @param lowHigh optional receiver for output
159
- * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the end of the ray.
186
+ * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the
187
+ * end of the ray.
160
188
  */
161
189
  projectedParameterRange(ray, lowHigh) {
162
190
  return PlaneAltitudeRangeContext_1.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
163
191
  }
164
192
  }
165
193
  exports.CurveCollection = CurveCollection;
166
- /** Shared base class for use by both open and closed paths.
167
- * - A `CurveChain` contains only curvePrimitives. No other paths, loops, or regions allowed.
168
- * - A single entry in the chain can in fact contain multiple curve primitives if the entry itself is (for instance) `CurveChainWithDistanceIndex`
169
- * which presents itself (through method interface) as a CurvePrimitive with well defined mappings from fraction to xyz, but in fact does all the
170
- * calculations over multiple primitives.
171
- * - The specific derived classes are `Path` and `Loop`
172
- * - `CurveChain` is an intermediate class. It is not instantiable on its own.
194
+ /**
195
+ * Shared base class for use by both open and closed paths.
196
+ * * A `CurveChain` contains only CurvePrimitives. No other paths, loops, or regions allowed.
197
+ * * The specific derived classes are `Path` and `Loop`
198
+ * * `CurveChain` is an intermediate class. It is not instantiable on its own.
199
+ * * The related class `CurveChainWithDistanceIndex` is a `CurvePrimitive` whose API presents well-defined mappings
200
+ * from fraction to xyz over the entire chain, but in fact does all the calculations over multiple primitives.
173
201
  * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.
174
202
  * @public
175
203
  */
176
204
  class CurveChain extends CurveCollection {
177
- constructor() { super(); this._curves = []; }
205
+ /** Constructor */
206
+ constructor() {
207
+ super();
208
+ this._curves = [];
209
+ }
178
210
  /** Return the array of `CurvePrimitive` */
179
211
  get children() {
180
212
  if (this._curves === undefined)
@@ -182,7 +214,7 @@ class CurveChain extends CurveCollection {
182
214
  return this._curves;
183
215
  }
184
216
  /**
185
- * Return the `[index]` curve primitive, optionally using `modulo` to map`index` to the cyclic indexing.
217
+ * Return the curve primitive at the given `index`, optionally using `modulo` to map `index` to the cyclic indexing.
186
218
  * * In particular, `-1` is the final curve.
187
219
  * @param index cyclic index
188
220
  */
@@ -190,8 +222,7 @@ class CurveChain extends CurveCollection {
190
222
  const n = this.children.length;
191
223
  if (n === 0)
192
224
  return undefined;
193
- /** Try simplest non-cyclic access first . . */
194
- if (index >= 0 && index < n)
225
+ if (index >= 0 && index < n) // try simplest non-cyclic access first
195
226
  return this.children[index];
196
227
  if (cyclic) {
197
228
  const index2 = Geometry_1.Geometry.modulo(index, n);
@@ -199,10 +230,16 @@ class CurveChain extends CurveCollection {
199
230
  }
200
231
  return undefined;
201
232
  }
202
- /** Stroke the chain into a simple xyz array.
233
+ /**
234
+ * Stroke the chain into a simple xyz array.
203
235
  * @param options tolerance parameters controlling the stroking.
204
236
  */
205
237
  getPackedStrokes(options) {
238
+ /**
239
+ * The object returned by "cloneStroked" has the same type (Loop or Path) but instead of a chain of
240
+ * CurvePrimitives as children, it has a single LineString3d child. "getPackedStrokes" just returns
241
+ * the points of that LineString3d using "packedPoints".
242
+ */
206
243
  const tree = this.cloneStroked(options);
207
244
  if (tree instanceof CurveChain) {
208
245
  const children = tree.children;
@@ -214,17 +251,8 @@ class CurveChain extends CurveCollection {
214
251
  }
215
252
  return undefined;
216
253
  }
217
- /* EDL 01/20 Path, Loop, CurveChainWithDistanceIndex all implement this.
218
- Reducing it to abstract.
219
- Hypothetically, a derived class in the wild might be depending on this.
220
- {
221
- const strokes = LineString3d.create();
222
- for (const curve of this.children)
223
- curve.emitStrokes(strokes, options);
224
- return strokes;
225
- }
226
- */
227
- /** add a child curve.
254
+ /**
255
+ * Add a child curve.
228
256
  * * Returns false if the given child is not a CurvePrimitive.
229
257
  */
230
258
  tryAddChild(child) {
@@ -240,7 +268,7 @@ class CurveChain extends CurveCollection {
240
268
  return this._curves[i];
241
269
  return undefined;
242
270
  }
243
- /** invoke `curve.extendRange(range, transform)` for each child */
271
+ /** Invoke `curve.extendRange(range, transform)` for each child */
244
272
  extendRange(range, transform) {
245
273
  for (const curve of this._curves)
246
274
  curve.extendRange(range, transform);
@@ -254,7 +282,8 @@ class CurveChain extends CurveCollection {
254
282
  curve.reverseInPlace();
255
283
  this._curves.reverse();
256
284
  }
257
- /** Return the index where target is found in the array of children
285
+ /**
286
+ * Return the index where target is found in the array of children.
258
287
  * @param alsoSearchProxies whether to also check proxy curves of the children
259
288
  */
260
289
  childIndex(target, alsoSearchProxies) {
@@ -273,8 +302,7 @@ class CurveChain extends CurveCollection {
273
302
  }
274
303
  return undefined;
275
304
  }
276
- /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive.
277
- */
305
+ /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */
278
306
  primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(index, fraction, cyclic = false, result) {
279
307
  const primitive = this.cyclicCurvePrimitive(index, cyclic);
280
308
  if (primitive) {
@@ -290,8 +318,10 @@ exports.CurveChain = CurveChain;
290
318
  * @public
291
319
  */
292
320
  class BagOfCurves extends CurveCollection {
293
- /** test if `other` is an instance of `BagOfCurves` */
294
- isSameGeometryClass(other) { return other instanceof BagOfCurves; }
321
+ /** Test if `other` is an instance of `BagOfCurves` */
322
+ isSameGeometryClass(other) {
323
+ return other instanceof BagOfCurves;
324
+ }
295
325
  /** Construct an empty `BagOfCurves` */
296
326
  constructor() {
297
327
  super();
@@ -300,8 +330,10 @@ class BagOfCurves extends CurveCollection {
300
330
  this._children = [];
301
331
  }
302
332
  /** Return the (reference to) array of children */
303
- get children() { return this._children; }
304
- /** create with given curves. */
333
+ get children() {
334
+ return this._children;
335
+ }
336
+ /** Create with given curves. */
305
337
  static create(...data) {
306
338
  const result = new BagOfCurves();
307
339
  for (const child of data) {
@@ -310,8 +342,10 @@ class BagOfCurves extends CurveCollection {
310
342
  return result;
311
343
  }
312
344
  /** Return the boundary type (0) of a corresponding MicroStation CurveVector */
313
- dgnBoundaryType() { return 0; }
314
- /** invoke `processor.announceBagOfCurves(this, indexInParent);` */
345
+ dgnBoundaryType() {
346
+ return 0;
347
+ }
348
+ /** Invoke `processor.announceBagOfCurves(this, indexInParent);` */
315
349
  announceToCurveProcessor(processor, indexInParent = -1) {
316
350
  return processor.announceBagOfCurves(this, indexInParent);
317
351
  }
@@ -335,7 +369,9 @@ class BagOfCurves extends CurveCollection {
335
369
  return clone;
336
370
  }
337
371
  /** Return an empty `BagOfCurves` */
338
- cloneEmptyPeer() { return new BagOfCurves(); }
372
+ cloneEmptyPeer() {
373
+ return new BagOfCurves();
374
+ }
339
375
  /** Add a child */
340
376
  tryAddChild(child) {
341
377
  if (child)
@@ -1 +1 @@
1
- {"version":3,"file":"CurveCollection.js","sourceRoot":"","sources":["../../../src/curve/CurveCollection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAuC;AAQvC,+DAA4D;AAC5D,qDAAkD;AAElD,mDAAgD;AAChD,8EAA2E;AAC3E,kGAA+F;AAC/F,oGAAiG;AACjG,0EAAuE;AACvE,4FAAyF;AACz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,8GAA8G;QACvG,8BAAyB,GAAY,IAAI,CAAC;QACjD,0CAA0C;QACnC,8BAAyB,GAAY,IAAI,CAAC;QACjD,gDAAgD;QACzC,4BAAuB,GAAG,mBAAQ,CAAC,mBAAmB,CAAC;QAC9D,uDAAuD;QAChD,2BAAsB,GAAG,mBAAQ,CAAC,mBAAmB,CAAC;IAC/D,CAAC;CAAA;AATD,8FASC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { AnyCurve } from \"./CurveChain\";\r\nimport { CurveLocationDetail } from \"./CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { CloneCurvesContext } from \"./internalContexts/CloneCurvesContext\";\r\nimport { CloneWithExpandedLineStrings } from \"./internalContexts/CloneWithExpandedLineStrings\";\r\nimport { CountLinearPartsSearchContext } from \"./internalContexts/CountLinearPartsSearchContext\";\r\nimport { GapSearchContext } from \"./internalContexts/GapSearchContext\";\r\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\r\nimport { SumLengthsContext } from \"./internalContexts/SumLengthsContext\";\r\nimport { TransformInPlaceContext } from \"./internalContexts/TransformInPlaceContext\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { ProxyCurve } from \"./ProxyCurve\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/** Describes the concrete type of a [[CurveCollection]]. Each type name maps to a specific subclass and can be used in conditional statements for type-switching.\r\n * - \"loop\" => [[Loop]]\r\n * - \"path\" => [[Path]]\r\n * - \"unionRegion\" => [[UnionRegion]]\r\n * - \"parityRegion\" => [[ParityRegion]]\r\n * - \"bagOfCurves\" => [[BagOfCurves]]\r\n * @public\r\n */\r\nexport type CurveCollectionType = \"loop\" | \"path\" | \"unionRegion\" | \"parityRegion\" | \"bagOfCurves\";\r\n\r\n/**\r\n * A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:\r\n * - `CurveChain` is a (non-instantiable) intermediate class for a sequence of `CurvePrimitive ` joining head-to-tail. The two instantiable forms of `CurveChain` are\r\n * - `Path` - A chain not required to close, and not enclosing a planar area\r\n * - `Loop` - A chain required to close from last to first so that a planar area is enclosed.\r\n * - `ParityRegion` -- a collection of coplanar `Loop`s, with \"in/out\" classification by parity rules\r\n * - `UnionRegion` -- a collection of coplanar `Loop`s, with \"in/out\" classification by union rules\r\n * - `BagOfCurves` -- a collection of `AnyCurve` with no implied structure.\r\n *\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport abstract class CurveCollection extends GeometryQuery {\r\n /** String name for schema properties */\r\n public readonly geometryCategory = \"curveCollection\";\r\n /** Type discriminator. */\r\n public abstract readonly curveCollectionType: CurveCollectionType;\r\n\r\n /* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\n /** Flag for inner loop status. Only used by `Loop`. */\r\n public isInner: boolean = false;\r\n /** Return the sum of the lengths of all contained curves. */\r\n public sumLengths(): number { return SumLengthsContext.sumLengths(this); }\r\n /** Return the closest point on the contained curves */\r\n public closestPoint(spacePoint: Point3d): CurveLocationDetail | undefined {\r\n let detailA: CurveLocationDetail | undefined;\r\n if (this.children !== undefined) {\r\n for (const child of this.children) {\r\n if (child instanceof CurvePrimitive) {\r\n const detailB = child.closestPoint(spacePoint, false);\r\n detailA = CurveLocationDetail.chooseSmallerA(detailA, detailB);\r\n } else if (child instanceof CurveCollection) {\r\n const detailB = child.closestPoint(spacePoint);\r\n detailA = CurveLocationDetail.chooseSmallerA(detailA, detailB);\r\n }\r\n }\r\n }\r\n return detailA;\r\n }\r\n\r\n /** return the max gap between adjacent primitives in Path and Loop collections.\r\n *\r\n * * In a Path, gaps are computed between consecutive primitives.\r\n * * In a Loop, gaps are computed between consecutive primitives and between last and first.\r\n * * gaps are NOT computed between consecutive CurvePrimitives in \"unstructured\" collections. The type is \"unstructured\" so gaps should not be semantically meaningful.\r\n */\r\n public maxGap(): number { return GapSearchContext.maxGap(this); }\r\n /** return true if the curve collection has any primitives other than LineSegment3d and LineString3d */\r\n public checkForNonLinearPrimitives(): boolean { return CountLinearPartsSearchContext.hasNonLinearPrimitives(this); }\r\n /** Apply transform recursively to children */\r\n public tryTransformInPlace(transform: Transform): boolean { return TransformInPlaceContext.tryTransformInPlace(this, transform); }\r\n /** Return a deep copy. */\r\n public override clone(): CurveCollection {\r\n return CloneCurvesContext.clone(this) as CurveCollection;\r\n }\r\n /** Create a deep copy of transformed curves. */\r\n public override cloneTransformed(transform: Transform): CurveCollection | undefined {\r\n return CloneCurvesContext.clone(this, transform);\r\n }\r\n /** Create a deep copy with all linestrings expanded to multiple LineSegment3d. */\r\n public cloneWithExpandedLineStrings(): CurveCollection {\r\n return CloneWithExpandedLineStrings.clone(this);\r\n }\r\n /** Recurse through children to collect CurvePrimitive's in flat array. */\r\n private collectCurvePrimitivesGo(results: CurvePrimitive[], smallestPossiblePrimitives: boolean, explodeLinestrings: boolean = false) {\r\n if (this.children) {\r\n for (const child of this.children) {\r\n if (child instanceof CurvePrimitive)\r\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\r\n else if (child instanceof CurveCollection)\r\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Return an array containing only the curve primitives.\r\n * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without clearing the array.)\r\n * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true, it recurses to its (otherwise hidden) children.\r\n */\r\n public collectCurvePrimitives(collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLineStrings: boolean = false): 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 /** Return true for planar region types:\r\n * * `Loop`\r\n * * `ParityRegion`\r\n * * `UnionRegion`\r\n */\r\n public get isAnyRegionType(): boolean {\r\n return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 5 || this.dgnBoundaryType() === 4;\r\n }\r\n /** Return true for a `Path`, i.e. a chain of curves joined head-to-tail\r\n */\r\n public get isOpenPath(): boolean {\r\n return this.dgnBoundaryType() === 1;\r\n }\r\n /** Return true for a single-loop planar region type, i.e. `Loop`.\r\n * * This is _not- a test for physical closure of a `Path`\r\n */\r\n public get isClosedPath(): boolean {\r\n return this.dgnBoundaryType() === 2;\r\n }\r\n /** Return a CurveCollection with the same structure but all curves replaced by strokes. */\r\n public abstract cloneStroked(options?: StrokeOptions): AnyCurve;\r\n\r\n /** Support method for ICurvePrimitive ... one line call to specific announce method . . */\r\n public abstract announceToCurveProcessor(processor: RecursiveCurveProcessor): void;\r\n /** clone an empty collection. */\r\n public abstract cloneEmptyPeer(): CurveCollection;\r\n /** Return the boundary type of a corresponding MicroStation CurveVector.\r\n * * Derived class must implement.\r\n */\r\n public abstract dgnBoundaryType(): number;\r\n /**\r\n * Try to add a child.\r\n * @param child child to add.\r\n * @return true if child is an acceptable type for this collection.\r\n */\r\n public abstract tryAddChild(child: AnyCurve | undefined): boolean;\r\n /** Return a child identified by by index */\r\n public abstract getChild(i: number): AnyCurve | undefined;\r\n /** Extend (increase) `rangeToExtend` as needed to include these curves (optionally transformed) */\r\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\r\n const children = this.children;\r\n if (children) {\r\n for (const c of children) {\r\n c.extendRange(rangeToExtend, transform);\r\n }\r\n }\r\n }\r\n /**\r\n * * Find any curve primitive in the source.\r\n * * Evaluate it at a fraction (which by default is an interior fraction)\r\n * @param source containing `CurvePrimitive` or `CurveCollection`\r\n * @param fraction fraction to use in `curve.fractionToPoint(fraction)`\r\n */\r\n public static createCurveLocationDetailOnAnyCurvePrimitive(source: GeometryQuery | undefined, fraction: number = 0.5): CurveLocationDetail | undefined {\r\n if (!source)\r\n return undefined;\r\n if (source instanceof CurvePrimitive) {\r\n return CurveLocationDetail.createCurveEvaluatedFraction(source, fraction);\r\n } else if (source instanceof CurveCollection && source.children !== undefined)\r\n for (const child of source.children) {\r\n const detail = this.createCurveLocationDetailOnAnyCurvePrimitive(child, fraction);\r\n if (detail)\r\n return detail;\r\n }\r\n return undefined;\r\n }\r\n /** Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional 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 end of the ray.\r\n */\r\n public projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n}\r\n\r\n/** Shared base class for use by both open and closed paths.\r\n * - A `CurveChain` contains only curvePrimitives. No other paths, loops, or regions allowed.\r\n * - A single entry in the chain can in fact contain multiple curve primitives if the entry itself is (for instance) `CurveChainWithDistanceIndex`\r\n * which presents itself (through method interface) as a CurvePrimitive with well defined mappings from fraction to xyz, but in fact does all the\r\n * calculations over multiple primitives.\r\n * - The specific derived classes are `Path` and `Loop`\r\n * - `CurveChain` is an intermediate class. It is not instantiable on its own.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport abstract class CurveChain extends CurveCollection {\r\n /** The curve primitives in the chain. */\r\n protected _curves: CurvePrimitive[];\r\n protected constructor() { super(); this._curves = []; }\r\n /** Return the array of `CurvePrimitive` */\r\n public override get children(): CurvePrimitive[] {\r\n if (this._curves === undefined)\r\n this._curves = [];\r\n return this._curves;\r\n }\r\n /**\r\n * Return the `[index]` curve primitive, optionally using `modulo` to map`index` to the cyclic indexing.\r\n * * In particular, `-1` is the final curve.\r\n * @param index cyclic index\r\n */\r\n public cyclicCurvePrimitive(index: number, cyclic: boolean = true): CurvePrimitive | undefined {\r\n const n = this.children.length;\r\n if (n === 0)\r\n return undefined;\r\n /** Try simplest non-cyclic access first . . */\r\n if (index >= 0 && index < n)\r\n return this.children[index];\r\n if (cyclic) {\r\n const index2 = Geometry.modulo(index, n);\r\n return this.children[index2];\r\n }\r\n return undefined;\r\n }\r\n /** Stroke the chain into a simple xyz array.\r\n * @param options tolerance parameters controlling the stroking.\r\n */\r\n public getPackedStrokes(options?: StrokeOptions): GrowableXYZArray | undefined {\r\n const tree = this.cloneStroked(options);\r\n if (tree instanceof CurveChain) {\r\n const children = tree.children;\r\n if (children.length === 1) {\r\n const ls = children[0];\r\n if (ls instanceof LineString3d)\r\n return ls.packedPoints;\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** Return a structural clone, with CurvePrimitive objects stroked. */\r\n public abstract override cloneStroked(options?: StrokeOptions): AnyCurve;\r\n /* EDL 01/20 Path, Loop, CurveChainWithDistanceIndex all implement this.\r\n Reducing it to abstract.\r\n Hypothetically, a derived class in the wild might be depending on this.\r\n {\r\n const strokes = LineString3d.create();\r\n for (const curve of this.children)\r\n curve.emitStrokes(strokes, options);\r\n return strokes;\r\n }\r\n */\r\n /** add a child curve.\r\n * * Returns false if the given child is not a CurvePrimitive.\r\n */\r\n public tryAddChild(child: AnyCurve | undefined): boolean {\r\n if (child && child instanceof CurvePrimitive) {\r\n this._curves.push(child);\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Return a child by index */\r\n public getChild(i: number): CurvePrimitive | undefined {\r\n if (i < this._curves.length) return this._curves[i];\r\n return undefined;\r\n }\r\n /** invoke `curve.extendRange(range, transform)` for each child */\r\n public override extendRange(range: Range3d, transform?: Transform): void {\r\n for (const curve of this._curves)\r\n curve.extendRange(range, transform);\r\n }\r\n /**\r\n * Reverse each child curve (in place)\r\n * Reverse the order of the children in the CurveChain array.\r\n */\r\n public reverseChildrenInPlace() {\r\n for (const curve of this._curves)\r\n curve.reverseInPlace();\r\n this._curves.reverse();\r\n }\r\n /** Return the index where target is found in the array of children\r\n * @param alsoSearchProxies whether to also check proxy curves of the children\r\n */\r\n public childIndex(target: CurvePrimitive | undefined, alsoSearchProxies?: boolean): number | undefined {\r\n for (let i = 0; i < this._curves.length; i++){\r\n if (this._curves[i] === target)\r\n return i;\r\n }\r\n if (alsoSearchProxies ?? false) {\r\n for (let i = 0; i < this._curves.length; i++) {\r\n const childCurve = this._curves[i];\r\n if (childCurve instanceof ProxyCurve) {\r\n if (childCurve.proxyCurve === target)\r\n return i;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive.\r\n */\r\n public primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(index: number, fraction: number, cyclic: boolean = false, result?: CurveLocationDetail): CurveLocationDetail | undefined {\r\n const primitive = this.cyclicCurvePrimitive(index, cyclic);\r\n if (primitive) {\r\n return CurveLocationDetail.createCurveEvaluatedFractionPointAndDerivative(primitive, fraction, result);\r\n }\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * * A `BagOfCurves` object is a collection of `AnyCurve` objects.\r\n * * A `BagOfCurves` has no implied properties such as being planar.\r\n * @public\r\n */\r\nexport class BagOfCurves extends CurveCollection {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"bagOfCurves\";\r\n\r\n /** test if `other` is an instance of `BagOfCurves` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean { return other instanceof BagOfCurves; }\r\n /** Array of children.\r\n * * No restrictions on type.\r\n */\r\n protected _children: AnyCurve[];\r\n /** Construct an empty `BagOfCurves` */\r\n public constructor() { super(); this._children = []; }\r\n /** Return the (reference to) array of children */\r\n public override get children(): AnyCurve[] { return this._children; }\r\n /** create with given curves. */\r\n public static create(...data: AnyCurve[]): BagOfCurves {\r\n const result = new BagOfCurves();\r\n for (const child of data) {\r\n result.tryAddChild(child);\r\n }\r\n return result;\r\n }\r\n /** Return the boundary type (0) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number { return 0; }\r\n /** invoke `processor.announceBagOfCurves(this, indexInParent);` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announceBagOfCurves(this, indexInParent);\r\n }\r\n /** Clone all children in stroked form. */\r\n public cloneStroked(options?: StrokeOptions): BagOfCurves {\r\n const clone = new BagOfCurves();\r\n let child;\r\n for (child of this.children) {\r\n if (child instanceof CurvePrimitive) {\r\n const ls = LineString3d.create();\r\n child.emitStrokes(ls, options);\r\n if (ls)\r\n clone.children.push(ls);\r\n } else if (child instanceof CurveCollection) {\r\n const childStrokes = child.cloneStroked(options);\r\n if (childStrokes)\r\n clone.children.push(childStrokes);\r\n }\r\n }\r\n return clone;\r\n }\r\n /** Return an empty `BagOfCurves` */\r\n public cloneEmptyPeer(): BagOfCurves { return new BagOfCurves(); }\r\n /** Add a child */\r\n public tryAddChild(child: AnyCurve | undefined): boolean {\r\n if (child)\r\n this._children.push(child);\r\n return true;\r\n }\r\n /** Get a child by index */\r\n public getChild(i: number): AnyCurve | undefined {\r\n if (i < this._children.length)\r\n return this._children[i];\r\n return undefined;\r\n }\r\n /** Second step of double dispatch: call `handler.handleBagOfCurves(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleBagOfCurves(this);\r\n }\r\n}\r\n/**\r\n * * Options to control method `RegionOps.consolidateAdjacentPrimitives`\r\n * @public\r\n */\r\nexport class ConsolidateAdjacentCurvePrimitivesOptions {\r\n /** True to consolidated linear geometry (e.g. separate LineSegment3d and LineString3d) into LineString3d */\r\n public consolidateLinearGeometry: boolean = true;\r\n /** True to consolidate contiguous arcs */\r\n public consolidateCompatibleArcs: boolean = true;\r\n /** Tolerance for collapsing identical points */\r\n public duplicatePointTolerance = Geometry.smallMetricDistance;\r\n /** Tolerance for removing interior colinear points. */\r\n public colinearPointTolerance = Geometry.smallMetricDistance;\r\n}\r\n"]}
1
+ {"version":3,"file":"CurveCollection.js","sourceRoot":"","sources":["../../../src/curve/CurveCollection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAuC;AAQvC,+DAA4D;AAC5D,qDAAkD;AAElD,mDAAgD;AAChD,8EAA2E;AAC3E,kGAA+F;AAC/F,oGAAiG;AACjG,0EAAuE;AACvE,4FAAyF;AACzF,4EAAyE;AACzE,wFAAqF;AACrF,iDAA8C;AAC9C,6CAA0C;AAe1C;;;;;;;;;;;;;;GAcG;AACH,MAAsB,eAAgB,SAAQ,6BAAa;IAA3D;;QACE,wCAAwC;QACxB,qBAAgB,GAAG,iBAAiB,CAAC;QAGrD,mEAAmE;QACnE,uDAAuD;QAChD,YAAO,GAAY,KAAK,CAAC;IAwKlC,CAAC;IAvKC,6DAA6D;IACtD,UAAU;QACf,OAAO,qCAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IACD,uDAAuD;IAChD,YAAY,CAAC,UAAmB;QACrC,IAAI,OAAwC,CAAC;QAC7C,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;YAC/B,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE;gBACjC,IAAI,KAAK,YAAY,+BAAc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IAAI,YAAY;oBACd,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;aACrC;SACF;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,oCAAoC;IAC7B,cAAc;QACnB,OAAO,IAAI,WAAW,EAAE,CAAC;IAC3B,CAAC;IACD,mBAAmB;IACZ,WAAW,CAAC,KAA2B;QAC5C,IAAI,KAAK;YACP,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,2BAA2B;IACpB,QAAQ,CAAC,CAAS;QACvB,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM;YAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,8EAA8E;IACvE,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF;AA3ED,kCA2EC;AAED;;;GAGG;AACH,MAAa,yCAAyC;IAAtD;QACE,8GAA8G;QACvG,8BAAyB,GAAY,IAAI,CAAC;QACjD,0CAA0C;QACnC,8BAAyB,GAAY,IAAI,CAAC;QACjD,gDAAgD;QACzC,4BAAuB,GAAG,mBAAQ,CAAC,mBAAmB,CAAC;QAC9D,uDAAuD;QAChD,2BAAsB,GAAG,mBAAQ,CAAC,mBAAmB,CAAC;IAC/D,CAAC;CAAA;AATD,8FASC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../Geometry\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { AnyCurve } from \"./CurveChain\";\nimport { CurveLocationDetail } from \"./CurveLocationDetail\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { CloneCurvesContext } from \"./internalContexts/CloneCurvesContext\";\nimport { CloneWithExpandedLineStrings } from \"./internalContexts/CloneWithExpandedLineStrings\";\nimport { CountLinearPartsSearchContext } from \"./internalContexts/CountLinearPartsSearchContext\";\nimport { GapSearchContext } from \"./internalContexts/GapSearchContext\";\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\nimport { SumLengthsContext } from \"./internalContexts/SumLengthsContext\";\nimport { TransformInPlaceContext } from \"./internalContexts/TransformInPlaceContext\";\nimport { LineString3d } from \"./LineString3d\";\nimport { ProxyCurve } from \"./ProxyCurve\";\nimport { StrokeOptions } from \"./StrokeOptions\";\n\n/**\n * Describes the concrete type of a [[CurveCollection]]. Each type name maps to a specific subclass and can be\n * used in conditional statements for type-switching.\n * - \"loop\" => [[Loop]]\n * - \"path\" => [[Path]]\n * - \"unionRegion\" => [[UnionRegion]]\n * - \"parityRegion\" => [[ParityRegion]]\n * - \"bagOfCurves\" => [[BagOfCurves]]\n * @public\n */\nexport type CurveCollectionType = \"loop\" | \"path\" | \"unionRegion\" | \"parityRegion\" | \"bagOfCurves\";\n\n/**\n * A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:\n * - `CurveChain` is a (non-instantiable) intermediate class for a sequence of `CurvePrimitive` joining head-to-tail.\n * The two instantiable forms of `CurveChain` are\n * - `Path` - A chain not required to close and not enclosing a planar area (so curves do not have to be on the\n * same plane).\n * - `Loop` - A chain required to close from last to first so that a planar area is enclosed (so curves have to\n * be on the same plane).\n * - `ParityRegion` -- a collection of coplanar `Loop`s, with \"in/out\" classification by parity rules.\n * - `UnionRegion` -- a collection of coplanar `Loop`s, with \"in/out\" classification by union rules.\n * - `BagOfCurves` -- a collection of `AnyCurve` with no implied structure.\n *\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\n * @public\n */\nexport abstract class CurveCollection extends GeometryQuery {\n /** String name for schema properties */\n public readonly geometryCategory = \"curveCollection\";\n /** Type discriminator. */\n public abstract readonly curveCollectionType: CurveCollectionType;\n /* eslint-disable @typescript-eslint/naming-convention, no-empty */\n /** Flag for inner loop status. Only used by `Loop`. */\n public isInner: boolean = false;\n /** Return the sum of the lengths of all contained curves. */\n public sumLengths(): number {\n return SumLengthsContext.sumLengths(this);\n }\n /** Return the closest point on the contained curves */\n public closestPoint(spacePoint: Point3d): CurveLocationDetail | undefined {\n let detailA: CurveLocationDetail | undefined;\n if (this.children !== undefined) {\n for (const child of this.children) {\n if (child instanceof CurvePrimitive) {\n const detailB = child.closestPoint(spacePoint, false);\n detailA = CurveLocationDetail.chooseSmallerA(detailA, detailB);\n } else if (child instanceof CurveCollection) {\n const detailB = child.closestPoint(spacePoint);\n detailA = CurveLocationDetail.chooseSmallerA(detailA, detailB);\n }\n }\n }\n return detailA;\n }\n /**\n * Return the max gap between adjacent primitives in Path and Loop collections.\n * * In a Path, gaps are computed between consecutive primitives.\n * * In a Loop, gaps are computed between consecutive primitives and between last and first.\n * * Gaps are NOT computed between consecutive CurvePrimitives in \"unstructured\" collections. The type is\n * \"unstructured\" so gaps should not be semantically meaningful.\n */\n public maxGap(): number {\n return GapSearchContext.maxGap(this);\n }\n /** Return true if the curve collection has any primitives other than LineSegment3d and LineString3d */\n public checkForNonLinearPrimitives(): boolean {\n return CountLinearPartsSearchContext.hasNonLinearPrimitives(this);\n }\n /** Apply transform recursively to children */\n public tryTransformInPlace(transform: Transform): boolean {\n return TransformInPlaceContext.tryTransformInPlace(this, transform);\n }\n /** Return a deep copy. */\n public override clone(): CurveCollection {\n return CloneCurvesContext.clone(this) as CurveCollection;\n }\n /** Create a deep copy of transformed curves. */\n public override cloneTransformed(transform: Transform): CurveCollection | undefined {\n return CloneCurvesContext.clone(this, transform);\n }\n /** Create a deep copy with all linestrings broken down into multiple LineSegment3d. */\n public cloneWithExpandedLineStrings(): CurveCollection {\n return CloneWithExpandedLineStrings.clone(this);\n }\n /**\n * Push all CurvePrimitives contained in the instance onto the `results` array.\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives\n * of the Loop are pushed onto `results`.\n */\n private collectCurvePrimitivesGo(\n results: CurvePrimitive[], smallestPossiblePrimitives: boolean, explodeLinestrings: boolean = false\n ): void {\n if (this.children) {\n for (const child of this.children) {\n if (child instanceof CurvePrimitive)\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\n else if (child instanceof CurveCollection)\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\n }\n }\n }\n /**\n * Return an array containing all CurvePrimitives in the instance.\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives of\n * the Loop are pushed onto the returned array.\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 * Return true for planar region types:\n * * `Loop`\n * * `ParityRegion`\n * * `UnionRegion`\n */\n public get isAnyRegionType(): boolean {\n return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 4 || this.dgnBoundaryType() === 5;\n }\n /** Return true for a `Path`, i.e. a chain of curves joined head-to-tail */\n public get isOpenPath(): boolean {\n return this.dgnBoundaryType() === 1;\n }\n /**\n * Return true for a single-loop planar region type, i.e. `Loop`.\n * * This is NOT a test for physical closure of a `Path`.\n */\n public get isClosedPath(): boolean {\n return this.dgnBoundaryType() === 2;\n }\n /** Return a CurveCollection with the same structure but all curves replaced by strokes. */\n public abstract cloneStroked(options?: StrokeOptions): AnyCurve;\n /** Support method for ICurvePrimitive ... one line call to specific announce method . . */\n public abstract announceToCurveProcessor(processor: RecursiveCurveProcessor): void;\n /** Clone an empty collection. */\n public abstract cloneEmptyPeer(): CurveCollection;\n /**\n * Return the boundary type of a corresponding MicroStation CurveVector.\n * * Derived class must implement.\n */\n public abstract dgnBoundaryType(): number;\n /**\n * Try to add a child.\n * @param child child to add.\n * @return true if child is an acceptable type for this collection.\n */\n public abstract tryAddChild(child: AnyCurve | undefined): boolean;\n /** Return a child identified by by index */\n public abstract getChild(i: number): AnyCurve | undefined;\n /**\n * Extend (increase) the given range as needed to encompass all curves in the curve collection.\n * @param rangeToExtend the given range.\n * @param transform if supplied, the range is extended with transformed curves.\n */\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\n const children = this.children;\n if (children) {\n for (const c of children) {\n c.extendRange(rangeToExtend, transform);\n }\n }\n }\n /**\n * Find any CurvePrimitive in the source and evaluate it at the given fraction.\n * * The first CurvePrimitive found is evaluated. Any other CurvePrimitives are ignored.\n * @param source containing `CurvePrimitive` or `CurveCollection`\n * @param fraction fraction to use in `curve.fractionToPoint(fraction)`\n */\n public static createCurveLocationDetailOnAnyCurvePrimitive(\n source: GeometryQuery | undefined, fraction: number = 0.5\n ): CurveLocationDetail | undefined {\n if (!source)\n return undefined;\n if (source instanceof CurvePrimitive) {\n return CurveLocationDetail.createCurveEvaluatedFraction(source, fraction);\n } else if (source instanceof CurveCollection && source.children !== undefined)\n for (const child of source.children) {\n const detail = this.createCurveLocationDetailOnAnyCurvePrimitive(child, fraction);\n if (detail)\n return detail;\n }\n return undefined;\n }\n /**\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters\n * 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 PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\n }\n}\n\n/**\n * Shared base class for use by both open and closed paths.\n * * A `CurveChain` contains only CurvePrimitives. No other paths, loops, or regions allowed.\n * * The specific derived classes are `Path` and `Loop`\n * * `CurveChain` is an intermediate class. It is not instantiable on its own.\n * * The related class `CurveChainWithDistanceIndex` is a `CurvePrimitive` whose API presents well-defined mappings\n * from fraction to xyz over the entire chain, but in fact does all the calculations over multiple primitives.\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\n * @public\n */\nexport abstract class CurveChain extends CurveCollection {\n /** The curve primitives in the chain. */\n protected _curves: CurvePrimitive[];\n /** Constructor */\n protected constructor() {\n super();\n this._curves = [];\n }\n /** Return the array of `CurvePrimitive` */\n public override get children(): CurvePrimitive[] {\n if (this._curves === undefined)\n this._curves = [];\n return this._curves;\n }\n /**\n * Return the curve primitive at the given `index`, optionally using `modulo` to map `index` to the cyclic indexing.\n * * In particular, `-1` is the final curve.\n * @param index cyclic index\n */\n public cyclicCurvePrimitive(index: number, cyclic: boolean = true): CurvePrimitive | undefined {\n const n = this.children.length;\n if (n === 0)\n return undefined;\n if (index >= 0 && index < n) // try simplest non-cyclic access first\n return this.children[index];\n if (cyclic) {\n const index2 = Geometry.modulo(index, n);\n return this.children[index2];\n }\n return undefined;\n }\n /**\n * Stroke the chain into a simple xyz array.\n * @param options tolerance parameters controlling the stroking.\n */\n public getPackedStrokes(options?: StrokeOptions): GrowableXYZArray | undefined {\n /**\n * The object returned by \"cloneStroked\" has the same type (Loop or Path) but instead of a chain of\n * CurvePrimitives as children, it has a single LineString3d child. \"getPackedStrokes\" just returns\n * the points of that LineString3d using \"packedPoints\".\n */\n const tree = this.cloneStroked(options);\n if (tree instanceof CurveChain) {\n const children = tree.children;\n if (children.length === 1) {\n const ls = children[0];\n if (ls instanceof LineString3d)\n return ls.packedPoints;\n }\n }\n return undefined;\n }\n /** Return a structural clone, with CurvePrimitive objects stroked. */\n public abstract override cloneStroked(options?: StrokeOptions): AnyCurve;\n /**\n * Add a child curve.\n * * Returns false if the given child is not a CurvePrimitive.\n */\n public tryAddChild(child: AnyCurve | undefined): boolean {\n if (child && child instanceof CurvePrimitive) {\n this._curves.push(child);\n return true;\n }\n return false;\n }\n /** Return a child by index */\n public getChild(i: number): CurvePrimitive | undefined {\n if (i < this._curves.length) return this._curves[i];\n return undefined;\n }\n /** Invoke `curve.extendRange(range, transform)` for each child */\n public override extendRange(range: Range3d, transform?: Transform): void {\n for (const curve of this._curves)\n curve.extendRange(range, transform);\n }\n /**\n * Reverse each child curve (in place)\n * Reverse the order of the children in the CurveChain array.\n */\n public reverseChildrenInPlace(): void {\n for (const curve of this._curves)\n curve.reverseInPlace();\n this._curves.reverse();\n }\n /**\n * Return the index where target is found in the array of children.\n * @param alsoSearchProxies whether to also check proxy curves of the children\n */\n public childIndex(target: CurvePrimitive | undefined, alsoSearchProxies?: boolean): number | undefined {\n for (let i = 0; i < this._curves.length; i++) {\n if (this._curves[i] === target)\n return i;\n }\n if (alsoSearchProxies ?? false) {\n for (let i = 0; i < this._curves.length; i++) {\n const childCurve = this._curves[i];\n if (childCurve instanceof ProxyCurve) {\n if (childCurve.proxyCurve === target)\n return i;\n }\n }\n }\n return undefined;\n }\n /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */\n public primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(\n index: number, fraction: number, cyclic: boolean = false, result?: CurveLocationDetail\n ): CurveLocationDetail | undefined {\n const primitive = this.cyclicCurvePrimitive(index, cyclic);\n if (primitive) {\n return CurveLocationDetail.createCurveEvaluatedFractionPointAndDerivative(primitive, fraction, result);\n }\n return undefined;\n }\n}\n\n/**\n * * A `BagOfCurves` object is a collection of `AnyCurve` objects.\n * * A `BagOfCurves` has no implied properties such as being planar.\n * @public\n */\nexport class BagOfCurves extends CurveCollection {\n /** String name for schema properties */\n public readonly curveCollectionType = \"bagOfCurves\";\n /** Test if `other` is an instance of `BagOfCurves` */\n public isSameGeometryClass(other: GeometryQuery): boolean {\n return other instanceof BagOfCurves;\n }\n /**\n * Array of children.\n * * No restrictions on type.\n */\n protected _children: AnyCurve[];\n /** Construct an empty `BagOfCurves` */\n public constructor() {\n super();\n this._children = [];\n }\n /** Return the (reference to) array of children */\n public override get children(): AnyCurve[] {\n return this._children;\n }\n /** Create with given curves. */\n public static create(...data: AnyCurve[]): BagOfCurves {\n const result = new BagOfCurves();\n for (const child of data) {\n result.tryAddChild(child);\n }\n return result;\n }\n /** Return the boundary type (0) of a corresponding MicroStation CurveVector */\n public dgnBoundaryType(): number {\n return 0;\n }\n /** Invoke `processor.announceBagOfCurves(this, indexInParent);` */\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\n return processor.announceBagOfCurves(this, indexInParent);\n }\n /** Clone all children in stroked form. */\n public cloneStroked(options?: StrokeOptions): BagOfCurves {\n const clone = new BagOfCurves();\n let child;\n for (child of this.children) {\n if (child instanceof CurvePrimitive) {\n const ls = LineString3d.create();\n child.emitStrokes(ls, options);\n if (ls)\n clone.children.push(ls);\n } else if (child instanceof CurveCollection) {\n const childStrokes = child.cloneStroked(options);\n if (childStrokes)\n clone.children.push(childStrokes);\n }\n }\n return clone;\n }\n /** Return an empty `BagOfCurves` */\n public cloneEmptyPeer(): BagOfCurves {\n return new BagOfCurves();\n }\n /** Add a child */\n public tryAddChild(child: AnyCurve | undefined): boolean {\n if (child)\n this._children.push(child);\n return true;\n }\n /** Get a child by index */\n public getChild(i: number): AnyCurve | undefined {\n if (i < this._children.length)\n return this._children[i];\n return undefined;\n }\n /** Second step of double dispatch: call `handler.handleBagOfCurves(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleBagOfCurves(this);\n }\n}\n\n/**\n * * Options to control method `RegionOps.consolidateAdjacentPrimitives`\n * @public\n */\nexport class ConsolidateAdjacentCurvePrimitivesOptions {\n /** True to consolidated linear geometry (e.g. separate LineSegment3d and LineString3d) into LineString3d */\n public consolidateLinearGeometry: boolean = true;\n /** True to consolidate contiguous arcs */\n public consolidateCompatibleArcs: boolean = true;\n /** Tolerance for collapsing identical points */\n public duplicatePointTolerance = Geometry.smallMetricDistance;\n /** Tolerance for removing interior colinear points. */\n public colinearPointTolerance = Geometry.smallMetricDistance;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CurveCurve.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveCurve.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,OAAO,EAAyB,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAE9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,qBAAa,UAAU;IACrB;;;;;;;OAOG;WACW,mBAAmB,CAAC,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,GAAE,MAAqC,GAAG,uBAAuB,EAAE;IAatM;;;;;;;OAOG;WACW,4BAA4B,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,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AC,SAAS,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;gBAC9D,SAAS,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;aAC9C;SACF;QACD,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;IACrC,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,6BAA6B,CACzC,SAAwB,EAAE,SAAwB,EAAE,WAAmB;QACvE,MAAM,OAAO,GAAG,IAAI,qDAAyB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACpE,OAAO,CAAC,mBAAmB,GAAG,WAAW,CAAC;QAC1C,SAAS,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;IACrC,CAAC;CAEF;AA/ED,gCA+EC","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\r\nimport { CurveCollection } from \"./CurveCollection\";\r\nimport { CurveCurveCloseApproachXY } from \"./CurveCurveCloseApproachXY\";\r\nimport { CurveCurveIntersectXY, CurveLocationDetailArrayPair } from \"./CurveCurveIntersectXY\";\r\nimport { CurveCurveIntersectXYZ } from \"./CurveCurveIntersectXYZ\";\r\nimport { CurveLocationDetailPair } from \"./CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\n\r\n/**\r\n * `CurveCurve` has static method for various computations that work on a pair of curves or curve collections.\r\n * @public\r\n */\r\nexport class CurveCurve {\r\n /**\r\n * Return xy intersections of 2 curves.\r\n * @param geometryA first geometry\r\n * @param extendA true to allow geometryA to extend\r\n * @param geometryB second geometry\r\n * @param extendB true to allow geometryB to extend\r\n * @param tolerance optional distance tolerance for coincidence\r\n */\r\n public static intersectionXYPairs(geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean, tolerance: number = Geometry.smallMetricDistance): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(undefined, geometryA, extendA, geometryB, extendB, tolerance);\r\n if (geometryB instanceof CurvePrimitive) {\r\n geometryA.dispatchToGeometryHandler(handler);\r\n } else if (geometryB instanceof CurveCollection) {\r\n const allCurves = geometryB.collectCurvePrimitives();\r\n for (const child of allCurves) {\r\n handler.resetGeometry(geometryA, false, child, false);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n }\r\n }\r\n return handler.grabPairedResults();\r\n }\r\n /**\r\n * Return xy intersections of 2 projected curves\r\n * @param geometryA first geometry\r\n * @param extendA true to allow geometryA to extend\r\n * @param geometryB second geometry\r\n * @param extendB true to allow geometryB to extend\r\n * @param tolerance optional distance tolerance for coincidence\r\n */\r\n public static intersectionProjectedXYPairs(worldToLocal: Matrix4d, geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean, tolerance: number = Geometry.smallMetricDistance): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(worldToLocal, geometryA, extendA, geometryB, extendB, tolerance);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n return handler.grabPairedResults();\r\n }\r\n /**\r\n * Return full 3d xyz intersections of 2 curves.\r\n * * Implemented for combinations of LineSegment3d, LineString3d, Arc3d.\r\n * * Not Implemented for bspline and bezier curves.\r\n * @beta\r\n * @param geometryA first geometry\r\n * @param extendA true to allow geometryA to extend\r\n * @param geometryB second geometry\r\n * @param extendB true to allow geometryB to extend\r\n */\r\n public static intersectionXYZ(geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean): CurveLocationDetailArrayPair {\r\n const handler = new CurveCurveIntersectXYZ(geometryA, extendA, geometryB, extendB);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n return handler.grabResults();\r\n }\r\n /**\r\n * Return xy intersections of input curves.\r\n * @param primitives input curves to intersect\r\n * @param tolerance optional distance tolerance for coincidence\r\n */\r\n public static allIntersectionsAmongPrimitivesXY(primitives: CurvePrimitive[], tolerance: number = Geometry.smallMetricDistance): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(undefined, undefined, false, undefined, false, tolerance);\r\n for (let i = 0; i < primitives.length; i++) {\r\n const geometryA = primitives[i];\r\n for (let j = i + 1; j < primitives.length; j++) {\r\n handler.resetGeometry(geometryA, false, primitives[j], false);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n }\r\n }\r\n return handler.grabPairedResults();\r\n }\r\n /**\r\n * Return xy close approaches of 2 projected curves\r\n * @param geometryA first geometry\r\n * @param geometryB second geometry\r\n */\r\n public static closeApproachProjectedXYPairs(\r\n geometryA: GeometryQuery, geometryB: GeometryQuery, maxDistance: number): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveCloseApproachXY(geometryA, geometryB);\r\n handler.maxDistanceToAccept = maxDistance;\r\n geometryA.dispatchToGeometryHandler(handler);\r\n return handler.grabPairedResults();\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"CurveCurve.js","sourceRoot":"","sources":["../../../src/curve/CurveCurve.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0CAAuC;AAEvC,uDAAoD;AACpD,2EAAwE;AACxE,mEAA8F;AAC9F,qEAAkE;AAElE,qDAAkD;AAGlD;;;GAGG;AACH,MAAa,UAAU;IACrB;;;;;;;OAOG;IACI,MAAM,CAAC,mBAAmB,CAC/B,SAAwB,EAAE,OAAgB,EAAE,SAAwB,EAAE,OAAgB,EACtF,YAAoB,mBAAQ,CAAC,mBAAmB;QAEhD,MAAM,OAAO,GAAG,IAAI,6CAAqB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,EAAE,SAAS,EAAE,OAAO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AmB;QAE9E,MAAM,OAAO,GAAG,IAAI,6CAAqB,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QACpG,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC1C,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YAChC,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9C,OAAO,CAAC,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;gBAC9D,SAAS,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;aAC9C;SACF;QACD,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;IACrC,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,6BAA6B,CACzC,SAAwB,EAAE,SAAwB,EAAE,WAAmB;QAEvE,MAAM,OAAO,GAAG,IAAI,qDAAyB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACpE,OAAO,CAAC,mBAAmB,GAAG,WAAW,CAAC;QAC1C,SAAS,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;IACrC,CAAC;CAEF;AA1FD,gCA0FC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { Geometry } from \"../Geometry\";\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\nimport { CurveCollection } from \"./CurveCollection\";\nimport { CurveCurveCloseApproachXY } from \"./CurveCurveCloseApproachXY\";\nimport { CurveCurveIntersectXY, CurveLocationDetailArrayPair } from \"./CurveCurveIntersectXY\";\nimport { CurveCurveIntersectXYZ } from \"./CurveCurveIntersectXYZ\";\nimport { CurveLocationDetailPair } from \"./CurveLocationDetail\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\nimport { GeometryQuery } from \"./GeometryQuery\";\n\n/**\n * `CurveCurve` has static method for various computations that work on a pair of curves or curve collections.\n * @public\n */\nexport class CurveCurve {\n /**\n * Return xy intersections of 2 curves.\n * @param geometryA first geometry\n * @param extendA true to allow geometryA to extend\n * @param geometryB second geometry\n * @param extendB true to allow geometryB to extend\n * @param tolerance optional distance tolerance for coincidence\n */\n public static intersectionXYPairs(\n geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean,\n tolerance: number = Geometry.smallMetricDistance\n ): CurveLocationDetailPair[] {\n const handler = new CurveCurveIntersectXY(undefined, geometryA, extendA, geometryB, extendB, tolerance);\n if (geometryB instanceof CurvePrimitive) {\n geometryA.dispatchToGeometryHandler(handler);\n } else if (geometryB instanceof CurveCollection) {\n const allCurves = geometryB.collectCurvePrimitives();\n for (const child of allCurves) {\n handler.resetGeometry(geometryA, false, child, false);\n geometryA.dispatchToGeometryHandler(handler);\n }\n }\n return handler.grabPairedResults();\n }\n /**\n * Return xy intersections of 2 projected curves\n * @param geometryA first geometry\n * @param extendA true to allow geometryA to extend\n * @param geometryB second geometry\n * @param extendB true to allow geometryB to extend\n * @param tolerance optional distance tolerance for coincidence\n */\n public static intersectionProjectedXYPairs(\n worldToLocal: Matrix4d, geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean,\n tolerance: number = Geometry.smallMetricDistance\n ): CurveLocationDetailPair[] {\n const handler = new CurveCurveIntersectXY(worldToLocal, geometryA, extendA, geometryB, extendB, tolerance);\n geometryA.dispatchToGeometryHandler(handler);\n return handler.grabPairedResults();\n }\n /**\n * Return full 3d xyz intersections of 2 curves.\n * * Implemented for combinations of LineSegment3d, LineString3d, Arc3d.\n * * Not Implemented for bspline and bezier curves.\n * @beta\n * @param geometryA first geometry\n * @param extendA true to allow geometryA to extend\n * @param geometryB second geometry\n * @param extendB true to allow geometryB to extend\n */\n public static intersectionXYZ(\n geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean\n ): CurveLocationDetailArrayPair {\n const handler = new CurveCurveIntersectXYZ(geometryA, extendA, geometryB, extendB);\n geometryA.dispatchToGeometryHandler(handler);\n return handler.grabResults();\n }\n /**\n * Return xy intersections of input curves.\n * @param primitives input curves to intersect\n * @param tolerance optional distance tolerance for coincidence\n */\n public static allIntersectionsAmongPrimitivesXY(\n primitives: CurvePrimitive[], tolerance: number = Geometry.smallMetricDistance\n ): CurveLocationDetailPair[] {\n const handler = new CurveCurveIntersectXY(undefined, undefined, false, undefined, false, tolerance);\n for (let i = 0; i < primitives.length; i++) {\n const geometryA = primitives[i];\n for (let j = i + 1; j < primitives.length; j++) {\n handler.resetGeometry(geometryA, false, primitives[j], false);\n geometryA.dispatchToGeometryHandler(handler);\n }\n }\n return handler.grabPairedResults();\n }\n /**\n * Return xy close approaches of 2 projected curves\n * @param geometryA first geometry\n * @param geometryB second geometry\n */\n public static closeApproachProjectedXYPairs(\n geometryA: GeometryQuery, geometryB: GeometryQuery, maxDistance: number\n ): CurveLocationDetailPair[] {\n const handler = new CurveCurveCloseApproachXY(geometryA, geometryB);\n handler.maxDistanceToAccept = maxDistance;\n geometryA.dispatchToGeometryHandler(handler);\n return handler.grabPairedResults();\n }\n\n}\n"]}