@itwin/core-geometry 4.1.0-dev.6 → 4.1.0-dev.63

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 (310) hide show
  1. package/CHANGELOG.md +62 -1
  2. package/lib/cjs/clipping/ClipPrimitive.d.ts.map +1 -1
  3. package/lib/cjs/clipping/ClipPrimitive.js +2 -0
  4. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  5. package/lib/cjs/core-geometry.d.ts +1 -0
  6. package/lib/cjs/core-geometry.d.ts.map +1 -1
  7. package/lib/cjs/core-geometry.js +4 -1
  8. package/lib/cjs/core-geometry.js.map +1 -1
  9. package/lib/cjs/curve/Arc3d.d.ts +1 -0
  10. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  11. package/lib/cjs/curve/Arc3d.js +1 -0
  12. package/lib/cjs/curve/Arc3d.js.map +1 -1
  13. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +61 -41
  14. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  15. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +69 -46
  16. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  17. package/lib/cjs/curve/CurveCollection.d.ts +36 -26
  18. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  19. package/lib/cjs/curve/CurveCollection.js +46 -39
  20. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  21. package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
  22. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  23. package/lib/cjs/curve/CurveFactory.d.ts +67 -3
  24. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  25. package/lib/cjs/curve/CurveFactory.js +75 -7
  26. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  27. package/lib/cjs/curve/CurveLocationDetail.d.ts +6 -6
  28. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  29. package/lib/cjs/curve/CurveLocationDetail.js +9 -7
  30. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  31. package/lib/cjs/curve/CurvePrimitive.d.ts +4 -3
  32. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  33. package/lib/cjs/curve/CurvePrimitive.js +4 -3
  34. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  35. package/lib/cjs/curve/LineSegment3d.d.ts +6 -4
  36. package/lib/cjs/curve/LineSegment3d.d.ts.map +1 -1
  37. package/lib/cjs/curve/LineSegment3d.js +4 -4
  38. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  39. package/lib/cjs/curve/LineString3d.d.ts +1 -1
  40. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  41. package/lib/cjs/curve/LineString3d.js +1 -1
  42. package/lib/cjs/curve/LineString3d.js.map +1 -1
  43. package/lib/cjs/curve/Loop.d.ts +7 -5
  44. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  45. package/lib/cjs/curve/Loop.js +18 -6
  46. package/lib/cjs/curve/Loop.js.map +1 -1
  47. package/lib/cjs/curve/ParityRegion.d.ts +7 -7
  48. package/lib/cjs/curve/ParityRegion.d.ts.map +1 -1
  49. package/lib/cjs/curve/ParityRegion.js +19 -11
  50. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  51. package/lib/cjs/curve/Path.d.ts +6 -6
  52. package/lib/cjs/curve/Path.d.ts.map +1 -1
  53. package/lib/cjs/curve/Path.js +15 -9
  54. package/lib/cjs/curve/Path.js.map +1 -1
  55. package/lib/cjs/curve/ProxyCurve.d.ts +4 -6
  56. package/lib/cjs/curve/ProxyCurve.d.ts.map +1 -1
  57. package/lib/cjs/curve/ProxyCurve.js +7 -7
  58. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  59. package/lib/cjs/curve/RegionOps.d.ts +69 -47
  60. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  61. package/lib/cjs/curve/RegionOps.js +70 -47
  62. package/lib/cjs/curve/RegionOps.js.map +1 -1
  63. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  64. package/lib/cjs/curve/StrokeOptions.js +6 -2
  65. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  66. package/lib/cjs/curve/UnionRegion.d.ts +6 -5
  67. package/lib/cjs/curve/UnionRegion.d.ts.map +1 -1
  68. package/lib/cjs/curve/UnionRegion.js +17 -8
  69. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  70. package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts +2 -1
  71. package/lib/cjs/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
  72. package/lib/cjs/curve/internalContexts/GapSearchContext.js +6 -2
  73. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  74. package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +4 -0
  75. package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
  76. package/lib/cjs/curve/internalContexts/MultiChainCollector.js +5 -2
  77. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  78. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +14 -8
  79. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
  80. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
  81. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  82. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts +56 -34
  83. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  84. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +153 -87
  85. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  86. package/lib/cjs/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
  87. package/lib/cjs/curve/internalContexts/SumLengthsContext.js +4 -1
  88. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  89. package/lib/cjs/geometry3d/Angle.d.ts +9 -0
  90. package/lib/cjs/geometry3d/Angle.d.ts.map +1 -1
  91. package/lib/cjs/geometry3d/Angle.js +13 -0
  92. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  93. package/lib/cjs/geometry3d/BilinearPatch.d.ts +43 -48
  94. package/lib/cjs/geometry3d/BilinearPatch.d.ts.map +1 -1
  95. package/lib/cjs/geometry3d/BilinearPatch.js +51 -55
  96. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  97. package/lib/cjs/geometry3d/Ellipsoid.d.ts +1 -1
  98. package/lib/cjs/geometry3d/Ellipsoid.js +1 -1
  99. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  100. package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
  101. package/lib/cjs/geometry3d/FrameBuilder.js +13 -11
  102. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  103. package/lib/cjs/geometry3d/GeometryHandler.d.ts +5 -5
  104. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  105. package/lib/cjs/geometry3d/Matrix3d.d.ts +18 -0
  106. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  107. package/lib/cjs/geometry3d/Matrix3d.js +27 -0
  108. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  109. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +36 -32
  110. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  111. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +35 -32
  112. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  113. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +8 -0
  114. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  115. package/lib/cjs/geometry3d/Point3dVector3d.js +13 -0
  116. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  117. package/lib/cjs/geometry3d/PolylineOps.d.ts +16 -1
  118. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  119. package/lib/cjs/geometry3d/PolylineOps.js +55 -0
  120. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  121. package/lib/cjs/geometry3d/Range.d.ts +134 -94
  122. package/lib/cjs/geometry3d/Range.d.ts.map +1 -1
  123. package/lib/cjs/geometry3d/Range.js +297 -145
  124. package/lib/cjs/geometry3d/Range.js.map +1 -1
  125. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  126. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  127. package/lib/cjs/geometry3d/Transform.d.ts +7 -0
  128. package/lib/cjs/geometry3d/Transform.d.ts.map +1 -1
  129. package/lib/cjs/geometry3d/Transform.js +12 -0
  130. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  131. package/lib/cjs/polyface/PolyfaceQuery.d.ts +64 -6
  132. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  133. package/lib/cjs/polyface/PolyfaceQuery.js +104 -19
  134. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  135. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts +11 -0
  136. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  137. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +79 -1
  138. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  139. package/lib/cjs/serialization/GeometrySamples.d.ts +11 -0
  140. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  141. package/lib/cjs/serialization/GeometrySamples.js +30 -0
  142. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  143. package/lib/cjs/solid/LinearSweep.d.ts +2 -1
  144. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  145. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  146. package/lib/cjs/solid/RotationalSweep.d.ts +2 -1
  147. package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
  148. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  149. package/lib/cjs/solid/RuledSweep.d.ts +2 -1
  150. package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
  151. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  152. package/lib/cjs/solid/SweepContour.d.ts +2 -2
  153. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  154. package/lib/cjs/solid/SweepContour.js +9 -0
  155. package/lib/cjs/solid/SweepContour.js.map +1 -1
  156. package/lib/esm/clipping/ClipPrimitive.d.ts.map +1 -1
  157. package/lib/esm/clipping/ClipPrimitive.js +2 -0
  158. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  159. package/lib/esm/core-geometry.d.ts +1 -0
  160. package/lib/esm/core-geometry.d.ts.map +1 -1
  161. package/lib/esm/core-geometry.js +2 -0
  162. package/lib/esm/core-geometry.js.map +1 -1
  163. package/lib/esm/curve/Arc3d.d.ts +1 -0
  164. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  165. package/lib/esm/curve/Arc3d.js +1 -0
  166. package/lib/esm/curve/Arc3d.js.map +1 -1
  167. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +61 -41
  168. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  169. package/lib/esm/curve/CurveChainWithDistanceIndex.js +69 -46
  170. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  171. package/lib/esm/curve/CurveCollection.d.ts +36 -26
  172. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  173. package/lib/esm/curve/CurveCollection.js +46 -39
  174. package/lib/esm/curve/CurveCollection.js.map +1 -1
  175. package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
  176. package/lib/esm/curve/CurveCurve.js.map +1 -1
  177. package/lib/esm/curve/CurveFactory.d.ts +67 -3
  178. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  179. package/lib/esm/curve/CurveFactory.js +74 -6
  180. package/lib/esm/curve/CurveFactory.js.map +1 -1
  181. package/lib/esm/curve/CurveLocationDetail.d.ts +6 -6
  182. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  183. package/lib/esm/curve/CurveLocationDetail.js +9 -7
  184. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  185. package/lib/esm/curve/CurvePrimitive.d.ts +4 -3
  186. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  187. package/lib/esm/curve/CurvePrimitive.js +4 -3
  188. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  189. package/lib/esm/curve/LineSegment3d.d.ts +6 -4
  190. package/lib/esm/curve/LineSegment3d.d.ts.map +1 -1
  191. package/lib/esm/curve/LineSegment3d.js +4 -4
  192. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  193. package/lib/esm/curve/LineString3d.d.ts +1 -1
  194. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  195. package/lib/esm/curve/LineString3d.js +1 -1
  196. package/lib/esm/curve/LineString3d.js.map +1 -1
  197. package/lib/esm/curve/Loop.d.ts +7 -5
  198. package/lib/esm/curve/Loop.d.ts.map +1 -1
  199. package/lib/esm/curve/Loop.js +18 -6
  200. package/lib/esm/curve/Loop.js.map +1 -1
  201. package/lib/esm/curve/ParityRegion.d.ts +7 -7
  202. package/lib/esm/curve/ParityRegion.d.ts.map +1 -1
  203. package/lib/esm/curve/ParityRegion.js +19 -11
  204. package/lib/esm/curve/ParityRegion.js.map +1 -1
  205. package/lib/esm/curve/Path.d.ts +6 -6
  206. package/lib/esm/curve/Path.d.ts.map +1 -1
  207. package/lib/esm/curve/Path.js +15 -9
  208. package/lib/esm/curve/Path.js.map +1 -1
  209. package/lib/esm/curve/ProxyCurve.d.ts +4 -6
  210. package/lib/esm/curve/ProxyCurve.d.ts.map +1 -1
  211. package/lib/esm/curve/ProxyCurve.js +7 -7
  212. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  213. package/lib/esm/curve/RegionOps.d.ts +69 -47
  214. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  215. package/lib/esm/curve/RegionOps.js +70 -47
  216. package/lib/esm/curve/RegionOps.js.map +1 -1
  217. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  218. package/lib/esm/curve/StrokeOptions.js +6 -2
  219. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  220. package/lib/esm/curve/UnionRegion.d.ts +6 -5
  221. package/lib/esm/curve/UnionRegion.d.ts.map +1 -1
  222. package/lib/esm/curve/UnionRegion.js +17 -8
  223. package/lib/esm/curve/UnionRegion.js.map +1 -1
  224. package/lib/esm/curve/internalContexts/GapSearchContext.d.ts +2 -1
  225. package/lib/esm/curve/internalContexts/GapSearchContext.d.ts.map +1 -1
  226. package/lib/esm/curve/internalContexts/GapSearchContext.js +6 -2
  227. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  228. package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +4 -0
  229. package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts.map +1 -1
  230. package/lib/esm/curve/internalContexts/MultiChainCollector.js +5 -2
  231. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  232. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts +14 -8
  233. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.d.ts.map +1 -1
  234. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js +14 -8
  235. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  236. package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts +56 -34
  237. package/lib/esm/curve/internalContexts/PolygonOffsetContext.d.ts.map +1 -1
  238. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +153 -87
  239. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  240. package/lib/esm/curve/internalContexts/SumLengthsContext.d.ts.map +1 -1
  241. package/lib/esm/curve/internalContexts/SumLengthsContext.js +4 -1
  242. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  243. package/lib/esm/geometry3d/Angle.d.ts +9 -0
  244. package/lib/esm/geometry3d/Angle.d.ts.map +1 -1
  245. package/lib/esm/geometry3d/Angle.js +13 -0
  246. package/lib/esm/geometry3d/Angle.js.map +1 -1
  247. package/lib/esm/geometry3d/BilinearPatch.d.ts +43 -48
  248. package/lib/esm/geometry3d/BilinearPatch.d.ts.map +1 -1
  249. package/lib/esm/geometry3d/BilinearPatch.js +51 -55
  250. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  251. package/lib/esm/geometry3d/Ellipsoid.d.ts +1 -1
  252. package/lib/esm/geometry3d/Ellipsoid.js +1 -1
  253. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  254. package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
  255. package/lib/esm/geometry3d/FrameBuilder.js +13 -11
  256. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  257. package/lib/esm/geometry3d/GeometryHandler.d.ts +5 -5
  258. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  259. package/lib/esm/geometry3d/Matrix3d.d.ts +18 -0
  260. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  261. package/lib/esm/geometry3d/Matrix3d.js +27 -0
  262. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  263. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +36 -32
  264. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  265. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +35 -32
  266. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  267. package/lib/esm/geometry3d/Point3dVector3d.d.ts +8 -0
  268. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  269. package/lib/esm/geometry3d/Point3dVector3d.js +13 -0
  270. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  271. package/lib/esm/geometry3d/PolylineOps.d.ts +16 -1
  272. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  273. package/lib/esm/geometry3d/PolylineOps.js +56 -1
  274. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  275. package/lib/esm/geometry3d/Range.d.ts +134 -94
  276. package/lib/esm/geometry3d/Range.d.ts.map +1 -1
  277. package/lib/esm/geometry3d/Range.js +297 -145
  278. package/lib/esm/geometry3d/Range.js.map +1 -1
  279. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  280. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  281. package/lib/esm/geometry3d/Transform.d.ts +7 -0
  282. package/lib/esm/geometry3d/Transform.d.ts.map +1 -1
  283. package/lib/esm/geometry3d/Transform.js +12 -0
  284. package/lib/esm/geometry3d/Transform.js.map +1 -1
  285. package/lib/esm/polyface/PolyfaceQuery.d.ts +64 -6
  286. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  287. package/lib/esm/polyface/PolyfaceQuery.js +103 -19
  288. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  289. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts +11 -0
  290. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.d.ts.map +1 -1
  291. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +78 -1
  292. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  293. package/lib/esm/serialization/GeometrySamples.d.ts +11 -0
  294. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  295. package/lib/esm/serialization/GeometrySamples.js +30 -0
  296. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  297. package/lib/esm/solid/LinearSweep.d.ts +2 -1
  298. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  299. package/lib/esm/solid/LinearSweep.js.map +1 -1
  300. package/lib/esm/solid/RotationalSweep.d.ts +2 -1
  301. package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
  302. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  303. package/lib/esm/solid/RuledSweep.d.ts +2 -1
  304. package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
  305. package/lib/esm/solid/RuledSweep.js.map +1 -1
  306. package/lib/esm/solid/SweepContour.d.ts +2 -2
  307. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  308. package/lib/esm/solid/SweepContour.js +9 -0
  309. package/lib/esm/solid/SweepContour.js.map +1 -1
  310. package/package.json +5 -5
