@itwin/core-geometry 4.9.0-dev.11 → 4.9.0-dev.13

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 (201) hide show
  1. package/lib/cjs/Geometry.d.ts +57 -46
  2. package/lib/cjs/Geometry.d.ts.map +1 -1
  3. package/lib/cjs/Geometry.js +73 -53
  4. package/lib/cjs/Geometry.js.map +1 -1
  5. package/lib/cjs/curve/Arc3d.d.ts +128 -34
  6. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  7. package/lib/cjs/curve/Arc3d.js +174 -20
  8. package/lib/cjs/curve/Arc3d.js.map +1 -1
  9. package/lib/cjs/curve/CurveCollection.d.ts +2 -1
  10. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  11. package/lib/cjs/curve/CurveCollection.js +2 -1
  12. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  13. package/lib/cjs/curve/CurveLocationDetail.d.ts +19 -1
  14. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  15. package/lib/cjs/curve/CurveLocationDetail.js +39 -0
  16. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  17. package/lib/cjs/curve/LineString3d.js +1 -1
  18. package/lib/cjs/curve/LineString3d.js.map +1 -1
  19. package/lib/cjs/curve/OffsetOptions.d.ts +1 -1
  20. package/lib/cjs/curve/OffsetOptions.js +1 -1
  21. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  22. package/lib/cjs/curve/RegionOps.d.ts +2 -1
  23. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  24. package/lib/cjs/curve/RegionOps.js +2 -1
  25. package/lib/cjs/curve/RegionOps.js.map +1 -1
  26. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +23 -7
  27. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  28. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +43 -35
  29. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  30. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts +211 -0
  31. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -0
  32. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +1000 -0
  33. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -0
  34. package/lib/cjs/geometry3d/Angle.d.ts +18 -5
  35. package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
  36. package/lib/cjs/geometry3d/Angle.js +23 -7
  37. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  38. package/lib/cjs/geometry3d/AngleSweep.d.ts +14 -1
  39. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  40. package/lib/cjs/geometry3d/AngleSweep.js +47 -12
  41. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  42. package/lib/cjs/geometry3d/Matrix3d.d.ts +6 -4
  43. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  44. package/lib/cjs/geometry3d/Matrix3d.js +6 -4
  45. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  46. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +2 -3
  47. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  48. package/lib/cjs/geometry3d/Point3dVector3d.js +2 -3
  49. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  50. package/lib/cjs/geometry3d/PointHelpers.d.ts +6 -5
  51. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  52. package/lib/cjs/geometry3d/PointHelpers.js +11 -10
  53. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  54. package/lib/cjs/geometry3d/Range.d.ts +6 -1
  55. package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
  56. package/lib/cjs/geometry3d/Range.js +9 -3
  57. package/lib/cjs/geometry3d/Range.js.map +1 -1
  58. package/lib/cjs/geometry3d/Transform.d.ts +1 -1
  59. package/lib/cjs/geometry3d/Transform.js +1 -1
  60. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  61. package/lib/cjs/numerics/Newton.d.ts +3 -3
  62. package/lib/cjs/numerics/Newton.d.ts.map +1 -1
  63. package/lib/cjs/numerics/Newton.js +14 -16
  64. package/lib/cjs/numerics/Newton.js.map +1 -1
  65. package/lib/cjs/numerics/Polynomials.d.ts +2 -2
  66. package/lib/cjs/numerics/Polynomials.js +2 -2
  67. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  68. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +7 -4
  69. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  70. package/lib/cjs/polyface/PolyfaceBuilder.js +8 -4
  71. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  72. package/lib/cjs/polyface/PolyfaceQuery.d.ts +3 -3
  73. package/lib/cjs/polyface/PolyfaceQuery.js +3 -3
  74. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  75. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  76. package/lib/cjs/serialization/BGFBWriter.js +2 -2
  77. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  78. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  79. package/lib/cjs/topology/Graph.d.ts +1 -1
  80. package/lib/cjs/topology/Graph.js +2 -2
  81. package/lib/cjs/topology/Graph.js.map +1 -1
  82. package/lib/cjs/topology/HalfEdgeNodeXYZUV.d.ts +1 -1
  83. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js +1 -1
  84. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  85. package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts +57 -15
  86. package/lib/cjs/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
  87. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js +168 -127
  88. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  89. package/lib/cjs/topology/HalfEdgePositionDetail.d.ts +35 -35
  90. package/lib/cjs/topology/HalfEdgePositionDetail.d.ts.map +1 -1
  91. package/lib/cjs/topology/HalfEdgePositionDetail.js +63 -41
  92. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  93. package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts +64 -12
  94. package/lib/cjs/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
  95. package/lib/cjs/topology/InsertAndRetriangulateContext.js +174 -75
  96. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  97. package/lib/cjs/topology/Triangulation.d.ts +16 -10
  98. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  99. package/lib/cjs/topology/Triangulation.js +23 -30
  100. package/lib/cjs/topology/Triangulation.js.map +1 -1
  101. package/lib/esm/Geometry.d.ts +57 -46
  102. package/lib/esm/Geometry.d.ts.map +1 -1
  103. package/lib/esm/Geometry.js +73 -53
  104. package/lib/esm/Geometry.js.map +1 -1
  105. package/lib/esm/curve/Arc3d.d.ts +128 -34
  106. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  107. package/lib/esm/curve/Arc3d.js +172 -19
  108. package/lib/esm/curve/Arc3d.js.map +1 -1
  109. package/lib/esm/curve/CurveCollection.d.ts +2 -1
  110. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  111. package/lib/esm/curve/CurveCollection.js +2 -1
  112. package/lib/esm/curve/CurveCollection.js.map +1 -1
  113. package/lib/esm/curve/CurveLocationDetail.d.ts +19 -1
  114. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  115. package/lib/esm/curve/CurveLocationDetail.js +39 -0
  116. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  117. package/lib/esm/curve/LineString3d.js +1 -1
  118. package/lib/esm/curve/LineString3d.js.map +1 -1
  119. package/lib/esm/curve/OffsetOptions.d.ts +1 -1
  120. package/lib/esm/curve/OffsetOptions.js +1 -1
  121. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  122. package/lib/esm/curve/RegionOps.d.ts +2 -1
  123. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  124. package/lib/esm/curve/RegionOps.js +2 -1
  125. package/lib/esm/curve/RegionOps.js.map +1 -1
  126. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +23 -7
  127. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -1
  128. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +43 -35
  129. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  130. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts +211 -0
  131. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -0
  132. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +995 -0
  133. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -0
  134. package/lib/esm/geometry3d/Angle.d.ts +18 -5
  135. package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
  136. package/lib/esm/geometry3d/Angle.js +23 -7
  137. package/lib/esm/geometry3d/Angle.js.map +1 -1
  138. package/lib/esm/geometry3d/AngleSweep.d.ts +14 -1
  139. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  140. package/lib/esm/geometry3d/AngleSweep.js +47 -12
  141. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  142. package/lib/esm/geometry3d/Matrix3d.d.ts +6 -4
  143. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  144. package/lib/esm/geometry3d/Matrix3d.js +6 -4
  145. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  146. package/lib/esm/geometry3d/Point3dVector3d.d.ts +2 -3
  147. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  148. package/lib/esm/geometry3d/Point3dVector3d.js +2 -3
  149. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  150. package/lib/esm/geometry3d/PointHelpers.d.ts +6 -5
  151. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  152. package/lib/esm/geometry3d/PointHelpers.js +11 -10
  153. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  154. package/lib/esm/geometry3d/Range.d.ts +6 -1
  155. package/lib/esm/geometry3d/Range.d.ts.map +1 -1
  156. package/lib/esm/geometry3d/Range.js +9 -3
  157. package/lib/esm/geometry3d/Range.js.map +1 -1
  158. package/lib/esm/geometry3d/Transform.d.ts +1 -1
  159. package/lib/esm/geometry3d/Transform.js +1 -1
  160. package/lib/esm/geometry3d/Transform.js.map +1 -1
  161. package/lib/esm/numerics/Newton.d.ts +3 -3
  162. package/lib/esm/numerics/Newton.d.ts.map +1 -1
  163. package/lib/esm/numerics/Newton.js +14 -16
  164. package/lib/esm/numerics/Newton.js.map +1 -1
  165. package/lib/esm/numerics/Polynomials.d.ts +2 -2
  166. package/lib/esm/numerics/Polynomials.js +2 -2
  167. package/lib/esm/numerics/Polynomials.js.map +1 -1
  168. package/lib/esm/polyface/PolyfaceBuilder.d.ts +7 -4
  169. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  170. package/lib/esm/polyface/PolyfaceBuilder.js +8 -4
  171. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  172. package/lib/esm/polyface/PolyfaceQuery.d.ts +3 -3
  173. package/lib/esm/polyface/PolyfaceQuery.js +3 -3
  174. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  175. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  176. package/lib/esm/serialization/BGFBWriter.js +2 -2
  177. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  178. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  179. package/lib/esm/topology/Graph.d.ts +1 -1
  180. package/lib/esm/topology/Graph.js +2 -2
  181. package/lib/esm/topology/Graph.js.map +1 -1
  182. package/lib/esm/topology/HalfEdgeNodeXYZUV.d.ts +1 -1
  183. package/lib/esm/topology/HalfEdgeNodeXYZUV.js +1 -1
  184. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  185. package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts +57 -15
  186. package/lib/esm/topology/HalfEdgePointInGraphSearch.d.ts.map +1 -1
  187. package/lib/esm/topology/HalfEdgePointInGraphSearch.js +168 -127
  188. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  189. package/lib/esm/topology/HalfEdgePositionDetail.d.ts +35 -35
  190. package/lib/esm/topology/HalfEdgePositionDetail.d.ts.map +1 -1
  191. package/lib/esm/topology/HalfEdgePositionDetail.js +63 -41
  192. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  193. package/lib/esm/topology/InsertAndRetriangulateContext.d.ts +64 -12
  194. package/lib/esm/topology/InsertAndRetriangulateContext.d.ts.map +1 -1
  195. package/lib/esm/topology/InsertAndRetriangulateContext.js +173 -74
  196. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  197. package/lib/esm/topology/Triangulation.d.ts +16 -10
  198. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  199. package/lib/esm/topology/Triangulation.js +24 -31
  200. package/lib/esm/topology/Triangulation.js.map +1 -1
  201. package/package.json +3 -3
