@itwin/core-geometry 5.0.0-dev.4 → 5.0.0-dev.40

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 (434) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/lib/cjs/Constant.js +17 -17
  3. package/lib/cjs/Constant.js.map +1 -1
  4. package/lib/cjs/Geometry.js +35 -35
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
  7. package/lib/cjs/bspline/BSplineCurveOps.js +18 -21
  8. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  9. package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
  10. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  11. package/lib/cjs/bspline/KnotVector.js +2 -2
  12. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  13. package/lib/cjs/clipping/AlternatingConvexClipTree.js +2 -2
  14. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  15. package/lib/cjs/clipping/ClipPlane.js +1 -1
  16. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  17. package/lib/cjs/clipping/ClipUtils.js +1 -1
  18. package/lib/cjs/clipping/ClipUtils.js.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.js +3 -3
  22. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  23. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +1 -1
  24. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  25. package/lib/cjs/curve/Arc3d.d.ts +40 -8
  26. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  27. package/lib/cjs/curve/Arc3d.js +80 -22
  28. package/lib/cjs/curve/Arc3d.js.map +1 -1
  29. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +4 -4
  30. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  31. package/lib/cjs/curve/CurveCollection.d.ts +16 -2
  32. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  33. package/lib/cjs/curve/CurveCollection.js +33 -2
  34. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  35. package/lib/cjs/curve/CurveFactory.d.ts +87 -53
  36. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  37. package/lib/cjs/curve/CurveFactory.js +213 -135
  38. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  39. package/lib/cjs/curve/LineString3d.d.ts +12 -8
  40. package/lib/cjs/curve/LineString3d.d.ts.map +1 -1
  41. package/lib/cjs/curve/LineString3d.js +34 -13
  42. package/lib/cjs/curve/LineString3d.js.map +1 -1
  43. package/lib/cjs/curve/Loop.d.ts +12 -6
  44. package/lib/cjs/curve/Loop.d.ts.map +1 -1
  45. package/lib/cjs/curve/Loop.js +12 -6
  46. package/lib/cjs/curve/Loop.js.map +1 -1
  47. package/lib/cjs/curve/Query/CylindricalRange.d.ts +8 -6
  48. package/lib/cjs/curve/Query/CylindricalRange.d.ts.map +1 -1
  49. package/lib/cjs/curve/Query/CylindricalRange.js +13 -9
  50. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  51. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +1 -1
  52. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  53. package/lib/cjs/curve/StrokeOptions.d.ts +4 -4
  54. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  55. package/lib/cjs/curve/StrokeOptions.js +1 -1
  56. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  57. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -5
  58. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  59. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +13 -13
  60. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  61. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +5 -5
  62. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  63. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  64. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +29 -23
  65. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  66. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +4 -4
  67. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  68. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +2 -2
  69. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  70. package/lib/cjs/geometry3d/Angle.js +16 -16
  71. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  72. package/lib/cjs/geometry3d/AngleSweep.d.ts +1 -1
  73. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  74. package/lib/cjs/geometry3d/AngleSweep.js +1 -1
  75. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  76. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts +14 -8
  77. package/lib/cjs/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  78. package/lib/cjs/geometry3d/BarycentricTriangle.js +17 -8
  79. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  80. package/lib/cjs/geometry3d/FrameBuilder.js +4 -4
  81. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  82. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts +2 -0
  83. package/lib/cjs/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  84. package/lib/cjs/geometry3d/GrowableFloat64Array.js +4 -0
  85. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  86. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +32 -10
  87. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  88. package/lib/cjs/geometry3d/GrowableXYZArray.js +54 -16
  89. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  90. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +13 -2
  91. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  92. package/lib/cjs/geometry3d/IndexedXYZCollection.js +24 -10
  93. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  94. package/lib/cjs/geometry3d/Matrix3d.d.ts +11 -8
  95. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  96. package/lib/cjs/geometry3d/Matrix3d.js +36 -34
  97. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  98. package/lib/cjs/geometry3d/OrderedRotationAngles.js +2 -2
  99. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  100. package/lib/cjs/geometry3d/Point3dArrayCarrier.js +1 -1
  101. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  102. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +6 -6
  103. package/lib/cjs/geometry3d/Point3dVector3d.js +6 -6
  104. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  105. package/lib/cjs/geometry3d/PointHelpers.js +5 -5
  106. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  107. package/lib/cjs/geometry3d/PolygonOps.d.ts +12 -6
  108. package/lib/cjs/geometry3d/PolygonOps.d.ts.map +1 -1
  109. package/lib/cjs/geometry3d/PolygonOps.js +117 -70
  110. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  111. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +3 -3
  112. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  113. package/lib/cjs/geometry3d/PolylineOps.d.ts +9 -5
  114. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  115. package/lib/cjs/geometry3d/PolylineOps.js +9 -5
  116. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  117. package/lib/cjs/geometry3d/Range.js +4 -4
  118. package/lib/cjs/geometry3d/Range.js.map +1 -1
  119. package/lib/cjs/geometry4d/MomentData.d.ts +72 -73
  120. package/lib/cjs/geometry4d/MomentData.d.ts.map +1 -1
  121. package/lib/cjs/geometry4d/MomentData.js +62 -64
  122. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  123. package/lib/cjs/numerics/ClusterableArray.js +13 -13
  124. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  125. package/lib/cjs/numerics/PascalCoefficients.js +1 -1
  126. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  127. package/lib/cjs/numerics/PolarData.js +1 -1
  128. package/lib/cjs/numerics/PolarData.js.map +1 -1
  129. package/lib/cjs/numerics/Polynomials.d.ts +5 -5
  130. package/lib/cjs/numerics/Polynomials.js +32 -32
  131. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  132. package/lib/cjs/numerics/Quadrature.js +20 -20
  133. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  134. package/lib/cjs/polyface/AuxData.d.ts +2 -2
  135. package/lib/cjs/polyface/AuxData.d.ts.map +1 -1
  136. package/lib/cjs/polyface/AuxData.js +11 -3
  137. package/lib/cjs/polyface/AuxData.js.map +1 -1
  138. package/lib/cjs/polyface/BoxTopology.js +67 -67
  139. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  140. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js +2 -2
  141. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  142. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +27 -20
  143. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  144. package/lib/cjs/polyface/IndexedEdgeMatcher.js +56 -30
  145. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  146. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
  147. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  148. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +2 -1
  149. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  150. package/lib/cjs/polyface/Polyface.d.ts +3 -5
  151. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  152. package/lib/cjs/polyface/Polyface.js +6 -13
  153. package/lib/cjs/polyface/Polyface.js.map +1 -1
  154. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +14 -7
  155. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  156. package/lib/cjs/polyface/PolyfaceBuilder.js +59 -64
  157. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  158. package/lib/cjs/polyface/PolyfaceData.d.ts +13 -3
  159. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  160. package/lib/cjs/polyface/PolyfaceData.js +26 -9
  161. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  162. package/lib/cjs/polyface/PolyfaceQuery.d.ts +2 -2
  163. package/lib/cjs/polyface/PolyfaceQuery.d.ts.map +1 -1
  164. package/lib/cjs/polyface/PolyfaceQuery.js +11 -10
  165. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  166. package/lib/cjs/polyface/multiclip/RangeSearch.js +5 -5
  167. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  168. package/lib/cjs/serialization/BGFBReader.js +22 -22
  169. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  170. package/lib/cjs/serialization/GeometrySamples.d.ts +5 -5
  171. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  172. package/lib/cjs/serialization/GeometrySamples.js +112 -112
  173. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  174. package/lib/cjs/solid/Box.d.ts +9 -3
  175. package/lib/cjs/solid/Box.d.ts.map +1 -1
  176. package/lib/cjs/solid/Box.js +10 -5
  177. package/lib/cjs/solid/Box.js.map +1 -1
  178. package/lib/cjs/solid/Cone.d.ts +3 -2
  179. package/lib/cjs/solid/Cone.d.ts.map +1 -1
  180. package/lib/cjs/solid/Cone.js +3 -3
  181. package/lib/cjs/solid/Cone.js.map +1 -1
  182. package/lib/cjs/solid/LinearSweep.d.ts +9 -3
  183. package/lib/cjs/solid/LinearSweep.d.ts.map +1 -1
  184. package/lib/cjs/solid/LinearSweep.js +9 -4
  185. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  186. package/lib/cjs/solid/RotationalSweep.d.ts +15 -4
  187. package/lib/cjs/solid/RotationalSweep.d.ts.map +1 -1
  188. package/lib/cjs/solid/RotationalSweep.js +20 -7
  189. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  190. package/lib/cjs/solid/RuledSweep.d.ts +35 -26
  191. package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
  192. package/lib/cjs/solid/RuledSweep.js +41 -28
  193. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  194. package/lib/cjs/solid/SolidPrimitive.d.ts +12 -11
  195. package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
  196. package/lib/cjs/solid/SolidPrimitive.js +8 -5
  197. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  198. package/lib/cjs/solid/Sphere.d.ts +17 -7
  199. package/lib/cjs/solid/Sphere.d.ts.map +1 -1
  200. package/lib/cjs/solid/Sphere.js +22 -16
  201. package/lib/cjs/solid/Sphere.js.map +1 -1
  202. package/lib/cjs/solid/SweepContour.d.ts +25 -16
  203. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  204. package/lib/cjs/solid/SweepContour.js +25 -16
  205. package/lib/cjs/solid/SweepContour.js.map +1 -1
  206. package/lib/cjs/solid/TorusPipe.d.ts +8 -2
  207. package/lib/cjs/solid/TorusPipe.d.ts.map +1 -1
  208. package/lib/cjs/solid/TorusPipe.js +9 -5
  209. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  210. package/lib/cjs/topology/ChainMerge.js +4 -4
  211. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  212. package/lib/cjs/topology/Graph.js +5 -5
  213. package/lib/cjs/topology/Graph.js.map +1 -1
  214. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +2 -2
  215. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  216. package/lib/cjs/topology/Triangulation.js +11 -11
  217. package/lib/cjs/topology/Triangulation.js.map +1 -1
  218. package/lib/esm/Constant.js +17 -17
  219. package/lib/esm/Constant.js.map +1 -1
  220. package/lib/esm/Geometry.js +35 -35
  221. package/lib/esm/Geometry.js.map +1 -1
  222. package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
  223. package/lib/esm/bspline/BSplineCurveOps.js +18 -21
  224. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  225. package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
  226. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  227. package/lib/esm/bspline/KnotVector.js +2 -2
  228. package/lib/esm/bspline/KnotVector.js.map +1 -1
  229. package/lib/esm/clipping/AlternatingConvexClipTree.js +2 -2
  230. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  231. package/lib/esm/clipping/ClipPlane.js +1 -1
  232. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  233. package/lib/esm/clipping/ClipUtils.js +1 -1
  234. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  235. package/lib/esm/clipping/ClipVector.js +1 -1
  236. package/lib/esm/clipping/ClipVector.js.map +1 -1
  237. package/lib/esm/clipping/ConvexClipPlaneSet.js +3 -3
  238. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  239. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +1 -1
  240. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  241. package/lib/esm/curve/Arc3d.d.ts +40 -8
  242. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  243. package/lib/esm/curve/Arc3d.js +80 -22
  244. package/lib/esm/curve/Arc3d.js.map +1 -1
  245. package/lib/esm/curve/CurveChainWithDistanceIndex.js +4 -4
  246. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  247. package/lib/esm/curve/CurveCollection.d.ts +16 -2
  248. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  249. package/lib/esm/curve/CurveCollection.js +33 -2
  250. package/lib/esm/curve/CurveCollection.js.map +1 -1
  251. package/lib/esm/curve/CurveFactory.d.ts +87 -53
  252. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  253. package/lib/esm/curve/CurveFactory.js +213 -135
  254. package/lib/esm/curve/CurveFactory.js.map +1 -1
  255. package/lib/esm/curve/LineString3d.d.ts +12 -8
  256. package/lib/esm/curve/LineString3d.d.ts.map +1 -1
  257. package/lib/esm/curve/LineString3d.js +34 -13
  258. package/lib/esm/curve/LineString3d.js.map +1 -1
  259. package/lib/esm/curve/Loop.d.ts +12 -6
  260. package/lib/esm/curve/Loop.d.ts.map +1 -1
  261. package/lib/esm/curve/Loop.js +12 -6
  262. package/lib/esm/curve/Loop.js.map +1 -1
  263. package/lib/esm/curve/Query/CylindricalRange.d.ts +8 -6
  264. package/lib/esm/curve/Query/CylindricalRange.d.ts.map +1 -1
  265. package/lib/esm/curve/Query/CylindricalRange.js +13 -9
  266. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  267. package/lib/esm/curve/RegionOpsClassificationSweeps.js +1 -1
  268. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  269. package/lib/esm/curve/StrokeOptions.d.ts +4 -4
  270. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  271. package/lib/esm/curve/StrokeOptions.js +1 -1
  272. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  273. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +5 -5
  274. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  275. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +13 -13
  276. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  277. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +5 -5
  278. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  279. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.d.ts.map +1 -1
  280. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +29 -23
  281. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  282. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +4 -4
  283. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  284. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +2 -2
  285. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  286. package/lib/esm/geometry3d/Angle.js +16 -16
  287. package/lib/esm/geometry3d/Angle.js.map +1 -1
  288. package/lib/esm/geometry3d/AngleSweep.d.ts +1 -1
  289. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  290. package/lib/esm/geometry3d/AngleSweep.js +1 -1
  291. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  292. package/lib/esm/geometry3d/BarycentricTriangle.d.ts +14 -8
  293. package/lib/esm/geometry3d/BarycentricTriangle.d.ts.map +1 -1
  294. package/lib/esm/geometry3d/BarycentricTriangle.js +17 -8
  295. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  296. package/lib/esm/geometry3d/FrameBuilder.js +4 -4
  297. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  298. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts +2 -0
  299. package/lib/esm/geometry3d/GrowableFloat64Array.d.ts.map +1 -1
  300. package/lib/esm/geometry3d/GrowableFloat64Array.js +4 -0
  301. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  302. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +32 -10
  303. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  304. package/lib/esm/geometry3d/GrowableXYZArray.js +54 -16
  305. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  306. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +13 -2
  307. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  308. package/lib/esm/geometry3d/IndexedXYZCollection.js +24 -10
  309. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  310. package/lib/esm/geometry3d/Matrix3d.d.ts +11 -8
  311. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  312. package/lib/esm/geometry3d/Matrix3d.js +36 -34
  313. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  314. package/lib/esm/geometry3d/OrderedRotationAngles.js +2 -2
  315. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  316. package/lib/esm/geometry3d/Point3dArrayCarrier.js +1 -1
  317. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  318. package/lib/esm/geometry3d/Point3dVector3d.d.ts +6 -6
  319. package/lib/esm/geometry3d/Point3dVector3d.js +6 -6
  320. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  321. package/lib/esm/geometry3d/PointHelpers.js +5 -5
  322. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  323. package/lib/esm/geometry3d/PolygonOps.d.ts +12 -6
  324. package/lib/esm/geometry3d/PolygonOps.d.ts.map +1 -1
  325. package/lib/esm/geometry3d/PolygonOps.js +117 -70
  326. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  327. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +3 -3
  328. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  329. package/lib/esm/geometry3d/PolylineOps.d.ts +9 -5
  330. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  331. package/lib/esm/geometry3d/PolylineOps.js +9 -5
  332. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  333. package/lib/esm/geometry3d/Range.js +4 -4
  334. package/lib/esm/geometry3d/Range.js.map +1 -1
  335. package/lib/esm/geometry4d/MomentData.d.ts +72 -73
  336. package/lib/esm/geometry4d/MomentData.d.ts.map +1 -1
  337. package/lib/esm/geometry4d/MomentData.js +62 -64
  338. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  339. package/lib/esm/numerics/ClusterableArray.js +13 -13
  340. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  341. package/lib/esm/numerics/PascalCoefficients.js +1 -1
  342. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  343. package/lib/esm/numerics/PolarData.js +1 -1
  344. package/lib/esm/numerics/PolarData.js.map +1 -1
  345. package/lib/esm/numerics/Polynomials.d.ts +5 -5
  346. package/lib/esm/numerics/Polynomials.js +32 -32
  347. package/lib/esm/numerics/Polynomials.js.map +1 -1
  348. package/lib/esm/numerics/Quadrature.js +20 -20
  349. package/lib/esm/numerics/Quadrature.js.map +1 -1
  350. package/lib/esm/polyface/AuxData.d.ts +2 -2
  351. package/lib/esm/polyface/AuxData.d.ts.map +1 -1
  352. package/lib/esm/polyface/AuxData.js +11 -3
  353. package/lib/esm/polyface/AuxData.js.map +1 -1
  354. package/lib/esm/polyface/BoxTopology.js +67 -67
  355. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  356. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js +2 -2
  357. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  358. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +27 -20
  359. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  360. package/lib/esm/polyface/IndexedEdgeMatcher.js +56 -30
  361. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  362. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +2 -1
  363. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  364. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +2 -1
  365. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  366. package/lib/esm/polyface/Polyface.d.ts +3 -5
  367. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  368. package/lib/esm/polyface/Polyface.js +6 -13
  369. package/lib/esm/polyface/Polyface.js.map +1 -1
  370. package/lib/esm/polyface/PolyfaceBuilder.d.ts +14 -7
  371. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  372. package/lib/esm/polyface/PolyfaceBuilder.js +60 -65
  373. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  374. package/lib/esm/polyface/PolyfaceData.d.ts +13 -3
  375. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  376. package/lib/esm/polyface/PolyfaceData.js +26 -9
  377. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  378. package/lib/esm/polyface/PolyfaceQuery.d.ts +2 -2
  379. package/lib/esm/polyface/PolyfaceQuery.d.ts.map +1 -1
  380. package/lib/esm/polyface/PolyfaceQuery.js +11 -10
  381. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  382. package/lib/esm/polyface/multiclip/RangeSearch.js +5 -5
  383. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  384. package/lib/esm/serialization/BGFBReader.js +22 -22
  385. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  386. package/lib/esm/serialization/GeometrySamples.d.ts +5 -5
  387. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  388. package/lib/esm/serialization/GeometrySamples.js +112 -112
  389. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  390. package/lib/esm/solid/Box.d.ts +9 -3
  391. package/lib/esm/solid/Box.d.ts.map +1 -1
  392. package/lib/esm/solid/Box.js +10 -5
  393. package/lib/esm/solid/Box.js.map +1 -1
  394. package/lib/esm/solid/Cone.d.ts +3 -2
  395. package/lib/esm/solid/Cone.d.ts.map +1 -1
  396. package/lib/esm/solid/Cone.js +3 -3
  397. package/lib/esm/solid/Cone.js.map +1 -1
  398. package/lib/esm/solid/LinearSweep.d.ts +9 -3
  399. package/lib/esm/solid/LinearSweep.d.ts.map +1 -1
  400. package/lib/esm/solid/LinearSweep.js +9 -4
  401. package/lib/esm/solid/LinearSweep.js.map +1 -1
  402. package/lib/esm/solid/RotationalSweep.d.ts +15 -4
  403. package/lib/esm/solid/RotationalSweep.d.ts.map +1 -1
  404. package/lib/esm/solid/RotationalSweep.js +20 -7
  405. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  406. package/lib/esm/solid/RuledSweep.d.ts +35 -26
  407. package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
  408. package/lib/esm/solid/RuledSweep.js +41 -28
  409. package/lib/esm/solid/RuledSweep.js.map +1 -1
  410. package/lib/esm/solid/SolidPrimitive.d.ts +12 -11
  411. package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
  412. package/lib/esm/solid/SolidPrimitive.js +8 -5
  413. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  414. package/lib/esm/solid/Sphere.d.ts +17 -7
  415. package/lib/esm/solid/Sphere.d.ts.map +1 -1
  416. package/lib/esm/solid/Sphere.js +22 -16
  417. package/lib/esm/solid/Sphere.js.map +1 -1
  418. package/lib/esm/solid/SweepContour.d.ts +25 -16
  419. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  420. package/lib/esm/solid/SweepContour.js +25 -16
  421. package/lib/esm/solid/SweepContour.js.map +1 -1
  422. package/lib/esm/solid/TorusPipe.d.ts +8 -2
  423. package/lib/esm/solid/TorusPipe.d.ts.map +1 -1
  424. package/lib/esm/solid/TorusPipe.js +9 -5
  425. package/lib/esm/solid/TorusPipe.js.map +1 -1
  426. package/lib/esm/topology/ChainMerge.js +4 -4
  427. package/lib/esm/topology/ChainMerge.js.map +1 -1
  428. package/lib/esm/topology/Graph.js +5 -5
  429. package/lib/esm/topology/Graph.js.map +1 -1
  430. package/lib/esm/topology/HalfEdgeGraphSpineContext.js +2 -2
  431. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  432. package/lib/esm/topology/Triangulation.js +11 -11
  433. package/lib/esm/topology/Triangulation.js.map +1 -1
  434. package/package.json +5 -5