@@ -22,10 +22,12 @@ import { ProxyCurve } from "./ProxyCurve";
22
22
  * A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:
23
23
  * - `CurveChain` is a (non-instantiable) intermediate class for a sequence of `CurvePrimitive` joining head-to-tail.
24
24
  * The two instantiable forms of `CurveChain` are
25
- * - `Path` - A chain not required to close, and not enclosing a planar area
26
- * - `Loop` - A chain required to close from last to first so that a planar area is enclosed.
27
- * - `ParityRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by parity rules
28
- * - `UnionRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by union rules
25
+ * - `Path` - A chain not required to close and not enclosing a planar area (so curves do not have to be on the
26
+ * same plane).
27
+ * - `Loop` - A chain required to close from last to first so that a planar area is enclosed (so curves have to
28
+ * be on the same plane).
29
+ * - `ParityRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by parity rules.
30
+ * - `UnionRegion` -- a collection of coplanar `Loop`s, with "in/out" classification by union rules.
29
31
  * - `BagOfCurves` -- a collection of `AnyCurve` with no implied structure.
30
32
  *
31
33
  * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.
@@ -65,7 +67,7 @@ export class CurveCollection extends GeometryQuery {
65
67
  * Return the max gap between adjacent primitives in Path and Loop collections.
66
68
  * * In a Path, gaps are computed between consecutive primitives.
67
69
  * * In a Loop, gaps are computed between consecutive primitives and between last and first.
68
- * * gaps are NOT computed between consecutive CurvePrimitives in "unstructured" collections. The type is
70
+ * * Gaps are NOT computed between consecutive CurvePrimitives in "unstructured" collections. The type is
69
71
  * "unstructured" so gaps should not be semantically meaningful.
70
72
  */
71
73
  maxGap() {
@@ -87,11 +89,15 @@ export class CurveCollection extends GeometryQuery {
87
89
  cloneTransformed(transform) {
88
90
  return CloneCurvesContext.clone(this, transform);
89
91
  }
90
- /** Create a deep copy with all linestrings expanded to multiple LineSegment3d. */
92
+ /** Create a deep copy with all linestrings broken down into multiple LineSegment3d. */
91
93
  cloneWithExpandedLineStrings() {
92
94
  return CloneWithExpandedLineStrings.clone(this);
93
95
  }
94
- /** Recurse through children to collect CurvePrimitive's in flat array. */
96
+ /**
97
+ * Push all CurvePrimitives contained in the instance onto the `results` array.
98
+ * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives
99
+ * of the Loop are pushed onto `results`.
100
+ */
95
101
  collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings = false) {
96
102
  if (this.children) {
97
103
  for (const child of this.children) {
@@ -103,10 +109,12 @@ export class CurveCollection extends GeometryQuery {
103
109
  }
104
110
  }
105
111
  /**
106
- * Return an array containing only the curve primitives.
112
+ * Return an array containing all CurvePrimitives in the instance.
113
+ * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives of
114
+ * the Loop are pushed onto the returned array.
107
115
  * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without
108
- * clearing the array.)
109
- * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,
116
+ * clearing the array).
117
+ * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,
110
118
  * it recurses to its (otherwise hidden) children.
111
119
  */
112
120
  collectCurvePrimitives(collectorArray, smallestPossiblePrimitives = false, explodeLineStrings = false) {
@@ -121,7 +129,7 @@ export class CurveCollection extends GeometryQuery {
121
129
  * * `UnionRegion`
122
130
  */
123
131
  get isAnyRegionType() {
124
- return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 5 || this.dgnBoundaryType() === 4;
132
+ return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 4 || this.dgnBoundaryType() === 5;
125
133
  }
126
134
  /** Return true for a `Path`, i.e. a chain of curves joined head-to-tail */
127
135
  get isOpenPath() {
@@ -129,12 +137,16 @@ export class CurveCollection extends GeometryQuery {
129
137
  }
130
138
  /**
131
139
  * Return true for a single-loop planar region type, i.e. `Loop`.
132
- * * This is _not- a test for physical closure of a `Path`
140
+ * * This is NOT a test for physical closure of a `Path`.
133
141
  */
134
142
  get isClosedPath() {
135
143
  return this.dgnBoundaryType() === 2;
136
144
  }
137
- /** Extend (increase) `rangeToExtend` as needed to include these curves (optionally transformed) */
145
+ /**
146
+ * Extend (increase) the given range as needed to encompass all curves in the curve collection.
147
+ * @param rangeToExtend the given range.
148
+ * @param transform if supplied, the range is extended with transformed curves.
149
+ */
138
150
  extendRange(rangeToExtend, transform) {
139
151
  const children = this.children;
140
152
  if (children) {
@@ -144,8 +156,8 @@ export class CurveCollection extends GeometryQuery {
144
156
  }
145
157
  }
146
158
  /**
147
- * * Find any curve primitive in the source.
148
- * * Evaluate it at a fraction (which by default is an interior fraction)
159
+ * Find any CurvePrimitive in the source and evaluate it at the given fraction.
160
+ * * The first CurvePrimitive found is evaluated. Any other CurvePrimitives are ignored.
149
161
  * @param source containing `CurvePrimitive` or `CurveCollection`
150
162
  * @param fraction fraction to use in `curve.fractionToPoint(fraction)`
151
163
  */
@@ -177,19 +189,20 @@ export class CurveCollection extends GeometryQuery {
177
189
  }
178
190
  /**
179
191
  * Shared base class for use by both open and closed paths.
180
- * - A `CurveChain` contains only curvePrimitives. No other paths, loops, or regions allowed.
181
- * - A single entry in the chain can in fact contain multiple curve primitives if the entry itself is (for instance)
182
- * `CurveChainWithDistanceIndex`
183
- * which presents itself (through method interface) as a CurvePrimitive with well defined mappings from fraction
184
- * to xyz, but in fact does all the
185
- * calculations over multiple primitives.
186
- * - The specific derived classes are `Path` and `Loop`
187
- * - `CurveChain` is an intermediate class. It is not instantiable on its own.
192
+ * * A `CurveChain` contains only CurvePrimitives. No other paths, loops, or regions allowed.
193
+ * * The specific derived classes are `Path` and `Loop`
194
+ * * `CurveChain` is an intermediate class. It is not instantiable on its own.
195
+ * * The related class `CurveChainWithDistanceIndex` is a `CurvePrimitive` whose API presents well-defined mappings
196
+ * from fraction to xyz over the entire chain, but in fact does all the calculations over multiple primitives.
188
197
  * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.
189
198
  * @public
190
199
  */
191
200
  export class CurveChain extends CurveCollection {
192
- constructor() { super(); this._curves = []; }
201
+ /** Constructor */
202
+ constructor() {
203
+ super();
204
+ this._curves = [];
205
+ }
193
206
  /** Return the array of `CurvePrimitive` */
194
207
  get children() {
195
208
  if (this._curves === undefined)
@@ -197,7 +210,7 @@ export class CurveChain extends CurveCollection {
197
210
  return this._curves;
198
211
  }
199
212
  /**
200
- * Return the `[index]` curve primitive, optionally using `modulo` to map`index` to the cyclic indexing.
213
+ * Return the curve primitive at the given `index`, optionally using `modulo` to map `index` to the cyclic indexing.
201
214
  * * In particular, `-1` is the final curve.
202
215
  * @param index cyclic index
203
216
  */
@@ -205,8 +218,7 @@ export class CurveChain extends CurveCollection {
205
218
  const n = this.children.length;
206
219
  if (n === 0)
207
220
  return undefined;
208
- /** Try simplest non-cyclic access first . . */
209
- if (index >= 0 && index < n)
221
+ if (index >= 0 && index < n) // try simplest non-cyclic access first
210
222
  return this.children[index];
211
223
  if (cyclic) {
212
224
  const index2 = Geometry.modulo(index, n);
@@ -219,6 +231,11 @@ export class CurveChain extends CurveCollection {
219
231
  * @param options tolerance parameters controlling the stroking.
220
232
  */
221
233
  getPackedStrokes(options) {
234
+ /**
235
+ * The object returned by "cloneStroked" has the same type (Loop or Path) but instead of a chain of
236
+ * CurvePrimitives as children, it has a single LineString3d child. "getPackedStrokes" just returns
237
+ * the points of that LineString3d using "packedPoints".
238
+ */
222
239
  const tree = this.cloneStroked(options);
223
240
  if (tree instanceof CurveChain) {
224
241
  const children = tree.children;
@@ -230,16 +247,6 @@ export class CurveChain extends CurveCollection {
230
247
  }
231
248
  return undefined;
232
249
  }
233
- /* EDL 01/20 Path, Loop, CurveChainWithDistanceIndex all implement this.
234
- Reducing it to abstract.
235
- Hypothetically, a derived class in the wild might be depending on this.
236
- {
237
- const strokes = LineString3d.create();
238
- for (const curve of this.children)
239
- curve.emitStrokes(strokes, options);
240
- return strokes;
241
- }
242
- */
243
250
  /**
244
251
  * Add a child curve.
245
252
  * * Returns false if the given child is not a CurvePrimitive.
@@ -272,7 +279,7 @@ export class CurveChain extends CurveCollection {
272
279
  this._curves.reverse();
273
280
  }
274
281
  /**
275
- * Return the index where target is found in the array of children
282
+ * Return the index where target is found in the array of children.
276
283
  * @param alsoSearchProxies whether to also check proxy curves of the children
277
284
  */
278
285
  childIndex(target, alsoSearchProxies) {
@@ -291,7 +298,7 @@ export class CurveChain extends CurveCollection {
291
298
  }
292
299
  return undefined;
293
300
  }
294
- /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */
301
+ /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */
295
302
  primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(index, fraction, cyclic = false, result) {
296
303
  const primitive = this.cyclicCurvePrimitive(index, cyclic);
297
304
  if (primitive) {
@@ -1 +1 @@
1
- {"version":3,"file":"CurveCollection.js","sourceRoot":"","sources":["../../../src/curve/CurveCollection.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAQvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,kBAAkB,EA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7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,2BAA2B;IACpB,QAAQ,CAAC,CAAS;QACvB,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM;YAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,8EAA8E;IACvE,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,yCAAyC;IAAtD;QACE,8GAA8G;QACvG,8BAAyB,GAAY,IAAI,CAAC;QACjD,0CAA0C;QACnC,8BAAyB,GAAY,IAAI,CAAC;QACjD,gDAAgD;QACzC,4BAAuB,GAAG,QAAQ,CAAC,mBAAmB,CAAC;QAC9D,uDAAuD;QAChD,2BAAsB,GAAG,QAAQ,CAAC,mBAAmB,CAAC;IAC/D,CAAC;CAAA","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { AnyCurve } from \"./CurveChain\";\r\nimport { CurveLocationDetail } from \"./CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { CloneCurvesContext } from \"./internalContexts/CloneCurvesContext\";\r\nimport { CloneWithExpandedLineStrings } from \"./internalContexts/CloneWithExpandedLineStrings\";\r\nimport { CountLinearPartsSearchContext } from \"./internalContexts/CountLinearPartsSearchContext\";\r\nimport { GapSearchContext } from \"./internalContexts/GapSearchContext\";\r\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\r\nimport { SumLengthsContext } from \"./internalContexts/SumLengthsContext\";\r\nimport { TransformInPlaceContext } from \"./internalContexts/TransformInPlaceContext\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { ProxyCurve } from \"./ProxyCurve\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * Describes the concrete type of a [[CurveCollection]]. Each type name maps to a specific subclass and can be\r\n * used in conditional statements for type-switching.\r\n * - \"loop\" => [[Loop]]\r\n * - \"path\" => [[Path]]\r\n * - \"unionRegion\" => [[UnionRegion]]\r\n * - \"parityRegion\" => [[ParityRegion]]\r\n * - \"bagOfCurves\" => [[BagOfCurves]]\r\n * @public\r\n */\r\nexport type CurveCollectionType = \"loop\" | \"path\" | \"unionRegion\" | \"parityRegion\" | \"bagOfCurves\";\r\n\r\n/**\r\n * A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:\r\n * - `CurveChain` is a (non-instantiable) intermediate class for a sequence of `CurvePrimitive` joining head-to-tail.\r\n * The two instantiable forms of `CurveChain` are\r\n * - `Path` - A chain not required to close, and not enclosing a planar area\r\n * - `Loop` - A chain required to close from last to first so that a planar area is enclosed.\r\n * - `ParityRegion` -- a collection of coplanar `Loop`s, with \"in/out\" classification by parity rules\r\n * - `UnionRegion` -- a collection of coplanar `Loop`s, with \"in/out\" classification by union rules\r\n * - `BagOfCurves` -- a collection of `AnyCurve` with no implied structure.\r\n *\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport abstract class CurveCollection extends GeometryQuery {\r\n /** String name for schema properties */\r\n public readonly geometryCategory = \"curveCollection\";\r\n /** Type discriminator. */\r\n public abstract readonly curveCollectionType: CurveCollectionType;\r\n /* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\n /** Flag for inner loop status. Only used by `Loop`. */\r\n public isInner: boolean = false;\r\n /** Return the sum of the lengths of all contained curves. */\r\n public sumLengths(): number {\r\n return SumLengthsContext.sumLengths(this);\r\n }\r\n /** Return the closest point on the contained curves */\r\n public closestPoint(spacePoint: Point3d): CurveLocationDetail | undefined {\r\n let detailA: CurveLocationDetail | undefined;\r\n if (this.children !== undefined) {\r\n for (const child of this.children) {\r\n if (child instanceof CurvePrimitive) {\r\n const detailB = child.closestPoint(spacePoint, false);\r\n detailA = CurveLocationDetail.chooseSmallerA(detailA, detailB);\r\n } else if (child instanceof CurveCollection) {\r\n const detailB = child.closestPoint(spacePoint);\r\n detailA = CurveLocationDetail.chooseSmallerA(detailA, detailB);\r\n }\r\n }\r\n }\r\n return detailA;\r\n }\r\n /**\r\n * Return the max gap between adjacent primitives in Path and Loop collections.\r\n * * In a Path, gaps are computed between consecutive primitives.\r\n * * In a Loop, gaps are computed between consecutive primitives and between last and first.\r\n * * gaps are NOT computed between consecutive CurvePrimitives in \"unstructured\" collections. The type is\r\n * \"unstructured\" so gaps should not be semantically meaningful.\r\n */\r\n public maxGap(): number {\r\n return GapSearchContext.maxGap(this);\r\n }\r\n /** Return true if the curve collection has any primitives other than LineSegment3d and LineString3d */\r\n public checkForNonLinearPrimitives(): boolean {\r\n return CountLinearPartsSearchContext.hasNonLinearPrimitives(this);\r\n }\r\n /** Apply transform recursively to children */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n return TransformInPlaceContext.tryTransformInPlace(this, transform);\r\n }\r\n /** Return a deep copy. */\r\n public override clone(): CurveCollection {\r\n return CloneCurvesContext.clone(this) as CurveCollection;\r\n }\r\n /** Create a deep copy of transformed curves. */\r\n public override cloneTransformed(transform: Transform): CurveCollection | undefined {\r\n return CloneCurvesContext.clone(this, transform);\r\n }\r\n /** Create a deep copy with all linestrings expanded to multiple LineSegment3d. */\r\n public cloneWithExpandedLineStrings(): CurveCollection {\r\n return CloneWithExpandedLineStrings.clone(this);\r\n }\r\n /** Recurse through children to collect CurvePrimitive's in flat array. */\r\n private collectCurvePrimitivesGo(\r\n results: CurvePrimitive[], smallestPossiblePrimitives: boolean, explodeLinestrings: boolean = false\r\n ): void {\r\n if (this.children) {\r\n for (const child of this.children) {\r\n if (child instanceof CurvePrimitive)\r\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\r\n else if (child instanceof CurveCollection)\r\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\r\n }\r\n }\r\n }\r\n /**\r\n * Return an array containing only the curve primitives.\r\n * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without\r\n * clearing the array.)\r\n * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,\r\n * it recurses to its (otherwise hidden) children.\r\n */\r\n public collectCurvePrimitives(\r\n collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLineStrings: boolean = false\r\n ): CurvePrimitive[] {\r\n const results: CurvePrimitive[] = collectorArray === undefined ? [] : collectorArray;\r\n this.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLineStrings);\r\n return results;\r\n }\r\n /**\r\n * Return true for planar region types:\r\n * * `Loop`\r\n * * `ParityRegion`\r\n * * `UnionRegion`\r\n */\r\n public get isAnyRegionType(): boolean {\r\n return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 5 || this.dgnBoundaryType() === 4;\r\n }\r\n /** Return true for a `Path`, i.e. a chain of curves joined head-to-tail */\r\n public get isOpenPath(): boolean {\r\n return this.dgnBoundaryType() === 1;\r\n }\r\n /**\r\n * Return true for a single-loop planar region type, i.e. `Loop`.\r\n * * This is _not- a test for physical closure of a `Path`\r\n */\r\n public get isClosedPath(): boolean {\r\n return this.dgnBoundaryType() === 2;\r\n }\r\n /** Return a CurveCollection with the same structure but all curves replaced by strokes. */\r\n public abstract cloneStroked(options?: StrokeOptions): AnyCurve;\r\n /** Support method for ICurvePrimitive ... one line call to specific announce method . . */\r\n public abstract announceToCurveProcessor(processor: RecursiveCurveProcessor): void;\r\n /** Clone an empty collection. */\r\n public abstract cloneEmptyPeer(): CurveCollection;\r\n /**\r\n * Return the boundary type of a corresponding MicroStation CurveVector.\r\n * * Derived class must implement.\r\n */\r\n public abstract dgnBoundaryType(): number;\r\n /**\r\n * Try to add a child.\r\n * @param child child to add.\r\n * @return true if child is an acceptable type for this collection.\r\n */\r\n public abstract tryAddChild(child: AnyCurve | undefined): boolean;\r\n /** Return a child identified by by index */\r\n public abstract getChild(i: number): AnyCurve | undefined;\r\n /** Extend (increase) `rangeToExtend` as needed to include these curves (optionally transformed) */\r\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\r\n const children = this.children;\r\n if (children) {\r\n for (const c of children) {\r\n c.extendRange(rangeToExtend, transform);\r\n }\r\n }\r\n }\r\n /**\r\n * * Find any curve primitive in the source.\r\n * * Evaluate it at a fraction (which by default is an interior fraction)\r\n * @param source containing `CurvePrimitive` or `CurveCollection`\r\n * @param fraction fraction to use in `curve.fractionToPoint(fraction)`\r\n */\r\n public static createCurveLocationDetailOnAnyCurvePrimitive(\r\n source: GeometryQuery | undefined, fraction: number = 0.5\r\n ): CurveLocationDetail | undefined {\r\n if (!source)\r\n return undefined;\r\n if (source instanceof CurvePrimitive) {\r\n return CurveLocationDetail.createCurveEvaluatedFraction(source, fraction);\r\n } else if (source instanceof CurveCollection && source.children !== undefined)\r\n for (const child of source.children) {\r\n const detail = this.createCurveLocationDetailOnAnyCurvePrimitive(child, fraction);\r\n if (detail)\r\n return detail;\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters\r\n * of projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\r\n * end of the ray.\r\n */\r\n public projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n}\r\n\r\n/**\r\n * Shared base class for use by both open and closed paths.\r\n * - A `CurveChain` contains only curvePrimitives. No other paths, loops, or regions allowed.\r\n * - A single entry in the chain can in fact contain multiple curve primitives if the entry itself is (for instance)\r\n * `CurveChainWithDistanceIndex`\r\n * which presents itself (through method interface) as a CurvePrimitive with well defined mappings from fraction\r\n * to xyz, but in fact does all the\r\n * calculations over multiple primitives.\r\n * - The specific derived classes are `Path` and `Loop`\r\n * - `CurveChain` is an intermediate class. It is not instantiable on its own.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport abstract class CurveChain extends CurveCollection {\r\n /** The curve primitives in the chain. */\r\n protected _curves: CurvePrimitive[];\r\n protected constructor() { super(); this._curves = []; }\r\n /** Return the array of `CurvePrimitive` */\r\n public override get children(): CurvePrimitive[] {\r\n if (this._curves === undefined)\r\n this._curves = [];\r\n return this._curves;\r\n }\r\n /**\r\n * Return the `[index]` curve primitive, optionally using `modulo` to map`index` to the cyclic indexing.\r\n * * In particular, `-1` is the final curve.\r\n * @param index cyclic index\r\n */\r\n public cyclicCurvePrimitive(index: number, cyclic: boolean = true): CurvePrimitive | undefined {\r\n const n = this.children.length;\r\n if (n === 0)\r\n return undefined;\r\n /** Try simplest non-cyclic access first . . */\r\n if (index >= 0 && index < n)\r\n return this.children[index];\r\n if (cyclic) {\r\n const index2 = Geometry.modulo(index, n);\r\n return this.children[index2];\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Stroke the chain into a simple xyz array.\r\n * @param options tolerance parameters controlling the stroking.\r\n */\r\n public getPackedStrokes(options?: StrokeOptions): GrowableXYZArray | undefined {\r\n const tree = this.cloneStroked(options);\r\n if (tree instanceof CurveChain) {\r\n const children = tree.children;\r\n if (children.length === 1) {\r\n const ls = children[0];\r\n if (ls instanceof LineString3d)\r\n return ls.packedPoints;\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** Return a structural clone, with CurvePrimitive objects stroked. */\r\n public abstract override cloneStroked(options?: StrokeOptions): AnyCurve;\r\n /* EDL 01/20 Path, Loop, CurveChainWithDistanceIndex all implement this.\r\n Reducing it to abstract.\r\n Hypothetically, a derived class in the wild might be depending on this.\r\n {\r\n const strokes = LineString3d.create();\r\n for (const curve of this.children)\r\n curve.emitStrokes(strokes, options);\r\n return strokes;\r\n }\r\n */\r\n /**\r\n * Add a child curve.\r\n * * Returns false if the given child is not a CurvePrimitive.\r\n */\r\n public tryAddChild(child: AnyCurve | undefined): boolean {\r\n if (child && child instanceof CurvePrimitive) {\r\n this._curves.push(child);\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Return a child by index */\r\n public getChild(i: number): CurvePrimitive | undefined {\r\n if (i < this._curves.length) return this._curves[i];\r\n return undefined;\r\n }\r\n /** Invoke `curve.extendRange(range, transform)` for each child */\r\n public override extendRange(range: Range3d, transform?: Transform): void {\r\n for (const curve of this._curves)\r\n curve.extendRange(range, transform);\r\n }\r\n /**\r\n * Reverse each child curve (in place)\r\n * Reverse the order of the children in the CurveChain array.\r\n */\r\n public reverseChildrenInPlace() {\r\n for (const curve of this._curves)\r\n curve.reverseInPlace();\r\n this._curves.reverse();\r\n }\r\n /**\r\n * Return the index where target is found in the array of children\r\n * @param alsoSearchProxies whether to also check proxy curves of the children\r\n */\r\n public childIndex(target: CurvePrimitive | undefined, alsoSearchProxies?: boolean): number | undefined {\r\n for (let i = 0; i < this._curves.length; i++) {\r\n if (this._curves[i] === target)\r\n return i;\r\n }\r\n if (alsoSearchProxies ?? false) {\r\n for (let i = 0; i < this._curves.length; i++) {\r\n const childCurve = this._curves[i];\r\n if (childCurve instanceof ProxyCurve) {\r\n if (childCurve.proxyCurve === target)\r\n return i;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */\r\n public primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(\r\n index: number, fraction: number, cyclic: boolean = false, result?: CurveLocationDetail\r\n ): CurveLocationDetail | undefined {\r\n const primitive = this.cyclicCurvePrimitive(index, cyclic);\r\n if (primitive) {\r\n return CurveLocationDetail.createCurveEvaluatedFractionPointAndDerivative(primitive, fraction, result);\r\n }\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * * A `BagOfCurves` object is a collection of `AnyCurve` objects.\r\n * * A `BagOfCurves` has no implied properties such as being planar.\r\n * @public\r\n */\r\nexport class BagOfCurves extends CurveCollection {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"bagOfCurves\";\r\n /** Test if `other` is an instance of `BagOfCurves` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof BagOfCurves;\r\n }\r\n /**\r\n * Array of children.\r\n * * No restrictions on type.\r\n */\r\n protected _children: AnyCurve[];\r\n /** Construct an empty `BagOfCurves` */\r\n public constructor() { super(); this._children = []; }\r\n /** Return the (reference to) array of children */\r\n public override get children(): AnyCurve[] {\r\n return this._children;\r\n }\r\n /** Create with given curves. */\r\n public static create(...data: AnyCurve[]): BagOfCurves {\r\n const result = new BagOfCurves();\r\n for (const child of data) {\r\n result.tryAddChild(child);\r\n }\r\n return result;\r\n }\r\n /** Return the boundary type (0) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n return 0;\r\n }\r\n /** Invoke `processor.announceBagOfCurves(this, indexInParent);` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announceBagOfCurves(this, indexInParent);\r\n }\r\n /** Clone all children in stroked form. */\r\n public cloneStroked(options?: StrokeOptions): BagOfCurves {\r\n const clone = new BagOfCurves();\r\n let child;\r\n for (child of this.children) {\r\n if (child instanceof CurvePrimitive) {\r\n const ls = LineString3d.create();\r\n child.emitStrokes(ls, options);\r\n if (ls)\r\n clone.children.push(ls);\r\n } else if (child instanceof CurveCollection) {\r\n const childStrokes = child.cloneStroked(options);\r\n if (childStrokes)\r\n clone.children.push(childStrokes);\r\n }\r\n }\r\n return clone;\r\n }\r\n /** Return an empty `BagOfCurves` */\r\n public cloneEmptyPeer(): BagOfCurves {\r\n return new BagOfCurves();\r\n }\r\n /** Add a child */\r\n public tryAddChild(child: AnyCurve | undefined): boolean {\r\n if (child)\r\n this._children.push(child);\r\n return true;\r\n }\r\n /** Get a child by index */\r\n public getChild(i: number): AnyCurve | undefined {\r\n if (i < this._children.length)\r\n return this._children[i];\r\n return undefined;\r\n }\r\n /** Second step of double dispatch: call `handler.handleBagOfCurves(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleBagOfCurves(this);\r\n }\r\n}\r\n\r\n/**\r\n * * Options to control method `RegionOps.consolidateAdjacentPrimitives`\r\n * @public\r\n */\r\nexport class ConsolidateAdjacentCurvePrimitivesOptions {\r\n /** True to consolidated linear geometry (e.g. separate LineSegment3d and LineString3d) into LineString3d */\r\n public consolidateLinearGeometry: boolean = true;\r\n /** True to consolidate contiguous arcs */\r\n public consolidateCompatibleArcs: boolean = true;\r\n /** Tolerance for collapsing identical points */\r\n public duplicatePointTolerance = Geometry.smallMetricDistance;\r\n /** Tolerance for removing interior colinear points. */\r\n public colinearPointTolerance = Geometry.smallMetricDistance;\r\n}\r\n"]}
1
+ {"version":3,"file":"CurveCollection.js","sourceRoot":"","sources":["../../../src/curve/CurveCollection.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AACH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAQvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D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D,mBAAmB;IACZ,WAAW,CAAC,KAA2B;QAC5C,IAAI,KAAK;YACP,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QAC7B,OAAO,IAAI,CAAC;IACd,CAAC;IACD,2BAA2B;IACpB,QAAQ,CAAC,CAAS;QACvB,IAAI,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM;YAC3B,OAAO,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,8EAA8E;IACvE,yBAAyB,CAAC,OAAwB;QACvD,OAAO,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;CACF;AAED;;;GAGG;AACH,MAAM,OAAO,yCAAyC;IAAtD;QACE,8GAA8G;QACvG,8BAAyB,GAAY,IAAI,CAAC;QACjD,0CAA0C;QACnC,8BAAyB,GAAY,IAAI,CAAC;QACjD,gDAAgD;QACzC,4BAAuB,GAAG,QAAQ,CAAC,mBAAmB,CAAC;QAC9D,uDAAuD;QAChD,2BAAsB,GAAG,QAAQ,CAAC,mBAAmB,CAAC;IAC/D,CAAC;CAAA","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { Point3d, Vector3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Range1d, Range3d } from \"../geometry3d/Range\";\r\nimport { Ray3d } from \"../geometry3d/Ray3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { AnyCurve } from \"./CurveChain\";\r\nimport { CurveLocationDetail } from \"./CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { RecursiveCurveProcessor } from \"./CurveProcessor\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\nimport { CloneCurvesContext } from \"./internalContexts/CloneCurvesContext\";\r\nimport { CloneWithExpandedLineStrings } from \"./internalContexts/CloneWithExpandedLineStrings\";\r\nimport { CountLinearPartsSearchContext } from \"./internalContexts/CountLinearPartsSearchContext\";\r\nimport { GapSearchContext } from \"./internalContexts/GapSearchContext\";\r\nimport { PlaneAltitudeRangeContext } from \"./internalContexts/PlaneAltitudeRangeContext\";\r\nimport { SumLengthsContext } from \"./internalContexts/SumLengthsContext\";\r\nimport { TransformInPlaceContext } from \"./internalContexts/TransformInPlaceContext\";\r\nimport { LineString3d } from \"./LineString3d\";\r\nimport { ProxyCurve } from \"./ProxyCurve\";\r\nimport { StrokeOptions } from \"./StrokeOptions\";\r\n\r\n/**\r\n * Describes the concrete type of a [[CurveCollection]]. Each type name maps to a specific subclass and can be\r\n * used in conditional statements for type-switching.\r\n * - \"loop\" => [[Loop]]\r\n * - \"path\" => [[Path]]\r\n * - \"unionRegion\" => [[UnionRegion]]\r\n * - \"parityRegion\" => [[ParityRegion]]\r\n * - \"bagOfCurves\" => [[BagOfCurves]]\r\n * @public\r\n */\r\nexport type CurveCollectionType = \"loop\" | \"path\" | \"unionRegion\" | \"parityRegion\" | \"bagOfCurves\";\r\n\r\n/**\r\n * A `CurveCollection` is an abstract (non-instantiable) class for various sets of curves with particular structures:\r\n * - `CurveChain` is a (non-instantiable) intermediate class for a sequence of `CurvePrimitive` joining head-to-tail.\r\n * The two instantiable forms of `CurveChain` are\r\n * - `Path` - A chain not required to close and not enclosing a planar area (so curves do not have to be on the\r\n * same plane).\r\n * - `Loop` - A chain required to close from last to first so that a planar area is enclosed (so curves have to\r\n * be on the same plane).\r\n * - `ParityRegion` -- a collection of coplanar `Loop`s, with \"in/out\" classification by parity rules.\r\n * - `UnionRegion` -- a collection of coplanar `Loop`s, with \"in/out\" classification by union rules.\r\n * - `BagOfCurves` -- a collection of `AnyCurve` with no implied structure.\r\n *\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport abstract class CurveCollection extends GeometryQuery {\r\n /** String name for schema properties */\r\n public readonly geometryCategory = \"curveCollection\";\r\n /** Type discriminator. */\r\n public abstract readonly curveCollectionType: CurveCollectionType;\r\n /* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\n /** Flag for inner loop status. Only used by `Loop`. */\r\n public isInner: boolean = false;\r\n /** Return the sum of the lengths of all contained curves. */\r\n public sumLengths(): number {\r\n return SumLengthsContext.sumLengths(this);\r\n }\r\n /** Return the closest point on the contained curves */\r\n public closestPoint(spacePoint: Point3d): CurveLocationDetail | undefined {\r\n let detailA: CurveLocationDetail | undefined;\r\n if (this.children !== undefined) {\r\n for (const child of this.children) {\r\n if (child instanceof CurvePrimitive) {\r\n const detailB = child.closestPoint(spacePoint, false);\r\n detailA = CurveLocationDetail.chooseSmallerA(detailA, detailB);\r\n } else if (child instanceof CurveCollection) {\r\n const detailB = child.closestPoint(spacePoint);\r\n detailA = CurveLocationDetail.chooseSmallerA(detailA, detailB);\r\n }\r\n }\r\n }\r\n return detailA;\r\n }\r\n /**\r\n * Return the max gap between adjacent primitives in Path and Loop collections.\r\n * * In a Path, gaps are computed between consecutive primitives.\r\n * * In a Loop, gaps are computed between consecutive primitives and between last and first.\r\n * * Gaps are NOT computed between consecutive CurvePrimitives in \"unstructured\" collections. The type is\r\n * \"unstructured\" so gaps should not be semantically meaningful.\r\n */\r\n public maxGap(): number {\r\n return GapSearchContext.maxGap(this);\r\n }\r\n /** Return true if the curve collection has any primitives other than LineSegment3d and LineString3d */\r\n public checkForNonLinearPrimitives(): boolean {\r\n return CountLinearPartsSearchContext.hasNonLinearPrimitives(this);\r\n }\r\n /** Apply transform recursively to children */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n return TransformInPlaceContext.tryTransformInPlace(this, transform);\r\n }\r\n /** Return a deep copy. */\r\n public override clone(): CurveCollection {\r\n return CloneCurvesContext.clone(this) as CurveCollection;\r\n }\r\n /** Create a deep copy of transformed curves. */\r\n public override cloneTransformed(transform: Transform): CurveCollection | undefined {\r\n return CloneCurvesContext.clone(this, transform);\r\n }\r\n /** Create a deep copy with all linestrings broken down into multiple LineSegment3d. */\r\n public cloneWithExpandedLineStrings(): CurveCollection {\r\n return CloneWithExpandedLineStrings.clone(this);\r\n }\r\n /**\r\n * Push all CurvePrimitives contained in the instance onto the `results` array.\r\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives\r\n * of the Loop are pushed onto `results`.\r\n */\r\n private collectCurvePrimitivesGo(\r\n results: CurvePrimitive[], smallestPossiblePrimitives: boolean, explodeLinestrings: boolean = false\r\n ): void {\r\n if (this.children) {\r\n for (const child of this.children) {\r\n if (child instanceof CurvePrimitive)\r\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\r\n else if (child instanceof CurveCollection)\r\n child.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLinestrings);\r\n }\r\n }\r\n }\r\n /**\r\n * Return an array containing all CurvePrimitives in the instance.\r\n * * This method is recursive. For example, if the CurveCollection contains a Loop, all CurvePrimitives of\r\n * the Loop are pushed onto the returned array.\r\n * @param collectorArray optional array to receive primitives. If present, new primitives are ADDED (without\r\n * clearing the array).\r\n * @param smallestPossiblePrimitives if false, CurvePrimitiveWithDistanceIndex returns only itself. If true,\r\n * it recurses to its (otherwise hidden) children.\r\n */\r\n public collectCurvePrimitives(\r\n collectorArray?: CurvePrimitive[], smallestPossiblePrimitives: boolean = false, explodeLineStrings: boolean = false\r\n ): CurvePrimitive[] {\r\n const results: CurvePrimitive[] = collectorArray === undefined ? [] : collectorArray;\r\n this.collectCurvePrimitivesGo(results, smallestPossiblePrimitives, explodeLineStrings);\r\n return results;\r\n }\r\n /**\r\n * Return true for planar region types:\r\n * * `Loop`\r\n * * `ParityRegion`\r\n * * `UnionRegion`\r\n */\r\n public get isAnyRegionType(): boolean {\r\n return this.dgnBoundaryType() === 2 || this.dgnBoundaryType() === 4 || this.dgnBoundaryType() === 5;\r\n }\r\n /** Return true for a `Path`, i.e. a chain of curves joined head-to-tail */\r\n public get isOpenPath(): boolean {\r\n return this.dgnBoundaryType() === 1;\r\n }\r\n /**\r\n * Return true for a single-loop planar region type, i.e. `Loop`.\r\n * * This is NOT a test for physical closure of a `Path`.\r\n */\r\n public get isClosedPath(): boolean {\r\n return this.dgnBoundaryType() === 2;\r\n }\r\n /** Return a CurveCollection with the same structure but all curves replaced by strokes. */\r\n public abstract cloneStroked(options?: StrokeOptions): AnyCurve;\r\n /** Support method for ICurvePrimitive ... one line call to specific announce method . . */\r\n public abstract announceToCurveProcessor(processor: RecursiveCurveProcessor): void;\r\n /** Clone an empty collection. */\r\n public abstract cloneEmptyPeer(): CurveCollection;\r\n /**\r\n * Return the boundary type of a corresponding MicroStation CurveVector.\r\n * * Derived class must implement.\r\n */\r\n public abstract dgnBoundaryType(): number;\r\n /**\r\n * Try to add a child.\r\n * @param child child to add.\r\n * @return true if child is an acceptable type for this collection.\r\n */\r\n public abstract tryAddChild(child: AnyCurve | undefined): boolean;\r\n /** Return a child identified by by index */\r\n public abstract getChild(i: number): AnyCurve | undefined;\r\n /**\r\n * Extend (increase) the given range as needed to encompass all curves in the curve collection.\r\n * @param rangeToExtend the given range.\r\n * @param transform if supplied, the range is extended with transformed curves.\r\n */\r\n public extendRange(rangeToExtend: Range3d, transform?: Transform): void {\r\n const children = this.children;\r\n if (children) {\r\n for (const c of children) {\r\n c.extendRange(rangeToExtend, transform);\r\n }\r\n }\r\n }\r\n /**\r\n * Find any CurvePrimitive in the source and evaluate it at the given fraction.\r\n * * The first CurvePrimitive found is evaluated. Any other CurvePrimitives are ignored.\r\n * @param source containing `CurvePrimitive` or `CurveCollection`\r\n * @param fraction fraction to use in `curve.fractionToPoint(fraction)`\r\n */\r\n public static createCurveLocationDetailOnAnyCurvePrimitive(\r\n source: GeometryQuery | undefined, fraction: number = 0.5\r\n ): CurveLocationDetail | undefined {\r\n if (!source)\r\n return undefined;\r\n if (source instanceof CurvePrimitive) {\r\n return CurveLocationDetail.createCurveEvaluatedFraction(source, fraction);\r\n } else if (source instanceof CurveCollection && source.children !== undefined)\r\n for (const child of source.children) {\r\n const detail = this.createCurveLocationDetailOnAnyCurvePrimitive(child, fraction);\r\n if (detail)\r\n return detail;\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Project instance geometry (via dispatch) onto the given ray, and return the extreme fractional parameters\r\n * of projection.\r\n * @param ray ray onto which the instance is projected. A `Vector3d` is treated as a `Ray3d` with zero origin.\r\n * @param lowHigh optional receiver for output\r\n * @returns range of fractional projection parameters onto the ray, where 0.0 is start of the ray and 1.0 is the\r\n * end of the ray.\r\n */\r\n public projectedParameterRange(ray: Vector3d | Ray3d, lowHigh?: Range1d): Range1d | undefined {\r\n return PlaneAltitudeRangeContext.findExtremeFractionsAlongDirection(this, ray, lowHigh);\r\n }\r\n}\r\n\r\n/**\r\n * Shared base class for use by both open and closed paths.\r\n * * A `CurveChain` contains only CurvePrimitives. No other paths, loops, or regions allowed.\r\n * * The specific derived classes are `Path` and `Loop`\r\n * * `CurveChain` is an intermediate class. It is not instantiable on its own.\r\n * * The related class `CurveChainWithDistanceIndex` is a `CurvePrimitive` whose API presents well-defined mappings\r\n * from fraction to xyz over the entire chain, but in fact does all the calculations over multiple primitives.\r\n * @see [Curve Collections]($docs/learning/geometry/CurveCollection.md) learning article.\r\n * @public\r\n */\r\nexport abstract class CurveChain extends CurveCollection {\r\n /** The curve primitives in the chain. */\r\n protected _curves: CurvePrimitive[];\r\n /** Constructor */\r\n protected constructor() {\r\n super();\r\n this._curves = [];\r\n }\r\n /** Return the array of `CurvePrimitive` */\r\n public override get children(): CurvePrimitive[] {\r\n if (this._curves === undefined)\r\n this._curves = [];\r\n return this._curves;\r\n }\r\n /**\r\n * Return the curve primitive at the given `index`, optionally using `modulo` to map `index` to the cyclic indexing.\r\n * * In particular, `-1` is the final curve.\r\n * @param index cyclic index\r\n */\r\n public cyclicCurvePrimitive(index: number, cyclic: boolean = true): CurvePrimitive | undefined {\r\n const n = this.children.length;\r\n if (n === 0)\r\n return undefined;\r\n if (index >= 0 && index < n) // try simplest non-cyclic access first\r\n return this.children[index];\r\n if (cyclic) {\r\n const index2 = Geometry.modulo(index, n);\r\n return this.children[index2];\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Stroke the chain into a simple xyz array.\r\n * @param options tolerance parameters controlling the stroking.\r\n */\r\n public getPackedStrokes(options?: StrokeOptions): GrowableXYZArray | undefined {\r\n /**\r\n * The object returned by \"cloneStroked\" has the same type (Loop or Path) but instead of a chain of\r\n * CurvePrimitives as children, it has a single LineString3d child. \"getPackedStrokes\" just returns\r\n * the points of that LineString3d using \"packedPoints\".\r\n */\r\n const tree = this.cloneStroked(options);\r\n if (tree instanceof CurveChain) {\r\n const children = tree.children;\r\n if (children.length === 1) {\r\n const ls = children[0];\r\n if (ls instanceof LineString3d)\r\n return ls.packedPoints;\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** Return a structural clone, with CurvePrimitive objects stroked. */\r\n public abstract override cloneStroked(options?: StrokeOptions): AnyCurve;\r\n /**\r\n * Add a child curve.\r\n * * Returns false if the given child is not a CurvePrimitive.\r\n */\r\n public tryAddChild(child: AnyCurve | undefined): boolean {\r\n if (child && child instanceof CurvePrimitive) {\r\n this._curves.push(child);\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Return a child by index */\r\n public getChild(i: number): CurvePrimitive | undefined {\r\n if (i < this._curves.length) return this._curves[i];\r\n return undefined;\r\n }\r\n /** Invoke `curve.extendRange(range, transform)` for each child */\r\n public override extendRange(range: Range3d, transform?: Transform): void {\r\n for (const curve of this._curves)\r\n curve.extendRange(range, transform);\r\n }\r\n /**\r\n * Reverse each child curve (in place)\r\n * Reverse the order of the children in the CurveChain array.\r\n */\r\n public reverseChildrenInPlace(): void {\r\n for (const curve of this._curves)\r\n curve.reverseInPlace();\r\n this._curves.reverse();\r\n }\r\n /**\r\n * Return the index where target is found in the array of children.\r\n * @param alsoSearchProxies whether to also check proxy curves of the children\r\n */\r\n public childIndex(target: CurvePrimitive | undefined, alsoSearchProxies?: boolean): number | undefined {\r\n for (let i = 0; i < this._curves.length; i++) {\r\n if (this._curves[i] === target)\r\n return i;\r\n }\r\n if (alsoSearchProxies ?? false) {\r\n for (let i = 0; i < this._curves.length; i++) {\r\n const childCurve = this._curves[i];\r\n if (childCurve instanceof ProxyCurve) {\r\n if (childCurve.proxyCurve === target)\r\n return i;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** Evaluate an indexed curve at a fraction. Return as a CurveLocationDetail that indicates the primitive. */\r\n public primitiveIndexAndFractionToCurveLocationDetailPointAndDerivative(\r\n index: number, fraction: number, cyclic: boolean = false, result?: CurveLocationDetail\r\n ): CurveLocationDetail | undefined {\r\n const primitive = this.cyclicCurvePrimitive(index, cyclic);\r\n if (primitive) {\r\n return CurveLocationDetail.createCurveEvaluatedFractionPointAndDerivative(primitive, fraction, result);\r\n }\r\n return undefined;\r\n }\r\n}\r\n\r\n/**\r\n * * A `BagOfCurves` object is a collection of `AnyCurve` objects.\r\n * * A `BagOfCurves` has no implied properties such as being planar.\r\n * @public\r\n */\r\nexport class BagOfCurves extends CurveCollection {\r\n /** String name for schema properties */\r\n public readonly curveCollectionType = \"bagOfCurves\";\r\n /** Test if `other` is an instance of `BagOfCurves` */\r\n public isSameGeometryClass(other: GeometryQuery): boolean {\r\n return other instanceof BagOfCurves;\r\n }\r\n /**\r\n * Array of children.\r\n * * No restrictions on type.\r\n */\r\n protected _children: AnyCurve[];\r\n /** Construct an empty `BagOfCurves` */\r\n public constructor() {\r\n super();\r\n this._children = [];\r\n }\r\n /** Return the (reference to) array of children */\r\n public override get children(): AnyCurve[] {\r\n return this._children;\r\n }\r\n /** Create with given curves. */\r\n public static create(...data: AnyCurve[]): BagOfCurves {\r\n const result = new BagOfCurves();\r\n for (const child of data) {\r\n result.tryAddChild(child);\r\n }\r\n return result;\r\n }\r\n /** Return the boundary type (0) of a corresponding MicroStation CurveVector */\r\n public dgnBoundaryType(): number {\r\n return 0;\r\n }\r\n /** Invoke `processor.announceBagOfCurves(this, indexInParent);` */\r\n public announceToCurveProcessor(processor: RecursiveCurveProcessor, indexInParent: number = -1): void {\r\n return processor.announceBagOfCurves(this, indexInParent);\r\n }\r\n /** Clone all children in stroked form. */\r\n public cloneStroked(options?: StrokeOptions): BagOfCurves {\r\n const clone = new BagOfCurves();\r\n let child;\r\n for (child of this.children) {\r\n if (child instanceof CurvePrimitive) {\r\n const ls = LineString3d.create();\r\n child.emitStrokes(ls, options);\r\n if (ls)\r\n clone.children.push(ls);\r\n } else if (child instanceof CurveCollection) {\r\n const childStrokes = child.cloneStroked(options);\r\n if (childStrokes)\r\n clone.children.push(childStrokes);\r\n }\r\n }\r\n return clone;\r\n }\r\n /** Return an empty `BagOfCurves` */\r\n public cloneEmptyPeer(): BagOfCurves {\r\n return new BagOfCurves();\r\n }\r\n /** Add a child */\r\n public tryAddChild(child: AnyCurve | undefined): boolean {\r\n if (child)\r\n this._children.push(child);\r\n return true;\r\n }\r\n /** Get a child by index */\r\n public getChild(i: number): AnyCurve | undefined {\r\n if (i < this._children.length)\r\n return this._children[i];\r\n return undefined;\r\n }\r\n /** Second step of double dispatch: call `handler.handleBagOfCurves(this)` */\r\n public dispatchToGeometryHandler(handler: GeometryHandler): any {\r\n return handler.handleBagOfCurves(this);\r\n }\r\n}\r\n\r\n/**\r\n * * Options to control method `RegionOps.consolidateAdjacentPrimitives`\r\n * @public\r\n */\r\nexport class ConsolidateAdjacentCurvePrimitivesOptions {\r\n /** True to consolidated linear geometry (e.g. separate LineSegment3d and LineString3d) into LineString3d */\r\n public consolidateLinearGeometry: boolean = true;\r\n /** True to consolidate contiguous arcs */\r\n public consolidateCompatibleArcs: boolean = true;\r\n /** Tolerance for collapsing identical points */\r\n public duplicatePointTolerance = Geometry.smallMetricDistance;\r\n /** Tolerance for removing interior colinear points. */\r\n public colinearPointTolerance = Geometry.smallMetricDistance;\r\n}\r\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CurveCurve.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveCurve.ts"],"names":[],"mappings":"AAIA;;GAEG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAGlD,OAAO,EAAyB,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAE9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD;;;GAGG;AACH,qBAAa,UAAU;IACrB;;;;;;;OAOG;WACW,mBAAmB,CAAC,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,GAAE,MAAqC,GAAG,uBAAuB,EAAE;IAatM;;;;;;;OAOG;WACW,4BAA4B,CAAC,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,GAAE,MAAqC,GAAG,uBAAuB,EAAE;IAKvO;;;;;;;;;OASG;WACW,eAAe,CAAC,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,OAAO,EAAE,OAAO,GAAG,4BAA4B;IAKnJ;;;;OAIG;WACW,iCAAiC,CAAC,UAAU,EAAE,cAAc,EAAE,EAAE,SAAS,GAAE,MAAqC,GAAG,uBAAuB,EAAE;IAW1J;;;;OAIG;WACW,6BAA6B,CACzC,SAAS,EAAE,aAAa,EAAE,SAAS,E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AC9C;SACF;QACD,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;IACrC,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,6BAA6B,CACzC,SAAwB,EAAE,SAAwB,EAAE,WAAmB;QACvE,MAAM,OAAO,GAAG,IAAI,yBAAyB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACpE,OAAO,CAAC,mBAAmB,GAAG,WAAW,CAAC;QAC1C,SAAS,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;IACrC,CAAC;CAEF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\r\nimport { CurveCollection } from \"./CurveCollection\";\r\nimport { CurveCurveCloseApproachXY } from \"./CurveCurveCloseApproachXY\";\r\nimport { CurveCurveIntersectXY, CurveLocationDetailArrayPair } from \"./CurveCurveIntersectXY\";\r\nimport { CurveCurveIntersectXYZ } from \"./CurveCurveIntersectXYZ\";\r\nimport { CurveLocationDetailPair } from \"./CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\n\r\n/**\r\n * `CurveCurve` has static method for various computations that work on a pair of curves or curve collections.\r\n * @public\r\n */\r\nexport class CurveCurve {\r\n /**\r\n * Return xy intersections of 2 curves.\r\n * @param geometryA first geometry\r\n * @param extendA true to allow geometryA to extend\r\n * @param geometryB second geometry\r\n * @param extendB true to allow geometryB to extend\r\n * @param tolerance optional distance tolerance for coincidence\r\n */\r\n public static intersectionXYPairs(geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean, tolerance: number = Geometry.smallMetricDistance): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(undefined, geometryA, extendA, geometryB, extendB, tolerance);\r\n if (geometryB instanceof CurvePrimitive) {\r\n geometryA.dispatchToGeometryHandler(handler);\r\n } else if (geometryB instanceof CurveCollection) {\r\n const allCurves = geometryB.collectCurvePrimitives();\r\n for (const child of allCurves) {\r\n handler.resetGeometry(geometryA, false, child, false);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n }\r\n }\r\n return handler.grabPairedResults();\r\n }\r\n /**\r\n * Return xy intersections of 2 projected curves\r\n * @param geometryA first geometry\r\n * @param extendA true to allow geometryA to extend\r\n * @param geometryB second geometry\r\n * @param extendB true to allow geometryB to extend\r\n * @param tolerance optional distance tolerance for coincidence\r\n */\r\n public static intersectionProjectedXYPairs(worldToLocal: Matrix4d, geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean, tolerance: number = Geometry.smallMetricDistance): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(worldToLocal, geometryA, extendA, geometryB, extendB, tolerance);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n return handler.grabPairedResults();\r\n }\r\n /**\r\n * Return full 3d xyz intersections of 2 curves.\r\n * * Implemented for combinations of LineSegment3d, LineString3d, Arc3d.\r\n * * Not Implemented for bspline and bezier curves.\r\n * @beta\r\n * @param geometryA first geometry\r\n * @param extendA true to allow geometryA to extend\r\n * @param geometryB second geometry\r\n * @param extendB true to allow geometryB to extend\r\n */\r\n public static intersectionXYZ(geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean): CurveLocationDetailArrayPair {\r\n const handler = new CurveCurveIntersectXYZ(geometryA, extendA, geometryB, extendB);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n return handler.grabResults();\r\n }\r\n /**\r\n * Return xy intersections of input curves.\r\n * @param primitives input curves to intersect\r\n * @param tolerance optional distance tolerance for coincidence\r\n */\r\n public static allIntersectionsAmongPrimitivesXY(primitives: CurvePrimitive[], tolerance: number = Geometry.smallMetricDistance): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(undefined, undefined, false, undefined, false, tolerance);\r\n for (let i = 0; i < primitives.length; i++) {\r\n const geometryA = primitives[i];\r\n for (let j = i + 1; j < primitives.length; j++) {\r\n handler.resetGeometry(geometryA, false, primitives[j], false);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n }\r\n }\r\n return handler.grabPairedResults();\r\n }\r\n /**\r\n * Return xy close approaches of 2 projected curves\r\n * @param geometryA first geometry\r\n * @param geometryB second geometry\r\n */\r\n public static closeApproachProjectedXYPairs(\r\n geometryA: GeometryQuery, geometryB: GeometryQuery, maxDistance: number): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveCloseApproachXY(geometryA, geometryB);\r\n handler.maxDistanceToAccept = maxDistance;\r\n geometryA.dispatchToGeometryHandler(handler);\r\n return handler.grabPairedResults();\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"CurveCurve.js","sourceRoot":"","sources":["../../../src/curve/CurveCurve.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,qBAAqB,EAAgC,MAAM,yBAAyB,CAAC;AAC9F,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAElE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGlD;;;GAGG;AACH,MAAM,OAAO,UAAU;IACrB;;;;;;;OAOG;IACI,MAAM,CAAC,mBAAmB,CAC/B,SAAwB,EAAE,OAAgB,EAAE,SAAwB,EAAE,OAAgB,EACtF,YAAoB,QAAQ,CAAC,mBAAmB;QAEhD,MAAM,OAAO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OAIG;IACI,MAAM,CAAC,iCAAiC,CAC7C,UAA4B,EAAE,YAAoB,QAAQ,CAAC,mBAAmB;QAE9E,MAAM,OAAO,GAAG,IAAI,qBAAqB,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,CAAC,CAAC;QACpG,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC1C,MAAM,SAAS,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;YAChC,KAAK,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;gBAC9C,OAAO,CAAC,aAAa,CAAC,SAAS,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;gBAC9D,SAAS,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;aAC9C;SACF;QACD,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;IACrC,CAAC;IACD;;;;OAIG;IACI,MAAM,CAAC,6BAA6B,CACzC,SAAwB,EAAE,SAAwB,EAAE,WAAmB;QAEvE,MAAM,OAAO,GAAG,IAAI,yBAAyB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QACpE,OAAO,CAAC,mBAAmB,GAAG,WAAW,CAAC;QAC1C,SAAS,CAAC,yBAAyB,CAAC,OAAO,CAAC,CAAC;QAC7C,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;IACrC,CAAC;CAEF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n/** @packageDocumentation\r\n * @module Curve\r\n */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Matrix4d } from \"../geometry4d/Matrix4d\";\r\nimport { CurveCollection } from \"./CurveCollection\";\r\nimport { CurveCurveCloseApproachXY } from \"./CurveCurveCloseApproachXY\";\r\nimport { CurveCurveIntersectXY, CurveLocationDetailArrayPair } from \"./CurveCurveIntersectXY\";\r\nimport { CurveCurveIntersectXYZ } from \"./CurveCurveIntersectXYZ\";\r\nimport { CurveLocationDetailPair } from \"./CurveLocationDetail\";\r\nimport { CurvePrimitive } from \"./CurvePrimitive\";\r\nimport { GeometryQuery } from \"./GeometryQuery\";\r\n\r\n/**\r\n * `CurveCurve` has static method for various computations that work on a pair of curves or curve collections.\r\n * @public\r\n */\r\nexport class CurveCurve {\r\n /**\r\n * Return xy intersections of 2 curves.\r\n * @param geometryA first geometry\r\n * @param extendA true to allow geometryA to extend\r\n * @param geometryB second geometry\r\n * @param extendB true to allow geometryB to extend\r\n * @param tolerance optional distance tolerance for coincidence\r\n */\r\n public static intersectionXYPairs(\r\n geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean,\r\n tolerance: number = Geometry.smallMetricDistance\r\n ): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(undefined, geometryA, extendA, geometryB, extendB, tolerance);\r\n if (geometryB instanceof CurvePrimitive) {\r\n geometryA.dispatchToGeometryHandler(handler);\r\n } else if (geometryB instanceof CurveCollection) {\r\n const allCurves = geometryB.collectCurvePrimitives();\r\n for (const child of allCurves) {\r\n handler.resetGeometry(geometryA, false, child, false);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n }\r\n }\r\n return handler.grabPairedResults();\r\n }\r\n /**\r\n * Return xy intersections of 2 projected curves\r\n * @param geometryA first geometry\r\n * @param extendA true to allow geometryA to extend\r\n * @param geometryB second geometry\r\n * @param extendB true to allow geometryB to extend\r\n * @param tolerance optional distance tolerance for coincidence\r\n */\r\n public static intersectionProjectedXYPairs(\r\n worldToLocal: Matrix4d, geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean,\r\n tolerance: number = Geometry.smallMetricDistance\r\n ): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(worldToLocal, geometryA, extendA, geometryB, extendB, tolerance);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n return handler.grabPairedResults();\r\n }\r\n /**\r\n * Return full 3d xyz intersections of 2 curves.\r\n * * Implemented for combinations of LineSegment3d, LineString3d, Arc3d.\r\n * * Not Implemented for bspline and bezier curves.\r\n * @beta\r\n * @param geometryA first geometry\r\n * @param extendA true to allow geometryA to extend\r\n * @param geometryB second geometry\r\n * @param extendB true to allow geometryB to extend\r\n */\r\n public static intersectionXYZ(\r\n geometryA: GeometryQuery, extendA: boolean, geometryB: GeometryQuery, extendB: boolean\r\n ): CurveLocationDetailArrayPair {\r\n const handler = new CurveCurveIntersectXYZ(geometryA, extendA, geometryB, extendB);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n return handler.grabResults();\r\n }\r\n /**\r\n * Return xy intersections of input curves.\r\n * @param primitives input curves to intersect\r\n * @param tolerance optional distance tolerance for coincidence\r\n */\r\n public static allIntersectionsAmongPrimitivesXY(\r\n primitives: CurvePrimitive[], tolerance: number = Geometry.smallMetricDistance\r\n ): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveIntersectXY(undefined, undefined, false, undefined, false, tolerance);\r\n for (let i = 0; i < primitives.length; i++) {\r\n const geometryA = primitives[i];\r\n for (let j = i + 1; j < primitives.length; j++) {\r\n handler.resetGeometry(geometryA, false, primitives[j], false);\r\n geometryA.dispatchToGeometryHandler(handler);\r\n }\r\n }\r\n return handler.grabPairedResults();\r\n }\r\n /**\r\n * Return xy close approaches of 2 projected curves\r\n * @param geometryA first geometry\r\n * @param geometryB second geometry\r\n */\r\n public static closeApproachProjectedXYPairs(\r\n geometryA: GeometryQuery, geometryB: GeometryQuery, maxDistance: number\r\n ): CurveLocationDetailPair[] {\r\n const handler = new CurveCurveCloseApproachXY(geometryA, geometryB);\r\n handler.maxDistanceToAccept = maxDistance;\r\n geometryA.dispatchToGeometryHandler(handler);\r\n return handler.grabPairedResults();\r\n }\r\n\r\n}\r\n"]}
@@ -2,21 +2,69 @@
2
2
  * @module Curve
