@itwin/core-geometry 4.2.0-dev.10 → 4.2.0-dev.12

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 (187) hide show
  1. package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts +4 -3
  2. package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
  3. package/lib/cjs/clipping/AlternatingConvexClipTree.js +1 -1
  4. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  5. package/lib/cjs/clipping/BooleanClipNode.d.ts +4 -3
  6. package/lib/cjs/clipping/BooleanClipNode.d.ts.map +1 -1
  7. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  8. package/lib/cjs/clipping/ClipPlane.d.ts +2 -1
  9. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  10. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  11. package/lib/cjs/clipping/ClipUtils.d.ts +4 -4
  12. package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
  13. package/lib/cjs/clipping/ClipUtils.js +1 -1
  14. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  15. package/lib/cjs/clipping/ClipVector.d.ts +6 -5
  16. package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
  17. package/lib/cjs/clipping/ClipVector.js +1 -1
  18. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  19. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +3 -2
  20. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  21. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  22. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +2 -1
  23. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  24. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  25. package/lib/cjs/core-geometry.d.ts +0 -2
  26. package/lib/cjs/core-geometry.d.ts.map +1 -1
  27. package/lib/cjs/core-geometry.js +0 -2
  28. package/lib/cjs/core-geometry.js.map +1 -1
  29. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  30. package/lib/cjs/curve/Arc3d.js.map +1 -1
  31. package/lib/cjs/curve/CurveCollection.d.ts +1 -1
  32. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  33. package/lib/cjs/curve/CurveCollection.js +1 -3
  34. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  35. package/lib/cjs/curve/CurveCurve.d.ts +38 -26
  36. package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
  37. package/lib/cjs/curve/CurveCurve.js +70 -40
  38. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  39. package/lib/cjs/curve/CurveLocationDetail.d.ts +12 -1
  40. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  41. package/lib/cjs/curve/CurveLocationDetail.js +13 -2
  42. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  43. package/lib/cjs/curve/{CurveCurveCloseApproachXY.d.ts → internalContexts/CurveCurveCloseApproachXY.d.ts} +89 -48
  44. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -0
  45. package/lib/cjs/curve/{CurveCurveCloseApproachXY.js → internalContexts/CurveCurveCloseApproachXY.js} +196 -155
  46. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -0
  47. package/lib/{esm/curve → cjs/curve/internalContexts}/CurveCurveIntersectXY.d.ts +14 -27
  48. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -0
  49. package/lib/cjs/curve/{CurveCurveIntersectXY.js → internalContexts/CurveCurveIntersectXY.js} +19 -32
  50. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -0
  51. package/lib/cjs/curve/{CurveCurveIntersectXYZ.d.ts → internalContexts/CurveCurveIntersectXYZ.d.ts} +11 -12
  52. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -0
  53. package/lib/cjs/curve/{CurveCurveIntersectXYZ.js → internalContexts/CurveCurveIntersectXYZ.js} +12 -14
  54. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -0
  55. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +1 -0
  56. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  57. package/lib/cjs/geometry3d/BarycentricTriangle.js +1 -0
  58. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  59. package/lib/cjs/geometry3d/FrameBuilder.d.ts +28 -11
  60. package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
  61. package/lib/cjs/geometry3d/FrameBuilder.js +57 -45
  62. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  63. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +0 -8
  64. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  65. package/lib/cjs/geometry3d/GrowableXYZArray.js +0 -16
  66. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  67. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +4 -4
  68. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  69. package/lib/cjs/geometry3d/IndexedXYZCollection.js +12 -0
  70. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  71. package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
  72. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  73. package/lib/cjs/geometry3d/PolygonOps.d.ts +1 -1
  74. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  75. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  76. package/lib/cjs/geometry3d/Ray3d.d.ts +3 -1
  77. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  78. package/lib/cjs/geometry3d/Ray3d.js +4 -3
  79. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  80. package/lib/cjs/geometry3d/ReusableObjectCache.d.ts +2 -1
  81. package/lib/cjs/geometry3d/ReusableObjectCache.d.ts.map +1 -1
  82. package/lib/cjs/geometry3d/ReusableObjectCache.js +1 -1
  83. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  84. package/lib/cjs/numerics/Polynomials.d.ts +2 -2
  85. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  86. package/lib/cjs/numerics/Polynomials.js +2 -2
  87. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  88. package/lib/esm/clipping/AlternatingConvexClipTree.d.ts +4 -3
  89. package/lib/esm/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
  90. package/lib/esm/clipping/AlternatingConvexClipTree.js +1 -1
  91. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  92. package/lib/esm/clipping/BooleanClipNode.d.ts +4 -3
  93. package/lib/esm/clipping/BooleanClipNode.d.ts.map +1 -1
  94. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  95. package/lib/esm/clipping/ClipPlane.d.ts +2 -1
  96. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  97. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  98. package/lib/esm/clipping/ClipUtils.d.ts +4 -4
  99. package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
  100. package/lib/esm/clipping/ClipUtils.js +1 -1
  101. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  102. package/lib/esm/clipping/ClipVector.d.ts +6 -5
  103. package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
  104. package/lib/esm/clipping/ClipVector.js +1 -1
  105. package/lib/esm/clipping/ClipVector.js.map +1 -1
  106. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +3 -2
  107. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  108. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  109. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +2 -1
  110. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  111. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  112. package/lib/esm/core-geometry.d.ts +0 -2
  113. package/lib/esm/core-geometry.d.ts.map +1 -1
  114. package/lib/esm/core-geometry.js +0 -2
  115. package/lib/esm/core-geometry.js.map +1 -1
  116. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  117. package/lib/esm/curve/Arc3d.js.map +1 -1
  118. package/lib/esm/curve/CurveCollection.d.ts +1 -1
  119. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  120. package/lib/esm/curve/CurveCollection.js +1 -3
  121. package/lib/esm/curve/CurveCollection.js.map +1 -1
  122. package/lib/esm/curve/CurveCurve.d.ts +38 -26
  123. package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
  124. package/lib/esm/curve/CurveCurve.js +70 -40
  125. package/lib/esm/curve/CurveCurve.js.map +1 -1
  126. package/lib/esm/curve/CurveLocationDetail.d.ts +12 -1
  127. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  128. package/lib/esm/curve/CurveLocationDetail.js +11 -1
  129. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  130. package/lib/esm/curve/{CurveCurveCloseApproachXY.d.ts → internalContexts/CurveCurveCloseApproachXY.d.ts} +89 -48
  131. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -0
  132. package/lib/esm/curve/{CurveCurveCloseApproachXY.js → internalContexts/CurveCurveCloseApproachXY.js} +196 -155
  133. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -0
  134. package/lib/{cjs/curve → esm/curve/internalContexts}/CurveCurveIntersectXY.d.ts +14 -27
  135. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -0
  136. package/lib/esm/curve/{CurveCurveIntersectXY.js → internalContexts/CurveCurveIntersectXY.js} +18 -30
  137. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -0
  138. package/lib/esm/curve/{CurveCurveIntersectXYZ.d.ts → internalContexts/CurveCurveIntersectXYZ.d.ts} +11 -12
  139. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -0
  140. package/lib/esm/curve/{CurveCurveIntersectXYZ.js → internalContexts/CurveCurveIntersectXYZ.js} +11 -13
  141. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -0
  142. package/lib/esm/geometry3d/BarycentricTriangle.d.ts +1 -0
  143. package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  144. package/lib/esm/geometry3d/BarycentricTriangle.js +1 -0
  145. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  146. package/lib/esm/geometry3d/FrameBuilder.d.ts +28 -11
  147. package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
  148. package/lib/esm/geometry3d/FrameBuilder.js +57 -45
  149. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  150. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +0 -8
  151. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  152. package/lib/esm/geometry3d/GrowableXYZArray.js +0 -16
  153. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  154. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +4 -4
  155. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  156. package/lib/esm/geometry3d/IndexedXYZCollection.js +12 -0
  157. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  158. package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
  159. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  160. package/lib/esm/geometry3d/PolygonOps.d.ts +1 -1
  161. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  162. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  163. package/lib/esm/geometry3d/Ray3d.d.ts +3 -1
  164. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  165. package/lib/esm/geometry3d/Ray3d.js +4 -3
  166. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  167. package/lib/esm/geometry3d/ReusableObjectCache.d.ts +2 -1
  168. package/lib/esm/geometry3d/ReusableObjectCache.d.ts.map +1 -1
  169. package/lib/esm/geometry3d/ReusableObjectCache.js +1 -1
  170. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  171. package/lib/esm/numerics/Polynomials.d.ts +2 -2
  172. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  173. package/lib/esm/numerics/Polynomials.js +2 -2
  174. package/lib/esm/numerics/Polynomials.js.map +1 -1
  175. package/package.json +3 -3
  176. package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts.map +0 -1
  177. package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +0 -1
  178. package/lib/cjs/curve/CurveCurveIntersectXY.d.ts.map +0 -1
  179. package/lib/cjs/curve/CurveCurveIntersectXY.js.map +0 -1
  180. package/lib/cjs/curve/CurveCurveIntersectXYZ.d.ts.map +0 -1
  181. package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +0 -1
  182. package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts.map +0 -1
  183. package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +0 -1
  184. package/lib/esm/curve/CurveCurveIntersectXY.d.ts.map +0 -1
  185. package/lib/esm/curve/CurveCurveIntersectXY.js.map +0 -1
  186. package/lib/esm/curve/CurveCurveIntersectXYZ.d.ts.map +0 -1
  187. package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CurveCollection.js","sourceRoot":"","sources":["../../../src/curve/CurveCollection.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,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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;AAED;;;GAGG;AACH,MAAM,OAAO,yCAAyC;IAAtD;QACE,8GAA8G;QACvG,8BAAyB,GAAY,IAAI,CAAC;QACjD,0CAA0C;QACnC,8BAAyB,GAAY,IAAI,CAAC;QACjD,gDAAgD;QACzC,4BAAuB,GAAG,QAAQ,CAAC,mBAAmB,CAAC;QAC9D,uDAAuD;QAChD,2BAAsB,GAAG,QAAQ,CAAC,mBAAmB,CAAC;IAC/D,CAAC;CAAA","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/**\r\n * Describes the concrete type of a [[CurveCollection]]. Each type name maps to a specific subclass and can be\r\n * 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.\r\n * The two instantiable forms of `CurveChain` are\r\n * - `Path` - A chain not required to close and not enclosing a planar area (so curves do not have to be on the\r\n * same plane).\r\n * - `Loop` - A chain required to close from last to first so that a planar area is enclosed (so curves have to\r\n * be on the same plane).\r\n * - `ParityRegion` -- a collection of coplanar `Loop`, with \"in/out\" classification by parity rules.\r\n * - `UnionRegion` -- a collection of coplanar `Loop` and/or `ParityRegion`, 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 /* 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 {\r\n return SumLengthsContext.sumLengths(this);\r\n }\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 * * 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\r\n * \"unstructured\" so gaps should not be semantically meaningful.\r\n */\r\n public maxGap(): number {\r\n return GapSearchContext.maxGap(this);\r\n }\r\n /** Return true if the curve collection has any primitives other than LineSegment3d and LineString3d */\r\n public checkForNonLinearPrimitives(): boolean {\r\n return CountLinearPartsSearchContext.hasNonLinearPrimitives(this);\r\n }\r\n /** Apply transform recursively to children */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n return TransformInPlaceContext.tryTransformInPlace(this, transform);\r\n }\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 broken down into multiple LineSegment3d. */\r\n public cloneWithExpandedLineStrings(): CurveCollection {\r\n return CloneWithExpandedLineStrings.clone(this);\r\n }\r\n /**\r\n * Push all CurvePrimitives contained in the instance onto the `results` array.\r\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives\r\n * of the Loop are pushed onto `results`.\r\n */\r\n private collectCurvePrimitivesGo(\r\n results: CurvePrimitive[], smallestPossiblePrimitives: boolean, explodeLinestrings: boolean = false,\r\n ): void {\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 * Return an array containing all CurvePrimitives in the instance.\r\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives of\r\n * the Loop are pushed onto the returned array.\r\n * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without\r\n * clearing the array).\r\n * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,\r\n * it recurses to its (otherwise hidden) children.\r\n */\r\n public collectCurvePrimitives(\r\n collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLineStrings: boolean = false,\r\n ): CurvePrimitive[] {\r\n const results: CurvePrimitive[] = collectorArray === undefined ? [] : collectorArray;\r\n this.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLineStrings);\r\n return results;\r\n }\r\n /**\r\n * 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() === 4 || this.dgnBoundaryType() === 5;\r\n }\r\n /** Return true for a `Path`, i.e. a chain of curves joined head-to-tail */\r\n public get isOpenPath(): boolean {\r\n return this.dgnBoundaryType() === 1;\r\n }\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 /** 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 /**\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 /**\r\n * Extend (increase) the given range as needed to encompass all curves in the curve collection.\r\n * @param rangeToExtend the given range.\r\n * @param transform if supplied, the range is extended with transformed curves.\r\n */\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 CurvePrimitive in the source and evaluate it at the given fraction.\r\n * * The first CurvePrimitive found is evaluated. Any other CurvePrimitives are ignored.\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(\r\n source: GeometryQuery | undefined, fraction: number = 0.5,\r\n ): 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 /**\r\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters\r\n * of projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\r\n * end of the ray.\r\n */\r\n public projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\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 * * The specific derived classes are `Path` and `Loop`\r\n * * `CurveChain` is an intermediate class. It is not instantiable on its own.\r\n * * The related class `CurveChainWithDistanceIndex` is a `CurvePrimitive` whose API presents well-defined mappings\r\n * from fraction to xyz over the entire chain, but in fact does all the calculations over multiple primitives.\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 /** Constructor */\r\n protected constructor() {\r\n super();\r\n this._curves = [];\r\n }\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 curve primitive at the given `index`, 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 if (index >= 0 && index < n) // try simplest non-cyclic access first\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 /**\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 /**\r\n * The object returned by \"cloneStroked\" has the same type (Loop or Path) but instead of a chain of\r\n * CurvePrimitives as children, it has a single LineString3d child. \"getPackedStrokes\" just returns\r\n * the points of that LineString3d using \"packedPoints\".\r\n */\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 /**\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(): void {\r\n for (const curve of this._curves)\r\n curve.reverseInPlace();\r\n this._curves.reverse();\r\n }\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 public primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(\r\n index: number, fraction: number, cyclic: boolean = false, result?: CurveLocationDetail,\r\n ): 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 /** Test if `other` is an instance of `BagOfCurves` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof BagOfCurves;\r\n }\r\n /**\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() {\r\n super();\r\n this._children = [];\r\n }\r\n /** Return the (reference to) array of children */\r\n public override get children(): AnyCurve[] {\r\n return this._children;\r\n }\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 {\r\n return 0;\r\n }\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 {\r\n return new BagOfCurves();\r\n }\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/**\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,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAQvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OAAO,EAAE,4BAA4B,EAAE,MAAM,iDAAiD,CAAC;AAC/F,OAAO,EAAE,6BAA6B,EAAE,MAAM,kDAAkD,CAAC;AACjG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,4CAA4C,CAAC;AACrF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAe1C;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAgB,eAAgB,SAAQ,aAAa;IAA3D;;QACE,wCAAwC;QACxB,qBAAgB,GAAG,iBAAiB,CAAC;QAGrD,mEAAmE;QACnE,uDAAuD;QAChD,YAAO,GAAY,KAAK,CAAC;IAwKlC,CAAC;IAvKC,6DA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K,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;aAC3B;iBAAM,IAAI,KAAK,YAAY,eAAe,EAAE;gBAC3C,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;gBACjD,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;AAED;;;GAGG;AACH,MAAM,OAAO,yCAAyC;IAAtD;QACE,8GAA8G;QACvG,8BAAyB,GAAY,IAAI,CAAC;QACjD,0CAA0C;QACnC,8BAAyB,GAAY,IAAI,CAAC;QACjD,gDAAgD;QACzC,4BAAuB,GAAG,QAAQ,CAAC,mBAAmB,CAAC;QAC9D,uDAAuD;QAChD,2BAAsB,GAAG,QAAQ,CAAC,mBAAmB,CAAC;IAC/D,CAAC;CAAA","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/**\r\n * Describes the concrete type of a [[CurveCollection]]. Each type name maps to a specific subclass and can be\r\n * 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.\r\n * The two instantiable forms of `CurveChain` are\r\n * - `Path` - A chain not required to close and not enclosing a planar area (so curves do not have to be on the\r\n * same plane).\r\n * - `Loop` - A chain required to close from last to first so that a planar area is enclosed (so curves have to\r\n * be on the same plane).\r\n * - `ParityRegion` -- a collection of coplanar `Loop`, with \"in/out\" classification by parity rules.\r\n * - `UnionRegion` -- a collection of coplanar `Loop` and/or `ParityRegion`, 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 /* 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 {\r\n return SumLengthsContext.sumLengths(this);\r\n }\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 * * 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\r\n * \"unstructured\" so gaps should not be semantically meaningful.\r\n */\r\n public maxGap(): number {\r\n return GapSearchContext.maxGap(this);\r\n }\r\n /** Return true if the curve collection has any primitives other than LineSegment3d and LineString3d */\r\n public checkForNonLinearPrimitives(): boolean {\r\n return CountLinearPartsSearchContext.hasNonLinearPrimitives(this);\r\n }\r\n /** Apply transform recursively to children */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n return TransformInPlaceContext.tryTransformInPlace(this, transform);\r\n }\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 broken down into multiple LineSegment3d. */\r\n public cloneWithExpandedLineStrings(): CurveCollection {\r\n return CloneWithExpandedLineStrings.clone(this);\r\n }\r\n /**\r\n * Push all CurvePrimitives contained in the instance onto the `results` array.\r\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives\r\n * of the Loop are pushed onto `results`.\r\n */\r\n private collectCurvePrimitivesGo(\r\n results: CurvePrimitive[], smallestPossiblePrimitives: boolean, explodeLinestrings: boolean = false,\r\n ): void {\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 * Return an array containing all CurvePrimitives in the instance.\r\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives of\r\n * the Loop are pushed onto the returned array.\r\n * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without\r\n * clearing the array).\r\n * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,\r\n * it recurses to its (otherwise hidden) children.\r\n */\r\n public collectCurvePrimitives(\r\n collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLineStrings: boolean = false,\r\n ): CurvePrimitive[] {\r\n const results: CurvePrimitive[] = collectorArray === undefined ? [] : collectorArray;\r\n this.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLineStrings);\r\n return results;\r\n }\r\n /**\r\n * 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() === 4 || this.dgnBoundaryType() === 5;\r\n }\r\n /** Return true for a `Path`, i.e. a chain of curves joined head-to-tail */\r\n public get isOpenPath(): boolean {\r\n return this.dgnBoundaryType() === 1;\r\n }\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 /** 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 /**\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 /**\r\n * Extend (increase) the given range as needed to encompass all curves in the curve collection.\r\n * @param rangeToExtend the given range.\r\n * @param transform if supplied, the range is extended with transformed curves.\r\n */\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 CurvePrimitive in the source and evaluate it at the given fraction.\r\n * * The first CurvePrimitive found is evaluated. Any other CurvePrimitives are ignored.\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(\r\n source: GeometryQuery | undefined, fraction: number = 0.5,\r\n ): 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 /**\r\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters\r\n * of projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\r\n * end of the ray.\r\n */\r\n public projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\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 * * The specific derived classes are `Path` and `Loop`.\r\n * * `CurveChain` is an intermediate class. It is not instantiable on its own.\r\n * * The related class `CurveChainWithDistanceIndex` is a `CurvePrimitive` whose API presents well-defined mappings\r\n * from fraction to xyz over the entire chain, but in fact does all the calculations over multiple primitives.\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 /** Constructor */\r\n protected constructor() {\r\n super();\r\n this._curves = [];\r\n }\r\n /** Return the array of `CurvePrimitive` */\r\n public override get children(): CurvePrimitive[] {\r\n return this._curves;\r\n }\r\n /**\r\n * Return the curve primitive at the given `index`, 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 if (index >= 0 && index < n) // try simplest non-cyclic access first\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 /**\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 /**\r\n * The object returned by \"cloneStroked\" has the same type (Loop or Path) but instead of a chain of\r\n * CurvePrimitives as children, it has a single LineString3d child. \"getPackedStrokes\" just returns\r\n * the points of that LineString3d using \"packedPoints\".\r\n */\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 /**\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(): void {\r\n for (const curve of this._curves)\r\n curve.reverseInPlace();\r\n this._curves.reverse();\r\n }\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 public primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(\r\n index: number, fraction: number, cyclic: boolean = false, result?: CurveLocationDetail,\r\n ): 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 /** Test if `other` is an instance of `BagOfCurves` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof BagOfCurves;\r\n }\r\n /**\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() {\r\n super();\r\n this._children = [];\r\n }\r\n /** Return the (reference to) array of children */\r\n public override get children(): AnyCurve[] {\r\n return this._children;\r\n }\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 {\r\n return 0;\r\n }\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 {\r\n return new BagOfCurves();\r\n }\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/**\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"]}
