@itwin/core-geometry 4.10.0-dev.31 → 4.10.0-dev.33

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 (207) hide show
  1. package/lib/cjs/Geometry.js +2 -2
  2. package/lib/cjs/Geometry.js.map +1 -1
  3. package/lib/cjs/bspline/BSpline1dNd.d.ts.map +1 -1
  4. package/lib/cjs/bspline/BSpline1dNd.js +0 -1
  5. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurve.d.ts +5 -3
  7. package/lib/cjs/bspline/BSplineCurve.d.ts.map +1 -1
  8. package/lib/cjs/bspline/BSplineCurve.js +5 -4
  9. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  10. package/lib/cjs/clipping/ClipVector.js +1 -1
  11. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  12. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  13. package/lib/cjs/curve/Arc3d.js.map +1 -1
  14. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +7 -5
  15. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  16. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +9 -7
  17. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  18. package/lib/cjs/curve/CurveCollection.d.ts +21 -2
  19. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  20. package/lib/cjs/curve/CurveCollection.js +45 -10
  21. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  22. package/lib/cjs/curve/CurveExtendMode.d.ts +18 -15
  23. package/lib/cjs/curve/CurveExtendMode.d.ts.map +1 -1
  24. package/lib/cjs/curve/CurveExtendMode.js +18 -17
  25. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  26. package/lib/cjs/curve/CurvePrimitive.d.ts +9 -5
  27. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  28. package/lib/cjs/curve/CurvePrimitive.js +9 -5
  29. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  30. package/lib/cjs/curve/CurveProcessor.d.ts.map +1 -1
  31. package/lib/cjs/curve/CurveProcessor.js +0 -1
  32. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  33. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  34. package/lib/cjs/curve/LineSegment3d.js +0 -1
  35. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  36. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  37. package/lib/cjs/curve/OffsetOptions.d.ts.map +1 -1
  38. package/lib/cjs/curve/OffsetOptions.js +4 -4
  39. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  40. package/lib/cjs/curve/Path.d.ts +14 -0
  41. package/lib/cjs/curve/Path.d.ts.map +1 -1
  42. package/lib/cjs/curve/Path.js +27 -0
  43. package/lib/cjs/curve/Path.js.map +1 -1
  44. package/lib/cjs/curve/PointString3d.d.ts.map +1 -1
  45. package/lib/cjs/curve/PointString3d.js +0 -1
  46. package/lib/cjs/curve/PointString3d.js.map +1 -1
  47. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  48. package/lib/cjs/curve/StrokeOptions.js +0 -1
  49. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  50. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  51. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +0 -2
  52. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  53. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  54. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +0 -1
  55. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  56. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  57. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +0 -1
  58. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  59. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +5 -4
  60. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  61. package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
  62. package/lib/cjs/geometry3d/FrameBuilder.js +0 -1
  63. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  64. package/lib/cjs/geometry3d/IndexedXYCollection.d.ts.map +1 -1
  65. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  66. package/lib/cjs/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
  67. package/lib/cjs/geometry3d/Point2dArrayCarrier.js +2 -3
  68. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  69. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  70. package/lib/cjs/geometry3d/PointHelpers.js +0 -1
  71. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  72. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  73. package/lib/cjs/geometry3d/PolygonOps.js +1 -3
  74. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  75. package/lib/cjs/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
  76. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  77. package/lib/cjs/numerics/BezierPolynomials.d.ts.map +1 -1
  78. package/lib/cjs/numerics/BezierPolynomials.js +0 -1
  79. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  80. package/lib/cjs/numerics/Range1dArray.js +2 -2
  81. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  82. package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
  83. package/lib/cjs/polyface/AuxData.js.map +1 -1
  84. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  85. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +0 -1
  86. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  87. package/lib/cjs/polyface/Polyface.d.ts +2 -2
  88. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  89. package/lib/cjs/polyface/Polyface.js +0 -1
  90. package/lib/cjs/polyface/Polyface.js.map +1 -1
  91. package/lib/cjs/polyface/PolyfaceBuilder.js +1 -1
  92. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  93. package/lib/cjs/polyface/PolyfaceClip.d.ts.map +1 -1
  94. package/lib/cjs/polyface/PolyfaceClip.js +0 -1
  95. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  96. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  97. package/lib/cjs/polyface/PolyfaceQuery.js +0 -1
  98. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  99. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  100. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  101. package/lib/cjs/serialization/DeepCompare.d.ts.map +1 -1
  102. package/lib/cjs/serialization/DeepCompare.js +0 -1
  103. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  104. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  105. package/lib/esm/Geometry.js +2 -2
  106. package/lib/esm/Geometry.js.map +1 -1
  107. package/lib/esm/bspline/BSpline1dNd.d.ts.map +1 -1
  108. package/lib/esm/bspline/BSpline1dNd.js +0 -1
  109. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  110. package/lib/esm/bspline/BSplineCurve.d.ts +5 -3
  111. package/lib/esm/bspline/BSplineCurve.d.ts.map +1 -1
  112. package/lib/esm/bspline/BSplineCurve.js +5 -4
  113. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  114. package/lib/esm/clipping/ClipVector.js +1 -1
  115. package/lib/esm/clipping/ClipVector.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/CurveChainWithDistanceIndex.d.ts +7 -5
  119. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  120. package/lib/esm/curve/CurveChainWithDistanceIndex.js +9 -7
  121. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  122. package/lib/esm/curve/CurveCollection.d.ts +21 -2
  123. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  124. package/lib/esm/curve/CurveCollection.js +45 -10
  125. package/lib/esm/curve/CurveCollection.js.map +1 -1
  126. package/lib/esm/curve/CurveExtendMode.d.ts +18 -15
  127. package/lib/esm/curve/CurveExtendMode.d.ts.map +1 -1
  128. package/lib/esm/curve/CurveExtendMode.js +18 -17
  129. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  130. package/lib/esm/curve/CurvePrimitive.d.ts +9 -5
  131. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  132. package/lib/esm/curve/CurvePrimitive.js +9 -5
  133. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  134. package/lib/esm/curve/CurveProcessor.d.ts.map +1 -1
  135. package/lib/esm/curve/CurveProcessor.js +0 -1
  136. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  137. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  138. package/lib/esm/curve/LineSegment3d.js +0 -1
  139. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  140. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  141. package/lib/esm/curve/OffsetOptions.d.ts.map +1 -1
  142. package/lib/esm/curve/OffsetOptions.js +4 -4
  143. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  144. package/lib/esm/curve/Path.d.ts +14 -0
  145. package/lib/esm/curve/Path.d.ts.map +1 -1
  146. package/lib/esm/curve/Path.js +27 -0
  147. package/lib/esm/curve/Path.js.map +1 -1
  148. package/lib/esm/curve/PointString3d.d.ts.map +1 -1
  149. package/lib/esm/curve/PointString3d.js +0 -1
  150. package/lib/esm/curve/PointString3d.js.map +1 -1
  151. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  152. package/lib/esm/curve/StrokeOptions.js +0 -1
  153. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  154. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  155. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +0 -2
  156. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  157. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -1
  158. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +0 -1
  159. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  160. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -1
  161. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +0 -1
  162. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  163. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +5 -4
  164. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  165. package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
  166. package/lib/esm/geometry3d/FrameBuilder.js +0 -1
  167. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  168. package/lib/esm/geometry3d/IndexedXYCollection.d.ts.map +1 -1
  169. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  170. package/lib/esm/geometry3d/Point2dArrayCarrier.d.ts.map +1 -1
  171. package/lib/esm/geometry3d/Point2dArrayCarrier.js +0 -1
  172. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  173. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  174. package/lib/esm/geometry3d/PointHelpers.js +0 -1
  175. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  176. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  177. package/lib/esm/geometry3d/PolygonOps.js +1 -3
  178. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  179. package/lib/esm/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
  180. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  181. package/lib/esm/numerics/BezierPolynomials.d.ts.map +1 -1
  182. package/lib/esm/numerics/BezierPolynomials.js +0 -1
  183. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  184. package/lib/esm/polyface/AuxData.d.ts.map +1 -1
  185. package/lib/esm/polyface/AuxData.js.map +1 -1
  186. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  187. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +0 -1
  188. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  189. package/lib/esm/polyface/Polyface.d.ts +2 -2
  190. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  191. package/lib/esm/polyface/Polyface.js +0 -1
  192. package/lib/esm/polyface/Polyface.js.map +1 -1
  193. package/lib/esm/polyface/PolyfaceBuilder.js +1 -1
  194. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  195. package/lib/esm/polyface/PolyfaceClip.d.ts.map +1 -1
  196. package/lib/esm/polyface/PolyfaceClip.js +0 -1
  197. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  198. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  199. package/lib/esm/polyface/PolyfaceQuery.js +0 -1
  200. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  201. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  202. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  203. package/lib/esm/serialization/DeepCompare.d.ts.map +1 -1
  204. package/lib/esm/serialization/DeepCompare.js +0 -1
  205. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  206. package/lib/esm/topology/Graph.d.ts.map +1 -1
  207. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"file":"CurveCollection.js","sourceRoot":"","sources":["../../../src/curve/CurveCollection.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAuC;AAOvC,+DAA4D;AAC5D,qDAAkD;AAGlD,mDAAgD;AAChD,8EAA2E;AAC3E,kGAA+F;AAC/F,oGAAiG;AACjG,0EAAuE;AACvE,4FAAyF;AACzF,4EAAyE;AACzE,wFAAqF;AACrF,iDAA8C;AAC9C,6CAA0C;AAoB1C;;;;;;;;;;;;GAYG;AACH,MAAsB,eAAgB,SAAQ,6BAAa;IAA3D;;QACE,wCAAwC;QACxB,qBAAgB,GAAG,iBAAiB,CAAC;QAGrD,uDAAuD;QAChD,YAAO,GAAY,KAAK,CAAC;IA4LlC,CAAC;IAzLC,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,CAAC;YAChC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAClC,IAAI,KAAK,YAAY,+BAAc,EAAE,CAAC;oBACpC,MAAM,OAAO,GAAG,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC;oBACtD,OAAO,GAAG,yCAAmB,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;gBACjE,CAAC;qBAAM,IAAI,KAAK,YAAY,eAAe,EAAE,CAAC;oBAC5C,MAAM,OAAO,GAAG,KAAK,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC;oBAC/C,OAAO,GAAG,yCAAmB,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,C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O,CAAC,CAAC;gBACjD,IAAI,YAAY;oBACd,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;YACtC,CAAC;QACH,CAAC;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","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 { CurveLocationDetail } from \"./CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { AnyCurve, type AnyRegion } from \"./CurveTypes\";\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\nimport type { Path } from \"./Path\";\r\nimport type { Loop } from \"./Loop\";\r\n\r\n/** Note: CurveChain and BagOfCurves classes are located in this file to prevent circular dependency. */\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]] - 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 of curves. Does not have to be closed or planar. A closed `Path` is not treated as bounding a surface.\r\n * - [[Loop]] - a closed and planar chain of curves. A `Loop` is treated as bounding a planar area.\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 /** Flag for inner loop status. Only used by `Loop`. */\r\n public isInner: boolean = false;\r\n /** Return the curve children. */\r\n public abstract override get children(): AnyCurve[];\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 * @see isAnyRegion\r\n */\r\n public get isAnyRegionType(): boolean {\r\n return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 4 || this.dgnBoundaryType() === 5;\r\n }\r\n /** Type guard for AnyRegion */\r\n public isAnyRegion(): this is AnyRegion {\r\n return this.isAnyRegionType;\r\n }\r\n /**\r\n * Return true for a `Path`, i.e. a chain of curves joined head-to-tail\r\n * @see isPath\r\n */\r\n public get isOpenPath(): boolean {\r\n return this.dgnBoundaryType() === 1;\r\n }\r\n /** Type guard for Path */\r\n public isPath(): this is Path {\r\n return this.isOpenPath;\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 * @see isLoop\r\n */\r\n public get isClosedPath(): boolean {\r\n return this.dgnBoundaryType() === 2;\r\n }\r\n /** Type guard for Loop */\r\n public isLoop(): this is Loop {\r\n return this.isClosedPath;\r\n }\r\n\r\n /** Return a CurveCollection with the same structure but all curves replaced by strokes. */\r\n public abstract cloneStroked(options?: StrokeOptions): CurveCollection;\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): CurveChain;\r\n /**\r\n * Add a child curve.\r\n * @param child curve to add to the chain. The curve is captured by this instance.\r\n * @return whether the child was added\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"]}
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;AAGlD,mDAAgD;AAChD,8EAA2E;AAC3E,kGAA+F;AAC/F,oGAAiG;AACjG,0EAAuE;AACvE,4FAAyF;AACzF,4EAAyE;AACzE,wFAAqF;AACrF,iDAA8C;AAC9C,6CAA0C;AAoB1C;;;;;;;;;;;;GAYG;AACH,MAAsB,eAAgB,SAAQ,6BAAa;IAA3D;;QACE,wCAAwC;QACxB,qBAAgB,GAAG,iBAAiB,CAAC;QAGrD,uDAAuD;QAChD,YAAO,GAAY,KAAK,CAAC;IAgMlC,CAAC;IA7LC,6DAA6D;IACtD,UAAU;QACf,OAAO,qCAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IACD;;;;;;OAMG;IACI,YAAY,CACjB,UAAmB,EAAE,UAAuC,KAAK,EAAE,MAA4B;QAE/F,IAAI,OAAwC,CAAC;QAC7C,MAAM,OAAO,GAAG,IAAI,yCAAmB,EAAE,CAAC;QAC1C,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAChC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAClC,IAAI,KAAK,CAAC,YAAY,CAAC,UAAU,EAAE,KAAK,EAAE,OAAO,CAAC;oBAChD,OAAO,GAAG,MAAM,GAAG,yCAAmB,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAC3F,CAAC;QACH,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IACD;;;;;;OAMG;IACI,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,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;AA/FD,kCA+FC","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 { VariantCurveExtendParameter } from \"./CurveExtendMode\";\r\nimport { CurveLocationDetail } from \"./CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { AnyCurve, type AnyRegion } from \"./CurveTypes\";\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\nimport type { Path } from \"./Path\";\r\nimport type { Loop } from \"./Loop\";\r\n\r\n/** Note: CurveChain and BagOfCurves classes are located in this file to prevent circular dependency. */\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]] - 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 of curves. Does not have to be closed or planar. A closed `Path` is not treated as bounding a surface.\r\n * - [[Loop]] - a closed and planar chain of curves. A `Loop` is treated as bounding a planar area.\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 /** Flag for inner loop status. Only used by `Loop`. */\r\n public isInner: boolean = false;\r\n /** Return the curve children. */\r\n public abstract override get children(): AnyCurve[];\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 /**\r\n * Return the closest point on the contained curves.\r\n * @param spacePoint point in space.\r\n * @param _extend unused here (pass false), but applicable to overrides in [[Path]] and [[BagOfCurves]].\r\n * @param result optional pre-allocated detail to populate and return.\r\n * @returns details of the closest point.\r\n */\r\n public closestPoint(\r\n spacePoint: Point3d, _extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\r\n ): CurveLocationDetail | undefined {\r\n let detailA: CurveLocationDetail | undefined;\r\n const detailB = new CurveLocationDetail();\r\n if (this.children !== undefined) {\r\n for (const child of this.children) {\r\n if (child.closestPoint(spacePoint, false, detailB))\r\n detailA = result = CurveLocationDetail.chooseSmallerA(detailA, detailB)!.clone(result);\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 * @see isAnyRegion\r\n */\r\n public get isAnyRegionType(): boolean {\r\n return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 4 || this.dgnBoundaryType() === 5;\r\n }\r\n /** Type guard for AnyRegion */\r\n public isAnyRegion(): this is AnyRegion {\r\n return this.isAnyRegionType;\r\n }\r\n /**\r\n * Return true for a `Path`, i.e. a chain of curves joined head-to-tail\r\n * @see isPath\r\n */\r\n public get isOpenPath(): boolean {\r\n return this.dgnBoundaryType() === 1;\r\n }\r\n /** Type guard for Path */\r\n public isPath(): this is Path {\r\n return this.isOpenPath;\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 * @see isLoop\r\n */\r\n public get isClosedPath(): boolean {\r\n return this.dgnBoundaryType() === 2;\r\n }\r\n /** Type guard for Loop */\r\n public isLoop(): this is Loop {\r\n return this.isClosedPath;\r\n }\r\n\r\n /** Return a CurveCollection with the same structure but all curves replaced by strokes. */\r\n public abstract cloneStroked(options?: StrokeOptions): CurveCollection;\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 /** Return the start point of the curve chain (start point of the first child). */\r\n public startPoint(result?: Point3d): Point3d | undefined {\r\n const firstChild = this.getChild(0);\r\n if (firstChild)\r\n return firstChild.fractionToPoint(0.0, result);\r\n else\r\n return undefined;\r\n }\r\n /** Return the end point of the curve chain (end point of the last child). */\r\n public endPoint(result?: Point3d): Point3d | undefined {\r\n const lastChild = this.getChild(this._curves.length - 1);\r\n if (lastChild)\r\n return lastChild.fractionToPoint(1.0, result);\r\n else\r\n return undefined;\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): CurveChain;\r\n /**\r\n * Add a child curve.\r\n * @param child curve to add to the chain. The curve is captured by this instance.\r\n * @return whether the child was added\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 /**\r\n * Return the closest point on the contained curves.\r\n * @param spacePoint point in space.\r\n * @param extend applicable only to children of type [[CurvePrimitive]], [[Path]], or [[BagOfCurves]]\r\n * @param result optional pre-allocated detail to populate and return.\r\n * @returns details of the closest point.\r\n */\r\n public override closestPoint(\r\n spacePoint: Point3d, extend: VariantCurveExtendParameter = false, result?: CurveLocationDetail,\r\n ): CurveLocationDetail | undefined {\r\n let detailA: CurveLocationDetail | undefined;\r\n const detailB = new CurveLocationDetail();\r\n if (this.children !== undefined) {\r\n for (const child of this.children) {\r\n if (child.closestPoint(spacePoint, extend, detailB))\r\n detailA = result = CurveLocationDetail.chooseSmallerA(detailA, detailB)!.clone(result);\r\n }\r\n }\r\n return detailA;\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"]}
@@ -2,24 +2,26 @@
2
2
  * @module Curve
