@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":"LineSegment3d.js","sourceRoot":"","sources":["../../../src/curve/LineSegment3d.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAO/F,0CAAgF;AAEhF,uFAAoF;AACpF,mEAAkE;AAClE,+CAAuD;AACvD,+CAA4C;AAE5C,qEAA6D;AAC7D,uDAAoF;AACpF,+DAA+E;AAC/E,qDAAsF;AAEtF,4FAAyF;AAEzF,mDAAgD;AAGhD,mEAAmE;AAEnE;;;;;;;;;;;;;GAaG;AACH,MAAa,aAAc,SAAQ,+BAAc;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,IAAI,CAAC;IACd,CAAC;IACD;;;;OAIG;IACH,YAAsB,MAAe,EAAE,MAAe;QACpD,KAAK,EAAE,CAAC;QAlCV,wCAAwC;QACxB,uBAAkB,GAAG,aAAa,CAAC;QAkCjD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAA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AAS,CAAC;IACnB,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,qDAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF;AAnXD,sCAmXC","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,sDAA6C;AAE7C,0CAAgF;AAEhF,uFAAoF;AACpF,mEAAyD;AACzD,mEAAkE;AAClE,+CAAuD;AACvD,+CAA4C;AAE5C,qEAA6D;AAC7D,yDAAsD;AACtD,uDAAoF;AACpF,+DAAwG;AACxG,qDAAsF;AAEtF,4FAAyF;AAEzF,mDAAgD;AAGhD,mEAAmE;AAEnE;;;;;;;;;;;;;GAaG;AACH,MAAa,aAAc,SAAQ,+BAAc;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,IAAI,CAAC;IACd,CAAC;IACD;;;;OAIG;IACH,YAAsB,MAAe,EAAE,MAAe;QACpD,KAAK,EAAE,CAAC;QAlCV,wCAAwC;QACxB,uBAAkB,GAAG,aAAa,CAAC;QAkCjD,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;QACtB,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC;IACxB,CAAC;IACD,iEAAiE;IAC1D,OAAO,C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AAC,SAAS,EAAE,UAAU,CAAC,CAC/F,CAAC;SACH;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;;;;OAOG;IACa,uBAAuB,CAAC,GAAqB,EAAE,OAAiB;QAC9E,OAAO,qDAAyB,CAAC,kCAAkC,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAC1F,CAAC;CACF;AAtdD,sCAsdC","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"]}
@@ -7,6 +7,7 @@ import { GeometryHandler, IStrokeHandler } from "../geometry3d/GeometryHandler";
7
7
  import { GrowableFloat64Array } from "../geometry3d/GrowableFloat64Array";
8
8
  import { GrowableXYArray } from "../geometry3d/GrowableXYArray";
9
9
  import { GrowableXYZArray } from "../geometry3d/GrowableXYZArray";
10
+ import { MultiLineStringDataVariant } from "../geometry3d/IndexedXYZCollection";
10
11
  import { Plane3dByOriginAndUnitNormal } from "../geometry3d/Plane3dByOriginAndUnitNormal";
11
12
  import { Plane3dByOriginAndVectors } from "../geometry3d/Plane3dByOriginAndVectors";
12
13
  import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
@@ -14,7 +15,6 @@ import { Range1d, Range3d } from "../geometry3d/Range";
14
15
  import { Ray3d } from "../geometry3d/Ray3d";
15
16
  import { Transform } from "../geometry3d/Transform";
16
17
  import { XAndY, XYZProps } from "../geometry3d/XYZProps";
17
- import { MultiLineStringDataVariant } from "../topology/Triangulation";
18
18
  import { VariantCurveExtendParameter } from "./CurveExtendMode";
19
19
  import { CurveLocationDetail } from "./CurveLocationDetail";
20
20
  import { AnnounceNumberNumberCurvePrimitive, CurvePrimitive } from "./CurvePrimitive";
@@ -85,15 +85,12 @@ export declare class LineString3d extends CurvePrimitive implements BeJSONFuncti
85
85
  * Point3d, Point2d, `[1,2,3]', array of any of those, or GrowableXYZArray
86
86
  */
87
87
  static create(...points: any[]): LineString3d;
88
- /**
89
- * Create a linestring, capturing the given GrowableXYZArray as the points.
90
- * Point3d, Point2d, `[1,2,3]', array of any of those, or GrowableXYZArray
91
- */
88
+ /** Create a linestring, capturing the given GrowableXYZArray as the points. */
92
89
  static createCapture(points: GrowableXYZArray): LineString3d;
93
90
  /** Create a linestring from `XAndY` points, with a specified z applied to all. */
