@itwin/core-geometry 4.4.0-dev.8 → 4.5.0-dev.0

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 (299) hide show
  1. package/CHANGELOG.md +6 -1
  2. package/lib/cjs/Geometry.d.ts +17 -0
  3. package/lib/cjs/Geometry.d.ts.map +1 -1
  4. package/lib/cjs/Geometry.js +14 -0
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/core-geometry.d.ts +3 -2
  7. package/lib/cjs/core-geometry.d.ts.map +1 -1
  8. package/lib/cjs/core-geometry.js +3 -2
  9. package/lib/cjs/core-geometry.js.map +1 -1
  10. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +2 -2
  11. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +3 -3
  12. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  13. package/lib/cjs/curve/CurveExtendMode.d.ts +7 -6
  14. package/lib/cjs/curve/CurveExtendMode.d.ts.map +1 -1
  15. package/lib/cjs/curve/CurveExtendMode.js +7 -6
  16. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  17. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  18. package/lib/cjs/curve/CurveLocationDetail.js +23 -18
  19. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  20. package/lib/cjs/curve/LineSegment3d.d.ts +14 -4
  21. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  22. package/lib/cjs/curve/LineSegment3d.js +107 -2
  23. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  24. package/lib/cjs/curve/LineString3d.d.ts +41 -8
  25. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  26. package/lib/cjs/curve/LineString3d.js +53 -15
  27. package/lib/cjs/curve/LineString3d.js.map +1 -1
  28. package/lib/cjs/curve/Loop.js +1 -1
  29. package/lib/cjs/curve/Loop.js.map +1 -1
  30. package/lib/cjs/curve/Query/PlanarSubdivision.d.ts +2 -2
  31. package/lib/cjs/curve/Query/PlanarSubdivision.js +2 -2
  32. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  33. package/lib/cjs/curve/RegionOps.d.ts +1 -2
  34. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  35. package/lib/cjs/curve/RegionOps.js.map +1 -1
  36. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +5 -8
  37. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  38. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +12 -12
  39. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  40. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +2 -2
  41. package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
  42. package/lib/cjs/geometry3d/GrowableXYArray.js +1 -1
  43. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  44. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +2 -3
  45. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  46. package/lib/cjs/geometry3d/GrowableXYZArray.js +1 -1
  47. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  48. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +18 -1
  49. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  50. package/lib/cjs/geometry3d/IndexedXYZCollection.js +13 -0
  51. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  52. package/lib/cjs/geometry3d/PointHelpers.d.ts +1 -2
  53. package/lib/cjs/geometry3d/PointHelpers.d.ts.map +1 -1
  54. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  55. package/lib/cjs/geometry3d/PointStreaming.d.ts +1 -1
  56. package/lib/cjs/geometry3d/PointStreaming.d.ts.map +1 -1
  57. package/lib/cjs/geometry3d/PointStreaming.js +3 -1
  58. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  59. package/lib/cjs/geometry3d/PolygonOps.d.ts +68 -1
  60. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  61. package/lib/cjs/geometry3d/PolygonOps.js +152 -4
  62. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  63. package/lib/cjs/geometry3d/PolylineOps.d.ts +23 -1
  64. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  65. package/lib/cjs/geometry3d/PolylineOps.js +73 -1
  66. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  67. package/lib/cjs/geometry3d/Range.d.ts +1 -1
  68. package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
  69. package/lib/cjs/geometry3d/Range.js.map +1 -1
  70. package/lib/cjs/geometry3d/Transform.js +1 -1
  71. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  72. package/lib/cjs/geometry3d/YawPitchRollAngles.d.ts +7 -5
  73. package/lib/cjs/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
  74. package/lib/cjs/geometry3d/YawPitchRollAngles.js +8 -6
  75. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  76. package/lib/cjs/numerics/Polynomials.d.ts +13 -1
  77. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  78. package/lib/cjs/numerics/Polynomials.js +13 -1
  79. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  80. package/lib/cjs/polyface/FacetLocationDetail.d.ts +28 -5
  81. package/lib/cjs/polyface/FacetLocationDetail.d.ts.map +1 -1
  82. package/lib/cjs/polyface/FacetLocationDetail.js +50 -15
  83. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  84. package/lib/cjs/polyface/Polyface.d.ts +1 -1
  85. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  86. package/lib/cjs/polyface/Polyface.js.map +1 -1
  87. package/lib/cjs/polyface/PolyfaceQuery.d.ts +7 -3
  88. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  89. package/lib/cjs/polyface/PolyfaceQuery.js +23 -0
  90. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  91. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.d.ts +52 -0
  92. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.d.ts.map +1 -0
  93. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js +78 -0
  94. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -0
  95. package/lib/cjs/polyface/RangeTree/MinimumValueTester.d.ts +60 -0
  96. package/lib/cjs/polyface/RangeTree/MinimumValueTester.d.ts.map +1 -0
  97. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js +96 -0
  98. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -0
  99. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts +57 -0
  100. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts.map +1 -0
  101. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js +73 -0
  102. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -0
  103. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts +57 -0
  104. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts.map +1 -0
  105. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js +84 -0
  106. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -0
  107. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts +274 -0
  108. package/lib/cjs/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -0
  109. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +505 -0
  110. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -0
  111. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts +204 -0
  112. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -0
  113. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js +383 -0
  114. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -0
  115. package/lib/cjs/serialization/GeometrySamples.d.ts +36 -3
  116. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  117. package/lib/cjs/serialization/GeometrySamples.js +93 -4
  118. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  119. package/lib/cjs/solid/LinearSweep.d.ts +1 -1
  120. package/lib/cjs/solid/LinearSweep.js +1 -1
  121. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  122. package/lib/cjs/solid/SweepContour.d.ts +2 -2
  123. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  124. package/lib/cjs/solid/SweepContour.js.map +1 -1
  125. package/lib/cjs/topology/Graph.d.ts +5 -6
  126. package/lib/cjs/topology/Graph.d.ts.map +1 -1
  127. package/lib/cjs/topology/Graph.js +7 -6
  128. package/lib/cjs/topology/Graph.js.map +1 -1
  129. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +4 -4
  130. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js +5 -5
  131. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  132. package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts +108 -71
  133. package/lib/cjs/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  134. package/lib/cjs/topology/HalfEdgeGraphSearch.js +223 -109
  135. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  136. package/lib/cjs/topology/Merging.d.ts +1 -1
  137. package/lib/cjs/topology/Merging.d.ts.map +1 -1
  138. package/lib/cjs/topology/Merging.js.map +1 -1
  139. package/lib/cjs/topology/SignedDataSummary.d.ts +13 -13
  140. package/lib/cjs/topology/SignedDataSummary.d.ts.map +1 -1
  141. package/lib/cjs/topology/SignedDataSummary.js +3 -3
  142. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  143. package/lib/cjs/topology/Triangulation.d.ts +1 -12
  144. package/lib/cjs/topology/Triangulation.d.ts.map +1 -1
  145. package/lib/cjs/topology/Triangulation.js.map +1 -1
  146. package/lib/cjs/topology/XYParitySearchContext.d.ts +27 -21
  147. package/lib/cjs/topology/XYParitySearchContext.d.ts.map +1 -1
  148. package/lib/cjs/topology/XYParitySearchContext.js +73 -71
  149. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  150. package/lib/esm/Geometry.d.ts +17 -0
  151. package/lib/esm/Geometry.d.ts.map +1 -1
  152. package/lib/esm/Geometry.js +14 -0
  153. package/lib/esm/Geometry.js.map +1 -1
  154. package/lib/esm/core-geometry.d.ts +3 -2
  155. package/lib/esm/core-geometry.d.ts.map +1 -1
  156. package/lib/esm/core-geometry.js +3 -2
  157. package/lib/esm/core-geometry.js.map +1 -1
  158. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +2 -2
  159. package/lib/esm/curve/CurveChainWithDistanceIndex.js +3 -3
  160. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  161. package/lib/esm/curve/CurveExtendMode.d.ts +7 -6
  162. package/lib/esm/curve/CurveExtendMode.d.ts.map +1 -1
  163. package/lib/esm/curve/CurveExtendMode.js +7 -6
  164. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  165. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  166. package/lib/esm/curve/CurveLocationDetail.js +23 -18
  167. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  168. package/lib/esm/curve/LineSegment3d.d.ts +14 -4
  169. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  170. package/lib/esm/curve/LineSegment3d.js +108 -3
  171. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  172. package/lib/esm/curve/LineString3d.d.ts +41 -8
  173. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  174. package/lib/esm/curve/LineString3d.js +53 -15
  175. package/lib/esm/curve/LineString3d.js.map +1 -1
  176. package/lib/esm/curve/Loop.js +1 -1
  177. package/lib/esm/curve/Loop.js.map +1 -1
  178. package/lib/esm/curve/Query/PlanarSubdivision.d.ts +2 -2
  179. package/lib/esm/curve/Query/PlanarSubdivision.js +2 -2
  180. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  181. package/lib/esm/curve/RegionOps.d.ts +1 -2
  182. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  183. package/lib/esm/curve/RegionOps.js +1 -1
  184. package/lib/esm/curve/RegionOps.js.map +1 -1
  185. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +5 -8
  186. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts.map +1 -1
  187. package/lib/esm/curve/RegionOpsClassificationSweeps.js +12 -12
  188. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  189. package/lib/esm/geometry3d/GrowableXYArray.d.ts +2 -2
  190. package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
  191. package/lib/esm/geometry3d/GrowableXYArray.js +1 -1
  192. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  193. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +2 -3
  194. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  195. package/lib/esm/geometry3d/GrowableXYZArray.js +1 -1
  196. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  197. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +18 -1
  198. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  199. package/lib/esm/geometry3d/IndexedXYZCollection.js +13 -0
  200. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  201. package/lib/esm/geometry3d/PointHelpers.d.ts +1 -2
  202. package/lib/esm/geometry3d/PointHelpers.d.ts.map +1 -1
  203. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  204. package/lib/esm/geometry3d/PointStreaming.d.ts +1 -1
  205. package/lib/esm/geometry3d/PointStreaming.d.ts.map +1 -1
  206. package/lib/esm/geometry3d/PointStreaming.js +3 -1
  207. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  208. package/lib/esm/geometry3d/PolygonOps.d.ts +68 -1
  209. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  210. package/lib/esm/geometry3d/PolygonOps.js +150 -3
  211. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  212. package/lib/esm/geometry3d/PolylineOps.d.ts +23 -1
  213. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  214. package/lib/esm/geometry3d/PolylineOps.js +73 -1
  215. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  216. package/lib/esm/geometry3d/Range.d.ts +1 -1
  217. package/lib/esm/geometry3d/Range.d.ts.map +1 -1
  218. package/lib/esm/geometry3d/Range.js.map +1 -1
  219. package/lib/esm/geometry3d/Transform.js +1 -1
  220. package/lib/esm/geometry3d/Transform.js.map +1 -1
  221. package/lib/esm/geometry3d/YawPitchRollAngles.d.ts +7 -5
  222. package/lib/esm/geometry3d/YawPitchRollAngles.d.ts.map +1 -1
  223. package/lib/esm/geometry3d/YawPitchRollAngles.js +8 -6
  224. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  225. package/lib/esm/numerics/Polynomials.d.ts +13 -1
  226. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  227. package/lib/esm/numerics/Polynomials.js +13 -1
  228. package/lib/esm/numerics/Polynomials.js.map +1 -1
  229. package/lib/esm/polyface/FacetLocationDetail.d.ts +28 -5
  230. package/lib/esm/polyface/FacetLocationDetail.d.ts.map +1 -1
  231. package/lib/esm/polyface/FacetLocationDetail.js +48 -14
  232. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  233. package/lib/esm/polyface/Polyface.d.ts +1 -1
  234. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  235. package/lib/esm/polyface/Polyface.js.map +1 -1
  236. package/lib/esm/polyface/PolyfaceQuery.d.ts +7 -3
  237. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  238. package/lib/esm/polyface/PolyfaceQuery.js +23 -0
  239. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  240. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.d.ts +52 -0
  241. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.d.ts.map +1 -0
  242. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js +74 -0
  243. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -0
  244. package/lib/esm/polyface/RangeTree/MinimumValueTester.d.ts +60 -0
  245. package/lib/esm/polyface/RangeTree/MinimumValueTester.d.ts.map +1 -0
  246. package/lib/esm/polyface/RangeTree/MinimumValueTester.js +92 -0
  247. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -0
  248. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts +57 -0
  249. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.d.ts.map +1 -0
  250. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js +69 -0
  251. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -0
  252. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts +57 -0
  253. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.d.ts.map +1 -0
  254. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js +80 -0
  255. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -0
  256. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts +274 -0
  257. package/lib/esm/polyface/RangeTree/RangeTreeNode.d.ts.map +1 -0
  258. package/lib/esm/polyface/RangeTree/RangeTreeNode.js +497 -0
  259. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -0
  260. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts +204 -0
  261. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.d.ts.map +1 -0
  262. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js +374 -0
  263. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -0
  264. package/lib/esm/serialization/GeometrySamples.d.ts +36 -3
  265. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  266. package/lib/esm/serialization/GeometrySamples.js +93 -4
  267. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  268. package/lib/esm/solid/LinearSweep.d.ts +1 -1
  269. package/lib/esm/solid/LinearSweep.js +1 -1
  270. package/lib/esm/solid/LinearSweep.js.map +1 -1
  271. package/lib/esm/solid/SweepContour.d.ts +2 -2
  272. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  273. package/lib/esm/solid/SweepContour.js.map +1 -1
  274. package/lib/esm/topology/Graph.d.ts +5 -6
  275. package/lib/esm/topology/Graph.d.ts.map +1 -1
  276. package/lib/esm/topology/Graph.js +7 -6
  277. package/lib/esm/topology/Graph.js.map +1 -1
  278. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +4 -4
  279. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js +5 -5
  280. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  281. package/lib/esm/topology/HalfEdgeGraphSearch.d.ts +108 -71
  282. package/lib/esm/topology/HalfEdgeGraphSearch.d.ts.map +1 -1
  283. package/lib/esm/topology/HalfEdgeGraphSearch.js +223 -109
  284. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  285. package/lib/esm/topology/Merging.d.ts +1 -1
  286. package/lib/esm/topology/Merging.d.ts.map +1 -1
  287. package/lib/esm/topology/Merging.js.map +1 -1
  288. package/lib/esm/topology/SignedDataSummary.d.ts +13 -13
  289. package/lib/esm/topology/SignedDataSummary.d.ts.map +1 -1
  290. package/lib/esm/topology/SignedDataSummary.js +3 -3
  291. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  292. package/lib/esm/topology/Triangulation.d.ts +1 -12
  293. package/lib/esm/topology/Triangulation.d.ts.map +1 -1
  294. package/lib/esm/topology/Triangulation.js.map +1 -1
  295. package/lib/esm/topology/XYParitySearchContext.d.ts +27 -21
  296. package/lib/esm/topology/XYParitySearchContext.d.ts.map +1 -1
  297. package/lib/esm/topology/XYParitySearchContext.js +73 -71
  298. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  299. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"CurveLocationDetail.js","sourceRoot":"","sources":["../../../src/curve/CurveLocationDetail.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAY,MAAM,+BAA+B,CAAC;AAIlE;;;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,KAAjB,iBAAiB,QAW5B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,0CAA0C;IAC1C,2DAAK,CAAA;IACL,iCAAiC;IACjC,+DAAW,CAAA;IACX,4FAA4F;IAC5F,mFAAqB,CAAA;AACvB,CAAC,EAPW,iBAAiB,KAAjB,iBAAiB,QAO5B;AAED;;;;;;GAMG;AACH,SAAS,oBAAoB,CAAC,MAA4B,EAAE,MAA4B;IACtF,IAAI,MAAM,EAAE;QACV,OAAO,MAAM,CAAC,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;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;gBACxB,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;oBAC5D,IAAI,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE;wBAC3D,IAAI,IAAI,CAAC,OAAO,CAAC,sBAAsB,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,EAAE;4BAC3D,OAAO,EAAE,CAAC,CAAE,uBAAuB;yBACpC;qBACF;iBACF;aACF;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":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry } from \"../Geometry\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\n\n/**\n * An enumeration of special conditions being described by a CurveLocationDetail.\n * @public\n */\nexport enum CurveIntervalRole {\n /** This point is an isolated point NOT at a primary vertex. */\n isolated = 0,\n /** This point is an isolated vertex hit */\n isolatedAtVertex = 1,\n /** This is the beginning of an interval */\n intervalStart = 10,\n /** This is an interior point of an interval. */\n intervalInterior = 11,\n /** This is the end of an interval */\n intervalEnd = 12,\n}\n\n/**\n * Return code for CurvePrimitive method `moveSignedDistanceFromFraction`\n * @public\n */\nexport enum CurveSearchStatus {\n /** Unimplemented or zero length curve */\n error,\n /** Complete success of search */\n success = 1,\n /** Search ended prematurely (e.g. at incomplete distance moved) at start or end of curve */\n stoppedAtBoundary = 2,\n}\n\n/**\n * Use to update a vector in case where source and prior result are both possibly undefined.\n * * Any undefined source returns undefined.\n * * For defined source, reuse optional result if available.\n * @param source optional source\n * @param result optional result\n */\nfunction optionalVectorUpdate(source: Vector3d | undefined, result: Vector3d | undefined): Vector3d | undefined {\n if (source) {\n return source.clone(result);\n }\n return undefined;\n}\n\n/**\n * CurveLocationDetail carries point and parameter data about a point evaluated on a curve.\n * * These are returned by a variety of queries.\n * * Particular contents can vary among the queries.\n * @public\n */\nexport class CurveLocationDetail {\n /** The curve being evaluated */\n public curve?: CurvePrimitive;\n /** Optional ray */\n public ray?: Ray3d;\n /** The fractional position along the curve */\n public fraction: number;\n /** Detail condition of the role this point has in some context */\n public intervalRole?: CurveIntervalRole;\n /** The point on the curve */\n public point: Point3d;\n /** A vector (e.g. tangent vector) in context */\n public vectorInCurveLocationDetail?: Vector3d;\n /** A context-specific numeric value. (e.g. a distance) */\n public a: number;\n /**\n * Optional CurveLocationDetail with more detail of location. For instance, a detail for fractional position\n * within a CurveChainWithDistanceIndex returns fraction and distance along the chain as its primary data and\n * further detail of the particular curve within the chain in the childDetail.\n */\n public childDetail?: CurveLocationDetail;\n /**\n * A status indicator for certain searches.\n * * e.g. CurvePrimitive.moveSignedDistanceFromFraction\n */\n public curveSearchStatus?: CurveSearchStatus;\n /** (Optional) second fraction, e.g. end of interval of coincident curves */\n public fraction1?: number;\n /** (Optional) second point, e.g. end of interval of coincident curves */\n public point1?: Point3d;\n /** A context-specific additional point */\n public pointQ: Point3d; // extra point for use in computations\n /** Constructor */\n public constructor() {\n this.pointQ = Point3d.createZero();\n this.fraction = 0;\n this.point = Point3d.createZero();\n this.a = 0.0;\n }\n /** Set the (optional) intervalRole field */\n public setIntervalRole(value: CurveIntervalRole): void {\n this.intervalRole = value;\n }\n /** Set the (optional) fraction1 and point1, using direct assignment (capture!) to point1 */\n public captureFraction1Point1(fraction1: number, point1: Point3d): void {\n this.fraction1 = fraction1;\n this.point1 = point1;\n }\n /** Test if this pair has fraction1 defined */\n public get hasFraction1(): boolean {\n return this.fraction1 !== undefined;\n }\n /** Test if this is an isolated point. This is true if intervalRole is any of (undefined, isolated, isolatedAtVertex) */\n public get isIsolated(): boolean {\n return this.intervalRole === undefined\n || this.intervalRole === CurveIntervalRole.isolated\n || this.intervalRole === CurveIntervalRole.isolatedAtVertex;\n }\n /** Return the fraction delta. (0 if no fraction1) */\n public get fractionDelta(): number {\n return this.fraction1 !== undefined ? this.fraction1 - this.fraction : 0.0;\n }\n /**\n * If (fraction1, point1) are defined, make them the primary (and only) data.\n * * No action if undefined.\n */\n public collapseToEnd() {\n if (this.fraction1 !== undefined)\n this.fraction = this.fraction1;\n if (this.point1)\n this.point = this.point1;\n this.collapseToStart();\n }\n /** Make (fraction, point) the primary (and only) data. */\n public collapseToStart() {\n this.fraction1 = undefined;\n this.point1 = undefined;\n }\n /**\n * Return a complete copy, WITH CAVEATS . . .\n * * curve member is copied as a reference.\n * * point and vector members are cloned.\n */\n public clone(result?: CurveLocationDetail): CurveLocationDetail {\n if (result === this)\n return result;\n result = result ? result : new CurveLocationDetail();\n result.curve = this.curve;\n result.fraction = this.fraction;\n result.fraction1 = this.fraction1;\n result.point1 = this.point1;\n result.point.setFromPoint3d(this.point);\n result.vectorInCurveLocationDetail = optionalVectorUpdate(\n this.vectorInCurveLocationDetail, result.vectorInCurveLocationDetail,\n );\n result.a = this.a;\n result.curveSearchStatus = this.curveSearchStatus;\n return result;\n }\n /**\n * Updated in this instance.\n * * Note that if caller omits `vector` and `a`, those fields are updated to the call-list defaults (NOT left as-is)\n * * point and vector updates are by data copy (not capture of pointers)\n * @param fraction (required) fraction to install\n * @param point (required) point to install\n * @param vector (optional) vector to install.\n * @param a (optional) numeric value to install.\n */\n public setFP(fraction: number, point: Point3d, vector?: Vector3d, a: number = 0.0): void {\n this.fraction = fraction;\n this.point.setFrom(point);\n this.vectorInCurveLocationDetail = optionalVectorUpdate(vector, this.vectorInCurveLocationDetail);\n this.a = a;\n }\n /**\n * Updated in this instance.\n * * Note that if caller omits a`, that field is updated to the call-list default (NOT left as-is)\n * * point and vector updates are by data copy (not capture of the ray members)\n * @param fraction (required) fraction to install\n * @param ray (required) point and vector to install\n * @param a (optional) numeric value to install.\n */\n public setFR(fraction: number, ray: Ray3d, a: number = 0): void {\n return this.setFP(fraction, ray.origin, ray.direction, a);\n }\n /** Set the CurvePrimitive pointer, leaving all other properties untouched. */\n public setCurve(curve: CurvePrimitive) {\n this.curve = curve;\n }\n /** Record the distance from the CurveLocationDetail's point to the parameter point. */\n public setDistanceTo(point: Point3d) {\n this.a = this.point.distance(point);\n }\n /** Create with a CurvePrimitive pointer but no coordinate data. */\n public static create(curve?: CurvePrimitive, result?: CurveLocationDetail): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n return result;\n }\n /** Create a new detail using CurvePrimitive pointer, fraction, and point coordinates. */\n public static createCurveFractionPoint(\n curve: CurvePrimitive | undefined, fraction: number, point: Point3d, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = 0.0;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create a new detail with only ray, fraction, and point. */\n public static createRayFractionPoint(\n ray: Ray3d, fraction: number, point: Point3d, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.fraction = fraction;\n result.ray = ray;\n result.point.setFromPoint3d(point);\n return result;\n }\n /** Create with CurvePrimitive pointer, fraction, and point coordinates */\n public static createCurveFractionPointDistanceCurveSearchStatus(\n curve: CurvePrimitive | undefined,\n fraction: number,\n point: Point3d,\n distance: number,\n status: CurveSearchStatus,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = distance;\n result.curveSearchStatus = status;\n return result;\n }\n /** Create with curveSearchStatus affected by allowExtension. */\n public static createConditionalMoveSignedDistance(\n allowExtension: boolean,\n curve: CurvePrimitive,\n startFraction: number,\n endFraction: number,\n requestedSignedDistance: number,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n let a = requestedSignedDistance;\n let status = CurveSearchStatus.success;\n if (!allowExtension && !Geometry.isIn01(endFraction)) {\n // cap the movement at the endpoint\n if (endFraction < 0.0) {\n a = - curve.curveLengthBetweenFractions(startFraction, 0.0);\n endFraction = 0.0;\n status = CurveSearchStatus.stoppedAtBoundary;\n } else if (endFraction > 1.0) {\n endFraction = 1.0;\n a = curve.curveLengthBetweenFractions(startFraction, 1.0);\n status = CurveSearchStatus.stoppedAtBoundary;\n }\n }\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = endFraction;\n result.point = curve.fractionToPoint(endFraction, result.point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = a;\n result.curveSearchStatus = status;\n return result;\n }\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\n public static createCurveEvaluatedFraction(\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point = curve.fractionToPoint(fraction);\n result.vectorInCurveLocationDetail = undefined;\n result.curveSearchStatus = undefined;\n result.a = 0.0;\n return result;\n }\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\n public static createCurveEvaluatedFractionPointAndDerivative(\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n const ray = curve.fractionToPointAndDerivative(fraction);\n result.point = ray.origin;\n result.vectorInCurveLocationDetail = ray.direction;\n result.curveSearchStatus = undefined;\n result.a = 0.0;\n return result;\n }\n /** Create with CurvePrimitive pointer and 2 fractions for evaluation. */\n public static createCurveEvaluatedFractionFraction(\n curve: CurvePrimitive, fraction0: number, fraction1: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction0;\n result.point = curve.fractionToPoint(fraction0);\n result.fraction1 = fraction1;\n result.point1 = curve.fractionToPoint(fraction1);\n result.vectorInCurveLocationDetail = undefined;\n result.curveSearchStatus = undefined;\n result.a = 0.0;\n return result;\n }\n /** Create with CurvePrimitive pointer, fraction, and point coordinates. */\n public static createCurveFractionPointDistance(\n curve: CurvePrimitive,\n fraction: number,\n point: Point3d,\n a: number,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = a;\n result.curveSearchStatus = undefined;\n return result;\n }\n /**\n * Update or create if closer than current contents.\n * @param curve candidate curve\n * @param fraction candidate fraction\n * @param point candidate point\n * @param a candidate distance\n * @returns true if the given distance is smaller (and hence this detail was updated.)\n */\n public updateIfCloserCurveFractionPointDistance(\n curve: CurvePrimitive, fraction: number, point: Point3d, a: number,\n ): boolean {\n if (this.a < a)\n return false;\n CurveLocationDetail.createCurveFractionPointDistance(curve, fraction, point, a, this);\n return true;\n }\n /**\n * Exchange the (fraction,fraction1) and (point, point1) pairs.\n * * (Skip each swap if its \"1\" value is undefined)\n */\n public swapFractionsAndPoints(): void {\n if (this.fraction1 !== undefined) {\n const f = this.fraction;\n this.fraction = this.fraction1;\n this.fraction1 = f;\n }\n if (this.point1 !== undefined) {\n const p = this.point;\n this.point = this.point1;\n this.point1 = p;\n }\n }\n /**\n * Return the fraction where f falls between fraction and fraction1.\n * * ASSUME fraction1 defined\n */\n public inverseInterpolateFraction(f: number, defaultFraction: number = 0): number {\n const a = Geometry.inverseInterpolate01(this.fraction, this.fraction1!, f);\n if (a === undefined)\n return defaultFraction;\n return a;\n }\n /**\n * Return the detail with smaller `a` value -- detailA returned if equal.\n * @param detailA first candidate\n * @param detailB second candidate\n */\n public static chooseSmallerA(\n detailA: CurveLocationDetail | undefined, detailB: CurveLocationDetail | undefined,\n ): CurveLocationDetail | undefined {\n if (detailA) {\n if (!detailB)\n return detailA;\n return detailA.a <= detailB.a ? detailA : detailB;\n }\n return detailB;\n }\n /** Compare only the curve and fraction of this detail with `other`. */\n public isSameCurveAndFraction(other: CurveLocationDetail | {curve: CurvePrimitive, fraction: number}): boolean {\n return this.curve === other.curve && Geometry.isAlmostEqualNumber(this.fraction, other.fraction);\n }\n}\n\n/**\n * Enumeration of configurations for intersections and min/max distance-between-curve\n * @public\n */\nexport enum CurveCurveApproachType {\n /** Intersection at a single point */\n Intersection = 0,\n /** Distinct points on the two curves, with each curve's tangent perpendicular to the chord between the points */\n PerpendicularChord = 1,\n /** Completely coincident geometry */\n CoincidentGeometry = 2,\n /** Completely parallel geometry. */\n ParallelGeometry = 3,\n}\n\n/**\n * A pair of CurveLocationDetail.\n * @public\n */\nexport class CurveLocationDetailPair {\n /** The first of the two details. */\n public detailA: CurveLocationDetail;\n /** The second of the two details. */\n public detailB: CurveLocationDetail;\n /**\n * Enumeration of how the detail pairs relate.\n * * This is set only by certain closeApproach calculations.\n */\n public approachType?: CurveCurveApproachType;\n\n public constructor(detailA?: CurveLocationDetail, detailB?: CurveLocationDetail) {\n this.detailA = detailA ? detailA : new CurveLocationDetail();\n this.detailB = detailB ? detailB : new CurveLocationDetail();\n }\n /** Create a curve detail pair using references to two CurveLocationDetails */\n public static createCapture(\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, result?: CurveLocationDetailPair,\n ): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n result.detailA = detailA;\n result.detailB = detailB;\n return result;\n }\n /**\n * Create a curve detail pair using references to two CurveLocationDetails.\n * * optionally install in reversed positions\n */\n public static createCaptureOptionalReverse(\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, reversed: boolean, result?: CurveLocationDetailPair,\n ): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n if (reversed) {\n result.detailA = detailA;\n result.detailB = detailB;\n\n } else {\n result.detailA = detailA;\n result.detailB = detailB;\n }\n return result;\n }\n /** Make a deep copy of this CurveLocationDetailPair */\n public clone(result?: CurveLocationDetailPair): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n result.detailA = this.detailA.clone();\n result.detailB = this.detailB.clone();\n result.approachType = this.approachType;\n return result;\n }\n /** Swap the details of A, B */\n public swapDetails() {\n const q = this.detailA;\n this.detailA = this.detailB;\n this.detailB = q;\n }\n /**\n * Mutate the input array by removing the second of two adjacent duplicate pairs.\n * * Ignores details representing coincident intervals (e.g., for which `fraction1` is defined).\n * * Comparison is performed by [[CurveLocationDetail.isSameCurveAndFraction]].\n * * No sorting is performed.\n * @param pairs array to de-duplicate in place\n * @param index0 look for duplicates in the tail of the array starting at index0\n * @return reference to input array\n * @internal\n */\n public static removeAdjacentDuplicates(pairs: CurveLocationDetailPair[], index0: number = 0): CurveLocationDetailPair[] {\n return pairs.flatMap(\n (pair: CurveLocationDetailPair, i: number, arr: CurveLocationDetailPair[]) => {\n if (i >= index0 && i > 0) {\n if (!pair.detailA.hasFraction1 && !pair.detailB.hasFraction1) {\n if (pair.detailA.isSameCurveAndFraction(arr[i - 1].detailA)) {\n if (pair.detailB.isSameCurveAndFraction(arr[i - 1].detailB)) {\n return []; // remove the i_th pair\n }\n }\n }\n }\n return [pair]; // preserve the i_th pair\n },\n );\n }\n}\n\n/**\n * Data bundle for a pair of arrays of CurveLocationDetail structures.\n * @deprecated in 4.x. Use CurveLocationDetailPair[] instead.\n * @public\n */\nexport class CurveLocationDetailArrayPair {\n /** First array of details. */\n public dataA: CurveLocationDetail[];\n /** Second array of details. */\n public dataB: CurveLocationDetail[];\n public constructor() {\n this.dataA = [];\n this.dataB = [];\n }\n}\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;AAIlE;;;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,KAAjB,iBAAiB,QAW5B;AAED;;;GAGG;AACH,MAAM,CAAN,IAAY,iBAOX;AAPD,WAAY,iBAAiB;IAC3B,0CAA0C;IAC1C,2DAAK,CAAA;IACL,iCAAiC;IACjC,+DAAW,CAAA;IACX,4FAA4F;IAC5F,mFAAqB,CAAA;AACvB,CAAC,EAPW,iBAAiB,KAAjB,iBAAiB,QAO5B;AAED;;;;;;GAMG;AACH,SAAS,cAAc,CAA0B,MAAqB,EAAE,MAA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AAC,CAAE,uBAAuB;yBACpC;qBACF;iBACF;aACF;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":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Curve\n */\nimport { Geometry, ICloneable } from \"../Geometry\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { CurvePrimitive } from \"./CurvePrimitive\";\n\n/**\n * An enumeration of special conditions being described by a CurveLocationDetail.\n * @public\n */\nexport enum CurveIntervalRole {\n /** This point is an isolated point NOT at a primary vertex. */\n isolated = 0,\n /** This point is an isolated vertex hit */\n isolatedAtVertex = 1,\n /** This is the beginning of an interval */\n intervalStart = 10,\n /** This is an interior point of an interval. */\n intervalInterior = 11,\n /** This is the end of an interval */\n intervalEnd = 12,\n}\n\n/**\n * Return code for CurvePrimitive method `moveSignedDistanceFromFraction`\n * @public\n */\nexport enum CurveSearchStatus {\n /** Unimplemented or zero length curve */\n error,\n /** Complete success of search */\n success = 1,\n /** Search ended prematurely (e.g. at incomplete distance moved) at start or end of curve */\n stoppedAtBoundary = 2,\n}\n\n/**\n * Use to update a cloneable object when source and/or prior result are possibly undefined.\n * * Any undefined source returns undefined.\n * * For defined source, reuse optional result if available.\n * @param source optional source\n * @param result optional result\n */\nfunction optionalUpdate<T extends ICloneable<T>>(source: T | undefined, result: T | undefined): T | undefined {\n return source ? source.clone(result) : undefined;\n}\n\n/**\n * CurveLocationDetail carries point and parameter data about a point evaluated on a curve.\n * * These are returned by a variety of queries.\n * * Particular contents can vary among the queries.\n * @public\n */\nexport class CurveLocationDetail {\n /** The curve being evaluated */\n public curve?: CurvePrimitive;\n /** Optional ray */\n public ray?: Ray3d;\n /** The fractional position along the curve */\n public fraction: number;\n /** Detail condition of the role this point has in some context */\n public intervalRole?: CurveIntervalRole;\n /** The point on the curve */\n public point: Point3d;\n /** A vector (e.g. tangent vector) in context */\n public vectorInCurveLocationDetail?: Vector3d;\n /** A context-specific numeric value. (e.g. a distance) */\n public a: number;\n /**\n * Optional CurveLocationDetail with more detail of location. For instance, a detail for fractional position\n * within a CurveChainWithDistanceIndex returns fraction and distance along the chain as its primary data and\n * further detail of the particular curve within the chain in the childDetail.\n */\n public childDetail?: CurveLocationDetail;\n /**\n * A status indicator for certain searches.\n * * e.g. CurvePrimitive.moveSignedDistanceFromFraction\n */\n public curveSearchStatus?: CurveSearchStatus;\n /** (Optional) second fraction, e.g. end of interval of coincident curves */\n public fraction1?: number;\n /** (Optional) second point, e.g. end of interval of coincident curves */\n public point1?: Point3d;\n /** A context-specific additional point */\n public pointQ: Point3d; // extra point for use in computations\n /** Constructor */\n public constructor() {\n this.pointQ = Point3d.createZero();\n this.fraction = 0;\n this.point = Point3d.createZero();\n this.a = 0.0;\n }\n /** Set the (optional) intervalRole field */\n public setIntervalRole(value: CurveIntervalRole): void {\n this.intervalRole = value;\n }\n /** Set the (optional) fraction1 and point1, using direct assignment (capture!) to point1 */\n public captureFraction1Point1(fraction1: number, point1: Point3d): void {\n this.fraction1 = fraction1;\n this.point1 = point1;\n }\n /** Test if this pair has fraction1 defined */\n public get hasFraction1(): boolean {\n return this.fraction1 !== undefined;\n }\n /** Test if this is an isolated point. This is true if intervalRole is any of (undefined, isolated, isolatedAtVertex) */\n public get isIsolated(): boolean {\n return this.intervalRole === undefined\n || this.intervalRole === CurveIntervalRole.isolated\n || this.intervalRole === CurveIntervalRole.isolatedAtVertex;\n }\n /** Return the fraction delta. (0 if no fraction1) */\n public get fractionDelta(): number {\n return this.fraction1 !== undefined ? this.fraction1 - this.fraction : 0.0;\n }\n /**\n * If (fraction1, point1) are defined, make them the primary (and only) data.\n * * No action if undefined.\n */\n public collapseToEnd() {\n if (this.fraction1 !== undefined)\n this.fraction = this.fraction1;\n if (this.point1)\n this.point = this.point1;\n this.collapseToStart();\n }\n /** Make (fraction, point) the primary (and only) data. */\n public collapseToStart() {\n this.fraction1 = undefined;\n this.point1 = undefined;\n }\n /**\n * Return a complete copy, WITH CAVEATS . . .\n * * curve member is copied as a reference.\n * * point and vector members are cloned.\n */\n public clone(result?: CurveLocationDetail): CurveLocationDetail {\n if (result === this)\n return result;\n result = result ? result : new CurveLocationDetail();\n result.curve = this.curve;\n result.fraction = this.fraction;\n result.fraction1 = this.fraction1;\n result.point1 = optionalUpdate<Point3d>(this.point1, result.point1);\n result.point.setFromPoint3d(this.point);\n result.vectorInCurveLocationDetail = optionalUpdate<Vector3d>(this.vectorInCurveLocationDetail, result.vectorInCurveLocationDetail);\n result.a = this.a;\n result.childDetail = optionalUpdate<CurveLocationDetail>(this.childDetail, result.childDetail);\n result.curveSearchStatus = this.curveSearchStatus;\n return result;\n }\n /**\n * Updated in this instance.\n * * Note that if caller omits `vector` and `a`, those fields are updated to the call-list defaults (NOT left as-is)\n * * point and vector updates are by data copy (not capture of pointers)\n * @param fraction (required) fraction to install\n * @param point (required) point to install\n * @param vector (optional) vector to install.\n * @param a (optional) numeric value to install.\n */\n public setFP(fraction: number, point: Point3d, vector?: Vector3d, a: number = 0.0): void {\n this.fraction = fraction;\n this.point.setFromPoint3d(point);\n this.vectorInCurveLocationDetail = optionalUpdate<Vector3d>(vector, this.vectorInCurveLocationDetail);\n this.a = a;\n }\n /**\n * Updated in this instance.\n * * Note that if caller omits a`, that field is updated to the call-list default (NOT left as-is)\n * * point and vector updates are by data copy (not capture of the ray members)\n * @param fraction (required) fraction to install\n * @param ray (required) point and vector to install\n * @param a (optional) numeric value to install.\n */\n public setFR(fraction: number, ray: Ray3d, a: number = 0): void {\n return this.setFP(fraction, ray.origin, ray.direction, a);\n }\n /** Set the CurvePrimitive pointer, leaving all other properties untouched. */\n public setCurve(curve: CurvePrimitive) {\n this.curve = curve;\n }\n /** Record the distance from the CurveLocationDetail's point to the parameter point. */\n public setDistanceTo(point: Point3d) {\n this.a = this.point.distance(point);\n }\n /** Create with a CurvePrimitive pointer but no coordinate data. */\n public static create(curve?: CurvePrimitive, result?: CurveLocationDetail): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n return result;\n }\n /** Create a new detail using CurvePrimitive pointer, fraction, and point coordinates. */\n public static createCurveFractionPoint(\n curve: CurvePrimitive | undefined, fraction: number, point: Point3d, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create a new detail with only ray, fraction, and point. */\n public static createRayFractionPoint(\n ray: Ray3d, fraction: number, point: Point3d, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.fraction = fraction;\n result.ray = ray;\n result.point.setFromPoint3d(point);\n return result;\n }\n /** Create with CurvePrimitive pointer, fraction, and point coordinates */\n public static createCurveFractionPointDistanceCurveSearchStatus(\n curve: CurvePrimitive | undefined,\n fraction: number,\n point: Point3d,\n distance: number,\n status: CurveSearchStatus,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = distance;\n result.childDetail = undefined;\n result.curveSearchStatus = status;\n return result;\n }\n /** Create with curveSearchStatus affected by allowExtension. */\n public static createConditionalMoveSignedDistance(\n allowExtension: boolean,\n curve: CurvePrimitive,\n startFraction: number,\n endFraction: number,\n requestedSignedDistance: number,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n let a = requestedSignedDistance;\n let status = CurveSearchStatus.success;\n if (!allowExtension && !Geometry.isIn01(endFraction)) {\n // cap the movement at the endpoint\n if (endFraction < 0.0) {\n a = - curve.curveLengthBetweenFractions(startFraction, 0.0);\n endFraction = 0.0;\n status = CurveSearchStatus.stoppedAtBoundary;\n } else if (endFraction > 1.0) {\n endFraction = 1.0;\n a = curve.curveLengthBetweenFractions(startFraction, 1.0);\n status = CurveSearchStatus.stoppedAtBoundary;\n }\n }\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = endFraction;\n curve.fractionToPoint(endFraction, result.point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = a;\n result.childDetail = undefined;\n result.curveSearchStatus = status;\n return result;\n }\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\n public static createCurveEvaluatedFraction(\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n curve.fractionToPoint(fraction, result.point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create with CurvePrimitive pointer and fraction for evaluation. */\n public static createCurveEvaluatedFractionPointAndDerivative(\n curve: CurvePrimitive, fraction: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n const ray = curve.fractionToPointAndDerivative(fraction);\n result.point.setFromPoint3d(ray.origin);\n result.vectorInCurveLocationDetail = ray.direction;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create with CurvePrimitive pointer and 2 fractions for evaluation. */\n public static createCurveEvaluatedFractionFraction(\n curve: CurvePrimitive, fraction0: number, fraction1: number, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction0;\n curve.fractionToPoint(fraction0, result.point);\n result.fraction1 = fraction1;\n result.point1 = curve.fractionToPoint(fraction1, result.point1);\n result.vectorInCurveLocationDetail = undefined;\n result.a = 0.0;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /** Create with CurvePrimitive pointer, fraction, and point coordinates. */\n public static createCurveFractionPointDistance(\n curve: CurvePrimitive,\n fraction: number,\n point: Point3d,\n a: number,\n result?: CurveLocationDetail,\n ): CurveLocationDetail {\n result = result ? result : new CurveLocationDetail();\n result.curve = curve;\n result.fraction = fraction;\n result.point.setFromPoint3d(point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = a;\n result.childDetail = undefined;\n result.curveSearchStatus = undefined;\n return result;\n }\n /**\n * Update or create if closer than current contents.\n * @param curve candidate curve\n * @param fraction candidate fraction\n * @param point candidate point\n * @param a candidate distance\n * @returns true if the given distance is smaller (and hence this detail was updated.)\n */\n public updateIfCloserCurveFractionPointDistance(\n curve: CurvePrimitive, fraction: number, point: Point3d, a: number,\n ): boolean {\n if (this.a < a)\n return false;\n CurveLocationDetail.createCurveFractionPointDistance(curve, fraction, point, a, this);\n return true;\n }\n /**\n * Exchange the (fraction,fraction1) and (point, point1) pairs.\n * * (Skip each swap if its \"1\" value is undefined)\n */\n public swapFractionsAndPoints(): void {\n if (this.fraction1 !== undefined) {\n const f = this.fraction;\n this.fraction = this.fraction1;\n this.fraction1 = f;\n }\n if (this.point1 !== undefined) {\n const p = this.point;\n this.point = this.point1;\n this.point1 = p;\n }\n }\n /**\n * Return the fraction where f falls between fraction and fraction1.\n * * ASSUME fraction1 defined\n */\n public inverseInterpolateFraction(f: number, defaultFraction: number = 0): number {\n const a = Geometry.inverseInterpolate01(this.fraction, this.fraction1!, f);\n if (a === undefined)\n return defaultFraction;\n return a;\n }\n /**\n * Return the detail with smaller `a` value -- detailA returned if equal.\n * @param detailA first candidate\n * @param detailB second candidate\n */\n public static chooseSmallerA(\n detailA: CurveLocationDetail | undefined, detailB: CurveLocationDetail | undefined,\n ): CurveLocationDetail | undefined {\n if (detailA) {\n if (!detailB)\n return detailA;\n return detailA.a <= detailB.a ? detailA : detailB;\n }\n return detailB;\n }\n /** Compare only the curve and fraction of this detail with `other`. */\n public isSameCurveAndFraction(other: CurveLocationDetail | {curve: CurvePrimitive, fraction: number}): boolean {\n return this.curve === other.curve && Geometry.isAlmostEqualNumber(this.fraction, other.fraction);\n }\n}\n\n/**\n * Enumeration of configurations for intersections and min/max distance-between-curve\n * @public\n */\nexport enum CurveCurveApproachType {\n /** Intersection at a single point */\n Intersection = 0,\n /** Distinct points on the two curves, with each curve's tangent perpendicular to the chord between the points */\n PerpendicularChord = 1,\n /** Completely coincident geometry */\n CoincidentGeometry = 2,\n /** Completely parallel geometry. */\n ParallelGeometry = 3,\n}\n\n/**\n * A pair of CurveLocationDetail.\n * @public\n */\nexport class CurveLocationDetailPair {\n /** The first of the two details. */\n public detailA: CurveLocationDetail;\n /** The second of the two details. */\n public detailB: CurveLocationDetail;\n /**\n * Enumeration of how the detail pairs relate.\n * * This is set only by certain closeApproach calculations.\n */\n public approachType?: CurveCurveApproachType;\n\n public constructor(detailA?: CurveLocationDetail, detailB?: CurveLocationDetail) {\n this.detailA = detailA ? detailA : new CurveLocationDetail();\n this.detailB = detailB ? detailB : new CurveLocationDetail();\n }\n /** Create a curve detail pair using references to two CurveLocationDetails */\n public static createCapture(\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, result?: CurveLocationDetailPair,\n ): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n result.detailA = detailA;\n result.detailB = detailB;\n return result;\n }\n /**\n * Create a curve detail pair using references to two CurveLocationDetails.\n * * optionally install in reversed positions\n */\n public static createCaptureOptionalReverse(\n detailA: CurveLocationDetail, detailB: CurveLocationDetail, reversed: boolean, result?: CurveLocationDetailPair,\n ): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n if (reversed) {\n result.detailA = detailA;\n result.detailB = detailB;\n\n } else {\n result.detailA = detailA;\n result.detailB = detailB;\n }\n return result;\n }\n /** Make a deep copy of this CurveLocationDetailPair */\n public clone(result?: CurveLocationDetailPair): CurveLocationDetailPair {\n result = result ? result : new CurveLocationDetailPair();\n result.detailA = this.detailA.clone();\n result.detailB = this.detailB.clone();\n result.approachType = this.approachType;\n return result;\n }\n /** Swap the details of A, B */\n public swapDetails() {\n const q = this.detailA;\n this.detailA = this.detailB;\n this.detailB = q;\n }\n /**\n * Mutate the input array by removing the second of two adjacent duplicate pairs.\n * * Ignores details representing coincident intervals (e.g., for which `fraction1` is defined).\n * * Comparison is performed by [[CurveLocationDetail.isSameCurveAndFraction]].\n * * No sorting is performed.\n * @param pairs array to de-duplicate in place\n * @param index0 look for duplicates in the tail of the array starting at index0\n * @return reference to input array\n * @internal\n */\n public static removeAdjacentDuplicates(pairs: CurveLocationDetailPair[], index0: number = 0): CurveLocationDetailPair[] {\n return pairs.flatMap(\n (pair: CurveLocationDetailPair, i: number, arr: CurveLocationDetailPair[]) => {\n if (i >= index0 && i > 0) {\n if (!pair.detailA.hasFraction1 && !pair.detailB.hasFraction1) {\n if (pair.detailA.isSameCurveAndFraction(arr[i - 1].detailA)) {\n if (pair.detailB.isSameCurveAndFraction(arr[i - 1].detailB)) {\n return []; // remove the i_th pair\n }\n }\n }\n }\n return [pair]; // preserve the i_th pair\n },\n );\n }\n}\n\n/**\n * Data bundle for a pair of arrays of CurveLocationDetail structures.\n * @deprecated in 4.x. Use CurveLocationDetailPair[] instead.\n * @public\n */\nexport class CurveLocationDetailArrayPair {\n /** First array of details. */\n public dataA: CurveLocationDetail[];\n /** Second array of details. */\n public dataB: CurveLocationDetail[];\n public constructor() {\n this.dataA = [];\n this.dataB = [];\n }\n}\n"]}