3
3
  */
4
4
  import { PlaneAltitudeEvaluator } from "../Geometry";
5
+ import { Angle } from "../geometry3d/Angle";
5
6
  import { AngleSweep } from "../geometry3d/AngleSweep";
6
7
  import { Ellipsoid, GeodesicPathPoint } from "../geometry3d/Ellipsoid";
7
8
  import { IndexedXYZCollection } from "../geometry3d/IndexedXYZCollection";
9
+ import { Plane3dByOriginAndUnitNormal } from "../geometry3d/Plane3dByOriginAndUnitNormal";
8
10
  import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
11
+ import { Ray3d } from "../geometry3d/Ray3d";
12
+ import { XAndY } from "../geometry3d/XYZProps";
13
+ import { IndexedPolyface } from "../polyface/Polyface";
14
+ import { RuledSweep } from "../solid/RuledSweep";
9
15
  import { Arc3d } from "./Arc3d";
16
+ import { AnyCurve } from "./CurveChain";
10
17
  import { CurveChain } from "./CurveCollection";
11
18
  import { CurvePrimitive } from "./CurvePrimitive";
12
19
  import { GeometryQuery } from "./GeometryQuery";
13
20
  import { LineString3d } from "./LineString3d";
14
21
  import { Loop } from "./Loop";