94
91
  static createXY(points: XAndY[], z: number, enforceClosure?: boolean): LineString3d;
95
92
  /**
96
- * Add points to the linestring.
93
+ * Add copies of points to the linestring.
97
94
  * Valid inputs are:
98
95
  * * a Point2d
99
96
  * * a point3d
@@ -235,7 +232,15 @@ export declare class LineString3d extends CurvePrimitive implements BeJSONFuncti
235
232
  /** Return point and derivative at fraction, with 000 second derivative. */
236
233
  fractionToPointAnd2Derivatives(fraction: number, result?: Plane3dByOriginAndVectors): Plane3dByOriginAndVectors;
237
234
  /**
238
- * Convert a segment index and local fraction to a global fraction.
235
+ * Convert a segment index and local fraction to a global linestring fraction.
236
+ * @param index index of segment being evaluated
237
+ * @param localFraction local fraction in [0,1] within the segment
238
+ * @param numSegment number N of segments in the linestring
239
+ * @return global fraction f in [0,1] such that the segment is parameterized by index/N <= f <= (index+1)/N.
240
+ */
241
+ static mapLocalToGlobalFraction(index: number, localFraction: number, numSegment: number): number;
242
+ /**
243
+ * Convert a segment index and local fraction to a global linestring fraction.
239
244
  * @param index index of segment being evaluated
240
245
  * @param localFraction local fraction in [0,1] within the segment
241
246
  * @return global fraction f in [0,1] such that the segment is parameterized by index/N <= f <= (index+1)/N.
@@ -245,6 +250,18 @@ export declare class LineString3d extends CurvePrimitive implements BeJSONFuncti
245
250
  * Convert a global fraction to a segment index and local fraction.
246
251
  * @param globalFraction a fraction f in [0,1] in the linestring parameterization, where the i_th segment
247
252
  * (0 <= i < N) is parameterized by i/N <= f <= (i+1)/N.
253
+ * @returns segment index and local fraction
254
+ */
255
+ static mapGlobalToLocalFraction(globalFraction: number, numSegment: number): {
256
+ index: number;
257
+ fraction: number;
258
+ };
259
+ /**
260
+ * Convert a global linestring fraction to a segment index and local fraction.
261
+ * @param globalFraction a fraction f in [0,1] in the linestring parameterization, where the i_th segment
262
+ * (0 <= i < N) is parameterized by i/N <= f <= (i+1)/N.
263
+ * @param numSegment number N of segments in the linestring
264
+ * @returns segment index and local fraction
248
265
  */
249
266
  globalFractionToSegmentIndexAndLocalFraction(globalFraction: number): {
250
267
  index: number;
@@ -264,6 +281,8 @@ export declare class LineString3d extends CurvePrimitive implements BeJSONFuncti
264
281
  surfaceNormalAt(i: number, result?: Vector3d): Vector3d | undefined;
265
282
  /** Return the number of points in this linestring. */
266
283
  numPoints(): number;
284
+ /** Return the number of edges in this linestring. */
285
+ numEdges(): number;
267
286
  /** Evaluate the end point of the linestring. */
268
287
  endPoint(): Point3d;
269
288
  /** Reverse the points within the linestring. */
@@ -401,7 +420,7 @@ export declare class LineString3d extends CurvePrimitive implements BeJSONFuncti
401
420
  */
402
421
  clonePartialCurve(fractionA: number, fractionB: number): LineString3d;
403
422
  /** Return (if possible) a specific segment of the linestring */
404
- getIndexedSegment(index: number): LineSegment3d | undefined;
423
+ getIndexedSegment(index: number, result?: LineSegment3d): LineSegment3d | undefined;
405
424
  /** Returns true if first and last points are within metric tolerance. */
406
425
  get isPhysicallyClosed(): boolean;
407
426
  /**
@@ -444,6 +463,20 @@ export declare class LineString3d extends CurvePrimitive implements BeJSONFuncti
444
463
  * the end of the ray.
445
464
  */
446
465
  projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined;
466
+ /**
467
+ * Convert the segment detail to a linestring detail:
468
+ * * `detail.childDetail` is set to a clone of the input segment detail (optionally populating pre-allocated `child` object).
469
+ * * `childDetail.a` is set to `segmentIndex`.
470
+ * * `detail.fraction` is set to the global linestring parameter.
471
+ * * `detail.curve` is set to the parent linestring.
472
+ * @param detail segment location detail, converted in place
473
+ * @param segmentIndex index of segment in the linestring
474
+ * @param numSegment linestring segment count
475
+ * @param parent optional linestring primitive
476
+ * @param child optional pre-allocated detail to use to clone the child data
477
+ * @returns reference to input detail, with both linestring and segment data
478
+ */
479
+ static convertLocalToGlobalDetail(detail: CurveLocationDetail, segmentIndex: number, numSegment: number, parent?: LineString3d, child?: CurveLocationDetail): CurveLocationDetail;
447
480
  }