3
3
  */
4
4
  import { AngleSweep } from "../geometry3d/AngleSweep";
5
- /** Enumeration of condition for extending a curve beyond start or end point.
5
+ /**
6
+ * Enumeration of condition for extending a curve beyond start or end point.
6
7
  * * Not all CurvePrimitives support these modes.
7
8
  * @public
8
9
  */
9
10
  export declare enum CurveExtendMode {
10
11
  /** No extension allowed. */
11
12
  None = 0,
12
- /** Extend along continuation of the end tangent */
13
+ /** Extend along continuation of the end tangent. */
13
14
  OnTangent = 1,
14
15
  /** Extend along continuation of the curve. */
15
16
  OnCurve = 2
16
17
  }
17
- /** Logic for deciding how a curve may be extended for closest point or intersection searches.
18
+ /**
19
+ * Logic for deciding how a curve may be extended for closest point or intersection searches.
18
20
  * @public
19
21
  */
20
22
  export declare class CurveExtendOptions {
21
23
  /**
22
- * Given an VariantCurveExtendParameter, isolate the particular CurveExtendMode in effect at an end.
24
+ * Given a `VariantCurveExtendParameter`, isolate the particular CurveExtendMode in effect at an end.
23
25
  * * Return `CurveExtendMode.None` if `param === false`.
24
26
  * * Return `CurveExtendMode.OnCurve` if `param === true`.
25
27
  * * Return the param if it is a single CurveExtendMode.
@@ -27,24 +29,25 @@ export declare class CurveExtendOptions {
27
29
  */
28
30
  static resolveVariantCurveExtendParameterToCurveExtendMode(param: VariantCurveExtendParameter, endIndex: 0 | 1): CurveExtendMode;
29
31
  /**
30
- *
31
- * * if fraction is between 0 and 1 return it unchanged.
32
- * * if fraction is less than 0 use the variant param to choose the fraction or 0
33
- * * if fraction is greater than 1 use the variant param to choose the fraction or 1
34
- *
32
+ * Correct fraction to be within [0,1].
33
+ * * If fraction is in [0,1] return it unchanged.
34
+ * * If fraction is less than 0 use `extendParam` to decide whether to return it unchanged, or to return 0.
35
+ * * If fraction is greater than 1 use `extendParam` to decide whether to return it unchanged, or to return 1.
35
36
  */
36
37
  static correctFraction(extendParam: VariantCurveExtendParameter, fraction: number): number;
37
38
  /**
38
39
  * Adjust a radians value to an angle sweep, allowing the extendParam to affect choice among periodic fractions.
39
- * * if radians is within the sweep, convert it to a fraction of the sweep.
40
- * * if radians is outside, use the extendParam to choose among:
41
- * * fraction below 0
42
- * * fraction above 1
40
+ * * If radians is within the sweep, convert it to a fraction of the sweep.
41
+ * * If radians is outside, use the extendParam to choose among:
42
+ * * fraction below 0.
43
+ * * fraction above 1.
43
44
  */
44
45
  static resolveRadiansToSweepFraction(extendParam: VariantCurveExtendParameter, radians: number, sweep: AngleSweep): number;
45
46
  }