@@ -24,6 +24,8 @@ const Matrix3d_1 = require("./Matrix3d");
24
24
  * @alpha
25
25
  */
26
26
  class OrderedRotationAngles {
27
+ /** treat vectors as matrix columns */
28
+ static { this._sTreatVectorsAsColumns = false; }
27
29
  /** constructor */
28
30
  constructor(x, y, z, axisOrder) {
29
31
  this._x = x;
@@ -318,6 +320,4 @@ class OrderedRotationAngles {
318
320
  }
319
321
  }
320
322
  exports.OrderedRotationAngles = OrderedRotationAngles;
321
- /** treat vectors as matrix columns */
322
- OrderedRotationAngles._sTreatVectorsAsColumns = false;
323
323
  //# sourceMappingURL=OrderedRotationAngles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"OrderedRotationAngles.js","sourceRoot":"","sources":["../../../src/geometry3d/OrderedRotationAngles.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAkD;AAClD,mCAAgC;AAChC,yCAAsC;AAEtC,wFAAwF;AAExF;;;;;;;;;;GAUG;AACH,MAAa,qBAAqB;IAWhC,kBAAkB;IAClB,YAAoB,CAAQ,EAAE,CAAQ,EAAE,CAAQ,EAAE,SAAoB;QACpE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IAC1B,CAAC;IACD,0FAA0F;IAC1F,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IAC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AAE,EACrB,IAAI,GAAG,IAAI,GAAG,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,EAAE,GAAG,IAAI,EAC3C,IAAI,GAAG,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,CAC5C,CAAC;QACJ,CAAC;aAAM,IAAI,SAAS,KAAK,oBAAS,CAAC,GAAG,EAAE,CAAC;YACvC,GAAG,CAAC,YAAY,CACd,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,EAC3C,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,EACrB,CAAC,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,CAC7C,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC;QACD,yEAAyE;QACzE,IAAI,CAAC,qBAAqB,CAAC,qBAAqB;YAC9C,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAEzB,OAAO,GAAG,CAAC;IACb,CAAC;;AAvVH,sDAwVC;AA/UC,sCAAsC;AACvB,6CAAuB,GAAY,KAAK,CAAC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\nimport { AxisOrder, Geometry } from \"../Geometry\";\nimport { Angle } from \"./Angle\";\nimport { Matrix3d } from \"./Matrix3d\";\n\n/* cspell:word cxcz, cxsz, cxcy, cxsy, sxcz, sxsz, sxcy, sxsy, cycz, cysz, sycz, sysz */\n\n/**\n * Represents a non-trivial rotation using three simple axis rotation angles and an order in which to apply them.\n * * This class accommodates application-specific interpretation of \"multiplying 3 rotation matrices\" with regard to\n * * Whether a \"vector\" is a \"row\" or a \"column\"\n * * The order in which the X,Y,Z rotations are applied.\n * * This class bakes in angle rotation directions via create functions (i.e., createRadians, createDegrees, and\n * createAngles) so you can define each of the 3 rotations to be clockwise or counterclockwise. The default\n * rotation is counterclockwise.\n * * Within the imodel geometry library, the preferred rotation order is encapsulated in `YawPitchRollAngles`.\n * @alpha\n */\nexport class OrderedRotationAngles {\n /** rotation around x */\n private _x: Angle;\n /** rotation around y */\n private _y: Angle;\n /** rotation around z */\n private _z: Angle;\n /** rotation order. For example XYZ means to rotate around x axis first, then y axis, and finally Z axis */\n private _order: AxisOrder;\n /** treat vectors as matrix columns */\n private static _sTreatVectorsAsColumns: boolean = false;\n /** constructor */\n private constructor(x: Angle, y: Angle, z: Angle, axisOrder: AxisOrder) {\n this._x = x;\n this._y = y;\n this._z = z;\n this._order = axisOrder;\n }\n /** (Property accessor) Return the `AxisOrder` controlling matrix multiplication order. */\n public get order(): AxisOrder {\n return this._order;\n }\n /** (Property accessor) Return the strongly typed angle of rotation around x. */\n public get xAngle(): Angle {\n return this._x.clone();\n }\n /** (Property accessor) Return the strongly typed angle of rotation around y. */\n public get yAngle(): Angle {\n return this._y.clone();\n }\n /** (Property accessor) Return the strongly typed angle of rotation around z. */\n public get zAngle(): Angle {\n return this._z.clone();\n }\n /** (Property accessor) Return the angle of rotation around x, in degrees */\n public get xDegrees(): number {\n return this._x.degrees;\n }\n /** (Property accessor) Return the angle of rotation around y, in degrees */\n public get xRadians(): number {\n return this._x.radians;\n }\n /** (Property accessor) Return the angle of rotation around z, in degrees */\n public get yDegrees(): number {\n return this._y.degrees;\n }\n /** (Property accessor) Return the angle of rotation around x, in radians */\n public get yRadians(): number {\n return this._y.radians;\n }\n /** (Property accessor) Return the angle of rotation around y, in radians */\n public get zDegrees(): number {\n return this._z.degrees;\n }\n /** (Property accessor) Return the angle of rotation around z, in radians */\n public get zRadians(): number {\n return this._z.radians;\n }\n /** The flag controlling whether vectors are treated as rows or as columns */\n public static get treatVectorsAsColumns(): boolean {\n return OrderedRotationAngles._sTreatVectorsAsColumns;\n }\n public static set treatVectorsAsColumns(value: boolean) {\n OrderedRotationAngles._sTreatVectorsAsColumns = value;\n }\n /**\n * Create an OrderedRotationAngles from three angles (in radians), an ordering in which to apply them when\n * rotating, and a flag triple controlling whether direction of x,y,z is clockwise or counterclockwise.\n * @param xRadians rotation around x\n * @param yRadians rotation around y\n * @param zRadians rotation around z\n * @param order left to right order of axis names identifies the order that rotations are applied.\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\n * matrix multiplication would be zRot*yRot*xRot\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeRotationAroundStandardAxes\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\n * @param result caller-allocated OrderedRotationAngles\n */\n public static createRadians(xRadians: number, yRadians: number, zRadians: number, order: AxisOrder,\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\n if (!xyzRotationIsClockwise) {\n xyzRotationIsClockwise = [false, false, false];\n }\n const xRadian = xyzRotationIsClockwise[0] ? -xRadians : xRadians;\n const yRadian = xyzRotationIsClockwise[1] ? -yRadians : yRadians;\n const zRadian = xyzRotationIsClockwise[2] ? -zRadians : zRadians;\n if (result) {\n result._x.setRadians(xRadian);\n result._y.setRadians(yRadian);\n result._z.setRadians(zRadian);\n result._order = order;\n return result;\n }\n return new OrderedRotationAngles(\n Angle.createRadians(xRadian),\n Angle.createRadians(yRadian),\n Angle.createRadians(zRadian),\n order,\n );\n }\n /**\n * Create an OrderedRotationAngles from three angles (in degrees) and an ordering in which to apply\n * them when rotating.\n * @param xDegrees rotation around x\n * @param yDegrees rotation around y\n * @param zDegrees rotation around z\n * @param order left to right order of axis names identifies the order that rotations are applied.\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\n * matrix multiplication would be zRot*yRot*xRot\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\n * @param result caller-allocated OrderedRotationAngles\n */\n public static createDegrees(xDegrees: number, yDegrees: number, zDegrees: number, order: AxisOrder,\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\n return OrderedRotationAngles.createRadians(\n Angle.degreesToRadians(xDegrees),\n Angle.degreesToRadians(yDegrees),\n Angle.degreesToRadians(zDegrees),\n order,\n xyzRotationIsClockwise,\n result,\n );\n }\n /**\n * Create an OrderedRotationAngles from three angles, an ordering in which to apply them when rotating,\n * and a flag triple controlling whether direction of x,y,z is clockwise or counterclockwise.\n * @param xRotation rotation around x\n * @param yRotation rotation around y\n * @param zRotation rotation around z\n * @param order left to right order of axis names identifies the order that rotations are applied\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\n * matrix multiplication would be zRot*yRot*xRot\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\n * @param result caller-allocated OrderedRotationAngles\n */\n public static createAngles(xRotation: Angle, yRotation: Angle, zRotation: Angle, order: AxisOrder,\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\n return OrderedRotationAngles.createRadians(\n xRotation.radians,\n yRotation.radians,\n zRotation.radians,\n order,\n xyzRotationIsClockwise,\n result,\n );\n }\n /**\n * Create an OrderedRotationAngles from a 3x3 rotational matrix, given the ordering of axis rotations\n * that the matrix derives from.\n * * This function creates an OrderedRotationAngles with default angle rotation directions, i.e.,\n * it assumes all x, y, and z rotations are counterclockwise.\n * * In the failure case the method's return value is `undefined`.\n * * In the failure case, if the optional result was supplied, that result will nonetheless be filled with\n * a set of angles.\n */\n public static createFromMatrix3d(matrix: Matrix3d, order: AxisOrder, result?: OrderedRotationAngles):\n OrderedRotationAngles | undefined {\n // treat vector as columns\n let m11 = matrix.coffs[0], m12 = matrix.coffs[1], m13 = matrix.coffs[2];\n let m21 = matrix.coffs[3], m22 = matrix.coffs[4], m23 = matrix.coffs[5];\n let m31 = matrix.coffs[6], m32 = matrix.coffs[7], m33 = matrix.coffs[8];\n // treat vector as rows\n if (!OrderedRotationAngles.treatVectorsAsColumns) {\n m11 = matrix.coffs[0], m12 = matrix.coffs[3], m13 = matrix.coffs[6];\n m21 = matrix.coffs[1], m22 = matrix.coffs[4], m23 = matrix.coffs[7];\n m31 = matrix.coffs[2], m32 = matrix.coffs[5], m33 = matrix.coffs[8];\n }\n\n let xRad: number;\n let yRad: number;\n let zRad: number;\n\n switch (order) {\n case AxisOrder.XYZ: {\n yRad = Math.asin(Math.max(-1, Math.min(1, -m31))); // limit asin domain to [-1,1]\n\n if (Math.abs(m31) < 0.99999) {\n xRad = Math.atan2(m32, m33);\n zRad = Math.atan2(m21, m11);\n } else {\n /**\n * If Math.abs(m31) = 1 then yRad = +-90 degrees and therefore, we have a gimbal lock.\n * This means xRad and zRad can be anything as long as their sum xRad + zRad is constant.\n * so we can pick zRad = 0 and calculate xRad (or pick xRad = 0 and calculate zRad).\n * Therefore, rotation matrix becomes\n * Matrix3d.createRowValues(\n * 0, +-sx, +-cx,\n * 0, cx, -sx,\n * -+1, 0, 0\n * );\n * Math details can be found\n * https://en.wikipedia.org/wiki/Gimbal_lock#Loss_of_a_degree_of_freedom_with_Euler_angles\n */\n xRad = Math.atan2(-m23, m22);\n zRad = 0;\n }\n break;\n } case AxisOrder.YXZ: {\n xRad = Math.asin(Math.max(-1, Math.min(1, m32))); // limit asin domain to [-1,1]\n\n if (Math.abs(m32) < 0.99999) {\n yRad = Math.atan2(-m31, m33);\n zRad = Math.atan2(-m12, m22);\n } else {\n yRad = Math.atan2(m13, m11);\n zRad = 0;\n }\n break;\n } case AxisOrder.ZXY: {\n xRad = Math.asin(Math.max(-1, Math.min(1, -m23))); // limit asin domain to [-1,1]\n\n if (Math.abs(m23) < 0.99999) {\n yRad = Math.atan2(m13, m33);\n zRad = Math.atan2(m21, m22);\n } else {\n yRad = 0;\n zRad = Math.atan2(-m12, m11);\n }\n break;\n } case AxisOrder.ZYX: {\n yRad = Math.asin(Math.max(-1, Math.min(1, m13))); // limit asin domain to [-1,1]\n\n if (Math.abs(m13) < 0.99999) {\n xRad = Math.atan2(-m23, m33);\n zRad = Math.atan2(-m12, m11);\n } else {\n xRad = 0;\n zRad = Math.atan2(m21, m22);\n }\n break;\n } case AxisOrder.YZX: {\n zRad = Math.asin(Math.max(-1, Math.min(1, -m12))); // limit asin domain to [-1,1]\n\n if (Math.abs(m12) < 0.99999) {\n xRad = Math.atan2(m32, m22);\n yRad = Math.atan2(m13, m11);\n } else {\n xRad = 0;\n yRad = Math.atan2(-m31, m33);\n }\n break;\n } case AxisOrder.XZY: {\n zRad = Math.asin(Math.max(-1, Math.min(1, m21))); // limit asin domain to [-1,1]\n\n if (Math.abs(m21) < 0.99999) {\n xRad = Math.atan2(-m23, m22);\n yRad = Math.atan2(-m31, m11);\n } else {\n xRad = Math.atan2(m32, m33);\n yRad = 0;\n }\n break;\n } default: {\n xRad = yRad = zRad = 0;\n }\n }\n const xyzRotationIsClockwise: [boolean, boolean, boolean] = [false, false, false];\n const angles = OrderedRotationAngles.createRadians(xRad, yRad, zRad, order, xyzRotationIsClockwise, result);\n // sanity check\n const matrix1 = angles.toMatrix3d();\n /**\n * Below tolerance loosened to allow sanity check to pass for\n *\n * OrderedRotationAngles.createFromMatrix3d(\n * OrderedRotationAngles.createDegrees(0, 89.999, 0.001, AxisOrder.XYZ).toMatrix3d(),\n * AxisOrder.XYZ\n * );\n *\n * with treatVectorsAsColumns = true.\n */\n return (matrix.maxDiff(matrix1) < 10 * Geometry.smallFraction) ? angles : undefined;\n }\n /**\n * Create a 3x3 rotational matrix from this OrderedRotationAngles.\n ** math details can be found at docs/learning/geometry/Angle.md\n **/\n public toMatrix3d(result?: Matrix3d): Matrix3d {\n const rot = (result !== undefined) ? result : new Matrix3d();\n const axisOrder = this.order;\n const x = this.xAngle, y = this.yAngle, z = this.zAngle;\n\n const cx = x.cos(), sx = x.sin();\n const cy = y.cos(), sy = y.sin();\n const cz = z.cos(), sz = z.sin();\n\n const cxcz = cx * cz, cxsz = cx * sz, cxcy = cx * cy, cxsy = cx * sy;\n const sxcz = sx * cz, sxsz = sx * sz, sxcy = sx * cy, sxsy = sx * sy;\n const cycz = cy * cz, cysz = cy * sz, sycz = sy * cz, sysz = sy * sz;\n\n // the rotation matrix we build below is created using column-based base rotation matrixes\n if (axisOrder === AxisOrder.XYZ) {\n rot.setRowValues(\n cy * cz, sxcz * sy - cxsz, cxcz * sy + sxsz,\n cy * sz, cxcz + sxsz * sy, cxsz * sy - sxcz,\n -sy, sx * cy, cx * cy,\n );\n } else if (axisOrder === AxisOrder.YXZ) {\n rot.setRowValues(\n cycz - sysz * sx, -cx * sz, cysz * sx + sycz,\n sycz * sx + cysz, cx * cz, sysz - cycz * sx,\n -cx * sy, sx, cx * cy,\n );\n } else if (axisOrder === AxisOrder.ZXY) {\n rot.setRowValues(\n cycz + sysz * sx, sycz * sx - cysz, cx * sy,\n cx * sz, cx * cz, -sx,\n cysz * sx - sycz, cycz * sx + sysz, cx * cy,\n );\n } else if (axisOrder === AxisOrder.ZYX) {\n rot.setRowValues(\n cy * cz, -cy * sz, sy,\n sxcz * sy + cxsz, cxcz - sxsz * sy, -sx * cy,\n sxsz - cxcz * sy, sxcz + cxsz * sy, cx * cy,\n );\n } else if (axisOrder === AxisOrder.YZX) {\n rot.setRowValues(\n cy * cz, -sz, sy * cz,\n sxsy + cxcy * sz, cx * cz, cxsy * sz - sxcy,\n sxcy * sz - cxsy, sx * cz, cxcy + sxsy * sz,\n );\n } else if (axisOrder === AxisOrder.XZY) {\n rot.setRowValues(\n cy * cz, sxsy - cxcy * sz, cxsy + sxcy * sz,\n sz, cx * cz, -sx * cz,\n -sy * cz, sxcy + cxsy * sz, cxcy - sxsy * sz,\n );\n } else {\n rot.setIdentity();\n }\n // if we need row-based rotation matrix, we transpose the rotation matrix\n if (!OrderedRotationAngles.treatVectorsAsColumns)\n rot.transposeInPlace();\n\n return rot;\n }\n}\n"]}
1
+ {"version":3,"file":"OrderedRotationAngles.js","sourceRoot":"","sources":["../../../src/geometry3d/OrderedRotationAngles.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;;;AAE/F;;GAEG;AACH,0CAAkD;AAClD,mCAAgC;AAChC,yCAAsC;AAEtC,wFAAwF;AAExF;;;;;;;;;;GAUG;AACH,MAAa,qBAAqB;IAShC,sCAAsC;aACvB,4BAAuB,GAAY,KAAK,CAAC;IACxD,kBAAkB;IAClB,YAAoB,CAAQ,EAAE,CAAQ,EAAE,CAAQ,EAAE,SAAoB;QACpE,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,EAAE,GAAG,CAAC,CAAC;QACZ,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;IAC1B,CAAC;IACD,0FAA0F;IAC1F,IAAW,KAAK;QACd,OAAO,IAAI,CAAC,MAAM,CAAC;IACrB,CAAC;IACD,gFAAgF;IAChF,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC;IACzB,CAAC;IACD,gFAAgF;IAChF,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,EAAE,CAAC,KAAK,EAAE,C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,GAAG,IAAI,GAAG,EAAE,CAC5C,CAAC;QACJ,CAAC;aAAM,IAAI,SAAS,KAAK,oBAAS,CAAC,GAAG,EAAE,CAAC;YACvC,GAAG,CAAC,YAAY,CACd,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,EAC3C,EAAE,EAAE,EAAE,GAAG,EAAE,EAAE,CAAC,EAAE,GAAG,EAAE,EACrB,CAAC,EAAE,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,EAAE,IAAI,GAAG,IAAI,GAAG,EAAE,CAC7C,CAAC;QACJ,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC;QACD,yEAAyE;QACzE,IAAI,CAAC,qBAAqB,CAAC,qBAAqB;YAC9C,GAAG,CAAC,gBAAgB,EAAE,CAAC;QAEzB,OAAO,GAAG,CAAC;IACb,CAAC;;AAvVH,sDAwVC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\nimport { AxisOrder, Geometry } from \"../Geometry\";\nimport { Angle } from \"./Angle\";\nimport { Matrix3d } from \"./Matrix3d\";\n\n/* cspell:word cxcz, cxsz, cxcy, cxsy, sxcz, sxsz, sxcy, sxsy, cycz, cysz, sycz, sysz */\n\n/**\n * Represents a non-trivial rotation using three simple axis rotation angles and an order in which to apply them.\n * * This class accommodates application-specific interpretation of \"multiplying 3 rotation matrices\" with regard to\n * * Whether a \"vector\" is a \"row\" or a \"column\"\n * * The order in which the X,Y,Z rotations are applied.\n * * This class bakes in angle rotation directions via create functions (i.e., createRadians, createDegrees, and\n * createAngles) so you can define each of the 3 rotations to be clockwise or counterclockwise. The default\n * rotation is counterclockwise.\n * * Within the imodel geometry library, the preferred rotation order is encapsulated in `YawPitchRollAngles`.\n * @alpha\n */\nexport class OrderedRotationAngles {\n /** rotation around x */\n private _x: Angle;\n /** rotation around y */\n private _y: Angle;\n /** rotation around z */\n private _z: Angle;\n /** rotation order. For example XYZ means to rotate around x axis first, then y axis, and finally Z axis */\n private _order: AxisOrder;\n /** treat vectors as matrix columns */\n private static _sTreatVectorsAsColumns: boolean = false;\n /** constructor */\n private constructor(x: Angle, y: Angle, z: Angle, axisOrder: AxisOrder) {\n this._x = x;\n this._y = y;\n this._z = z;\n this._order = axisOrder;\n }\n /** (Property accessor) Return the `AxisOrder` controlling matrix multiplication order. */\n public get order(): AxisOrder {\n return this._order;\n }\n /** (Property accessor) Return the strongly typed angle of rotation around x. */\n public get xAngle(): Angle {\n return this._x.clone();\n }\n /** (Property accessor) Return the strongly typed angle of rotation around y. */\n public get yAngle(): Angle {\n return this._y.clone();\n }\n /** (Property accessor) Return the strongly typed angle of rotation around z. */\n public get zAngle(): Angle {\n return this._z.clone();\n }\n /** (Property accessor) Return the angle of rotation around x, in degrees */\n public get xDegrees(): number {\n return this._x.degrees;\n }\n /** (Property accessor) Return the angle of rotation around y, in degrees */\n public get xRadians(): number {\n return this._x.radians;\n }\n /** (Property accessor) Return the angle of rotation around z, in degrees */\n public get yDegrees(): number {\n return this._y.degrees;\n }\n /** (Property accessor) Return the angle of rotation around x, in radians */\n public get yRadians(): number {\n return this._y.radians;\n }\n /** (Property accessor) Return the angle of rotation around y, in radians */\n public get zDegrees(): number {\n return this._z.degrees;\n }\n /** (Property accessor) Return the angle of rotation around z, in radians */\n public get zRadians(): number {\n return this._z.radians;\n }\n /** The flag controlling whether vectors are treated as rows or as columns */\n public static get treatVectorsAsColumns(): boolean {\n return OrderedRotationAngles._sTreatVectorsAsColumns;\n }\n public static set treatVectorsAsColumns(value: boolean) {\n OrderedRotationAngles._sTreatVectorsAsColumns = value;\n }\n /**\n * Create an OrderedRotationAngles from three angles (in radians), an ordering in which to apply them when\n * rotating, and a flag triple controlling whether direction of x,y,z is clockwise or counterclockwise.\n * @param xRadians rotation around x\n * @param yRadians rotation around y\n * @param zRadians rotation around z\n * @param order left to right order of axis names identifies the order that rotations are applied.\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\n * matrix multiplication would be zRot*yRot*xRot\n * * Visualization can be found at https://www.itwinjs.org/sandbox/SaeedTorabi/CubeRotationAroundStandardAxes\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\n * @param result caller-allocated OrderedRotationAngles\n */\n public static createRadians(xRadians: number, yRadians: number, zRadians: number, order: AxisOrder,\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\n if (!xyzRotationIsClockwise) {\n xyzRotationIsClockwise = [false, false, false];\n }\n const xRadian = xyzRotationIsClockwise[0] ? -xRadians : xRadians;\n const yRadian = xyzRotationIsClockwise[1] ? -yRadians : yRadians;\n const zRadian = xyzRotationIsClockwise[2] ? -zRadians : zRadians;\n if (result) {\n result._x.setRadians(xRadian);\n result._y.setRadians(yRadian);\n result._z.setRadians(zRadian);\n result._order = order;\n return result;\n }\n return new OrderedRotationAngles(\n Angle.createRadians(xRadian),\n Angle.createRadians(yRadian),\n Angle.createRadians(zRadian),\n order,\n );\n }\n /**\n * Create an OrderedRotationAngles from three angles (in degrees) and an ordering in which to apply\n * them when rotating.\n * @param xDegrees rotation around x\n * @param yDegrees rotation around y\n * @param zDegrees rotation around z\n * @param order left to right order of axis names identifies the order that rotations are applied.\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\n * matrix multiplication would be zRot*yRot*xRot\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\n * @param result caller-allocated OrderedRotationAngles\n */\n public static createDegrees(xDegrees: number, yDegrees: number, zDegrees: number, order: AxisOrder,\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\n return OrderedRotationAngles.createRadians(\n Angle.degreesToRadians(xDegrees),\n Angle.degreesToRadians(yDegrees),\n Angle.degreesToRadians(zDegrees),\n order,\n xyzRotationIsClockwise,\n result,\n );\n }\n /**\n * Create an OrderedRotationAngles from three angles, an ordering in which to apply them when rotating,\n * and a flag triple controlling whether direction of x,y,z is clockwise or counterclockwise.\n * @param xRotation rotation around x\n * @param yRotation rotation around y\n * @param zRotation rotation around z\n * @param order left to right order of axis names identifies the order that rotations are applied\n * For example XYZ means to rotate around x axis first, then y axis, and finally Z axis.\n * * Note that rotation order is reverse of rotation matrix multiplication so for XYZ the rotation\n * matrix multiplication would be zRot*yRot*xRot\n * @param xyzRotationIsClockwise the flags controlling whether direction of x,y,z is clockwise or counterclockwise.\n * rotation direction of x,y,z: true ---> clockwise - false ---> counterclockwise.\n * * if xyzRotationIsClockwise is undefined it's set to [false, false, false].\n * @param result caller-allocated OrderedRotationAngles\n */\n public static createAngles(xRotation: Angle, yRotation: Angle, zRotation: Angle, order: AxisOrder,\n xyzRotationIsClockwise?: [boolean, boolean, boolean], result?: OrderedRotationAngles): OrderedRotationAngles {\n return OrderedRotationAngles.createRadians(\n xRotation.radians,\n yRotation.radians,\n zRotation.radians,\n order,\n xyzRotationIsClockwise,\n result,\n );\n }\n /**\n * Create an OrderedRotationAngles from a 3x3 rotational matrix, given the ordering of axis rotations\n * that the matrix derives from.\n * * This function creates an OrderedRotationAngles with default angle rotation directions, i.e.,\n * it assumes all x, y, and z rotations are counterclockwise.\n * * In the failure case the method's return value is `undefined`.\n * * In the failure case, if the optional result was supplied, that result will nonetheless be filled with\n * a set of angles.\n */\n public static createFromMatrix3d(matrix: Matrix3d, order: AxisOrder, result?: OrderedRotationAngles):\n OrderedRotationAngles | undefined {\n // treat vector as columns\n let m11 = matrix.coffs[0], m12 = matrix.coffs[1], m13 = matrix.coffs[2];\n let m21 = matrix.coffs[3], m22 = matrix.coffs[4], m23 = matrix.coffs[5];\n let m31 = matrix.coffs[6], m32 = matrix.coffs[7], m33 = matrix.coffs[8];\n // treat vector as rows\n if (!OrderedRotationAngles.treatVectorsAsColumns) {\n m11 = matrix.coffs[0], m12 = matrix.coffs[3], m13 = matrix.coffs[6];\n m21 = matrix.coffs[1], m22 = matrix.coffs[4], m23 = matrix.coffs[7];\n m31 = matrix.coffs[2], m32 = matrix.coffs[5], m33 = matrix.coffs[8];\n }\n\n let xRad: number;\n let yRad: number;\n let zRad: number;\n\n switch (order) {\n case AxisOrder.XYZ: {\n yRad = Math.asin(Math.max(-1, Math.min(1, -m31))); // limit asin domain to [-1,1]\n\n if (Math.abs(m31) < 0.99999) {\n xRad = Math.atan2(m32, m33);\n zRad = Math.atan2(m21, m11);\n } else {\n /**\n * If Math.abs(m31) = 1 then yRad = +-90 degrees and therefore, we have a gimbal lock.\n * This means xRad and zRad can be anything as long as their sum xRad + zRad is constant.\n * so we can pick zRad = 0 and calculate xRad (or pick xRad = 0 and calculate zRad).\n * Therefore, rotation matrix becomes\n * Matrix3d.createRowValues(\n * 0, +-sx, +-cx,\n * 0, cx, -sx,\n * -+1, 0, 0\n * );\n * Math details can be found\n * https://en.wikipedia.org/wiki/Gimbal_lock#Loss_of_a_degree_of_freedom_with_Euler_angles\n */\n xRad = Math.atan2(-m23, m22);\n zRad = 0;\n }\n break;\n } case AxisOrder.YXZ: {\n xRad = Math.asin(Math.max(-1, Math.min(1, m32))); // limit asin domain to [-1,1]\n\n if (Math.abs(m32) < 0.99999) {\n yRad = Math.atan2(-m31, m33);\n zRad = Math.atan2(-m12, m22);\n } else {\n yRad = Math.atan2(m13, m11);\n zRad = 0;\n }\n break;\n } case AxisOrder.ZXY: {\n xRad = Math.asin(Math.max(-1, Math.min(1, -m23))); // limit asin domain to [-1,1]\n\n if (Math.abs(m23) < 0.99999) {\n yRad = Math.atan2(m13, m33);\n zRad = Math.atan2(m21, m22);\n } else {\n yRad = 0;\n zRad = Math.atan2(-m12, m11);\n }\n break;\n } case AxisOrder.ZYX: {\n yRad = Math.asin(Math.max(-1, Math.min(1, m13))); // limit asin domain to [-1,1]\n\n if (Math.abs(m13) < 0.99999) {\n xRad = Math.atan2(-m23, m33);\n zRad = Math.atan2(-m12, m11);\n } else {\n xRad = 0;\n zRad = Math.atan2(m21, m22);\n }\n break;\n } case AxisOrder.YZX: {\n zRad = Math.asin(Math.max(-1, Math.min(1, -m12))); // limit asin domain to [-1,1]\n\n if (Math.abs(m12) < 0.99999) {\n xRad = Math.atan2(m32, m22);\n yRad = Math.atan2(m13, m11);\n } else {\n xRad = 0;\n yRad = Math.atan2(-m31, m33);\n }\n break;\n } case AxisOrder.XZY: {\n zRad = Math.asin(Math.max(-1, Math.min(1, m21))); // limit asin domain to [-1,1]\n\n if (Math.abs(m21) < 0.99999) {\n xRad = Math.atan2(-m23, m22);\n yRad = Math.atan2(-m31, m11);\n } else {\n xRad = Math.atan2(m32, m33);\n yRad = 0;\n }\n break;\n } default: {\n xRad = yRad = zRad = 0;\n }\n }\n const xyzRotationIsClockwise: [boolean, boolean, boolean] = [false, false, false];\n const angles = OrderedRotationAngles.createRadians(xRad, yRad, zRad, order, xyzRotationIsClockwise, result);\n // sanity check\n const matrix1 = angles.toMatrix3d();\n /**\n * Below tolerance loosened to allow sanity check to pass for\n *\n * OrderedRotationAngles.createFromMatrix3d(\n * OrderedRotationAngles.createDegrees(0, 89.999, 0.001, AxisOrder.XYZ).toMatrix3d(),\n * AxisOrder.XYZ\n * );\n *\n * with treatVectorsAsColumns = true.\n */\n return (matrix.maxDiff(matrix1) < 10 * Geometry.smallFraction) ? angles : undefined;\n }\n /**\n * Create a 3x3 rotational matrix from this OrderedRotationAngles.\n ** math details can be found at docs/learning/geometry/Angle.md\n **/\n public toMatrix3d(result?: Matrix3d): Matrix3d {\n const rot = (result !== undefined) ? result : new Matrix3d();\n const axisOrder = this.order;\n const x = this.xAngle, y = this.yAngle, z = this.zAngle;\n\n const cx = x.cos(), sx = x.sin();\n const cy = y.cos(), sy = y.sin();\n const cz = z.cos(), sz = z.sin();\n\n const cxcz = cx * cz, cxsz = cx * sz, cxcy = cx * cy, cxsy = cx * sy;\n const sxcz = sx * cz, sxsz = sx * sz, sxcy = sx * cy, sxsy = sx * sy;\n const cycz = cy * cz, cysz = cy * sz, sycz = sy * cz, sysz = sy * sz;\n\n // the rotation matrix we build below is created using column-based base rotation matrixes\n if (axisOrder === AxisOrder.XYZ) {\n rot.setRowValues(\n cy * cz, sxcz * sy - cxsz, cxcz * sy + sxsz,\n cy * sz, cxcz + sxsz * sy, cxsz * sy - sxcz,\n -sy, sx * cy, cx * cy,\n );\n } else if (axisOrder === AxisOrder.YXZ) {\n rot.setRowValues(\n cycz - sysz * sx, -cx * sz, cysz * sx + sycz,\n sycz * sx + cysz, cx * cz, sysz - cycz * sx,\n -cx * sy, sx, cx * cy,\n );\n } else if (axisOrder === AxisOrder.ZXY) {\n rot.setRowValues(\n cycz + sysz * sx, sycz * sx - cysz, cx * sy,\n cx * sz, cx * cz, -sx,\n cysz * sx - sycz, cycz * sx + sysz, cx * cy,\n );\n } else if (axisOrder === AxisOrder.ZYX) {\n rot.setRowValues(\n cy * cz, -cy * sz, sy,\n sxcz * sy + cxsz, cxcz - sxsz * sy, -sx * cy,\n sxsz - cxcz * sy, sxcz + cxsz * sy, cx * cy,\n );\n } else if (axisOrder === AxisOrder.YZX) {\n rot.setRowValues(\n cy * cz, -sz, sy * cz,\n sxsy + cxcy * sz, cx * cz, cxsy * sz - sxcy,\n sxcy * sz - cxsy, sx * cz, cxcy + sxsy * sz,\n );\n } else if (axisOrder === AxisOrder.XZY) {\n rot.setRowValues(\n cy * cz, sxsy - cxcy * sz, cxsy + sxcy * sz,\n sz, cx * cz, -sx * cz,\n -sy * cz, sxcy + cxsy * sz, cxcy - sxsy * sz,\n );\n } else {\n rot.setIdentity();\n }\n // if we need row-based rotation matrix, we transpose the rotation matrix\n if (!OrderedRotationAngles.treatVectorsAsColumns)\n rot.transposeInPlace();\n\n return rot;\n }\n}\n"]}
@@ -25,7 +25,7 @@ class Point3dArrayCarrier extends IndexedXYZCollection_1.IndexedReadWriteXYZColl
25
25
  }
