@itwin/core-geometry 5.0.0-dev.6 → 5.0.0-dev.61

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 (928) hide show
  1. package/CHANGELOG.md +39 -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/AkimaCurve3d.js +3 -1
  7. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  8. package/lib/cjs/bspline/BSpline1dNd.js +18 -0
  9. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  10. package/lib/cjs/bspline/BSplineCurve.js +6 -2
  11. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  12. package/lib/cjs/bspline/BSplineCurve3dH.js +1 -0
  13. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  14. package/lib/cjs/bspline/BSplineCurveOps.d.ts.map +1 -1
  15. package/lib/cjs/bspline/BSplineCurveOps.js +18 -21
  16. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  17. package/lib/cjs/bspline/BSplineSurface.js +22 -2
  18. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  19. package/lib/cjs/bspline/Bezier1dNd.js +6 -0
  20. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  21. package/lib/cjs/bspline/BezierCurve3d.js +2 -0
  22. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  23. package/lib/cjs/bspline/BezierCurve3dH.js +2 -0
  24. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  25. package/lib/cjs/bspline/BezierCurveBase.d.ts.map +1 -1
  26. package/lib/cjs/bspline/BezierCurveBase.js +21 -2
  27. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  28. package/lib/cjs/bspline/InterpolationCurve3d.js +12 -1
  29. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  30. package/lib/cjs/bspline/KnotVector.d.ts +8 -6
  31. package/lib/cjs/bspline/KnotVector.d.ts.map +1 -1
  32. package/lib/cjs/bspline/KnotVector.js +21 -8
  33. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  34. package/lib/cjs/bspline/SurfaceLocationDetail.js +12 -0
  35. package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
  36. package/lib/cjs/clipping/AlternatingConvexClipTree.js +14 -13
  37. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  38. package/lib/cjs/clipping/BooleanClipNode.js +4 -0
  39. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  40. package/lib/cjs/clipping/ClipPlane.js +10 -1
  41. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  42. package/lib/cjs/clipping/ClipPrimitive.js +19 -0
  43. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  44. package/lib/cjs/clipping/ClipUtils.js +5 -1
  45. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  46. package/lib/cjs/clipping/ClipVector.js +11 -8
  47. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  48. package/lib/cjs/clipping/ConvexClipPlaneSet.js +5 -3
  49. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  50. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js +2 -1
  51. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  52. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js +3 -0
  53. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  54. package/lib/cjs/core-geometry.d.ts +1 -0
  55. package/lib/cjs/core-geometry.d.ts.map +1 -1
  56. package/lib/cjs/core-geometry.js +1 -0
  57. package/lib/cjs/core-geometry.js.map +1 -1
  58. package/lib/cjs/curve/Arc3d.d.ts +15 -3
  59. package/lib/cjs/curve/Arc3d.d.ts.map +1 -1
  60. package/lib/cjs/curve/Arc3d.js +47 -20
  61. package/lib/cjs/curve/Arc3d.js.map +1 -1
  62. package/lib/cjs/curve/ConstructCurveBetweenCurves.js +3 -0
  63. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  64. package/lib/cjs/curve/CoordinateXYZ.js +3 -2
  65. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  66. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts +0 -2
  67. package/lib/cjs/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  68. package/lib/cjs/curve/CurveChainWithDistanceIndex.js +25 -10
  69. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  70. package/lib/cjs/curve/CurveCollection.d.ts +10 -0
  71. package/lib/cjs/curve/CurveCollection.d.ts.map +1 -1
  72. package/lib/cjs/curve/CurveCollection.js +35 -9
  73. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  74. package/lib/cjs/curve/CurveFactory.d.ts +87 -53
  75. package/lib/cjs/curve/CurveFactory.d.ts.map +1 -1
  76. package/lib/cjs/curve/CurveFactory.js +213 -135
  77. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  78. package/lib/cjs/curve/CurveLocationDetail.js +44 -0
  79. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  80. package/lib/cjs/curve/CurvePrimitive.d.ts +7 -10
  81. package/lib/cjs/curve/CurvePrimitive.d.ts.map +1 -1
  82. package/lib/cjs/curve/CurvePrimitive.js +27 -12
  83. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  84. package/lib/cjs/curve/CurveProcessor.js +2 -0
  85. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  86. package/lib/cjs/curve/CurveWireMomentsXYZ.js +2 -0
  87. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  88. package/lib/cjs/curve/LineSegment3d.js +6 -2
  89. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  90. package/lib/cjs/curve/LineString3d.js +27 -7
  91. package/lib/cjs/curve/LineString3d.js.map +1 -1
  92. package/lib/cjs/curve/Loop.js +12 -4
  93. package/lib/cjs/curve/Loop.js.map +1 -1
  94. package/lib/cjs/curve/OffsetOptions.js +25 -21
  95. package/lib/cjs/curve/OffsetOptions.js.map +1 -1
  96. package/lib/cjs/curve/ParityRegion.js +4 -2
  97. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  98. package/lib/cjs/curve/Path.js +2 -2
  99. package/lib/cjs/curve/Path.js.map +1 -1
  100. package/lib/cjs/curve/PointString3d.js +3 -2
  101. package/lib/cjs/curve/PointString3d.js.map +1 -1
  102. package/lib/cjs/curve/ProxyCurve.js +1 -0
  103. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  104. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js +1 -0
  105. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  106. package/lib/cjs/curve/Query/CurveSplitContext.js +3 -0
  107. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  108. package/lib/cjs/curve/Query/CylindricalRange.js +6 -2
  109. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  110. package/lib/cjs/curve/Query/PlanarSubdivision.js +4 -6
  111. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  112. package/lib/cjs/curve/Query/StrokeCountChain.js +12 -0
  113. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  114. package/lib/cjs/curve/Query/StrokeCountMap.js +14 -0
  115. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  116. package/lib/cjs/curve/RegionMomentsXY.js +4 -5
  117. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  118. package/lib/cjs/curve/RegionOps.js +9 -10
  119. package/lib/cjs/curve/RegionOps.js.map +1 -1
  120. package/lib/cjs/curve/RegionOpsClassificationSweeps.js +24 -1
  121. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  122. package/lib/cjs/curve/StrokeOptions.d.ts +4 -4
  123. package/lib/cjs/curve/StrokeOptions.d.ts.map +1 -1
  124. package/lib/cjs/curve/StrokeOptions.js +23 -6
  125. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  126. package/lib/cjs/curve/UnionRegion.js +4 -2
  127. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  128. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js +13 -7
  129. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  130. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js +6 -0
  131. package/lib/cjs/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  132. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js +2 -0
  133. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  134. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js +13 -5
  135. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  136. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js +3 -0
  137. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  138. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js +18 -5
  139. package/lib/cjs/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  140. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js +26 -13
  141. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  142. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js +11 -5
  143. package/lib/cjs/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  144. package/lib/cjs/curve/internalContexts/CurveLengthContext.js +6 -0
  145. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  146. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js +8 -6
  147. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  148. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js +38 -5
  149. package/lib/cjs/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  150. package/lib/cjs/curve/internalContexts/GapSearchContext.js +1 -0
  151. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  152. package/lib/cjs/curve/internalContexts/MultiChainCollector.js +12 -0
  153. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  154. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js +1 -0
  155. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  156. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js +7 -0
  157. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  158. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js +22 -4
  159. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  160. package/lib/cjs/curve/internalContexts/SumLengthsContext.js +1 -0
  161. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  162. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js +3 -0
  163. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  164. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js +2 -0
  165. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  166. package/lib/cjs/curve/spiral/ClothoidSeries.js +4 -0
  167. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  168. package/lib/cjs/curve/spiral/CubicEvaluator.js +2 -0
  169. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  170. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js +4 -0
  171. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  172. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js +5 -0
  173. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  174. package/lib/cjs/curve/spiral/DirectSpiral3d.js +12 -2
  175. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  176. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js +24 -4
  177. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  178. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +2 -0
  179. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  180. package/lib/cjs/curve/spiral/NormalizedTransition.js +5 -0
  181. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  182. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js +2 -0
  183. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  184. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js +10 -0
  185. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  186. package/lib/cjs/curve/spiral/TransitionSpiral3d.js +10 -0
  187. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  188. package/lib/cjs/curve/spiral/XYCurveEvaluator.js +6 -0
  189. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  190. package/lib/cjs/geometry3d/Angle.js +18 -16
  191. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  192. package/lib/cjs/geometry3d/AngleSweep.d.ts +1 -1
  193. package/lib/cjs/geometry3d/AngleSweep.d.ts.map +1 -1
  194. package/lib/cjs/geometry3d/AngleSweep.js +3 -1
  195. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  196. package/lib/cjs/geometry3d/BarycentricTriangle.js +25 -0
  197. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  198. package/lib/cjs/geometry3d/BilinearPatch.js +8 -0
  199. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  200. package/lib/cjs/geometry3d/CoincidentGeometryOps.js +5 -0
  201. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  202. package/lib/cjs/geometry3d/Ellipsoid.js +48 -0
  203. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  204. package/lib/cjs/geometry3d/FrameBuilder.js +12 -4
  205. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  206. package/lib/cjs/geometry3d/FrustumAnimation.js +7 -0
  207. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  208. package/lib/cjs/geometry3d/GrowableBlockedArray.js +12 -0
  209. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  210. package/lib/cjs/geometry3d/GrowableFloat64Array.js +3 -0
  211. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  212. package/lib/cjs/geometry3d/GrowableXYArray.d.ts +0 -5
  213. package/lib/cjs/geometry3d/GrowableXYArray.d.ts.map +1 -1
  214. package/lib/cjs/geometry3d/GrowableXYArray.js +16 -7
  215. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  216. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts +32 -10
  217. package/lib/cjs/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  218. package/lib/cjs/geometry3d/GrowableXYZArray.js +70 -16
  219. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  220. package/lib/cjs/geometry3d/IndexedCollectionInterval.js +6 -0
  221. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  222. package/lib/cjs/geometry3d/IndexedXYCollection.js +1 -0
  223. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  224. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts +13 -2
  225. package/lib/cjs/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  226. package/lib/cjs/geometry3d/IndexedXYZCollection.js +26 -11
  227. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  228. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js +3 -0
  229. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  230. package/lib/cjs/geometry3d/Matrix3d.d.ts +3 -4
  231. package/lib/cjs/geometry3d/Matrix3d.d.ts.map +1 -1
  232. package/lib/cjs/geometry3d/Matrix3d.js +34 -12
  233. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  234. package/lib/cjs/geometry3d/OrderedRotationAngles.js +10 -2
  235. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  236. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +2 -0
  237. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  238. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +7 -0
  239. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  240. package/lib/cjs/geometry3d/Point2dArrayCarrier.js +2 -0
  241. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  242. package/lib/cjs/geometry3d/Point2dVector2d.js +4 -0
  243. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  244. package/lib/cjs/geometry3d/Point3dArrayCarrier.js +3 -1
  245. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  246. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +6 -6
  247. package/lib/cjs/geometry3d/Point3dVector3d.js +12 -6
  248. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  249. package/lib/cjs/geometry3d/PointHelpers.js +5 -5
  250. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  251. package/lib/cjs/geometry3d/PointStreaming.js +12 -4
  252. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  253. package/lib/cjs/geometry3d/PolygonOps.d.ts +2 -2
  254. package/lib/cjs/geometry3d/PolygonOps.js +62 -25
  255. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  256. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js +7 -3
  257. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  258. package/lib/cjs/geometry3d/PolylineOps.d.ts +9 -5
  259. package/lib/cjs/geometry3d/PolylineOps.d.ts.map +1 -1
  260. package/lib/cjs/geometry3d/PolylineOps.js +12 -5
  261. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  262. package/lib/cjs/geometry3d/Range.js +21 -4
  263. package/lib/cjs/geometry3d/Range.js.map +1 -1
  264. package/lib/cjs/geometry3d/Ray2d.js +2 -0
  265. package/lib/cjs/geometry3d/Ray2d.js.map +1 -1
  266. package/lib/cjs/geometry3d/Ray3d.js +12 -0
  267. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  268. package/lib/cjs/geometry3d/ReusableObjectCache.js +4 -0
  269. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  270. package/lib/cjs/geometry3d/Segment1d.js +4 -0
  271. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  272. package/lib/cjs/geometry3d/SortablePolygon.js +11 -0
  273. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  274. package/lib/cjs/geometry3d/Transform.js +3 -0
  275. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  276. package/lib/cjs/geometry3d/YawPitchRollAngles.js +6 -0
  277. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  278. package/lib/cjs/geometry4d/Map4d.js +2 -0
  279. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  280. package/lib/cjs/geometry4d/Matrix4d.js +1 -0
  281. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  282. package/lib/cjs/geometry4d/MomentData.d.ts +72 -73
  283. package/lib/cjs/geometry4d/MomentData.d.ts.map +1 -1
  284. package/lib/cjs/geometry4d/MomentData.js +90 -66
  285. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  286. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js +6 -0
  287. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  288. package/lib/cjs/geometry4d/Point4d.js +2 -0
  289. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  290. package/lib/cjs/numerics/BezierPolynomials.js +8 -0
  291. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  292. package/lib/cjs/numerics/ClusterableArray.js +29 -13
  293. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  294. package/lib/cjs/numerics/Complex.js +2 -0
  295. package/lib/cjs/numerics/Complex.js.map +1 -1
  296. package/lib/cjs/numerics/ConvexPolygon2d.js +3 -0
  297. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  298. package/lib/cjs/numerics/Newton.js +59 -4
  299. package/lib/cjs/numerics/Newton.js.map +1 -1
  300. package/lib/cjs/numerics/PascalCoefficients.js +1 -1
  301. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  302. package/lib/cjs/numerics/PolarData.js +13 -1
  303. package/lib/cjs/numerics/PolarData.js.map +1 -1
  304. package/lib/cjs/numerics/Polynomials.js +64 -26
  305. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  306. package/lib/cjs/numerics/Quadrature.js +26 -20
  307. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  308. package/lib/cjs/numerics/TriDiagonalSystem.js +11 -0
  309. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  310. package/lib/cjs/numerics/UnionFind.js +1 -0
  311. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  312. package/lib/cjs/numerics/UsageSums.js +10 -0
  313. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  314. package/lib/cjs/polyface/AuxData.js +16 -0
  315. package/lib/cjs/polyface/AuxData.js.map +1 -1
  316. package/lib/cjs/polyface/BoxTopology.js +67 -67
  317. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  318. package/lib/cjs/polyface/FacetFaceData.d.ts +1 -1
  319. package/lib/cjs/polyface/FacetFaceData.js +3 -1
  320. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  321. package/lib/cjs/polyface/FacetLocationDetail.js +30 -0
  322. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  323. package/lib/cjs/polyface/FacetOrientation.js +12 -1
  324. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  325. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js +18 -2
  326. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  327. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts +33 -23
  328. package/lib/cjs/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  329. package/lib/cjs/polyface/IndexedEdgeMatcher.js +63 -33
  330. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  331. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts +3 -2
  332. package/lib/cjs/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  333. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js +11 -2
  334. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  335. package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts +233 -0
  336. package/lib/cjs/polyface/IndexedPolyfaceWalker.d.ts.map +1 -0
  337. package/lib/cjs/polyface/IndexedPolyfaceWalker.js +353 -0
  338. package/lib/cjs/polyface/IndexedPolyfaceWalker.js.map +1 -0
  339. package/lib/cjs/polyface/Polyface.d.ts +35 -10
  340. package/lib/cjs/polyface/Polyface.d.ts.map +1 -1
  341. package/lib/cjs/polyface/Polyface.js +73 -12
  342. package/lib/cjs/polyface/Polyface.js.map +1 -1
  343. package/lib/cjs/polyface/PolyfaceBuilder.d.ts +14 -27
  344. package/lib/cjs/polyface/PolyfaceBuilder.d.ts.map +1 -1
  345. package/lib/cjs/polyface/PolyfaceBuilder.js +47 -79
  346. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  347. package/lib/cjs/polyface/PolyfaceClip.js +8 -0
  348. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  349. package/lib/cjs/polyface/PolyfaceData.d.ts +28 -0
  350. package/lib/cjs/polyface/PolyfaceData.d.ts.map +1 -1
  351. package/lib/cjs/polyface/PolyfaceData.js +87 -5
  352. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  353. package/lib/cjs/polyface/PolyfaceQuery.js +47 -7
  354. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  355. package/lib/cjs/polyface/RangeLengthData.js +7 -0
  356. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  357. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js +12 -0
  358. package/lib/cjs/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  359. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js +5 -2
  360. package/lib/cjs/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  361. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js +12 -0
  362. package/lib/cjs/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  363. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js +14 -0
  364. package/lib/cjs/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  365. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js +5 -0
  366. package/lib/cjs/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  367. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js +43 -0
  368. package/lib/cjs/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  369. package/lib/cjs/polyface/TaggedNumericData.js +8 -0
  370. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  371. package/lib/cjs/polyface/TriangleCandidate.js +3 -0
  372. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  373. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js +7 -0
  374. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  375. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js +6 -0
  376. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  377. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js +3 -0
  378. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  379. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js +3 -0
  380. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  381. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js +32 -0
  382. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  383. package/lib/cjs/polyface/multiclip/RangeSearch.js +5 -5
  384. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  385. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js +21 -8
  386. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  387. package/lib/cjs/polyface/multiclip/XYPointBuckets.js +6 -0
  388. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  389. package/lib/cjs/serialization/BGFBAccessors.js +82 -164
  390. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  391. package/lib/cjs/serialization/BGFBReader.js +22 -22
  392. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  393. package/lib/cjs/serialization/BGFBWriter.js +1 -0
  394. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  395. package/lib/cjs/serialization/DeepCompare.js +17 -17
  396. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  397. package/lib/cjs/serialization/GeometrySamples.d.ts +5 -5
  398. package/lib/cjs/serialization/GeometrySamples.d.ts.map +1 -1
  399. package/lib/cjs/serialization/GeometrySamples.js +113 -112
  400. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  401. package/lib/cjs/serialization/IModelJsonSchema.d.ts +1 -2
  402. package/lib/cjs/serialization/IModelJsonSchema.d.ts.map +1 -1
  403. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  404. package/lib/cjs/solid/Box.js +7 -2
  405. package/lib/cjs/solid/Box.js.map +1 -1
  406. package/lib/cjs/solid/Cone.js +6 -2
  407. package/lib/cjs/solid/Cone.js.map +1 -1
  408. package/lib/cjs/solid/LinearSweep.js +4 -2
  409. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  410. package/lib/cjs/solid/RotationalSweep.js +5 -2
  411. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  412. package/lib/cjs/solid/RuledSweep.d.ts +26 -23
  413. package/lib/cjs/solid/RuledSweep.d.ts.map +1 -1
  414. package/lib/cjs/solid/RuledSweep.js +32 -24
  415. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  416. package/lib/cjs/solid/SolidPrimitive.d.ts +12 -11
  417. package/lib/cjs/solid/SolidPrimitive.d.ts.map +1 -1
  418. package/lib/cjs/solid/SolidPrimitive.js +11 -6
  419. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  420. package/lib/cjs/solid/Sphere.js +4 -2
  421. package/lib/cjs/solid/Sphere.js.map +1 -1
  422. package/lib/cjs/solid/SweepContour.d.ts +24 -15
  423. package/lib/cjs/solid/SweepContour.d.ts.map +1 -1
  424. package/lib/cjs/solid/SweepContour.js +33 -15
  425. package/lib/cjs/solid/SweepContour.js.map +1 -1
  426. package/lib/cjs/solid/TorusPipe.js +7 -2
  427. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  428. package/lib/cjs/topology/ChainMerge.js +16 -4
  429. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  430. package/lib/cjs/topology/Graph.js +41 -6
  431. package/lib/cjs/topology/Graph.js.map +1 -1
  432. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +1 -1
  433. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js +5 -1
  434. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  435. package/lib/cjs/topology/HalfEdgeGraphSearch.js +2 -0
  436. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  437. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js +9 -2
  438. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  439. package/lib/cjs/topology/HalfEdgeGraphValidation.js +7 -9
  440. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  441. package/lib/cjs/topology/HalfEdgeMarkSet.js +5 -0
  442. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  443. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js +6 -0
  444. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  445. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js +1 -0
  446. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  447. package/lib/cjs/topology/HalfEdgePositionDetail.js +16 -0
  448. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  449. package/lib/cjs/topology/HalfEdgePriorityQueue.js +2 -0
  450. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  451. package/lib/cjs/topology/InsertAndRetriangulateContext.js +4 -0
  452. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  453. package/lib/cjs/topology/MaskManager.js +3 -0
  454. package/lib/cjs/topology/MaskManager.js.map +1 -1
  455. package/lib/cjs/topology/Merging.js +11 -6
  456. package/lib/cjs/topology/Merging.js.map +1 -1
  457. package/lib/cjs/topology/RegularizeFace.js +22 -0
  458. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  459. package/lib/cjs/topology/SignedDataSummary.js +22 -0
  460. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  461. package/lib/cjs/topology/Triangulation.js +21 -11
  462. package/lib/cjs/topology/Triangulation.js.map +1 -1
  463. package/lib/cjs/topology/XYParitySearchContext.js +13 -0
  464. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  465. package/lib/esm/Constant.js +17 -17
  466. package/lib/esm/Constant.js.map +1 -1
  467. package/lib/esm/Geometry.js +35 -35
  468. package/lib/esm/Geometry.js.map +1 -1
  469. package/lib/esm/bspline/AkimaCurve3d.js +3 -1
  470. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  471. package/lib/esm/bspline/BSpline1dNd.js +18 -0
  472. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  473. package/lib/esm/bspline/BSplineCurve.js +6 -2
  474. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  475. package/lib/esm/bspline/BSplineCurve3dH.js +1 -0
  476. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  477. package/lib/esm/bspline/BSplineCurveOps.d.ts.map +1 -1
  478. package/lib/esm/bspline/BSplineCurveOps.js +18 -21
  479. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  480. package/lib/esm/bspline/BSplineSurface.js +22 -2
  481. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  482. package/lib/esm/bspline/Bezier1dNd.js +6 -0
  483. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  484. package/lib/esm/bspline/BezierCurve3d.js +2 -0
  485. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  486. package/lib/esm/bspline/BezierCurve3dH.js +2 -0
  487. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  488. package/lib/esm/bspline/BezierCurveBase.d.ts.map +1 -1
  489. package/lib/esm/bspline/BezierCurveBase.js +21 -2
  490. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  491. package/lib/esm/bspline/InterpolationCurve3d.js +12 -1
  492. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  493. package/lib/esm/bspline/KnotVector.d.ts +8 -6
  494. package/lib/esm/bspline/KnotVector.d.ts.map +1 -1
  495. package/lib/esm/bspline/KnotVector.js +21 -8
  496. package/lib/esm/bspline/KnotVector.js.map +1 -1
  497. package/lib/esm/bspline/SurfaceLocationDetail.js +12 -0
  498. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  499. package/lib/esm/clipping/AlternatingConvexClipTree.js +14 -13
  500. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  501. package/lib/esm/clipping/BooleanClipNode.js +4 -0
  502. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  503. package/lib/esm/clipping/ClipPlane.js +10 -1
  504. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  505. package/lib/esm/clipping/ClipPrimitive.js +19 -0
  506. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  507. package/lib/esm/clipping/ClipUtils.js +5 -1
  508. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  509. package/lib/esm/clipping/ClipVector.js +11 -8
  510. package/lib/esm/clipping/ClipVector.js.map +1 -1
  511. package/lib/esm/clipping/ConvexClipPlaneSet.js +5 -3
  512. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  513. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js +2 -1
  514. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  515. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js +3 -0
  516. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  517. package/lib/esm/core-geometry.d.ts +1 -0
  518. package/lib/esm/core-geometry.d.ts.map +1 -1
  519. package/lib/esm/core-geometry.js +1 -0
  520. package/lib/esm/core-geometry.js.map +1 -1
  521. package/lib/esm/curve/Arc3d.d.ts +15 -3
  522. package/lib/esm/curve/Arc3d.d.ts.map +1 -1
  523. package/lib/esm/curve/Arc3d.js +47 -20
  524. package/lib/esm/curve/Arc3d.js.map +1 -1
  525. package/lib/esm/curve/ConstructCurveBetweenCurves.js +3 -0
  526. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  527. package/lib/esm/curve/CoordinateXYZ.js +3 -2
  528. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  529. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts +0 -2
  530. package/lib/esm/curve/CurveChainWithDistanceIndex.d.ts.map +1 -1
  531. package/lib/esm/curve/CurveChainWithDistanceIndex.js +25 -10
  532. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  533. package/lib/esm/curve/CurveCollection.d.ts +10 -0
  534. package/lib/esm/curve/CurveCollection.d.ts.map +1 -1
  535. package/lib/esm/curve/CurveCollection.js +35 -9
  536. package/lib/esm/curve/CurveCollection.js.map +1 -1
  537. package/lib/esm/curve/CurveFactory.d.ts +87 -53
  538. package/lib/esm/curve/CurveFactory.d.ts.map +1 -1
  539. package/lib/esm/curve/CurveFactory.js +213 -135
  540. package/lib/esm/curve/CurveFactory.js.map +1 -1
  541. package/lib/esm/curve/CurveLocationDetail.js +44 -0
  542. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  543. package/lib/esm/curve/CurvePrimitive.d.ts +7 -10
  544. package/lib/esm/curve/CurvePrimitive.d.ts.map +1 -1
  545. package/lib/esm/curve/CurvePrimitive.js +27 -12
  546. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  547. package/lib/esm/curve/CurveProcessor.js +2 -0
  548. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  549. package/lib/esm/curve/CurveWireMomentsXYZ.js +2 -0
  550. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  551. package/lib/esm/curve/LineSegment3d.js +6 -2
  552. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  553. package/lib/esm/curve/LineString3d.js +27 -7
  554. package/lib/esm/curve/LineString3d.js.map +1 -1
  555. package/lib/esm/curve/Loop.js +12 -4
  556. package/lib/esm/curve/Loop.js.map +1 -1
  557. package/lib/esm/curve/OffsetOptions.js +25 -21
  558. package/lib/esm/curve/OffsetOptions.js.map +1 -1
  559. package/lib/esm/curve/ParityRegion.js +4 -2
  560. package/lib/esm/curve/ParityRegion.js.map +1 -1
  561. package/lib/esm/curve/Path.js +2 -2
  562. package/lib/esm/curve/Path.js.map +1 -1
  563. package/lib/esm/curve/PointString3d.js +3 -2
  564. package/lib/esm/curve/PointString3d.js.map +1 -1
  565. package/lib/esm/curve/ProxyCurve.js +1 -0
  566. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  567. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js +1 -0
  568. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  569. package/lib/esm/curve/Query/CurveSplitContext.js +3 -0
  570. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  571. package/lib/esm/curve/Query/CylindricalRange.js +6 -2
  572. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  573. package/lib/esm/curve/Query/PlanarSubdivision.js +4 -6
  574. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  575. package/lib/esm/curve/Query/StrokeCountChain.js +12 -0
  576. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  577. package/lib/esm/curve/Query/StrokeCountMap.js +14 -0
  578. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  579. package/lib/esm/curve/RegionMomentsXY.js +4 -5
  580. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  581. package/lib/esm/curve/RegionOps.js +9 -10
  582. package/lib/esm/curve/RegionOps.js.map +1 -1
  583. package/lib/esm/curve/RegionOpsClassificationSweeps.js +24 -1
  584. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  585. package/lib/esm/curve/StrokeOptions.d.ts +4 -4
  586. package/lib/esm/curve/StrokeOptions.d.ts.map +1 -1
  587. package/lib/esm/curve/StrokeOptions.js +23 -6
  588. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  589. package/lib/esm/curve/UnionRegion.js +4 -2
  590. package/lib/esm/curve/UnionRegion.js.map +1 -1
  591. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js +13 -7
  592. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  593. package/lib/esm/curve/internalContexts/ChainCollectorContext.js +6 -0
  594. package/lib/esm/curve/internalContexts/ChainCollectorContext.js.map +1 -1
  595. package/lib/esm/curve/internalContexts/CloneCurvesContext.js +2 -0
  596. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  597. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js +13 -5
  598. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  599. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js +3 -0
  600. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  601. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js +18 -5
  602. package/lib/esm/curve/internalContexts/CurveCurveCloseApproachXY.js.map +1 -1
  603. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js +26 -13
  604. package/lib/esm/curve/internalContexts/CurveCurveIntersectXY.js.map +1 -1
  605. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js +11 -5
  606. package/lib/esm/curve/internalContexts/CurveCurveIntersectXYZ.js.map +1 -1
  607. package/lib/esm/curve/internalContexts/CurveLengthContext.js +6 -0
  608. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  609. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js +8 -6
  610. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  611. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js +38 -5
  612. package/lib/esm/curve/internalContexts/EllipticalArcApproximationContext.js.map +1 -1
  613. package/lib/esm/curve/internalContexts/GapSearchContext.js +1 -0
  614. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  615. package/lib/esm/curve/internalContexts/MultiChainCollector.js +12 -0
  616. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  617. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js +1 -0
  618. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  619. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js +7 -0
  620. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  621. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js +22 -4
  622. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  623. package/lib/esm/curve/internalContexts/SumLengthsContext.js +1 -0
  624. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  625. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js +3 -0
  626. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  627. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js +2 -0
  628. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  629. package/lib/esm/curve/spiral/ClothoidSeries.js +4 -0
  630. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  631. package/lib/esm/curve/spiral/CubicEvaluator.js +2 -0
  632. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  633. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js +4 -0
  634. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  635. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js +5 -0
  636. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  637. package/lib/esm/curve/spiral/DirectSpiral3d.js +12 -2
  638. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  639. package/lib/esm/curve/spiral/IntegratedSpiral3d.js +24 -4
  640. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  641. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js +2 -0
  642. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  643. package/lib/esm/curve/spiral/NormalizedTransition.js +5 -0
  644. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  645. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js +2 -0
  646. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  647. package/lib/esm/curve/spiral/TransitionConditionalProperties.js +10 -0
  648. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  649. package/lib/esm/curve/spiral/TransitionSpiral3d.js +10 -0
  650. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  651. package/lib/esm/curve/spiral/XYCurveEvaluator.js +6 -0
  652. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  653. package/lib/esm/geometry3d/Angle.js +18 -16
  654. package/lib/esm/geometry3d/Angle.js.map +1 -1
  655. package/lib/esm/geometry3d/AngleSweep.d.ts +1 -1
  656. package/lib/esm/geometry3d/AngleSweep.d.ts.map +1 -1
  657. package/lib/esm/geometry3d/AngleSweep.js +3 -1
  658. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  659. package/lib/esm/geometry3d/BarycentricTriangle.js +25 -0
  660. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  661. package/lib/esm/geometry3d/BilinearPatch.js +8 -0
  662. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  663. package/lib/esm/geometry3d/CoincidentGeometryOps.js +5 -0
  664. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  665. package/lib/esm/geometry3d/Ellipsoid.js +48 -0
  666. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  667. package/lib/esm/geometry3d/FrameBuilder.js +12 -4
  668. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  669. package/lib/esm/geometry3d/FrustumAnimation.js +7 -0
  670. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  671. package/lib/esm/geometry3d/GrowableBlockedArray.js +12 -0
  672. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  673. package/lib/esm/geometry3d/GrowableFloat64Array.js +3 -0
  674. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  675. package/lib/esm/geometry3d/GrowableXYArray.d.ts +0 -5
  676. package/lib/esm/geometry3d/GrowableXYArray.d.ts.map +1 -1
  677. package/lib/esm/geometry3d/GrowableXYArray.js +16 -7
  678. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  679. package/lib/esm/geometry3d/GrowableXYZArray.d.ts +32 -10
  680. package/lib/esm/geometry3d/GrowableXYZArray.d.ts.map +1 -1
  681. package/lib/esm/geometry3d/GrowableXYZArray.js +70 -16
  682. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  683. package/lib/esm/geometry3d/IndexedCollectionInterval.js +6 -0
  684. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  685. package/lib/esm/geometry3d/IndexedXYCollection.js +1 -0
  686. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  687. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts +13 -2
  688. package/lib/esm/geometry3d/IndexedXYZCollection.d.ts.map +1 -1
  689. package/lib/esm/geometry3d/IndexedXYZCollection.js +26 -11
  690. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  691. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js +3 -0
  692. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  693. package/lib/esm/geometry3d/Matrix3d.d.ts +3 -4
  694. package/lib/esm/geometry3d/Matrix3d.d.ts.map +1 -1
  695. package/lib/esm/geometry3d/Matrix3d.js +34 -12
  696. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  697. package/lib/esm/geometry3d/OrderedRotationAngles.js +10 -2
  698. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  699. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +2 -0
  700. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  701. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +7 -0
  702. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  703. package/lib/esm/geometry3d/Point2dArrayCarrier.js +2 -0
  704. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  705. package/lib/esm/geometry3d/Point2dVector2d.js +4 -0
  706. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  707. package/lib/esm/geometry3d/Point3dArrayCarrier.js +3 -1
  708. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  709. package/lib/esm/geometry3d/Point3dVector3d.d.ts +6 -6
  710. package/lib/esm/geometry3d/Point3dVector3d.js +12 -6
  711. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  712. package/lib/esm/geometry3d/PointHelpers.js +5 -5
  713. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  714. package/lib/esm/geometry3d/PointStreaming.js +12 -4
  715. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  716. package/lib/esm/geometry3d/PolygonOps.d.ts +2 -2
  717. package/lib/esm/geometry3d/PolygonOps.js +62 -25
  718. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  719. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js +7 -3
  720. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  721. package/lib/esm/geometry3d/PolylineOps.d.ts +9 -5
  722. package/lib/esm/geometry3d/PolylineOps.d.ts.map +1 -1
  723. package/lib/esm/geometry3d/PolylineOps.js +12 -5
  724. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  725. package/lib/esm/geometry3d/Range.js +21 -4
  726. package/lib/esm/geometry3d/Range.js.map +1 -1
  727. package/lib/esm/geometry3d/Ray2d.js +2 -0
  728. package/lib/esm/geometry3d/Ray2d.js.map +1 -1
  729. package/lib/esm/geometry3d/Ray3d.js +12 -0
  730. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  731. package/lib/esm/geometry3d/ReusableObjectCache.js +4 -0
  732. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  733. package/lib/esm/geometry3d/Segment1d.js +4 -0
  734. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  735. package/lib/esm/geometry3d/SortablePolygon.js +11 -0
  736. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  737. package/lib/esm/geometry3d/Transform.js +3 -0
  738. package/lib/esm/geometry3d/Transform.js.map +1 -1
  739. package/lib/esm/geometry3d/YawPitchRollAngles.js +6 -0
  740. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  741. package/lib/esm/geometry4d/Map4d.js +2 -0
  742. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  743. package/lib/esm/geometry4d/Matrix4d.js +1 -0
  744. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  745. package/lib/esm/geometry4d/MomentData.d.ts +72 -73
  746. package/lib/esm/geometry4d/MomentData.d.ts.map +1 -1
  747. package/lib/esm/geometry4d/MomentData.js +90 -66
  748. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  749. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js +6 -0
  750. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  751. package/lib/esm/geometry4d/Point4d.js +2 -0
  752. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  753. package/lib/esm/numerics/BezierPolynomials.js +8 -0
  754. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  755. package/lib/esm/numerics/ClusterableArray.js +29 -13
  756. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  757. package/lib/esm/numerics/Complex.js +2 -0
  758. package/lib/esm/numerics/Complex.js.map +1 -1
  759. package/lib/esm/numerics/ConvexPolygon2d.js +3 -0
  760. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  761. package/lib/esm/numerics/Newton.js +59 -4
  762. package/lib/esm/numerics/Newton.js.map +1 -1
  763. package/lib/esm/numerics/PascalCoefficients.js +1 -1
  764. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  765. package/lib/esm/numerics/PolarData.js +13 -1
  766. package/lib/esm/numerics/PolarData.js.map +1 -1
  767. package/lib/esm/numerics/Polynomials.js +64 -26
  768. package/lib/esm/numerics/Polynomials.js.map +1 -1
  769. package/lib/esm/numerics/Quadrature.js +26 -20
  770. package/lib/esm/numerics/Quadrature.js.map +1 -1
  771. package/lib/esm/numerics/TriDiagonalSystem.js +11 -0
  772. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  773. package/lib/esm/numerics/UnionFind.js +1 -0
  774. package/lib/esm/numerics/UnionFind.js.map +1 -1
  775. package/lib/esm/numerics/UsageSums.js +10 -0
  776. package/lib/esm/numerics/UsageSums.js.map +1 -1
  777. package/lib/esm/polyface/AuxData.js +16 -0
  778. package/lib/esm/polyface/AuxData.js.map +1 -1
  779. package/lib/esm/polyface/BoxTopology.js +67 -67
  780. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  781. package/lib/esm/polyface/FacetFaceData.d.ts +1 -1
  782. package/lib/esm/polyface/FacetFaceData.js +3 -1
  783. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  784. package/lib/esm/polyface/FacetLocationDetail.js +30 -0
  785. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  786. package/lib/esm/polyface/FacetOrientation.js +12 -1
  787. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  788. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js +18 -2
  789. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  790. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts +33 -23
  791. package/lib/esm/polyface/IndexedEdgeMatcher.d.ts.map +1 -1
  792. package/lib/esm/polyface/IndexedEdgeMatcher.js +63 -33
  793. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  794. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts +3 -2
  795. package/lib/esm/polyface/IndexedPolyfaceVisitor.d.ts.map +1 -1
  796. package/lib/esm/polyface/IndexedPolyfaceVisitor.js +11 -2
  797. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  798. package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts +233 -0
  799. package/lib/esm/polyface/IndexedPolyfaceWalker.d.ts.map +1 -0
  800. package/lib/esm/polyface/IndexedPolyfaceWalker.js +349 -0
  801. package/lib/esm/polyface/IndexedPolyfaceWalker.js.map +1 -0
  802. package/lib/esm/polyface/Polyface.d.ts +35 -10
  803. package/lib/esm/polyface/Polyface.d.ts.map +1 -1
  804. package/lib/esm/polyface/Polyface.js +73 -12
  805. package/lib/esm/polyface/Polyface.js.map +1 -1
  806. package/lib/esm/polyface/PolyfaceBuilder.d.ts +14 -27
  807. package/lib/esm/polyface/PolyfaceBuilder.d.ts.map +1 -1
  808. package/lib/esm/polyface/PolyfaceBuilder.js +48 -80
  809. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  810. package/lib/esm/polyface/PolyfaceClip.js +8 -0
  811. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  812. package/lib/esm/polyface/PolyfaceData.d.ts +28 -0
  813. package/lib/esm/polyface/PolyfaceData.d.ts.map +1 -1
  814. package/lib/esm/polyface/PolyfaceData.js +87 -5
  815. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  816. package/lib/esm/polyface/PolyfaceQuery.js +47 -7
  817. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  818. package/lib/esm/polyface/RangeLengthData.js +7 -0
  819. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  820. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js +12 -0
  821. package/lib/esm/polyface/RangeTree/LineString3dRangeTreeContext.js.map +1 -1
  822. package/lib/esm/polyface/RangeTree/MinimumValueTester.js +5 -2
  823. package/lib/esm/polyface/RangeTree/MinimumValueTester.js.map +1 -1
  824. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js +12 -0
  825. package/lib/esm/polyface/RangeTree/Point3dArrayRangeTreeContext.js.map +1 -1
  826. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js +14 -0
  827. package/lib/esm/polyface/RangeTree/PolyfaceRangeTreeContext.js.map +1 -1
  828. package/lib/esm/polyface/RangeTree/RangeTreeNode.js +5 -0
  829. package/lib/esm/polyface/RangeTree/RangeTreeNode.js.map +1 -1
  830. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js +43 -0
  831. package/lib/esm/polyface/RangeTree/RangeTreeSearchHandlers.js.map +1 -1
  832. package/lib/esm/polyface/TaggedNumericData.js +8 -0
  833. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  834. package/lib/esm/polyface/TriangleCandidate.js +3 -0
  835. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  836. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js +7 -0
  837. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  838. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js +6 -0
  839. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  840. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js +3 -0
  841. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  842. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js +3 -0
  843. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  844. package/lib/esm/polyface/multiclip/OffsetMeshContext.js +32 -0
  845. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  846. package/lib/esm/polyface/multiclip/RangeSearch.js +5 -5
  847. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  848. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js +21 -8
  849. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  850. package/lib/esm/polyface/multiclip/XYPointBuckets.js +6 -0
  851. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  852. package/lib/esm/serialization/BGFBAccessors.js +82 -164
  853. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  854. package/lib/esm/serialization/BGFBReader.js +22 -22
  855. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  856. package/lib/esm/serialization/BGFBWriter.js +1 -0
  857. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  858. package/lib/esm/serialization/DeepCompare.js +17 -17
  859. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  860. package/lib/esm/serialization/GeometrySamples.d.ts +5 -5
  861. package/lib/esm/serialization/GeometrySamples.d.ts.map +1 -1
  862. package/lib/esm/serialization/GeometrySamples.js +113 -112
  863. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  864. package/lib/esm/serialization/IModelJsonSchema.d.ts +1 -2
  865. package/lib/esm/serialization/IModelJsonSchema.d.ts.map +1 -1
  866. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  867. package/lib/esm/solid/Box.js +7 -2
  868. package/lib/esm/solid/Box.js.map +1 -1
  869. package/lib/esm/solid/Cone.js +6 -2
  870. package/lib/esm/solid/Cone.js.map +1 -1
  871. package/lib/esm/solid/LinearSweep.js +4 -2
  872. package/lib/esm/solid/LinearSweep.js.map +1 -1
  873. package/lib/esm/solid/RotationalSweep.js +5 -2
  874. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  875. package/lib/esm/solid/RuledSweep.d.ts +26 -23
  876. package/lib/esm/solid/RuledSweep.d.ts.map +1 -1
  877. package/lib/esm/solid/RuledSweep.js +32 -24
  878. package/lib/esm/solid/RuledSweep.js.map +1 -1
  879. package/lib/esm/solid/SolidPrimitive.d.ts +12 -11
  880. package/lib/esm/solid/SolidPrimitive.d.ts.map +1 -1
  881. package/lib/esm/solid/SolidPrimitive.js +11 -6
  882. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  883. package/lib/esm/solid/Sphere.js +4 -2
  884. package/lib/esm/solid/Sphere.js.map +1 -1
  885. package/lib/esm/solid/SweepContour.d.ts +24 -15
  886. package/lib/esm/solid/SweepContour.d.ts.map +1 -1
  887. package/lib/esm/solid/SweepContour.js +33 -15
  888. package/lib/esm/solid/SweepContour.js.map +1 -1
  889. package/lib/esm/solid/TorusPipe.js +7 -2
  890. package/lib/esm/solid/TorusPipe.js.map +1 -1
  891. package/lib/esm/topology/ChainMerge.js +16 -4
  892. package/lib/esm/topology/ChainMerge.js.map +1 -1
  893. package/lib/esm/topology/Graph.js +41 -6
  894. package/lib/esm/topology/Graph.js.map +1 -1
  895. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.d.ts +1 -1
  896. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js +5 -1
  897. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  898. package/lib/esm/topology/HalfEdgeGraphSearch.js +2 -0
  899. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  900. package/lib/esm/topology/HalfEdgeGraphSpineContext.js +9 -2
  901. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  902. package/lib/esm/topology/HalfEdgeGraphValidation.js +7 -9
  903. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  904. package/lib/esm/topology/HalfEdgeMarkSet.js +5 -0
  905. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  906. package/lib/esm/topology/HalfEdgeNodeXYZUV.js +6 -0
  907. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  908. package/lib/esm/topology/HalfEdgePointInGraphSearch.js +1 -0
  909. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  910. package/lib/esm/topology/HalfEdgePositionDetail.js +16 -0
  911. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  912. package/lib/esm/topology/HalfEdgePriorityQueue.js +2 -0
  913. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  914. package/lib/esm/topology/InsertAndRetriangulateContext.js +4 -0
  915. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  916. package/lib/esm/topology/MaskManager.js +3 -0
  917. package/lib/esm/topology/MaskManager.js.map +1 -1
  918. package/lib/esm/topology/Merging.js +11 -6
  919. package/lib/esm/topology/Merging.js.map +1 -1
  920. package/lib/esm/topology/RegularizeFace.js +22 -0
  921. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  922. package/lib/esm/topology/SignedDataSummary.js +22 -0
  923. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  924. package/lib/esm/topology/Triangulation.js +21 -11
  925. package/lib/esm/topology/Triangulation.js.map +1 -1
  926. package/lib/esm/topology/XYParitySearchContext.js +13 -0
  927. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  928. package/package.json +5 -5