@@ -2,10 +2,9 @@
2
2
  * @module Curve
3
3
  */
4
4
  import { Matrix4d } from "../geometry4d/Matrix4d";
5
- import { CurveLocationDetailArrayPair } from "./CurveCurveIntersectXY";
6
- import { CurveLocationDetailPair } from "./CurveLocationDetail";
5
+ import { CurveLocationDetailArrayPair, CurveLocationDetailPair } from "./CurveLocationDetail";
7
6
  import { CurvePrimitive } from "./CurvePrimitive";
8
- import { GeometryQuery } from "./GeometryQuery";
7
+ import { AnyCurve } from "./CurveChain";
9
8
  /**
10
9
  * `CurveCurve` has static method for various computations that work on a pair of curves or curve collections.
11
10
  * @public
@@ -13,36 +12,33 @@ import { GeometryQuery } from "./GeometryQuery";
13
12
  export declare class CurveCurve {
14
13
  /**
15
14
  * Return xy intersections of 2 curves.
16
- * * **NOTE:** GeometryQuery inputs should really be AnyCurve.
17
- * @param geometryA first geometry
18
- * @param extendA true to allow geometryA to extend
19
- * @param geometryB second geometry
20
- * @param extendB true to allow geometryB to extend
15
+ * @param curveA first curve
16
+ * @param extendA true to allow curveA to extend
17
+ * @param curveB second curve
18
+ * @param extendB true to allow curveB to extend
21
19
  * @param tolerance optional distance tolerance for coincidence
22
20
  */
