@itwin/core-geometry 4.2.0-dev.3 → 4.2.0-dev.30

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 (336) hide show
  1. package/CHANGELOG.md +59 -1
  2. package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts +4 -3
  3. package/lib/cjs/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
  4. package/lib/cjs/clipping/AlternatingConvexClipTree.js +1 -1
  5. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  6. package/lib/cjs/clipping/BooleanClipNode.d.ts +4 -3
  7. package/lib/cjs/clipping/BooleanClipNode.d.ts.map +1 -1
  8. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  9. package/lib/cjs/clipping/ClipPlane.d.ts +12 -8
  10. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  11. package/lib/cjs/clipping/ClipPlane.js +5 -3
  12. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  13. package/lib/cjs/clipping/ClipUtils.d.ts +20 -8
  14. package/lib/cjs/clipping/ClipUtils.d.ts.map +1 -1
  15. package/lib/cjs/clipping/ClipUtils.js +77 -2
  16. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  17. package/lib/cjs/clipping/ClipVector.d.ts +6 -5
  18. package/lib/cjs/clipping/ClipVector.d.ts.map +1 -1
  19. package/lib/cjs/clipping/ClipVector.js +1 -1
  20. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  21. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts +6 -4
  22. package/lib/cjs/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  23. package/lib/cjs/clipping/ConvexClipPlaneSet.js +3 -2
  24. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  25. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts +4 -3
  26. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  27. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +2 -2
  28. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  29. package/lib/cjs/core-geometry.d.ts +1 -3
  30. package/lib/cjs/core-geometry.d.ts.map +1 -1
  31. package/lib/cjs/core-geometry.js +1 -3
  32. package/lib/cjs/core-geometry.js.map +1 -1
  33. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  34. package/lib/cjs/curve/Arc3d.js +4 -4
  35. package/lib/cjs/curve/Arc3d.js.map +1 -1
  36. package/lib/cjs/curve/CoordinateXYZ.d.ts +15 -15
  37. package/lib/cjs/curve/CoordinateXYZ.d.ts.map +1 -1
  38. package/lib/cjs/curve/CoordinateXYZ.js +15 -15
  39. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  40. package/lib/cjs/curve/CurveCollection.d.ts +4 -17
  41. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  42. package/lib/cjs/curve/CurveCollection.js +3 -22
  43. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  44. package/lib/cjs/curve/CurveCurve.d.ts +41 -26
  45. package/lib/cjs/curve/CurveCurve.d.ts.map +1 -1
  46. package/lib/cjs/curve/CurveCurve.js +73 -40
  47. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  48. package/lib/cjs/curve/CurveFactory.d.ts +1 -1
  49. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  50. package/lib/cjs/curve/CurveLocationDetail.d.ts +12 -1
  51. package/lib/cjs/curve/CurveLocationDetail.d.ts.map +1 -1
  52. package/lib/cjs/curve/CurveLocationDetail.js +13 -2
  53. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  54. package/lib/cjs/curve/CurveOps.d.ts +1 -1
  55. package/lib/cjs/curve/CurveOps.js.map +1 -1
  56. package/lib/cjs/curve/CurveProcessor.d.ts +1 -1
  57. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  58. package/lib/cjs/curve/CurveTypes.d.ts +19 -0
  59. package/lib/cjs/curve/CurveTypes.d.ts.map +1 -0
  60. package/lib/cjs/curve/{CurveChain.js → CurveTypes.js} +1 -1
  61. package/lib/cjs/curve/CurveTypes.js.map +1 -0
  62. package/lib/cjs/curve/CurveWireMomentsXYZ.d.ts +1 -1
  63. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  64. package/lib/cjs/curve/ParityRegion.d.ts +1 -1
  65. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  66. package/lib/cjs/curve/Path.d.ts +1 -1
  67. package/lib/cjs/curve/Path.d.ts.map +1 -1
  68. package/lib/cjs/curve/Path.js +1 -1
  69. package/lib/cjs/curve/Path.js.map +1 -1
  70. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts +3 -2
  71. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  72. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +2 -2
  73. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  74. package/lib/cjs/curve/Query/CurveSplitContext.d.ts +1 -1
  75. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  76. package/lib/cjs/curve/Query/CylindricalRange.d.ts +1 -1
  77. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  78. package/lib/cjs/curve/Query/InOutTests.d.ts +1 -1
  79. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  80. package/lib/cjs/curve/Query/StrokeCountChain.d.ts +1 -1
  81. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  82. package/lib/cjs/curve/RegionOps.d.ts +16 -2
  83. package/lib/cjs/curve/RegionOps.d.ts.map +1 -1
  84. package/lib/cjs/curve/RegionOps.js +18 -1
  85. package/lib/cjs/curve/RegionOps.js.map +1 -1
  86. package/lib/cjs/curve/RegionOpsClassificationSweeps.d.ts +1 -1
  87. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  88. package/lib/cjs/curve/UnionRegion.d.ts +1 -1
  89. package/lib/cjs/curve/UnionRegion.js +1 -1
  90. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  91. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +225 -0
  92. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -0
  93. package/lib/cjs/curve/{CurveCurveCloseApproachXY.js → internalContexts/CurveCurveCloseApproachXY.js} +249 -189
  94. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -0
  95. package/lib/{esm/curve → cjs/curve/internalContexts}/CurveCurveIntersectXY.d.ts +14 -27
  96. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -0
  97. package/lib/cjs/curve/{CurveCurveIntersectXY.js → internalContexts/CurveCurveIntersectXY.js} +31 -42
  98. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -0
  99. package/lib/cjs/curve/{CurveCurveIntersectXYZ.d.ts → internalContexts/CurveCurveIntersectXYZ.d.ts} +11 -12
  100. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -0
  101. package/lib/cjs/curve/{CurveCurveIntersectXYZ.js → internalContexts/CurveCurveIntersectXYZ.js} +12 -14
  102. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -0
  103. package/lib/cjs/curve/internalContexts/MultiChainCollector.d.ts +1 -1
  104. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  105. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +1 -0
  106. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  107. package/lib/cjs/geometry3d/BarycentricTriangle.js +1 -0
  108. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  109. package/lib/cjs/geometry3d/FrameBuilder.d.ts +57 -36
  110. package/lib/cjs/geometry3d/FrameBuilder.d.ts.map +1 -1
  111. package/lib/cjs/geometry3d/FrameBuilder.js +99 -74
  112. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  113. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +0 -8
  114. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  115. package/lib/cjs/geometry3d/GrowableXYZArray.js +0 -16
  116. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  117. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +4 -4
  118. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  119. package/lib/cjs/geometry3d/IndexedXYZCollection.js +12 -0
  120. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  121. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  122. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  123. package/lib/cjs/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
  124. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  125. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +0 -1
  126. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  127. package/lib/cjs/geometry3d/Point3dVector3d.js +0 -1
  128. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  129. package/lib/cjs/geometry3d/PolygonOps.d.ts +1 -1
  130. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  131. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  132. package/lib/cjs/geometry3d/Ray3d.d.ts +3 -1
  133. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  134. package/lib/cjs/geometry3d/Ray3d.js +4 -3
  135. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  136. package/lib/cjs/geometry3d/ReusableObjectCache.d.ts +2 -1
  137. package/lib/cjs/geometry3d/ReusableObjectCache.d.ts.map +1 -1
  138. package/lib/cjs/geometry3d/ReusableObjectCache.js +1 -1
  139. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  140. package/lib/cjs/geometry3d/SortablePolygon.d.ts +1 -1
  141. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  142. package/lib/cjs/geometry3d/YawPitchRollAngles.js +1 -1
  143. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  144. package/lib/cjs/numerics/Polynomials.d.ts +2 -2
  145. package/lib/cjs/numerics/Polynomials.d.ts.map +1 -1
  146. package/lib/cjs/numerics/Polynomials.js +2 -2
  147. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  148. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +1 -1
  149. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  150. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  151. package/lib/cjs/solid/LinearSweep.d.ts +1 -1
  152. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  153. package/lib/cjs/solid/RotationalSweep.d.ts +1 -1
  154. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  155. package/lib/cjs/solid/RuledSweep.d.ts +1 -1
  156. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  157. package/lib/cjs/solid/SweepContour.d.ts +1 -1
  158. package/lib/cjs/solid/SweepContour.js.map +1 -1
  159. package/lib/esm/clipping/AlternatingConvexClipTree.d.ts +4 -3
  160. package/lib/esm/clipping/AlternatingConvexClipTree.d.ts.map +1 -1
  161. package/lib/esm/clipping/AlternatingConvexClipTree.js +1 -1
  162. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  163. package/lib/esm/clipping/BooleanClipNode.d.ts +4 -3
  164. package/lib/esm/clipping/BooleanClipNode.d.ts.map +1 -1
  165. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  166. package/lib/esm/clipping/ClipPlane.d.ts +12 -8
  167. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  168. package/lib/esm/clipping/ClipPlane.js +5 -3
  169. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  170. package/lib/esm/clipping/ClipUtils.d.ts +20 -8
  171. package/lib/esm/clipping/ClipUtils.d.ts.map +1 -1
  172. package/lib/esm/clipping/ClipUtils.js +77 -2
  173. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  174. package/lib/esm/clipping/ClipVector.d.ts +6 -5
  175. package/lib/esm/clipping/ClipVector.d.ts.map +1 -1
  176. package/lib/esm/clipping/ClipVector.js +1 -1
  177. package/lib/esm/clipping/ClipVector.js.map +1 -1
  178. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts +6 -4
  179. package/lib/esm/clipping/ConvexClipPlaneSet.d.ts.map +1 -1
  180. package/lib/esm/clipping/ConvexClipPlaneSet.js +3 -2
  181. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  182. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts +4 -3
  183. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.d.ts.map +1 -1
  184. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +2 -2
  185. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  186. package/lib/esm/core-geometry.d.ts +1 -3
  187. package/lib/esm/core-geometry.d.ts.map +1 -1
  188. package/lib/esm/core-geometry.js +1 -3
  189. package/lib/esm/core-geometry.js.map +1 -1
  190. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  191. package/lib/esm/curve/Arc3d.js +4 -4
  192. package/lib/esm/curve/Arc3d.js.map +1 -1
  193. package/lib/esm/curve/CoordinateXYZ.d.ts +15 -15
  194. package/lib/esm/curve/CoordinateXYZ.d.ts.map +1 -1
  195. package/lib/esm/curve/CoordinateXYZ.js +15 -15
  196. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  197. package/lib/esm/curve/CurveCollection.d.ts +4 -17
  198. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  199. package/lib/esm/curve/CurveCollection.js +2 -20
  200. package/lib/esm/curve/CurveCollection.js.map +1 -1
  201. package/lib/esm/curve/CurveCurve.d.ts +41 -26
  202. package/lib/esm/curve/CurveCurve.d.ts.map +1 -1
  203. package/lib/esm/curve/CurveCurve.js +73 -40
  204. package/lib/esm/curve/CurveCurve.js.map +1 -1
  205. package/lib/esm/curve/CurveFactory.d.ts +1 -1
  206. package/lib/esm/curve/CurveFactory.js.map +1 -1
  207. package/lib/esm/curve/CurveLocationDetail.d.ts +12 -1
  208. package/lib/esm/curve/CurveLocationDetail.d.ts.map +1 -1
  209. package/lib/esm/curve/CurveLocationDetail.js +11 -1
  210. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  211. package/lib/esm/curve/CurveOps.d.ts +1 -1
  212. package/lib/esm/curve/CurveOps.js.map +1 -1
  213. package/lib/esm/curve/CurveProcessor.d.ts +1 -1
  214. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  215. package/lib/esm/curve/CurveTypes.d.ts +19 -0
  216. package/lib/esm/curve/CurveTypes.d.ts.map +1 -0
  217. package/lib/esm/curve/{CurveChain.js → CurveTypes.js} +1 -1
  218. package/lib/esm/curve/CurveTypes.js.map +1 -0
  219. package/lib/esm/curve/CurveWireMomentsXYZ.d.ts +1 -1
  220. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  221. package/lib/esm/curve/ParityRegion.d.ts +1 -1
  222. package/lib/esm/curve/ParityRegion.js.map +1 -1
  223. package/lib/esm/curve/Path.d.ts +1 -1
  224. package/lib/esm/curve/Path.d.ts.map +1 -1
  225. package/lib/esm/curve/Path.js +1 -1
  226. package/lib/esm/curve/Path.js.map +1 -1
  227. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts +3 -2
  228. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.d.ts.map +1 -1
  229. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +1 -1
  230. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  231. package/lib/esm/curve/Query/CurveSplitContext.d.ts +1 -1
  232. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  233. package/lib/esm/curve/Query/CylindricalRange.d.ts +1 -1
  234. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  235. package/lib/esm/curve/Query/InOutTests.d.ts +1 -1
  236. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  237. package/lib/esm/curve/Query/StrokeCountChain.d.ts +1 -1
  238. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  239. package/lib/esm/curve/RegionOps.d.ts +16 -2
  240. package/lib/esm/curve/RegionOps.d.ts.map +1 -1
  241. package/lib/esm/curve/RegionOps.js +16 -0
  242. package/lib/esm/curve/RegionOps.js.map +1 -1
  243. package/lib/esm/curve/RegionOpsClassificationSweeps.d.ts +1 -1
  244. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  245. package/lib/esm/curve/UnionRegion.d.ts +1 -1
  246. package/lib/esm/curve/UnionRegion.js +1 -1
  247. package/lib/esm/curve/UnionRegion.js.map +1 -1
  248. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts +225 -0
  249. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.d.ts.map +1 -0
  250. package/lib/esm/curve/{CurveCurveCloseApproachXY.js → internalContexts/CurveCurveCloseApproachXY.js} +249 -189
  251. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -0
  252. package/lib/{cjs/curve → esm/curve/internalContexts}/CurveCurveIntersectXY.d.ts +14 -27
  253. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.d.ts.map +1 -0
  254. package/lib/esm/curve/{CurveCurveIntersectXY.js → internalContexts/CurveCurveIntersectXY.js} +30 -40
  255. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -0
  256. package/lib/esm/curve/{CurveCurveIntersectXYZ.d.ts → internalContexts/CurveCurveIntersectXYZ.d.ts} +11 -12
  257. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.d.ts.map +1 -0
  258. package/lib/esm/curve/{CurveCurveIntersectXYZ.js → internalContexts/CurveCurveIntersectXYZ.js} +11 -13
  259. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -0
  260. package/lib/esm/curve/internalContexts/MultiChainCollector.d.ts +1 -1
  261. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  262. package/lib/esm/geometry3d/BarycentricTriangle.d.ts +1 -0
  263. package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  264. package/lib/esm/geometry3d/BarycentricTriangle.js +1 -0
  265. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  266. package/lib/esm/geometry3d/FrameBuilder.d.ts +57 -36
  267. package/lib/esm/geometry3d/FrameBuilder.d.ts.map +1 -1
  268. package/lib/esm/geometry3d/FrameBuilder.js +99 -74
  269. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  270. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +0 -8
  271. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  272. package/lib/esm/geometry3d/GrowableXYZArray.js +0 -16
  273. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  274. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +4 -4
  275. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  276. package/lib/esm/geometry3d/IndexedXYZCollection.js +12 -0
  277. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  278. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  279. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  280. package/lib/esm/geometry3d/Point3dArrayCarrier.d.ts.map +1 -1
  281. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  282. package/lib/esm/geometry3d/Point3dVector3d.d.ts +0 -1
  283. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  284. package/lib/esm/geometry3d/Point3dVector3d.js +0 -1
  285. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  286. package/lib/esm/geometry3d/PolygonOps.d.ts +1 -1
  287. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  288. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  289. package/lib/esm/geometry3d/Ray3d.d.ts +3 -1
  290. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  291. package/lib/esm/geometry3d/Ray3d.js +4 -3
  292. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  293. package/lib/esm/geometry3d/ReusableObjectCache.d.ts +2 -1
  294. package/lib/esm/geometry3d/ReusableObjectCache.d.ts.map +1 -1
  295. package/lib/esm/geometry3d/ReusableObjectCache.js +1 -1
  296. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  297. package/lib/esm/geometry3d/SortablePolygon.d.ts +1 -1
  298. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  299. package/lib/esm/geometry3d/YawPitchRollAngles.js +1 -1
  300. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  301. package/lib/esm/numerics/Polynomials.d.ts +2 -2
  302. package/lib/esm/numerics/Polynomials.d.ts.map +1 -1
  303. package/lib/esm/numerics/Polynomials.js +2 -2
  304. package/lib/esm/numerics/Polynomials.js.map +1 -1
  305. package/lib/esm/polyface/PolyfaceBuilder.d.ts +1 -1
  306. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  307. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  308. package/lib/esm/solid/LinearSweep.d.ts +1 -1
  309. package/lib/esm/solid/LinearSweep.js.map +1 -1
  310. package/lib/esm/solid/RotationalSweep.d.ts +1 -1
  311. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  312. package/lib/esm/solid/RuledSweep.d.ts +1 -1
  313. package/lib/esm/solid/RuledSweep.js.map +1 -1
  314. package/lib/esm/solid/SweepContour.d.ts +1 -1
  315. package/lib/esm/solid/SweepContour.js.map +1 -1
  316. package/package.json +3 -3
  317. package/lib/cjs/curve/CurveChain.d.ts +0 -17
  318. package/lib/cjs/curve/CurveChain.d.ts.map +0 -1
  319. package/lib/cjs/curve/CurveChain.js.map +0 -1
  320. package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts +0 -164
  321. package/lib/cjs/curve/CurveCurveCloseApproachXY.d.ts.map +0 -1
  322. package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +0 -1
  323. package/lib/cjs/curve/CurveCurveIntersectXY.d.ts.map +0 -1
  324. package/lib/cjs/curve/CurveCurveIntersectXY.js.map +0 -1
  325. package/lib/cjs/curve/CurveCurveIntersectXYZ.d.ts.map +0 -1
  326. package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +0 -1
  327. package/lib/esm/curve/CurveChain.d.ts +0 -17
  328. package/lib/esm/curve/CurveChain.d.ts.map +0 -1
  329. package/lib/esm/curve/CurveChain.js.map +0 -1
  330. package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts +0 -164
  331. package/lib/esm/curve/CurveCurveCloseApproachXY.d.ts.map +0 -1
  332. package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +0 -1
  333. package/lib/esm/curve/CurveCurveIntersectXY.d.ts.map +0 -1
  334. package/lib/esm/curve/CurveCurveIntersectXY.js.map +0 -1
  335. package/lib/esm/curve/CurveCurveIntersectXYZ.d.ts.map +0 -1
  336. package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +0 -1