15
22
  import { Path } from "./Path";
16
- import { Angle } from "../geometry3d/Angle";
17
23
  import { IntegratedSpiralTypeName } from "./spiral/TransitionSpiral3d";
18
- import { XAndY } from "../geometry3d/XYZProps";
19
- import { Ray3d } from "../geometry3d/Ray3d";
24
+ import { StrokeOptions } from "./StrokeOptions";
25
+ /**
26
+ * Interface to carry parallel arrays of planes and sections, and optional geometry assembled from them, as returned by [CurveFactory.createMiteredSweepSections].
27
+ * @public
28
+ */
29
+ export interface SectionSequenceWithPlanes {
30
+ /** the plane of each section */
31
+ planes: Plane3dByOriginAndUnitNormal[];
32
+ /** section curve projected onto the corresponding plane */
33
+ sections: AnyCurve[];
34
+ /**
35
+ * Optional `RuledSweep` generated from the sections.
36
+ * * The `RuledSweep` and sections array refer to the same section objects.
37
+ */
38
+ ruledSweep?: RuledSweep;
39
+ /** Optional mesh generated from the `RuledSweep` generated from the sections. */
40
+ mesh?: IndexedPolyface;
41
+ }
42
+ /**
43
+ * Enumeration of geometric output for [CurveFactory.createMiteredSweepSections].
44
+ * @public
45
+ */
46
+ export declare enum MiteredSweepOutputSelect {
47
+ /** Output only the parallel arrays of planes and sections. */
48
+ Sections = 0,
49
+ /** Output planes and sections, as well as the assembled ruled sweep. */
50
+ AlsoRuledSweep = 1,
51
+ /** Output planes and sections, as well as the assembled ruled sweep and its stroked mesh. */
52
+ AlsoMesh = 2
53
+ }
54
+ /**
55
+ * Interface bundling options for [CurveFactory.createMiteredSweepSections].
56
+ * @public
57
+ */
58
+ export interface MiteredSweepOptions {
59
+ /** Whether first and last planes are averaged and equated when the centerline is physically closed. Default value is `false`. */
60
+ wrapIfPhysicallyClosed?: boolean;
61
+ /** Whether to output sections only, or sections plus optional geometry constructed from them. Default value is `MiteredSweepOutputSelect.Sections`. */
62
+ outputSelect?: MiteredSweepOutputSelect;
63
+ /** How to stroke the ruled sweep if outputting a mesh. If undefined, default stroke options are used. */
64
+ strokeOptions?: StrokeOptions;
65
+ /** Whether to cap the ruled sweep if outputting a ruled sweep or mesh. Default value is `false`. */
66
+ capped?: boolean;
67
+ }
20
68
  /**
21
69
  * The `CurveFactory` class contains methods for specialized curve constructions.
22
70
  * @public
@@ -83,6 +131,22 @@ export declare class CurveFactory {
83
131
  * @param sectionData circle radius, ellipse semi-axis lengths, or full Arc3d
84
132
  */