@@ -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,EAAE,MAAM,aAAa,CAAC;AAOvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,uCAAuC,CAAC;AAC3E,OA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,OAAO,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","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 * * 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"]}
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;AAOvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD,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;AAoB1C;;;;;;;;;;;;GAYG;AACH,MAAM,OAAgB,eAAgB,SAAQ,aAAa;IAA3D;;QACE,wCAAwC;QACxB,qBAAgB,GAAG,iBAAiB,CAAC;QAGrD,uDAAuD;QAChD,YAAO,GAAY,KAAK,CAAC;IA4LlC,CAAC;IAzLC,6DAA6D;IACtD,UAAU;QACf,OAAO,iBAAiB,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;IAC5C,CAAC;IACD,uDAAuD;IAChD,YAAY,CAAC,UAAmB;QACrC,IAAI,OAAwC,CAAC;QAC7C,IAAI,IAAI,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AK,GAAG,IAAI,WAAW,EAAE,CAAC;QAChC,IAAI,KAAK,CAAC;QACV,KAAK,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YAC5B,IAAI,KAAK,YAAY,cAAc,EAAE,CAAC;gBACpC,MAAM,EAAE,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;gBACjC,KAAK,CAAC,WAAW,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;gBAC/B,IAAI,EAAE;oBACJ,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YAC5B,CAAC;iBAAM,IAAI,KAAK,YAAY,eAAe,EAAE,CAAC;gBAC5C,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC,OAAO,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","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,5 +1,6 @@
1
1
  import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
2
2
  import { Ray3d } from "../geometry3d/Ray3d";
3
+ import { Transform } from "../geometry3d/Transform";
3
4
  import { CurvePrimitive } from "./CurvePrimitive";
4
5
  /**
5
6
  * An enumeration of special conditions being described by a CurveLocationDetail.
@@ -65,7 +66,7 @@ export declare class CurveLocationDetail {
65
66
  fraction1?: number;
66
67
  /** (Optional) second point, e.g. end of interval of coincident curves */
67
68
  point1?: Point3d;
68
- /** A context-specific additional point */
69
+ /** A context-specific temporary point, e.g. for intermediate calculations. */
69
70
  pointQ: Point3d;
70
71
  /** Constructor */
71
72
  constructor();
@@ -163,6 +164,16 @@ export declare class CurveLocationDetail {
163
164
  curve: CurvePrimitive;
164
165
  fraction: number;
165
166
  }): boolean;
167
+ /**
168
+ * Transform the detail in place.
169
+ * * All numerical properties are transformed directly, except:
170
+ * * when `curve` is defined, `point` and `point1` are reset by evaluating the transformed curve at `fraction` and `fraction1`
171
+ * * these properties are untouched: `a`, `fraction`, `fraction1`, `pointQ`
172
+ * @param transform the transform to apply
173
+ * @return true if and only if the transformation was successful. If false, the instance is in an indeterminate
174
+ * state and should not be used.
175
+ */
176
+ tryTransformInPlace(transform: Transform): boolean;
166
177
  }
167
178
  /**
168
179
  * Enumeration of configurations for intersections and min/max distance-between-curve
@@ -215,6 +226,13 @@ export declare class CurveLocationDetailPair {
215
226
  * @internal
216
227
  */
217
228
  static removeAdjacentDuplicates(pairs: CurveLocationDetailPair[], index0?: number): CurveLocationDetailPair[];
229
+ /**
230
+ * Transform the details in place.
231
+ * @param transform the transform to apply
232
+ * @return true if and only if the transformation was successful on both details.
233
+ * If false, the instance is in an indeterminate state and should not be used.
234
+ */
235
+ tryTransformInPlace(transform: Transform): boolean;
218
236
  }