46
- /** Variants of a single parameter.
47
- * Use this type in a function signature where caller may want simple true, false, or same extend mode for both ends.
47
+ /**
48
+ * Variant options for extending a curve.
49
+ * * Useful for specifying either a single boolean/`CurveExtendMode` option applicable to both ends of the curve,
50
+ * or an array of options, the first entry of which applies to the curve start; the second, to curve end.
48
51
  * @public
49
52
  */
50
53
  export type VariantCurveExtendParameter = boolean | CurveExtendMode | CurveExtendMode[];
@@ -1 +1 @@
1
- {"version":3,"file":"CurveExtendMode.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveExtendMode.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD;;;GAGG;AACH,oBAAY,eAAe;IACzB,4BAA4B;IAC5B,IAAI,IAAI;IACR,mDAAmD;IACnD,SAAS,IAAI;IACb,8CAA8C;IAC9C,OAAO,IAAI;CACZ;AACD;;GAEG;AACH,qBAAa,kBAAkB;IAC7B;;;;;;OAMG;WACW,mDAAmD,CAAC,KAAK,EAAE,2BAA2B,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,GAAG,eAAe;IASvI;;;;;;OAMG;WACW,eAAe,CAAC,WAAW,EAAE,2BAA2B,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAYjG;;;;;;OAMG;WACW,6BAA6B,CAAC,WAAW,EAAE,2BAA2B,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAAG,MAAM;CAwBlI;AACD;;;GAGG;AACH,MAAM,MAAM,2BAA2B,GAAG,OAAO,GAAG,eAAe,GAAG,eAAe,EAAE,CAAC"}
1
+ {"version":3,"file":"CurveExtendMode.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveExtendMode.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAEtD;;;;GAIG;AACH,oBAAY,eAAe;IACzB,4BAA4B;IAC5B,IAAI,IAAI;IACR,oDAAoD;IACpD,SAAS,IAAI;IACb,8CAA8C;IAC9C,OAAO,IAAI;CACZ;AACD;;;GAGG;AACH,qBAAa,kBAAkB;IAC7B;;;;;;OAMG;WACW,mDAAmD,CAC/D,KAAK,EAAE,2BAA2B,EAAE,QAAQ,EAAE,CAAC,GAAG,CAAC,GAClD,eAAe;IASlB;;;;;OAKG;WACW,eAAe,CAAC,WAAW,EAAE,2BAA2B,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM;IAYjG;;;;;;OAMG;WACW,6BAA6B,CACzC,WAAW,EAAE,2BAA2B,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,GAC3E,MAAM;CAwBV;AACD;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG,OAAO,GAAG,eAAe,GAAG,eAAe,EAAE,CAAC"}
@@ -9,7 +9,8 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.CurveExtendOptions = exports.CurveExtendMode = void 0;
11
11
  const Geometry_1 = require("../Geometry");