@@ -5,8 +5,8 @@
5
5
  /** @packageDocumentation
6
6
  * @module Numerics
7
7
  */
8
- // import { Point2d } from "./Geometry2d";
9
8
  /* eslint-disable @typescript-eslint/naming-convention */
9
+ // cspell:word ABAT
10
10
  import { Geometry } from "../Geometry";
11
11
  import { Matrix3d } from "../geometry3d/Matrix3d";
12
12
  import { Point3d, Vector3d } from "../geometry3d/Point3dVector3d";
@@ -19,61 +19,84 @@ import { Point4d } from "./Point4d";
19
19
  * * origin = local origin used as moments are summed.
20
20
  * * sums = array of summed moments.
21
21
  * * The [i,j] entry of the sums is a summed or integrated moment for product of axis i and j.
22
- * * axes 0,1,2 are x,y,z
22
+ * * axes 0,1,2 are x,y,z.
23
23
  * * e.g. entry [0,1] is summed product xy
24
24
  * * axis 3 is "w", which is 1 in sums.
25
- * * e.g. entry 03 is summed x
26
- * * In this level,
25
+ * * e.g. entry 03 is summed x.
26
+ * * In this level:
27
27
  * * the `absoluteQuantity` member is undefined.
28
28
  * * the `localToWorldMap` and `radiiOfGyration` are created by have undefined contents.