@@ -13,7 +13,6 @@ import { CurveCollection } from "../curve/CurveCollection";
13
13
  import { CurvePrimitive } from "../curve/CurvePrimitive";
14
14
  import { LineSegment3d } from "../curve/LineSegment3d";
15
15
  import { LineString3d } from "../curve/LineString3d";
16
- /* eslint-disable @typescript-eslint/naming-convention, no-empty */
17
16
  import { AxisOrder, AxisScaleSelect, Geometry } from "../Geometry";
18
17
  import { GrowableXYZArray } from "./GrowableXYZArray";
19
18
  import { Matrix3d } from "./Matrix3d";
@@ -21,6 +20,7 @@ import { Point3d, Vector3d } from "./Point3dVector3d";
21
20
  import { Point3dArray } from "./PointHelpers";
22
21
  import { PolygonOps } from "./PolygonOps";
23
22
  import { Transform } from "./Transform";
23
+ /* eslint-disable @typescript-eslint/naming-convention, no-empty */
24
24
  /**
25
25
  * Helper class to accumulate points and vectors until there is enough data to define a coordinate system.
26
26
  *
@@ -28,10 +28,10 @@ import { Transform } from "./Transform";
28
28
  * * create the FrameBuilder and make calls to announcePoint and announceVector.
29
29
  * * the frame will be fully determined by an origin and two vectors.
30
30
  * * the first call to announcePoint will set the origin.
31
- * * additional calls to announcePoint will produce announceVector call with the vector from the origin.
32
- * * After each announcement, call getValidatedFrame(false)
31
+ * * additional calls to announcePoint will produce announceVector call with the vector from the origin.
32
+ * * after each announcement, call getValidatedFrame(false)
33
33
  * * getValidatedFrame will succeed when it has two independent vectors.
34
- * * to build a left handed frame,
34
+ * * To build a left handed frame,
35
35
  * * an origin and 3 independent vectors are required.
36
36
  * * announce as above, but query with getValidatedFrame (true).
37
37
  * * this will use the third vector to select right or left handed frame.
@@ -46,29 +46,39 @@ export class FrameBuilder {
46
46
  }
47
47
  return false;
48
48
  }
49
- /** clear all accumulated point and vector data */
50
- clear() { this._origin = undefined; this._vector0 = undefined; this._vector1 = undefined; this._vector2 = undefined; }
51
- constructor() { this.clear(); }
52
- /** Try to assemble the data into a non-singular transform.
53
- *
49
+ /** Clear all accumulated point and vector data */
50
+ clear() {
51
+ this._origin = undefined;
52
+ this._vector0 = undefined;
53
+ this._vector1 = undefined;
54
+ this._vector2 = undefined;
55
+ }
56
+ constructor() {
57
+ this.clear();
58
+ }
59
+ /**
60
+ * Try to assemble the data into a non-singular transform.
54
61
  * * If allowLeftHanded is false, vector0 and vector1 determine a right handed coordinate system.
55
62
  * * if allowLeftHanded is true, the z vector of the right handed system can be flipped to agree with vector2 direction.
56
63
  */