448
481
  /**
449
482
  * An AnnotatedLineString3d is a linestring with additional surface-related data attached to each point
@@ -1 +1 @@
1
- {"version":3,"file":"LineString3d.d.ts","sourceRoot":"","sources":["../../../src/curve/LineString3d.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAa,eAAe,EAAY,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE3F,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAElE,OAAO,EAAE,4BAA4B,EAAE,MAAM,4CAA4C,CAAC;AAC1F,OAAO,EAAE,yBAAyB,EAAE,MAAM,yCAAyC,CAAC;AACpF,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACpD,OAAO,EAAE,KAAK,EAAE,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C,EAAE,gBAAgB,CAAC;IACnC,8DAA8D;IACvD,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAClC,8DAA8D;IACvD,OAAO,CAAC,EAAE,gBAAgB,CAAC;CACnC"}
@@ -20,7 +20,6 @@ const PlaneAltitudeRangeContext_1 = require("./internalContexts/PlaneAltitudeRan
20
20
  const LineSegment3d_1 = require("./LineSegment3d");
21
21
  const OffsetOptions_1 = require("./OffsetOptions");
22
22
  const StrokeCountMap_1 = require("./Query/StrokeCountMap");
23
- /* eslint-disable @typescript-eslint/naming-convention, no-empty */
24
23
  /**
25
24
  * Starting with baseIndex and moving index by stepDirection:
26
25
  * If the vector from baseIndex to baseIndex +1 crossed with vectorA can be normalized, accumulate it (scaled) to normal.
@@ -139,10 +138,7 @@ class LineString3d extends CurvePrimitive_1.CurvePrimitive {
139
138
  result.addPoints(points);
140
139
  return result;
141
140
  }
142
- /**
143
- * Create a linestring, capturing the given GrowableXYZArray as the points.
144
- * Point3d, Point2d, `[1,2,3]', array of any of those, or GrowableXYZArray
145
- */
141
+ /** Create a linestring, capturing the given GrowableXYZArray as the points. */
146
142
  static createCapture(points) {
147
143
  return new LineString3d(points);
148
144
  }
@@ -166,7 +162,7 @@ class LineString3d extends CurvePrimitive_1.CurvePrimitive {
166
162
  return result;
167
163
  }
168
164
  /**
169
- * Add points to the linestring.
165
+ * Add copies of points to the linestring.
170
166
  * Valid inputs are:
171
167
  * * a Point2d
172
168
  * * a point3d
@@ -552,24 +548,33 @@ class LineString3d extends CurvePrimitive_1.CurvePrimitive {
552
548
  return result;
553
549
  }
554
550
  /**
555
- * Convert a segment index and local fraction to a global fraction.
551
+ * Convert a segment index and local fraction to a global linestring fraction.
556
552
  * @param index index of segment being evaluated
557
553
  * @param localFraction local fraction in [0,1] within the segment
554
+ * @param numSegment number N of segments in the linestring
558
555
  * @return global fraction f in [0,1] such that the segment is parameterized by index/N <= f <= (index+1)/N.
559
556
  */