85
133
  static createMiteredPipeSections(centerline: IndexedXYZCollection, sectionData: number | XAndY | Arc3d): Arc3d[];
134
+ /**
135
+ * Sweep the initialSection along each segment of the centerLine until it hits the bisector plane at the next vertex.
136
+ * * The caller should place the initialSection on a plane perpendicular to the first edge.
137
+ * * This plane is commonly (but not necessarily) through the start point itself.
138
+ * * If the geometry is not "on a perpendicular plane", the output geometry will still be flattened onto the various planes.
139
+ * * In the "open path" case (i.e when wrapIfPhysicallyClosed is false or the path does not have matched first and last points)
140
+ * the first/last output plane will be at the start/end of the first/last edge and on a perpendicular plane.
141
+ * * In the "closed path" case, the output plane for the first and last point is the bisector of the start and end planes from the "open path" case,
142
+ * and the first/last section geometry may be different from `initialSection`.
143
+ * * The centerline path does NOT have to be planar, however twisting effects effects will appear in the various bisector planes.
144
+ * @param centerline sweep path, e.g., as stroked from a smooth centerline curve
145
+ * @param initialSection profile curve to be swept. As noted above, this should be on a plane perpendicular to the first segment of the centerline.
146
+ * @param options options for computation and output
147
+ * @return array of sections, starting with `initialSection` projected along the first edge to the first plane.
148
+ */
149
+ static createMiteredSweepSections(centerline: IndexedXYZCollection | Point3d[], initialSection: AnyCurve, options: MiteredSweepOptions): SectionSequenceWithPlanes | undefined;
86
150
  /**
87
151
  * Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep
88
152
  * * The vector from start point to center is in the direction of upVector crossed with tangentA.
@@ -1 +1 @@
1
- {"version":3,"file":"CurveFactory.d.ts","sourceRoot":"","sources":["../../../src/curve/CurveFactory.ts"],"names":[],"mappings":"AAKA;;GAEG;AAIH,OAAO,EAAkC,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAG1E,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAIlE,OAAO,EAAE,KAAK,EAAgB,MAAM,SAAS,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OA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AO,EACf,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAChB,aAAa,EAAE,GAAG,SAAS;IAoD9B;;;;;OAKG;WACW,yBAAyB,CACrC,MAAM,EAAE,sBAAsB,EAAE,MAAM,EAAE,sBAAsB,GAAG,KAAK,GAAG,SAAS;CAuBrF"}
@@ -7,12 +7,20 @@
7
7
  */