23
- static intersectionXYPairs(geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean, tolerance?: number): CurveLocationDetailPair[];
21
+ static intersectionXYPairs(curveA: AnyCurve, extendA: boolean, curveB: AnyCurve, extendB: boolean, tolerance?: number): CurveLocationDetailPair[];
24
22
  /**
25
23
  * Return xy intersections of 2 projected curves.
26
- * * **NOTE:** GeometryQuery inputs should really be AnyCurve.
27
- * @param geometryA first geometry
28
- * @param extendA true to allow geometryA to extend
29
- * @param geometryB second geometry
30
- * @param extendB true to allow geometryB to extend
24
+ * @param curveA first curve
25
+ * @param extendA true to allow curveA to extend
26
+ * @param curveB second curve
27
+ * @param extendB true to allow curveB to extend
31
28
  * @param tolerance optional distance tolerance for coincidence
32
29
  */
33
- static intersectionProjectedXYPairs(worldToLocal: Matrix4d, geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean, tolerance?: number): CurveLocationDetailPair[];
30
+ static intersectionProjectedXYPairs(worldToLocal: Matrix4d, curveA: AnyCurve, extendA: boolean, curveB: AnyCurve, extendB: boolean, tolerance?: number): CurveLocationDetailPair[];
34
31
  /**
35
32
  * Return full 3d xyz intersections of 2 curves.
36
33
  * * Implemented for combinations of LineSegment3d, LineString3d, Arc3d.
37
34
  * * Not Implemented for bspline and bezier curves.
38
- * * **NOTE:** GeometryQuery inputs should really be AnyCurve.
39
35
  * @beta
40
- * @param geometryA first geometry
41
- * @param extendA true to allow geometryA to extend
42
- * @param geometryB second geometry
43
- * @param extendB true to allow geometryB to extend
36
+ * @param curveA first curve
37
+ * @param extendA true to allow curveA to extend
38
+ * @param curveB second curve
39
+ * @param extendB true to allow curveB to extend
44
40
  */