@@ -1,6 +1,3 @@
1
- /** @packageDocumentation
2
- * @module Curve
3
- */
4
1
  import { Clipper } from "../clipping/ClipUtils";
5
2
  import { BeJSONFunctions, PlaneAltitudeEvaluator } from "../Geometry";
6
3
  import { GeometryHandler, IStrokeHandler } from "../geometry3d/GeometryHandler";
@@ -10,7 +7,7 @@ import { Range1d, Range3d } from "../geometry3d/Range";
10
7
  import { Ray3d } from "../geometry3d/Ray3d";
11
8
  import { Transform } from "../geometry3d/Transform";
12
9
  import { VariantCurveExtendParameter } from "./CurveExtendMode";
13
- import { CurveLocationDetail } from "./CurveLocationDetail";
10
+ import { CurveLocationDetail, CurveLocationDetailPair } from "./CurveLocationDetail";
14
11
  import { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from "./CurvePrimitive";
15
12
  import { GeometryQuery } from "./GeometryQuery";
16
13
  import { LineString3d } from "./LineString3d";
@@ -117,8 +114,21 @@ export declare class LineSegment3d extends CurvePrimitive implements BeJSONFunct
117
114
  * @param spacePoint point in space
118
115
  * @param extend if false, only return points within the bounded line segment. If true, allow the point to be on
119
116
  * the unbounded line that contains the bounded segment.
117
+ * @param result optional pre-allocated object to populate and return
118
+ * @returns detail, with `a` field set to the distance from `spacePoint` to the closest point
120
119
  */
121
120
  closestPoint(spacePoint: Point3d, extend: VariantCurveExtendParameter, result?: CurveLocationDetail): CurveLocationDetail;
121
+ /**
122
+ * Compute the closest approach between a pair of line segments.
123
+ * * The approach distance is returned in the `a` fields of the details.
124
+ * @param segmentA first line segment
125
+ * @param extendA how to extend segmentA forward/backward
126
+ * @param segmentB second line segment
127
+ * @param extendB how to extend segmentB forward/backward
128
+ * @param result optional pre-allocated object to populate and return
129
+ * @returns pair of details, one per segment, each with `a` field set to the closest approach distance
130
+ */
131
+ static closestApproach(segmentA: LineSegment3d, extendA: VariantCurveExtendParameter, segmentB: LineSegment3d, extendB: VariantCurveExtendParameter, result?: CurveLocationDetailPair): CurveLocationDetailPair | undefined;
122
132
  /** Swap the endpoint references. */
123
133
  reverseInPlace(): void;
124
134
  /** Transform the two endpoints of this LinSegment. */
@@ -1 +1 @@
1
- {"version":3,"file":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AE,YAAY,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI;IAIrE,8CAA8C;IACvC,kBAAkB,CAAC,OAAO,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI;IAMjF;;;OAGG;IACI,4BAA4B,CAAC,OAAO,CAAC,EAAE,aAAa,GAAG,MAAM;IASpE,+EAA+E;IACxE,yBAAyB,CAAC,OAAO,EAAE,eAAe,GAAG,GAAG;IAG/D;;;;OAIG;IACa,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,QAAQ,CAAC,EAAE,kCAAkC,GAAG,OAAO;IAM/G;;;;OAIG;IACa,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,aAAa;IAGtF;;;OAGG;IACa,qBAAqB,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,SAAS,GAAG,OAAO;IAgB3G;;;OAGG;IACa,iBAAiB,CAC/B,uBAAuB,EAAE,MAAM,GAAG,aAAa,GAC9C,cAAc,GAAG,cAAc,EAAE,GAAG,SAAS;IAWhD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAG,EAAE,QAAQ,GAAG,KAAK,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS;CAGvG"}
@@ -2,14 +2,20 @@
2
2
  * Copyright (c) Bentley Systems, Incorporated. All rights reserved.
3
3
  * See LICENSE.md in the project root for license terms and full copyright notice.
4
4
  *--------------------------------------------------------------------------------------------*/
5
+ /** @packageDocumentation
6
+ * @module Curve
7
+ */
8
+ import { assert } from "@itwin/core-bentley";
5
9
  import { Geometry } from "../Geometry";
6
10
  import { Plane3dByOriginAndVectors } from "../geometry3d/Plane3dByOriginAndVectors";
11
+ import { Vector2d } from "../geometry3d/Point2dVector2d";
7
12
  import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
8
13
  import { Range3d } from "../geometry3d/Range";
9
14
  import { Ray3d } from "../geometry3d/Ray3d";
10
15
  import { Order2Bezier } from "../numerics/BezierPolynomials";
16
+ import { SmallSystem } from "../numerics/Polynomials";
11
17
  import { CurveExtendOptions } from "./CurveExtendMode";
12
- import { CurveIntervalRole, CurveLocationDetail } from "./CurveLocationDetail";
18
+ import { CurveIntervalRole, CurveLocationDetail, CurveLocationDetailPair } from "./CurveLocationDetail";
13
19
  import { CurvePrimitive } from "./CurvePrimitive";
14
20
  import { PlaneAltitudeRangeContext } from "./internalContexts/PlaneAltitudeRangeContext";
15
21
  import { OffsetOptions } from "./OffsetOptions";
@@ -191,19 +197,118 @@ export class LineSegment3d extends CurvePrimitive {
191
197
  * @param spacePoint point in space
192
198
  * @param extend if false, only return points within the bounded line segment. If true, allow the point to be on
193
199
  * the unbounded line that contains the bounded segment.
200
+ * @param result optional pre-allocated object to populate and return
201
+ * @returns detail, with `a` field set to the distance from `spacePoint` to the closest point
194
202
  */
195
203
  closestPoint(spacePoint, extend, result) {
196
204
  let fraction = spacePoint.fractionOfProjectionToLine(this._point0, this._point1, 0.0);
197
205
  fraction = CurveExtendOptions.correctFraction(extend, fraction);
198
206
  result = CurveLocationDetail.create(this, result);
199
- // remark: This can be done by result.setFP (fraction, thePoint, undefined, a)
200
- // but that creates a temporary point.
201
207
  result.fraction = fraction;
202
208
  this._point0.interpolate(fraction, this._point1, result.point);
203
209
  result.vectorInCurveLocationDetail = undefined;
204
210
  result.a = result.point.distance(spacePoint);
205
211
  return result;
206
212
  }
213
+ /**
214
+ * Compute the closest approach between a pair of line segments.
215
+ * * The approach distance is returned in the `a` fields of the details.
216
+ * @param segmentA first line segment
217
+ * @param extendA how to extend segmentA forward/backward
218
+ * @param segmentB second line segment
219
+ * @param extendB how to extend segmentB forward/backward
220
+ * @param result optional pre-allocated object to populate and return
221
+ * @returns pair of details, one per segment, each with `a` field set to the closest approach distance
222
+ */
223
+ static closestApproach(segmentA, extendA, segmentB, extendB, result) {
224
+ const unboundedFractions = Vector2d.create();
225
+ if (result === undefined)
226
+ result = CurveLocationDetailPair.createCapture(CurveLocationDetail.create(), CurveLocationDetail.create());
227
+ if (SmallSystem.lineSegment3dClosestApproachUnbounded(segmentA._point0, segmentA._point1, segmentB._point0, segmentB._point1, unboundedFractions)) {
228
+ // There is a simple approach between the unbounded segments. Maybe its a really easy case ...
229
+ const fractionA = CurveExtendOptions.correctFraction(extendA, unboundedFractions.x);
230
+ const fractionB = CurveExtendOptions.correctFraction(extendB, unboundedFractions.y);
231
+ // if neither fraction was corrected, just accept !!!
232
+ if (fractionA === unboundedFractions.x && fractionB === unboundedFractions.y) {
233
+ CurveLocationDetail.createCurveEvaluatedFraction(segmentA, fractionA, result.detailA);
234
+ CurveLocationDetail.createCurveEvaluatedFraction(segmentB, fractionB, result.detailB);
235
+ result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);
236
+ return result;
237
+ }
238
+ // One or both of the fractions were clamped back to an endpoint.
239
+ // Claim: (????!!!????) The only proximity candidates that matter are from clamped point onto the other.
240
+ if (fractionA !== unboundedFractions.x && fractionB !== unboundedFractions.y) {
241
+ // Fill in (in the result) both individual details with "projected" points and distance.
242
+ // The "loser" will have its contents replaced.
243
+ const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;
244
+ const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;
245
+ segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);
246
+ segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);
247
+ if (result.detailA.a <= result.detailB.a) {
248
+ CurveLocationDetail.createCurveFractionPoint(segmentB, fractionB, clampedPointOnB, result.detailB);
249
+ }
250
+ else {
251
+ CurveLocationDetail.createCurveFractionPoint(segmentA, fractionA, clampedPointOnA, result.detailA);
252
+ }
253
+ }
254
+ else if (fractionB !== unboundedFractions.y) {
255
+ // B (only) was clamped.
256
+ const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;
257
+ segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);
258
+ result.detailB.setCurve(segmentB);
259
+ result.detailB.point.setFrom(clampedPointOnB);
260
+ result.detailB.fraction = fractionB;
261
+ }
262
+ else {
263
+ // fractionA was clamped.
264
+ const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;
265
+ segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);
266
+ result.detailA.setCurve(segmentA);
267
+ result.detailA.point.setFrom(clampedPointOnA);
268
+ result.detailA.fraction = fractionA;
269
+ }
270
+ result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);
271
+ return result;
272
+ }
273
+ // (probably? certainly?) parallel (possibly coincident) lines.
274
+ // run all 4 endpoint-to-other cases . . . reassemble carefully ...
275
+ const resultSet = [
276
+ segmentA.closestPoint(segmentB._point0, extendA),
277
+ segmentA.closestPoint(segmentB._point1, extendA),
278
+ segmentB.closestPoint(segmentA._point0, extendB),
279
+ segmentB.closestPoint(segmentA._point1, extendB),
280
+ ];
281
+ let dMin = resultSet[0].a;
282
+ let iMin = 0;
283
+ for (let i = 1; i < 4; i++) {
284
+ if (resultSet[i].a < dMin) {
285
+ iMin = i;
286
+ dMin = resultSet[i].a;
287
+ }
288
+ }
289
+ if (iMin === 0) {
290
+ resultSet[0].clone(result.detailA);
291
+ CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 0.0, result.detailB);
292
+ result.detailB.a = result.detailA.a;
293
+ }
294
+ else if (iMin === 1) {
295
+ resultSet[1].clone(result.detailA);
296
+ CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 1.0, result.detailB);
297
+ result.detailB.a = result.detailA.a;
298
+ }
299
+ else if (iMin === 2) {
300
+ resultSet[2].clone(result.detailB);
301
+ CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 0.0, result.detailA);
302
+ result.detailA.a = result.detailB.a;
303
+ }
304
+ else {
305
+ assert(iMin === 3);
306
+ resultSet[3].clone(result.detailB);
307
+ CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 1.0, result.detailA);
308
+ result.detailA.a = result.detailB.a;
309
+ }
310
+ return result;
311
+ }
207
312
  /** Swap the endpoint references. */