57
- getValidatedFrame(allowLeftHanded = false) {
64
+ getValidatedFrame(allowLeftHanded = false, result) {
58
65
  if (this._origin && this._vector0 && this._vector1) {
66
+ const createRigidMatrix = (v0, v1) => {
67
+ return FrameBuilder._workMatrix = Matrix3d.createRigidFromColumns(v0, v1, AxisOrder.XYZ, FrameBuilder._workMatrix);
68
+ };
59
69
  if (!allowLeftHanded) {
60
- const matrix = Matrix3d.createRigidFromColumns(this._vector0, this._vector1, AxisOrder.XYZ);
70
+ const matrix = createRigidMatrix(this._vector0, this._vector1);
61
71
  if (matrix)
62
- return Transform.createOriginAndMatrix(this._origin, matrix);
72
+ return Transform.createOriginAndMatrix(this._origin, matrix, result);
63
73
  // uh oh -- vector1 was not really independent. clear everything after vector0.
64
74
  this._vector1 = this._vector2 = undefined;
65
75
  }
66
76
  else if (this._vector2) {
67
- const matrix = Matrix3d.createRigidFromColumns(this._vector0, this._vector1, AxisOrder.XYZ);
77
+ const matrix = createRigidMatrix(this._vector0, this._vector1);
68
78
  if (matrix) {
69
79
  if (this._vector0.tripleProduct(this._vector1, this._vector2) < 0)
70
80
  matrix.scaleColumns(1.0, 1.0, -1.0);
71
- return Transform.createOriginAndMatrix(this._origin, matrix);
81
+ return Transform.createOriginAndMatrix(this._origin, matrix, result);
72
82
  }
73
83
  // uh oh again -- clear vector1 and vector2, re-announce vector2 as possible vector1??
74
84
  const vector2 = this._vector2;
@@ -85,8 +95,11 @@ export class FrameBuilder {
85
95
  }
86
96
  }
87
97
  /** Ask if there is a defined origin for the evolving frame */
88
- get hasOrigin() { return this._origin !== undefined; }
89
- /** Return the number of vectors saved. Because the save process checks numerics, this should be the rank of the system.
98
+ get hasOrigin() {
99
+ return this._origin !== undefined;
100
+ }
101
+ /**
102
+ * Return the number of vectors saved. Because the save process checks numerics, this should be the rank of the system.
90
103
  */
91
104
  savedVectorCount() {
92
105
  if (!this._vector0)
@@ -97,7 +110,9 @@ export class FrameBuilder {
97
110
  return 2;
98
111
  return 3;
99
112
  }
100
- /** announce a new point. If this point is different from the origin, also compute and announce the vector from the origin.*/
113
+ /**
114
+ * Announce a new point. If this point is different from the origin, also compute and announce the vector from the origin.
115
+ */
101
116
  announcePoint(point) {
102
117
  if (!this._origin) {
103
118
  this._origin = point.clone();
@@ -108,7 +123,7 @@ export class FrameBuilder {
108
123
  return this.savedVectorCount();
109
124
  return this.announceVector(this._origin.vectorTo(point));
110
125
  }
111
- /** announce a new vector. */
126
+ /** Announce a new vector. */
112
127
  announceVector(vector) {
113
128
  if (vector.isAlmostZero)
114
129
  return this.savedVectorCount();
@@ -135,12 +150,15 @@ export class FrameBuilder {
135
150
  // fall through if prior vectors are all there -- no need for the new one.
136
151
  return 3;
137
152
  }
138
- /** Inspect the content of the data. Announce points and vectors. Return when savedVectorCount becomes
139
- * sufficient for a coordinate system.
153
+ /**
154
+ * Inspect the content of the data. Announce points and vectors. Return when savedVectorCount becomes sufficient
155
+ * for a coordinate system.
140
156
  */
141
157
  announce(data) {
142
158
  if (this.savedVectorCount() > 1)
143
159
  return;
160
+ if (data === undefined)
161
+ return;
144
162
  if (data instanceof Point3d)
145
163
  this.announcePoint(data);
146
164
  else if (data instanceof Vector3d)
@@ -217,108 +235,113 @@ export class FrameBuilder {
217
235
  }
218
236
  }
219
237
  }
220
- /** create a localToWorld frame for the given data.
221
- *
222
- * * origin is at first point
223
- * * x axis in direction of first nonzero vector present or implied by the input.
224
- * * y axis is perpendicular to x and contains (in positive side) the next vector present or implied by the input.
238
+ /**
239
+ * Create a localToWorld frame for the given data.
240
+ * * origin is at first point.
241
+ * * x axis in direction of first nonzero vector present or implied by the input.
242
+ * * y axis is perpendicular to x and contains (in positive side) the next vector present or implied by the input.
243
+ * * The calculation favors the first points found. It does not try to get a "best" plane.
244
+ * @param defaultUpVector optional vector to cross with vector0 to create vector1 when it is unknown
245
+ * @param params any number of geometric objects to examine in [[announce]] for point/vector data sufficient to construct a frame.
246
+ * If the last argument is a `Transform`, it is populated with the computed frame and returned.
247
+ * @returns computed localToWorld frame, or undefined if insufficient data.
225
248
  */
226
249
  static createRightHandedFrame(defaultUpVector, ...params) {
250
+ // if last arg is a Transform, remove it from the array and use for the return value
251
+ let frame = (params.length > 0 && params[params.length - 1] instanceof Transform) ? params.pop() : undefined;
227
252
  const builder = new FrameBuilder();
228
253
  for (const data of params) {
229
254
  builder.announce(data);
230
255
  builder.applyDefaultUpVector(defaultUpVector);
231
- const result = builder.getValidatedFrame(false);
232
- if (result !== undefined) {
256
+ if (frame = builder.getValidatedFrame(false, frame)) {
233
257
  if (defaultUpVector) {
234
- if (result.matrix.dotColumnZ(defaultUpVector) < 0.0)
235
- result.matrix.scaleColumnsInPlace(1, -1, -1);
258
+ if (frame.matrix.dotColumnZ(defaultUpVector) < 0.0)
259
+ frame.matrix.scaleColumnsInPlace(1, -1, -1);
236
260
  }
237
- return result;
261
+ return frame;
238
262
  }
239
263
  }
240
- const evaluatePrimitiveFrame = (curve) => {
241
- return curve.fractionToFrenetFrame(0.0);
264
+ const evaluatePrimitiveFrame = (curve, result) => {
265
+ return curve.fractionToFrenetFrame(0.0, result);
242
266
  };
243
267
  // try direct evaluation of curve primitives using the above lambda
244
268
  for (const data of params) {
245
269
  if (data instanceof CurvePrimitive) {
246
- return evaluatePrimitiveFrame(data);
270
+ return evaluatePrimitiveFrame(data, frame);
247
271
  }
248
272
  else if (data instanceof CurveCollection) {
249
273
  const children = data.collectCurvePrimitives();
250
274
  for (const curve of children) {
251
- const frenetFrame = evaluatePrimitiveFrame(curve);
252
- if (frenetFrame)
253
- return frenetFrame;
275
+ if (frame = evaluatePrimitiveFrame(curve, frame))
276
+ return frame;
254
277
  }
255
278
  }
256
279
  }
257
280
  return undefined;
258
281
  }
259
- /** create a transform containing points or vectors in the given data.
282
+ /**
283
+ * Create a transform containing points or vectors in the given data.
260
284
  * * The xy columns of the transform contain the first points or vectors of the data.
261
285
  * * The z column is perpendicular to that xy plane.
262
- * * The calculation favors the first points found. It does not try to get a "best" plane.
286
+ * * The calculation favors the first points found. It does not try to get a "best" plane.
287
+ * @param params any number of geometric objects to examine in [[announce]] for point/vector data sufficient to construct a frame.
288
+ * If the last argument is a `Transform`, it is populated with the computed frame and returned.
289
+ * @returns computed localToWorld frame, or undefined if insufficient data.
263
290
  */
264
291
  static createRightHandedLocalToWorld(...params) {
265
- const builder = new FrameBuilder();
266
- for (const data of params) {
267
- builder.announce(data);
268
- const localToWorld = builder.getValidatedFrame(false);
269
- if (localToWorld !== undefined)
270
- return localToWorld;
271
- }
272
- return undefined;
292
+ return this.createRightHandedFrame(undefined, params);
273
293
  }
274
294
  /**
275
- * try to create a frame whose xy plane is through points.
276
- *
277
- * * if 3 or more distinct points are present, the x axis is from the first point to the most distance, and y direction is toward the
278
- * point most distant from that line.
295
+ * Try to create a frame whose xy plane is through points.
296
+ * * If 3 or more distinct points are present, the x axis is from the first point to the most distant, and y
297
+ * direction is toward the point most distant from that line.
279
298
  * @param points array of points
299
+ * @param result optional pre-allocated Transform to populate and return
300
+ * @returns localToWorld frame for the points, or undefined if insufficient data
280
301
  */
281
- static createFrameToDistantPoints(points) {
302
+ static createFrameToDistantPoints(points, result) {
282
303
  if (points.length > 2) {
283
- const origin = points[0].clone();
284
- const vector01 = Vector3d.create();
304
+ const origin = points[0];
305
+ const vector01 = FrameBuilder._workVector0 ?? Vector3d.create();
285
306
  Point3dArray.indexOfMostDistantPoint(points, points[0], vector01);
286
- const vector02 = Vector3d.create();
307
+ const vector02 = FrameBuilder._workVector1 ?? Vector3d.create();
287
308
  Point3dArray.indexOfPointWithMaxCrossProductMagnitude(points, origin, vector01, vector02);
288
- const matrix = Matrix3d.createRigidFromColumns(vector01, vector02, AxisOrder.XYZ);
309
+ const matrix = FrameBuilder._workMatrix = Matrix3d.createRigidFromColumns(vector01, vector02, AxisOrder.XYZ, FrameBuilder._workMatrix);
289
310
  if (matrix)
290
- return Transform.createRefs(origin, matrix);
311
+ return Transform.createOriginAndMatrix(origin, matrix, result);
291
312
  }
292
313
  return undefined;
293
314
  }
294
315
  /**
295
- * try to create a frame whose xy plane is through points, with the points appearing CCW in the local frame.
296
- *
297
- * * if 3 or more distinct points are present, the x axis is from the first point to the most distance, and y direction is toward the
298
- * point most distant from that line.
316
+ * Try to create a frame whose xy plane is through points, with the points appearing CCW in the local frame.
317
+ * * If 3 or more distinct points are present, the x axis is from the first point to the most distant, and y
318
+ * direction is toward the point most distant from that line.
299
319
  * @param points array of points
320
+ * @param result optional pre-allocated Transform to populate and return
321
+ * @returns localToWorld frame for the points, or undefined if insufficient data
300
322
  */
301
- static createFrameWithCCWPolygon(points) {
323
+ static createFrameWithCCWPolygon(points, result) {
302
324
  if (points.length > 2) {
303
- const ray = PolygonOps.centroidAreaNormal(points);
304
- if (ray) {
305
- return ray.toRigidZFrame();
306
- }
325
+ const ray = PolygonOps.centroidAreaNormal(points); // can't pass pre-allocated ray...
326
+ if (ray)
327
+ return ray.toRigidZFrame(result);
307
328
  }
308
329
  return undefined;
309
330
  }
310
331
  /**
311
332
  * Create the localToWorld transform from a range to axes of its parent coordinate system.
312
- * @param range [in] range to inspect
313
- * @param fractionX [in] fractional coordinate of frame origin x
314
- * @param fractionY [in] fractional coordinate of frame origin y
315
- * @param fractionZ [in] fractional coordinate of frame origin z
316
- * @param scaleSelect [in] selects size of localToWorld axes.
317
- * @param defaultAxisLength [in] if true and any axis length is 0, that axis vector takes this physical length.
333
+ * @param range range to inspect
334
+ * @param scaleSelect selects size of localToWorld axes.
335
+ * @param fractionX fractional coordinate of frame origin x
336
+ * @param fractionY fractional coordinate of frame origin y
337
+ * @param fractionZ fractional coordinate of frame origin z
338
+ * @param defaultAxisLength if true and any axis length is 0, that axis vector takes this physical length.
339
+ * @param result optional pre-allocated Transform to populate and return
340
+ * @returns localToWorld frame for the range
318
341
  */
319
- static createLocalToWorldTransformInRange(range, scaleSelect = AxisScaleSelect.NonUniformRangeContainment, fractionX = 0, fractionY = 0, fractionZ = 0, defaultAxisLength = 1.0) {
342
+ static createLocalToWorldTransformInRange(range, scaleSelect = AxisScaleSelect.NonUniformRangeContainment, fractionX = 0, fractionY = 0, fractionZ = 0, defaultAxisLength = 1.0, result) {
320
343
  if (range.isNull)
321
- return Transform.createIdentity();
344
+ return Transform.createIdentity(result);
322
345
  let a = 1.0;
323
346
  let b = 1.0;
324
347
  let c = 1.0;
@@ -330,7 +353,9 @@ export class FrameBuilder {
330
353
  b = Geometry.correctSmallMetricDistance(range.yLength(), defaultAxisLength) * Geometry.maxAbsDiff(fractionY, 0, 1);
331
354
  c = Geometry.correctSmallMetricDistance(range.zLength(), defaultAxisLength) * Geometry.maxAbsDiff(fractionZ, 0, 1);
332
355
  }
333
- return Transform.createRefs(range.fractionToPoint(fractionX, fractionY, fractionZ), Matrix3d.createScale(a, b, c));
356
+ const origin = FrameBuilder._workPoint = range.fractionToPoint(fractionX, fractionY, fractionZ, FrameBuilder._workPoint);
357
+ const matrix = FrameBuilder._workMatrix = Matrix3d.createScale(a, b, c, FrameBuilder._workMatrix);
358
+ return Transform.createOriginAndMatrix(origin, matrix, result);
334
359
  }
335
360
  }
336
361
  //# sourceMappingURL=FrameBuilder.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FrameBuilder.js","sourceRoot":"","sources":["../../../src/geometry3d/FrameBuilder.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,0CAA0C;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,mEAAmE;AACnE,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnE,O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F","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 CartesianGeometry\r\n */\r\n\r\n// import { Point2d } from \"./Geometry2d\";\r\nimport { BSplineCurve3d } from \"../bspline/BSplineCurve\";\r\nimport { InterpolationCurve3d } from \"../bspline/InterpolationCurve3d\";\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\nimport { AxisOrder, AxisScaleSelect, Geometry } from \"../Geometry\";\r\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Point3dArray } from \"./PointHelpers\";\r\nimport { PolygonOps } from \"./PolygonOps\";\r\nimport { Range3d } from \"./Range\";\r\nimport { Transform } from \"./Transform\";\r\n\r\n/**\r\n * Helper class to accumulate points and vectors until there is enough data to define a coordinate system.\r\n *\r\n * * For the common case of building a right handed frame:\r\n * * create the FrameBuilder and make calls to announcePoint and announceVector.\r\n * * the frame will be fully determined by an origin and two vectors.\r\n * * the first call to announcePoint will set the origin.\r\n * * additional calls to announcePoint will produce announceVector call with the vector from the origin.\r\n * * After each announcement, call getValidatedFrame(false)\r\n * * getValidatedFrame will succeed when it has two independent vectors.\r\n * * to build a left handed frame,\r\n * * an origin and 3 independent vectors are required.\r\n * * announce as above, but query with getValidatedFrame (true).\r\n * * this will use the third vector to select right or left handed frame.\r\n * @public\r\n */\r\nexport class FrameBuilder {\r\n private _origin: undefined | Point3d;\r\n private _vector0: undefined | Vector3d;\r\n private _vector1: undefined | Vector3d;\r\n private _vector2: undefined | Vector3d;\r\n // test if both vectors are defined and have significant angle between.\r\n private areStronglyIndependentVectors(vector0: Vector3d, vector1: Vector3d, radiansTolerance: number = Geometry.smallAngleRadians): boolean {\r\n if (vector0 !== undefined && vector1 !== undefined) {\r\n const q = vector0.smallerUnorientedRadiansTo(vector1);\r\n return q > radiansTolerance;\r\n }\r\n return false;\r\n }\r\n /** clear all accumulated point and vector data */\r\n public clear() { this._origin = undefined; this._vector0 = undefined; this._vector1 = undefined; this._vector2 = undefined; }\r\n constructor() { this.clear(); }\r\n /** Try to assemble the data into a non-singular transform.\r\n *\r\n * * If allowLeftHanded is false, vector0 and vector1 determine a right handed coordinate system.\r\n * * if allowLeftHanded is true, the z vector of the right handed system can be flipped to agree with vector2 direction.\r\n */\r\n public getValidatedFrame(allowLeftHanded: boolean = false): Transform | undefined {\r\n if (this._origin && this._vector0 && this._vector1) {\r\n if (!allowLeftHanded) {\r\n const matrix = Matrix3d.createRigidFromColumns(this._vector0, this._vector1, AxisOrder.XYZ);\r\n if (matrix)\r\n return Transform.createOriginAndMatrix(this._origin, matrix);\r\n // uh oh -- vector1 was not really independent. clear everything after vector0.\r\n this._vector1 = this._vector2 = undefined;\r\n } else if (this._vector2) {\r\n const matrix = Matrix3d.createRigidFromColumns(this._vector0, this._vector1, AxisOrder.XYZ);\r\n if (matrix) {\r\n if (this._vector0.tripleProduct(this._vector1, this._vector2) < 0)\r\n matrix.scaleColumns(1.0, 1.0, -1.0);\r\n return Transform.createOriginAndMatrix(this._origin, matrix);\r\n }\r\n // uh oh again -- clear vector1 and vector2, re-announce vector2 as possible vector1??\r\n const vector2 = this._vector2;\r\n this._vector1 = this._vector2 = undefined;\r\n this.announceVector(vector2);\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** If vector0 is known but vector1 is not, make vector1 the cross of the up-vector and vector0 */\r\n public applyDefaultUpVector(vector?: Vector3d) {\r\n if (vector && this._vector0 && !this._vector1 && !vector.isParallelTo(this._vector0)) {\r\n this._vector1 = vector.crossProduct(this._vector0);\r\n }\r\n }\r\n /** Ask if there is a defined origin for the evolving frame */\r\n public get hasOrigin(): boolean { return this._origin !== undefined; }\r\n /** Return the number of vectors saved. Because the save process checks numerics, this should be the rank of the system.\r\n */\r\n public savedVectorCount(): number {\r\n if (!this._vector0)\r\n return 0;\r\n if (!this._vector1)\r\n return 1;\r\n if (!this._vector2)\r\n return 2;\r\n return 3;\r\n }\r\n /** announce a new point. If this point is different from the origin, also compute and announce the vector from the origin.*/\r\n public announcePoint(point: Point3d): number {\r\n if (!this._origin) {\r\n this._origin = point.clone();\r\n return this.savedVectorCount();\r\n }\r\n // the new point may provide an additional vector\r\n if (this._origin.isAlmostEqual(point))\r\n return this.savedVectorCount();\r\n return this.announceVector(this._origin.vectorTo(point));\r\n }\r\n /** announce a new vector. */\r\n public announceVector(vector: Vector3d): number {\r\n if (vector.isAlmostZero)\r\n return this.savedVectorCount();\r\n\r\n if (!this._vector0) { this._vector0 = vector.clone(this._vector0); return 1; }\r\n\r\n if (!this._vector1) {\r\n if (this.areStronglyIndependentVectors(vector, this._vector0, 1.0e-5)) {\r\n this._vector1 = vector.clone(this._vector1);\r\n return 2;\r\n }\r\n return 1;\r\n }\r\n\r\n // vector0 and vector1 are independent.\r\n if (!this._vector2) {\r\n const unitPerpendicular = this._vector0.unitCrossProduct(this._vector1);\r\n if (unitPerpendicular && !Geometry.isSameCoordinate(0, unitPerpendicular.dotProduct(vector))) {\r\n this._vector2 = vector.clone(this._vector2);\r\n return 3;\r\n }\r\n return 2;\r\n }\r\n // fall through if prior vectors are all there -- no need for the new one.\r\n return 3;\r\n }\r\n /** Inspect the content of the data. Announce points and vectors. Return when savedVectorCount becomes\r\n * sufficient for a coordinate system.\r\n */\r\n public announce(data: any) {\r\n if (this.savedVectorCount() > 1) return;\r\n if (data instanceof Point3d)\r\n this.announcePoint(data);\r\n else if (data instanceof Vector3d)\r\n this.announceVector(data);\r\n else if (Array.isArray(data)) {\r\n for (const child of data) {\r\n if (this.savedVectorCount() > 1)\r\n break;\r\n this.announce(child);\r\n }\r\n } else if (data instanceof CurvePrimitive) {\r\n if (data instanceof LineSegment3d) {\r\n this.announcePoint(data.startPoint());\r\n this.announcePoint(data.endPoint());\r\n } else if (data instanceof Arc3d) {\r\n const ray = data.fractionToPointAndDerivative(0.0);\r\n this.announcePoint(ray.origin);\r\n this.announceVector(ray.direction);\r\n this.announceVector(data.matrixRef.columnZCrossVector(ray.direction));\r\n } else if (data instanceof LineString3d) {\r\n for (const point of data.points) {\r\n this.announcePoint(point);\r\n if (this.savedVectorCount() > 1)\r\n break;\r\n }\r\n } else if (data instanceof BSplineCurve3d) {\r\n const point = Point3d.create();\r\n for (let i = 0; this.savedVectorCount() < 2; i++) {\r\n if (data.getPolePoint3d(i, point) instanceof Point3d)\r\n this.announcePoint(point);\r\n else break;\r\n }\r\n } else if (data instanceof InterpolationCurve3d) {\r\n const point = Point3d.create();\r\n for (let i = 0; this.savedVectorCount() < 2; i++) {\r\n if (i < data.options.fitPoints.length) {\r\n point.setFrom(data.options.fitPoints[i]);\r\n this.announcePoint(point);\r\n } else break;\r\n }\r\n } else { // unimplemented CurvePrimitive type\r\n const frame = data.fractionToFrenetFrame(0.0);\r\n if (undefined !== frame) {\r\n this.announcePoint(frame.getOrigin());\r\n this.announceVector(frame.matrix.getColumn(0));\r\n this.announceVector(frame.matrix.getColumn(1));\r\n }\r\n }\r\n } else if (data instanceof CurveCollection) {\r\n if (data.children)\r\n for (const child of data.children) {\r\n this.announce(child);\r\n if (this.savedVectorCount() > 1)\r\n break;\r\n }\r\n } else if (data instanceof GrowableXYZArray) {\r\n const point = Point3d.create();\r\n for (let i = 0; this.savedVectorCount() < 2; i++) {\r\n if (data.getPoint3dAtCheckedPointIndex(i, point) instanceof Point3d)\r\n this.announcePoint(point);\r\n else break;\r\n }\r\n }\r\n }\r\n /** create a localToWorld frame for the given data.\r\n *\r\n * * origin is at first point\r\n * * x axis in direction of first nonzero vector present or implied by the input.\r\n * * y axis is perpendicular to x and contains (in positive side) the next vector present or implied by the input.\r\n */\r\n public static createRightHandedFrame(defaultUpVector: Vector3d | undefined, ...params: any[]): Transform | undefined {\r\n const builder = new FrameBuilder();\r\n for (const data of params) {\r\n builder.announce(data);\r\n builder.applyDefaultUpVector(defaultUpVector);\r\n const result = builder.getValidatedFrame(false);\r\n if (result !== undefined) {\r\n if (defaultUpVector) {\r\n if (result.matrix.dotColumnZ(defaultUpVector) < 0.0)\r\n result.matrix.scaleColumnsInPlace(1, -1, -1);\r\n }\r\n return result;\r\n }\r\n }\r\n\r\n const evaluatePrimitiveFrame = (curve: CurvePrimitive): Transform | undefined => {\r\n return curve.fractionToFrenetFrame(0.0);\r\n };\r\n\r\n // try direct evaluation of curve primitives using the above lambda\r\n for (const data of params) {\r\n if (data instanceof CurvePrimitive) {\r\n return evaluatePrimitiveFrame(data);\r\n } else if (data instanceof CurveCollection) {\r\n const children = data.collectCurvePrimitives();\r\n for (const curve of children) {\r\n const frenetFrame = evaluatePrimitiveFrame(curve);\r\n if (frenetFrame)\r\n return frenetFrame;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** create a transform containing points or vectors in the given data.\r\n * * The xy columns of the transform contain the first points or vectors of the data.\r\n * * The z column is perpendicular to that xy plane.\r\n * * The calculation favors the first points found. It does not try to get a \"best\" plane.\r\n */\r\n public static createRightHandedLocalToWorld(...params: any[]): Transform | undefined {\r\n const builder = new FrameBuilder();\r\n for (const data of params) {\r\n builder.announce(data);\r\n const localToWorld = builder.getValidatedFrame(false);\r\n if (localToWorld !== undefined)\r\n return localToWorld;\r\n }\r\n return undefined;\r\n }\r\n\r\n /**\r\n * try to create a frame whose xy plane is through points.\r\n *\r\n * * if 3 or more distinct points are present, the x axis is from the first point to the most distance, and y direction is toward the\r\n * point most distant from that line.\r\n * @param points array of points\r\n */\r\n public static createFrameToDistantPoints(points: Point3d[]): Transform | undefined {\r\n if (points.length > 2) {\r\n const origin = points[0].clone();\r\n const vector01 = Vector3d.create();\r\n Point3dArray.indexOfMostDistantPoint(points, points[0], vector01);\r\n const vector02 = Vector3d.create();\r\n Point3dArray.indexOfPointWithMaxCrossProductMagnitude(points, origin, vector01, vector02);\r\n const matrix = Matrix3d.createRigidFromColumns(vector01, vector02, AxisOrder.XYZ);\r\n if (matrix)\r\n return Transform.createRefs(origin, matrix);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * try to create a frame whose xy plane is through points, with the points appearing CCW in the local frame.\r\n *\r\n * * if 3 or more distinct points are present, the x axis is from the first point to the most distance, and y direction is toward the\r\n * point most distant from that line.\r\n * @param points array of points\r\n */\r\n public static createFrameWithCCWPolygon(points: Point3d[]): Transform | undefined {\r\n if (points.length > 2) {\r\n const ray = PolygonOps.centroidAreaNormal(points);\r\n if (ray) {\r\n return ray.toRigidZFrame();\r\n }\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create the localToWorld transform from a range to axes of its parent coordinate system.\r\n * @param range [in] range to inspect\r\n * @param fractionX [in] fractional coordinate of frame origin x\r\n * @param fractionY [in] fractional coordinate of frame origin y\r\n * @param fractionZ [in] fractional coordinate of frame origin z\r\n * @param scaleSelect [in] selects size of localToWorld axes.\r\n * @param defaultAxisLength [in] if true and any axis length is 0, that axis vector takes this physical length.\r\n */\r\n public static createLocalToWorldTransformInRange(\r\n range: Range3d,\r\n scaleSelect: AxisScaleSelect = AxisScaleSelect.NonUniformRangeContainment,\r\n fractionX: number = 0,\r\n fractionY: number = 0,\r\n fractionZ: number = 0,\r\n defaultAxisLength: number = 1.0): Transform {\r\n if (range.isNull)\r\n return Transform.createIdentity();\r\n let a = 1.0;\r\n let b = 1.0;\r\n let c = 1.0;\r\n if (scaleSelect === AxisScaleSelect.LongestRangeDirection) {\r\n a = b = c = Geometry.correctSmallMetricDistance(range.maxLength(), defaultAxisLength);\r\n } else if (scaleSelect === AxisScaleSelect.NonUniformRangeContainment) {\r\n a = Geometry.correctSmallMetricDistance(range.xLength(), defaultAxisLength) * Geometry.maxAbsDiff(fractionX, 0, 1);\r\n b = Geometry.correctSmallMetricDistance(range.yLength(), defaultAxisLength) * Geometry.maxAbsDiff(fractionY, 0, 1);\r\n c = Geometry.correctSmallMetricDistance(range.zLength(), defaultAxisLength) * Geometry.maxAbsDiff(fractionZ, 0, 1);\r\n }\r\n return Transform.createRefs(range.fractionToPoint(fractionX, fractionY, fractionZ), Matrix3d.createScale(a, b, c));\r\n }\r\n\r\n}\r\n"]}
1
+ {"version":3,"file":"FrameBuilder.js","sourceRoot":"","sources":["../../../src/geometry3d/FrameBuilder.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,0CAA0C;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE1C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,mEAAmE;AAEnE;;;;;;;;;;;;;;;G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AC;QACzH,MAAM,MAAM,GAAG,YAAY,CAAC,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,YAAY,CAAC,WAAW,CAAC,CAAC;QAClG,OAAO,SAAS,CAAC,qBAAqB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;IACjE,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\n// import { Point2d } from \"./Geometry2d\";\r\nimport { BSplineCurve3d } from \"../bspline/BSplineCurve\";\r\nimport { InterpolationCurve3d } from \"../bspline/InterpolationCurve3d\";\r\nimport { Arc3d } from \"../curve/Arc3d\";\r\nimport { CurveCollection } from \"../curve/CurveCollection\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { LineSegment3d } from \"../curve/LineSegment3d\";\r\nimport { LineString3d } from \"../curve/LineString3d\";\r\nimport { AxisOrder, AxisScaleSelect, Geometry } from \"../Geometry\";\r\nimport { GrowableXYZArray } from \"./GrowableXYZArray\";\r\nimport { Matrix3d } from \"./Matrix3d\";\r\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\r\nimport { Point3dArray } from \"./PointHelpers\";\r\nimport { PolygonOps } from \"./PolygonOps\";\r\nimport { Range3d } from \"./Range\";\r\nimport { Transform } from \"./Transform\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\n\r\n/**\r\n * Helper class to accumulate points and vectors until there is enough data to define a coordinate system.\r\n *\r\n * * For the common case of building a right handed frame:\r\n * * create the FrameBuilder and make calls to announcePoint and announceVector.\r\n * * the frame will be fully determined by an origin and two vectors.\r\n * * the first call to announcePoint will set the origin.\r\n * * additional calls to announcePoint will produce announceVector call with the vector from the origin.\r\n * * after each announcement, call getValidatedFrame(false)\r\n * * getValidatedFrame will succeed when it has two independent vectors.\r\n * * To build a left handed frame,\r\n * * an origin and 3 independent vectors are required.\r\n * * announce as above, but query with getValidatedFrame (true).\r\n * * this will use the third vector to select right or left handed frame.\r\n * @public\r\n */\r\nexport class FrameBuilder {\r\n private _origin: undefined | Point3d;\r\n private _vector0: undefined | Vector3d;\r\n private _vector1: undefined | Vector3d;\r\n private _vector2: undefined | Vector3d;\r\n private static _workMatrix?: Matrix3d;\r\n private static _workVector0?: Vector3d;\r\n private static _workVector1?: Vector3d;\r\n private static _workPoint?: Point3d;\r\n // test if both vectors are defined and have significant angle between.\r\n private areStronglyIndependentVectors(\r\n vector0: Vector3d, vector1: Vector3d, radiansTolerance: number = Geometry.smallAngleRadians,\r\n ): boolean {\r\n if (vector0 !== undefined && vector1 !== undefined) {\r\n const q = vector0.smallerUnorientedRadiansTo(vector1);\r\n return q > radiansTolerance;\r\n }\r\n return false;\r\n }\r\n /** Clear all accumulated point and vector data */\r\n public clear() {\r\n this._origin = undefined;\r\n this._vector0 = undefined;\r\n this._vector1 = undefined;\r\n this._vector2 = undefined;\r\n }\r\n constructor() {\r\n this.clear();\r\n }\r\n /**\r\n * Try to assemble the data into a non-singular transform.\r\n * * If allowLeftHanded is false, vector0 and vector1 determine a right handed coordinate system.\r\n * * if allowLeftHanded is true, the z vector of the right handed system can be flipped to agree with vector2 direction.\r\n */\r\n public getValidatedFrame(allowLeftHanded: boolean = false, result?: Transform): Transform | undefined {\r\n if (this._origin && this._vector0 && this._vector1) {\r\n const createRigidMatrix = (v0: Vector3d, v1: Vector3d): Matrix3d | undefined => {\r\n return FrameBuilder._workMatrix = Matrix3d.createRigidFromColumns(v0, v1, AxisOrder.XYZ, FrameBuilder._workMatrix);\r\n };\r\n if (!allowLeftHanded) {\r\n const matrix = createRigidMatrix(this._vector0, this._vector1);\r\n if (matrix)\r\n return Transform.createOriginAndMatrix(this._origin, matrix, result);\r\n // uh oh -- vector1 was not really independent. clear everything after vector0.\r\n this._vector1 = this._vector2 = undefined;\r\n } else if (this._vector2) {\r\n const matrix = createRigidMatrix(this._vector0, this._vector1);\r\n if (matrix) {\r\n if (this._vector0.tripleProduct(this._vector1, this._vector2) < 0)\r\n matrix.scaleColumns(1.0, 1.0, -1.0);\r\n return Transform.createOriginAndMatrix(this._origin, matrix, result);\r\n }\r\n // uh oh again -- clear vector1 and vector2, re-announce vector2 as possible vector1??\r\n const vector2 = this._vector2;\r\n this._vector1 = this._vector2 = undefined;\r\n this.announceVector(vector2);\r\n }\r\n }\r\n return undefined;\r\n }\r\n /** If vector0 is known but vector1 is not, make vector1 the cross of the up-vector and vector0 */\r\n public applyDefaultUpVector(vector?: Vector3d) {\r\n if (vector && this._vector0 && !this._vector1 && !vector.isParallelTo(this._vector0)) {\r\n this._vector1 = vector.crossProduct(this._vector0);\r\n }\r\n }\r\n /** Ask if there is a defined origin for the evolving frame */\r\n public get hasOrigin(): boolean {\r\n return this._origin !== undefined;\r\n }\r\n /**\r\n * Return the number of vectors saved. Because the save process checks numerics, this should be the rank of the system.\r\n */\r\n public savedVectorCount(): number {\r\n if (!this._vector0)\r\n return 0;\r\n if (!this._vector1)\r\n return 1;\r\n if (!this._vector2)\r\n return 2;\r\n return 3;\r\n }\r\n /**\r\n * Announce a new point. If this point is different from the origin, also compute and announce the vector from the origin.\r\n */\r\n public announcePoint(point: Point3d): number {\r\n if (!this._origin) {\r\n this._origin = point.clone();\r\n return this.savedVectorCount();\r\n }\r\n // the new point may provide an additional vector\r\n if (this._origin.isAlmostEqual(point))\r\n return this.savedVectorCount();\r\n return this.announceVector(this._origin.vectorTo(point));\r\n }\r\n /** Announce a new vector. */\r\n public announceVector(vector: Vector3d): number {\r\n if (vector.isAlmostZero)\r\n return this.savedVectorCount();\r\n if (!this._vector0) {\r\n this._vector0 = vector.clone(this._vector0);\r\n return 1;\r\n }\r\n if (!this._vector1) {\r\n if (this.areStronglyIndependentVectors(vector, this._vector0, 1.0e-5)) {\r\n this._vector1 = vector.clone(this._vector1);\r\n return 2;\r\n }\r\n return 1;\r\n }\r\n // vector0 and vector1 are independent.\r\n if (!this._vector2) {\r\n const unitPerpendicular = this._vector0.unitCrossProduct(this._vector1);\r\n if (unitPerpendicular && !Geometry.isSameCoordinate(0, unitPerpendicular.dotProduct(vector))) {\r\n this._vector2 = vector.clone(this._vector2);\r\n return 3;\r\n }\r\n return 2;\r\n }\r\n // fall through if prior vectors are all there -- no need for the new one.\r\n return 3;\r\n }\r\n /**\r\n * Inspect the content of the data. Announce points and vectors. Return when savedVectorCount becomes sufficient\r\n * for a coordinate system.\r\n */\r\n public announce(data: any) {\r\n if (this.savedVectorCount() > 1)\r\n return;\r\n if (data === undefined)\r\n return;\r\n if (data instanceof Point3d)\r\n this.announcePoint(data);\r\n else if (data instanceof Vector3d)\r\n this.announceVector(data);\r\n else if (Array.isArray(data)) {\r\n for (const child of data) {\r\n if (this.savedVectorCount() > 1)\r\n break;\r\n this.announce(child);\r\n }\r\n } else if (data instanceof CurvePrimitive) {\r\n if (data instanceof LineSegment3d) {\r\n this.announcePoint(data.startPoint());\r\n this.announcePoint(data.endPoint());\r\n } else if (data instanceof Arc3d) {\r\n const ray = data.fractionToPointAndDerivative(0.0);\r\n this.announcePoint(ray.origin);\r\n this.announceVector(ray.direction);\r\n this.announceVector(data.matrixRef.columnZCrossVector(ray.direction));\r\n } else if (data instanceof LineString3d) {\r\n for (const point of data.points) {\r\n this.announcePoint(point);\r\n if (this.savedVectorCount() > 1)\r\n break;\r\n }\r\n } else if (data instanceof BSplineCurve3d) {\r\n const point = Point3d.create();\r\n for (let i = 0; this.savedVectorCount() < 2; i++) {\r\n if (data.getPolePoint3d(i, point) instanceof Point3d)\r\n this.announcePoint(point);\r\n else break;\r\n }\r\n } else if (data instanceof InterpolationCurve3d) {\r\n const point = Point3d.create();\r\n for (let i = 0; this.savedVectorCount() < 2; i++) {\r\n if (i < data.options.fitPoints.length) {\r\n point.setFrom(data.options.fitPoints[i]);\r\n this.announcePoint(point);\r\n } else break;\r\n }\r\n } else { // unimplemented CurvePrimitive type\r\n const frame = data.fractionToFrenetFrame(0.0);\r\n if (undefined !== frame) {\r\n this.announcePoint(frame.getOrigin());\r\n this.announceVector(frame.matrix.getColumn(0));\r\n this.announceVector(frame.matrix.getColumn(1));\r\n }\r\n }\r\n } else if (data instanceof CurveCollection) {\r\n if (data.children)\r\n for (const child of data.children) {\r\n this.announce(child);\r\n if (this.savedVectorCount() > 1)\r\n break;\r\n }\r\n } else if (data instanceof GrowableXYZArray) {\r\n const point = Point3d.create();\r\n for (let i = 0; this.savedVectorCount() < 2; i++) {\r\n if (data.getPoint3dAtCheckedPointIndex(i, point) instanceof Point3d)\r\n this.announcePoint(point);\r\n else break;\r\n }\r\n }\r\n }\r\n /**\r\n * Create a localToWorld frame for the given data.\r\n * * origin is at first point.\r\n * * x axis in direction of first nonzero vector present or implied by the input.\r\n * * y axis is perpendicular to x and contains (in positive side) the next vector present or implied by the input.\r\n * * The calculation favors the first points found. It does not try to get a \"best\" plane.\r\n * @param defaultUpVector optional vector to cross with vector0 to create vector1 when it is unknown\r\n * @param params any number of geometric objects to examine in [[announce]] for point/vector data sufficient to construct a frame.\r\n * If the last argument is a `Transform`, it is populated with the computed frame and returned.\r\n * @returns computed localToWorld frame, or undefined if insufficient data.\r\n */\r\n public static createRightHandedFrame(defaultUpVector: Vector3d | undefined, ...params: any[]): Transform | undefined {\r\n // if last arg is a Transform, remove it from the array and use for the return value\r\n let frame = (params.length > 0 && params[params.length - 1] instanceof Transform) ? params.pop() as Transform : undefined;\r\n const builder = new FrameBuilder();\r\n for (const data of params) {\r\n builder.announce(data);\r\n builder.applyDefaultUpVector(defaultUpVector);\r\n if (frame = builder.getValidatedFrame(false, frame)) {\r\n if (defaultUpVector) {\r\n if (frame.matrix.dotColumnZ(defaultUpVector) < 0.0)\r\n frame.matrix.scaleColumnsInPlace(1, -1, -1);\r\n }\r\n return frame;\r\n }\r\n }\r\n const evaluatePrimitiveFrame = (curve: CurvePrimitive, result?: Transform): Transform | undefined => {\r\n return curve.fractionToFrenetFrame(0.0, result);\r\n };\r\n // try direct evaluation of curve primitives using the above lambda\r\n for (const data of params) {\r\n if (data instanceof CurvePrimitive) {\r\n return evaluatePrimitiveFrame(data, frame);\r\n } else if (data instanceof CurveCollection) {\r\n const children = data.collectCurvePrimitives();\r\n for (const curve of children) {\r\n if (frame = evaluatePrimitiveFrame(curve, frame))\r\n return frame;\r\n }\r\n }\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create a transform containing points or vectors in the given data.\r\n * * The xy columns of the transform contain the first points or vectors of the data.\r\n * * The z column is perpendicular to that xy plane.\r\n * * The calculation favors the first points found. It does not try to get a \"best\" plane.\r\n * @param params any number of geometric objects to examine in [[announce]] for point/vector data sufficient to construct a frame.\r\n * If the last argument is a `Transform`, it is populated with the computed frame and returned.\r\n * @returns computed localToWorld frame, or undefined if insufficient data.\r\n */\r\n public static createRightHandedLocalToWorld(...params: any[]): Transform | undefined {\r\n return this.createRightHandedFrame(undefined, params);\r\n }\r\n\r\n /**\r\n * Try to create a frame whose xy plane is through points.\r\n * * If 3 or more distinct points are present, the x axis is from the first point to the most distant, and y\r\n * direction is toward the point most distant from that line.\r\n * @param points array of points\r\n * @param result optional pre-allocated Transform to populate and return\r\n * @returns localToWorld frame for the points, or undefined if insufficient data\r\n */\r\n public static createFrameToDistantPoints(points: Point3d[], result?: Transform): Transform | undefined {\r\n if (points.length > 2) {\r\n const origin = points[0];\r\n const vector01 = FrameBuilder._workVector0 ?? Vector3d.create();\r\n Point3dArray.indexOfMostDistantPoint(points, points[0], vector01);\r\n const vector02 = FrameBuilder._workVector1 ?? Vector3d.create();\r\n Point3dArray.indexOfPointWithMaxCrossProductMagnitude(points, origin, vector01, vector02);\r\n const matrix = FrameBuilder._workMatrix = Matrix3d.createRigidFromColumns(vector01, vector02, AxisOrder.XYZ, FrameBuilder._workMatrix);\r\n if (matrix)\r\n return Transform.createOriginAndMatrix(origin, matrix, result);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Try to create a frame whose xy plane is through points, with the points appearing CCW in the local frame.\r\n * * If 3 or more distinct points are present, the x axis is from the first point to the most distant, and y\r\n * direction is toward the point most distant from that line.\r\n * @param points array of points\r\n * @param result optional pre-allocated Transform to populate and return\r\n * @returns localToWorld frame for the points, or undefined if insufficient data\r\n */\r\n public static createFrameWithCCWPolygon(points: Point3d[], result?: Transform): Transform | undefined {\r\n if (points.length > 2) {\r\n const ray = PolygonOps.centroidAreaNormal(points); // can't pass pre-allocated ray...\r\n if (ray)\r\n return ray.toRigidZFrame(result);\r\n }\r\n return undefined;\r\n }\r\n /**\r\n * Create the localToWorld transform from a range to axes of its parent coordinate system.\r\n * @param range range to inspect\r\n * @param scaleSelect selects size of localToWorld axes.\r\n * @param fractionX fractional coordinate of frame origin x\r\n * @param fractionY fractional coordinate of frame origin y\r\n * @param fractionZ fractional coordinate of frame origin z\r\n * @param defaultAxisLength if true and any axis length is 0, that axis vector takes this physical length.\r\n * @param result optional pre-allocated Transform to populate and return\r\n * @returns localToWorld frame for the range\r\n */\r\n public static createLocalToWorldTransformInRange(\r\n range: Range3d,\r\n scaleSelect: AxisScaleSelect = AxisScaleSelect.NonUniformRangeContainment,\r\n fractionX: number = 0,\r\n fractionY: number = 0,\r\n fractionZ: number = 0,\r\n defaultAxisLength: number = 1.0,\r\n result?: Transform,\r\n ): Transform {\r\n if (range.isNull)\r\n return Transform.createIdentity(result);\r\n let a = 1.0;\r\n let b = 1.0;\r\n let c = 1.0;\r\n if (scaleSelect === AxisScaleSelect.LongestRangeDirection) {\r\n a = b = c = Geometry.correctSmallMetricDistance(range.maxLength(), defaultAxisLength);\r\n } else if (scaleSelect === AxisScaleSelect.NonUniformRangeContainment) {\r\n a = Geometry.correctSmallMetricDistance(range.xLength(), defaultAxisLength) * Geometry.maxAbsDiff(fractionX, 0, 1);\r\n b = Geometry.correctSmallMetricDistance(range.yLength(), defaultAxisLength) * Geometry.maxAbsDiff(fractionY, 0, 1);\r\n c = Geometry.correctSmallMetricDistance(range.zLength(), defaultAxisLength) * Geometry.maxAbsDiff(fractionZ, 0, 1);\r\n }\r\n const origin = FrameBuilder._workPoint = range.fractionToPoint(fractionX, fractionY, fractionZ, FrameBuilder._workPoint);\r\n const matrix = FrameBuilder._workMatrix = Matrix3d.createScale(a, b, c, FrameBuilder._workMatrix);\r\n return Transform.createOriginAndMatrix(origin, matrix, result);\r\n }\r\n}\r\n"]}
@@ -181,14 +181,6 @@ export declare class GrowableXYZArray extends IndexedReadWriteXYZCollection {
181
181
  * @returns number of points pushed.
182
182
  */
183
183
  pushFromGrowableXYZArray(source: GrowableXYZArray, sourceIndex?: number): number;
184
- /**
185
- * Return the first point, or undefined if the array is empty.
186
- */
187
- front(result?: Point3d): Point3d | undefined;
188
- /**
189
- * Return the last point, or undefined if the array is empty.
190
- */
191
- back(result?: Point3d): Point3d | undefined;
192
184
  /**
193
185
  * Set the coordinates of a single point.
194
186
  * @param pointIndex index of point to set
@@ -1 +1 @@
1
- {"version":3,"file":"GrowableXYZArray.d.ts","sourceRoot":"","sources":["../../../src/geometry3d/GrowableXYZArray.ts"],"names":[],"mappings":"AAKA;;GAEG;AAEH,OAAO,EAAY,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2BAA2B,CAAC;AACvE,OAAO,EAAE,6BAA6B,EAAwB,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,OA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AAG,SAAS;IAW1I,6DAA6D;WAC/C,aAAa,CAAC,KAAK,EAAE,gBAAgB,GAAG,SAAS,EAAE,KAAK,EAAE,gBAAgB,GAAG,SAAS,GAAG,OAAO;IAa9G,+EAA+E;IACxE,kBAAkB,IAAI,WAAW;IAcxC,kDAAkD;IAC3C,mBAAmB,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM;IAY1D,oFAAoF;IAC7E,SAAS,CAAC,UAAU,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,GAAG,MAAM;IAGpE;;;;;;OAMG;IACI,gBAAgB,CAAC,KAAK,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;IAalG;;;;OAIG;WACW,uCAAuC,CAAC,MAAM,EAAE,gBAAgB,EAAE,MAAM,EAAE,gBAAgB,GAAG,OAAO;IAclH;;;;OAIG;WACW,aAAa,CAAC,MAAM,EAAE,6BAA6B,EAAE,SAAS,GAAE,MAAqC;IAInH;;;;;;OAMG;IACI,wBAAwB,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS;IAuB3I;;;;OAIG;IACI,YAAY,CAAC,cAAc,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,MAAM;CAQjG"}
@@ -380,22 +380,6 @@ export class GrowableXYZArray extends IndexedReadWriteXYZCollection {
380
380
  }
381
381
  return 0;
382
382
  }
383
- /**
384
- * Return the first point, or undefined if the array is empty.
385
- */
386
- front(result) {
387
- if (this._xyzInUse === 0)
388
- return undefined;
389
- return this.getPoint3dAtUncheckedPointIndex(0, result);
390
- }
391
- /**
392
- * Return the last point, or undefined if the array is empty.
393
- */
394
- back(result) {
395
- if (this._xyzInUse < 1)
396
- return undefined;
397
- return this.getPoint3dAtUncheckedPointIndex(this._xyzInUse - 1, result);
398
- }
399
383
  /**
400
384
  * Set the coordinates of a single point.
401
385
  * @param pointIndex index of point to set