219
237
  /**
220
238
  * Data bundle for a pair of arrays of CurveLocationDetail structures.
@@ -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,2CAA2C;IAC3C,aAAa,KAAK;IAClB,gDAAgD;IAChD,gBAAgB,KAAK;IACrB,qCAAqC;IACrC,WAAW,KAAK;CACjB;AAED;;;GAGG;AACH,oBAAY,iBAAiB;IAC3B,0CAA0C;IAC1C,KAAK,IAAA;IACL,iCAAiC;IACjC,OAAO,IAAI;IACX,4FAA4F;IAC5F,iBAAiB,IAAI;CACtB;AAaD;;;;;GAKG;AACH,qBAAa,mBAAmB;IAC9B,gCAAgC;IACzB,KAAK,CAAC,EAAE,cAAc,CAAC;IAC9B,mBAAmB;IACZ,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qC;IACrC,YAAY,IAAI;IAChB,iHAAiH;IACjH,kBAAkB,IAAI;IACtB,qCAAqC;IACrC,kBAAkB,IAAI;IACtB,oCAAoC;IACpC,gBAAgB,IAAI;CACrB;AAED;;;GAGG;AACH,qBAAa,uBAAuB;IAClC,oCAAoC;IAC7B,OAAO,EAAE,mBAAmB,CAAC;IACpC,qCAAqC;IAC9B,OAAO,EAAE,mBAAmB,CAAC;IACpC;;;OAGG;IACI,YAAY,CAAC,EAAE,sBAAsB,CAAC;gBAE1B,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;IAKlB;;;;;;;;;OASG;WACW,wBAAwB,CAAC,KAAK,EAAE,uBAAuB,EAAE,EAAE,MAAM,GAAE,MAAU,GAAG,uBAAuB,EAAE;IAgBvH;;;;;OAKG;IACI,mBAAmB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO;CAG1D;AAED;;;;GAIG;AACH,qBAAa,4BAA4B;IACvC,8BAA8B;IACvB,KAAK,EAAE,mBAAmB,EAAE,CAAC;IACpC,+BAA+B;IACxB,KAAK,EAAE,mBAAmB,EAAE,CAAC;;CAKrC"}
@@ -327,6 +327,36 @@ export class CurveLocationDetail {
327
327
  isSameCurveAndFraction(other) {
328
328
  return this.curve === other.curve && Geometry.isAlmostEqualNumber(this.fraction, other.fraction);
329
329
  }
330
+ /**
331
+ * Transform the detail in place.
332
+ * * All numerical properties are transformed directly, except:
333
+ * * when `curve` is defined, `point` and `point1` are reset by evaluating the transformed curve at `fraction` and `fraction1`
334
+ * * these properties are untouched: `a`, `fraction`, `fraction1`, `pointQ`
335
+ * @param transform the transform to apply
336
+ * @return true if and only if the transformation was successful. If false, the instance is in an indeterminate
337
+ * state and should not be used.
338
+ */
339
+ tryTransformInPlace(transform) {
340
+ if (this.curve && !this.curve.tryTransformInPlace(transform))
341
+ return false;
342
+ if (this.ray)
343
+ this.ray.transformInPlace(transform);
344
+ if (this.curve)
345
+ this.curve.fractionToPoint(this.fraction, this.point);
346
+ else
347
+ transform.multiplyXYAndZInPlace(this.point);
348
+ if (this.vectorInCurveLocationDetail)
349
+ transform.multiplyVectorInPlace(this.vectorInCurveLocationDetail);
350
+ if (this.childDetail && this.childDetail !== this && !this.childDetail.tryTransformInPlace(transform))
351
+ return false;
352
+ if (this.point1) {
353
+ if (this.curve && this.fraction1)
354
+ this.curve.fractionToPoint(this.fraction1, this.point1);
355
+ else
356
+ transform.multiplyXYAndZInPlace(this.point1);
357
+ }
358
+ return true;
359
+ }
330
360
  }
331
361
  /**
332
362
  * Enumeration of configurations for intersections and min/max distance-between-curve
@@ -413,6 +443,15 @@ export class CurveLocationDetailPair {
413
443
  return [pair]; // preserve the i_th pair
414
444
  });
415
445
  }
446
+ /**
447
+ * Transform the details in place.
448
+ * @param transform the transform to apply
449
+ * @return true if and only if the transformation was successful on both details.
450
+ * If false, the instance is in an indeterminate state and should not be used.
451
+ */
452
+ tryTransformInPlace(transform) {
453
+ return this.detailA.tryTransformInPlace(transform) && this.detailB.tryTransformInPlace(transform);
454
+ }
416
455
  }