12
- /** Enumeration of condition for extending a curve beyond start or end point.
12
+ /**
13
+ * Enumeration of condition for extending a curve beyond start or end point.
13
14
  * * Not all CurvePrimitives support these modes.
14
15
  * @public
15
16
  */
@@ -17,17 +18,18 @@ var CurveExtendMode;
17
18
  (function (CurveExtendMode) {
18
19
  /** No extension allowed. */
19
20
  CurveExtendMode[CurveExtendMode["None"] = 0] = "None";
20
- /** Extend along continuation of the end tangent */
21
+ /** Extend along continuation of the end tangent. */
21
22
  CurveExtendMode[CurveExtendMode["OnTangent"] = 1] = "OnTangent";
22
23
  /** Extend along continuation of the curve. */
23
24
  CurveExtendMode[CurveExtendMode["OnCurve"] = 2] = "OnCurve";
24
25
  })(CurveExtendMode || (exports.CurveExtendMode = CurveExtendMode = {}));
25
- /** Logic for deciding how a curve may be extended for closest point or intersection searches.
26
+ /**
27
+ * Logic for deciding how a curve may be extended for closest point or intersection searches.
26
28
  * @public
27
29
  */
28
30
  class CurveExtendOptions {
29
31
  /**
30
- * Given an VariantCurveExtendParameter, isolate the particular CurveExtendMode in effect at an end.
32
+ * Given a `VariantCurveExtendParameter`, isolate the particular CurveExtendMode in effect at an end.
31
33
  * * Return `CurveExtendMode.None` if `param === false`.
32
34
  * * Return `CurveExtendMode.OnCurve` if `param === true`.
33
35
  * * Return the param if it is a single CurveExtendMode.
@@ -39,15 +41,14 @@ class CurveExtendOptions {
39
41
  if (param === true)
40
42
  return CurveExtendMode.OnCurve;
41
43
  if (Array.isArray(param))
42
- return param[endIndex];
44
+ return param.length > endIndex ? param[endIndex] : CurveExtendMode.None;
43
45
  return param;
44
46
  }
45
47
  /**
46
- *
47
- * * if fraction is between 0 and 1 return it unchanged.
48
- * * if fraction is less than 0 use the variant param to choose the fraction or 0
49
- * * if fraction is greater than 1 use the variant param to choose the fraction or 1
50
- *
48
+ * Correct fraction to be within [0,1].
49
+ * * If fraction is in [0,1] return it unchanged.
50
+ * * If fraction is less than 0 use `extendParam` to decide whether to return it unchanged, or to return 0.
51
+ * * If fraction is greater than 1 use `extendParam` to decide whether to return it unchanged, or to return 1.
51
52
  */
52
53
  static correctFraction(extendParam, fraction) {
53
54
  if (fraction < 0) {
@@ -64,10 +65,10 @@ class CurveExtendOptions {
64
65
  }
65
66
  /**
66
67
  * Adjust a radians value to an angle sweep, allowing the extendParam to affect choice among periodic fractions.
67
- * * if radians is within the sweep, convert it to a fraction of the sweep.
68
- * * if radians is outside, use the extendParam to choose among:
69
- * * fraction below 0
70
- * * fraction above 1
68
+ * * If radians is within the sweep, convert it to a fraction of the sweep.
69
+ * * If radians is outside, use the extendParam to choose among:
70
+ * * fraction below 0.
71
+ * * fraction above 1.
71
72
  */
72
73
  static resolveRadiansToSweepFraction(extendParam, radians, sweep) {
73
74
  let fraction = sweep.radiansToSignedPeriodicFraction(radians);
@@ -77,11 +78,11 @@ class CurveExtendOptions {
77
78
  const mode1 = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendParam, 1);
78
79
  if (mode0 !== CurveExtendMode.None) {
79
80
  if (mode1 !== CurveExtendMode.None) {
80
- // both extensions possible ... let the sweep resolve to the "closer" end
81
+ // both extensions possible; let the sweep resolve to the "closer" end
81
82
  fraction = sweep.radiansToSignedPeriodicFraction(radians);
82
83
  }
83
84
  else {
84
- // only extend to negative .....
85
+ // only extend to negative
85
86
  if (fraction > 1.0)
86
87
  fraction -= fractionPeriod;
87
88
  }
@@ -90,7 +91,7 @@ class CurveExtendOptions {
90
91
  if (fraction < 0.0)
91
92
  fraction += fractionPeriod;
92
93
  }
93
- else { // both clamped !!!!
94
+ else { // both clamped
94
95
  fraction = Geometry_1.Geometry.clamp(fraction, 0, 1);
95
96
  }
96
97
  }
@@ -1 +1 @@
1
- {"version":3,"file":"CurveExtendMode.js","sourceRoot":"","sources":["../../../src/curve/CurveExtendMode.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,0CAAuC;AAGvC;;;GAGG;AACH,IAAY,eAOX;AAPD,WAAY,eAAe;IACzB,4BAA4B;IAC5B,qDAAQ,CAAA;IACR,mDAAmD;IACnD,+DAAa,CAAA;IACb,8CAA8C;IAC9C,2DAAW,CAAA;AACb,CAAC,EAPW,eAAe,+BAAf,eAAe,QAO1B;AACD;;GAEG;AACH,MAAa,kBAAkB;IAC7B;;;;;;OAMG;IACI,MAAM,CAAC,mDAAmD,CAAC,KAAkC,EAAE,QAAe;QACnH,IAAI,KAAK,KAAK,KAAK;YACjB,OAAO,eAAe,CAAC,IAAI,CAAC;QAC9B,IAAI,KAAK,KAAK,IAAI;YAChB,OAAO,eAAe,CAAC,OAAO,CAAC;QACjC,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;YACtB,OAAO,KAAK,CAAC,QAAQ,CAAC,CAAC;QACzB,OAAO,KAAK,CAAC;IACf,CAAC;IACD;;;;;;OAMG;IACI,MAAM,CAAC,eAAe,CAAC,WAAwC,EAAE,QAAgB;QACtF,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;YACjB,MAAM,IAAI,GAAG,kBAAkB,CAAC,mDAAmD,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;YACpG,IAAI,IAAI,KAAK,eAAe,CAAC,IAAI;gBAC/B,QAAQ,GAAG,GAAG,CAAC;QACnB,CAAC;aAAM,IAAI,QAAQ,GAAG,GAA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C,CAAC;YAC5C,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAnED,gDAmEC","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 { AngleSweep } from \"../geometry3d/AngleSweep\";\r\n\r\n/** Enumeration of condition for extending a curve beyond start or end point.\r\n * * Not all CurvePrimitives support these modes.\r\n * @public\r\n */\r\nexport enum CurveExtendMode {\r\n /** No extension allowed. */\r\n None = 0,\r\n /** Extend along continuation of the end tangent */\r\n OnTangent = 1,\r\n /** Extend along continuation of the curve. */\r\n OnCurve = 2,\r\n}\r\n/** Logic for deciding how a curve may be extended for closest point or intersection searches.\r\n * @public\r\n */\r\nexport class CurveExtendOptions {\r\n /**\r\n * Given an VariantCurveExtendParameter, isolate the particular CurveExtendMode in effect at an end.\r\n * * Return `CurveExtendMode.None` if `param === false`.\r\n * * Return `CurveExtendMode.OnCurve` if `param === true`.\r\n * * Return the param if it is a single CurveExtendMode.\r\n * * Return dereferenced array at entry `endIndex` if the param is an array of CurveExtendMode.\r\n */\r\n public static resolveVariantCurveExtendParameterToCurveExtendMode(param: VariantCurveExtendParameter, endIndex: 0 | 1): CurveExtendMode {\r\n if (param === false)\r\n return CurveExtendMode.None;\r\n if (param === true)\r\n return CurveExtendMode.OnCurve;\r\n if (Array.isArray(param))\r\n return param[endIndex];\r\n return param;\r\n }\r\n /**\r\n *\r\n * * if fraction is between 0 and 1 return it unchanged.\r\n * * if fraction is less than 0 use the variant param to choose the fraction or 0\r\n * * if fraction is greater than 1 use the variant param to choose the fraction or 1\r\n *\r\n */\r\n public static correctFraction(extendParam: VariantCurveExtendParameter, fraction: number): number {\r\n if (fraction < 0) {\r\n const mode = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendParam, 0);\r\n if (mode === CurveExtendMode.None)\r\n fraction = 0.0;\r\n } else if (fraction > 1.0) {\r\n const mode = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendParam, 1);\r\n if (mode === CurveExtendMode.None)\r\n fraction = 1.0;\r\n }\r\n return fraction;\r\n }\r\n /**\r\n * Adjust a radians value to an angle sweep, allowing the extendParam to affect choice among periodic fractions.\r\n * * if radians is within the sweep, convert it to a fraction of the sweep.\r\n * * if radians is outside, use the extendParam to choose among:\r\n * * fraction below 0\r\n * * fraction above 1\r\n */\r\n public static resolveRadiansToSweepFraction(extendParam: VariantCurveExtendParameter, radians: number, sweep: AngleSweep): number {\r\n let fraction = sweep.radiansToSignedPeriodicFraction(radians);\r\n if (!sweep.isRadiansInSweep(radians)) {\r\n const fractionPeriod = sweep.fractionPeriod();\r\n const mode0 = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendParam, 0);\r\n const mode1 = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendParam, 1);\r\n if (mode0 !== CurveExtendMode.None) {\r\n if (mode1 !== CurveExtendMode.None) {\r\n // both extensions possible ... let the sweep resolve to the \"closer\" end\r\n fraction = sweep.radiansToSignedPeriodicFraction(radians);\r\n } else {\r\n // only extend to negative .....\r\n if (fraction > 1.0)\r\n fraction -= fractionPeriod;\r\n }\r\n } else if (mode1 !== CurveExtendMode.None) {\r\n if (fraction < 0.0)\r\n fraction += fractionPeriod;\r\n } else { // both clamped !!!!\r\n fraction = Geometry.clamp(fraction, 0, 1);\r\n }\r\n }\r\n return fraction;\r\n }\r\n}\r\n/** Variants of a single parameter.\r\n * Use this type in a function signature where caller may want simple true, false, or same extend mode for both ends.\r\n * @public\r\n */\r\nexport type VariantCurveExtendParameter = boolean | CurveExtendMode | CurveExtendMode[];\r\n"]}
1
+ {"version":3,"file":"CurveExtendMode.js","sourceRoot":"","sources":["../../../src/curve/CurveEx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,CAAC;IAClB,CAAC;IACD;;;;;;OAMG;IACI,MAAM,CAAC,6BAA6B,CACzC,WAAwC,EAAE,OAAe,EAAE,KAAiB;QAE5E,IAAI,QAAQ,GAAG,KAAK,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;QAC9D,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAC;YACrC,MAAM,cAAc,GAAG,KAAK,CAAC,cAAc,EAAE,CAAC;YAC9C,MAAM,KAAK,GAAG,kBAAkB,CAAC,mDAAmD,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;YACrG,MAAM,KAAK,GAAG,kBAAkB,CAAC,mDAAmD,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;YACrG,IAAI,KAAK,KAAK,eAAe,CAAC,IAAI,EAAE,CAAC;gBACnC,IAAI,KAAK,KAAK,eAAe,CAAC,IAAI,EAAE,CAAC;oBACnC,sEAAsE;oBACtE,QAAQ,GAAG,KAAK,CAAC,+BAA+B,CAAC,OAAO,CAAC,CAAC;gBAC5D,CAAC;qBAAM,CAAC;oBACN,0BAA0B;oBAC1B,IAAI,QAAQ,GAAG,GAAG;wBAChB,QAAQ,IAAI,cAAc,CAAC;gBAC/B,CAAC;YACH,CAAC;iBAAM,IAAI,KAAK,KAAK,eAAe,CAAC,IAAI,EAAE,CAAC;gBAC1C,IAAI,QAAQ,GAAG,GAAG;oBAChB,QAAQ,IAAI,cAAc,CAAC;YAC/B,CAAC;iBAAM,CAAC,CAAC,eAAe;gBACtB,QAAQ,GAAG,mBAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YAC5C,CAAC;QACH,CAAC;QACD,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF;AAtED,gDAsEC","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 { AngleSweep } from \"../geometry3d/AngleSweep\";\r\n\r\n/**\r\n * Enumeration of condition for extending a curve beyond start or end point.\r\n * * Not all CurvePrimitives support these modes.\r\n * @public\r\n */\r\nexport enum CurveExtendMode {\r\n /** No extension allowed. */\r\n None = 0,\r\n /** Extend along continuation of the end tangent. */\r\n OnTangent = 1,\r\n /** Extend along continuation of the curve. */\r\n OnCurve = 2,\r\n}\r\n/**\r\n * Logic for deciding how a curve may be extended for closest point or intersection searches.\r\n * @public\r\n */\r\nexport class CurveExtendOptions {\r\n /**\r\n * Given a `VariantCurveExtendParameter`, isolate the particular CurveExtendMode in effect at an end.\r\n * * Return `CurveExtendMode.None` if `param === false`.\r\n * * Return `CurveExtendMode.OnCurve` if `param === true`.\r\n * * Return the param if it is a single CurveExtendMode.\r\n * * Return dereferenced array at entry `endIndex` if the param is an array of CurveExtendMode.\r\n */\r\n public static resolveVariantCurveExtendParameterToCurveExtendMode(\r\n param: VariantCurveExtendParameter, endIndex: 0 | 1,\r\n ): CurveExtendMode {\r\n if (param === false)\r\n return CurveExtendMode.None;\r\n if (param === true)\r\n return CurveExtendMode.OnCurve;\r\n if (Array.isArray(param))\r\n return param.length > endIndex ? param[endIndex] : CurveExtendMode.None;\r\n return param;\r\n }\r\n /**\r\n * Correct fraction to be within [0,1].\r\n * * If fraction is in [0,1] return it unchanged.\r\n * * If fraction is less than 0 use `extendParam` to decide whether to return it unchanged, or to return 0.\r\n * * If fraction is greater than 1 use `extendParam` to decide whether to return it unchanged, or to return 1.\r\n */\r\n public static correctFraction(extendParam: VariantCurveExtendParameter, fraction: number): number {\r\n if (fraction < 0) {\r\n const mode = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendParam, 0);\r\n if (mode === CurveExtendMode.None)\r\n fraction = 0.0;\r\n } else if (fraction > 1.0) {\r\n const mode = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendParam, 1);\r\n if (mode === CurveExtendMode.None)\r\n fraction = 1.0;\r\n }\r\n return fraction;\r\n }\r\n /**\r\n * Adjust a radians value to an angle sweep, allowing the extendParam to affect choice among periodic fractions.\r\n * * If radians is within the sweep, convert it to a fraction of the sweep.\r\n * * If radians is outside, use the extendParam to choose among:\r\n * * fraction below 0.\r\n * * fraction above 1.\r\n */\r\n public static resolveRadiansToSweepFraction(\r\n extendParam: VariantCurveExtendParameter, radians: number, sweep: AngleSweep,\r\n ): number {\r\n let fraction = sweep.radiansToSignedPeriodicFraction(radians);\r\n if (!sweep.isRadiansInSweep(radians)) {\r\n const fractionPeriod = sweep.fractionPeriod();\r\n const mode0 = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendParam, 0);\r\n const mode1 = CurveExtendOptions.resolveVariantCurveExtendParameterToCurveExtendMode(extendParam, 1);\r\n if (mode0 !== CurveExtendMode.None) {\r\n if (mode1 !== CurveExtendMode.None) {\r\n // both extensions possible; let the sweep resolve to the \"closer\" end\r\n fraction = sweep.radiansToSignedPeriodicFraction(radians);\r\n } else {\r\n // only extend to negative\r\n if (fraction > 1.0)\r\n fraction -= fractionPeriod;\r\n }\r\n } else if (mode1 !== CurveExtendMode.None) {\r\n if (fraction < 0.0)\r\n fraction += fractionPeriod;\r\n } else { // both clamped\r\n fraction = Geometry.clamp(fraction, 0, 1);\r\n }\r\n }\r\n return fraction;\r\n }\r\n}\r\n/**\r\n * Variant options for extending a curve.\r\n * * Useful for specifying either a single boolean/`CurveExtendMode` option applicable to both ends of the curve,\r\n * or an array of options, the first entry of which applies to the curve start; the second, to curve end.\r\n * @public\r\n */\r\nexport type VariantCurveExtendParameter = boolean | CurveExtendMode | CurveExtendMode[];\r\n"]}
@@ -297,11 +297,15 @@ export declare abstract class CurvePrimitive extends GeometryQuery {
297
297
  * Search for a point on the curve that is closest to the spacePoint.
298
298
  * * If the space point is exactly on the curve, this is the reverse of fractionToPoint.
299
299
  * * Since CurvePrimitive should always have start and end available as candidate points, this method should always
300
- * succeed
301
- * @param spacePoint point in space
302
- * @param extend true to extend the curve (if possible), false for no extend, single CurveExtendOptions (for both
303
- * directions), or array of distinct CurveExtendOptions for start and end.
304
- * @returns Returns a CurveLocationDetail structure that holds the details of the close point.
300
+ * succeed.
301
+ * @param spacePoint point in space.
302
+ * @param extend if applicable, compute the closest point to the curve extended according to variant type:
303
+ * * false: do not extend the curve
304
+ * * true: extend the curve at both start and end
305
+ * * CurveExtendOptions: extend the curve in the specified manner at both start and end
306
+ * * CurveExtendOptions[]: first entry applies to curve start; second, to curve end; any other entries ignored
307
+ * @param result optional pre-allocated detail to populate and return.
308
+ * @returns details of the closest point.
305
309
  */
306
310
  closestPoint(spacePoint: Point3d, extend: VariantCurveExtendParameter, result?: CurveLocationDetail): CurveLocationDetail | undefined;
307
311
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CurvePrimitive.d.ts","sourceRoot":"","sources":["../../../src/curve/CurvePrimitive.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAuB,KAAK,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE/E,OAAO,EAAE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,KAAK,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC5D,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAqB,mBAAmB,EAAqB,MAAM,uBAAuB,CAAC;AAClG,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAIhD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D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Ac;IAK/G;;;;;;;;OAQG;IACI,wBAAwB,CAC7B,cAAc,EAAE,cAAc,EAAE,EAAE,2BAA2B,EAAE,OAAO,EAAE,mBAAmB,GAAE,OAAe,GAC3G,IAAI;IAGP;;;;;;;OAOG;IACI,sBAAsB,CAC3B,cAAc,CAAC,EAAE,cAAc,EAAE,EAAE,0BAA0B,GAAE,OAAe,EAAE,kBAAkB,GAAE,OAAe,GAClH,cAAc,EAAE;IAKnB;;;;;;OAMG;aACa,iBAAiB,CAC/B,uBAAuB,EAAE,MAAM,GAAG,aAAa,GAC9C,cAAc,GAAG,cAAc,EAAE,GAAG,SAAS;IAEhD;;;;;;;OAOG;IACI,uBAAuB,CAAC,IAAI,EAAE,QAAQ,GAAG,KAAK,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS;CAGhG"}
@@ -392,11 +392,15 @@ class CurvePrimitive extends GeometryQuery_1.GeometryQuery {
392
392
  * Search for a point on the curve that is closest to the spacePoint.
393
393
  * * If the space point is exactly on the curve, this is the reverse of fractionToPoint.
394
394
  * * Since CurvePrimitive should always have start and end available as candidate points, this method should always
395
- * succeed
396
- * @param spacePoint point in space
397
- * @param extend true to extend the curve (if possible), false for no extend, single CurveExtendOptions (for both
398
- * directions), or array of distinct CurveExtendOptions for start and end.
399
- * @returns Returns a CurveLocationDetail structure that holds the details of the close point.
395
+ * succeed.
396
+ * @param spacePoint point in space.
397
+ * @param extend if applicable, compute the closest point to the curve extended according to variant type:
398
+ * * false: do not extend the curve
399
+ * * true: extend the curve at both start and end
400
+ * * CurveExtendOptions: extend the curve in the specified manner at both start and end
401
+ * * CurveExtendOptions[]: first entry applies to curve start; second, to curve end; any other entries ignored
402
+ * @param result optional pre-allocated detail to populate and return.
403
+ * @returns details of the closest point.
400
404
  */
401
405
  closestPoint(spacePoint, extend, result) {
402
406
  const strokeHandler = new ClosestPointStrokeHandler_1.ClosestPointStrokeHandler(spacePoint, extend, result);