45
- static intersectionXYZ(geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean): CurveLocationDetailArrayPair;
41
+ static intersectionXYZ(curveA: AnyCurve, extendA: boolean, curveB: AnyCurve, extendB: boolean): CurveLocationDetailArrayPair;
46
42
  /**
47
43
  * Return xy intersections of input curves.
48
44
  * @param primitives input curves to intersect
@@ -50,11 +46,27 @@ export declare class CurveCurve {
50
46
  */
51
47
  static allIntersectionsAmongPrimitivesXY(primitives: CurvePrimitive[], tolerance?: number): CurveLocationDetailPair[];
52
48
  /**
53
- * Return xy close approaches of 2 projected curves.
54
- * * **NOTE:** GeometryQuery inputs should really be AnyCurve.
55
- * @param geometryA first geometry
56
- * @param geometryB second geometry
49
+ * Return at least one XY close approach between 2 curves.
50
+ * * Close approach xy-distances are measured without regard to z. This is equivalent to their separation distance
51
+ * as seen in the top view, or as measured between their projections onto the xy-plane.
52
+ * * If more than one approach is returned, one of them is the closest approach.
53
+ * @param curveA first curve
54
+ * @param curveB second curve
55
+ * @param maxDistance maximum xy-distance to consider between the curves.
56
+ * Close approaches further than this xy-distance are not returned.
57
57
  */