29
- * * Second level: after a call to inertiaProductsToPrincipalAxes, the `localToWorldMap`, `absoluteQuantity` and `radiiOfGyration` are filled in.
29
+ * * Second level: after a call to inertiaProductsToPrincipalAxes, the `localToWorldMap`, `absoluteQuantity` and
30
+ * `radiiOfGyration` are filled in.
30
31
  * @public
31
32
  */
32
33
  export class MomentData {
33
- /** Return the lower-right (3,3) entry in the sums.
34
- * * This is the quantity (i.e. length, area, or volume) summed
34
+ /** Origin used for sums. */
35
+ origin;
36
+ /** Flag to request deferred origin setup. */
37
+ needOrigin;
38
+ /**
39
+ * Moment sums.
40
+ * * Set to zero at initialization and if requested later.
41
+ * * Accumulated during data entry phase.
42
+ */
43
+ sums;
44
+ /**
45
+ * The mapping between principal and world system.
46
+ * * This set up with its inverse already constructed.
35
47
  */
36
- get quantitySum() { return this.sums.atIJ(3, 3); }
37
- /** Return a scale factor to make these sums match the target orientation sign.
48
+ localToWorldMap;
49
+ // private variables
50
+ static _vectorA;
51
+ static _vectorB;
52
+ static _vectorC;
53
+ _point0 = Point3d.create();
54
+ _point1 = Point3d.create();
55
+ /**
56
+ * Return the lower-right (3,3) entry in the sums.
57
+ * * This is the quantity (i.e. length, area, or volume) summed.
58
+ */
59
+ get quantitySum() {
60
+ return this.sums.atIJ(3, 3);
61
+ }
62
+ /**
63
+ * Return a scale factor to make these sums match the target orientation sign.
38
64
  * * 1.0 if `this.quantitySum` has the same sign as `targetSign`.
39
65
  * * -1.0 if `this.quantitySum` has the opposite sign from `targetSign`
40
66
  */
41
67
  signFactor(targetSign) {
42
68
  return targetSign * this.quantitySum > 0 ? 1.0 : -1.0;
43
69
  }
44
- /**
45
- * If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag.
46
- *
47
- */
70
+ /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */
48
71
  setOriginIfNeeded(origin) {
49
72
  if (this.needOrigin) {
50
73
  this.origin.setFromPoint3d(origin);
51
74
  this.needOrigin = false;
52
75
  }
53
76
  }
54
- /**
55
- * If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag.
56
- *
57
- */
77
+ /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */
58
78
  setOriginFromGrowableXYZArrayIfNeeded(points) {
59
79
  if (this.needOrigin && points.length > 0) {
60
80
  points.getPoint3dAtCheckedPointIndex(0, this.origin);
61
81
  this.needOrigin = false;
62
82
  }
63
83
  }
64
- /**
65
- * If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag.
66
- *
67
- */
84
+ /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */
68
85
  setOriginXYZIfNeeded(x, y, z) {
69
86
  if (this.needOrigin) {
70
87
  this.origin.set(x, y, z);
71
88
  this.needOrigin = false;
72
89
  }
73
90
  }
91
+ /** Radii of gyration (square roots of principal second moments). */
92
+ radiusOfGyration;
93
+ /**
94
+ * Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by
95
+ * inertiaProductsToPrincipalAxes.
96
+ */
97
+ absoluteQuantity;
98
+ /** Constructor. */
74
99
  constructor() {
75
- this._point0 = Point3d.create();
76
- this._point1 = Point3d.create();
77
100
  this.origin = Point3d.createZero();
78
101
  this.sums = Matrix4d.createZero();
79
102
  this.localToWorldMap = Transform.createIdentity();
@@ -82,12 +105,13 @@ export class MomentData {
82
105
  this.absoluteQuantity = 0.1; // so optimizer sees its type
83
106
  this.absoluteQuantity = undefined;
84
107
  }
85
- /** Create moments with optional origin.
86
- * * origin and needOrigin are quirky.
108
+ /**
109
+ * Create moments with optional origin.
110
+ * * Origin and needOrigin are quirky.
87
111
  * * (undefined, true) sets up to use first incoming point as origin.
88
- * * (origin) sets up to use that durable origin, set needsOrigin flag false
89
- * * (origin, true) the "true" is meaningless
90
- * * (undefined, false) makes 000 the durable origin
112
+ * * (origin) sets up to use that durable origin, set needsOrigin flag false.
113
+ * * (origin, true) the "true" is meaningless.
114
+ * * (undefined, false) makes 000 the durable origin.
91
115
  */
92
116
  static create(origin, needOrigin = false) {
93
117
  const data = new MomentData();
@@ -99,8 +123,8 @@ export class MomentData {
99
123
  return data;
100
124
  }
101
125
  /**
102
- * Return the formal tensor of integrated values `[yy+zz,xy,xz][yx,xx+zz,yz][zx,xy,xx+yy]`
103
- * @param products matrix of (integrated) `[xx,xy,xz][yx,yy,yz][zx,xy,zz]`
126
+ * Return the formal tensor of integrated values `[yy+zz,xy,xz][yx,xx+zz,yz][zx,xy,xx+yy]`.
127
+ * @param products matrix of (integrated) `[xx,xy,xz][yx,yy,yz][zx,xy,zz]`.
104
128
  */
105
129
  static momentTensorFromInertiaProducts(products) {
106
130
  const rr = products.sumDiagonal();
@@ -133,7 +157,7 @@ export class MomentData {
133
157
  }
134
158
  /**
135
159
  * Return the principal moment data for an array of points.
136
- * @param points array of points
160
+ * @param points array of points.
137
161
  */
138
162
  static pointsToPrincipalAxes(points) {
139
163
  const moments = new MomentData();
@@ -144,12 +168,12 @@ export class MomentData {
144
168
  return this.inertiaProductsToPrincipalAxes(moments.origin, moments.sums);
145
169
  }
146
170
  /**
147
- * Compute principal axes from inertial products
148
- * * The radii of gyration are sorted smallest to largest
149
- * * Hence x axis is long direction
150
- * * Hence planar data generates large moment as Z
171
+ * Compute principal axes from inertial products.
172
+ * * The radii of gyration are sorted smallest to largest.
173
+ * * Hence x axis is long direction.
174
+ * * Hence planar data generates large moment as Z.
151
175
  * @param origin The origin used for the inertia products.
152
- * @param inertiaProducts The inertia products -- sums or integrals of [xx,xy,xz,xw; yx,yy, yz,yw; zx,zy,zz,zw; wx,wy,wz,w]
176
+ * @param inertiaProducts The inertia products: sums or integrals of [xx,xy,xz,xw; yx,yy, yz,yw; zx,zy,zz,zw; wx,wy,wz,w].
153
177
  */
154
178
  static inertiaProductsToPrincipalAxes(origin, inertiaProducts) {
155
179
  const moments = new MomentData();
@@ -177,18 +201,19 @@ export class MomentData {
177
201
  return moments;
178
202
  }
179
203
  /**
180
- * Test for match among selected members as they exist after `inertiaProductsToPrincipalAxes`
181
- * * The members considered are
182
- * * origin of local to world map (i.e. centroid)
183
- * * radius of gyration
204
+ * Test for match among selected members as they exist after `inertiaProductsToPrincipalAxes`.
205
+ * * The members considered are:
206
+ * * origin of local to world map (i.e. centroid),
207
+ * * radius of gyration,
184
208
  * * axes of localToWorldMap.
185
209
  * * Axis direction tests allow these quirks:
186
210
  * * opposite orientation is considered matched.
187
211
  * * Full xyz symmetry: If x,y,z radii are matched, axes are not tested.
188
- * * Symmetry in xy plane: If x and y radii are matched, the x and y axes area allowed to spin freely. Only Z direction is tested.
212
+ * * Symmetry in xy plane: If x and y radii are matched, the x and y axes area allowed to spin freely. Only Z direction
213
+ * is tested.
189
214
  * * If either or both are undefined, returns false.
190
- * @param dataA first set of moments
191
- * @param dataB second set of moments
215
+ * @param dataA first set of moments.
216
+ * @param dataB second set of moments.
192
217
  */
193
218
  static areEquivalentPrincipalAxes(dataA, dataB) {
194
219
  if (dataA && dataB
@@ -236,7 +261,7 @@ export class MomentData {
236
261
  this.sums.addMomentsInPlace(p.x - this.origin.x, p.y - this.origin.y, p.z - this.origin.z, 1.0);
237
262
  }
238
263
  }
239
- /** revise the accumulated sums to be "around the centroid" */
264
+ /** Revise the accumulated sums to be "around the centroid". */
240
265
  shiftOriginAndSumsToCentroidOfSums() {
241
266
  const xyz = this.sums.columnW().realPoint();
242
267
  if (xyz) {
@@ -245,7 +270,8 @@ export class MomentData {
245
270
  }
246
271
  return false;
247
272
  }
248
- /** revise the accumulated sums
273
+ /**
274
+ * Revise the accumulated sums.
249
275
  * * add ax,ay,ax to the origin coordinates.
250
276
  * * apply the negative translation to the sums.
251
277
  */
@@ -253,11 +279,12 @@ export class MomentData {
253
279
  this.origin.addXYZInPlace(ax, ay, az);
254
280
  this.sums.multiplyTranslationSandwichInPlace(-ax, -ay, -az);
255
281
  }
256
- /** revise the accumulated sums so they are based at a specified origin. */
282
+ /** Revise the accumulated sums so they are based at a specified origin. */
257
283
  shiftOriginAndSumsToNewOrigin(newOrigin) {
258
284
  this.shiftOriginAndSumsByXYZ(newOrigin.x - this.origin.x, newOrigin.y - this.origin.y, newOrigin.z - this.origin.z);
259
285
  }
260
- /** compute moments of a triangle from the origin to the given line.
286
+ /**
287
+ * Compute moments of a triangle from the origin to the given line.
261
288
  * Accumulate them to this.sums.
262
289
  * * If `pointA` is undefined, use `this.origin` as pointA.
263
290
  * * If `this.needOrigin` is set, pointB is used
@@ -289,7 +316,7 @@ export class MomentData {
289
316
  this.sums.addScaledOuterProductInPlace(vectorC, vectorC, r1_12);
290
317
  }
291
318
  }
292
- /** add scaled outer product of (4d, unit weight) point to this.sums */
319
+ /** Add scaled outer product of (4d, unit weight) point to this.sums. */
293
320
  accumulateScaledOuterProduct(point, scaleFactor) {
294
321
  this.setOriginXYZIfNeeded(point.x, point.y, 0.0);
295
322
  const vectorA = MomentData._vectorA = Point4d.create(point.x - this.origin.x, point.y - this.origin.y, point.z - this.origin.z, 1.0, MomentData._vectorA);
@@ -311,7 +338,8 @@ export class MomentData {
311
338
  this.sums.addScaledOuterProductInPlace(vectorB, vectorA, r1_6);
312
339
  this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_3);
313
340
  }
314
- /** compute moments of triangles from a base point to the given linestring.
341
+ /**
342
+ * Compute moments of triangles from a base point to the given linestring.
315
343
  * Accumulate them to this.sums.
316
344
  * * If `pointA` is undefined, use `this.origin` as pointA.
317
345
  * * If `this.needOrigin` is set, the first point of the array is captured as local origin for subsequent sums.
@@ -328,18 +356,18 @@ export class MomentData {
328
356
  }
329
357
  }
330
358
  }
331
- // cspell:word ABAT
332
359
  /**
333
360
  * * Assemble XX, YY, XY products into a full matrix form [xx,xy,0,0; xy,yy,0,0;0,0,0,0;0,0,0,1].
334
- * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin]. (Column weights 0001) (only xy parts of vectors)
361
+ * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin]. (Column weights 0001) (only xy
362
+ * parts of vectors).
335
363
  * * scale by detJ for the xy-only determinant of the vectors.
336
364
  * @param productXX
337
365
  * @param productXY
338
366
  * @param productYY
339
- * @param area Area in caller's system
340
- * @param origin Caller's origin
341
- * @param vectorU Caller's U axis (not necessarily unit)
342
- * @param vectorV Caller's V axis (not necessarily unit)
367
+ * @param area Area in caller's system.
368
+ * @param origin Caller's origin.
369
+ * @param vectorU Caller's U axis (not necessarily unit).
370
+ * @param vectorV Caller's V axis (not necessarily unit).
343
371
  */
344
372
  accumulateXYProductsInCentroidalFrame(productXX, productXY, productYY, area, origin, vectorU, vectorV) {
345
373
  const centroidalProducts = Matrix4d.createRowValues(productXX, productXY, 0, 0, productXY, productYY, 0, 0, 0, 0, 0, 0, 0, 0, 0, area);
@@ -351,27 +379,23 @@ export class MomentData {
351
379
  }
352
380
  /**
353
381
  * Accumulate sums from other moments.
354
- * * scale by given scaleFactor (e.g. sign to correct orientation)
355
- * * pull the origin from `other` if `this` needs an origin.
356
- * *
382
+ * * Scale by given scaleFactor (e.g. sign to correct orientation).
383
+ * * Pull the origin from `other` if `this` needs an origin.
357
384
  */
358
385
  accumulateProducts(other, scale) {
359
386
  this.setOriginIfNeeded(other.origin);
360
387
  this.sums.addTranslationSandwichInPlace(other.sums, this.origin.x - other.origin.x, this.origin.y - other.origin.y, this.origin.z - other.origin.z, scale);
361
388
  }
362
389
  /**
363
- * Accumulate sums from Matrix4d and origin.
364
- * * scale by given scaleFactor (e.g. sign to correct orientation)
365
- * * trap the origin if `this` needs an origin.
366
- * *
367
- */
390
+ * Accumulate sums from Matrix4d and origin.
391
+ * * Scale by given scaleFactor (e.g. sign to correct orientation).
392
+ * * Trap the origin if `this` needs an origin.
393
+ */
368
394
  accumulateProductsFromOrigin(origin, products, scale) {
369
395
  this.setOriginIfNeeded(origin);
370
396
  this.sums.addTranslationSandwichInPlace(products, this.origin.x - origin.x, this.origin.y - origin.y, this.origin.z - origin.z, scale);
371
397
  }
372
- /**
373
- * Convert to a json data object with:
374
- */
398
+ /** Convert to a json data object. */
375
399
  toJSON() {
376
400
  return {
377
401
  origin: this.origin,
@@ -1 +1 @@
1
- {"version":3,"file":"MomentData.js","sourceRoot":"","sources":["../../../src/geometry4d/MomentData.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,0CAA0C;AAC1C,yDAAyD;AAEzD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAO,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;;;;;;;;;GAeG;AACH,MAAM,OAAO,UAAU;IAcrB;;OAEG;IACH,IAAW,WAAW,KAAa,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IACjE;;;OAGG;IACI,UAAU,CAAC,UAAkB;QAClC,OAAO,UAAU,GAAG,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IACxD,CAAC;IAED;;;OAGG;IACI,iBAAiB,CAAC,MAAe;QACtC,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;YACnC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC1B,CAAC;IACH,CAAC;IACD;;;OAGG;IACI,qCAAqC,CAAC,MAAwB;QACnE,IAAI,IA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AAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IACzI,CAAC;IACD;;OAEG;IACI,MAAM;QACX,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACxB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE;YAChD,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;SAC5C,CAAC;IACJ,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 Numerics\r\n */\r\n\r\n// import { Point2d } from \"./Geometry2d\";\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Point3d, Vector3d, XYZ } from \"../geometry3d/Point3dVector3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { XAndY, XYAndZ } from \"../geometry3d/XYZProps\";\r\nimport { Matrix4d } from \"./Matrix4d\";\r\nimport { Point4d } from \"./Point4d\";\r\n\r\n/**\r\n * A MomentData structure exists in several levels:\r\n * * First level: as a carrier of sums of inertial products that determine moments.\r\n * * origin = local origin used as moments are summed.\r\n * * sums = array of summed moments.\r\n * * The [i,j] entry of the sums is a summed or integrated moment for product of axis i and j.\r\n * * axes 0,1,2 are x,y,z\r\n * * e.g. entry [0,1] is summed product xy\r\n * * axis 3 is \"w\", which is 1 in sums.\r\n * * e.g. entry 03 is summed x\r\n * * In this level,\r\n * * the `absoluteQuantity` member is undefined.\r\n * * the `localToWorldMap` and `radiiOfGyration` are created by have undefined contents.\r\n * * Second level: after a call to inertiaProductsToPrincipalAxes, the `localToWorldMap`, `absoluteQuantity` and `radiiOfGyration` are filled in.\r\n * @public\r\n */\r\nexport class MomentData {\r\n /** Origin used for sums. */\r\n public origin: Point3d;\r\n /** flag to request deferred origin setup. */\r\n public needOrigin: boolean;\r\n /** Moment sums.\r\n * * Set to zero at initialization and if requested later.\r\n * * Accumulated during data entry phase.\r\n */\r\n public sums: Matrix4d;\r\n /** the mapping between principal and world system.\r\n * * This set up with its inverse already constructed.\r\n */\r\n public localToWorldMap: Transform;\r\n /** Return the lower-right (3,3) entry in the sums.\r\n * * This is the quantity (i.e. length, area, or volume) summed\r\n */\r\n public get quantitySum(): number { return this.sums.atIJ(3, 3); }\r\n /** Return a scale factor to make these sums match the target orientation sign.\r\n * * 1.0 if `this.quantitySum` has the same sign as `targetSign`.\r\n * * -1.0 if `this.quantitySum` has the opposite sign from `targetSign`\r\n */\r\n public signFactor(targetSign: number): number {\r\n return targetSign * this.quantitySum > 0 ? 1.0 : -1.0;\r\n }\r\n\r\n /**\r\n * If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag.\r\n *\r\n */\r\n public setOriginIfNeeded(origin: Point3d) {\r\n if (this.needOrigin) {\r\n this.origin.setFromPoint3d(origin);\r\n this.needOrigin = false;\r\n }\r\n }\r\n /**\r\n * If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag.\r\n *\r\n */\r\n public setOriginFromGrowableXYZArrayIfNeeded(points: GrowableXYZArray) {\r\n if (this.needOrigin && points.length > 0) {\r\n points.getPoint3dAtCheckedPointIndex(0, this.origin);\r\n this.needOrigin = false;\r\n }\r\n }\r\n\r\n /**\r\n * If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag.\r\n *\r\n */\r\n public setOriginXYZIfNeeded(x: number, y: number, z: number) {\r\n if (this.needOrigin) {\r\n this.origin.set(x, y, z);\r\n this.needOrigin = false;\r\n }\r\n }\r\n\r\n /** radii of gyration (square roots of principal second moments)\r\n */\r\n public radiusOfGyration: Vector3d;\r\n /** principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by\r\n *\r\n */\r\n public absoluteQuantity?: number;\r\n\r\n private constructor() {\r\n this.origin = Point3d.createZero();\r\n this.sums = Matrix4d.createZero();\r\n this.localToWorldMap = Transform.createIdentity();\r\n this.radiusOfGyration = Vector3d.create();\r\n this.needOrigin = false;\r\n this.absoluteQuantity = 0.1; // so optimizer sees its type\r\n this.absoluteQuantity = undefined;\r\n }\r\n /** Create moments with optional origin.\r\n * * origin and needOrigin are quirky.\r\n * * (undefined, true) sets up to use first incoming point as origin.\r\n * * (origin) sets up to use that durable origin, set needsOrigin flag false\r\n * * (origin, true) the \"true\" is meaningless\r\n * * (undefined, false) makes 000 the durable origin\r\n */\r\n public static create(origin?: Point3d | undefined, needOrigin: boolean = false): MomentData {\r\n const data = new MomentData();\r\n data.needOrigin = needOrigin;\r\n if (origin) {\r\n data.origin.setFromPoint3d(origin);\r\n data.needOrigin = false;\r\n }\r\n return data;\r\n }\r\n /**\r\n * Return the formal tensor of integrated values `[yy+zz,xy,xz][yx,xx+zz,yz][zx,xy,xx+yy]`\r\n * @param products matrix of (integrated) `[xx,xy,xz][yx,yy,yz][zx,xy,zz]`\r\n */\r\n public static momentTensorFromInertiaProducts(products: Matrix3d): Matrix3d {\r\n const rr = products.sumDiagonal();\r\n const result = Matrix3d.createScale(rr, rr, rr);\r\n result.addScaledInPlace(products, -1.0);\r\n return result;\r\n }\r\n /** Sort the columns of the matrix for increasing moments. */\r\n public static sortColumnsForIncreasingMoments(axes: Matrix3d, moments: Vector3d) {\r\n const points = [\r\n axes.indexedColumnWithWeight(0, moments.x),\r\n axes.indexedColumnWithWeight(1, moments.y),\r\n axes.indexedColumnWithWeight(2, moments.z),\r\n ].sort((dataA: Point4d, dataB: Point4d): number => {\r\n if (dataA.w < dataB.w) return -1;\r\n if (dataA.w > dataB.w) return 1;\r\n return 0;\r\n });\r\n axes.setColumnsPoint4dXYZ(points[0], points[1], points[2]);\r\n if (axes.determinant() < 0)\r\n axes.scaleColumnsInPlace(-1.0, -1.0, -1.0);\r\n // prefer x and z positive -- y falls wherever . ..\r\n if (axes.at(0, 0) < 0.0)\r\n axes.scaleColumnsInPlace(-1.0, -1.0, 1.0);\r\n if (axes.at(2, 2) < 0.0)\r\n axes.scaleColumnsInPlace(1.0, -1.0, -1.0);\r\n moments.set(points[0].w, points[1].w, points[2].w);\r\n }\r\n\r\n /**\r\n * Return the principal moment data for an array of points.\r\n * @param points array of points\r\n */\r\n public static pointsToPrincipalAxes(points: Point3d[]): MomentData | undefined {\r\n const moments = new MomentData();\r\n if (points.length === 0)\r\n return moments;\r\n moments.clearSums(points[0]);\r\n moments.accumulatePointMomentsFromOrigin(points);\r\n return this.inertiaProductsToPrincipalAxes(moments.origin, moments.sums);\r\n }\r\n /**\r\n * Compute principal axes from inertial products\r\n * * The radii of gyration are sorted smallest to largest\r\n * * Hence x axis is long direction\r\n * * Hence planar data generates large moment as Z\r\n * @param origin The origin used for the inertia products.\r\n * @param inertiaProducts The inertia products -- sums or integrals of [xx,xy,xz,xw; yx,yy, yz,yw; zx,zy,zz,zw; wx,wy,wz,w]\r\n */\r\n public static inertiaProductsToPrincipalAxes(origin: XYZ, inertiaProducts: Matrix4d): MomentData | undefined {\r\n const moments = new MomentData();\r\n moments.sums.setFrom(inertiaProducts);\r\n moments.origin.setFrom(origin);\r\n if (!moments.shiftOriginAndSumsToCentroidOfSums())\r\n return undefined;\r\n const products = moments.sums.matrixPart();\r\n const w = moments.sums.weight();\r\n if (w < 0.0)\r\n products.scaleColumnsInPlace(-1, -1, -1);\r\n const tensor = MomentData.momentTensorFromInertiaProducts(products);\r\n const moment2 = Vector3d.create();\r\n const axisVectors = Matrix3d.createZero();\r\n tensor.fastSymmetricEigenvalues(axisVectors, moment2);\r\n if (moment2.x < 0.0)\r\n return undefined;\r\n MomentData.sortColumnsForIncreasingMoments(axisVectors, moment2);\r\n if (w < 0.0)\r\n axisVectors.scaleColumnsInPlace(1, -1, -1);\r\n moments.localToWorldMap = Transform.createOriginAndMatrix(moments.origin, axisVectors);\r\n moments.radiusOfGyration.set(\r\n Math.sqrt(Math.abs(moment2.x)), Math.sqrt(Math.abs(moment2.y)), Math.sqrt(Math.abs(moment2.z)));\r\n moments.radiusOfGyration.scaleInPlace(1.0 / Math.sqrt(Math.abs(w)));\r\n moments.absoluteQuantity = Math.abs(w);\r\n return moments;\r\n }\r\n /**\r\n * Test for match among selected members as they exist after `inertiaProductsToPrincipalAxes`\r\n * * The members considered are\r\n * * origin of local to world map (i.e. centroid)\r\n * * radius of gyration\r\n * * axes of localToWorldMap.\r\n * * Axis direction tests allow these quirks:\r\n * * opposite orientation is considered matched.\r\n * * Full xyz symmetry: If x,y,z radii are matched, axes are not tested.\r\n * * Symmetry in xy plane: If x and y radii are matched, the x and y axes area allowed to spin freely. Only Z direction is tested.\r\n * * If either or both are undefined, returns false.\r\n * @param dataA first set of moments\r\n * @param dataB second set of moments\r\n */\r\n public static areEquivalentPrincipalAxes(dataA: MomentData | undefined, dataB: MomentData | undefined): boolean {\r\n if (dataA && dataB\r\n && Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // um.. need different tolerance for area, volume?)\r\n if (dataA.localToWorldMap.getOrigin().isAlmostEqual(dataB.localToWorldMap.getOrigin())\r\n && dataA.radiusOfGyration.isAlmostEqual(dataB.radiusOfGyration)) {\r\n if (Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.y)) {\r\n // We have at least xy symmetry ....\r\n if (Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.z))\r\n return true;\r\n // just xy.\r\n // allow opposite z directions.\r\n // If the z's are aligned, x an dy can spin freely.\r\n const zA = dataA.localToWorldMap.matrix.columnZ();\r\n const zB = dataB.localToWorldMap.matrix.columnZ();\r\n if (zA.isParallelTo(zB, true))\r\n return true;\r\n return false;\r\n }\r\n // no symmetry. Test all three axes.\r\n const vectorA = Vector3d.create();\r\n const vectorB = Vector3d.create();\r\n for (let i = 0; i < 3; i++) {\r\n dataA.localToWorldMap.matrix.getColumn(i, vectorA);\r\n dataB.localToWorldMap.matrix.getColumn(i, vectorB);\r\n if (!vectorA.isParallelTo(vectorB, true))\r\n return false;\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Clear the MomentData sums to zero, and establish a new origin. */\r\n public clearSums(origin?: Point3d) {\r\n this.sums.setZero();\r\n if (origin)\r\n this.origin.setFrom(origin);\r\n else\r\n this.origin.setZero();\r\n }\r\n /** Accumulate products-of-components for given points. */\r\n public accumulatePointMomentsFromOrigin(points: Point3d[]) {\r\n for (const p of points) {\r\n this.sums.addMomentsInPlace(\r\n p.x - this.origin.x,\r\n p.y - this.origin.y,\r\n p.z - this.origin.z,\r\n 1.0);\r\n }\r\n }\r\n /** revise the accumulated sums to be \"around the centroid\" */\r\n public shiftOriginAndSumsToCentroidOfSums(): boolean {\r\n const xyz = this.sums.columnW().realPoint();\r\n if (xyz) {\r\n this.shiftOriginAndSumsByXYZ(xyz.x, xyz.y, xyz.z);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /** revise the accumulated sums\r\n * * add ax,ay,ax to the origin coordinates.\r\n * * apply the negative translation to the sums.\r\n */\r\n public shiftOriginAndSumsByXYZ(ax: number, ay: number, az: number) {\r\n this.origin.addXYZInPlace(ax, ay, az);\r\n this.sums.multiplyTranslationSandwichInPlace(-ax, -ay, -az);\r\n }\r\n /** revise the accumulated sums so they are based at a specified origin. */\r\n public shiftOriginAndSumsToNewOrigin(newOrigin: XYAndZ) {\r\n this.shiftOriginAndSumsByXYZ(newOrigin.x - this.origin.x, newOrigin.y - this.origin.y, newOrigin.z - this.origin.z);\r\n }\r\n private static _vectorA?: Point4d;\r\n private static _vectorB?: Point4d;\r\n private static _vectorC?: Point4d;\r\n\r\n /** compute moments of a triangle from the origin to the given line.\r\n * Accumulate them to this.sums.\r\n * * If `pointA` is undefined, use `this.origin` as pointA.\r\n * * If `this.needOrigin` is set, pointB is used\r\n */\r\n public accumulateTriangleMomentsXY(pointA: XAndY | undefined, pointB: XAndY, pointC: XAndY) {\r\n this.setOriginXYZIfNeeded(pointB.x, pointB.y, 0.0);\r\n const x0 = this.origin.x;\r\n const y0 = this.origin.y;\r\n const vectorA = MomentData._vectorA =\r\n pointA !== undefined ? Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA)\r\n : Point4d.create(this.origin.x, this.origin.y, 0.0, 1.0, MomentData._vectorA);\r\n const vectorB = MomentData._vectorB = Point4d.create(pointB.x - x0, pointB.y - y0, 0.0, 1.0, MomentData._vectorB);\r\n const vectorC = MomentData._vectorC = Point4d.create(pointC.x - x0, pointC.y - y0, 0.0, 1.0, MomentData._vectorC);\r\n\r\n // accumulate Return product integrals I(0<=u<=1) I (0<=v<= u) (w*W + u *U + v * V)(w*W + u *U + v * V)^ du dv\r\n // where w = 1-u-v\r\n // W = column vector (point00.x, point00.y, point00.z, 1.0) etc.\r\n const detJ = Geometry.crossProductXYXY(vectorB.x - vectorA.x, vectorB.y - vectorA.y, vectorC.x - vectorA.x, vectorC.y - vectorA.y);\r\n if (detJ !== 0.0) {\r\n const r1_12 = detJ / 12.0;\r\n const r1_24 = detJ / 24.0;\r\n\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorA, r1_12);\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorB, r1_24);\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorC, r1_24);\r\n\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorA, r1_24);\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_12);\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorC, r1_24);\r\n\r\n this.sums.addScaledOuterProductInPlace(vectorC, vectorA, r1_24);\r\n this.sums.addScaledOuterProductInPlace(vectorC, vectorB, r1_24);\r\n this.sums.addScaledOuterProductInPlace(vectorC, vectorC, r1_12);\r\n }\r\n }\r\n /** add scaled outer product of (4d, unit weight) point to this.sums */\r\n public accumulateScaledOuterProduct(point: XYAndZ, scaleFactor: number) {\r\n this.setOriginXYZIfNeeded(point.x, point.y, 0.0);\r\n const vectorA = MomentData._vectorA = Point4d.create(point.x - this.origin.x, point.y - this.origin.y, point.z - this.origin.z, 1.0, MomentData._vectorA);\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorA, scaleFactor);\r\n }\r\n /** Accumulate wire moment integral from pointA to pointB */\r\n public accumulateLineMomentsXYZ(pointA: Point3d, pointB: Point3d) {\r\n this.setOriginXYZIfNeeded(pointA.x, pointA.y, pointA.z);\r\n const x0 = this.origin.x;\r\n const y0 = this.origin.y;\r\n const z0 = this.origin.z;\r\n const vectorA = MomentData._vectorA = Point4d.create(pointA.x - x0, pointA.y - y0, pointA.z - z0, 1.0, MomentData._vectorA);\r\n const vectorB = MomentData._vectorB = Point4d.create(pointB.x - x0, pointB.y - y0, pointB.z - z0, 1.0, MomentData._vectorB);\r\n const detJ = pointA.distance(pointB);\r\n const r1_3 = detJ / 3.0;\r\n const r1_6 = detJ / 6.0;\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorA, r1_3);\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorB, r1_6);\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorA, r1_6);\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_3);\r\n\r\n }\r\n\r\n private _point0 = Point3d.create();\r\n private _point1 = Point3d.create();\r\n /** compute moments of triangles from a base point to the given linestring.\r\n * Accumulate them to this.sums.\r\n * * If `pointA` is undefined, use `this.origin` as pointA.\r\n * * If `this.needOrigin` is set, the first point of the array is captured as local origin for subsequent sums.\r\n *\r\n */\r\n public accumulateTriangleToLineStringMomentsXY(sweepBase: XAndY | undefined, points: GrowableXYZArray) {\r\n const n = points.length;\r\n if (n > 1) {\r\n points.getPoint3dAtUncheckedPointIndex(0, this._point0);\r\n for (let i = 1; i < n; i++) {\r\n points.getPoint3dAtUncheckedPointIndex(i, this._point1);\r\n this.accumulateTriangleMomentsXY(sweepBase, this._point0, this._point1);\r\n this._point0.setFromPoint3d(this._point1);\r\n }\r\n }\r\n }\r\n // cspell:word ABAT\r\n /**\r\n * * Assemble XX, YY, XY products into a full matrix form [xx,xy,0,0; xy,yy,0,0;0,0,0,0;0,0,0,1].\r\n * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin]. (Column weights 0001) (only xy parts of vectors)\r\n * * scale by detJ for the xy-only determinant of the vectors.\r\n * @param productXX\r\n * @param productXY\r\n * @param productYY\r\n * @param area Area in caller's system\r\n * @param origin Caller's origin\r\n * @param vectorU Caller's U axis (not necessarily unit)\r\n * @param vectorV Caller's V axis (not necessarily unit)\r\n */\r\n public accumulateXYProductsInCentroidalFrame(productXX: number, productXY: number, productYY: number, area: number,\r\n origin: XAndY, vectorU: XAndY, vectorV: XAndY) {\r\n const centroidalProducts = Matrix4d.createRowValues(\r\n productXX, productXY, 0, 0,\r\n productXY, productYY, 0, 0,\r\n 0, 0, 0, 0,\r\n 0, 0, 0, area);\r\n const detJ = Geometry.crossProductXYXY(vectorU.x, vectorV.x, vectorU.y, vectorV.y);\r\n const placement = Matrix4d.createRowValues(\r\n vectorU.x, vectorV.x, 0, origin.x - this.origin.x,\r\n vectorU.y, vectorV.y, 0, origin.y - this.origin.y,\r\n 0, 0, 0, 0,\r\n 0, 0, 0, 1);\r\n const AB = placement.multiplyMatrixMatrix(centroidalProducts);\r\n const ABAT = AB.multiplyMatrixMatrixTranspose(placement);\r\n this.sums.addScaledInPlace(ABAT, detJ);\r\n }\r\n /**\r\n * Accumulate sums from other moments.\r\n * * scale by given scaleFactor (e.g. sign to correct orientation)\r\n * * pull the origin from `other` if `this` needs an origin.\r\n * *\r\n */\r\n public accumulateProducts(other: MomentData, scale: number) {\r\n this.setOriginIfNeeded(other.origin);\r\n this.sums.addTranslationSandwichInPlace(other.sums, this.origin.x - other.origin.x, this.origin.y - other.origin.y, this.origin.z - other.origin.z, scale);\r\n }\r\n\r\n /**\r\n * Accumulate sums from Matrix4d and origin.\r\n * * scale by given scaleFactor (e.g. sign to correct orientation)\r\n * * trap the origin if `this` needs an origin.\r\n * *\r\n */\r\n public accumulateProductsFromOrigin(origin: Point3d, products: Matrix4d, scale: number) {\r\n this.setOriginIfNeeded(origin);\r\n this.sums.addTranslationSandwichInPlace(products, this.origin.x - origin.x, this.origin.y - origin.y, this.origin.z - origin.z, scale);\r\n }\r\n /**\r\n * Convert to a json data object with:\r\n */\r\n public toJSON(): any {\r\n return {\r\n origin: this.origin,\r\n sums: this.sums.toJSON(),\r\n radiusOfGyration: this.radiusOfGyration.toJSON(),\r\n localToWorld: this.localToWorldMap.toJSON(),\r\n };\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"MomentData.js","sourceRoot":"","sources":["../../../src/geometry4d/MomentData.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAE/F;;GAEG;AAEH,yDAAyD;AACzD,mBAAmB;AAEnB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAO,MAAM,+BAA+B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAEpD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,OAAO,UAAU;IACrB,4BAA4B;IACrB,MAAM,CAAU;IACvB,6CAA6C;IACtC,UAAU,CAAU;IAC3B;;;;OAIG;IACI,IAAI,CAAW;IACtB;;;OAGG;IACI,eAAe,CAAY;IAClC,oBAAoB;IACZ,MAAM,CAAC,QAAQ,CAAW;IAC1B,MAAM,CAAC,QA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AI,CAAC,iBAAiB,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACrC,IAAI,CAAC,IAAI,CAAC,6BAA6B,CACrC,KAAK,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,EAAE,KAAK,CAClH,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACI,4BAA4B,CAAC,MAAe,EAAE,QAAkB,EAAE,KAAa;QACpF,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;QAC/B,IAAI,CAAC,IAAI,CAAC,6BAA6B,CACrC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,KAAK,CAC9F,CAAC;IACJ,CAAC;IACD,qCAAqC;IAC9B,MAAM;QACX,OAAO;YACL,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE;YACxB,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE;YAChD,YAAY,EAAE,IAAI,CAAC,eAAe,CAAC,MAAM,EAAE;SAC5C,CAAC;IACJ,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 Numerics\r\n */\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention */\r\n// cspell:word ABAT\r\n\r\nimport { Geometry } from \"../Geometry\";\r\nimport { GrowableXYZArray } from \"../geometry3d/GrowableXYZArray\";\r\nimport { Matrix3d } from \"../geometry3d/Matrix3d\";\r\nimport { Point3d, Vector3d, XYZ } from \"../geometry3d/Point3dVector3d\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { XAndY, XYAndZ } from \"../geometry3d/XYZProps\";\r\nimport { Matrix4d } from \"./Matrix4d\";\r\nimport { Point4d } from \"./Point4d\";\r\n\r\n/**\r\n * A MomentData structure exists in several levels:\r\n * * First level: as a carrier of sums of inertial products that determine moments.\r\n * * origin = local origin used as moments are summed.\r\n * * sums = array of summed moments.\r\n * * The [i,j] entry of the sums is a summed or integrated moment for product of axis i and j.\r\n * * axes 0,1,2 are x,y,z.\r\n * * e.g. entry [0,1] is summed product xy\r\n * * axis 3 is \"w\", which is 1 in sums.\r\n * * e.g. entry 03 is summed x.\r\n * * In this level:\r\n * * the `absoluteQuantity` member is undefined.\r\n * * the `localToWorldMap` and `radiiOfGyration` are created by have undefined contents.\r\n * * Second level: after a call to inertiaProductsToPrincipalAxes, the `localToWorldMap`, `absoluteQuantity` and\r\n * `radiiOfGyration` are filled in.\r\n * @public\r\n */\r\nexport class MomentData {\r\n /** Origin used for sums. */\r\n public origin: Point3d;\r\n /** Flag to request deferred origin setup. */\r\n public needOrigin: boolean;\r\n /**\r\n * Moment sums.\r\n * * Set to zero at initialization and if requested later.\r\n * * Accumulated during data entry phase.\r\n */\r\n public sums: Matrix4d;\r\n /**\r\n * The mapping between principal and world system.\r\n * * This set up with its inverse already constructed.\r\n */\r\n public localToWorldMap: Transform;\r\n // private variables\r\n private static _vectorA?: Point4d;\r\n private static _vectorB?: Point4d;\r\n private static _vectorC?: Point4d;\r\n private _point0 = Point3d.create();\r\n private _point1 = Point3d.create();\r\n /**\r\n * Return the lower-right (3,3) entry in the sums.\r\n * * This is the quantity (i.e. length, area, or volume) summed.\r\n */\r\n public get quantitySum(): number {\r\n return this.sums.atIJ(3, 3);\r\n }\r\n /**\r\n * Return a scale factor to make these sums match the target orientation sign.\r\n * * 1.0 if `this.quantitySum` has the same sign as `targetSign`.\r\n * * -1.0 if `this.quantitySum` has the opposite sign from `targetSign`\r\n */\r\n public signFactor(targetSign: number): number {\r\n return targetSign * this.quantitySum > 0 ? 1.0 : -1.0;\r\n }\r\n /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */\r\n public setOriginIfNeeded(origin: Point3d) {\r\n if (this.needOrigin) {\r\n this.origin.setFromPoint3d(origin);\r\n this.needOrigin = false;\r\n }\r\n }\r\n /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */\r\n public setOriginFromGrowableXYZArrayIfNeeded(points: GrowableXYZArray) {\r\n if (this.needOrigin && points.length > 0) {\r\n points.getPoint3dAtCheckedPointIndex(0, this.origin);\r\n this.needOrigin = false;\r\n }\r\n }\r\n /** If `this.needOrigin` flag is set, copy `origin` to `this.origin` and clear the flag. */\r\n public setOriginXYZIfNeeded(x: number, y: number, z: number) {\r\n if (this.needOrigin) {\r\n this.origin.set(x, y, z);\r\n this.needOrigin = false;\r\n }\r\n }\r\n /** Radii of gyration (square roots of principal second moments). */\r\n public radiusOfGyration: Vector3d;\r\n /**\r\n * Principal quantity (e.g. length, area, or volume). This is undefined in raw moments, and becomes defined by\r\n * inertiaProductsToPrincipalAxes.\r\n */\r\n public absoluteQuantity?: number;\r\n /** Constructor. */\r\n private constructor() {\r\n this.origin = Point3d.createZero();\r\n this.sums = Matrix4d.createZero();\r\n this.localToWorldMap = Transform.createIdentity();\r\n this.radiusOfGyration = Vector3d.create();\r\n this.needOrigin = false;\r\n this.absoluteQuantity = 0.1; // so optimizer sees its type\r\n this.absoluteQuantity = undefined;\r\n }\r\n /**\r\n * Create moments with optional origin.\r\n * * Origin and needOrigin are quirky.\r\n * * (undefined, true) sets up to use first incoming point as origin.\r\n * * (origin) sets up to use that durable origin, set needsOrigin flag false.\r\n * * (origin, true) the \"true\" is meaningless.\r\n * * (undefined, false) makes 000 the durable origin.\r\n */\r\n public static create(origin?: Point3d | undefined, needOrigin: boolean = false): MomentData {\r\n const data = new MomentData();\r\n data.needOrigin = needOrigin;\r\n if (origin) {\r\n data.origin.setFromPoint3d(origin);\r\n data.needOrigin = false;\r\n }\r\n return data;\r\n }\r\n /**\r\n * Return the formal tensor of integrated values `[yy+zz,xy,xz][yx,xx+zz,yz][zx,xy,xx+yy]`.\r\n * @param products matrix of (integrated) `[xx,xy,xz][yx,yy,yz][zx,xy,zz]`.\r\n */\r\n public static momentTensorFromInertiaProducts(products: Matrix3d): Matrix3d {\r\n const rr = products.sumDiagonal();\r\n const result = Matrix3d.createScale(rr, rr, rr);\r\n result.addScaledInPlace(products, -1.0);\r\n return result;\r\n }\r\n /** Sort the columns of the matrix for increasing moments. */\r\n public static sortColumnsForIncreasingMoments(axes: Matrix3d, moments: Vector3d) {\r\n const points = [\r\n axes.indexedColumnWithWeight(0, moments.x),\r\n axes.indexedColumnWithWeight(1, moments.y),\r\n axes.indexedColumnWithWeight(2, moments.z),\r\n ].sort((dataA: Point4d, dataB: Point4d): number => {\r\n if (dataA.w < dataB.w) return -1;\r\n if (dataA.w > dataB.w) return 1;\r\n return 0;\r\n });\r\n axes.setColumnsPoint4dXYZ(points[0], points[1], points[2]);\r\n if (axes.determinant() < 0)\r\n axes.scaleColumnsInPlace(-1.0, -1.0, -1.0);\r\n // prefer x and z positive -- y falls wherever . ..\r\n if (axes.at(0, 0) < 0.0)\r\n axes.scaleColumnsInPlace(-1.0, -1.0, 1.0);\r\n if (axes.at(2, 2) < 0.0)\r\n axes.scaleColumnsInPlace(1.0, -1.0, -1.0);\r\n moments.set(points[0].w, points[1].w, points[2].w);\r\n }\r\n /**\r\n * Return the principal moment data for an array of points.\r\n * @param points array of points.\r\n */\r\n public static pointsToPrincipalAxes(points: Point3d[]): MomentData | undefined {\r\n const moments = new MomentData();\r\n if (points.length === 0)\r\n return moments;\r\n moments.clearSums(points[0]);\r\n moments.accumulatePointMomentsFromOrigin(points);\r\n return this.inertiaProductsToPrincipalAxes(moments.origin, moments.sums);\r\n }\r\n /**\r\n * Compute principal axes from inertial products.\r\n * * The radii of gyration are sorted smallest to largest.\r\n * * Hence x axis is long direction.\r\n * * Hence planar data generates large moment as Z.\r\n * @param origin The origin used for the inertia products.\r\n * @param inertiaProducts The inertia products: sums or integrals of [xx,xy,xz,xw; yx,yy, yz,yw; zx,zy,zz,zw; wx,wy,wz,w].\r\n */\r\n public static inertiaProductsToPrincipalAxes(origin: XYZ, inertiaProducts: Matrix4d): MomentData | undefined {\r\n const moments = new MomentData();\r\n moments.sums.setFrom(inertiaProducts);\r\n moments.origin.setFrom(origin);\r\n if (!moments.shiftOriginAndSumsToCentroidOfSums())\r\n return undefined;\r\n const products = moments.sums.matrixPart();\r\n const w = moments.sums.weight();\r\n if (w < 0.0)\r\n products.scaleColumnsInPlace(-1, -1, -1);\r\n const tensor = MomentData.momentTensorFromInertiaProducts(products);\r\n const moment2 = Vector3d.create();\r\n const axisVectors = Matrix3d.createZero();\r\n tensor.fastSymmetricEigenvalues(axisVectors, moment2);\r\n if (moment2.x < 0.0)\r\n return undefined;\r\n MomentData.sortColumnsForIncreasingMoments(axisVectors, moment2);\r\n if (w < 0.0)\r\n axisVectors.scaleColumnsInPlace(1, -1, -1);\r\n moments.localToWorldMap = Transform.createOriginAndMatrix(moments.origin, axisVectors);\r\n moments.radiusOfGyration.set(\r\n Math.sqrt(Math.abs(moment2.x)), Math.sqrt(Math.abs(moment2.y)), Math.sqrt(Math.abs(moment2.z)));\r\n moments.radiusOfGyration.scaleInPlace(1.0 / Math.sqrt(Math.abs(w)));\r\n moments.absoluteQuantity = Math.abs(w);\r\n return moments;\r\n }\r\n /**\r\n * Test for match among selected members as they exist after `inertiaProductsToPrincipalAxes`.\r\n * * The members considered are:\r\n * * origin of local to world map (i.e. centroid),\r\n * * radius of gyration,\r\n * * axes of localToWorldMap.\r\n * * Axis direction tests allow these quirks:\r\n * * opposite orientation is considered matched.\r\n * * Full xyz symmetry: If x,y,z radii are matched, axes are not tested.\r\n * * Symmetry in xy plane: If x and y radii are matched, the x and y axes area allowed to spin freely. Only Z direction\r\n * is tested.\r\n * * If either or both are undefined, returns false.\r\n * @param dataA first set of moments.\r\n * @param dataB second set of moments.\r\n */\r\n public static areEquivalentPrincipalAxes(dataA: MomentData | undefined, dataB: MomentData | undefined): boolean {\r\n if (dataA && dataB\r\n && Geometry.isSameCoordinate(dataA.quantitySum, dataB.quantitySum)) { // um.. need different tolerance for area, volume?)\r\n if (dataA.localToWorldMap.getOrigin().isAlmostEqual(dataB.localToWorldMap.getOrigin())\r\n && dataA.radiusOfGyration.isAlmostEqual(dataB.radiusOfGyration)) {\r\n if (Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.y)) {\r\n // We have at least xy symmetry ....\r\n if (Geometry.isSameCoordinate(dataA.radiusOfGyration.x, dataA.radiusOfGyration.z))\r\n return true;\r\n // just xy.\r\n // allow opposite z directions.\r\n // If the z's are aligned, x an dy can spin freely.\r\n const zA = dataA.localToWorldMap.matrix.columnZ();\r\n const zB = dataB.localToWorldMap.matrix.columnZ();\r\n if (zA.isParallelTo(zB, true))\r\n return true;\r\n return false;\r\n }\r\n // no symmetry. Test all three axes.\r\n const vectorA = Vector3d.create();\r\n const vectorB = Vector3d.create();\r\n for (let i = 0; i < 3; i++) {\r\n dataA.localToWorldMap.matrix.getColumn(i, vectorA);\r\n dataB.localToWorldMap.matrix.getColumn(i, vectorB);\r\n if (!vectorA.isParallelTo(vectorB, true))\r\n return false;\r\n }\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** Clear the MomentData sums to zero, and establish a new origin. */\r\n public clearSums(origin?: Point3d) {\r\n this.sums.setZero();\r\n if (origin)\r\n this.origin.setFrom(origin);\r\n else\r\n this.origin.setZero();\r\n }\r\n /** Accumulate products-of-components for given points. */\r\n public accumulatePointMomentsFromOrigin(points: Point3d[]) {\r\n for (const p of points) {\r\n this.sums.addMomentsInPlace(\r\n p.x - this.origin.x,\r\n p.y - this.origin.y,\r\n p.z - this.origin.z,\r\n 1.0,\r\n );\r\n }\r\n }\r\n /** Revise the accumulated sums to be \"around the centroid\". */\r\n public shiftOriginAndSumsToCentroidOfSums(): boolean {\r\n const xyz = this.sums.columnW().realPoint();\r\n if (xyz) {\r\n this.shiftOriginAndSumsByXYZ(xyz.x, xyz.y, xyz.z);\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n /**\r\n * Revise the accumulated sums.\r\n * * add ax,ay,ax to the origin coordinates.\r\n * * apply the negative translation to the sums.\r\n */\r\n public shiftOriginAndSumsByXYZ(ax: number, ay: number, az: number) {\r\n this.origin.addXYZInPlace(ax, ay, az);\r\n this.sums.multiplyTranslationSandwichInPlace(-ax, -ay, -az);\r\n }\r\n /** Revise the accumulated sums so they are based at a specified origin. */\r\n public shiftOriginAndSumsToNewOrigin(newOrigin: XYAndZ) {\r\n this.shiftOriginAndSumsByXYZ(newOrigin.x - this.origin.x, newOrigin.y - this.origin.y, newOrigin.z - this.origin.z);\r\n }\r\n /**\r\n * Compute moments of a triangle from the origin to the given line.\r\n * Accumulate them to this.sums.\r\n * * If `pointA` is undefined, use `this.origin` as pointA.\r\n * * If `this.needOrigin` is set, pointB is used\r\n */\r\n public accumulateTriangleMomentsXY(pointA: XAndY | undefined, pointB: XAndY, pointC: XAndY) {\r\n this.setOriginXYZIfNeeded(pointB.x, pointB.y, 0.0);\r\n const x0 = this.origin.x;\r\n const y0 = this.origin.y;\r\n const vectorA = MomentData._vectorA =\r\n pointA !== undefined ? Point4d.create(pointA.x - x0, pointA.y - y0, 0.0, 1.0, MomentData._vectorA)\r\n : Point4d.create(this.origin.x, this.origin.y, 0.0, 1.0, MomentData._vectorA);\r\n const vectorB = MomentData._vectorB = Point4d.create(pointB.x - x0, pointB.y - y0, 0.0, 1.0, MomentData._vectorB);\r\n const vectorC = MomentData._vectorC = Point4d.create(pointC.x - x0, pointC.y - y0, 0.0, 1.0, MomentData._vectorC);\r\n // accumulate Return product integrals I(0<=u<=1) I (0<=v<= u) (w*W + u *U + v * V)(w*W + u *U + v * V)^ du dv\r\n // where w = 1-u-v\r\n // W = column vector (point00.x, point00.y, point00.z, 1.0) etc.\r\n const detJ = Geometry.crossProductXYXY(vectorB.x - vectorA.x, vectorB.y - vectorA.y, vectorC.x - vectorA.x, vectorC.y - vectorA.y);\r\n if (detJ !== 0.0) {\r\n const r1_12 = detJ / 12.0;\r\n const r1_24 = detJ / 24.0;\r\n\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorA, r1_12);\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorB, r1_24);\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorC, r1_24);\r\n\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorA, r1_24);\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_12);\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorC, r1_24);\r\n\r\n this.sums.addScaledOuterProductInPlace(vectorC, vectorA, r1_24);\r\n this.sums.addScaledOuterProductInPlace(vectorC, vectorB, r1_24);\r\n this.sums.addScaledOuterProductInPlace(vectorC, vectorC, r1_12);\r\n }\r\n }\r\n /** Add scaled outer product of (4d, unit weight) point to this.sums. */\r\n public accumulateScaledOuterProduct(point: XYAndZ, scaleFactor: number) {\r\n this.setOriginXYZIfNeeded(point.x, point.y, 0.0);\r\n const vectorA = MomentData._vectorA = Point4d.create(\r\n point.x - this.origin.x, point.y - this.origin.y, point.z - this.origin.z, 1.0, MomentData._vectorA,\r\n );\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorA, scaleFactor);\r\n }\r\n /** Accumulate wire moment integral from pointA to pointB */\r\n public accumulateLineMomentsXYZ(pointA: Point3d, pointB: Point3d) {\r\n this.setOriginXYZIfNeeded(pointA.x, pointA.y, pointA.z);\r\n const x0 = this.origin.x;\r\n const y0 = this.origin.y;\r\n const z0 = this.origin.z;\r\n const vectorA = MomentData._vectorA = Point4d.create(\r\n pointA.x - x0, pointA.y - y0, pointA.z - z0, 1.0, MomentData._vectorA,\r\n );\r\n const vectorB = MomentData._vectorB = Point4d.create(\r\n pointB.x - x0, pointB.y - y0, pointB.z - z0, 1.0, MomentData._vectorB,\r\n );\r\n const detJ = pointA.distance(pointB);\r\n const r1_3 = detJ / 3.0;\r\n const r1_6 = detJ / 6.0;\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorA, r1_3);\r\n this.sums.addScaledOuterProductInPlace(vectorA, vectorB, r1_6);\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorA, r1_6);\r\n this.sums.addScaledOuterProductInPlace(vectorB, vectorB, r1_3);\r\n }\r\n /**\r\n * Compute moments of triangles from a base point to the given linestring.\r\n * Accumulate them to this.sums.\r\n * * If `pointA` is undefined, use `this.origin` as pointA.\r\n * * If `this.needOrigin` is set, the first point of the array is captured as local origin for subsequent sums.\r\n *\r\n */\r\n public accumulateTriangleToLineStringMomentsXY(sweepBase: XAndY | undefined, points: GrowableXYZArray) {\r\n const n = points.length;\r\n if (n > 1) {\r\n points.getPoint3dAtUncheckedPointIndex(0, this._point0);\r\n for (let i = 1; i < n; i++) {\r\n points.getPoint3dAtUncheckedPointIndex(i, this._point1);\r\n this.accumulateTriangleMomentsXY(sweepBase, this._point0, this._point1);\r\n this._point0.setFromPoint3d(this._point1);\r\n }\r\n }\r\n }\r\n /**\r\n * * Assemble XX, YY, XY products into a full matrix form [xx,xy,0,0; xy,yy,0,0;0,0,0,0;0,0,0,1].\r\n * * Sandwich this between transforms with columns [vectorU, vectorV, 0000, origin]. (Column weights 0001) (only xy\r\n * parts of vectors).\r\n * * scale by detJ for the xy-only determinant of the vectors.\r\n * @param productXX\r\n * @param productXY\r\n * @param productYY\r\n * @param area Area in caller's system.\r\n * @param origin Caller's origin.\r\n * @param vectorU Caller's U axis (not necessarily unit).\r\n * @param vectorV Caller's V axis (not necessarily unit).\r\n */\r\n public accumulateXYProductsInCentroidalFrame(\r\n productXX: number, productXY: number, productYY: number,\r\n area: number, origin: XAndY, vectorU: XAndY, vectorV: XAndY,\r\n ) {\r\n const centroidalProducts = Matrix4d.createRowValues(\r\n productXX, productXY, 0, 0,\r\n productXY, productYY, 0, 0,\r\n 0, 0, 0, 0,\r\n 0, 0, 0, area,\r\n );\r\n const detJ = Geometry.crossProductXYXY(vectorU.x, vectorV.x, vectorU.y, vectorV.y);\r\n const placement = Matrix4d.createRowValues(\r\n vectorU.x, vectorV.x, 0, origin.x - this.origin.x,\r\n vectorU.y, vectorV.y, 0, origin.y - this.origin.y,\r\n 0, 0, 0, 0,\r\n 0, 0, 0, 1,\r\n );\r\n const AB = placement.multiplyMatrixMatrix(centroidalProducts);\r\n const ABAT = AB.multiplyMatrixMatrixTranspose(placement);\r\n this.sums.addScaledInPlace(ABAT, detJ);\r\n }\r\n /**\r\n * Accumulate sums from other moments.\r\n * * Scale by given scaleFactor (e.g. sign to correct orientation).\r\n * * Pull the origin from `other` if `this` needs an origin.\r\n */\r\n public accumulateProducts(other: MomentData, scale: number) {\r\n this.setOriginIfNeeded(other.origin);\r\n this.sums.addTranslationSandwichInPlace(\r\n other.sums, this.origin.x - other.origin.x, this.origin.y - other.origin.y, this.origin.z - other.origin.z, scale,\r\n );\r\n }\r\n\r\n /**\r\n * Accumulate sums from Matrix4d and origin.\r\n * * Scale by given scaleFactor (e.g. sign to correct orientation).\r\n * * Trap the origin if `this` needs an origin.\r\n */\r\n public accumulateProductsFromOrigin(origin: Point3d, products: Matrix4d, scale: number) {\r\n this.setOriginIfNeeded(origin);\r\n this.sums.addTranslationSandwichInPlace(\r\n products, this.origin.x - origin.x, this.origin.y - origin.y, this.origin.z - origin.z, scale,\r\n );\r\n }\r\n /** Convert to a json data object. */\r\n public toJSON(): any {\r\n return {\r\n origin: this.origin,\r\n sums: this.sums.toJSON(),\r\n radiusOfGyration: this.radiusOfGyration.toJSON(),\r\n localToWorld: this.localToWorldMap.toJSON(),\r\n };\r\n }\r\n}\r\n"]}
@@ -11,6 +11,12 @@ import { Point4d } from "./Point4d";
11
11
  * @public
12
12
  */
13
13
  export class PlaneByOriginAndVectors4d {
14
+ /** homogeneous origin */
15
+ origin;
16
+ /** homogeneous u-direction vector */
17
+ vectorU;
18
+ /** homogeneous v-direction vector */
19
+ vectorV;
14
20
  constructor(origin, vectorU, vectorV) {
15
21
  this.origin = origin;
16
22
  this.vectorU = vectorU;
@@ -1 +1 @@
1
- {"version":3,"file":"PlaneByOriginAndVectors4d.js","sourceRoot":"","sources":["../../../src/geometry4d/PlaneByOriginAndVectors4d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,OAAO,yBAAyB;IAOpC,YAAoB,MAAe,EAAE,OAAgB,EAAE,OAAgB;QACrE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IACD,mCAAmC;IAC5B,KAAK,CAAC,MAAkC;QAC7C,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACrB,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,IAAI,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACxG,CAAC;IACD,wCAAwC;IACjC,OAAO,CAAC,KAAgC;QAC7C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACp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C,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IACvP,CAAC;IACD,gEAAgE;IACzD,eAAe,CAAC,CAAS,EAAE,CAAS,EAAE,MAAgB;QAC3D,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC3E,CAAC;IACD,+DAA+D;IACxD,MAAM,CAAC,aAAa,CAAC,MAAkC;QAC5D,OAAO,yBAAyB,CAAC,0BAA0B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC1G,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 Numerics\r\n */\r\n\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Point4d } from \"./Point4d\";\r\n\r\n/**\r\n * A PlaneByOriginAndVectors4d is a 4d origin and pair of 4d \"vectors\" defining a 4d plane.\r\n * * The parameterization of the plane is `X = origin + vectorU * u + vectorV * v`\r\n * * With particular weight values `origin.w === 1, vectorU.w === 0, vectorV.w === 0` this is like `Plane3dByOriginAndVectors`\r\n * * With other weights, the deweighted xyz coordinates of points on the 4d plane still form a 3d plane.\r\n * @public\r\n */\r\nexport class PlaneByOriginAndVectors4d {\r\n /** homogeneous origin */\r\n public origin: Point4d;\r\n /** homogeneous u-direction vector */\r\n public vectorU: Point4d;\r\n /** homogeneous v-direction vector */\r\n public vectorV: Point4d;\r\n private constructor(origin: Point4d, vectorU: Point4d, vectorV: Point4d) {\r\n this.origin = origin;\r\n this.vectorU = vectorU;\r\n this.vectorV = vectorV;\r\n }\r\n /** Return a clone of this plane */\r\n public clone(result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n if (result) {\r\n result.setFrom(this);\r\n return result;\r\n }\r\n return new PlaneByOriginAndVectors4d(this.origin.clone(), this.vectorU.clone(), this.vectorV.clone());\r\n }\r\n /** copy all content from other plane */\r\n public setFrom(other: PlaneByOriginAndVectors4d): void {\r\n this.origin.setFrom(other.origin);\r\n this.vectorU.setFrom(other.vectorU);\r\n this.vectorV.setFrom(other.vectorV);\r\n }\r\n /** Return true if origin, vectorU, and vectorV pass isAlmostEqual. */\r\n public isAlmostEqual(other: PlaneByOriginAndVectors4d): boolean {\r\n return this.origin.isAlmostEqual(other.origin)\r\n && this.vectorU.isAlmostEqual(other.vectorU)\r\n && this.vectorV.isAlmostEqual(other.vectorV);\r\n }\r\n /** Create a plane with (copies of) origin, vectorU, vectorV parameters, all given as full 4d points.\r\n */\r\n public static createOriginAndVectors(origin: Point4d, vectorU: Point4d, vectorV: Point4d, result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n if (result) {\r\n result.setOriginAndVectors(origin, vectorU, vectorV);\r\n return result;\r\n }\r\n return new PlaneByOriginAndVectors4d(origin.clone(), vectorU.clone(), vectorV.clone());\r\n }\r\n /** Set all numeric data from complete list of (x,y,z,w) in origin, vectorU, and vectorV */\r\n public setOriginAndVectorsXYZW(x0: number, y0: number, z0: number, w0: number, ux: number, uy: number, uz: number, uw: number, vx: number, vy: number, vz: number, vw: number): PlaneByOriginAndVectors4d {\r\n this.origin.set(x0, y0, z0, w0);\r\n this.vectorU.set(ux, uy, uz, uw);\r\n this.vectorV.set(vx, vy, vz, vw);\r\n return this;\r\n }\r\n /** Copy the contents of origin, vectorU, vectorV parameters to respective member variables */\r\n public setOriginAndVectors(origin: Point4d, vectorU: Point4d, vectorV: Point4d): PlaneByOriginAndVectors4d {\r\n this.origin.setFrom(origin);\r\n this.vectorU.setFrom(vectorU);\r\n this.vectorV.setFrom(vectorV);\r\n return this;\r\n }\r\n /** Create from complete list of (x,y,z,w) in origin, vectorU, and vectorV */\r\n public static createOriginAndVectorsXYZW(x0: number, y0: number, z0: number, w0: number, ux: number, uy: number, uz: number, uw: number, vx: number, vy: number, vz: number, vw: number, result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n if (result)\r\n return result.setOriginAndVectorsXYZW(x0, y0, z0, w0, ux, uy, uz, uw, vx, vy, vz, vw);\r\n return new PlaneByOriginAndVectors4d(Point4d.create(x0, y0, z0, w0), Point4d.create(ux, uy, uz, uw), Point4d.create(vx, vy, vz, uw));\r\n }\r\n /** create from origin point, (u=1,v=0) point, and (u=0,v=1) point. */\r\n public static createOriginAndTargets3d(origin: Point3d, targetU: Point3d, targetV: Point3d, result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n return PlaneByOriginAndVectors4d.createOriginAndVectorsXYZW(origin.x, origin.y, origin.z, 1.0, targetU.x - origin.x, targetU.y - origin.y, targetU.z - origin.z, 0.0, targetV.x - origin.x, targetV.y - origin.y, targetV.z - origin.z, 0.0, result);\r\n }\r\n /** evaluate plane point (full 3d) at given (u,v) coordinate. */\r\n public fractionToPoint(u: number, v: number, result?: Point4d): Point4d {\r\n return this.origin.plus2Scaled(this.vectorU, u, this.vectorV, v, result);\r\n }\r\n /** create a new plane which maps to the cartesian xy plane. */\r\n public static createXYPlane(result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n return PlaneByOriginAndVectors4d.createOriginAndVectorsXYZW(0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, result);\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"PlaneByOriginAndVectors4d.js","sourceRoot":"","sources":["../../../src/geometry4d/PlaneByOriginAndVectors4d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC;;;;;;GAMG;AACH,MAAM,OAAO,yBAAyB;IACpC,yBAAyB;IAClB,MAAM,CAAU;IACvB,qCAAqC;IAC9B,OAAO,CAAU;IACxB,qCAAqC;IAC9B,OAAO,CAAU;IACxB,YAAoB,MAAe,EAAE,OAAgB,EAAE,OAAgB;QACrE,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;IACzB,CAAC;IACD,mCAAmC;IAC5B,KAAK,CAAC,MAAkC;QAC7C,IAAI,MAAM,EAAE,CAAC;YACX,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;YACrB,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,IAAI,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,CAAC;IACxG,CAAC;IACD,wCAAwC;IACjC,OAAO,CAAC,KAAgC;QAC7C,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QAClC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACpC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IACtC,CAAC;IACD,sEAAsE;IAC/D,aAAa,CAAC,KAAgC;QACnD,OAAO,IAAI,CAAC,MAAM,CAAC,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C,GAAG,MAAM,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,GAAG,MAAM,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;IACvP,CAAC;IACD,gEAAgE;IACzD,eAAe,CAAC,CAAS,EAAE,CAAS,EAAE,MAAgB;QAC3D,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC3E,CAAC;IACD,+DAA+D;IACxD,MAAM,CAAC,aAAa,CAAC,MAAkC;QAC5D,OAAO,yBAAyB,CAAC,0BAA0B,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC1G,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 Numerics\r\n */\r\n\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Point4d } from \"./Point4d\";\r\n\r\n/**\r\n * A PlaneByOriginAndVectors4d is a 4d origin and pair of 4d \"vectors\" defining a 4d plane.\r\n * * The parameterization of the plane is `X = origin + vectorU * u + vectorV * v`\r\n * * With particular weight values `origin.w === 1, vectorU.w === 0, vectorV.w === 0` this is like `Plane3dByOriginAndVectors`\r\n * * With other weights, the deweighted xyz coordinates of points on the 4d plane still form a 3d plane.\r\n * @public\r\n */\r\nexport class PlaneByOriginAndVectors4d {\r\n /** homogeneous origin */\r\n public origin: Point4d;\r\n /** homogeneous u-direction vector */\r\n public vectorU: Point4d;\r\n /** homogeneous v-direction vector */\r\n public vectorV: Point4d;\r\n private constructor(origin: Point4d, vectorU: Point4d, vectorV: Point4d) {\r\n this.origin = origin;\r\n this.vectorU = vectorU;\r\n this.vectorV = vectorV;\r\n }\r\n /** Return a clone of this plane */\r\n public clone(result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n if (result) {\r\n result.setFrom(this);\r\n return result;\r\n }\r\n return new PlaneByOriginAndVectors4d(this.origin.clone(), this.vectorU.clone(), this.vectorV.clone());\r\n }\r\n /** copy all content from other plane */\r\n public setFrom(other: PlaneByOriginAndVectors4d): void {\r\n this.origin.setFrom(other.origin);\r\n this.vectorU.setFrom(other.vectorU);\r\n this.vectorV.setFrom(other.vectorV);\r\n }\r\n /** Return true if origin, vectorU, and vectorV pass isAlmostEqual. */\r\n public isAlmostEqual(other: PlaneByOriginAndVectors4d): boolean {\r\n return this.origin.isAlmostEqual(other.origin)\r\n && this.vectorU.isAlmostEqual(other.vectorU)\r\n && this.vectorV.isAlmostEqual(other.vectorV);\r\n }\r\n /** Create a plane with (copies of) origin, vectorU, vectorV parameters, all given as full 4d points.\r\n */\r\n public static createOriginAndVectors(origin: Point4d, vectorU: Point4d, vectorV: Point4d, result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n if (result) {\r\n result.setOriginAndVectors(origin, vectorU, vectorV);\r\n return result;\r\n }\r\n return new PlaneByOriginAndVectors4d(origin.clone(), vectorU.clone(), vectorV.clone());\r\n }\r\n /** Set all numeric data from complete list of (x,y,z,w) in origin, vectorU, and vectorV */\r\n public setOriginAndVectorsXYZW(x0: number, y0: number, z0: number, w0: number, ux: number, uy: number, uz: number, uw: number, vx: number, vy: number, vz: number, vw: number): PlaneByOriginAndVectors4d {\r\n this.origin.set(x0, y0, z0, w0);\r\n this.vectorU.set(ux, uy, uz, uw);\r\n this.vectorV.set(vx, vy, vz, vw);\r\n return this;\r\n }\r\n /** Copy the contents of origin, vectorU, vectorV parameters to respective member variables */\r\n public setOriginAndVectors(origin: Point4d, vectorU: Point4d, vectorV: Point4d): PlaneByOriginAndVectors4d {\r\n this.origin.setFrom(origin);\r\n this.vectorU.setFrom(vectorU);\r\n this.vectorV.setFrom(vectorV);\r\n return this;\r\n }\r\n /** Create from complete list of (x,y,z,w) in origin, vectorU, and vectorV */\r\n public static createOriginAndVectorsXYZW(x0: number, y0: number, z0: number, w0: number, ux: number, uy: number, uz: number, uw: number, vx: number, vy: number, vz: number, vw: number, result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n if (result)\r\n return result.setOriginAndVectorsXYZW(x0, y0, z0, w0, ux, uy, uz, uw, vx, vy, vz, vw);\r\n return new PlaneByOriginAndVectors4d(Point4d.create(x0, y0, z0, w0), Point4d.create(ux, uy, uz, uw), Point4d.create(vx, vy, vz, uw));\r\n }\r\n /** create from origin point, (u=1,v=0) point, and (u=0,v=1) point. */\r\n public static createOriginAndTargets3d(origin: Point3d, targetU: Point3d, targetV: Point3d, result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n return PlaneByOriginAndVectors4d.createOriginAndVectorsXYZW(origin.x, origin.y, origin.z, 1.0, targetU.x - origin.x, targetU.y - origin.y, targetU.z - origin.z, 0.0, targetV.x - origin.x, targetV.y - origin.y, targetV.z - origin.z, 0.0, result);\r\n }\r\n /** evaluate plane point (full 3d) at given (u,v) coordinate. */\r\n public fractionToPoint(u: number, v: number, result?: Point4d): Point4d {\r\n return this.origin.plus2Scaled(this.vectorU, u, this.vectorV, v, result);\r\n }\r\n /** create a new plane which maps to the cartesian xy plane. */\r\n public static createXYPlane(result?: PlaneByOriginAndVectors4d): PlaneByOriginAndVectors4d {\r\n return PlaneByOriginAndVectors4d.createOriginAndVectorsXYZW(0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 0, result);\r\n }\r\n}\r\n"]}
@@ -34,6 +34,8 @@ function quotientDerivative2(ddg, dh, ddh, f, df, divH) {
34
34
  * @public
35
35
  */
36
36
  export class Point4d extends Plane3d {
37
+ /** x,y,z,w are packed into a Float64Array */
38
+ xyzw;
37
39
  /** Set x,y,z,w of this point. */
38
40
  set(x = 0, y = 0, z = 0, w = 0) {
39
41
  this.xyzw[0] = x;