26
26
  /** Test if `index` is a valid index into the array. */
27
27
  isValidIndex(index) {
28
- return index >= 0 && index < this.data.length;
28
+ return this.isIndexValid(index);
29
29
  }
30
30
  /**
31
31
  * Access by index, returning strongly typed Point3d
@@ -1 +1 @@
1
- {"version":3,"file":"Point3dArrayCarrier.js","sourceRoot":"","sources":["../../../src/geometry3d/Point3dArrayCarrier.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,iEAAuE;AACvE,uDAAsD;AAGtD;;;;;;GAMG;AACH,MAAa,mBAAoB,SAAQ,oDAA6B;IAGpE,wCAAwC;IACxC,YAAmB,IAAe;QAChC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IACD,uDAAuD;IAChD,YAAY,CAAC,KAAa;QAC/B,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;IAChD,CAAC;IACD;;;;;;OAMG;IACI,6BAA6B,CAAC,KAAa,EAAE,MAAgB;QAClE,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChC,OAAO,yBAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAC9D,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IACtB,CAAC;IACD;;;;OAIG;IACI,yBAAyB,CAAC,MAAc,EAAE,MAAc;QAC7D,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;OAIG;IACI,kBAAkB,CAAC,MAAc,EAAE,MAAc;QACtD,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,yDAAyD;IACzC,WAAW,CAAC,CAAS;QACnC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;CACF;AAnOD,kDAmOC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ArraysAndInterfaces\n */\n\nimport { IndexedReadWriteXYZCollection } from \"./IndexedXYZCollection\";\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\nimport { XYAndZ } from \"./XYZProps\";\n\n/**\n * Helper object to access members of a Point3d[] in geometric calculations.\n * * The collection holds only a reference to the actual array.\n * * The actual array may be replaced by the user as needed.\n * * When replaced, there is no cached data to be updated.\n * @public\n */\nexport class Point3dArrayCarrier extends IndexedReadWriteXYZCollection {\n /** Reference to array being queried. */\n public data: Point3d[];\n /** CAPTURE caller supplied array ... */\n public constructor(data: Point3d[]) {\n super();\n this.data = data;\n }\n /** Test if `index` is a valid index into the array. */\n public isValidIndex(index: number): boolean {\n return index >= 0 && index < this.data.length;\n }\n /**\n * Access by index, returning strongly typed Point3d\n * * This returns the xyz value but NOT reference to the point in the \"carried\" array.\n * @param index index of point within the array\n * @param result caller-allocated destination\n * @returns undefined if the index is out of bounds\n */\n public getPoint3dAtCheckedPointIndex(index: number, result?: Point3d): Point3d | undefined {\n if (this.isValidIndex(index)) {\n const source = this.data[index];\n return Point3d.create(source.x, source.y, source.z, result);\n }\n return undefined;\n }\n /**\n * Access by index, returning strongly typed Point3d\n * * This returns the xyz value but NOT reference to the point in the \"carried\" array.\n * @param index index of point within the array\n * @param result caller-allocated destination\n */\n public getPoint3dAtUncheckedPointIndex(index: number, result?: Point3d): Point3d {\n const source = this.data[index];\n return Point3d.create(source.x, source.y, source.z, result);\n }\n /**\n * Access by index, returning strongly typed Vector3d\n * @param index index of point within the array\n * @param result caller-allocated destination\n * @returns undefined if the index is out of bounds\n */\n public getVector3dAtCheckedVectorIndex(index: number, result?: Vector3d): Vector3d | undefined {\n if (this.isValidIndex(index)) {\n const source = this.data[index];\n return Vector3d.create(source.x, source.y, source.z, result);\n }\n return undefined;\n }\n /**\n * Access x of indexed point\n * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results\n */\n public getXAtUncheckedPointIndex(pointIndex: number): number {\n return this.data[pointIndex].x;\n }\n /**\n * Access y of indexed point\n * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results\n */\n public getYAtUncheckedPointIndex(pointIndex: number): number {\n return this.data[pointIndex].y;\n }\n /**\n * Access z of indexed point\n * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results\n */\n public getZAtUncheckedPointIndex(pointIndex: number): number {\n return this.data[pointIndex].z;\n }\n /**\n * Return a vector from the point at indexA to the point at indexB\n * @param indexA index of point within the array\n * @param indexB index of point within the array\n * @param result caller-allocated vector.\n * @returns undefined if either index is out of bounds\n */\n public vectorIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined {\n if (this.isValidIndex(indexA) && this.isValidIndex(indexB))\n return Vector3d.createStartEnd(this.data[indexA], this.data[indexB], result);\n return undefined;\n }\n /**\n * Return a vector from given origin to point at indexB\n * @param origin origin for vector\n * @param indexB index of point within the array\n * @param result caller-allocated vector.\n * @returns undefined if index is out of bounds\n */\n public vectorXYAndZIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d | undefined {\n if (this.isValidIndex(indexB))\n return Vector3d.createStartEnd(origin, this.data[indexB], result);\n return undefined;\n }\n /**\n * Return the cross product of vectors from origin to points at indexA and indexB\n * @param origin origin for vector\n * @param indexA index of first target within the array\n * @param indexB index of second target within the array\n * @param result caller-allocated vector.\n * @returns undefined if either index is out of bounds\n */\n public crossProductXYAndZIndexIndex(\n origin: XYAndZ, indexA: number, indexB: number, result?: Vector3d,\n ): Vector3d | undefined {\n if (this.isValidIndex(indexA) && this.isValidIndex(indexB))\n return Vector3d.createCrossProductToPoints(origin, this.data[indexA], this.data[indexB], result);\n return undefined;\n }\n /**\n * Return the cross product of vectors from point at originIndex to points at indexA and indexB\n * @param originIndex index of origin\n * @param indexA index of first target within the array\n * @param indexB index of second target within the array\n * @param result caller-allocated vector.\n * @returns return true if indexA, indexB both valid\n */\n public crossProductIndexIndexIndex(\n originIndex: number, indexA: number, indexB: number, result?: Vector3d,\n ): Vector3d | undefined {\n if (this.isValidIndex(originIndex) && this.isValidIndex(indexA) && this.isValidIndex(indexB))\n return Vector3d.createCrossProductToPoints(this.data[originIndex], this.data[indexA], this.data[indexB], result);\n return undefined;\n }\n /**\n * Compute the cross product of vectors from point at originIndex to points at indexA and indexB, and accumulate it to the result.\n * @param origin index of origin\n * @param indexA index of first target within the array\n * @param indexB index of second target within the array\n * @param result caller-allocated vector.\n * @returns return true if indexA, indexB both valid\n */\n public accumulateCrossProductIndexIndexIndex(originIndex: number, indexA: number, indexB: number, result: Vector3d): void {\n const data = this.data;\n if (this.isValidIndex(originIndex) && this.isValidIndex(indexA) && this.isValidIndex(indexB))\n result.addCrossProductToTargetsInPlace(\n data[originIndex].x, data[originIndex].y, data[originIndex].z,\n data[indexA].x, data[indexA].y, data[indexA].z,\n data[indexB].x, data[indexB].y, data[indexB].z,\n );\n }\n /** Accumulate scale times the x,y,z values at index to the sum. No action if index is out of bounds */\n public accumulateScaledXYZ(index: number, scale: number, sum: Point3d): void {\n if (this.isValidIndex(index)) {\n const point = this.data[index];\n sum.x += scale * point.x;\n sum.y += scale * point.y;\n sum.z += scale * point.z;\n }\n }\n /** Read-only property for number of XYZ in the collection */\n public get length(): number {\n return this.data.length;\n }\n /**\n * Push a (clone of) point onto the collection\n * * point itself is not pushed -- xyz data is extracted into the native form of the collection.\n */\n public push(data: Point3d): void {\n this.data.push(data.clone());\n }\n /**\n * Push a new point (given by coordinates) onto the collection\n * @param x x coordinate\n * @param y y coordinate\n * @param z z coordinate\n */\n public pushXYZ(x?: number, y?: number, z?: number): void {\n this.data.push(\n Point3d.create(x === undefined ? 0.0 : x, y === undefined ? 0.0 : y, z === undefined ? 0.0 : z),\n );\n }\n /** Extract (copy) the final point */\n public override back(result?: Point3d): Point3d | undefined {\n if (this.data.length > 0) {\n return this.data[this.data.length - 1].clone(result);\n }\n return undefined;\n }\n /** Extract (copy) the first point */\n public override front(result?: Point3d): Point3d | undefined {\n if (this.data.length > 0) {\n return this.data[0].clone(result);\n }\n return undefined;\n }\n /** Remove the final point. */\n public pop(): void {\n if (this.data.length > 0)\n this.data.pop();\n }\n /** Remove all points. */\n public clear(): void {\n this.data.length = 0;\n }\n /** Reverse the points in place */\n public reverseInPlace(): void {\n this.data.reverse();\n }\n /**\n * Return distance squared between indicated points.\n * @param index0 first point index\n * @param index1 second point index\n */\n public distanceSquaredIndexIndex(index0: number, index1: number): number | undefined {\n const n = this.data.length;\n if (index0 >= 0 && index0 < n && index1 >= 0 && index1 < n) {\n return this.data[index0].distanceSquared(this.data[index1]);\n }\n return undefined;\n }\n /**\n * Return distance between indicated points.\n * @param index0 first point index\n * @param index1 second point index\n */\n public distanceIndexIndex(index0: number, index1: number): number | undefined {\n const n = this.data.length;\n if (index0 >= 0 && index0 < n && index1 >= 0 && index1 < n) {\n return this.data[index0].distance(this.data[index1]);\n }\n return undefined;\n }\n /** Adjust index into range by modulo with the length. */\n public override cyclicIndex(i: number): number {\n return (i % this.data.length);\n }\n}\n"]}
1
+ {"version":3,"file":"Point3dArrayCarrier.js","sourceRoot":"","sources":["../../../src/geometry3d/Point3dArrayCarrier.ts"],"names":[],"mappings":";AAAA;;;+FAG+F;AAC/F;;GAEG;;;AAEH,iEAAuE;AACvE,uDAAsD;AAGtD;;;;;;GAMG;AACH,MAAa,mBAAoB,SAAQ,oDAA6B;IAGpE,wCAAwC;IACxC,YAAmB,IAAe;QAChC,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IACD,uDAAuD;IAChD,YAAY,CAAC,KAAa;QAC/B,OAAO,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;IAClC,CAAC;IACD;;;;;;OAMG;IACI,6BAA6B,CAAC,KAAa,EAAE,MAAgB;QAClE,IAAI,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAChC,OAAO,yBAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,SAAS,CAAC;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I,yBAAyB,CAAC,MAAc,EAAE,MAAc;QAC7D,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAC9D,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD;;;;OAIG;IACI,kBAAkB,CAAC,MAAc,EAAE,MAAc;QACtD,MAAM,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC;QAC3B,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,IAAI,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE,CAAC;YAC3D,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QACvD,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,yDAAyD;IACzC,WAAW,CAAC,CAAS;QACnC,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAChC,CAAC;CACF;AAnOD,kDAmOC","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module ArraysAndInterfaces\n */\n\nimport { IndexedReadWriteXYZCollection } from \"./IndexedXYZCollection\";\nimport { Point3d, Vector3d } from \"./Point3dVector3d\";\nimport { XYAndZ } from \"./XYZProps\";\n\n/**\n * Helper object to access members of a Point3d[] in geometric calculations.\n * * The collection holds only a reference to the actual array.\n * * The actual array may be replaced by the user as needed.\n * * When replaced, there is no cached data to be updated.\n * @public\n */\nexport class Point3dArrayCarrier extends IndexedReadWriteXYZCollection {\n /** Reference to array being queried. */\n public data: Point3d[];\n /** CAPTURE caller supplied array ... */\n public constructor(data: Point3d[]) {\n super();\n this.data = data;\n }\n /** Test if `index` is a valid index into the array. */\n public isValidIndex(index: number): boolean {\n return this.isIndexValid(index);\n }\n /**\n * Access by index, returning strongly typed Point3d\n * * This returns the xyz value but NOT reference to the point in the \"carried\" array.\n * @param index index of point within the array\n * @param result caller-allocated destination\n * @returns undefined if the index is out of bounds\n */\n public getPoint3dAtCheckedPointIndex(index: number, result?: Point3d): Point3d | undefined {\n if (this.isValidIndex(index)) {\n const source = this.data[index];\n return Point3d.create(source.x, source.y, source.z, result);\n }\n return undefined;\n }\n /**\n * Access by index, returning strongly typed Point3d\n * * This returns the xyz value but NOT reference to the point in the \"carried\" array.\n * @param index index of point within the array\n * @param result caller-allocated destination\n */\n public getPoint3dAtUncheckedPointIndex(index: number, result?: Point3d): Point3d {\n const source = this.data[index];\n return Point3d.create(source.x, source.y, source.z, result);\n }\n /**\n * Access by index, returning strongly typed Vector3d\n * @param index index of point within the array\n * @param result caller-allocated destination\n * @returns undefined if the index is out of bounds\n */\n public getVector3dAtCheckedVectorIndex(index: number, result?: Vector3d): Vector3d | undefined {\n if (this.isValidIndex(index)) {\n const source = this.data[index];\n return Vector3d.create(source.x, source.y, source.z, result);\n }\n return undefined;\n }\n /**\n * Access x of indexed point\n * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results\n */\n public getXAtUncheckedPointIndex(pointIndex: number): number {\n return this.data[pointIndex].x;\n }\n /**\n * Access y of indexed point\n * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results\n */\n public getYAtUncheckedPointIndex(pointIndex: number): number {\n return this.data[pointIndex].y;\n }\n /**\n * Access z of indexed point\n * * WARNING: make sure `pointIndex` is a valid index, otherwise, you get random results\n */\n public getZAtUncheckedPointIndex(pointIndex: number): number {\n return this.data[pointIndex].z;\n }\n /**\n * Return a vector from the point at indexA to the point at indexB\n * @param indexA index of point within the array\n * @param indexB index of point within the array\n * @param result caller-allocated vector.\n * @returns undefined if either index is out of bounds\n */\n public vectorIndexIndex(indexA: number, indexB: number, result?: Vector3d): Vector3d | undefined {\n if (this.isValidIndex(indexA) && this.isValidIndex(indexB))\n return Vector3d.createStartEnd(this.data[indexA], this.data[indexB], result);\n return undefined;\n }\n /**\n * Return a vector from given origin to point at indexB\n * @param origin origin for vector\n * @param indexB index of point within the array\n * @param result caller-allocated vector.\n * @returns undefined if index is out of bounds\n */\n public vectorXYAndZIndex(origin: XYAndZ, indexB: number, result?: Vector3d): Vector3d | undefined {\n if (this.isValidIndex(indexB))\n return Vector3d.createStartEnd(origin, this.data[indexB], result);\n return undefined;\n }\n /**\n * Return the cross product of vectors from origin to points at indexA and indexB\n * @param origin origin for vector\n * @param indexA index of first target within the array\n * @param indexB index of second target within the array\n * @param result caller-allocated vector.\n * @returns undefined if either index is out of bounds\n */\n public crossProductXYAndZIndexIndex(\n origin: XYAndZ, indexA: number, indexB: number, result?: Vector3d,\n ): Vector3d | undefined {\n if (this.isValidIndex(indexA) && this.isValidIndex(indexB))\n return Vector3d.createCrossProductToPoints(origin, this.data[indexA], this.data[indexB], result);\n return undefined;\n }\n /**\n * Return the cross product of vectors from point at originIndex to points at indexA and indexB\n * @param originIndex index of origin\n * @param indexA index of first target within the array\n * @param indexB index of second target within the array\n * @param result caller-allocated vector.\n * @returns return true if indexA, indexB both valid\n */\n public crossProductIndexIndexIndex(\n originIndex: number, indexA: number, indexB: number, result?: Vector3d,\n ): Vector3d | undefined {\n if (this.isValidIndex(originIndex) && this.isValidIndex(indexA) && this.isValidIndex(indexB))\n return Vector3d.createCrossProductToPoints(this.data[originIndex], this.data[indexA], this.data[indexB], result);\n return undefined;\n }\n /**\n * Compute the cross product of vectors from point at originIndex to points at indexA and indexB, and accumulate it to the result.\n * @param origin index of origin\n * @param indexA index of first target within the array\n * @param indexB index of second target within the array\n * @param result caller-allocated vector.\n * @returns return true if indexA, indexB both valid\n */\n public accumulateCrossProductIndexIndexIndex(originIndex: number, indexA: number, indexB: number, result: Vector3d): void {\n const data = this.data;\n if (this.isValidIndex(originIndex) && this.isValidIndex(indexA) && this.isValidIndex(indexB))\n result.addCrossProductToTargetsInPlace(\n data[originIndex].x, data[originIndex].y, data[originIndex].z,\n data[indexA].x, data[indexA].y, data[indexA].z,\n data[indexB].x, data[indexB].y, data[indexB].z,\n );\n }\n /** Accumulate scale times the x,y,z values at index to the sum. No action if index is out of bounds */\n public accumulateScaledXYZ(index: number, scale: number, sum: Point3d): void {\n if (this.isValidIndex(index)) {\n const point = this.data[index];\n sum.x += scale * point.x;\n sum.y += scale * point.y;\n sum.z += scale * point.z;\n }\n }\n /** Read-only property for number of XYZ in the collection */\n public get length(): number {\n return this.data.length;\n }\n /**\n * Push a (clone of) point onto the collection\n * * point itself is not pushed -- xyz data is extracted into the native form of the collection.\n */\n public push(data: Point3d): void {\n this.data.push(data.clone());\n }\n /**\n * Push a new point (given by coordinates) onto the collection\n * @param x x coordinate\n * @param y y coordinate\n * @param z z coordinate\n */\n public pushXYZ(x?: number, y?: number, z?: number): void {\n this.data.push(\n Point3d.create(x === undefined ? 0.0 : x, y === undefined ? 0.0 : y, z === undefined ? 0.0 : z),\n );\n }\n /** Extract (copy) the final point */\n public override back(result?: Point3d): Point3d | undefined {\n if (this.data.length > 0) {\n return this.data[this.data.length - 1].clone(result);\n }\n return undefined;\n }\n /** Extract (copy) the first point */\n public override front(result?: Point3d): Point3d | undefined {\n if (this.data.length > 0) {\n return this.data[0].clone(result);\n }\n return undefined;\n }\n /** Remove the final point. */\n public pop(): void {\n if (this.data.length > 0)\n this.data.pop();\n }\n /** Remove all points. */\n public clear(): void {\n this.data.length = 0;\n }\n /** Reverse the points in place */\n public reverseInPlace(): void {\n this.data.reverse();\n }\n /**\n * Return distance squared between indicated points.\n * @param index0 first point index\n * @param index1 second point index\n */\n public distanceSquaredIndexIndex(index0: number, index1: number): number | undefined {\n const n = this.data.length;\n if (index0 >= 0 && index0 < n && index1 >= 0 && index1 < n) {\n return this.data[index0].distanceSquared(this.data[index1]);\n }\n return undefined;\n }\n /**\n * Return distance between indicated points.\n * @param index0 first point index\n * @param index1 second point index\n */\n public distanceIndexIndex(index0: number, index1: number): number | undefined {\n const n = this.data.length;\n if (index0 >= 0 && index0 < n && index1 >= 0 && index1 < n) {\n return this.data[index0].distance(this.data[index1]);\n }\n return undefined;\n }\n /** Adjust index into range by modulo with the length. */\n public override cyclicIndex(i: number): number {\n return (i % this.data.length);\n }\n}\n"]}
@@ -524,10 +524,10 @@ export declare class Vector3d extends XYZ {
524
524
  */
525
525
  rotate90Around(axis: Vector3d, result?: Vector3d): Vector3d | undefined;
526
526
  /**
527
- * Return a vector computed at fractional position between this vector and vectorB
528
- * @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`.
529
- * True fractions are "between", negatives are "before this", beyond 1 is "beyond vectorB".
530
- * @param vectorB second vector
527
+ * Return a vector computed at fractional position between this vector and vectorB.
528
+ * @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`. True fractions are "between",
529
+ * negatives are "before this", beyond 1 is "beyond vectorB".
530
+ * @param vectorB second vector.
531
531
  * @param result optional preallocated result.
532
532
  */
533
533
  interpolate(fraction: number, vectorB: XYAndZ, result?: Vector3d): Vector3d;
@@ -781,8 +781,8 @@ export declare class Vector3d extends XYZ {
781
781
  * * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,
782
782
  * so if you have a distance or angle tolerance t, you should pass in t * t.
783
783
  * @param other second vector in comparison
784
- * @param oppositeIsParallel whether to consider diametrically opposed vectors as parallel
785
- * @param returnValueIfAnInputIsZeroLength if either vector is near zero length, return this value.
784
+ * @param oppositeIsParallel whether to consider diametrically opposed vectors as parallel. Default false.
785
+ * @param returnValueIfAnInputIsZeroLength if either vector is near zero length, return this value. Default false.
786
786
  * @param options optional radian and distance tolerances.
787
787
  */
788
788
  isParallelTo(other: Vector3d, oppositeIsParallel?: boolean, returnValueIfAnInputIsZeroLength?: boolean, options?: PerpParallelOptions): boolean;
@@ -1038,10 +1038,10 @@ class Vector3d extends XYZ {
1038
1038
  return unitNormal ? unitNormal.crossProduct(this).plusScaled(unitNormal, unitNormal.dotProduct(this), result) : undefined;
1039
1039
  }
1040
1040
  /**
1041
- * Return a vector computed at fractional position between this vector and vectorB
1042
- * @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`.
1043
- * True fractions are "between", negatives are "before this", beyond 1 is "beyond vectorB".
1044
- * @param vectorB second vector
1041
+ * Return a vector computed at fractional position between this vector and vectorB.
1042
+ * @param fraction fractional position. 0 is at `this`. 1 is at `vectorB`. True fractions are "between",
1043
+ * negatives are "before this", beyond 1 is "beyond vectorB".
1044
+ * @param vectorB second vector.
1045
1045
  * @param result optional preallocated result.
1046
1046
  */
1047
1047
  interpolate(fraction, vectorB, result) {
@@ -1481,8 +1481,8 @@ class Vector3d extends XYZ {
1481
1481
  * * The input tolerances in `options`, if given, are considered to be squared for efficiency's sake,
1482
1482
  * so if you have a distance or angle tolerance t, you should pass in t * t.
1483
1483
  * @param other second vector in comparison
1484
- * @param oppositeIsParallel whether to consider diametrically opposed vectors as parallel
1485
- * @param returnValueIfAnInputIsZeroLength if either vector is near zero length, return this value.
1484
+ * @param oppositeIsParallel whether to consider diametrically opposed vectors as parallel. Default false.
1485
+ * @param returnValueIfAnInputIsZeroLength if either vector is near zero length, return this value. Default false.
1486
1486
  * @param options optional radian and distance tolerances.
1487
1487
  */
1488
1488
  isParallelTo(other, oppositeIsParallel = false, returnValueIfAnInputIsZeroLength = false, options) {