58
- static closeApproachProjectedXYPairs(geometryA: GeometryQuery, geometryB: GeometryQuery, maxDistance: number): CurveLocationDetailPair[];
58
+ static closeApproachProjectedXYPairs(curveA: AnyCurve, curveB: AnyCurve, maxDistance: number): CurveLocationDetailPair[];
59
+ /**
60
+ * Convenience method that calls [[closeApproachProjectedXYPairs]] with a large `maxDistance`
61
+ * and returns a detail pair representing the closest xy-approach between the curves.
62
+ * * There may be many detail pairs that represent "closest" xy-approach, including coincident interval pairs,
63
+ * isolated intersections, or close approaches within tolerance of each other. This method makes no attempt to
64
+ * distinguish among them, and returns a pair whose `detail.point` values are separated by the smallest xy distance
65
+ * found among the pairs.
66
+ * @param curveA first curve
67
+ * @param curveB second curve
68
+ * @return detail pair of closest xy-approach, undefined if not found
69
+ */
70
+ static closestApproachProjectedXYPair(curveA: AnyCurve, curveB: AnyCurve): CurveLocationDetailPair | undefined;
59
71
  }
60
72
  //# sourceMappingURL=CurveCurve.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurveCurve.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveCurve.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAA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M,uBAAuB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAExC;;;GAGG;AACH,qBAAa,UAAU;IACrB;;;;;;;OAOG;WACW,mBAAmB,CAC/B,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,OAAO,EAChB,SAAS,GAAE,MAAqC,GAC/C,uBAAuB,EAAE;IAa5B;;;;;;;OAOG;WACW,4BAA4B,CACxC,YAAY,EAAE,QAAQ,EACtB,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,QAAQ,EAChB,OAAO,EAAE,OAAO,EAChB,SAAS,GAAE,MAAqC,GAC/C,uBAAuB,EAAE;IAK5B;;;;;;;;;OASG;WACW,eAAe,CAC3B,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GACrE,4BAA4B;IAK/B;;;;OAIG;WACW,iCAAiC,CAC7C,UAAU,EAAE,cAAc,EAAE,EAAE,SAAS,GAAE,MAAqC,GAC7E,uBAAuB,EAAE;IAW5B;;;;;;;;;OASG;WACW,6BAA6B,CACzC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GACtD,uBAAuB,EAAE;IAM5B;;;;;;;;;;OAUG;WACW,8BAA8B,CAAC,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,GAAG,uBAAuB,GAAG,SAAS;CAkBtH"}
@@ -7,9 +7,9 @@
7
7
  */
8
8
  import { Geometry } from "../Geometry";
9
9
  import { CurveCollection } from "./CurveCollection";
10
- import { CurveCurveCloseApproachXY } from "./CurveCurveCloseApproachXY";
11
- import { CurveCurveIntersectXY } from "./CurveCurveIntersectXY";
12
- import { CurveCurveIntersectXYZ } from "./CurveCurveIntersectXYZ";
10
+ import { CurveCurveCloseApproachXY } from "./internalContexts/CurveCurveCloseApproachXY";
11
+ import { CurveCurveIntersectXY } from "./internalContexts/CurveCurveIntersectXY";
12
+ import { CurveCurveIntersectXYZ } from "./internalContexts/CurveCurveIntersectXYZ";
13
13
  import { CurvePrimitive } from "./CurvePrimitive";
14
14
  /**
15
15
  * `CurveCurve` has static method for various computations that work on a pair of curves or curve collections.
@@ -18,55 +18,52 @@ import { CurvePrimitive } from "./CurvePrimitive";
18
18
  export class CurveCurve {
19
19
  /**
20
20
  * Return xy intersections of 2 curves.
21
- * * **NOTE:** GeometryQuery inputs should really be AnyCurve.
22
- * @param geometryA first geometry
23
- * @param extendA true to allow geometryA to extend
24
- * @param geometryB second geometry
25
- * @param extendB true to allow geometryB to extend
21
+ * @param curveA first curve
22
+ * @param extendA true to allow curveA to extend
23
+ * @param curveB second curve
24
+ * @param extendB true to allow curveB to extend
26
25
  * @param tolerance optional distance tolerance for coincidence
27
26
  */