417
456
  /**
418
457
  * Data bundle for a pair of arrays of CurveLocationDetail structures.
@@ -1 +1 @@
1
- {"version":3,"file":"CurveLocationDetail.js","sourceRoot":"","sources":["../../../src/curve/CurveLocationDetail.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG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AChB,CAAC;IACD,+BAA+B;IACxB,WAAW;QAChB,MAAM,CAAC,GAAG,IAAI,CAAC,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,CAAC,CAAC;IACnB,CAAC;IACD;;;;;;;;;OASG;IACI,MAAM,CAAC,wBAAwB,CAAC,KAAgC,EAAE,SAAiB,CAAC;QACzF,OAAO,KAAK,CAAC,OAAO,CAClB,CAAC,IAA6B,EAAE,CAAS,EAAE,GAA8B,EAAE,EAAE;YAC3E,IAAI,CAAC,IAAI,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,CAAC;oBAC7D,IAAI,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;wBAC5D,IAAI,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;4BAC5D,OAAO,EAAE,CAAC,CAAE,uBAAuB;wBACrC,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAE,yBAAyB;QAC3C,CAAC,CACF,CAAC;IACJ,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,4BAA4B;IAKvC;QACE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry, ICloneable } from \"../Geometry\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\n\r\n/**\r\n * An enumeration of special conditions being described by a CurveLocationDetail.\r\n * @public\r\n */\r\nexport enum CurveIntervalRole {\r\n /** This point is an isolated point NOT at a primary vertex. */\r\n isolated = 0,\r\n /** This point is an isolated vertex hit */\r\n isolatedAtVertex = 1,\r\n /** This is the beginning of an interval */\r\n intervalStart = 10,\r\n /** This is an interior point of an interval. */\r\n intervalInterior = 11,\r\n /** This is the end of an interval */\r\n intervalEnd = 12,\r\n}\r\n\r\n/**\r\n * Return code for CurvePrimitive method `moveSignedDistanceFromFraction`\r\n * @public\r\n */\r\nexport enum CurveSearchStatus {\r\n /** Unimplemented or zero length curve */\r\n error,\r\n /** Complete success of search */\r\n success = 1,\r\n /** Search ended prematurely (e.g. at incomplete distance moved) at start or end of curve */\r\n stoppedAtBoundary = 2,\r\n}\r\n\r\n/**\r\n * Use to update a cloneable object when source and/or prior result are possibly undefined.\r\n * * Any undefined source returns undefined.\r\n * * For defined source, reuse optional result if available.\r\n * @param source optional source\r\n * @param result optional result\r\n */\r\nfunction optionalUpdate<T extends ICloneable<T>>(source: T | undefined, result: T | undefined): T | undefined {\r\n return source ? source.clone(result) : undefined;\r\n}\r\n\r\n/**\r\n * CurveLocationDetail carries point and parameter data about a point evaluated on a curve.\r\n * * These are returned by a variety of queries.\r\n * * Particular contents can vary among the queries.\r\n * @public\r\n */\r\nexport class CurveLocationDetail {\r\n /** The curve being evaluated */\r\n public curve?: CurvePrimitive;\r\n /** Optional ray */\r\n public ray?: Ray3d;\r\n /** The fractional position along the curve */\r\n public fraction: number;\r\n /** Detail condition of the role this point has in some context */\r\n public intervalRole?: CurveIntervalRole;\r\n /** The point on the curve */\r\n public point: Point3d;\r\n /** A vector (e.g. tangent vector) in context */\r\n public vectorInCurveLocationDetail?: Vector3d;\r\n /** A context-specific numeric value. (e.g. a distance) */\r\n public a: number;\r\n /**\r\n * Optional CurveLocationDetail with more detail of location. For instance, a detail for fractional position\r\n * within a CurveChainWithDistanceIndex returns fraction and distance along the chain as its primary data and\r\n * further detail of the particular curve within the chain in the childDetail.\r\n */\r\n public childDetail?: CurveLocationDetail;\r\n /**\r\n * A status indicator for certain searches.\r\n * * e.g. CurvePrimitive.moveSignedDistanceFromFraction\r\n */\r\n public curveSearchStatus?: CurveSearchStatus;\r\n /** (Optional) second fraction, e.g. end of interval of coincident curves */\r\n public fraction1?: number;\r\n /** (Optional) second point, e.g. end of interval of coincident curves */\r\n public point1?: Point3d;\r\n /** A context-specific additional point */\r\n public pointQ: Point3d; // extra point for use in computations\r\n /** Constructor */\r\n public constructor() {\r\n this.pointQ = Point3d.createZero();\r\n this.fraction = 0;\r\n this.point = Point3d.createZero();\r\n this.a = 0.0;\r\n }\r\n /** Set the (optional) intervalRole field */\r\n public setIntervalRole(value: CurveIntervalRole): void {\r\n this.intervalRole = value;\r\n }\r\n /** Set the (optional) fraction1 and point1, using direct assignment (capture!) to point1 */\r\n public captureFraction1Point1(fraction1: number, point1: Point3d): void {\r\n this.fraction1 = fraction1;\r\n this.point1 = point1;\r\n }\r\n /** Test if this pair has fraction1 defined */\r\n public get hasFraction1(): boolean {\r\n return this.fraction1 !== undefined;\r\n }\r\n /** Test if this is an isolated point. This is true if intervalRole is any of (undefined, isolated, isolatedAtVertex) */\r\n public get isIsolated(): boolean {\r\n return this.intervalRole === undefined\r\n || this.intervalRole === CurveIntervalRole.isolated\r\n || this.intervalRole === CurveIntervalRole.isolatedAtVertex;\r\n }\r\n /** Return the fraction delta. (0 if no fraction1) */\r\n public get fractionDelta(): number {\r\n return this.fraction1 !== undefined ? this.fraction1 - this.fraction : 0.0;\r\n }\r\n /**\r\n * If (fraction1, point1) are defined, make them the primary (and only) data.\r\n * * No action if undefined.\r\n */\r\n public collapseToEnd() {\r\n if (this.fraction1 !== undefined)\r\n this.fraction = this.fraction1;\r\n if (this.point1)\r\n this.point = this.point1;\r\n this.collapseToStart();\r\n }\r\n /** Make (fraction, point) the primary (and only) data. */\r\n public collapseToStart() {\r\n this.fraction1 = undefined;\r\n this.point1 = undefined;\r\n }\r\n /**\r\n * Return a complete copy, WITH CAVEATS . . .\r\n * * curve member is copied as a reference.\r\n * * point and vector members are cloned.\r\n */\r\n public clone(result?: CurveLocationDetail): CurveLocationDetail {\r\n if (result === this)\r\n return result;\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = this.curve;\r\n result.fraction = this.fraction;\r\n result.fraction1 = this.fraction1;\r\n result.point1 = optionalUpdate<Point3d>(this.point1, result.point1);\r\n result.point.setFromPoint3d(this.point);\r\n result.vectorInCurveLocationDetail = optionalUpdate<Vector3d>(this.vectorInCurveLocationDetail, result.vectorInCurveLocationDetail);\r\n result.a = this.a;\r\n result.childDetail = optionalUpdate<CurveLocationDetail>(this.childDetail, result.childDetail);\r\n result.curveSearchStatus = this.curveSearchStatus;\r\n return result;\r\n }\r\n /**\r\n * Updated in this instance.\r\n * * Note that if caller omits `vector` and `a`, those fields are updated to the call-list defaults (NOT left as-is)\r\n * * point and vector updates are by data copy (not capture of pointers)\r\n * @param fraction (required) fraction to install\r\n * @param point (required) point to install\r\n * @param vector (optional) vector to install.\r\n * @param a (optional) numeric value to install.\r\n */\r\n public setFP(fraction: number, point: Point3d, vector?: Vector3d, a: number = 0.0): void {\r\n this.fraction = fraction;\r\n this.point.setFromPoint3d(point);\r\n this.vectorInCurveLocationDetail = optionalUpdate<Vector3d>(vector, this.vectorInCurveLocationDetail);\r\n this.a = a;\r\n }\r\n /**\r\n * Updated in this instance.\r\n * * Note that if caller omits a`, that field is updated to the call-list default (NOT left as-is)\r\n * * point and vector updates are by data copy (not capture of the ray members)\r\n * @param fraction (required) fraction to install\r\n * @param ray (required) point and vector to install\r\n * @param a (optional) numeric value to install.\r\n */\r\n public setFR(fraction: number, ray: Ray3d, a: number = 0): void {\r\n return this.setFP(fraction, ray.origin, ray.direction, a);\r\n }\r\n /** Set the CurvePrimitive pointer, leaving all other properties untouched. */\r\n public setCurve(curve: CurvePrimitive) {\r\n this.curve = curve;\r\n }\r\n /** Record the distance from the CurveLocationDetail's point to the parameter point. */\r\n public setDistanceTo(point: Point3d) {\r\n this.a = this.point.distance(point);\r\n }\r\n /** Create with a CurvePrimitive pointer but no coordinate data. */\r\n public static create(curve?: CurvePrimitive, result?: CurveLocationDetail): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n return result;\r\n }\r\n /** Create a new detail using CurvePrimitive pointer, fraction, and point coordinates. */\r\n public static createCurveFractionPoint(\r\n curve: CurvePrimitive | undefined, fraction: number, point: Point3d, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n result.point.setFromPoint3d(point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = 0.0;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /** Create a new detail with only ray, fraction, and point. */\r\n public static createRayFractionPoint(\r\n ray: Ray3d, fraction: number, point: Point3d, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.fraction = fraction;\r\n result.ray = ray;\r\n result.point.setFromPoint3d(point);\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer, fraction, and point coordinates */\r\n public static createCurveFractionPointDistanceCurveSearchStatus(\r\n curve: CurvePrimitive | undefined,\r\n fraction: number,\r\n point: Point3d,\r\n distance: number,\r\n status: CurveSearchStatus,\r\n result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n result.point.setFromPoint3d(point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = distance;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = status;\r\n return result;\r\n }\r\n /** Create with curveSearchStatus affected by allowExtension. */\r\n public static createConditionalMoveSignedDistance(\r\n allowExtension: boolean,\r\n curve: CurvePrimitive,\r\n startFraction: number,\r\n endFraction: number,\r\n requestedSignedDistance: number,\r\n result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n let a = requestedSignedDistance;\r\n let status = CurveSearchStatus.success;\r\n if (!allowExtension && !Geometry.isIn01(endFraction)) {\r\n // cap the movement at the endpoint\r\n if (endFraction < 0.0) {\r\n a = - curve.curveLengthBetweenFractions(startFraction, 0.0);\r\n endFraction = 0.0;\r\n status = CurveSearchStatus.stoppedAtBoundary;\r\n } else if (endFraction > 1.0) {\r\n endFraction = 1.0;\r\n a = curve.curveLengthBetweenFractions(startFraction, 1.0);\r\n status = CurveSearchStatus.stoppedAtBoundary;\r\n }\r\n }\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = endFraction;\r\n curve.fractionToPoint(endFraction, result.point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = a;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = status;\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\r\n public static createCurveEvaluatedFraction(\r\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n curve.fractionToPoint(fraction, result.point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = 0.0;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\r\n public static createCurveEvaluatedFractionPointAndDerivative(\r\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n const ray = curve.fractionToPointAndDerivative(fraction);\r\n result.point.setFromPoint3d(ray.origin);\r\n result.vectorInCurveLocationDetail = ray.direction;\r\n result.a = 0.0;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer and 2 fractions for evaluation. */\r\n public static createCurveEvaluatedFractionFraction(\r\n curve: CurvePrimitive, fraction0: number, fraction1: number, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction0;\r\n curve.fractionToPoint(fraction0, result.point);\r\n result.fraction1 = fraction1;\r\n result.point1 = curve.fractionToPoint(fraction1, result.point1);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = 0.0;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer, fraction, and point coordinates. */\r\n public static createCurveFractionPointDistance(\r\n curve: CurvePrimitive,\r\n fraction: number,\r\n point: Point3d,\r\n a: number,\r\n result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n result.point.setFromPoint3d(point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = a;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /**\r\n * Update or create if closer than current contents.\r\n * @param curve candidate curve\r\n * @param fraction candidate fraction\r\n * @param point candidate point\r\n * @param a candidate distance\r\n * @returns true if the given distance is smaller (and hence this detail was updated.)\r\n */\r\n public updateIfCloserCurveFractionPointDistance(\r\n curve: CurvePrimitive, fraction: number, point: Point3d, a: number,\r\n ): boolean {\r\n if (this.a < a)\r\n return false;\r\n CurveLocationDetail.createCurveFractionPointDistance(curve, fraction, point, a, this);\r\n return true;\r\n }\r\n /**\r\n * Exchange the (fraction,fraction1) and (point, point1) pairs.\r\n * * (Skip each swap if its \"1\" value is undefined)\r\n */\r\n public swapFractionsAndPoints(): void {\r\n if (this.fraction1 !== undefined) {\r\n const f = this.fraction;\r\n this.fraction = this.fraction1;\r\n this.fraction1 = f;\r\n }\r\n if (this.point1 !== undefined) {\r\n const p = this.point;\r\n this.point = this.point1;\r\n this.point1 = p;\r\n }\r\n }\r\n /**\r\n * Return the fraction where f falls between fraction and fraction1.\r\n * * ASSUME fraction1 defined\r\n */\r\n public inverseInterpolateFraction(f: number, defaultFraction: number = 0): number {\r\n const a = Geometry.inverseInterpolate01(this.fraction, this.fraction1!, f);\r\n if (a === undefined)\r\n return defaultFraction;\r\n return a;\r\n }\r\n /**\r\n * Return the detail with smaller `a` value -- detailA returned if equal.\r\n * @param detailA first candidate\r\n * @param detailB second candidate\r\n */\r\n public static chooseSmallerA(\r\n detailA: CurveLocationDetail | undefined, detailB: CurveLocationDetail | undefined,\r\n ): CurveLocationDetail | undefined {\r\n if (detailA) {\r\n if (!detailB)\r\n return detailA;\r\n return detailA.a <= detailB.a ? detailA : detailB;\r\n }\r\n return detailB;\r\n }\r\n /** Compare only the curve and fraction of this detail with `other`. */\r\n public isSameCurveAndFraction(other: CurveLocationDetail | {curve: CurvePrimitive, fraction: number}): boolean {\r\n return this.curve === other.curve && Geometry.isAlmostEqualNumber(this.fraction, other.fraction);\r\n }\r\n}\r\n\r\n/**\r\n * Enumeration of configurations for intersections and min/max distance-between-curve\r\n * @public\r\n */\r\nexport enum CurveCurveApproachType {\r\n /** Intersection at a single point */\r\n Intersection = 0,\r\n /** Distinct points on the two curves, with each curve's tangent perpendicular to the chord between the points */\r\n PerpendicularChord = 1,\r\n /** Completely coincident geometry */\r\n CoincidentGeometry = 2,\r\n /** Completely parallel geometry. */\r\n ParallelGeometry = 3,\r\n}\r\n\r\n/**\r\n * A pair of CurveLocationDetail.\r\n * @public\r\n */\r\nexport class CurveLocationDetailPair {\r\n /** The first of the two details. */\r\n public detailA: CurveLocationDetail;\r\n /** The second of the two details. */\r\n public detailB: CurveLocationDetail;\r\n /**\r\n * Enumeration of how the detail pairs relate.\r\n * * This is set only by certain closeApproach calculations.\r\n */\r\n public approachType?: CurveCurveApproachType;\r\n\r\n public constructor(detailA?: CurveLocationDetail, detailB?: CurveLocationDetail) {\r\n this.detailA = detailA ? detailA : new CurveLocationDetail();\r\n this.detailB = detailB ? detailB : new CurveLocationDetail();\r\n }\r\n /** Create a curve detail pair using references to two CurveLocationDetails */\r\n public static createCapture(\r\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, result?: CurveLocationDetailPair,\r\n ): CurveLocationDetailPair {\r\n result = result ? result : new CurveLocationDetailPair();\r\n result.detailA = detailA;\r\n result.detailB = detailB;\r\n return result;\r\n }\r\n /**\r\n * Create a curve detail pair using references to two CurveLocationDetails.\r\n * * optionally install in reversed positions\r\n */\r\n public static createCaptureOptionalReverse(\r\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, reversed: boolean, result?: CurveLocationDetailPair,\r\n ): CurveLocationDetailPair {\r\n result = result ? result : new CurveLocationDetailPair();\r\n if (reversed) {\r\n result.detailA = detailA;\r\n result.detailB = detailB;\r\n\r\n } else {\r\n result.detailA = detailA;\r\n result.detailB = detailB;\r\n }\r\n return result;\r\n }\r\n /** Make a deep copy of this CurveLocationDetailPair */\r\n public clone(result?: CurveLocationDetailPair): CurveLocationDetailPair {\r\n result = result ? result : new CurveLocationDetailPair();\r\n result.detailA = this.detailA.clone();\r\n result.detailB = this.detailB.clone();\r\n result.approachType = this.approachType;\r\n return result;\r\n }\r\n /** Swap the details of A, B */\r\n public swapDetails() {\r\n const q = this.detailA;\r\n this.detailA = this.detailB;\r\n this.detailB = q;\r\n }\r\n /**\r\n * Mutate the input array by removing the second of two adjacent duplicate pairs.\r\n * * Ignores details representing coincident intervals (e.g., for which `fraction1` is defined).\r\n * * Comparison is performed by [[CurveLocationDetail.isSameCurveAndFraction]].\r\n * * No sorting is performed.\r\n * @param pairs array to de-duplicate in place\r\n * @param index0 look for duplicates in the tail of the array starting at index0\r\n * @return reference to input array\r\n * @internal\r\n */\r\n public static removeAdjacentDuplicates(pairs: CurveLocationDetailPair[], index0: number = 0): CurveLocationDetailPair[] {\r\n return pairs.flatMap(\r\n (pair: CurveLocationDetailPair, i: number, arr: CurveLocationDetailPair[]) => {\r\n if (i >= index0 && i > 0) {\r\n if (!pair.detailA.hasFraction1 && !pair.detailB.hasFraction1) {\r\n if (pair.detailA.isSameCurveAndFraction(arr[i - 1].detailA)) {\r\n if (pair.detailB.isSameCurveAndFraction(arr[i - 1].detailB)) {\r\n return []; // remove the i_th pair\r\n }\r\n }\r\n }\r\n }\r\n return [pair]; // preserve the i_th pair\r\n },\r\n );\r\n }\r\n}\r\n\r\n/**\r\n * Data bundle for a pair of arrays of CurveLocationDetail structures.\r\n * @deprecated in 4.x. Use CurveLocationDetailPair[] instead.\r\n * @public\r\n */\r\nexport class CurveLocationDetailArrayPair {\r\n /** First array of details. */\r\n public dataA: CurveLocationDetail[];\r\n /** Second array of details. */\r\n public dataB: CurveLocationDetail[];\r\n public constructor() {\r\n this.dataA = [];\r\n this.dataB = [];\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"CurveLocationDetail.js","sourceRoot":"","sources":["../../../src/curve/CurveLocationDetail.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAc,MAAM,aAAa,CAAC;AACnD,OAAO,EAAE,OAAO,EAAY,MAAM,+BAA+B,CAAC;AAKlE;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAWX;AAXD,WAAY,iBAAiB;IAC3B,+DAA+D;IAC/D,iEAAY,CAAA;IACZ,2CAA2C;IAC3C,iFAAoB,CAAA;IACpB,2CAA2C;IAC3C,4EAAkB,CAAA;IAClB,gDAAgD;IAChD,kFAAqB,CAAA;IACrB,qCAAqC;IACrC,wEAAgB,CAAA;AAClB,CAAC,EAXW,iBAAiB,KA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AG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;wBAC5D,IAAI,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;4BAC5D,OAAO,EAAE,CAAC,CAAE,uBAAuB;wBACrC,CAAC;oBACH,CAAC;gBACH,CAAC;YACH,CAAC;YACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAE,yBAAyB;QAC3C,CAAC,CACF,CAAC;IACJ,CAAC;IACD;;;;;OAKG;IACI,mBAAmB,CAAC,SAAoB;QAC7C,OAAO,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;IACpG,CAAC;CACF;AAED;;;;GAIG;AACH,MAAM,OAAO,4BAA4B;IAKvC;QACE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry, ICloneable } from \"../Geometry\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\n\r\n/**\r\n * An enumeration of special conditions being described by a CurveLocationDetail.\r\n * @public\r\n */\r\nexport enum CurveIntervalRole {\r\n /** This point is an isolated point NOT at a primary vertex. */\r\n isolated = 0,\r\n /** This point is an isolated vertex hit */\r\n isolatedAtVertex = 1,\r\n /** This is the beginning of an interval */\r\n intervalStart = 10,\r\n /** This is an interior point of an interval. */\r\n intervalInterior = 11,\r\n /** This is the end of an interval */\r\n intervalEnd = 12,\r\n}\r\n\r\n/**\r\n * Return code for CurvePrimitive method `moveSignedDistanceFromFraction`\r\n * @public\r\n */\r\nexport enum CurveSearchStatus {\r\n /** Unimplemented or zero length curve */\r\n error,\r\n /** Complete success of search */\r\n success = 1,\r\n /** Search ended prematurely (e.g. at incomplete distance moved) at start or end of curve */\r\n stoppedAtBoundary = 2,\r\n}\r\n\r\n/**\r\n * Use to update a cloneable object when source and/or prior result are possibly undefined.\r\n * * Any undefined source returns undefined.\r\n * * For defined source, reuse optional result if available.\r\n * @param source optional source\r\n * @param result optional result\r\n */\r\nfunction optionalUpdate<T extends ICloneable<T>>(source: T | undefined, result: T | undefined): T | undefined {\r\n return source ? source.clone(result) : undefined;\r\n}\r\n\r\n/**\r\n * CurveLocationDetail carries point and parameter data about a point evaluated on a curve.\r\n * * These are returned by a variety of queries.\r\n * * Particular contents can vary among the queries.\r\n * @public\r\n */\r\nexport class CurveLocationDetail {\r\n /** The curve being evaluated */\r\n public curve?: CurvePrimitive;\r\n /** Optional ray */\r\n public ray?: Ray3d;\r\n /** The fractional position along the curve */\r\n public fraction: number;\r\n /** Detail condition of the role this point has in some context */\r\n public intervalRole?: CurveIntervalRole;\r\n /** The point on the curve */\r\n public point: Point3d;\r\n /** A vector (e.g. tangent vector) in context */\r\n public vectorInCurveLocationDetail?: Vector3d;\r\n /** A context-specific numeric value. (e.g. a distance) */\r\n public a: number;\r\n /**\r\n * Optional CurveLocationDetail with more detail of location. For instance, a detail for fractional position\r\n * within a CurveChainWithDistanceIndex returns fraction and distance along the chain as its primary data and\r\n * further detail of the particular curve within the chain in the childDetail.\r\n */\r\n public childDetail?: CurveLocationDetail;\r\n /**\r\n * A status indicator for certain searches.\r\n * * e.g. CurvePrimitive.moveSignedDistanceFromFraction\r\n */\r\n public curveSearchStatus?: CurveSearchStatus;\r\n /** (Optional) second fraction, e.g. end of interval of coincident curves */\r\n public fraction1?: number;\r\n /** (Optional) second point, e.g. end of interval of coincident curves */\r\n public point1?: Point3d;\r\n /** A context-specific temporary point, e.g. for intermediate calculations. */\r\n public pointQ: Point3d;\r\n /** Constructor */\r\n public constructor() {\r\n this.pointQ = Point3d.createZero();\r\n this.fraction = 0;\r\n this.point = Point3d.createZero();\r\n this.a = 0.0;\r\n }\r\n /** Set the (optional) intervalRole field */\r\n public setIntervalRole(value: CurveIntervalRole): void {\r\n this.intervalRole = value;\r\n }\r\n /** Set the (optional) fraction1 and point1, using direct assignment (capture!) to point1 */\r\n public captureFraction1Point1(fraction1: number, point1: Point3d): void {\r\n this.fraction1 = fraction1;\r\n this.point1 = point1;\r\n }\r\n /** Test if this pair has fraction1 defined */\r\n public get hasFraction1(): boolean {\r\n return this.fraction1 !== undefined;\r\n }\r\n /** Test if this is an isolated point. This is true if intervalRole is any of (undefined, isolated, isolatedAtVertex) */\r\n public get isIsolated(): boolean {\r\n return this.intervalRole === undefined\r\n || this.intervalRole === CurveIntervalRole.isolated\r\n || this.intervalRole === CurveIntervalRole.isolatedAtVertex;\r\n }\r\n /** Return the fraction delta. (0 if no fraction1) */\r\n public get fractionDelta(): number {\r\n return this.fraction1 !== undefined ? this.fraction1 - this.fraction : 0.0;\r\n }\r\n /**\r\n * If (fraction1, point1) are defined, make them the primary (and only) data.\r\n * * No action if undefined.\r\n */\r\n public collapseToEnd() {\r\n if (this.fraction1 !== undefined)\r\n this.fraction = this.fraction1;\r\n if (this.point1)\r\n this.point = this.point1;\r\n this.collapseToStart();\r\n }\r\n /** Make (fraction, point) the primary (and only) data. */\r\n public collapseToStart() {\r\n this.fraction1 = undefined;\r\n this.point1 = undefined;\r\n }\r\n /**\r\n * Return a complete copy, WITH CAVEATS . . .\r\n * * curve member is copied as a reference.\r\n * * point and vector members are cloned.\r\n */\r\n public clone(result?: CurveLocationDetail): CurveLocationDetail {\r\n if (result === this)\r\n return result;\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = this.curve;\r\n result.fraction = this.fraction;\r\n result.fraction1 = this.fraction1;\r\n result.point1 = optionalUpdate<Point3d>(this.point1, result.point1);\r\n result.point.setFromPoint3d(this.point);\r\n result.vectorInCurveLocationDetail = optionalUpdate<Vector3d>(this.vectorInCurveLocationDetail, result.vectorInCurveLocationDetail);\r\n result.a = this.a;\r\n result.childDetail = optionalUpdate<CurveLocationDetail>(this.childDetail, result.childDetail);\r\n result.curveSearchStatus = this.curveSearchStatus;\r\n return result;\r\n }\r\n /**\r\n * Updated in this instance.\r\n * * Note that if caller omits `vector` and `a`, those fields are updated to the call-list defaults (NOT left as-is)\r\n * * point and vector updates are by data copy (not capture of pointers)\r\n * @param fraction (required) fraction to install\r\n * @param point (required) point to install\r\n * @param vector (optional) vector to install.\r\n * @param a (optional) numeric value to install.\r\n */\r\n public setFP(fraction: number, point: Point3d, vector?: Vector3d, a: number = 0.0): void {\r\n this.fraction = fraction;\r\n this.point.setFromPoint3d(point);\r\n this.vectorInCurveLocationDetail = optionalUpdate<Vector3d>(vector, this.vectorInCurveLocationDetail);\r\n this.a = a;\r\n }\r\n /**\r\n * Updated in this instance.\r\n * * Note that if caller omits a`, that field is updated to the call-list default (NOT left as-is)\r\n * * point and vector updates are by data copy (not capture of the ray members)\r\n * @param fraction (required) fraction to install\r\n * @param ray (required) point and vector to install\r\n * @param a (optional) numeric value to install.\r\n */\r\n public setFR(fraction: number, ray: Ray3d, a: number = 0): void {\r\n return this.setFP(fraction, ray.origin, ray.direction, a);\r\n }\r\n /** Set the CurvePrimitive pointer, leaving all other properties untouched. */\r\n public setCurve(curve: CurvePrimitive) {\r\n this.curve = curve;\r\n }\r\n /** Record the distance from the CurveLocationDetail's point to the parameter point. */\r\n public setDistanceTo(point: Point3d) {\r\n this.a = this.point.distance(point);\r\n }\r\n /** Create with a CurvePrimitive pointer but no coordinate data. */\r\n public static create(curve?: CurvePrimitive, result?: CurveLocationDetail): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n return result;\r\n }\r\n /** Create a new detail using CurvePrimitive pointer, fraction, and point coordinates. */\r\n public static createCurveFractionPoint(\r\n curve: CurvePrimitive | undefined, fraction: number, point: Point3d, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n result.point.setFromPoint3d(point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = 0.0;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /** Create a new detail with only ray, fraction, and point. */\r\n public static createRayFractionPoint(\r\n ray: Ray3d, fraction: number, point: Point3d, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.fraction = fraction;\r\n result.ray = ray;\r\n result.point.setFromPoint3d(point);\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer, fraction, and point coordinates */\r\n public static createCurveFractionPointDistanceCurveSearchStatus(\r\n curve: CurvePrimitive | undefined,\r\n fraction: number,\r\n point: Point3d,\r\n distance: number,\r\n status: CurveSearchStatus,\r\n result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n result.point.setFromPoint3d(point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = distance;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = status;\r\n return result;\r\n }\r\n /** Create with curveSearchStatus affected by allowExtension. */\r\n public static createConditionalMoveSignedDistance(\r\n allowExtension: boolean,\r\n curve: CurvePrimitive,\r\n startFraction: number,\r\n endFraction: number,\r\n requestedSignedDistance: number,\r\n result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n let a = requestedSignedDistance;\r\n let status = CurveSearchStatus.success;\r\n if (!allowExtension && !Geometry.isIn01(endFraction)) {\r\n // cap the movement at the endpoint\r\n if (endFraction < 0.0) {\r\n a = - curve.curveLengthBetweenFractions(startFraction, 0.0);\r\n endFraction = 0.0;\r\n status = CurveSearchStatus.stoppedAtBoundary;\r\n } else if (endFraction > 1.0) {\r\n endFraction = 1.0;\r\n a = curve.curveLengthBetweenFractions(startFraction, 1.0);\r\n status = CurveSearchStatus.stoppedAtBoundary;\r\n }\r\n }\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = endFraction;\r\n curve.fractionToPoint(endFraction, result.point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = a;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = status;\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\r\n public static createCurveEvaluatedFraction(\r\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n curve.fractionToPoint(fraction, result.point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = 0.0;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\r\n public static createCurveEvaluatedFractionPointAndDerivative(\r\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n const ray = curve.fractionToPointAndDerivative(fraction);\r\n result.point.setFromPoint3d(ray.origin);\r\n result.vectorInCurveLocationDetail = ray.direction;\r\n result.a = 0.0;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer and 2 fractions for evaluation. */\r\n public static createCurveEvaluatedFractionFraction(\r\n curve: CurvePrimitive, fraction0: number, fraction1: number, result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction0;\r\n curve.fractionToPoint(fraction0, result.point);\r\n result.fraction1 = fraction1;\r\n result.point1 = curve.fractionToPoint(fraction1, result.point1);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = 0.0;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /** Create with CurvePrimitive pointer, fraction, and point coordinates. */\r\n public static createCurveFractionPointDistance(\r\n curve: CurvePrimitive,\r\n fraction: number,\r\n point: Point3d,\r\n a: number,\r\n result?: CurveLocationDetail,\r\n ): CurveLocationDetail {\r\n result = result ? result : new CurveLocationDetail();\r\n result.curve = curve;\r\n result.fraction = fraction;\r\n result.point.setFromPoint3d(point);\r\n result.vectorInCurveLocationDetail = undefined;\r\n result.a = a;\r\n result.childDetail = undefined;\r\n result.curveSearchStatus = undefined;\r\n return result;\r\n }\r\n /**\r\n * Update or create if closer than current contents.\r\n * @param curve candidate curve\r\n * @param fraction candidate fraction\r\n * @param point candidate point\r\n * @param a candidate distance\r\n * @returns true if the given distance is smaller (and hence this detail was updated.)\r\n */\r\n public updateIfCloserCurveFractionPointDistance(\r\n curve: CurvePrimitive, fraction: number, point: Point3d, a: number,\r\n ): boolean {\r\n if (this.a < a)\r\n return false;\r\n CurveLocationDetail.createCurveFractionPointDistance(curve, fraction, point, a, this);\r\n return true;\r\n }\r\n /**\r\n * Exchange the (fraction,fraction1) and (point, point1) pairs.\r\n * * (Skip each swap if its \"1\" value is undefined)\r\n */\r\n public swapFractionsAndPoints(): void {\r\n if (this.fraction1 !== undefined) {\r\n const f = this.fraction;\r\n this.fraction = this.fraction1;\r\n this.fraction1 = f;\r\n }\r\n if (this.point1 !== undefined) {\r\n const p = this.point;\r\n this.point = this.point1;\r\n this.point1 = p;\r\n }\r\n }\r\n /**\r\n * Return the fraction where f falls between fraction and fraction1.\r\n * * ASSUME fraction1 defined\r\n */\r\n public inverseInterpolateFraction(f: number, defaultFraction: number = 0): number {\r\n const a = Geometry.inverseInterpolate01(this.fraction, this.fraction1!, f);\r\n if (a === undefined)\r\n return defaultFraction;\r\n return a;\r\n }\r\n /**\r\n * Return the detail with smaller `a` value -- detailA returned if equal.\r\n * @param detailA first candidate\r\n * @param detailB second candidate\r\n */\r\n public static chooseSmallerA(\r\n detailA: CurveLocationDetail | undefined, detailB: CurveLocationDetail | undefined,\r\n ): CurveLocationDetail | undefined {\r\n if (detailA) {\r\n if (!detailB)\r\n return detailA;\r\n return detailA.a <= detailB.a ? detailA : detailB;\r\n }\r\n return detailB;\r\n }\r\n /** Compare only the curve and fraction of this detail with `other`. */\r\n public isSameCurveAndFraction(other: CurveLocationDetail | {curve: CurvePrimitive, fraction: number}): boolean {\r\n return this.curve === other.curve && Geometry.isAlmostEqualNumber(this.fraction, other.fraction);\r\n }\r\n /**\r\n * Transform the detail in place.\r\n * * All numerical properties are transformed directly, except:\r\n * * when `curve` is defined, `point` and `point1` are reset by evaluating the transformed curve at `fraction` and `fraction1`\r\n * * these properties are untouched: `a`, `fraction`, `fraction1`, `pointQ`\r\n * @param transform the transform to apply\r\n * @return true if and only if the transformation was successful. If false, the instance is in an indeterminate\r\n * state and should not be used.\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n if (this.curve && !this.curve.tryTransformInPlace(transform))\r\n return false;\r\n if (this.ray)\r\n this.ray.transformInPlace(transform);\r\n if (this.curve)\r\n this.curve.fractionToPoint(this.fraction, this.point);\r\n else\r\n transform.multiplyXYAndZInPlace(this.point);\r\n if (this.vectorInCurveLocationDetail)\r\n transform.multiplyVectorInPlace(this.vectorInCurveLocationDetail);\r\n if (this.childDetail && this.childDetail !== this && !this.childDetail.tryTransformInPlace(transform))\r\n return false;\r\n if (this.point1) {\r\n if (this.curve && this.fraction1)\r\n this.curve.fractionToPoint(this.fraction1, this.point1);\r\n else\r\n transform.multiplyXYAndZInPlace(this.point1);\r\n }\r\n return true;\r\n }\r\n}\r\n\r\n/**\r\n * Enumeration of configurations for intersections and min/max distance-between-curve\r\n * @public\r\n */\r\nexport enum CurveCurveApproachType {\r\n /** Intersection at a single point */\r\n Intersection = 0,\r\n /** Distinct points on the two curves, with each curve's tangent perpendicular to the chord between the points */\r\n PerpendicularChord = 1,\r\n /** Completely coincident geometry */\r\n CoincidentGeometry = 2,\r\n /** Completely parallel geometry. */\r\n ParallelGeometry = 3,\r\n}\r\n\r\n/**\r\n * A pair of CurveLocationDetail.\r\n * @public\r\n */\r\nexport class CurveLocationDetailPair {\r\n /** The first of the two details. */\r\n public detailA: CurveLocationDetail;\r\n /** The second of the two details. */\r\n public detailB: CurveLocationDetail;\r\n /**\r\n * Enumeration of how the detail pairs relate.\r\n * * This is set only by certain closeApproach calculations.\r\n */\r\n public approachType?: CurveCurveApproachType;\r\n\r\n public constructor(detailA?: CurveLocationDetail, detailB?: CurveLocationDetail) {\r\n this.detailA = detailA ? detailA : new CurveLocationDetail();\r\n this.detailB = detailB ? detailB : new CurveLocationDetail();\r\n }\r\n /** Create a curve detail pair using references to two CurveLocationDetails */\r\n public static createCapture(\r\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, result?: CurveLocationDetailPair,\r\n ): CurveLocationDetailPair {\r\n result = result ? result : new CurveLocationDetailPair();\r\n result.detailA = detailA;\r\n result.detailB = detailB;\r\n return result;\r\n }\r\n /**\r\n * Create a curve detail pair using references to two CurveLocationDetails.\r\n * * optionally install in reversed positions\r\n */\r\n public static createCaptureOptionalReverse(\r\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, reversed: boolean, result?: CurveLocationDetailPair,\r\n ): CurveLocationDetailPair {\r\n result = result ? result : new CurveLocationDetailPair();\r\n if (reversed) {\r\n result.detailA = detailA;\r\n result.detailB = detailB;\r\n\r\n } else {\r\n result.detailA = detailA;\r\n result.detailB = detailB;\r\n }\r\n return result;\r\n }\r\n /** Make a deep copy of this CurveLocationDetailPair */\r\n public clone(result?: CurveLocationDetailPair): CurveLocationDetailPair {\r\n result = result ? result : new CurveLocationDetailPair();\r\n result.detailA = this.detailA.clone();\r\n result.detailB = this.detailB.clone();\r\n result.approachType = this.approachType;\r\n return result;\r\n }\r\n /** Swap the details of A, B */\r\n public swapDetails() {\r\n const q = this.detailA;\r\n this.detailA = this.detailB;\r\n this.detailB = q;\r\n }\r\n /**\r\n * Mutate the input array by removing the second of two adjacent duplicate pairs.\r\n * * Ignores details representing coincident intervals (e.g., for which `fraction1` is defined).\r\n * * Comparison is performed by [[CurveLocationDetail.isSameCurveAndFraction]].\r\n * * No sorting is performed.\r\n * @param pairs array to de-duplicate in place\r\n * @param index0 look for duplicates in the tail of the array starting at index0\r\n * @return reference to input array\r\n * @internal\r\n */\r\n public static removeAdjacentDuplicates(pairs: CurveLocationDetailPair[], index0: number = 0): CurveLocationDetailPair[] {\r\n return pairs.flatMap(\r\n (pair: CurveLocationDetailPair, i: number, arr: CurveLocationDetailPair[]) => {\r\n if (i >= index0 && i > 0) {\r\n if (!pair.detailA.hasFraction1 && !pair.detailB.hasFraction1) {\r\n if (pair.detailA.isSameCurveAndFraction(arr[i - 1].detailA)) {\r\n if (pair.detailB.isSameCurveAndFraction(arr[i - 1].detailB)) {\r\n return []; // remove the i_th pair\r\n }\r\n }\r\n }\r\n }\r\n return [pair]; // preserve the i_th pair\r\n },\r\n );\r\n }\r\n /**\r\n * Transform the details in place.\r\n * @param transform the transform to apply\r\n * @return true if and only if the transformation was successful on both details.\r\n * If false, the instance is in an indeterminate state and should not be used.\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n return this.detailA.tryTransformInPlace(transform) && this.detailB.tryTransformInPlace(transform);\r\n }\r\n}\r\n\r\n/**\r\n * Data bundle for a pair of arrays of CurveLocationDetail structures.\r\n * @deprecated in 4.x. Use CurveLocationDetailPair[] instead.\r\n * @public\r\n */\r\nexport class CurveLocationDetailArrayPair {\r\n /** First array of details. */\r\n public dataA: CurveLocationDetail[];\r\n /** Second array of details. */\r\n public dataB: CurveLocationDetail[];\r\n public constructor() {\r\n this.dataA = [];\r\n this.dataB = [];\r\n }\r\n}\r\n"]}
@@ -586,7 +586,7 @@ export class LineString3d extends CurvePrimitive {
586
586
  segmentIndex = 0;
587
587
  else if (globalFraction >= 1)
588
588
  segmentIndex = numSegment - 1;
589
- else // globalFraction in [0,1]
589
+ else // globalFraction in (0,1)
590
590
  segmentIndex = Math.floor(scaledGlobalFraction);
591
591
  return { index: segmentIndex, fraction: scaledGlobalFraction - segmentIndex };
592
592
  }