8
8
  // import { Geometry, Angle, AngleSweep } from "../Geometry";
9
9
  import { AxisIndex, AxisOrder, Geometry } from "../Geometry";
10
+ import { Angle } from "../geometry3d/Angle";
10
11
  import { AngleSweep } from "../geometry3d/AngleSweep";
11
12
  import { Matrix3d } from "../geometry3d/Matrix3d";
13
+ import { Vector2d } from "../geometry3d/Point2dVector2d";
12
14
  import { Point3dArrayCarrier } from "../geometry3d/Point3dArrayCarrier";
13
15
  import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
16
+ import { PolylineOps } from "../geometry3d/PolylineOps";
17
+ import { Ray3d } from "../geometry3d/Ray3d";
18
+ import { Segment1d } from "../geometry3d/Segment1d";
19
+ import { Transform } from "../geometry3d/Transform";
20
+ import { SmallSystem } from "../numerics/Polynomials";
14
21
  import { PolyfaceBuilder } from "../polyface/PolyfaceBuilder";
15
22
  import { Cone } from "../solid/Cone";
23
+ import { RuledSweep } from "../solid/RuledSweep";
16
24
  import { TorusPipe } from "../solid/TorusPipe";
17
25
  import { Arc3d } from "./Arc3d";
18
26
  import { CurveChain } from "./CurveCollection";