28
- static intersectionXYPairs(geometryA, extendA, geometryB, extendB, tolerance = Geometry.smallMetricDistance) {
29
- const handler = new CurveCurveIntersectXY(undefined, extendA, geometryB, extendB, tolerance);
30
- if (geometryB instanceof CurvePrimitive) {
31
- geometryA.dispatchToGeometryHandler(handler);
27
+ static intersectionXYPairs(curveA, extendA, curveB, extendB, tolerance = Geometry.smallMetricDistance) {
28
+ const handler = new CurveCurveIntersectXY(undefined, extendA, curveB, extendB, tolerance);
29
+ if (curveB instanceof CurvePrimitive) {
30
+ curveA.dispatchToGeometryHandler(handler);
32
31
  }
33
- else if (geometryB instanceof CurveCollection) {
34
- const allCurves = geometryB.collectCurvePrimitives();
32
+ else if (curveB instanceof CurveCollection) {
33
+ const allCurves = curveB.collectCurvePrimitives();
35
34
  for (const child of allCurves) {
36
35
  handler.resetGeometry(false, child, false);
37
- geometryA.dispatchToGeometryHandler(handler);
36
+ curveA.dispatchToGeometryHandler(handler);
38
37
  }
39
38
  }
40
39
  return handler.grabPairedResults();
41
40
  }
42
41
  /**
43
42
  * Return xy intersections of 2 projected curves.
44
- * * **NOTE:** GeometryQuery inputs should really be AnyCurve.
45
- * @param geometryA first geometry
46
- * @param extendA true to allow geometryA to extend
47
- * @param geometryB second geometry
48
- * @param extendB true to allow geometryB to extend
43
+ * @param curveA first curve
44
+ * @param extendA true to allow curveA to extend
45
+ * @param curveB second curve
46
+ * @param extendB true to allow curveB to extend
49
47
  * @param tolerance optional distance tolerance for coincidence
50
48
  */
51
- static intersectionProjectedXYPairs(worldToLocal, geometryA, extendA, geometryB, extendB, tolerance = Geometry.smallMetricDistance) {
52
- const handler = new CurveCurveIntersectXY(worldToLocal, extendA, geometryB, extendB, tolerance);
53
- geometryA.dispatchToGeometryHandler(handler);
49
+ static intersectionProjectedXYPairs(worldToLocal, curveA, extendA, curveB, extendB, tolerance = Geometry.smallMetricDistance) {
50
+ const handler = new CurveCurveIntersectXY(worldToLocal, extendA, curveB, extendB, tolerance);
51
+ curveA.dispatchToGeometryHandler(handler);
54
52
  return handler.grabPairedResults();
55
53
  }
56
54
  /**
57
55
  * Return full 3d xyz intersections of 2 curves.
58
56
  * * Implemented for combinations of LineSegment3d, LineString3d, Arc3d.
59
57
  * * Not Implemented for bspline and bezier curves.
60
- * * **NOTE:** GeometryQuery inputs should really be AnyCurve.
61
58
  * @beta
62
- * @param geometryA first geometry
63
- * @param extendA true to allow geometryA to extend
64
- * @param geometryB second geometry
65
- * @param extendB true to allow geometryB to extend
59
+ * @param curveA first curve
60
+ * @param extendA true to allow curveA to extend
61
+ * @param curveB second curve
62
+ * @param extendB true to allow curveB to extend
66
63
  */
67
- static intersectionXYZ(geometryA, extendA, geometryB, extendB) {
68
- const handler = new CurveCurveIntersectXYZ(extendA, geometryB, extendB);
69
- geometryA.dispatchToGeometryHandler(handler);
64
+ static intersectionXYZ(curveA, extendA, curveB, extendB) {
65
+ const handler = new CurveCurveIntersectXYZ(extendA, curveB, extendB);
66
+ curveA.dispatchToGeometryHandler(handler);
70
67
  return handler.grabResults();
71
68
  }
72
69
  /**
@@ -77,25 +74,58 @@ export class CurveCurve {
77
74
  static allIntersectionsAmongPrimitivesXY(primitives, tolerance = Geometry.smallMetricDistance) {
78
75
  const handler = new CurveCurveIntersectXY(undefined, false, undefined, false, tolerance);
79
76
  for (let i = 0; i < primitives.length; i++) {
80
- const geometryA = primitives[i];
77
+ const curveA = primitives[i];
81
78
  for (let j = i + 1; j < primitives.length; j++) {
82
79
  handler.resetGeometry(false, primitives[j], false);
83
- geometryA.dispatchToGeometryHandler(handler);
80
+ curveA.dispatchToGeometryHandler(handler);
84
81
  }
85
82
  }
86
83
  return handler.grabPairedResults();
87
84
  }
88
85
  /**
89
- * Return xy close approaches of 2 projected curves.
90
- * * **NOTE:** GeometryQuery inputs should really be AnyCurve.
91
- * @param geometryA first geometry
92
- * @param geometryB second geometry
86
+ * Return at least one XY close approach between 2 curves.
87
+ * * Close approach xy-distances are measured without regard to z. This is equivalent to their separation distance
88
+ * as seen in the top view, or as measured between their projections onto the xy-plane.
89
+ * * If more than one approach is returned, one of them is the closest approach.
90
+ * @param curveA first curve
91
+ * @param curveB second curve
92
+ * @param maxDistance maximum xy-distance to consider between the curves.
93
+ * Close approaches further than this xy-distance are not returned.
93
94
  */
94
- static closeApproachProjectedXYPairs(geometryA, geometryB, maxDistance) {
95
- const handler = new CurveCurveCloseApproachXY(geometryB);
95
+ static closeApproachProjectedXYPairs(curveA, curveB, maxDistance) {
96
+ const handler = new CurveCurveCloseApproachXY(curveB);
96
97
  handler.maxDistanceToAccept = maxDistance;
97
- geometryA.dispatchToGeometryHandler(handler);
98
+ curveA.dispatchToGeometryHandler(handler);
98
99
  return handler.grabPairedResults();
99
100
  }
101
+ /**
102
+ * Convenience method that calls [[closeApproachProjectedXYPairs]] with a large `maxDistance`
103
+ * and returns a detail pair representing the closest xy-approach between the curves.
104
+ * * There may be many detail pairs that represent "closest" xy-approach, including coincident interval pairs,
105
+ * isolated intersections, or close approaches within tolerance of each other. This method makes no attempt to
106
+ * distinguish among them, and returns a pair whose `detail.point` values are separated by the smallest xy distance
107
+ * found among the pairs.
108
+ * @param curveA first curve
109
+ * @param curveB second curve
110
+ * @return detail pair of closest xy-approach, undefined if not found
111
+ */
112
+ static closestApproachProjectedXYPair(curveA, curveB) {
113
+ const range = curveA.range();
114
+ range.extendRange(curveB.range());
115
+ const maxDistance = range.low.distanceXY(range.high);
116
+ const closeApproaches = this.closeApproachProjectedXYPairs(curveA, curveB, maxDistance);
117
+ if (!closeApproaches.length)
118
+ return undefined;
119
+ let iMin = 0;
120
+ let minDistXY = 2 * maxDistance;
121
+ for (let i = 0; i < closeApproaches.length; ++i) {
122
+ const distXY = closeApproaches[i].detailA.point.distanceXY(closeApproaches[i].detailB.point);
123
+ if (distXY < minDistXY) {
124
+ iMin = i;
125
+ minDistXY = distXY;
126
+ }
127
+ }
128
+ return closeApproaches[iMin];
129
+ }
100
130
  }
101
131
  //# sourceMappingURL=CurveCurve.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurveCurve.js","sourceRoot":"","sources":["../../../src/curve/CurveCurve.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAgC,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;GAGG;AACH,MAAM,OAAO,UAAU;IACrB;;;;;;;;OAQG;IACI,MAAM,CAAC,mBAAmB,CAC/B,SAAwB,EAAE,OAAgB,EAAE,SAAwB,EAAE,OAAgB,EACtF,YAAoB,QAAQ,CAAC,mBAAmB;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AAiC,CAC7C,UAA4B,EAAE,YAAoB,QAAQ,CAAC,mBAAmB;QAE9E,MAAM,OAAO,GAAG,IAAI,qBAAqB,CAAC,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QACzF,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,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;gBACnD,SAAS,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;aAC9C;SACF;QACD,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;IACrC,CAAC;IACD;;;;;OAKG;IACI,MAAM,CAAC,6BAA6B,CACzC,SAAwB,EAAE,SAAwB,EAAE,WAAmB;QAEvE,MAAM,OAAO,GAAG,IAAI,yBAAyB,CAAC,SAAS,CAAC,CAAC;QACzD,OAAO,CAAC,mBAAmB,GAAG,WAAW,CAAC;QAC1C,SAAS,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;IACrC,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\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 * * **NOTE:** GeometryQuery inputs should really be AnyCurve.\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(\r\n geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean,\r\n tolerance: number = Geometry.smallMetricDistance,\r\n ): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(undefined, 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(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 * * **NOTE:** GeometryQuery inputs should really be AnyCurve.\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(\r\n worldToLocal: Matrix4d, geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean,\r\n tolerance: number = Geometry.smallMetricDistance,\r\n ): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(worldToLocal, 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 * * **NOTE:** GeometryQuery inputs should really be AnyCurve.\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(\r\n geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean,\r\n ): CurveLocationDetailArrayPair {\r\n const handler = new CurveCurveIntersectXYZ(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(\r\n primitives: CurvePrimitive[], tolerance: number = Geometry.smallMetricDistance,\r\n ): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(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(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 * * **NOTE:** GeometryQuery inputs should really be AnyCurve.\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,\r\n ): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveCloseApproachXY(geometryB);\r\n handler.maxDistanceToAccept = maxDistance;\r\n geometryA.dispatchToGeometryHandler(handler);\r\n return handler.grabPairedResults();\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,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AACzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,0CAA0C,CAAC;AACjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAEnF,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;GAGG;AACH,MAAM,OAAO,UAAU;IACrB;;;;;;;OAOG;IACI,MAAM,CAAC,mBAAmB,CAC/B,MAAgB,EAChB,OAAgB,EAChB,MAAgB,EAChB,OAAgB,EAChB,YAAoB,QAAQ,CAAC,mBAAmB;QAEhD,MAAM,OAAO,GAAG,IAAI,qBAAqB,CAAC,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC;QAC1F,IAAI,MAAM,YAAY,cAAc,EAAE;YACpC,MAAM,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;SAC3C;aAAM,IAAI,MAAM,YAAY,eAAe,EAAE;YAC5C,MAAM,SAAS,GAAG,MAAM,CAAC,sBAAsB,EAAE,CAAC;YAClD,KAAK,MAAM,KAAK,IAAI,SAAS,EAAE;gBAC7B,OAAO,CAAC,aAAa,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;gBAC3C,MAAM,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;aAC3C;SACF;QACD,OAAO,OAAO,CAAC,iBA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AAE;gBACtB,IAAI,GAAG,CAAC,CAAC;gBACT,SAAS,GAAG,MAAM,CAAC;aACpB;SACF;QACD,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\r\nimport { CurveCollection } from \"./CurveCollection\";\r\nimport { CurveCurveCloseApproachXY } from \"./internalContexts/CurveCurveCloseApproachXY\";\r\nimport { CurveCurveIntersectXY } from \"./internalContexts/CurveCurveIntersectXY\";\r\nimport { CurveCurveIntersectXYZ } from \"./internalContexts/CurveCurveIntersectXYZ\";\r\nimport { CurveLocationDetailArrayPair, CurveLocationDetailPair } from \"./CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { AnyCurve } from \"./CurveChain\";\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 curveA first curve\r\n * @param extendA true to allow curveA to extend\r\n * @param curveB second curve\r\n * @param extendB true to allow curveB to extend\r\n * @param tolerance optional distance tolerance for coincidence\r\n */\r\n public static intersectionXYPairs(\r\n curveA: AnyCurve,\r\n extendA: boolean,\r\n curveB: AnyCurve,\r\n extendB: boolean,\r\n tolerance: number = Geometry.smallMetricDistance,\r\n ): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(undefined, extendA, curveB, extendB, tolerance);\r\n if (curveB instanceof CurvePrimitive) {\r\n curveA.dispatchToGeometryHandler(handler);\r\n } else if (curveB instanceof CurveCollection) {\r\n const allCurves = curveB.collectCurvePrimitives();\r\n for (const child of allCurves) {\r\n handler.resetGeometry(false, child, false);\r\n curveA.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 curveA first curve\r\n * @param extendA true to allow curveA to extend\r\n * @param curveB second curve\r\n * @param extendB true to allow curveB to extend\r\n * @param tolerance optional distance tolerance for coincidence\r\n */\r\n public static intersectionProjectedXYPairs(\r\n worldToLocal: Matrix4d,\r\n curveA: AnyCurve,\r\n extendA: boolean,\r\n curveB: AnyCurve,\r\n extendB: boolean,\r\n tolerance: number = Geometry.smallMetricDistance,\r\n ): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(worldToLocal, extendA, curveB, extendB, tolerance);\r\n curveA.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 curveA first curve\r\n * @param extendA true to allow curveA to extend\r\n * @param curveB second curve\r\n * @param extendB true to allow curveB to extend\r\n */\r\n public static intersectionXYZ(\r\n curveA: AnyCurve, extendA: boolean, curveB: AnyCurve, extendB: boolean,\r\n ): CurveLocationDetailArrayPair {\r\n const handler = new CurveCurveIntersectXYZ(extendA, curveB, extendB);\r\n curveA.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(\r\n primitives: CurvePrimitive[], tolerance: number = Geometry.smallMetricDistance,\r\n ): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(undefined, false, undefined, false, tolerance);\r\n for (let i = 0; i < primitives.length; i++) {\r\n const curveA = primitives[i];\r\n for (let j = i + 1; j < primitives.length; j++) {\r\n handler.resetGeometry(false, primitives[j], false);\r\n curveA.dispatchToGeometryHandler(handler);\r\n }\r\n }\r\n return handler.grabPairedResults();\r\n }\r\n /**\r\n * Return at least one XY close approach between 2 curves.\r\n * * Close approach xy-distances are measured without regard to z. This is equivalent to their separation distance\r\n * as seen in the top view, or as measured between their projections onto the xy-plane.\r\n * * If more than one approach is returned, one of them is the closest approach.\r\n * @param curveA first curve\r\n * @param curveB second curve\r\n * @param maxDistance maximum xy-distance to consider between the curves.\r\n * Close approaches further than this xy-distance are not returned.\r\n */\r\n public static closeApproachProjectedXYPairs(\r\n curveA: AnyCurve, curveB: AnyCurve, maxDistance: number,\r\n ): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveCloseApproachXY(curveB);\r\n handler.maxDistanceToAccept = maxDistance;\r\n curveA.dispatchToGeometryHandler(handler);\r\n return handler.grabPairedResults();\r\n }\r\n /**\r\n * Convenience method that calls [[closeApproachProjectedXYPairs]] with a large `maxDistance`\r\n * and returns a detail pair representing the closest xy-approach between the curves.\r\n * * There may be many detail pairs that represent \"closest\" xy-approach, including coincident interval pairs,\r\n * isolated intersections, or close approaches within tolerance of each other. This method makes no attempt to\r\n * distinguish among them, and returns a pair whose `detail.point` values are separated by the smallest xy distance\r\n * found among the pairs.\r\n * @param curveA first curve\r\n * @param curveB second curve\r\n * @return detail pair of closest xy-approach, undefined if not found\r\n */\r\n public static closestApproachProjectedXYPair(curveA: AnyCurve, curveB: AnyCurve): CurveLocationDetailPair | undefined {\r\n const range = curveA.range();\r\n range.extendRange(curveB.range());\r\n const maxDistance = range.low.distanceXY(range.high);\r\n const closeApproaches = this.closeApproachProjectedXYPairs(curveA, curveB, maxDistance);\r\n if (!closeApproaches.length)\r\n return undefined;\r\n let iMin = 0;\r\n let minDistXY = 2 * maxDistance;\r\n for (let i = 0; i < closeApproaches.length; ++i) {\r\n const distXY = closeApproaches[i].detailA.point.distanceXY(closeApproaches[i].detailB.point);\r\n if (distXY < minDistXY) {\r\n iMin = i;\r\n minDistXY = distXY;\r\n }\r\n }\r\n return closeApproaches[iMin];\r\n }\r\n}\r\n"]}
@@ -120,7 +120,7 @@ export declare class CurveLocationDetail {
120
120
  setDistanceTo(point: Point3d): void;
121
121
  /** Create with a CurvePrimitive pointer but no coordinate data. */
122
122
  static create(curve?: CurvePrimitive, result?: CurveLocationDetail): CurveLocationDetail;
123
- /** Create with CurvePrimitive pointer, fraction, and point coordinates. */
123
+ /** Create a new detail using CurvePrimitive pointer, fraction, and point coordinates. */
124
124
  static createCurveFractionPoint(curve: CurvePrimitive | undefined, fraction: number, point: Point3d, result?: CurveLocationDetail): CurveLocationDetail;
125
125
  /** Create a new detail with only ray, fraction, and point. */
126
126
  static createRayFractionPoint(ray: Ray3d, fraction: number, point: Point3d, result?: CurveLocationDetail): CurveLocationDetail;
@@ -203,4 +203,15 @@ export declare class CurveLocationDetailPair {
203
203
  /** Swap the details of A, B */
204
204
  swapDetails(): void;
205
205
  }
206
+ /**
207
+ * Data bundle for a pair of arrays of CurveLocationDetail structures such as produced by [[CurveCurve.intersectionXYZ]].
208
+ * @public
209
+ */
210
+ export declare class CurveLocationDetailArrayPair {
211
+ /** First array of details ... */
212
+ dataA: CurveLocationDetail[];
213
+ /** Second array of details ... */
214
+ dataB: CurveLocationDetail[];
215
+ constructor();
216
+ }
206
217
  //# sourceMappingURL=CurveLocationDetail.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CurveLocationDetail.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveLocationDetail.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B,+DAA+D;IAC/D,QAAQ,IAAI;IACZ,2CAA2C;IAC3C,gBAAgB,IAAI;IACpB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BAE1B,OAAO,CAAC,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,mBAAmB;IAI/E,8EAA8E;WAChE,aAAa,CACzB,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,mBAAmB,EAAE,MAAM,CAAC,EAAE,uBAAuB,GAC3F,uBAAuB;IAM1B;;;OAGG;WACW,4BAA4B,CACxC,OAAO,EAAE,mBAAmB,EAAE,OAAO,EAAE,mBAAmB,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,uBAAuB,GAC9G,uBAAuB;IAY1B,uDAAuD;IAChD,KAAK,CAAC,MAAM,CAAC,EAAE,uBAAuB,GAAG,uBAAuB;IAOvE,+BAA+B;IACxB,WAAW;CAKnB;AAED;;;GAGG;AACH,qBAAa,4BAA4B;IACvC,iCAAiC;IAC1B,KAAK,EAAE,mBAAmB,EAAE,CAAC;IACpC,kCAAkC;IAC3B,KAAK,EAAE,mBAAmB,EAAE,CAAC;;CAKrC"}
@@ -168,7 +168,7 @@ export class CurveLocationDetail {
168
168
  result.curve = curve;
169
169
  return result;
170
170
  }
171
- /** Create with CurvePrimitive pointer, fraction, and point coordinates. */
171
+ /** Create a new detail using CurvePrimitive pointer, fraction, and point coordinates. */
172
172
  static createCurveFractionPoint(curve, fraction, point, result) {
173
173
  result = result ? result : new CurveLocationDetail();
174
174
  result.curve = curve;
@@ -387,4 +387,14 @@ export class CurveLocationDetailPair {
387
387
  this.detailB = q;
388
388
  }
389
389
  }
390
+ /**
391
+ * Data bundle for a pair of arrays of CurveLocationDetail structures such as produced by [[CurveCurve.intersectionXYZ]].
392
+ * @public
393
+ */
394
+ export class CurveLocationDetailArrayPair {
395
+ constructor() {
396
+ this.dataA = [];
397
+ this.dataB = [];
398
+ }
399
+ }
390
400
  //# sourceMappingURL=CurveLocationDetail.js.map