208
313
  reverseInPlace() {
209
314
  const a = this._point0;
@@ -1 +1 @@
1
- {"version":3,"file":"LineSegment3d.js","sourceRoot":"","sources":["../../../src/curve/LineSegment3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAmB,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAEhF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAW,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,kBAAkB,EAA+B,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAsC,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAEzF,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,mEAAmE;AAEnE;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,aAAc,SAAQ,cAAc;IAG/C,kDAAkD;IAC3C,mBAAmB,CAAC,KAAoB;QAC7C,OAAO,KAAK,YAAY,aAAa,CAAC;IACxC,CAAC;IAKD;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD;;;OAGG;IACH,IAAW,SAAS;QAClB,OAAO,IAAI,CAAC,OAAO,CAAC;IACtB,CAAC;IACD,uDAAuD;IACvD,IAAoB,yBAAyB;QAC3C,OAAO,IA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Aa,CAAC,MAAM,CACzB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAC/F,CAAC;SACH;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,yBAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { Clipper } from \"../clipping/ClipUtils\";\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { GeometryHandler, IStrokeHandler } from \"../geometry3d/GeometryHandler\";\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { Order2Bezier } from \"../numerics/BezierPolynomials\";\nimport { CurveExtendOptions, VariantCurveExtendParameter } from \"./CurveExtendMode\";\nimport { CurveIntervalRole, CurveLocationDetail } from \"./CurveLocationDetail\";\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"./CurvePrimitive\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\nimport { LineString3d } from \"./LineString3d\";\nimport { OffsetOptions } from \"./OffsetOptions\";\nimport { StrokeOptions } from \"./StrokeOptions\";\n\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\n\n/**\n * A LineSegment3d is:\n * * A 3d line segment represented by its start and end coordinates\n * * startPoint\n * * endPoint\n * * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these\n * equivalent forms maps fraction `f` to a point `X(f)`:\n * ```\n * equation\n * X(f) = P_0 + f*(P_1 - P_0)\\newline\n * X(f) = (1-f)*P_0 + f*P_1\n * ```\n * @public\n */\nexport class LineSegment3d extends CurvePrimitive implements BeJSONFunctions {\n /** String name for schema properties */\n public readonly curvePrimitiveType = \"lineSegment\";\n /** Test if `other` is of class `LineSegment3d` */\n public isSameGeometryClass(other: GeometryQuery): boolean {\n return other instanceof LineSegment3d;\n }\n /** Start point of the segment */\n private _point0: Point3d;\n /** End point of the segment */\n private _point1: Point3d;\n /**\n * Return REFERENCE to the start point of this segment.\n * * This is distinct from the `CurvePrimitive` abstract method `startPoint()` which creates a returned point.\n */\n public get point0Ref(): Point3d {\n return this._point0;\n }\n /**\n * Return REFERENCE to the end point of this segment.\n * * This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point.\n */\n public get point1Ref(): Point3d {\n return this._point1;\n }\n /** A LineSegment3d extends along its infinite line. */\n public override get isExtensibleFractionSpace(): boolean {\n return true;\n }\n /**\n * CAPTURE point references as a `LineSegment3d`\n * @param point0\n * @param point1\n */\n protected constructor(point0: Point3d, point1: Point3d) {\n super();\n this._point0 = point0;\n this._point1 = point1;\n }\n /** Set the start and endpoints by capturing input references. */\n public setRefs(point0: Point3d, point1: Point3d) {\n this._point0 = point0;\n this._point1 = point1;\n }\n /** Set the start and endpoints by cloning the input parameters. */\n public set(point0: Point3d, point1: Point3d) {\n this._point0 = point0.clone();\n this._point1 = point1.clone();\n }\n /** Copy (clone) data from other */\n public setFrom(other: LineSegment3d) {\n this._point0.setFrom(other._point0);\n this._point1.setFrom(other._point1);\n }\n /** Return a (clone of) the start point (This is NOT a reference to the stored start point) */\n public override startPoint(result?: Point3d): Point3d {\n if (result) { result.setFrom(this._point0); return result; }\n return this._point0.clone();\n }\n /** Return a (clone of) the end point (This is NOT a reference to the stored end point) */\n public override endPoint(result?: Point3d): Point3d {\n if (result) { result.setFrom(this._point1); return result; }\n return this._point1.clone();\n }\n /** Return the point and derivative vector at fractional position along the line segment. */\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\n result = result ? result : Ray3d.createZero();\n result.direction.setStartEnd(this._point0, this._point1);\n this._point0.interpolate(fraction, this._point1, result.origin);\n return result;\n }\n /**\n * Construct a plane with\n * * origin at the fractional position along the line segment\n * * x axis is the first derivative, i.e. along the line segment\n * * y axis is the second derivative, i.e. 000\n */\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n result = result ? result : Plane3dByOriginAndVectors.createXYPlane();\n result.vectorU.setStartEnd(this._point0, this._point1);\n result.vectorV.set(0, 0, 0);\n this._point0.interpolate(fraction, this._point1, result.origin);\n return result;\n }\n /** Clone the LineSegment3d */\n public clone(): LineSegment3d {\n return LineSegment3d.create(this._point0, this._point1);\n }\n /** Clone and apply transform to the clone. */\n public cloneTransformed(transform: Transform): LineSegment3d { // we know tryTransformInPlace succeeds.\n const c = this.clone();\n c.tryTransformInPlace(transform);\n return c;\n }\n /** Create with start and end points. The point contents are cloned into the LineSegment3d. */\n public static create(point0: Point3d, point1: Point3d, result?: LineSegment3d): LineSegment3d {\n if (result) {\n result.set(point0, point1); // and this will clone them !!\n return result;\n }\n return new LineSegment3d(point0.clone(), point1.clone());\n }\n /** Create with start and end points. The point contents are CAPTURED into the result */\n public static createCapture(point0: Point3d, point1: Point3d): LineSegment3d {\n return new LineSegment3d(point0, point1);\n }\n /**\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\n * @param x0 start point x coordinate.\n * @param y0 start point y coordinate.\n * @param x1 end point x coordinate.\n * @param y1 end point y coordinate.\n * @param z z coordinate to use for both points.\n * @param result optional existing LineSegment to be reinitialized.\n */\n public static createXYXY(x0: number, y0: number, x1: number, y1: number, z: number = 0, result?: LineSegment3d) {\n if (result) {\n result._point0.set(x0, y0, z);\n result._point1.set(x1, y1, z);\n return result;\n }\n return new LineSegment3d(Point3d.create(x0, y0, z), Point3d.create(x1, y1, z));\n }\n /**\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\n * @param x0 start point x coordinate.\n * @param y0 start point y coordinate.\n * @param x1 end point x coordinate.\n * @param y1 end point y coordinate.\n * @param z z coordinate to use for both points.\n * @param result optional existing LineSegment to be reinitialized.\n */\n public static createXYZXYZ(\n x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, result?: LineSegment3d,\n ): LineSegment3d {\n if (result) {\n result._point0.set(x0, y0, z0);\n result._point1.set(x1, y1, z1);\n return result;\n }\n return new LineSegment3d(Point3d.create(x0, y0, z0), Point3d.create(x1, y1, z1));\n }\n /** Return the point at fractional position along the line segment. */\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\n return this._point0.interpolate(fraction, this._point1, result);\n }\n /** Return the length of the segment. */\n public override curveLength(): number {\n return this._point0.distance(this._point1);\n }\n /** Return the length of the partial segment between fractions. */\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number): number {\n return Math.abs(fraction1 - fraction0) * this._point0.distance(this._point1);\n }\n /** Return the length of the segment. */\n public quickLength(): number {\n return this.curveLength();\n }\n /**\n * Returns a curve location detail with both xyz and fractional coordinates of the closest point.\n * @param spacePoint point in space\n * @param extend if false, only return points within the bounded line segment. If true, allow the point to be on\n * the unbounded line that contains the bounded segment.\n */\n public override closestPoint(\n spacePoint: Point3d, extend: VariantCurveExtendParameter, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n let fraction = spacePoint.fractionOfProjectionToLine(this._point0, this._point1, 0.0);\n fraction = CurveExtendOptions.correctFraction(extend, fraction);\n result = CurveLocationDetail.create(this, result);\n // remark: This can be done by result.setFP (fraction, thePoint, undefined, a)\n // but that creates a temporary point.\n result.fraction = fraction;\n this._point0.interpolate(fraction, this._point1, result.point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = result.point.distance(spacePoint);\n return result;\n }\n /** Swap the endpoint references. */\n public reverseInPlace(): void {\n const a = this._point0;\n this._point0 = this._point1;\n this._point1 = a;\n }\n /** Transform the two endpoints of this LinSegment. */\n public tryTransformInPlace(transform: Transform): boolean {\n this._point0 = transform.multiplyPoint3d(this._point0, this._point0);\n this._point1 = transform.multiplyPoint3d(this._point1, this._point1);\n return true;\n }\n /** Test if both endpoints are in a plane (within tolerance) */\n public isInPlane(plane: PlaneAltitudeEvaluator): boolean {\n return Geometry.isSmallMetricDistance(plane.altitude(this._point0))\n && Geometry.isSmallMetricDistance(plane.altitude(this._point1));\n }\n /**\n * Compute points of simple (transverse) with a plane.\n * * Use isInPlane to test if the line segment is completely in the plane.\n */\n public override appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\n const h0 = plane.altitude(this._point0);\n const h1 = plane.altitude(this._point1);\n const fraction = Order2Bezier.solveCoffs(h0, h1);\n let numIntersection = 0;\n if (fraction !== undefined) {\n numIntersection++;\n const detail = CurveLocationDetail.createCurveFractionPoint(this, fraction, this.fractionToPoint(fraction));\n detail.intervalRole = CurveIntervalRole.isolated;\n result.push(detail);\n }\n return numIntersection;\n }\n /**\n * Extend a range to include the (optionally transformed) line segment\n * @param range range to extend\n * @param transform optional transform to apply to the end points\n */\n public extendRange(range: Range3d, transform?: Transform): void {\n if (transform) {\n range.extendTransformedPoint(transform, this._point0);\n range.extendTransformedPoint(transform, this._point1);\n } else {\n range.extendPoint(this._point0);\n range.extendPoint(this._point1);\n }\n }\n /**\n * Construct a line from either of these json forms:\n *\n * * object with named start and end:\n * `{startPoint: pointValue, endPoint: pointValue}`\n * * array of two point values:\n * `[pointValue, pointValue]`\n * The point values are any values accepted by the Point3d method setFromJSON.\n * @param json data to parse.\n */\n public setFromJSON(json?: any) {\n if (!json) {\n this._point0.set(0, 0, 0);\n this._point1.set(1, 0, 0);\n return;\n } else if (json.startPoint && json.endPoint) { // {startPoint:json point, endPoint:json point}\n this._point0.setFromJSON(json.startPoint);\n this._point1.setFromJSON(json.endPoint);\n } else if (Array.isArray(json)\n && json.length > 1) { // [json point, json point]\n this._point0.setFromJSON(json[0]);\n this._point1.setFromJSON(json[1]);\n }\n }\n /** A simple line segment's fraction and distance are proportional. */\n public override getFractionToDistanceScale(): number | undefined {\n return this.curveLength();\n }\n /**\n * Place the lineSegment3d start and points in a json object\n * @return {*} [[x,y,z],[x,y,z]]\n */\n public toJSON(): any {\n return [this._point0.toJSON(), this._point1.toJSON()];\n }\n /** Create a new `LineSegment3d` with coordinates from json object. See `setFromJSON` for object layout description. */\n public static fromJSON(json?: any): LineSegment3d {\n const result = new LineSegment3d(Point3d.createZero(), Point3d.create());\n result.setFromJSON(json);\n return result;\n }\n /** Near equality test with `other`. */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof LineSegment3d) {\n const ls = other;\n return this._point0.isAlmostEqual(ls._point0) && this._point1.isAlmostEqual(ls._point1);\n }\n return false;\n }\n /** Emit strokes to caller-supplied linestring */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\n const numStroke = this.computeStrokeCountForOptions(options);\n dest.appendFractionalStrokePoints(this, numStroke, 0.0, 1.0);\n }\n /** Emit strokes to caller-supplied handler */\n public emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void {\n handler.startCurvePrimitive(this);\n const numStroke = this.computeStrokeCountForOptions(options);\n handler.announceSegmentInterval(this, this._point0, this._point1, numStroke, 0.0, 1.0);\n handler.endCurvePrimitive(this);\n }\n /**\n * Return the stroke count required for given options.\n * @param options StrokeOptions that determine count\n */\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n let numStroke = 1;\n if (options) {\n if (options.maxEdgeLength)\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n }\n return numStroke;\n }\n /** Second step of double dispatch: call `handler.handleLineSegment3d(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleLineSegment3d(this);\n }\n /**\n * Find intervals of this curve primitive that are interior to a clipper\n * @param clipper clip structure (e.g. clip planes)\n * @param announce function to be called announcing fractional intervals `announce(fraction0, fraction1, curvePrimitive)`\n */\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n return clipper.announceClippedSegmentIntervals(\n 0.0, 1.0, this._point0, this._point1,\n announce ? (fraction0: number, fraction1: number) => announce(fraction0, fraction1, this) : undefined,\n );\n }\n /**\n * Return (if possible) a curve primitive which is a portion of this curve.\n * @param fractionA [in] start fraction\n * @param fractionB [in] end fraction\n */\n public override clonePartialCurve(fractionA: number, fractionB: number): LineSegment3d {\n return LineSegment3d.create(this.fractionToPoint(fractionA), this.fractionToPoint(fractionB));\n }\n /**\n * Returns a (high accuracy) range of the curve between fractional positions\n * * Default implementation returns teh range of the curve from clonePartialCurve\n */\n public override rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\n // (This is cheap -- don't bother testing for fraction0===fraction1)\n if (!transform) {\n const range = Range3d.create();\n range.extendInterpolated(this._point0, fraction0, this._point1);\n range.extendInterpolated(this._point0, fraction1, this._point1);\n return range;\n }\n const point0 = this.fractionToPoint(fraction0);\n const point1 = this.fractionToPoint(fraction1);\n if (transform) {\n transform.multiplyPoint3d(point0, point0);\n transform.multiplyPoint3d(point1, point1);\n }\n return Range3d.create(point0, point1);\n }\n /**\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\n */\n public override constructOffsetXY(\n offsetDistanceOrOptions: number | OffsetOptions,\n ): CurvePrimitive | CurvePrimitive[] | undefined {\n const offsetVec = Vector3d.createStartEnd(this._point0, this._point1);\n if (offsetVec.normalizeInPlace()) {\n offsetVec.rotate90CCWXY(offsetVec);\n const offsetDist = OffsetOptions.getOffsetDistance(offsetDistanceOrOptions);\n return LineSegment3d.create(\n this._point0.plusScaled(offsetVec, offsetDist), this._point1.plusScaled(offsetVec, offsetDist),\n );\n }\n return undefined;\n }\n /**\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of\n * projection.\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\n * @param lowHigh optional receiver for output\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\n * end of the ray.\n */\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\n }\n}\n"]}
1
+ {"version":3,"file":"LineSegment3d.js","sourceRoot":"","sources":["../../../src/curve/LineSegment3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAE7C,OAAO,EAAmB,QAAQ,EAA0B,MAAM,aAAa,CAAC;AAEhF,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAW,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAA+B,MAAM,mBAAmB,CAAC;AACpF,OAAO,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AACxG,OAAO,EAAsC,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtF,OAAO,EAAE,yBAA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AAe,CAAC,SAAS,CAAC,CAAC;QAC/C,IAAI,SAAS,EAAE;YACb,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;YAC1C,SAAS,CAAC,eAAe,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;SAC3C;QACD,OAAO,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,CAAC;IACD;;;OAGG;IACa,iBAAiB,CAC/B,uBAA+C;QAE/C,MAAM,SAAS,GAAG,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QACtE,IAAI,SAAS,CAAC,gBAAgB,EAAE,EAAE;YAChC,SAAS,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;YACnC,MAAM,UAAU,GAAG,aAAa,CAAC,iBAAiB,CAAC,uBAAuB,CAAC,CAAC;YAC5E,OAAO,aAAa,CAAC,MAAM,CACzB,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,EAAE,UAAU,CAAC,CAC/F,CAAC;SACH;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,yBAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module Curve\n */\n\nimport { assert } from \"@itwin/core-bentley\";\nimport { Clipper } from \"../clipping/ClipUtils\";\nimport { BeJSONFunctions, Geometry, PlaneAltitudeEvaluator } from \"../Geometry\";\nimport { GeometryHandler, IStrokeHandler } from \"../geometry3d/GeometryHandler\";\nimport { Plane3dByOriginAndVectors } from \"../geometry3d/Plane3dByOriginAndVectors\";\nimport { Vector2d } from \"../geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\nimport { Ray3d } from \"../geometry3d/Ray3d\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { Order2Bezier } from \"../numerics/BezierPolynomials\";\nimport { SmallSystem } from \"../numerics/Polynomials\";\nimport { CurveExtendOptions, VariantCurveExtendParameter } from \"./CurveExtendMode\";\nimport { CurveIntervalRole, CurveLocationDetail, CurveLocationDetailPair } from \"./CurveLocationDetail\";\nimport { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from \"./CurvePrimitive\";\nimport { GeometryQuery } from \"./GeometryQuery\";\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\nimport { LineString3d } from \"./LineString3d\";\nimport { OffsetOptions } from \"./OffsetOptions\";\nimport { StrokeOptions } from \"./StrokeOptions\";\n\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\n\n/**\n * A LineSegment3d is:\n * * A 3d line segment represented by its start and end coordinates\n * * startPoint\n * * endPoint\n * * The segment is parameterized with fraction 0 at the start and fraction 1 at the end, i.e. each of these\n * equivalent forms maps fraction `f` to a point `X(f)`:\n * ```\n * equation\n * X(f) = P_0 + f*(P_1 - P_0)\\newline\n * X(f) = (1-f)*P_0 + f*P_1\n * ```\n * @public\n */\nexport class LineSegment3d extends CurvePrimitive implements BeJSONFunctions {\n /** String name for schema properties */\n public readonly curvePrimitiveType = \"lineSegment\";\n /** Test if `other` is of class `LineSegment3d` */\n public isSameGeometryClass(other: GeometryQuery): boolean {\n return other instanceof LineSegment3d;\n }\n /** Start point of the segment */\n private _point0: Point3d;\n /** End point of the segment */\n private _point1: Point3d;\n /**\n * Return REFERENCE to the start point of this segment.\n * * This is distinct from the `CurvePrimitive` abstract method `startPoint()` which creates a returned point.\n */\n public get point0Ref(): Point3d {\n return this._point0;\n }\n /**\n * Return REFERENCE to the end point of this segment.\n * * This is distinct from the `CurvePrimitive` abstract method `endPoint()` which creates a returned point.\n */\n public get point1Ref(): Point3d {\n return this._point1;\n }\n /** A LineSegment3d extends along its infinite line. */\n public override get isExtensibleFractionSpace(): boolean {\n return true;\n }\n /**\n * CAPTURE point references as a `LineSegment3d`\n * @param point0\n * @param point1\n */\n protected constructor(point0: Point3d, point1: Point3d) {\n super();\n this._point0 = point0;\n this._point1 = point1;\n }\n /** Set the start and endpoints by capturing input references. */\n public setRefs(point0: Point3d, point1: Point3d) {\n this._point0 = point0;\n this._point1 = point1;\n }\n /** Set the start and endpoints by cloning the input parameters. */\n public set(point0: Point3d, point1: Point3d) {\n this._point0 = point0.clone();\n this._point1 = point1.clone();\n }\n /** Copy (clone) data from other */\n public setFrom(other: LineSegment3d) {\n this._point0.setFrom(other._point0);\n this._point1.setFrom(other._point1);\n }\n /** Return a (clone of) the start point (This is NOT a reference to the stored start point) */\n public override startPoint(result?: Point3d): Point3d {\n if (result) { result.setFrom(this._point0); return result; }\n return this._point0.clone();\n }\n /** Return a (clone of) the end point (This is NOT a reference to the stored end point) */\n public override endPoint(result?: Point3d): Point3d {\n if (result) { result.setFrom(this._point1); return result; }\n return this._point1.clone();\n }\n /** Return the point and derivative vector at fractional position along the line segment. */\n public fractionToPointAndDerivative(fraction: number, result?: Ray3d): Ray3d {\n result = result ? result : Ray3d.createZero();\n result.direction.setStartEnd(this._point0, this._point1);\n this._point0.interpolate(fraction, this._point1, result.origin);\n return result;\n }\n /**\n * Construct a plane with\n * * origin at the fractional position along the line segment\n * * x axis is the first derivative, i.e. along the line segment\n * * y axis is the second derivative, i.e. 000\n */\n public fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors {\n result = result ? result : Plane3dByOriginAndVectors.createXYPlane();\n result.vectorU.setStartEnd(this._point0, this._point1);\n result.vectorV.set(0, 0, 0);\n this._point0.interpolate(fraction, this._point1, result.origin);\n return result;\n }\n /** Clone the LineSegment3d */\n public clone(): LineSegment3d {\n return LineSegment3d.create(this._point0, this._point1);\n }\n /** Clone and apply transform to the clone. */\n public cloneTransformed(transform: Transform): LineSegment3d { // we know tryTransformInPlace succeeds.\n const c = this.clone();\n c.tryTransformInPlace(transform);\n return c;\n }\n /** Create with start and end points. The point contents are cloned into the LineSegment3d. */\n public static create(point0: Point3d, point1: Point3d, result?: LineSegment3d): LineSegment3d {\n if (result) {\n result.set(point0, point1); // and this will clone them !!\n return result;\n }\n return new LineSegment3d(point0.clone(), point1.clone());\n }\n /** Create with start and end points. The point contents are CAPTURED into the result */\n public static createCapture(point0: Point3d, point1: Point3d): LineSegment3d {\n return new LineSegment3d(point0, point1);\n }\n /**\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\n * @param x0 start point x coordinate.\n * @param y0 start point y coordinate.\n * @param x1 end point x coordinate.\n * @param y1 end point y coordinate.\n * @param z z coordinate to use for both points.\n * @param result optional existing LineSegment to be reinitialized.\n */\n public static createXYXY(x0: number, y0: number, x1: number, y1: number, z: number = 0, result?: LineSegment3d) {\n if (result) {\n result._point0.set(x0, y0, z);\n result._point1.set(x1, y1, z);\n return result;\n }\n return new LineSegment3d(Point3d.create(x0, y0, z), Point3d.create(x1, y1, z));\n }\n /**\n * Create a LineSegment3d from xy coordinates of start and end, with common z.\n * @param x0 start point x coordinate.\n * @param y0 start point y coordinate.\n * @param x1 end point x coordinate.\n * @param y1 end point y coordinate.\n * @param z z coordinate to use for both points.\n * @param result optional existing LineSegment to be reinitialized.\n */\n public static createXYZXYZ(\n x0: number, y0: number, z0: number, x1: number, y1: number, z1: number, result?: LineSegment3d,\n ): LineSegment3d {\n if (result) {\n result._point0.set(x0, y0, z0);\n result._point1.set(x1, y1, z1);\n return result;\n }\n return new LineSegment3d(Point3d.create(x0, y0, z0), Point3d.create(x1, y1, z1));\n }\n /** Return the point at fractional position along the line segment. */\n public fractionToPoint(fraction: number, result?: Point3d): Point3d {\n return this._point0.interpolate(fraction, this._point1, result);\n }\n /** Return the length of the segment. */\n public override curveLength(): number {\n return this._point0.distance(this._point1);\n }\n /** Return the length of the partial segment between fractions. */\n public override curveLengthBetweenFractions(fraction0: number, fraction1: number): number {\n return Math.abs(fraction1 - fraction0) * this._point0.distance(this._point1);\n }\n /** Return the length of the segment. */\n public quickLength(): number {\n return this.curveLength();\n }\n /**\n * Returns a curve location detail with both xyz and fractional coordinates of the closest point.\n * @param spacePoint point in space\n * @param extend if false, only return points within the bounded line segment. If true, allow the point to be on\n * the unbounded line that contains the bounded segment.\n * @param result optional pre-allocated object to populate and return\n * @returns detail, with `a` field set to the distance from `spacePoint` to the closest point\n */\n public override closestPoint(\n spacePoint: Point3d, extend: VariantCurveExtendParameter, result?: CurveLocationDetail,\n ): CurveLocationDetail {\n let fraction = spacePoint.fractionOfProjectionToLine(this._point0, this._point1, 0.0);\n fraction = CurveExtendOptions.correctFraction(extend, fraction);\n result = CurveLocationDetail.create(this, result);\n result.fraction = fraction;\n this._point0.interpolate(fraction, this._point1, result.point);\n result.vectorInCurveLocationDetail = undefined;\n result.a = result.point.distance(spacePoint);\n return result;\n }\n /**\n * Compute the closest approach between a pair of line segments.\n * * The approach distance is returned in the `a` fields of the details.\n * @param segmentA first line segment\n * @param extendA how to extend segmentA forward/backward\n * @param segmentB second line segment\n * @param extendB how to extend segmentB forward/backward\n * @param result optional pre-allocated object to populate and return\n * @returns pair of details, one per segment, each with `a` field set to the closest approach distance\n */\n public static closestApproach(\n segmentA: LineSegment3d,\n extendA: VariantCurveExtendParameter,\n segmentB: LineSegment3d,\n extendB: VariantCurveExtendParameter,\n result?: CurveLocationDetailPair,\n ): CurveLocationDetailPair | undefined {\n const unboundedFractions = Vector2d.create();\n if (result === undefined)\n result = CurveLocationDetailPair.createCapture(CurveLocationDetail.create(), CurveLocationDetail.create());\n if (SmallSystem.lineSegment3dClosestApproachUnbounded(segmentA._point0, segmentA._point1, segmentB._point0, segmentB._point1, unboundedFractions)) {\n // There is a simple approach between the unbounded segments. Maybe its a really easy case ...\n const fractionA = CurveExtendOptions.correctFraction(extendA, unboundedFractions.x);\n const fractionB = CurveExtendOptions.correctFraction(extendB, unboundedFractions.y);\n // if neither fraction was corrected, just accept !!!\n if (fractionA === unboundedFractions.x && fractionB === unboundedFractions.y) {\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, fractionA, result.detailA);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, fractionB, result.detailB);\n result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);\n return result;\n }\n // One or both of the fractions were clamped back to an endpoint.\n // Claim: (????!!!????) The only proximity candidates that matter are from clamped point onto the other.\n if (fractionA !== unboundedFractions.x && fractionB !== unboundedFractions.y) {\n // Fill in (in the result) both individual details with \"projected\" points and distance.\n // The \"loser\" will have its contents replaced.\n const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;\n const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;\n segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);\n segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);\n if (result.detailA.a <= result.detailB.a) {\n CurveLocationDetail.createCurveFractionPoint(segmentB, fractionB, clampedPointOnB, result.detailB);\n } else {\n CurveLocationDetail.createCurveFractionPoint(segmentA, fractionA, clampedPointOnA, result.detailA);\n }\n } else if (fractionB !== unboundedFractions.y) {\n // B (only) was clamped.\n const clampedPointOnB = fractionB < 0.5 ? segmentB._point0 : segmentB._point1;\n segmentA.closestPoint(clampedPointOnB, extendA, result.detailA);\n result.detailB.setCurve(segmentB);\n result.detailB.point.setFrom(clampedPointOnB);\n result.detailB.fraction = fractionB;\n } else {\n // fractionA was clamped.\n const clampedPointOnA = fractionA < 0.5 ? segmentA._point0 : segmentA._point1;\n segmentB.closestPoint(clampedPointOnA, extendB, result.detailB);\n result.detailA.setCurve(segmentA);\n result.detailA.point.setFrom(clampedPointOnA);\n result.detailA.fraction = fractionA;\n }\n result.detailA.a = result.detailB.a = result.detailA.point.distance(result.detailB.point);\n return result;\n }\n // (probably? certainly?) parallel (possibly coincident) lines.\n // run all 4 endpoint-to-other cases . . . reassemble carefully ...\n const resultSet = [\n segmentA.closestPoint(segmentB._point0, extendA),\n segmentA.closestPoint(segmentB._point1, extendA),\n segmentB.closestPoint(segmentA._point0, extendB),\n segmentB.closestPoint(segmentA._point1, extendB),\n ];\n let dMin = resultSet[0].a;\n let iMin = 0;\n for (let i = 1; i < 4; i++) {\n if (resultSet[i].a < dMin) {\n iMin = i;\n dMin = resultSet[i].a;\n }\n }\n if (iMin === 0) {\n resultSet[0].clone(result.detailA);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 0.0, result.detailB);\n result.detailB.a = result.detailA.a;\n } else if (iMin === 1) {\n resultSet[1].clone(result.detailA);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentB, 1.0, result.detailB);\n result.detailB.a = result.detailA.a;\n } else if (iMin === 2) {\n resultSet[2].clone(result.detailB);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 0.0, result.detailA);\n result.detailA.a = result.detailB.a;\n } else {\n assert(iMin === 3);\n resultSet[3].clone(result.detailB);\n CurveLocationDetail.createCurveEvaluatedFraction(segmentA, 1.0, result.detailA);\n result.detailA.a = result.detailB.a;\n }\n return result;\n }\n /** Swap the endpoint references. */\n public reverseInPlace(): void {\n const a = this._point0;\n this._point0 = this._point1;\n this._point1 = a;\n }\n /** Transform the two endpoints of this LinSegment. */\n public tryTransformInPlace(transform: Transform): boolean {\n this._point0 = transform.multiplyPoint3d(this._point0, this._point0);\n this._point1 = transform.multiplyPoint3d(this._point1, this._point1);\n return true;\n }\n /** Test if both endpoints are in a plane (within tolerance) */\n public isInPlane(plane: PlaneAltitudeEvaluator): boolean {\n return Geometry.isSmallMetricDistance(plane.altitude(this._point0))\n && Geometry.isSmallMetricDistance(plane.altitude(this._point1));\n }\n /**\n * Compute points of simple (transverse) with a plane.\n * * Use isInPlane to test if the line segment is completely in the plane.\n */\n public override appendPlaneIntersectionPoints(plane: PlaneAltitudeEvaluator, result: CurveLocationDetail[]): number {\n const h0 = plane.altitude(this._point0);\n const h1 = plane.altitude(this._point1);\n const fraction = Order2Bezier.solveCoffs(h0, h1);\n let numIntersection = 0;\n if (fraction !== undefined) {\n numIntersection++;\n const detail = CurveLocationDetail.createCurveFractionPoint(this, fraction, this.fractionToPoint(fraction));\n detail.intervalRole = CurveIntervalRole.isolated;\n result.push(detail);\n }\n return numIntersection;\n }\n /**\n * Extend a range to include the (optionally transformed) line segment\n * @param range range to extend\n * @param transform optional transform to apply to the end points\n */\n public extendRange(range: Range3d, transform?: Transform): void {\n if (transform) {\n range.extendTransformedPoint(transform, this._point0);\n range.extendTransformedPoint(transform, this._point1);\n } else {\n range.extendPoint(this._point0);\n range.extendPoint(this._point1);\n }\n }\n /**\n * Construct a line from either of these json forms:\n *\n * * object with named start and end:\n * `{startPoint: pointValue, endPoint: pointValue}`\n * * array of two point values:\n * `[pointValue, pointValue]`\n * The point values are any values accepted by the Point3d method setFromJSON.\n * @param json data to parse.\n */\n public setFromJSON(json?: any) {\n if (!json) {\n this._point0.set(0, 0, 0);\n this._point1.set(1, 0, 0);\n return;\n } else if (json.startPoint && json.endPoint) { // {startPoint:json point, endPoint:json point}\n this._point0.setFromJSON(json.startPoint);\n this._point1.setFromJSON(json.endPoint);\n } else if (Array.isArray(json)\n && json.length > 1) { // [json point, json point]\n this._point0.setFromJSON(json[0]);\n this._point1.setFromJSON(json[1]);\n }\n }\n /** A simple line segment's fraction and distance are proportional. */\n public override getFractionToDistanceScale(): number | undefined {\n return this.curveLength();\n }\n /**\n * Place the lineSegment3d start and points in a json object\n * @return {*} [[x,y,z],[x,y,z]]\n */\n public toJSON(): any {\n return [this._point0.toJSON(), this._point1.toJSON()];\n }\n /** Create a new `LineSegment3d` with coordinates from json object. See `setFromJSON` for object layout description. */\n public static fromJSON(json?: any): LineSegment3d {\n const result = new LineSegment3d(Point3d.createZero(), Point3d.create());\n result.setFromJSON(json);\n return result;\n }\n /** Near equality test with `other`. */\n public override isAlmostEqual(other: GeometryQuery): boolean {\n if (other instanceof LineSegment3d) {\n const ls = other;\n return this._point0.isAlmostEqual(ls._point0) && this._point1.isAlmostEqual(ls._point1);\n }\n return false;\n }\n /** Emit strokes to caller-supplied linestring */\n public emitStrokes(dest: LineString3d, options?: StrokeOptions): void {\n const numStroke = this.computeStrokeCountForOptions(options);\n dest.appendFractionalStrokePoints(this, numStroke, 0.0, 1.0);\n }\n /** Emit strokes to caller-supplied handler */\n public emitStrokableParts(handler: IStrokeHandler, options?: StrokeOptions): void {\n handler.startCurvePrimitive(this);\n const numStroke = this.computeStrokeCountForOptions(options);\n handler.announceSegmentInterval(this, this._point0, this._point1, numStroke, 0.0, 1.0);\n handler.endCurvePrimitive(this);\n }\n /**\n * Return the stroke count required for given options.\n * @param options StrokeOptions that determine count\n */\n public computeStrokeCountForOptions(options?: StrokeOptions): number {\n let numStroke = 1;\n if (options) {\n if (options.maxEdgeLength)\n numStroke = options.applyMaxEdgeLength(numStroke, this.curveLength());\n numStroke = options.applyMinStrokesPerPrimitive(numStroke);\n }\n return numStroke;\n }\n /** Second step of double dispatch: call `handler.handleLineSegment3d(this)` */\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\n return handler.handleLineSegment3d(this);\n }\n /**\n * Find intervals of this curve primitive that are interior to a clipper\n * @param clipper clip structure (e.g. clip planes)\n * @param announce function to be called announcing fractional intervals `announce(fraction0, fraction1, curvePrimitive)`\n */\n public override announceClipIntervals(clipper: Clipper, announce?: AnnounceNumberNumberCurvePrimitive): boolean {\n return clipper.announceClippedSegmentIntervals(\n 0.0, 1.0, this._point0, this._point1,\n announce ? (fraction0: number, fraction1: number) => announce(fraction0, fraction1, this) : undefined,\n );\n }\n /**\n * Return (if possible) a curve primitive which is a portion of this curve.\n * @param fractionA [in] start fraction\n * @param fractionB [in] end fraction\n */\n public override clonePartialCurve(fractionA: number, fractionB: number): LineSegment3d {\n return LineSegment3d.create(this.fractionToPoint(fractionA), this.fractionToPoint(fractionB));\n }\n /**\n * Returns a (high accuracy) range of the curve between fractional positions\n * * Default implementation returns teh range of the curve from clonePartialCurve\n */\n public override rangeBetweenFractions(fraction0: number, fraction1: number, transform?: Transform): Range3d {\n // (This is cheap -- don't bother testing for fraction0===fraction1)\n if (!transform) {\n const range = Range3d.create();\n range.extendInterpolated(this._point0, fraction0, this._point1);\n range.extendInterpolated(this._point0, fraction1, this._point1);\n return range;\n }\n const point0 = this.fractionToPoint(fraction0);\n const point1 = this.fractionToPoint(fraction1);\n if (transform) {\n transform.multiplyPoint3d(point0, point0);\n transform.multiplyPoint3d(point1, point1);\n }\n return Range3d.create(point0, point1);\n }\n /**\n * Construct an offset of the instance curve as viewed in the xy-plane (ignoring z).\n * @param offsetDistanceOrOptions offset distance (positive to left of the instance curve), or options object\n */\n public override constructOffsetXY(\n offsetDistanceOrOptions: number | OffsetOptions,\n ): CurvePrimitive | CurvePrimitive[] | undefined {\n const offsetVec = Vector3d.createStartEnd(this._point0, this._point1);\n if (offsetVec.normalizeInPlace()) {\n offsetVec.rotate90CCWXY(offsetVec);\n const offsetDist = OffsetOptions.getOffsetDistance(offsetDistanceOrOptions);\n return LineSegment3d.create(\n this._point0.plusScaled(offsetVec, offsetDist), this._point1.plusScaled(offsetVec, offsetDist),\n );\n }\n return undefined;\n }\n /**\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters of\n * projection.\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\n * @param lowHigh optional receiver for output\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\n * end of the ray.\n */\n public override projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\n }\n}\n"]}