@@ -22,13 +30,20 @@ import { LineSegment3d } from "./LineSegment3d";
22
30
  import { LineString3d } from "./LineString3d";
23
31
  import { Loop } from "./Loop";
24
32
  import { Path } from "./Path";
25
- import { Angle } from "../geometry3d/Angle";
26
- import { Transform } from "../geometry3d/Transform";
27
33
  import { IntegratedSpiral3d } from "./spiral/IntegratedSpiral3d";
28
- import { Segment1d } from "../geometry3d/Segment1d";
29
- import { SmallSystem } from "../numerics/Polynomials";
30
- import { Vector2d } from "../geometry3d/Point2dVector2d";
31
- import { Ray3d } from "../geometry3d/Ray3d";
34
+ /**
35
+ * Enumeration of geometric output for [CurveFactory.createMiteredSweepSections].
36
+ * @public
37
+ */
38
+ export var MiteredSweepOutputSelect;
39
+ (function (MiteredSweepOutputSelect) {
40
+ /** Output only the parallel arrays of planes and sections. */
41
+ MiteredSweepOutputSelect[MiteredSweepOutputSelect["Sections"] = 0] = "Sections";
42
+ /** Output planes and sections, as well as the assembled ruled sweep. */
43
+ MiteredSweepOutputSelect[MiteredSweepOutputSelect["AlsoRuledSweep"] = 1] = "AlsoRuledSweep";
44
+ /** Output planes and sections, as well as the assembled ruled sweep and its stroked mesh. */
45
+ MiteredSweepOutputSelect[MiteredSweepOutputSelect["AlsoMesh"] = 2] = "AlsoMesh";
46
+ })(MiteredSweepOutputSelect || (MiteredSweepOutputSelect = {}));
32
47
  /**
33
48
  * The `CurveFactory` class contains methods for specialized curve constructions.
34
49
  * @public
@@ -331,6 +346,59 @@ export class CurveFactory {
331
346
  }
332
347
  return arcs;
333
348
  }
349
+ /**
350
+ * Sweep the initialSection along each segment of the centerLine until it hits the bisector plane at the next vertex.
351
+ * * The caller should place the initialSection on a plane perpendicular to the first edge.
352
+ * * This plane is commonly (but not necessarily) through the start point itself.
353
+ * * If the geometry is not "on a perpendicular plane", the output geometry will still be flattened onto the various planes.
354
+ * * In the "open path" case (i.e when wrapIfPhysicallyClosed is false or the path does not have matched first and last points)
355
+ * the first/last output plane will be at the start/end of the first/last edge and on a perpendicular plane.
356
+ * * In the "closed path" case, the output plane for the first and last point is the bisector of the start and end planes from the "open path" case,
357
+ * and the first/last section geometry may be different from `initialSection`.
358
+ * * The centerline path does NOT have to be planar, however twisting effects effects will appear in the various bisector planes.
359
+ * @param centerline sweep path, e.g., as stroked from a smooth centerline curve
360
+ * @param initialSection profile curve to be swept. As noted above, this should be on a plane perpendicular to the first segment of the centerline.
361
+ * @param options options for computation and output
362
+ * @return array of sections, starting with `initialSection` projected along the first edge to the first plane.
363
+ */
364
+ static createMiteredSweepSections(centerline, initialSection, options) {
365
+ const sectionData = { sections: [], planes: [] };
366
+ const planes = PolylineOps.createBisectorPlanesForDistinctPoints(centerline, options.wrapIfPhysicallyClosed);
367
+ if (planes !== undefined && planes.length > 1) {
368
+ // Projection to target plane, constructing sweep direction from two given planes.
369
+ // If successful, push the target plane and swept section to the output arrays and return the swept section.
370
+ // If unsuccessful, leave the output arrays alone and return the input section.
371
+ const doSweepToPlane = function (edgePlane0, edgePlane1, targetPlane, section) {
372
+ const sweepVector = Vector3d.createStartEnd(edgePlane0.getOriginRef(), edgePlane1.getOriginRef());
373
+ const transform = Transform.createFlattenAlongVectorToPlane(sweepVector, targetPlane.getOriginRef(), targetPlane.getNormalRef());
374
+ if (transform === undefined)
375
+ return section;
376
+ const section1 = section.cloneTransformed(transform);
377
+ if (section1 === undefined)
378
+ return section;
379
+ sectionData.planes.push(targetPlane);
380
+ sectionData.sections.push(section1);
381
+ return section1;
382
+ };
383
+ let currentSection = doSweepToPlane(planes[0], planes[1], planes[0], initialSection);
384
+ for (let i = 1; i < planes.length; i++) {
385
+ currentSection = doSweepToPlane(planes[i - 1], planes[i], planes[i], currentSection);
386
+ }
387
+ if (options.outputSelect) {
388
+ const ruledSweep = RuledSweep.create(sectionData.sections, options.capped ?? false);
389
+ if (ruledSweep) {
390
+ sectionData.ruledSweep = ruledSweep;
391
+ if (MiteredSweepOutputSelect.AlsoMesh === options.outputSelect) {
392
+ const builder = PolyfaceBuilder.create(options.strokeOptions);
393
+ builder.addRuledSweep(ruledSweep);
394
+ sectionData.mesh = builder.claimPolyface();
395
+ }
396
+ }
397
+ }
398
+ return sectionData;
399
+ }
400
+ return undefined;
401
+ }
334
402
  /**
335
403
  * Create a circular arc from start point, tangent at start, radius, optional plane normal, arc sweep
336
404
  * * The vector from start point to center is in the direction of upVector crossed with tangentA.