560
- segmentIndexAndLocalFractionToGlobalFraction(index, localFraction) {
561
- const numSegment = this._points.length - 1;
557
+ static mapLocalToGlobalFraction(index, localFraction, numSegment) {
562
558
  if (numSegment < 1)
563
559
  return 0.0;
564
560
  return (index + localFraction) / numSegment;
565
561
  }
562
+ /**
563
+ * Convert a segment index and local fraction to a global linestring fraction.
564
+ * @param index index of segment being evaluated
565
+ * @param localFraction local fraction in [0,1] within the segment
566
+ * @return global fraction f in [0,1] such that the segment is parameterized by index/N <= f <= (index+1)/N.
567
+ */
568
+ segmentIndexAndLocalFractionToGlobalFraction(index, localFraction) {
569
+ return LineString3d.mapLocalToGlobalFraction(index, localFraction, this._points.length - 1);
570
+ }
566
571
  /**
567
572
  * Convert a global fraction to a segment index and local fraction.
568
573
  * @param globalFraction a fraction f in [0,1] in the linestring parameterization, where the i_th segment
569
574
  * (0 <= i < N) is parameterized by i/N <= f <= (i+1)/N.
575
+ * @returns segment index and local fraction
570
576
  */
571
- globalFractionToSegmentIndexAndLocalFraction(globalFraction) {
572
- const numSegment = this._points.length - 1;
577
+ static mapGlobalToLocalFraction(globalFraction, numSegment) {
573
578
  if (numSegment < 1)
574
579
  return { index: 0, fraction: 0.0 };
575
580
  const scaledGlobalFraction = globalFraction * numSegment;
@@ -580,8 +585,17 @@ class LineString3d extends CurvePrimitive_1.CurvePrimitive {
580
585
  segmentIndex = numSegment - 1;
581
586
  else // globalFraction in [0,1]
582
587
  segmentIndex = Math.floor(scaledGlobalFraction);
583
- const localFraction = scaledGlobalFraction - segmentIndex;
584
- return { index: segmentIndex, fraction: localFraction };
588
+ return { index: segmentIndex, fraction: scaledGlobalFraction - segmentIndex };
589
+ }
590
+ /**
591
+ * Convert a global linestring fraction to a segment index and local fraction.
592
+ * @param globalFraction a fraction f in [0,1] in the linestring parameterization, where the i_th segment
593
+ * (0 <= i < N) is parameterized by i/N <= f <= (i+1)/N.
594
+ * @param numSegment number N of segments in the linestring
595
+ * @returns segment index and local fraction
596
+ */
597
+ globalFractionToSegmentIndexAndLocalFraction(globalFraction) {
598
+ return LineString3d.mapGlobalToLocalFraction(globalFraction, this._points.length - 1);
585
599
  }
586
600
  /** Return a frenet frame, using nearby points to estimate a plane. */
587
601
  fractionToFrenetFrame(fraction, result) {
@@ -662,6 +676,10 @@ class LineString3d extends CurvePrimitive_1.CurvePrimitive {
662
676
  numPoints() {
663
677
  return this._points.length;
664
678
  }
679
+ /** Return the number of edges in this linestring. */
680
+ numEdges() {
681
+ return this._points.length > 0 ? this._points.length - 1 : 0;
682
+ }
665
683
  /** Evaluate the end point of the linestring. */
666
684
  endPoint() {
667
685
  if (this._points.length === 0)
@@ -1247,9 +1265,9 @@ class LineString3d extends CurvePrimitive_1.CurvePrimitive {
1247
1265
  return result;
1248
1266
  }
1249
1267
  /** Return (if possible) a specific segment of the linestring */
1250
- getIndexedSegment(index) {
1268
+ getIndexedSegment(index, result) {
1251
1269
  if (index >= 0 && index + 1 < this._points.length)
1252
- return LineSegment3d_1.LineSegment3d.create(this._points.getPoint3dAtCheckedPointIndex(index), this._points.getPoint3dAtCheckedPointIndex(index + 1));
1270
+ return LineSegment3d_1.LineSegment3d.create(this._points.getPoint3dAtCheckedPointIndex(index), this._points.getPoint3dAtCheckedPointIndex(index + 1), result);
1253
1271
  return undefined;
1254
1272
  }
1255
1273
  /** Returns true if first and last points are within metric tolerance. */
@@ -1359,6 +1377,26 @@ class LineString3d extends CurvePrimitive_1.CurvePrimitive {
1359
1377
  projectedParameterRange(ray, lowHigh) {
1360
1378
  return PlaneAltitudeRangeContext_1.PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);
1361
1379
  }
1380
+ /**
1381
+ * Convert the segment detail to a linestring detail:
1382
+ * * `detail.childDetail` is set to a clone of the input segment detail (optionally populating pre-allocated `child` object).
1383
+ * * `childDetail.a` is set to `segmentIndex`.
1384
+ * * `detail.fraction` is set to the global linestring parameter.
1385
+ * * `detail.curve` is set to the parent linestring.
1386
+ * @param detail segment location detail, converted in place
1387
+ * @param segmentIndex index of segment in the linestring
1388
+ * @param numSegment linestring segment count
1389
+ * @param parent optional linestring primitive
1390
+ * @param child optional pre-allocated detail to use to clone the child data
1391
+ * @returns reference to input detail, with both linestring and segment data
1392
+ */
1393
+ static convertLocalToGlobalDetail(detail, segmentIndex, numSegment, parent, child) {
1394
+ detail.childDetail = detail.clone(child);
1395
+ detail.childDetail.a = segmentIndex;
1396
+ detail.fraction = this.mapLocalToGlobalFraction(segmentIndex, detail.fraction, numSegment);
1397
+ detail.curve = parent;
1398
+ return detail;
1399
+ }
1362
1400
  }
1363
1401
  LineString3d._workPointA = Point3dVector3d_1.Point3d.create();
1364
1402
  LineString3d._workPointB = Point3dVector3d_1.Point3d.create();