@itwin/core-geometry 4.0.0-dev.59 → 4.0.0-dev.60

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 (473) hide show
  1. package/lib/cjs/Constant.js.map +1 -1
  2. package/lib/cjs/Geometry.d.ts +13 -5
  3. package/lib/cjs/Geometry.d.ts.map +1 -1
  4. package/lib/cjs/Geometry.js +13 -0
  5. package/lib/cjs/Geometry.js.map +1 -1
  6. package/lib/cjs/bspline/AkimaCurve3d.js.map +1 -1
  7. package/lib/cjs/bspline/BSpline1dNd.js.map +1 -1
  8. package/lib/cjs/bspline/BSplineCurve.js.map +1 -1
  9. package/lib/cjs/bspline/BSplineCurve3dH.js.map +1 -1
  10. package/lib/cjs/bspline/BSplineCurveOps.js.map +1 -1
  11. package/lib/cjs/bspline/BSplineSurface.js.map +1 -1
  12. package/lib/cjs/bspline/Bezier1dNd.js.map +1 -1
  13. package/lib/cjs/bspline/BezierCurve3d.js.map +1 -1
  14. package/lib/cjs/bspline/BezierCurve3dH.js.map +1 -1
  15. package/lib/cjs/bspline/BezierCurveBase.js.map +1 -1
  16. package/lib/cjs/bspline/InterpolationCurve3d.js.map +1 -1
  17. package/lib/cjs/bspline/KnotVector.js.map +1 -1
  18. package/lib/cjs/bspline/SurfaceLocationDetail.js.map +1 -1
  19. package/lib/cjs/clipping/AlternatingConvexClipTree.js.map +1 -1
  20. package/lib/cjs/clipping/BooleanClipFactory.js.map +1 -1
  21. package/lib/cjs/clipping/BooleanClipNode.js.map +1 -1
  22. package/lib/cjs/clipping/ClipPlane.d.ts +15 -2
  23. package/lib/cjs/clipping/ClipPlane.d.ts.map +1 -1
  24. package/lib/cjs/clipping/ClipPlane.js +22 -1
  25. package/lib/cjs/clipping/ClipPlane.js.map +1 -1
  26. package/lib/cjs/clipping/ClipPrimitive.js.map +1 -1
  27. package/lib/cjs/clipping/ClipUtils.js.map +1 -1
  28. package/lib/cjs/clipping/ClipVector.js.map +1 -1
  29. package/lib/cjs/clipping/ConvexClipPlaneSet.js.map +1 -1
  30. package/lib/cjs/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  31. package/lib/cjs/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  32. package/lib/cjs/core-geometry.d.ts +2 -0
  33. package/lib/cjs/core-geometry.d.ts.map +1 -1
  34. package/lib/cjs/core-geometry.js +2 -0
  35. package/lib/cjs/core-geometry.js.map +1 -1
  36. package/lib/cjs/curve/Arc3d.js.map +1 -1
  37. package/lib/cjs/curve/ChainCollectorContext.js.map +1 -1
  38. package/lib/cjs/curve/ConstructCurveBetweenCurves.js.map +1 -1
  39. package/lib/cjs/curve/CoordinateXYZ.js.map +1 -1
  40. package/lib/cjs/curve/CurveChain.js.map +1 -1
  41. package/lib/cjs/curve/CurveChainWithDistanceIndex.js.map +1 -1
  42. package/lib/cjs/curve/CurveCollection.js.map +1 -1
  43. package/lib/cjs/curve/CurveCurve.js.map +1 -1
  44. package/lib/cjs/curve/CurveCurveCloseApproachXY.js.map +1 -1
  45. package/lib/cjs/curve/CurveCurveIntersectXY.js.map +1 -1
  46. package/lib/cjs/curve/CurveCurveIntersectXYZ.js.map +1 -1
  47. package/lib/cjs/curve/CurveExtendMode.js.map +1 -1
  48. package/lib/cjs/curve/CurveFactory.js.map +1 -1
  49. package/lib/cjs/curve/CurveLocationDetail.js.map +1 -1
  50. package/lib/cjs/curve/CurvePrimitive.js.map +1 -1
  51. package/lib/cjs/curve/CurveProcessor.js.map +1 -1
  52. package/lib/cjs/curve/CurveWireMomentsXYZ.js.map +1 -1
  53. package/lib/cjs/curve/GeometryQuery.js.map +1 -1
  54. package/lib/cjs/curve/LineSegment3d.js.map +1 -1
  55. package/lib/cjs/curve/LineString3d.js.map +1 -1
  56. package/lib/cjs/curve/Loop.js.map +1 -1
  57. package/lib/cjs/curve/ParityRegion.js.map +1 -1
  58. package/lib/cjs/curve/Path.js.map +1 -1
  59. package/lib/cjs/curve/PointString3d.js.map +1 -1
  60. package/lib/cjs/curve/ProxyCurve.js.map +1 -1
  61. package/lib/cjs/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  62. package/lib/cjs/curve/Query/CurveSplitContext.js.map +1 -1
  63. package/lib/cjs/curve/Query/CylindricalRange.js.map +1 -1
  64. package/lib/cjs/curve/Query/InOutTests.js.map +1 -1
  65. package/lib/cjs/curve/Query/PlanarSubdivision.js.map +1 -1
  66. package/lib/cjs/curve/Query/StrokeCountChain.js.map +1 -1
  67. package/lib/cjs/curve/Query/StrokeCountMap.js.map +1 -1
  68. package/lib/cjs/curve/RegionMomentsXY.js.map +1 -1
  69. package/lib/cjs/curve/RegionOps.js.map +1 -1
  70. package/lib/cjs/curve/RegionOpsClassificationSweeps.js.map +1 -1
  71. package/lib/cjs/curve/StrokeOptions.js.map +1 -1
  72. package/lib/cjs/curve/UnionRegion.js.map +1 -1
  73. package/lib/cjs/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  74. package/lib/cjs/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  75. package/lib/cjs/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  76. package/lib/cjs/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  77. package/lib/cjs/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  78. package/lib/cjs/curve/internalContexts/CurveLengthContext.js.map +1 -1
  79. package/lib/cjs/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  80. package/lib/cjs/curve/internalContexts/GapSearchContext.js.map +1 -1
  81. package/lib/cjs/curve/internalContexts/MultiChainCollector.js.map +1 -1
  82. package/lib/cjs/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  83. package/lib/cjs/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  84. package/lib/cjs/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  85. package/lib/cjs/curve/internalContexts/SumLengthsContext.js.map +1 -1
  86. package/lib/cjs/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  87. package/lib/cjs/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  88. package/lib/cjs/curve/spiral/ClothoidSeries.js.map +1 -1
  89. package/lib/cjs/curve/spiral/CubicEvaluator.js.map +1 -1
  90. package/lib/cjs/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  91. package/lib/cjs/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  92. package/lib/cjs/curve/spiral/DirectSpiral3d.js.map +1 -1
  93. package/lib/cjs/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  94. package/lib/cjs/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  95. package/lib/cjs/curve/spiral/NormalizedTransition.js.map +1 -1
  96. package/lib/cjs/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  97. package/lib/cjs/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  98. package/lib/cjs/curve/spiral/TransitionSpiral3d.js.map +1 -1
  99. package/lib/cjs/curve/spiral/XYCurveEvaluator.js.map +1 -1
  100. package/lib/cjs/geometry3d/Angle.js.map +1 -1
  101. package/lib/cjs/geometry3d/AngleSweep.js.map +1 -1
  102. package/lib/cjs/geometry3d/BarycentricTriangle.js.map +1 -1
  103. package/lib/cjs/geometry3d/BilinearPatch.js.map +1 -1
  104. package/lib/cjs/geometry3d/CoincidentGeometryOps.js.map +1 -1
  105. package/lib/cjs/geometry3d/Ellipsoid.js.map +1 -1
  106. package/lib/cjs/geometry3d/FrameBuilder.js.map +1 -1
  107. package/lib/cjs/geometry3d/FrustumAnimation.js.map +1 -1
  108. package/lib/cjs/geometry3d/GeometryHandler.js.map +1 -1
  109. package/lib/cjs/geometry3d/GrowableBlockedArray.js.map +1 -1
  110. package/lib/cjs/geometry3d/GrowableFloat64Array.js.map +1 -1
  111. package/lib/cjs/geometry3d/GrowableXYArray.js.map +1 -1
  112. package/lib/cjs/geometry3d/GrowableXYZArray.js.map +1 -1
  113. package/lib/cjs/geometry3d/IndexedCollectionInterval.js.map +1 -1
  114. package/lib/cjs/geometry3d/IndexedXYCollection.js.map +1 -1
  115. package/lib/cjs/geometry3d/IndexedXYZCollection.js.map +1 -1
  116. package/lib/cjs/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  117. package/lib/cjs/geometry3d/Matrix3d.js.map +1 -1
  118. package/lib/cjs/geometry3d/OrderedRotationAngles.js.map +1 -1
  119. package/lib/cjs/geometry3d/Plane3d.d.ts +126 -0
  120. package/lib/cjs/geometry3d/Plane3d.d.ts.map +1 -0
  121. package/lib/cjs/geometry3d/Plane3d.js +95 -0
  122. package/lib/cjs/geometry3d/Plane3d.js.map +1 -0
  123. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +34 -6
  124. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  125. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js +59 -5
  126. package/lib/cjs/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  127. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts +58 -4
  128. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  129. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js +134 -4
  130. package/lib/cjs/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  131. package/lib/cjs/geometry3d/Point2dArrayCarrier.js.map +1 -1
  132. package/lib/cjs/geometry3d/Point2dVector2d.js.map +1 -1
  133. package/lib/cjs/geometry3d/Point3dArrayCarrier.js.map +1 -1
  134. package/lib/cjs/geometry3d/Point3dVector3d.d.ts +13 -0
  135. package/lib/cjs/geometry3d/Point3dVector3d.d.ts.map +1 -1
  136. package/lib/cjs/geometry3d/Point3dVector3d.js +20 -0
  137. package/lib/cjs/geometry3d/Point3dVector3d.js.map +1 -1
  138. package/lib/cjs/geometry3d/PointHelpers.js.map +1 -1
  139. package/lib/cjs/geometry3d/PointStreaming.js.map +1 -1
  140. package/lib/cjs/geometry3d/PolygonOps.js.map +1 -1
  141. package/lib/cjs/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  142. package/lib/cjs/geometry3d/PolylineOps.js.map +1 -1
  143. package/lib/cjs/geometry3d/Range.js.map +1 -1
  144. package/lib/cjs/geometry3d/Ray3d.d.ts +8 -1
  145. package/lib/cjs/geometry3d/Ray3d.d.ts.map +1 -1
  146. package/lib/cjs/geometry3d/Ray3d.js +19 -1
  147. package/lib/cjs/geometry3d/Ray3d.js.map +1 -1
  148. package/lib/cjs/geometry3d/ReusableObjectCache.js.map +1 -1
  149. package/lib/cjs/geometry3d/Segment1d.js.map +1 -1
  150. package/lib/cjs/geometry3d/SortablePolygon.js.map +1 -1
  151. package/lib/cjs/geometry3d/Transform.js.map +1 -1
  152. package/lib/cjs/geometry3d/UVSurfaceOps.js.map +1 -1
  153. package/lib/cjs/geometry3d/XYZProps.js.map +1 -1
  154. package/lib/cjs/geometry3d/YawPitchRollAngles.js.map +1 -1
  155. package/lib/cjs/geometry4d/Map4d.js.map +1 -1
  156. package/lib/cjs/geometry4d/Matrix4d.js.map +1 -1
  157. package/lib/cjs/geometry4d/MomentData.js.map +1 -1
  158. package/lib/cjs/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  159. package/lib/cjs/geometry4d/Point4d.d.ts +14 -2
  160. package/lib/cjs/geometry4d/Point4d.d.ts.map +1 -1
  161. package/lib/cjs/geometry4d/Point4d.js +25 -12
  162. package/lib/cjs/geometry4d/Point4d.js.map +1 -1
  163. package/lib/cjs/numerics/BandedSystem.js.map +1 -1
  164. package/lib/cjs/numerics/BezierPolynomials.js.map +1 -1
  165. package/lib/cjs/numerics/ClusterableArray.js.map +1 -1
  166. package/lib/cjs/numerics/Complex.js.map +1 -1
  167. package/lib/cjs/numerics/ConvexPolygon2d.js.map +1 -1
  168. package/lib/cjs/numerics/Newton.js.map +1 -1
  169. package/lib/cjs/numerics/PascalCoefficients.js.map +1 -1
  170. package/lib/cjs/numerics/PolarData.js.map +1 -1
  171. package/lib/cjs/numerics/Polynomials.js.map +1 -1
  172. package/lib/cjs/numerics/Quadrature.js.map +1 -1
  173. package/lib/cjs/numerics/Range1dArray.js.map +1 -1
  174. package/lib/cjs/numerics/TriDiagonalSystem.js.map +1 -1
  175. package/lib/cjs/numerics/UnionFind.js.map +1 -1
  176. package/lib/cjs/numerics/UsageSums.js.map +1 -1
  177. package/lib/cjs/polyface/AuxData.js.map +1 -1
  178. package/lib/cjs/polyface/BoxTopology.js.map +1 -1
  179. package/lib/cjs/polyface/FacetFaceData.js.map +1 -1
  180. package/lib/cjs/polyface/FacetLocationDetail.js.map +1 -1
  181. package/lib/cjs/polyface/FacetOrientation.js.map +1 -1
  182. package/lib/cjs/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  183. package/lib/cjs/polyface/IndexedEdgeMatcher.js.map +1 -1
  184. package/lib/cjs/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  185. package/lib/cjs/polyface/Polyface.js.map +1 -1
  186. package/lib/cjs/polyface/PolyfaceBuilder.js.map +1 -1
  187. package/lib/cjs/polyface/PolyfaceClip.js.map +1 -1
  188. package/lib/cjs/polyface/PolyfaceData.js.map +1 -1
  189. package/lib/cjs/polyface/PolyfaceQuery.js.map +1 -1
  190. package/lib/cjs/polyface/RangeLengthData.js.map +1 -1
  191. package/lib/cjs/polyface/TaggedNumericData.js.map +1 -1
  192. package/lib/cjs/polyface/TriangleCandidate.js.map +1 -1
  193. package/lib/cjs/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  194. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  195. package/lib/cjs/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  196. package/lib/cjs/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  197. package/lib/cjs/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  198. package/lib/cjs/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  199. package/lib/cjs/polyface/multiclip/RangeSearch.js.map +1 -1
  200. package/lib/cjs/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  201. package/lib/cjs/polyface/multiclip/XYPointBuckets.js.map +1 -1
  202. package/lib/cjs/serialization/BGFBAccessors.js.map +1 -1
  203. package/lib/cjs/serialization/BGFBReader.js.map +1 -1
  204. package/lib/cjs/serialization/BGFBWriter.js.map +1 -1
  205. package/lib/cjs/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  206. package/lib/cjs/serialization/DeepCompare.js.map +1 -1
  207. package/lib/cjs/serialization/GeometrySamples.js.map +1 -1
  208. package/lib/cjs/serialization/IModelJsonSchema.js.map +1 -1
  209. package/lib/cjs/solid/Box.js.map +1 -1
  210. package/lib/cjs/solid/Cone.js.map +1 -1
  211. package/lib/cjs/solid/LinearSweep.js.map +1 -1
  212. package/lib/cjs/solid/RotationalSweep.js.map +1 -1
  213. package/lib/cjs/solid/RuledSweep.js.map +1 -1
  214. package/lib/cjs/solid/SolidPrimitive.js.map +1 -1
  215. package/lib/cjs/solid/Sphere.js.map +1 -1
  216. package/lib/cjs/solid/SweepContour.js.map +1 -1
  217. package/lib/cjs/solid/TorusPipe.js.map +1 -1
  218. package/lib/cjs/topology/ChainMerge.js.map +1 -1
  219. package/lib/cjs/topology/Graph.js.map +1 -1
  220. package/lib/cjs/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  221. package/lib/cjs/topology/HalfEdgeGraphSearch.js.map +1 -1
  222. package/lib/cjs/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  223. package/lib/cjs/topology/HalfEdgeGraphValidation.js.map +1 -1
  224. package/lib/cjs/topology/HalfEdgeMarkSet.js.map +1 -1
  225. package/lib/cjs/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  226. package/lib/cjs/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  227. package/lib/cjs/topology/HalfEdgePositionDetail.js.map +1 -1
  228. package/lib/cjs/topology/HalfEdgePriorityQueue.js.map +1 -1
  229. package/lib/cjs/topology/InsertAndRetriangulateContext.js.map +1 -1
  230. package/lib/cjs/topology/MaskManager.js.map +1 -1
  231. package/lib/cjs/topology/Merging.js.map +1 -1
  232. package/lib/cjs/topology/RegularizeFace.js.map +1 -1
  233. package/lib/cjs/topology/SignedDataSummary.js.map +1 -1
  234. package/lib/cjs/topology/SpaceTriangulation.js.map +1 -1
  235. package/lib/cjs/topology/Triangulation.js.map +1 -1
  236. package/lib/cjs/topology/XYParitySearchContext.js.map +1 -1
  237. package/lib/esm/Constant.js.map +1 -1
  238. package/lib/esm/Geometry.d.ts +13 -5
  239. package/lib/esm/Geometry.d.ts.map +1 -1
  240. package/lib/esm/Geometry.js +13 -0
  241. package/lib/esm/Geometry.js.map +1 -1
  242. package/lib/esm/bspline/AkimaCurve3d.js.map +1 -1
  243. package/lib/esm/bspline/BSpline1dNd.js.map +1 -1
  244. package/lib/esm/bspline/BSplineCurve.js.map +1 -1
  245. package/lib/esm/bspline/BSplineCurve3dH.js.map +1 -1
  246. package/lib/esm/bspline/BSplineCurveOps.js.map +1 -1
  247. package/lib/esm/bspline/BSplineSurface.js.map +1 -1
  248. package/lib/esm/bspline/Bezier1dNd.js.map +1 -1
  249. package/lib/esm/bspline/BezierCurve3d.js.map +1 -1
  250. package/lib/esm/bspline/BezierCurve3dH.js.map +1 -1
  251. package/lib/esm/bspline/BezierCurveBase.js.map +1 -1
  252. package/lib/esm/bspline/InterpolationCurve3d.js.map +1 -1
  253. package/lib/esm/bspline/KnotVector.js.map +1 -1
  254. package/lib/esm/bspline/SurfaceLocationDetail.js.map +1 -1
  255. package/lib/esm/clipping/AlternatingConvexClipTree.js.map +1 -1
  256. package/lib/esm/clipping/BooleanClipFactory.js.map +1 -1
  257. package/lib/esm/clipping/BooleanClipNode.js.map +1 -1
  258. package/lib/esm/clipping/ClipPlane.d.ts +15 -2
  259. package/lib/esm/clipping/ClipPlane.d.ts.map +1 -1
  260. package/lib/esm/clipping/ClipPlane.js +22 -1
  261. package/lib/esm/clipping/ClipPlane.js.map +1 -1
  262. package/lib/esm/clipping/ClipPrimitive.js.map +1 -1
  263. package/lib/esm/clipping/ClipUtils.js.map +1 -1
  264. package/lib/esm/clipping/ClipVector.js.map +1 -1
  265. package/lib/esm/clipping/ConvexClipPlaneSet.js.map +1 -1
  266. package/lib/esm/clipping/UnionOfConvexClipPlaneSets.js.map +1 -1
  267. package/lib/esm/clipping/internalContexts/LineStringOffsetClipperContext.js.map +1 -1
  268. package/lib/esm/core-geometry.d.ts +2 -0
  269. package/lib/esm/core-geometry.d.ts.map +1 -1
  270. package/lib/esm/core-geometry.js +2 -0
  271. package/lib/esm/core-geometry.js.map +1 -1
  272. package/lib/esm/curve/Arc3d.js.map +1 -1
  273. package/lib/esm/curve/ChainCollectorContext.js.map +1 -1
  274. package/lib/esm/curve/ConstructCurveBetweenCurves.js.map +1 -1
  275. package/lib/esm/curve/CoordinateXYZ.js.map +1 -1
  276. package/lib/esm/curve/CurveChain.js.map +1 -1
  277. package/lib/esm/curve/CurveChainWithDistanceIndex.js.map +1 -1
  278. package/lib/esm/curve/CurveCollection.js.map +1 -1
  279. package/lib/esm/curve/CurveCurve.js.map +1 -1
  280. package/lib/esm/curve/CurveCurveCloseApproachXY.js.map +1 -1
  281. package/lib/esm/curve/CurveCurveIntersectXY.js.map +1 -1
  282. package/lib/esm/curve/CurveCurveIntersectXYZ.js.map +1 -1
  283. package/lib/esm/curve/CurveExtendMode.js.map +1 -1
  284. package/lib/esm/curve/CurveFactory.js.map +1 -1
  285. package/lib/esm/curve/CurveLocationDetail.js.map +1 -1
  286. package/lib/esm/curve/CurvePrimitive.js.map +1 -1
  287. package/lib/esm/curve/CurveProcessor.js.map +1 -1
  288. package/lib/esm/curve/CurveWireMomentsXYZ.js.map +1 -1
  289. package/lib/esm/curve/GeometryQuery.js.map +1 -1
  290. package/lib/esm/curve/LineSegment3d.js.map +1 -1
  291. package/lib/esm/curve/LineString3d.js.map +1 -1
  292. package/lib/esm/curve/Loop.js.map +1 -1
  293. package/lib/esm/curve/ParityRegion.js.map +1 -1
  294. package/lib/esm/curve/Path.js.map +1 -1
  295. package/lib/esm/curve/PointString3d.js.map +1 -1
  296. package/lib/esm/curve/ProxyCurve.js.map +1 -1
  297. package/lib/esm/curve/Query/ConsolidateAdjacentPrimitivesContext.js.map +1 -1
  298. package/lib/esm/curve/Query/CurveSplitContext.js.map +1 -1
  299. package/lib/esm/curve/Query/CylindricalRange.js.map +1 -1
  300. package/lib/esm/curve/Query/InOutTests.js.map +1 -1
  301. package/lib/esm/curve/Query/PlanarSubdivision.js.map +1 -1
  302. package/lib/esm/curve/Query/StrokeCountChain.js.map +1 -1
  303. package/lib/esm/curve/Query/StrokeCountMap.js.map +1 -1
  304. package/lib/esm/curve/RegionMomentsXY.js.map +1 -1
  305. package/lib/esm/curve/RegionOps.js.map +1 -1
  306. package/lib/esm/curve/RegionOpsClassificationSweeps.js.map +1 -1
  307. package/lib/esm/curve/StrokeOptions.js.map +1 -1
  308. package/lib/esm/curve/UnionRegion.js.map +1 -1
  309. package/lib/esm/curve/internalContexts/AppendPlaneIntersectionStrokeHandler.js.map +1 -1
  310. package/lib/esm/curve/internalContexts/CloneCurvesContext.js.map +1 -1
  311. package/lib/esm/curve/internalContexts/CloneWithExpandedLineStrings.js.map +1 -1
  312. package/lib/esm/curve/internalContexts/ClosestPointStrokeHandler.js.map +1 -1
  313. package/lib/esm/curve/internalContexts/CountLinearPartsSearchContext.js.map +1 -1
  314. package/lib/esm/curve/internalContexts/CurveLengthContext.js.map +1 -1
  315. package/lib/esm/curve/internalContexts/CurveOffsetXYHandler.js.map +1 -1
  316. package/lib/esm/curve/internalContexts/GapSearchContext.js.map +1 -1
  317. package/lib/esm/curve/internalContexts/MultiChainCollector.js.map +1 -1
  318. package/lib/esm/curve/internalContexts/NewtonRtoRStrokeHandler.js.map +1 -1
  319. package/lib/esm/curve/internalContexts/PlaneAltitudeRangeContext.js.map +1 -1
  320. package/lib/esm/curve/internalContexts/PolygonOffsetContext.js.map +1 -1
  321. package/lib/esm/curve/internalContexts/SumLengthsContext.js.map +1 -1
  322. package/lib/esm/curve/internalContexts/TransformInPlaceContext.js.map +1 -1
  323. package/lib/esm/curve/spiral/AustralianRailCorpXYEvaluator.js.map +1 -1
  324. package/lib/esm/curve/spiral/ClothoidSeries.js.map +1 -1
  325. package/lib/esm/curve/spiral/CubicEvaluator.js.map +1 -1
  326. package/lib/esm/curve/spiral/CzechSpiralEvaluator.js.map +1 -1
  327. package/lib/esm/curve/spiral/DirectHalfCosineSpiralEvaluator.js.map +1 -1
  328. package/lib/esm/curve/spiral/DirectSpiral3d.js.map +1 -1
  329. package/lib/esm/curve/spiral/IntegratedSpiral3d.js.map +1 -1
  330. package/lib/esm/curve/spiral/MXCubicAlongArcSpiralEvaluator.js.map +1 -1
  331. package/lib/esm/curve/spiral/NormalizedTransition.js.map +1 -1
  332. package/lib/esm/curve/spiral/PolishCubicSpiralEvaluator.js.map +1 -1
  333. package/lib/esm/curve/spiral/TransitionConditionalProperties.js.map +1 -1
  334. package/lib/esm/curve/spiral/TransitionSpiral3d.js.map +1 -1
  335. package/lib/esm/curve/spiral/XYCurveEvaluator.js.map +1 -1
  336. package/lib/esm/geometry3d/Angle.js.map +1 -1
  337. package/lib/esm/geometry3d/AngleSweep.js.map +1 -1
  338. package/lib/esm/geometry3d/BarycentricTriangle.js.map +1 -1
  339. package/lib/esm/geometry3d/BilinearPatch.js.map +1 -1
  340. package/lib/esm/geometry3d/CoincidentGeometryOps.js.map +1 -1
  341. package/lib/esm/geometry3d/Ellipsoid.js.map +1 -1
  342. package/lib/esm/geometry3d/FrameBuilder.js.map +1 -1
  343. package/lib/esm/geometry3d/FrustumAnimation.js.map +1 -1
  344. package/lib/esm/geometry3d/GeometryHandler.js.map +1 -1
  345. package/lib/esm/geometry3d/GrowableBlockedArray.js.map +1 -1
  346. package/lib/esm/geometry3d/GrowableFloat64Array.js.map +1 -1
  347. package/lib/esm/geometry3d/GrowableXYArray.js.map +1 -1
  348. package/lib/esm/geometry3d/GrowableXYZArray.js.map +1 -1
  349. package/lib/esm/geometry3d/IndexedCollectionInterval.js.map +1 -1
  350. package/lib/esm/geometry3d/IndexedXYCollection.js.map +1 -1
  351. package/lib/esm/geometry3d/IndexedXYZCollection.js.map +1 -1
  352. package/lib/esm/geometry3d/LongitudeLatitudeAltitude.js.map +1 -1
  353. package/lib/esm/geometry3d/Matrix3d.js.map +1 -1
  354. package/lib/esm/geometry3d/OrderedRotationAngles.js.map +1 -1
  355. package/lib/esm/geometry3d/Plane3d.d.ts +126 -0
  356. package/lib/esm/geometry3d/Plane3d.d.ts.map +1 -0
  357. package/lib/esm/geometry3d/Plane3d.js +91 -0
  358. package/lib/esm/geometry3d/Plane3d.js.map +1 -0
  359. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts +34 -6
  360. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.d.ts.map +1 -1
  361. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js +59 -5
  362. package/lib/esm/geometry3d/Plane3dByOriginAndUnitNormal.js.map +1 -1
  363. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts +58 -4
  364. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.d.ts.map +1 -1
  365. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js +134 -4
  366. package/lib/esm/geometry3d/Plane3dByOriginAndVectors.js.map +1 -1
  367. package/lib/esm/geometry3d/Point2dArrayCarrier.js.map +1 -1
  368. package/lib/esm/geometry3d/Point2dVector2d.js.map +1 -1
  369. package/lib/esm/geometry3d/Point3dArrayCarrier.js.map +1 -1
  370. package/lib/esm/geometry3d/Point3dVector3d.d.ts +13 -0
  371. package/lib/esm/geometry3d/Point3dVector3d.d.ts.map +1 -1
  372. package/lib/esm/geometry3d/Point3dVector3d.js +20 -0
  373. package/lib/esm/geometry3d/Point3dVector3d.js.map +1 -1
  374. package/lib/esm/geometry3d/PointHelpers.js.map +1 -1
  375. package/lib/esm/geometry3d/PointStreaming.js.map +1 -1
  376. package/lib/esm/geometry3d/PolygonOps.js.map +1 -1
  377. package/lib/esm/geometry3d/PolylineCompressionByEdgeOffset.js.map +1 -1
  378. package/lib/esm/geometry3d/PolylineOps.js.map +1 -1
  379. package/lib/esm/geometry3d/Range.js.map +1 -1
  380. package/lib/esm/geometry3d/Ray3d.d.ts +8 -1
  381. package/lib/esm/geometry3d/Ray3d.d.ts.map +1 -1
  382. package/lib/esm/geometry3d/Ray3d.js +19 -1
  383. package/lib/esm/geometry3d/Ray3d.js.map +1 -1
  384. package/lib/esm/geometry3d/ReusableObjectCache.js.map +1 -1
  385. package/lib/esm/geometry3d/Segment1d.js.map +1 -1
  386. package/lib/esm/geometry3d/SortablePolygon.js.map +1 -1
  387. package/lib/esm/geometry3d/Transform.js.map +1 -1
  388. package/lib/esm/geometry3d/UVSurfaceOps.js.map +1 -1
  389. package/lib/esm/geometry3d/XYZProps.js.map +1 -1
  390. package/lib/esm/geometry3d/YawPitchRollAngles.js.map +1 -1
  391. package/lib/esm/geometry4d/Map4d.js.map +1 -1
  392. package/lib/esm/geometry4d/Matrix4d.js.map +1 -1
  393. package/lib/esm/geometry4d/MomentData.js.map +1 -1
  394. package/lib/esm/geometry4d/PlaneByOriginAndVectors4d.js.map +1 -1
  395. package/lib/esm/geometry4d/Point4d.d.ts +14 -2
  396. package/lib/esm/geometry4d/Point4d.d.ts.map +1 -1
  397. package/lib/esm/geometry4d/Point4d.js +25 -12
  398. package/lib/esm/geometry4d/Point4d.js.map +1 -1
  399. package/lib/esm/numerics/BandedSystem.js.map +1 -1
  400. package/lib/esm/numerics/BezierPolynomials.js.map +1 -1
  401. package/lib/esm/numerics/ClusterableArray.js.map +1 -1
  402. package/lib/esm/numerics/Complex.js.map +1 -1
  403. package/lib/esm/numerics/ConvexPolygon2d.js.map +1 -1
  404. package/lib/esm/numerics/Newton.js.map +1 -1
  405. package/lib/esm/numerics/PascalCoefficients.js.map +1 -1
  406. package/lib/esm/numerics/PolarData.js.map +1 -1
  407. package/lib/esm/numerics/Polynomials.js.map +1 -1
  408. package/lib/esm/numerics/Quadrature.js.map +1 -1
  409. package/lib/esm/numerics/Range1dArray.js.map +1 -1
  410. package/lib/esm/numerics/TriDiagonalSystem.js.map +1 -1
  411. package/lib/esm/numerics/UnionFind.js.map +1 -1
  412. package/lib/esm/numerics/UsageSums.js.map +1 -1
  413. package/lib/esm/polyface/AuxData.js.map +1 -1
  414. package/lib/esm/polyface/BoxTopology.js.map +1 -1
  415. package/lib/esm/polyface/FacetFaceData.js.map +1 -1
  416. package/lib/esm/polyface/FacetLocationDetail.js.map +1 -1
  417. package/lib/esm/polyface/FacetOrientation.js.map +1 -1
  418. package/lib/esm/polyface/GreedyTriangulationBetweenLineStrings.js.map +1 -1
  419. package/lib/esm/polyface/IndexedEdgeMatcher.js.map +1 -1
  420. package/lib/esm/polyface/IndexedPolyfaceVisitor.js.map +1 -1
  421. package/lib/esm/polyface/Polyface.js.map +1 -1
  422. package/lib/esm/polyface/PolyfaceBuilder.js.map +1 -1
  423. package/lib/esm/polyface/PolyfaceClip.js.map +1 -1
  424. package/lib/esm/polyface/PolyfaceData.js.map +1 -1
  425. package/lib/esm/polyface/PolyfaceQuery.js.map +1 -1
  426. package/lib/esm/polyface/RangeLengthData.js.map +1 -1
  427. package/lib/esm/polyface/TaggedNumericData.js.map +1 -1
  428. package/lib/esm/polyface/TriangleCandidate.js.map +1 -1
  429. package/lib/esm/polyface/multiclip/BuildAverageNormalsContext.js.map +1 -1
  430. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSet.js.map +1 -1
  431. package/lib/esm/polyface/multiclip/GriddedRaggedRange2dSetWithOverflow.js.map +1 -1
  432. package/lib/esm/polyface/multiclip/LinearSearchRange2dArray.js.map +1 -1
  433. package/lib/esm/polyface/multiclip/OffsetMeshContext.js.map +1 -1
  434. package/lib/esm/polyface/multiclip/Range2dSearchInterface.js.map +1 -1
  435. package/lib/esm/polyface/multiclip/RangeSearch.js.map +1 -1
  436. package/lib/esm/polyface/multiclip/SweepLineStringToFacetContext.js.map +1 -1
  437. package/lib/esm/polyface/multiclip/XYPointBuckets.js.map +1 -1
  438. package/lib/esm/serialization/BGFBAccessors.js.map +1 -1
  439. package/lib/esm/serialization/BGFBReader.js.map +1 -1
  440. package/lib/esm/serialization/BGFBWriter.js.map +1 -1
  441. package/lib/esm/serialization/BentleyGeometryFlatBuffer.js.map +1 -1
  442. package/lib/esm/serialization/DeepCompare.js.map +1 -1
  443. package/lib/esm/serialization/GeometrySamples.js.map +1 -1
  444. package/lib/esm/serialization/IModelJsonSchema.js.map +1 -1
  445. package/lib/esm/solid/Box.js.map +1 -1
  446. package/lib/esm/solid/Cone.js.map +1 -1
  447. package/lib/esm/solid/LinearSweep.js.map +1 -1
  448. package/lib/esm/solid/RotationalSweep.js.map +1 -1
  449. package/lib/esm/solid/RuledSweep.js.map +1 -1
  450. package/lib/esm/solid/SolidPrimitive.js.map +1 -1
  451. package/lib/esm/solid/Sphere.js.map +1 -1
  452. package/lib/esm/solid/SweepContour.js.map +1 -1
  453. package/lib/esm/solid/TorusPipe.js.map +1 -1
  454. package/lib/esm/topology/ChainMerge.js.map +1 -1
  455. package/lib/esm/topology/Graph.js.map +1 -1
  456. package/lib/esm/topology/HalfEdgeGraphFromIndexedLoopsContext.js.map +1 -1
  457. package/lib/esm/topology/HalfEdgeGraphSearch.js.map +1 -1
  458. package/lib/esm/topology/HalfEdgeGraphSpineContext.js.map +1 -1
  459. package/lib/esm/topology/HalfEdgeGraphValidation.js.map +1 -1
  460. package/lib/esm/topology/HalfEdgeMarkSet.js.map +1 -1
  461. package/lib/esm/topology/HalfEdgeNodeXYZUV.js.map +1 -1
  462. package/lib/esm/topology/HalfEdgePointInGraphSearch.js.map +1 -1
  463. package/lib/esm/topology/HalfEdgePositionDetail.js.map +1 -1
  464. package/lib/esm/topology/HalfEdgePriorityQueue.js.map +1 -1
  465. package/lib/esm/topology/InsertAndRetriangulateContext.js.map +1 -1
  466. package/lib/esm/topology/MaskManager.js.map +1 -1
  467. package/lib/esm/topology/Merging.js.map +1 -1
  468. package/lib/esm/topology/RegularizeFace.js.map +1 -1
  469. package/lib/esm/topology/SignedDataSummary.js.map +1 -1
  470. package/lib/esm/topology/SpaceTriangulation.js.map +1 -1
  471. package/lib/esm/topology/Triangulation.js.map +1 -1
  472. package/lib/esm/topology/XYParitySearchContext.js.map +1 -1
  473. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"Geometry.js","sourceRoot":"","sources":["../../src/Geometry.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAW,QAAQ,EAAM,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAW,QAAQ,EAAO,MAAM,8BAA8B,CAAC;AAItE,mEAAmE;AAEnE;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,SAaX;AAbD,WAAY,SAAS;IACnB,2CAA2C;IAC3C,uCAAO,CAAA;IACP,2CAA2C;IAC3C,uCAAO,CAAA;IACP,2CAA2C;IAC3C,uCAAO,CAAA;IACP,0CAA0C;IAC1C,uCAAO,CAAA;IACP,0CAA0C;IAC1C,uCAAO,CAAA;IACP,0CAA0C;IAC1C,uCAAO,CAAA;AACT,CAAC,EAbW,SAAS,KAAT,SAAS,QAapB;AACD;;;GAGG;AACH,MAAM,CAAN,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,wBAAwB;IACxB,mCAAK,CAAA;IACL,wBAAwB;IACxB,mCAAK,CAAA;IACL,wBAAwB;IACxB,mCAAK,CAAA;AACP,CAAC,EAPW,SAAS,KAAT,SAAS,QAOpB;AACD;;GAEG;AACH,MAAM,CAAN,IAAY,iBAiBX;AAjBD,WAAY,iBAAiB;IAC3B,uBAAuB;IACvB,uDAAO,CAAA;IACP,gCAAgC;IAChC,6DAAU,CAAA;IACV,gCA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KAAK,SAAS;YACpC,OAAO,CAAC,KAAK,CAAC,CAAC;QACjB,OAAO,KAAK,CAAC;IACf,CAAC;IACD;;MAEE;IACK,MAAM,CAAC,YAAY,CAAyB,CAAkB;QACnE,IAAI,CAAC,KAAK,SAAS;YACjB,OAAO,SAAS,CAAC;QACnB,MAAM,CAAC,GAAQ,EAAE,CAAC;QAClB,KAAK,MAAM,CAAC,IAAI,CAAC,EAAE;YACjB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,EAAG,CAAC,CAAC;SACpB;QACD,OAAO,CAAC,CAAC;IACX,CAAC;;AApwBD,0DAA0D;AACnC,4BAAmB,GAAG,MAAM,CAAC;AACpD,uCAAuC;AAChB,mCAA0B,GAAG,OAAO,CAAC;AAC5D,qDAAqD;AAC9B,0BAAiB,GAAG,OAAO,CAAC;AACnD,oCAAoC;AACb,iCAAwB,GAAG,OAAO,CAAC;AAC1D,qDAAqD;AAC9B,0BAAiB,GAAG,OAAO,CAAC;AACnD,yDAAyD;AAClC,0BAAiB,GAAG,IAAI,CAAC;AAChD;;GAEG;AACoB,4BAAmB,GAAG,MAAM,CAAC;AACpD,+EAA+E;AACxD,sBAAa,GAAG,OAAO,CAAC;AAC/C;;GAEG;AACoB,8BAAqB,GAAG,MAAM,CAAC;AACtD;;GAEG;AACoB,uBAAc,GAAG,MAAM,CAAC;AAa/C,0EAA0E;AACnD,yCAAgC,GAAG,GAAG,GAAG,IAAI,CAAC,EAAE,GAAG,OAAO,CAAC,CAAI,yCAAyC;SAxCpH,QAAQ","sourcesContent":["/*---------------------------------------------------------------------------------------------\r\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\r\n* See LICENSE.md in the project root for license terms and full copyright notice.\r\n*--------------------------------------------------------------------------------------------*/\r\n\r\n/** @packageDocumentation\r\n * @module CartesianGeometry\r\n */\r\n\r\nimport { AngleSweep } from \"./geometry3d/AngleSweep\";\r\nimport { Point2d, Vector2d, XY } from \"./geometry3d/Point2dVector2d\";\r\nimport { Point3d, Vector3d, XYZ } from \"./geometry3d/Point3dVector3d\";\r\nimport { XAndY } from \"./geometry3d/XYZProps\";\r\nimport { Point4d } from \"./geometry4d/Point4d\";\r\n\r\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\n\r\n/**\r\n * Enumeration of the 6 possible orderings of XYZ axis order\r\n * * **Note:** There are 3 axis order with right hand system (XYZ = 0, YZX = 1, ZXY = 2) and 3 axis order with\r\n * left hand system (XZY = 4, YXZ = 5, ZYX = 6). Note that AxisOrder is encoding the handedness as well. Cross\r\n * product of the i_th axis in an ordering (i=0,1,2), with the i+1_th in that ordering, will produce the i+2_th\r\n * axis in that ordering.\r\n * @public\r\n */\r\nexport enum AxisOrder {\r\n /** Right handed system, X then Y then Z */\r\n XYZ = 0, /* eslint-disable-line @typescript-eslint/no-shadow */\r\n /** Right handed system, Y then Z then X */\r\n YZX = 1,\r\n /** Right handed system, Z then X then Y */\r\n ZXY = 2,\r\n /** Left handed system, X then Z then Y */\r\n XZY = 4,\r\n /** Left handed system, Y then X then Z */\r\n YXZ = 5,\r\n /** Left handed system, Z then Y then X */\r\n ZYX = 6,\r\n}\r\n/**\r\n * Enumeration of numeric indices of 3 axes AxisIndex.X, AxisIndex.Y, AxisIndex.Z\r\n * @public\r\n */\r\nexport enum AxisIndex {\r\n /** x axis is index 0 */\r\n X = 0,\r\n /** y axis is index 1 */\r\n Y = 1,\r\n /** 2 axis is index 2 */\r\n Z = 2,\r\n}\r\n/** Standard views. Used in `Matrix3d.createStandardViewAxes(index: StandardViewIndex, invert: boolean)`\r\n * @public\r\n */\r\nexport enum StandardViewIndex {\r\n /** X to right, Y up */\r\n Top = 1,\r\n /** X to right, negative Y up */\r\n Bottom = 2,\r\n /** negative Y to right, Z up */\r\n Left = 3,\r\n /** Y to right, Z up */\r\n Right = 4,\r\n /** X to right, Z up */\r\n Front = 5,\r\n /** negative X to right, Z up */\r\n Back = 6,\r\n /** isometric: view towards origin from (-1,-1,1) */\r\n Iso = 7, //\r\n /** right isometric: view towards origin from (1,-1,1) */\r\n RightIso = 8,\r\n}\r\n/** Enumeration among choice for how a coordinate transformation should incorporate scaling.\r\n * @public\r\n */\r\nexport enum AxisScaleSelect {\r\n /** All axes of unit length. */\r\n Unit = 0,\r\n /** On each axis, the vector length matches the longest side of the range of the data. */\r\n LongestRangeDirection = 1,\r\n /** On each axis, the vector length matches he length of the corresponding edge of the range. */\r\n NonUniformRangeContainment = 2,\r\n}\r\n/** object with a radians value and its associated cosine and sine values.\r\n * @public\r\n */\r\nexport interface TrigValues {\r\n /** the cosine value */\r\n c: number;\r\n /** the sine value */\r\n s: number;\r\n /** the radians value */\r\n radians: number;\r\n}\r\n/**\r\n * Interface so various plane representations can be used by algorithms that just want altitude evaluations.\r\n *\r\n * Specific implementors are\r\n * * Plane3dByOriginAndUnitNormal\r\n * * Point4d (used for homogeneous plane coefficients)\r\n * @public\r\n */\r\nexport interface PlaneAltitudeEvaluator {\r\n /**\r\n * Return the altitude of the point from the plane.\r\n * @param point point for evaluation\r\n */\r\n altitude(point: Point3d): number;\r\n /**\r\n * Return the altitude of the point from the plane, with the point supplied as simple x,y,z\r\n * @param x x coordinate\r\n * @param y y coordinate\r\n * @param z z coordinate\r\n */\r\n altitudeXYZ(x: number, y: number, z: number): number;\r\n /**\r\n * Return the derivative of altitude wrt motion along a vector.\r\n * @param point point for evaluation\r\n */\r\n velocity(vector: Vector3d): number;\r\n /**\r\n * Return the derivative of altitude wrt motion along a vector given by components\r\n * @param point point for evaluation\r\n */\r\n velocityXYZ(x: number, y: number, z: number): number;\r\n /**\r\n * Return the weighted altitude\r\n * @param point xyzw data.\r\n */\r\n weightedAltitude(point: Point4d): number;\r\n /** x part of normal vector */\r\n normalX(): number;\r\n /** x part of normal vector */\r\n normalY(): number;\r\n /** x part of normal vector */\r\n normalZ(): number;\r\n}\r\n\r\n/** Enumeration of possible locations of a point in the plane of a polygon.\r\n * @public\r\n */\r\nexport enum PolygonLocation {\r\n /** No location specified. */\r\n Unknown = 0,\r\n /** Point is at a vertex. */\r\n OnPolygonVertex = 1,\r\n /** Point is on an edge (but not a vertex). */\r\n OnPolygonEdgeInterior = 2,\r\n /** Point is strictly inside the polygon with unknown projection. */\r\n InsidePolygon = 3,\r\n /** Point is strictly inside the polygon and projects to a vertex. */\r\n InsidePolygonProjectsToVertex = 4,\r\n /** Point is strictly inside the polygon and projects to an edge (but not a vertex). */\r\n InsidePolygonProjectsToEdgeInterior = 5,\r\n /** Point is strictly outside the polygon with unknown projection. */\r\n OutsidePolygon = 6,\r\n /** Point is strictly outside the polygon and projects to a vertex. */\r\n OutsidePolygonProjectsToVertex = 7,\r\n /** Point is strictly outside the polygon and projects to an edge (but not a vertex). */\r\n OutsidePolygonProjectsToEdgeInterior = 8,\r\n}\r\n\r\n/**\r\n * Interface for `toJSON` and `setFromJSON` methods\r\n * @public\r\n */\r\nexport interface BeJSONFunctions {\r\n /**\r\n * Set content from a JSON object.\r\n * If the json object is undefined or unrecognized, always set a default value.\r\n */\r\n setFromJSON(json: any): void;\r\n /** Return a json object with this object's contents. */\r\n toJSON(): any;\r\n}\r\n/** The Properties for a JSON representation of an Angle.\r\n * If value is a number, it is in *degrees*.\r\n * If value is an object, it can have either degrees or radians.\r\n * @public\r\n */\r\nexport type AngleProps =\r\n { degrees: number } |\r\n { radians: number } |\r\n { _radians: number } |\r\n { _degrees: number } |\r\n number;\r\n/** The Properties for a JSON representation of an AngleSweep.\r\n * * The json data is always start and end angles as a pair in an array.\r\n * If AngleProps data is an array of two numbers, it is an angle in degrees.\r\n * If the AngleProps is an object with key degrees, the degrees value must be an array with the two degrees angles as numbers\r\n * If the AngleProps is an object with key radians, the radians value must be an array with the two radians angles as numbers\r\n * @public\r\n */\r\nexport type AngleSweepProps =\r\n AngleSweep |\r\n { degrees: [number, number] } |\r\n { radians: [number, number] } |\r\n [number, number];\r\n\r\n/**\r\n * Class containing static methods for typical numeric operations.\r\n * * Experimentally, methods like Geometry.hypotenuse are observed to be faster than the system intrinsics.\r\n * * This is probably due to\r\n * * Fixed length arg lists\r\n * * strongly typed parameters\r\n * @public\r\n */\r\nexport class Geometry {\r\n /** Tolerance for small distances in metric coordinates */\r\n public static readonly smallMetricDistance = 1.0e-6;\r\n /** Square of `smallMetricTolerance` */\r\n public static readonly smallMetricDistanceSquared = 1.0e-12;\r\n /** tolerance for small angle measured in radians. */\r\n public static readonly smallAngleRadians = 1.0e-12;\r\n /** square of `smallAngleRadians` */\r\n public static readonly smallAngleRadiansSquared = 1.0e-24;\r\n /** tolerance for small angle measured in degrees. */\r\n public static readonly smallAngleDegrees = 5.7e-11;\r\n /** tolerance for small angle measured in arc-seconds. */\r\n public static readonly smallAngleSeconds = 2e-7;\r\n /** numeric value that may be considered huge for a ratio of numbers.\r\n * * Note that the \"allowed\" result value is vastly larger than 1.\r\n */\r\n public static readonly largeFractionResult = 1.0e10;\r\n /** numeric value that may be considered zero for fractions between 0 and 1. */\r\n public static readonly smallFraction = 1.0e-10;\r\n /** numeric value that may considered huge for numbers expected to be coordinates.\r\n * * This allows larger results than `largeFractionResult`.\r\n */\r\n public static readonly largeCoordinateResult = 1.0e13;\r\n /** numeric value that may considered infinite for metric coordinates.\r\n * * This coordinate should be used only as a placeholder indicating \"at infinity\" -- computing actual points at this coordinate invites numerical problems.\r\n */\r\n public static readonly hugeCoordinate = 1.0e12;\r\n /** Test if absolute value of x is huge.\r\n * * See `Geometry.hugeCoordinate`\r\n */\r\n public static isHugeCoordinate(x: number): boolean {\r\n return x > this.hugeCoordinate || x < - this.hugeCoordinate;\r\n }\r\n\r\n /** Test if a number is odd.\r\n */\r\n public static isOdd(x: number): boolean {\r\n return (x & (0x01)) === 1;\r\n }\r\n /** Radians value for full circle 2PI radians minus `smallAngleRadians` */\r\n public static readonly fullCircleRadiansMinusSmallAngle = 2.0 * Math.PI - 1.0e-12; // smallAngleRadians less than 360degrees\r\n /** Correct `distance` to zero if undefined or smaller than metric tolerance. Otherwise return it unchanged. */\r\n public static correctSmallMetricDistance(distance: number | undefined, replacement: number = 0.0): number {\r\n if (distance === undefined || Math.abs(distance) < Geometry.smallMetricDistance) {\r\n return replacement;\r\n }\r\n return distance;\r\n }\r\n /**\r\n * If `a` is large enough for safe division, return `1/a`, using Geometry.smallMetricDistance as the tolerance for declaring it as divide by zero. Otherwise return `undefined`.\r\n * @param a denominator of division\r\n */\r\n public static inverseMetricDistance(a: number): number | undefined {\r\n return (Math.abs(a) <= Geometry.smallMetricDistance) ? undefined : 1.0 / a;\r\n }\r\n /**\r\n * If `a` is large enough, return `1/a`, using the square of Geometry.smallMetricDistance as the tolerance for declaring it as divide by zero. Otherwise return `undefined`.\r\n * @param a denominator of division\r\n */\r\n public static inverseMetricDistanceSquared(a: number): number | undefined {\r\n return (Math.abs(a) <= Geometry.smallMetricDistanceSquared) ? undefined : 1.0 / a;\r\n }\r\n /**\r\n * Boolean test for metric coordinate near-equality (i.e., if x and y are almost equal). If tolerance is not passed,\r\n * `Geometry.smallMetricDistance` is used as tolerance.\r\n */\r\n public static isSameCoordinate(x: number, y: number, tol?: number): boolean {\r\n if (tol)\r\n return Math.abs(x - y) < Math.abs(tol);\r\n return Math.abs(x - y) < Geometry.smallMetricDistance;\r\n }\r\n /** Boolean test for metric coordinate near-equality, with toleranceFactor applied to the usual smallMetricDistance */\r\n public static isSameCoordinateWithToleranceFactor(x: number, y: number, toleranceFactor: number): boolean {\r\n return Geometry.isSameCoordinate(x, y, toleranceFactor * Geometry.smallMetricDistance);\r\n }\r\n /** Boolean test for metric coordinate near-equality of x, y pair */\r\n public static isSameCoordinateXY(x0: number, y0: number, x1: number, y1: number, tol: number = Geometry.smallMetricDistance): boolean {\r\n let d = x1 - x0;\r\n if (d < 0)\r\n d = -d;\r\n if (d > tol)\r\n return false;\r\n d = y1 - y0;\r\n if (d < 0)\r\n d = -d;\r\n return d < tol;\r\n }\r\n /** Boolean test for squared metric coordinate near-equality */\r\n public static isSameCoordinateSquared(x: number, y: number): boolean {\r\n return Math.abs(Math.sqrt(x) - Math.sqrt(y)) < Geometry.smallMetricDistance;\r\n }\r\n /** boolean test for small `dataA.distance (dataB)` within `smallMetricDistance` */\r\n public static isSamePoint3d(dataA: Point3d, dataB: Point3d): boolean { return dataA.distance(dataB) < Geometry.smallMetricDistance; }\r\n /** boolean test for distance between `XYZ` objects within `smallMetricDistance`\r\n * * Note that Point3d and Vector3d are both derived from XYZ, so this method tolerates mixed types.\r\n */\r\n public static isSameXYZ(dataA: XYZ, dataB: XYZ): boolean { return dataA.distance(dataB) < Geometry.smallMetricDistance; }\r\n /** boolean test for small `dataA.distanceXY (dataB)` within `smallMetricDistance` */\r\n public static isSamePoint3dXY(dataA: Point3d, dataB: Point3d): boolean { return dataA.distanceXY(dataB) < Geometry.smallMetricDistance; }\r\n /** boolean test for small `dataA.distanceXY (dataB)` within `smallMetricDistance` */\r\n public static isSameVector3d(dataA: Vector3d, dataB: Vector3d): boolean { return dataA.distance(dataB) < Geometry.smallMetricDistance; }\r\n /** boolean test for small `dataA.distanceXY (dataB)` within `smallMetricDistance` */\r\n public static isSamePoint2d(dataA: Point2d, dataB: Point2d): boolean { return dataA.distance(dataB) < Geometry.smallMetricDistance; }\r\n /** boolean test for small `dataA.distanceXY (dataB)` within `smallMetricDistance` */\r\n public static isSameVector2d(dataA: Vector2d, dataB: Vector2d): boolean { return dataA.distance(dataB) < Geometry.smallMetricDistance; }\r\n /**\r\n * Lexical comparison of (a.x,a.y) (b.x,b.y) with x as first test, y second.\r\n * * This is appropriate for a horizontal sweep in the plane.\r\n */\r\n public static lexicalXYLessThan(a: XY | XYZ, b: XY | XYZ): -1 | 0 | 1 {\r\n if (a.x < b.x)\r\n return -1;\r\n else if (a.x > b.x)\r\n return 1;\r\n if (a.y < b.y)\r\n return -1;\r\n else if (a.y > b.y)\r\n return 1;\r\n return 0;\r\n }\r\n /**\r\n * Lexical comparison of (a.x,a.y) (b.x,b.y) with y as first test, x second.\r\n * * This is appropriate for a vertical sweep in the plane.\r\n */\r\n public static lexicalYXLessThan(a: XY | XYZ, b: XY | XYZ): -1 | 0 | 1 {\r\n if (a.y < b.y)\r\n return -1;\r\n else if (a.y > b.y)\r\n return 1;\r\n if (a.x < b.x)\r\n return -1;\r\n else if (a.x > b.x)\r\n return 1;\r\n return 0;\r\n }\r\n /**\r\n * Lexical test, based on x first, y second, z third.\r\n */\r\n public static lexicalXYZLessThan(a: XYZ, b: XYZ): -1 | 0 | 1 {\r\n if (a.x < b.x)\r\n return -1;\r\n else if (a.x > b.x)\r\n return 1;\r\n if (a.y < b.y)\r\n return -1;\r\n else if (a.y > b.y)\r\n return 1;\r\n if (a.z < b.z)\r\n return -1;\r\n else if (a.z > b.z)\r\n return 1;\r\n return 0;\r\n }\r\n /** Test if `value` is small compared to `smallAngleRadians`.\r\n * * This is appropriate if `value` is know to be a typical 0..1 fraction.\r\n */\r\n public static isSmallRelative(value: number): boolean {\r\n return Math.abs(value) < Geometry.smallAngleRadians;\r\n }\r\n /** Test if `value` is small compared to `smallAngleRadians` */\r\n public static isSmallAngleRadians(value: number): boolean {\r\n return Math.abs(value) < Geometry.smallAngleRadians;\r\n }\r\n /** Returns true if both values are undefined or if both are defined and almost equal within tolerance.\r\n * If one is undefined and the other is not then false is returned.\r\n */\r\n public static isAlmostEqualOptional(a: number | undefined, b: number | undefined, tolerance: number): boolean {\r\n if (a !== undefined && b !== undefined) {\r\n if (Math.abs(a - b) > tolerance)\r\n return false;\r\n } else {\r\n if (a !== undefined || b !== undefined)\r\n return false;\r\n }\r\n return true;\r\n }\r\n /** Toleranced equality test, using tolerance `smallAngleRadians * ( 1 + abs(a) + (abs(b)))`\r\n * * Effectively an absolute tolerance of `smallAngleRadians`, with tolerance increasing for larger values of a and b.\r\n */\r\n public static isAlmostEqualNumber(a: number, b: number): boolean {\r\n const sumAbs = 1.0 + Math.abs(a) + Math.abs(b);\r\n return Math.abs(a - b) <= Geometry.smallAngleRadians * sumAbs;\r\n }\r\n /** Toleranced equality test, using tolerance `smallAngleRadians * ( 1 + abs(a) + (abs(b)))`\r\n * * Effectively an absolute tolerance of `smallAngleRadians`, with tolerance increasing for larger values of a and b.\r\n */\r\n public static isAlmostEqualXAndY(a: XAndY, b: XAndY): boolean {\r\n const sumAbs = 1.0 + Math.abs(a.x) + Math.abs(b.x) + Math.abs(a.y) + Math.abs(b.y);\r\n const tolerance = Geometry.smallAngleRadians * sumAbs;\r\n return Math.abs(a.x - b.x) <= tolerance && Math.abs(a.y - b.y) <= tolerance;\r\n }\r\n /**\r\n * Toleranced equality test, using caller-supplied tolerance.\r\n * If no tolerance is given, use smallMetricDistance.\r\n */\r\n public static isDistanceWithinTol(distance: number, tol?: number): boolean {\r\n if (tol !== undefined)\r\n return Math.abs(distance) <= Math.abs(tol);\r\n return Math.abs(distance) <= Geometry.smallMetricDistance;\r\n }\r\n /** Toleranced equality test, using `smallMetricDistance` tolerance. */\r\n public static isSmallMetricDistance(distance: number): boolean {\r\n return Math.abs(distance) <= Geometry.smallMetricDistance;\r\n }\r\n\r\n /** Toleranced equality, using `smallMetricDistanceSquared` tolerance. */\r\n public static isSmallMetricDistanceSquared(distanceSquared: number): boolean {\r\n return Math.abs(distanceSquared) <= Geometry.smallMetricDistanceSquared;\r\n }\r\n /**\r\n * Return `axis modulo 3` with proper handling of negative indices\r\n * ..., -3:x, -2:y, -1:z, 0:x, 1:y, 2:z, 3:x, 4:y, 5:z, 6:x, 7:y, 8:z, ...\r\n * */\r\n public static cyclic3dAxis(axis: number): number {\r\n /* Direct test for the most common cases, avoid modulo */\r\n if (axis >= 0) {\r\n if (axis < 3)\r\n return axis;\r\n if (axis < 6)\r\n return axis - 3;\r\n return axis % 3;\r\n }\r\n const j = axis + 3;\r\n if (j >= 0)\r\n return j;\r\n return 2 - ((-axis - 1) % 3);\r\n }\r\n /** Return the AxisOrder for which axisIndex is the first named axis.\r\n * * `axisIndex === 0` returns `AxisOrder.XYZ`\r\n * * `axisIndex === 1` returns `AxisOrder.YZX`\r\n * * `axisIndex === 2` returns `AxisOrder.ZXY`\r\n */\r\n public static axisIndexToRightHandedAxisOrder(axisIndex: AxisIndex): AxisOrder {\r\n if (axisIndex === 0)\r\n return AxisOrder.XYZ;\r\n if (axisIndex === 1)\r\n return AxisOrder.YZX;\r\n if (axisIndex === 2)\r\n return AxisOrder.ZXY;\r\n return Geometry.axisIndexToRightHandedAxisOrder(Geometry.cyclic3dAxis(axisIndex));\r\n }\r\n /** Return the largest absolute distance from a to either of b0 or b1 */\r\n public static maxAbsDiff(a: number, b0: number, b1: number): number {\r\n return Math.max(Math.abs(a - b0), Math.abs(a - b1));\r\n }\r\n /** Return the largest absolute absolute value among x,y,z */\r\n public static maxAbsXYZ(x: number, y: number, z: number): number {\r\n return Geometry.maxXYZ(Math.abs(x), Math.abs(y), Math.abs(z));\r\n }\r\n /** Return the largest absolute absolute value among x,y */\r\n public static maxAbsXY(x: number, y: number): number {\r\n return Geometry.maxXY(Math.abs(x), Math.abs(y));\r\n }\r\n /** Return the largest signed value among a, b, c */\r\n public static maxXYZ(a: number, b: number, c: number): number {\r\n let q = a;\r\n if (b > q) q = b;\r\n if (c > q) q = c;\r\n return q;\r\n }\r\n /**\r\n * Examine the value (particularly sign) of x.\r\n * * If x is negative, return outNegative.\r\n * * If x is true zero, return outZero\r\n * * If x is positive, return outPositive\r\n */\r\n public static split3WaySign(x: number, outNegative: number, outZero: number, outPositive: number): number {\r\n if (x < 0)\r\n return outNegative;\r\n if (x > 0.0)\r\n return outPositive;\r\n return outZero;\r\n }\r\n /** Return the largest signed value among a, b */\r\n public static maxXY(a: number, b: number): number {\r\n let q = a;\r\n if (b > q) q = b;\r\n return q;\r\n }\r\n /** Return the smallest signed value among a, b */\r\n public static minXY(a: number, b: number): number {\r\n let q = a;\r\n if (b < q) q = b;\r\n return q;\r\n }\r\n /** Return the hypotenuse `sqrt(x*x + y*y)`. This is much faster than `Math.hypot(x,y)`. */\r\n public static hypotenuseXY(x: number, y: number): number {\r\n return Math.sqrt(x * x + y * y);\r\n }\r\n /** Return the squared `hypotenuse (x*x + y*y)`. */\r\n public static hypotenuseSquaredXY(x: number, y: number): number {\r\n return x * x + y * y;\r\n }\r\n /** Return the square of x */\r\n public static square(x: number): number {\r\n return x * x;\r\n }\r\n /** Return the hypotenuse `sqrt(x*x + y*y + z*z)`. This is much faster than `Math.hypot(x,y,z)`. */\r\n public static hypotenuseXYZ(x: number, y: number, z: number): number {\r\n return Math.sqrt(x * x + y * y + z * z);\r\n }\r\n /** Return the squared hypotenuse `(x*x + y*y + z*z)`. This is much faster than `Math.hypot(x,y,z)`. */\r\n public static hypotenuseSquaredXYZ(x: number, y: number, z: number): number {\r\n return x * x + y * y + z * z;\r\n }\r\n /** Return the (full 4d) hypotenuse `sqrt(x*x + y*y + z*z + w*w)`. This is much faster than `Math.hypot(x,y,z,w)`. */\r\n public static hypotenuseXYZW(x: number, y: number, z: number, w: number): number {\r\n return Math.sqrt(x * x + y * y + z * z + w * w);\r\n }\r\n /** Return the squared hypotenuse `(x*x + y*y + z*z+w*w)`. This is much faster than `Math.hypot(x,y,z)`. */\r\n public static hypotenuseSquaredXYZW(x: number, y: number, z: number, w: number): number {\r\n return x * x + y * y + z * z + w * w;\r\n }\r\n /**\r\n * Return the distance between xy points given as numbers.\r\n * @param x0 x coordinate of point 0\r\n * @param y0 y coordinate of point 0\r\n * @param x1 x coordinate of point 1\r\n * @param y1 y coordinate of point 1\r\n */\r\n public static distanceXYXY(x0: number, y0: number, x1: number, y1: number): number {\r\n return Geometry.hypotenuseXY(x1 - x0, y1 - y0);\r\n }\r\n /**\r\n * Return the distance between xyz points given as numbers.\r\n * @param x0 x coordinate of point 0\r\n * @param y0 y coordinate of point 0\r\n * @param z0 z coordinate of point 0\r\n * @param x1 x coordinate of point 1\r\n * @param y1 y coordinate of point 1\r\n * @param z1 z coordinate of point 1\r\n */\r\n public static distanceXYZXYZ(x0: number, y0: number, z0: number, x1: number, y1: number, z1: number): number {\r\n return Geometry.hypotenuseXYZ(x1 - x0, y1 - y0, z1 - z0);\r\n }\r\n /** Returns Returns the triple product of 3 vectors provided as x,y,z number sequences.\r\n *\r\n * * The triple product is the determinant of the 3x3 matrix with the 9 numbers (3 vectors placed in 3 rows).\r\n * * The triple product is positive if the 3 vectors form a right handed coordinate system.\r\n * * The triple product is negative if the 3 vectors form a left handed coordinate system.\r\n * * Treating the 9 numbers as 3 vectors U, V, W, any of these formulas gives the same result:\r\n * * U dot (V cross W)\r\n * * V dot (W cross U)\r\n * * W dot (U cross V)\r\n * * (-U dot (W cross V)) -- (note the negative -- reversing cross product order changes the sign)\r\n * * (-V dot (U cross W)) -- (note the negative -- reversing cross product order changes the sign)\r\n * * (-W dot (V cross U)) -- (note the negative -- reversing cross product order changes the sign)\r\n * * the triple product is 6 times the (signed) volume of the tetrahedron with the three vectors as edges from a common vertex.\r\n */\r\n public static tripleProduct(\r\n ux: number, uy: number, uz: number,\r\n vx: number, vy: number, vz: number,\r\n wx: number, wy: number, wz: number): number {\r\n return ux * (vy * wz - vz * wy)\r\n + uy * (vz * wx - vx * wz)\r\n + uz * (vx * wy - vy * wx);\r\n }\r\n /** Returns the determinant of the 4x4 matrix unrolled as the 16 parameters.\r\n */\r\n public static determinant4x4(\r\n xx: number, xy: number, xz: number, xw: number,\r\n yx: number, yy: number, yz: number, yw: number,\r\n zx: number, zy: number, zz: number, zw: number,\r\n wx: number, wy: number, wz: number, ww: number): number {\r\n return xx * this.tripleProduct(yy, yz, yw, zy, zz, zw, wy, wz, ww)\r\n - yx * this.tripleProduct(xy, xz, xw, zy, zz, zw, wy, wz, ww)\r\n + zx * this.tripleProduct(xy, xz, xw, yy, yz, yw, wy, wz, ww)\r\n - wx * this.tripleProduct(xy, xz, xw, yy, yz, yw, zy, zz, zw);\r\n }\r\n /** Return the mean curvature for two radii, with 0 radius implying 0 curvature */\r\n public static meanCurvatureOfRadii(r0: number, r1: number): number {\r\n return 0.5 * (this.safeDivideFraction(1, r0, 0) + this.safeDivideFraction(1, r1, 0));\r\n }\r\n /**\r\n * Returns curvature magnitude from a first and second derivative vector.\r\n * @param ux first derivative x component\r\n * @param uy first derivative y component\r\n * @param uz first derivative z component\r\n * @param vx second derivative x component\r\n * @param vy second derivative y component\r\n * @param vz second derivative z component\r\n */\r\n public static curvatureMagnitude(\r\n ux: number, uy: number, uz: number,\r\n vx: number, vy: number, vz: number): number {\r\n let q = uy * vz - uz * vy;\r\n let sum = q * q;\r\n q = uz * vx - ux * vz;\r\n sum += q * q;\r\n q = ux * vy - uy * vx;\r\n sum += q * q;\r\n const a = Math.sqrt(ux * ux + uy * uy + uz * uz);\r\n const b = Math.sqrt(sum);\r\n // (sum and a are both nonnegative)\r\n const aaa = a * a * a;\r\n // radius of curvature = aaa / b;\r\n // curvature = b/aaa\r\n const tol = Geometry.smallAngleRadians;\r\n if (aaa > tol * b)\r\n return b / aaa;\r\n return 0; // hm.. maybe should be infinite?\r\n }\r\n /** Returns the determinant of 3x3 matrix with x and y rows taken from 3 points, third row from corresponding numbers.\r\n *\r\n */\r\n public static tripleProductXYW(\r\n columnA: XAndY, weightA: number,\r\n columnB: XAndY, weightB: number,\r\n columnC: XAndY, weightC: number): number {\r\n return Geometry.tripleProduct(\r\n columnA.x, columnB.x, columnC.x,\r\n columnA.y, columnB.y, columnC.y,\r\n weightA, weightB, weightC);\r\n }\r\n /** Returns the determinant of 3x3 matrix with x and y rows taken from 3 points, third row from corresponding numbers.\r\n *\r\n */\r\n public static tripleProductPoint4dXYW(\r\n columnA: Point4d,\r\n columnB: Point4d,\r\n columnC: Point4d): number {\r\n return Geometry.tripleProduct(\r\n columnA.x, columnB.x, columnC.x,\r\n columnA.y, columnB.y, columnC.y,\r\n columnA.w, columnB.w, columnC.w);\r\n }\r\n /** 2D cross product of vectors layed out as scalars. */\r\n public static crossProductXYXY(ux: number, uy: number, vx: number, vy: number): number {\r\n return ux * vy - uy * vx;\r\n }\r\n /** 3D cross product of vectors layed out as scalars. */\r\n public static crossProductXYZXYZ(ux: number, uy: number, uz: number, vx: number, vy: number, vz: number, result?: Vector3d): Vector3d {\r\n return Vector3d.create(\r\n uy * vz - uz * vy,\r\n uz * vx - ux * vz,\r\n ux * vy - uy * vx, result);\r\n }\r\n /** magnitude of 3D cross product of vectors, with the vectors presented as */\r\n public static crossProductMagnitude(ux: number, uy: number, uz: number, vx: number, vy: number, vz: number): number {\r\n return Geometry.hypotenuseXYZ(\r\n uy * vz - uz * vy,\r\n uz * vx - ux * vz,\r\n ux * vy - uy * vx);\r\n }\r\n /** 3D dot product of vectors layed out as scalars. */\r\n public static dotProductXYZXYZ(ux: number, uy: number, uz: number, vx: number, vy: number, vz: number): number {\r\n return ux * vx + uy * vy + uz * vz;\r\n }\r\n /** 2D dot product of vectors layed out as scalars. */\r\n public static dotProductXYXY(ux: number, uy: number, vx: number, vy: number): number {\r\n return ux * vx + uy * vy;\r\n }\r\n /**\r\n * Clamp to (min(a,b), max(a,b))\r\n * * always returns a number between a and b\r\n * @param x\r\n * @param a\r\n * @param b\r\n */\r\n public static clampToStartEnd(x: number, a: number, b: number): number {\r\n if (a > b)\r\n return Geometry.clampToStartEnd(x, b, a);\r\n if (x < a)\r\n return a;\r\n if (b < x)\r\n return b;\r\n return x;\r\n }\r\n /**\r\n * Clamp value to (min,max) with no test for order of (min,max)\r\n * @param value value to clamp\r\n * @param min smallest allowed output\r\n * @param max largest allowed result.\r\n */\r\n public static clamp(value: number, min: number, max: number): number { return Math.max(min, Math.min(max, value)); }\r\n /** If given a number, return it. If given undefined, return `defaultValue`. */\r\n public static resolveNumber(value: number | undefined, defaultValue: number = 0): number {\r\n return value !== undefined ? value : defaultValue;\r\n }\r\n /** If given a value, return it. If given undefined, return `defaultValue`. */\r\n public static resolveValue<T>(value: T | undefined, defaultValue: T): T {\r\n return value !== undefined ? value : defaultValue;\r\n }\r\n /** If given value matches a target, return undefined. Otherwise return the value. */\r\n public static resolveToUndefined<T>(value: T | undefined, targetValue: T): T | undefined {\r\n return value === targetValue ? undefined : value;\r\n }\r\n /**\r\n * Simple interpolation between values, but choosing (based on fraction) a or b as starting\r\n * point for maximum accuracy.\r\n * * If `f = 0`, then `a` is returned and if `f = 1`, then `b` is returned.\r\n */\r\n public static interpolate(a: number, f: number, b: number): number {\r\n return f <= 0.5 ? a + f * (b - a) : b - (1.0 - f) * (b - a);\r\n }\r\n /**\r\n * Given an axisOrder (e.g. XYZ, YZX, etc) and an index, returns the axis index at the given index.\r\n * * For example, if axisOrder = XYZ, then for index 0 returns X (or axis index 0), for index 1 returns\r\n * Y (or axis index 1), and for index 2 returns Z (or axis index 2). For indexes greater than 2 or smaller\r\n * than 0, it returns cyclic axis index. See Geometry.cyclic3dAxis for more info.\r\n * * Another example: if axisOrder = ZYX, then for index 0 returns Z (or axis index 2), for index 1 returns\r\n * Y (or axis index 1), and for index 2 returns X (or axis index 0).\r\n * */\r\n public static axisOrderToAxis(order: AxisOrder, index: number): number {\r\n const axis = order <= AxisOrder.ZXY ? order + index : (order - AxisOrder.XZY) - index;\r\n return Geometry.cyclic3dAxis(axis);\r\n }\r\n /** Return (a modulo period), e.g. for use as a cyclic index. Both a and period may be negative. */\r\n public static modulo(a: number, period: number): number {\r\n if (period <= 0) {\r\n if (period === 0)\r\n return a;\r\n return -Geometry.modulo(-a, -period);\r\n }\r\n\r\n if (a >= 0) {\r\n if (a < period)\r\n return a;\r\n if (a < 2 * period)\r\n return a - period;\r\n } else {\r\n a += period; // hopefully move into primary period without division and floor\r\n if (a > 0)\r\n return a;\r\n }\r\n const m = Math.floor(a / period);\r\n return a - m * period;\r\n }\r\n /** return 0 if the value is undefined, 1 if defined. */\r\n public static defined01(value: any): number { return value === undefined ? 0 : 1; }\r\n /**\r\n * Return `numerator` divided by `denominator`, or `undefined`.\r\n * @param numerator the numerator\r\n * @param denominator the denominator\r\n * @returns return `numerator/denominator` but if the ratio would exceed `Geometry.largeFractionResult`,\r\n * return `undefined`.\r\n */\r\n public static conditionalDivideFraction(numerator: number, denominator: number): number | undefined {\r\n if (Math.abs(denominator) * Geometry.largeFractionResult > Math.abs(numerator))\r\n return numerator / denominator;\r\n return undefined;\r\n }\r\n /**\r\n * Return `numerator` divided by `denominator`.\r\n * @param numerator the numerator\r\n * @param denominator the denominator\r\n * @returns return `numerator/denominator` but if the ratio would exceed `Geometry.largeFractionResult`,\r\n * return `defaultResult`.\r\n */\r\n public static safeDivideFraction(numerator: number, denominator: number, defaultResult: number): number {\r\n const a = Geometry.conditionalDivideFraction(numerator, denominator);\r\n if (a !== undefined)\r\n return a;\r\n return defaultResult;\r\n }\r\n /**\r\n * Return `numerator` divided by `denominator` (with a given `largestResult`), or `undefined`.\r\n * @param numerator the numerator\r\n * @param denominator the denominator\r\n * @param largestResult the ratio threshold.\r\n * @returns return `numerator/denominator` but if the ratio would exceed `largestResult`, return `undefined`.\r\n */\r\n public static conditionalDivideCoordinate(numerator: number, denominator: number,\r\n largestResult: number = Geometry.largeCoordinateResult): number | undefined {\r\n if (Math.abs(denominator * largestResult) > Math.abs(numerator))\r\n return numerator / denominator;\r\n return undefined;\r\n }\r\n /** return the 0, 1, or 2 pairs of (c,s) values that solve\r\n * {constCoff + cosCoff * c + sinCoff * s = 0}\r\n * with the constraint {c*c+s*s = 1}\r\n */\r\n public static solveTrigForm(constCoff: number, cosCoff: number, sinCoff: number): Vector2d[] | undefined {\r\n {\r\n const delta2 = cosCoff * cosCoff + sinCoff * sinCoff;\r\n const constCoff2 = constCoff * constCoff;\r\n // nSolution = 0\r\n let result;\r\n if (delta2 > 0.0) {\r\n const lambda = - constCoff / delta2;\r\n const a2 = constCoff2 / delta2;\r\n const D2 = 1.0 - a2;\r\n if (-Geometry.smallMetricDistanceSquared < D2 && D2 <= 0.0) { // observed D2 = -2.22e-16 in rotated system\r\n // nSolution = 1\r\n const c0 = lambda * cosCoff;\r\n const s0 = lambda * sinCoff;\r\n result = [Vector2d.create(c0, s0)];\r\n } else if (D2 > 0.0) {\r\n const mu = Math.sqrt(D2 / delta2);\r\n /* c0,s0 = closest approach of line to origin */\r\n const c0 = lambda * cosCoff;\r\n const s0 = lambda * sinCoff;\r\n // nSolution = 2\r\n result = [Vector2d.create(c0 - mu * sinCoff, s0 + mu * cosCoff), Vector2d.create(c0 + mu * sinCoff, s0 - mu * cosCoff)];\r\n }\r\n }\r\n return result;\r\n }\r\n }\r\n /** For a line f(x) whose function values at x0 and x1 are f0 and f1, return the x value at which f(x)=fTarget; */\r\n public static inverseInterpolate(x0: number, f0: number, x1: number, f1: number, targetF: number = 0,\r\n defaultResult?: number): number | undefined {\r\n const g = Geometry.conditionalDivideFraction(targetF - f0, f1 - f0);\r\n if (g)\r\n return Geometry.interpolate(x0, g, x1);\r\n return defaultResult;\r\n }\r\n /** For a line f(x) whose function values at x=0 and x=1 are f0 and f1, return the x value at which f(x)=fTarget; */\r\n public static inverseInterpolate01(f0: number, f1: number, targetF: number = 0): number | undefined {\r\n return Geometry.conditionalDivideFraction(targetF - f0, f1 - f0);\r\n }\r\n /** Return true if json is an array with at least minEntries, and all entries are numbers (including those beyond minEntries) */\r\n public static isNumberArray(json: any, minEntries: number = 0): boolean {\r\n if (Array.isArray(json) && json.length >= minEntries) {\r\n let entry;\r\n for (entry of json) {\r\n // if (!(entry as number) && entry !== 0.0)\r\n if (!Number.isFinite(entry))\r\n return false;\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** Return true if json is an array of at least numNumberArrays, with at least minEntries in each number array.\r\n */\r\n public static isArrayOfNumberArray(json: any, numNumberArray: number, minEntries: number = 0): boolean {\r\n if (Array.isArray(json) && json.length >= numNumberArray) {\r\n let entry;\r\n for (entry of json)\r\n if (!Geometry.isNumberArray(entry, minEntries)) return false;\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** return the number of steps to take so that numSteps * stepSize >= total.\r\n * minCount is returned for both (a) setSize 0 or less and (b) stepSize > total.\r\n * A small tolerance is applied for almost\r\n */\r\n public static stepCount(stepSize: number, total: number, minCount = 1, maxCount = 101): number {\r\n if (stepSize <= 0)\r\n return minCount;\r\n total = Math.abs(total);\r\n if (stepSize >= total)\r\n return minCount;\r\n const stepCount = Math.floor((total + 0.999999 * stepSize) / stepSize);\r\n if (stepCount < minCount)\r\n return minCount;\r\n if (stepCount > maxCount)\r\n return maxCount;\r\n return stepCount;\r\n }\r\n /** Test if x is in simple 0..1 interval. But optionally skip the test. (this odd behavior is very convenient for code that sometimes does not do the filtering.)\r\n * @param x value to test.\r\n * @param apply01 if false, accept all x.\r\n */\r\n public static isIn01(x: number, apply01: boolean = true): boolean { return apply01 ? x >= 0.0 && x <= 1.0 : true; }\r\n /** Test if x is in simple 0..1 interval. But optionally skip the test. (this odd behavior is very convenient for code that sometimes does not do the filtering.)\r\n * @param x value to test.\r\n * @param apply01 if false, accept all x.\r\n */\r\n public static isIn01WithTolerance(x: number, tolerance: number): boolean { return x + tolerance >= 0.0 && x - tolerance <= 1.0; }\r\n /**\r\n * restrict x so it is in the interval `[a,b]`, allowing a,b to be in either order.\r\n * @param x\r\n * @param a (usually the lower) interval limit\r\n * @param b (usually the upper) interval limit\r\n */\r\n public static restrictToInterval(x: number, a: number, b: number): number {\r\n if (a <= b) {\r\n if (x < a) return a;\r\n if (x > b) return b;\r\n return x;\r\n }\r\n // reversed interval ....\r\n if (x < b) return b;\r\n if (x > a) return a;\r\n return x;\r\n }\r\n /**\r\n * Case-insensitive string comparison.\r\n * * Return true if the toUpperCase values match.\r\n */\r\n public static equalStringNoCase(string1: string, string2: string): boolean {\r\n return string1.toUpperCase() === string2.toUpperCase();\r\n }\r\n /** test for EXACT match of number arrays. */\r\n public static exactEqualNumberArrays(a: number[] | undefined, b: number[] | undefined): boolean {\r\n if (Array.isArray(a) && a.length === 0)\r\n a = undefined;\r\n if (Array.isArray(b) && b.length === 0)\r\n b = undefined;\r\n if (a === undefined && b === undefined)\r\n return true;\r\n if (Array.isArray(a) && Array.isArray(b)) {\r\n if (a.length !== b.length)\r\n return false;\r\n for (let i = 0; i < a.length; i++)\r\n if (a[i] !== b[i])\r\n return false;\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** test for match of XYZ arrays. */\r\n public static almostEqualArrays<T>(a: T[] | undefined, b: T[] | undefined,\r\n testFunction: (p: T, q: T) => boolean): boolean {\r\n if (Array.isArray(a) && a.length === 0)\r\n a = undefined;\r\n if (Array.isArray(b) && b.length === 0)\r\n b = undefined;\r\n if (a === undefined && b === undefined)\r\n return true;\r\n if (Array.isArray(a) && Array.isArray(b)) {\r\n if (a.length !== b.length)\r\n return false;\r\n for (let i = 0; i < a.length; i++) {\r\n if (!testFunction(a[i], b[i]))\r\n return false;\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n /** test for match of typed arrays (e.g. Float64Array). */\r\n public static almostEqualNumberArrays(a: number[] | Float64Array | undefined, b: number[] | Float64Array | undefined,\r\n testFunction: (p: number, q: number) => boolean): boolean {\r\n if (Array.isArray(a) && a.length === 0)\r\n a = undefined;\r\n if (Array.isArray(b) && b.length === 0)\r\n b = undefined;\r\n if (a === undefined && b === undefined)\r\n return true;\r\n if (Array.isArray(a) && Array.isArray(b)) {\r\n if (a.length !== b.length)\r\n return false;\r\n for (let i = 0; i < a.length; i++) {\r\n if (!testFunction(a[i], b[i]))\r\n return false;\r\n }\r\n return true;\r\n }\r\n return false;\r\n }\r\n /**\r\n * Return\r\n * * true if both values are defined and equal (with ===).\r\n * * false if both defined by not equal\r\n * * return (option arg) resultIfBothUndefined when both are undefined.\r\n * * return false if one is defined and the other undefined\r\n * @param a first value\r\n * @param b second value\r\n * @param resultIfBothUndefined return value when both are undefined.\r\n * @returns\r\n */\r\n public static areEqualAllowUndefined<T>(a: T | undefined, b: T | undefined, resultIfBothUndefined: boolean = true): boolean {\r\n if (a === undefined && b === undefined)\r\n return resultIfBothUndefined;\r\n if (a !== undefined && b !== undefined)\r\n return a === b;\r\n return false;\r\n }\r\n /** clone an array whose members have a clone method.\r\n * * undefined return from clone is forced into the output array.\r\n */\r\n public static cloneMembers<T extends Cloneable<T>>(a: T[] | undefined): T[] | undefined {\r\n if (a === undefined)\r\n return undefined;\r\n const b: T[] = [];\r\n for (const p of a) {\r\n b.push(p.clone()!);\r\n }\r\n return b;\r\n }\r\n}\r\n/**\r\n * interface for method with a clone operation\r\n * @public\r\n */\r\nexport interface Cloneable<T> {\r\n /** required method to return a deep clone. */\r\n clone(): T | undefined;\r\n}\r\n/** Options used for methods like [[Vector2d.isPerpendicularTo]] and [[Vector3d.isParallelTo]].\r\n * @public\r\n */\r\nexport interface PerpParallelOptions {\r\n /** Squared radian tolerance for comparing the angle between two vectors.\r\n * Default: [[Geometry.smallAngleRadiansSquared]].\r\n */\r\n radianSquaredTol?: number;\r\n /** Squared distance tolerance for detecting a zero-length vector.\r\n * Default: [[Geometry.smallMetricDistanceSquared]].\r\n */\r\n distanceSquaredTol?: number;\r\n}\r\n"]}
1
+ {"version":3,"file":"Geometry.js","sourceRoot":"","sources":["../../src/Geometry.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAO/F,OAAO,EAAW,QAAQ,EAAM,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAW,QAAQ,EAAO,MAAM,8BAA8B,CAAC;AAItE,mEAAmE;AAEnE;;;;;;;GAOG;AACH,MAAM,CAAN,IAAY,SAaX;AAbD,WAAY,SAAS;IACnB,2CAA2C;IAC3C,uCAAO,CAAA;IACP,2CAA2C;IAC3C,uCAAO,CAAA;IACP,2CAA2C;IAC3C,uCAAO,CAAA;IACP,0CAA0C;IAC1C,uCAAO,CAAA;IACP,0CAA0C;IAC1C,uCAAO,CAAA;IACP,0CAA0C;IAC1C,uCAAO,CAAA;AACT,CAAC,EAbW,SAAS,KAAT,SAAS,QAapB;AACD;;;GAGG;AACH,MAAM,CAAN,IAAY,SAOX;AAPD,WAAY,SAAS;IACnB,wBAAwB;IACxB,mCAAK,CAAA;IACL,wBAAwB;IACxB,mCAAK,CAAA;IACL,wBAAwB;IACxB,mCAAK,CAAA;AACP,CAAC,EAPW,SAAS,KAAT,SAAS,QAOpB;AACD;;GAEG;AACH,MAAM,CAAN,IAAY,iBAiBX;AA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AAC,EAAE,GAAG,OAAO,CAAC,CAAI,yCAAyC;SAxCpH,QAAQ","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n\n/** @packageDocumentation\n * @module CartesianGeometry\n */\n\nimport { AngleSweep } from \"./geometry3d/AngleSweep\";\nimport { Point2d, Vector2d, XY } from \"./geometry3d/Point2dVector2d\";\nimport { Point3d, Vector3d, XYZ } from \"./geometry3d/Point3dVector3d\";\nimport { XAndY } from \"./geometry3d/XYZProps\";\nimport { Point4d } from \"./geometry4d/Point4d\";\n\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\n\n/**\n * Enumeration of the 6 possible orderings of XYZ axis order\n * * **Note:** There are 3 axis order with right hand system (XYZ = 0, YZX = 1, ZXY = 2) and 3 axis order with\n * left hand system (XZY = 4, YXZ = 5, ZYX = 6). Note that AxisOrder is encoding the handedness as well. Cross\n * product of the i_th axis in an ordering (i=0,1,2), with the i+1_th in that ordering, will produce the i+2_th\n * axis in that ordering.\n * @public\n */\nexport enum AxisOrder {\n /** Right handed system, X then Y then Z */\n XYZ = 0, /* eslint-disable-line @typescript-eslint/no-shadow */\n /** Right handed system, Y then Z then X */\n YZX = 1,\n /** Right handed system, Z then X then Y */\n ZXY = 2,\n /** Left handed system, X then Z then Y */\n XZY = 4,\n /** Left handed system, Y then X then Z */\n YXZ = 5,\n /** Left handed system, Z then Y then X */\n ZYX = 6,\n}\n/**\n * Enumeration of numeric indices of 3 axes AxisIndex.X, AxisIndex.Y, AxisIndex.Z\n * @public\n */\nexport enum AxisIndex {\n /** x axis is index 0 */\n X = 0,\n /** y axis is index 1 */\n Y = 1,\n /** 2 axis is index 2 */\n Z = 2,\n}\n/** Standard views. Used in `Matrix3d.createStandardViewAxes(index: StandardViewIndex, invert: boolean)`\n * @public\n */\nexport enum StandardViewIndex {\n /** X to right, Y up */\n Top = 1,\n /** X to right, negative Y up */\n Bottom = 2,\n /** negative Y to right, Z up */\n Left = 3,\n /** Y to right, Z up */\n Right = 4,\n /** X to right, Z up */\n Front = 5,\n /** negative X to right, Z up */\n Back = 6,\n /** isometric: view towards origin from (-1,-1,1) */\n Iso = 7, //\n /** right isometric: view towards origin from (1,-1,1) */\n RightIso = 8,\n}\n/** Enumeration among choice for how a coordinate transformation should incorporate scaling.\n * @public\n */\nexport enum AxisScaleSelect {\n /** All axes of unit length. */\n Unit = 0,\n /** On each axis, the vector length matches the longest side of the range of the data. */\n LongestRangeDirection = 1,\n /** On each axis, the vector length matches he length of the corresponding edge of the range. */\n NonUniformRangeContainment = 2,\n}\n/** object with a radians value and its associated cosine and sine values.\n * @public\n */\nexport interface TrigValues {\n /** the cosine value */\n c: number;\n /** the sine value */\n s: number;\n /** the radians value */\n radians: number;\n}\n\n/**\n * Plane Evaluation methods.\n * * These provide the necessary queries to implement clipping operations without knowing if the plane in use\n * is a [[ClipPlane]], [[Plane3dByOriginAndUnitNormal]], [[Plane3dByOriginAndVectors]], [[Point4d]].\n * * The Plane3d class declares obligation to implement these methods, and\n * passes the obligation on to concrete implementations by declaring them as abstract members which the particular classes can implement.\n * * It is intended that this interface be deprecated because its implementation by [[Plane3d]] provides all of its functionality and allows more to be added.\n * @public\n */\nexport interface PlaneAltitudeEvaluator {\n /**\n * Return the altitude of the point from the plane.\n * @param point point for evaluation\n */\n altitude(point: Point3d): number;\n /**\n * Return the altitude of the point from the plane, with the point supplied as simple x,y,z\n * @param x x coordinate\n * @param y y coordinate\n * @param z z coordinate\n */\n altitudeXYZ(x: number, y: number, z: number): number;\n /**\n * Return the derivative of altitude wrt motion along a vector.\n * @param point point for evaluation\n */\n velocity(vector: Vector3d): number;\n /**\n * Return the derivative of altitude wrt motion along a vector given by components\n * @param point point for evaluation\n */\n velocityXYZ(x: number, y: number, z: number): number;\n /**\n * Return the weighted altitude\n * @param point xyzw data.\n */\n weightedAltitude(point: Point4d): number;\n /** x part of normal vector */\n normalX(): number;\n /** x part of normal vector */\n normalY(): number;\n /** x part of normal vector */\n normalZ(): number;\n}\n\n/** Enumeration of possible locations of a point in the plane of a polygon.\n * @public\n */\nexport enum PolygonLocation {\n /** No location specified. */\n Unknown = 0,\n /** Point is at a vertex. */\n OnPolygonVertex = 1,\n /** Point is on an edge (but not a vertex). */\n OnPolygonEdgeInterior = 2,\n /** Point is strictly inside the polygon with unknown projection. */\n InsidePolygon = 3,\n /** Point is strictly inside the polygon and projects to a vertex. */\n InsidePolygonProjectsToVertex = 4,\n /** Point is strictly inside the polygon and projects to an edge (but not a vertex). */\n InsidePolygonProjectsToEdgeInterior = 5,\n /** Point is strictly outside the polygon with unknown projection. */\n OutsidePolygon = 6,\n /** Point is strictly outside the polygon and projects to a vertex. */\n OutsidePolygonProjectsToVertex = 7,\n /** Point is strictly outside the polygon and projects to an edge (but not a vertex). */\n OutsidePolygonProjectsToEdgeInterior = 8,\n}\n\n/**\n * Interface for `toJSON` and `setFromJSON` methods\n * @public\n */\nexport interface BeJSONFunctions {\n /**\n * Set content from a JSON object.\n * If the json object is undefined or unrecognized, always set a default value.\n */\n setFromJSON(json: any): void;\n /** Return a json object with this object's contents. */\n toJSON(): any;\n}\n/** The Properties for a JSON representation of an Angle.\n * If value is a number, it is in *degrees*.\n * If value is an object, it can have either degrees or radians.\n * @public\n */\nexport type AngleProps =\n { degrees: number } |\n { radians: number } |\n { _radians: number } |\n { _degrees: number } |\n number;\n/** The Properties for a JSON representation of an AngleSweep.\n * * The json data is always start and end angles as a pair in an array.\n * If AngleProps data is an array of two numbers, it is an angle in degrees.\n * If the AngleProps is an object with key degrees, the degrees value must be an array with the two degrees angles as numbers\n * If the AngleProps is an object with key radians, the radians value must be an array with the two radians angles as numbers\n * @public\n */\nexport type AngleSweepProps =\n AngleSweep |\n { degrees: [number, number] } |\n { radians: [number, number] } |\n [number, number];\n\n/**\n * Class containing static methods for typical numeric operations.\n * * Experimentally, methods like Geometry.hypotenuse are observed to be faster than the system intrinsics.\n * * This is probably due to\n * * Fixed length arg lists\n * * strongly typed parameters\n * @public\n */\nexport class Geometry {\n /** Tolerance for small distances in metric coordinates */\n public static readonly smallMetricDistance = 1.0e-6;\n /** Square of `smallMetricTolerance` */\n public static readonly smallMetricDistanceSquared = 1.0e-12;\n /** tolerance for small angle measured in radians. */\n public static readonly smallAngleRadians = 1.0e-12;\n /** square of `smallAngleRadians` */\n public static readonly smallAngleRadiansSquared = 1.0e-24;\n /** tolerance for small angle measured in degrees. */\n public static readonly smallAngleDegrees = 5.7e-11;\n /** tolerance for small angle measured in arc-seconds. */\n public static readonly smallAngleSeconds = 2e-7;\n /** numeric value that may be considered huge for a ratio of numbers.\n * * Note that the \"allowed\" result value is vastly larger than 1.\n */\n public static readonly largeFractionResult = 1.0e10;\n /** numeric value that may be considered zero for fractions between 0 and 1. */\n public static readonly smallFraction = 1.0e-10;\n /** numeric value that may considered huge for numbers expected to be coordinates.\n * * This allows larger results than `largeFractionResult`.\n */\n public static readonly largeCoordinateResult = 1.0e13;\n /** numeric value that may considered infinite for metric coordinates.\n * * This coordinate should be used only as a placeholder indicating \"at infinity\" -- computing actual points at this coordinate invites numerical problems.\n */\n public static readonly hugeCoordinate = 1.0e12;\n /** Test if absolute value of x is huge.\n * * See `Geometry.hugeCoordinate`\n */\n public static isHugeCoordinate(x: number): boolean {\n return x > this.hugeCoordinate || x < - this.hugeCoordinate;\n }\n\n /** Test if a number is odd.\n */\n public static isOdd(x: number): boolean {\n return (x & (0x01)) === 1;\n }\n /** Radians value for full circle 2PI radians minus `smallAngleRadians` */\n public static readonly fullCircleRadiansMinusSmallAngle = 2.0 * Math.PI - 1.0e-12; // smallAngleRadians less than 360degrees\n /** Correct `distance` to zero if undefined or smaller than metric tolerance. Otherwise return it unchanged. */\n public static correctSmallMetricDistance(distance: number | undefined, replacement: number = 0.0): number {\n if (distance === undefined || Math.abs(distance) < Geometry.smallMetricDistance) {\n return replacement;\n }\n return distance;\n }\n /**\n * If `a` is large enough for safe division, return `1/a`, using Geometry.smallMetricDistance as the tolerance for declaring it as divide by zero. Otherwise return `undefined`.\n * @param a denominator of division\n */\n public static inverseMetricDistance(a: number): number | undefined {\n return (Math.abs(a) <= Geometry.smallMetricDistance) ? undefined : 1.0 / a;\n }\n /**\n * If `a` is large enough, return `1/a`, using the square of Geometry.smallMetricDistance as the tolerance for declaring it as divide by zero. Otherwise return `undefined`.\n * @param a denominator of division\n */\n public static inverseMetricDistanceSquared(a: number): number | undefined {\n return (Math.abs(a) <= Geometry.smallMetricDistanceSquared) ? undefined : 1.0 / a;\n }\n /**\n * Boolean test for metric coordinate near-equality (i.e., if x and y are almost equal). If tolerance is not passed,\n * `Geometry.smallMetricDistance` is used as tolerance.\n */\n public static isSameCoordinate(x: number, y: number, tol?: number): boolean {\n if (tol)\n return Math.abs(x - y) < Math.abs(tol);\n return Math.abs(x - y) < Geometry.smallMetricDistance;\n }\n /** Boolean test for metric coordinate near-equality, with toleranceFactor applied to the usual smallMetricDistance */\n public static isSameCoordinateWithToleranceFactor(x: number, y: number, toleranceFactor: number): boolean {\n return Geometry.isSameCoordinate(x, y, toleranceFactor * Geometry.smallMetricDistance);\n }\n /** Boolean test for metric coordinate near-equality of x, y pair */\n public static isSameCoordinateXY(x0: number, y0: number, x1: number, y1: number, tol: number = Geometry.smallMetricDistance): boolean {\n let d = x1 - x0;\n if (d < 0)\n d = -d;\n if (d > tol)\n return false;\n d = y1 - y0;\n if (d < 0)\n d = -d;\n return d < tol;\n }\n /** Boolean test for squared metric coordinate near-equality */\n public static isSameCoordinateSquared(x: number, y: number): boolean {\n return Math.abs(Math.sqrt(x) - Math.sqrt(y)) < Geometry.smallMetricDistance;\n }\n /** boolean test for small `dataA.distance (dataB)` within `smallMetricDistance` */\n public static isSamePoint3d(dataA: Point3d, dataB: Point3d): boolean { return dataA.distance(dataB) < Geometry.smallMetricDistance; }\n /** boolean test for distance between `XYZ` objects within `smallMetricDistance`\n * * Note that Point3d and Vector3d are both derived from XYZ, so this method tolerates mixed types.\n */\n public static isSameXYZ(dataA: XYZ, dataB: XYZ): boolean { return dataA.distance(dataB) < Geometry.smallMetricDistance; }\n /** boolean test for small `dataA.distanceXY (dataB)` within `smallMetricDistance` */\n public static isSamePoint3dXY(dataA: Point3d, dataB: Point3d): boolean { return dataA.distanceXY(dataB) < Geometry.smallMetricDistance; }\n /** boolean test for small `dataA.distanceXY (dataB)` within `smallMetricDistance` */\n public static isSameVector3d(dataA: Vector3d, dataB: Vector3d): boolean { return dataA.distance(dataB) < Geometry.smallMetricDistance; }\n /** boolean test for small `dataA.distanceXY (dataB)` within `smallMetricDistance` */\n public static isSamePoint2d(dataA: Point2d, dataB: Point2d): boolean { return dataA.distance(dataB) < Geometry.smallMetricDistance; }\n /** boolean test for small `dataA.distanceXY (dataB)` within `smallMetricDistance` */\n public static isSameVector2d(dataA: Vector2d, dataB: Vector2d): boolean { return dataA.distance(dataB) < Geometry.smallMetricDistance; }\n /**\n * Lexical comparison of (a.x,a.y) (b.x,b.y) with x as first test, y second.\n * * This is appropriate for a horizontal sweep in the plane.\n */\n public static lexicalXYLessThan(a: XY | XYZ, b: XY | XYZ): -1 | 0 | 1 {\n if (a.x < b.x)\n return -1;\n else if (a.x > b.x)\n return 1;\n if (a.y < b.y)\n return -1;\n else if (a.y > b.y)\n return 1;\n return 0;\n }\n /**\n * Lexical comparison of (a.x,a.y) (b.x,b.y) with y as first test, x second.\n * * This is appropriate for a vertical sweep in the plane.\n */\n public static lexicalYXLessThan(a: XY | XYZ, b: XY | XYZ): -1 | 0 | 1 {\n if (a.y < b.y)\n return -1;\n else if (a.y > b.y)\n return 1;\n if (a.x < b.x)\n return -1;\n else if (a.x > b.x)\n return 1;\n return 0;\n }\n /**\n * Lexical test, based on x first, y second, z third.\n */\n public static lexicalXYZLessThan(a: XYZ, b: XYZ): -1 | 0 | 1 {\n if (a.x < b.x)\n return -1;\n else if (a.x > b.x)\n return 1;\n if (a.y < b.y)\n return -1;\n else if (a.y > b.y)\n return 1;\n if (a.z < b.z)\n return -1;\n else if (a.z > b.z)\n return 1;\n return 0;\n }\n /** Test if `value` is small compared to `smallAngleRadians`.\n * * This is appropriate if `value` is know to be a typical 0..1 fraction.\n */\n public static isSmallRelative(value: number): boolean {\n return Math.abs(value) < Geometry.smallAngleRadians;\n }\n /** Test if `value` is small compared to `smallAngleRadians` */\n public static isSmallAngleRadians(value: number): boolean {\n return Math.abs(value) < Geometry.smallAngleRadians;\n }\n /** Returns true if both values are undefined or if both are defined and almost equal within tolerance.\n * If one is undefined and the other is not then false is returned.\n */\n public static isAlmostEqualOptional(a: number | undefined, b: number | undefined, tolerance: number): boolean {\n if (a !== undefined && b !== undefined) {\n if (Math.abs(a - b) > tolerance)\n return false;\n } else {\n if (a !== undefined || b !== undefined)\n return false;\n }\n return true;\n }\n /** Toleranced equality test, using tolerance `smallAngleRadians * ( 1 + abs(a) + (abs(b)))`\n * * Effectively an absolute tolerance of `smallAngleRadians`, with tolerance increasing for larger values of a and b.\n */\n public static isAlmostEqualNumber(a: number, b: number): boolean {\n const sumAbs = 1.0 + Math.abs(a) + Math.abs(b);\n return Math.abs(a - b) <= Geometry.smallAngleRadians * sumAbs;\n }\n /** Toleranced equality test, using tolerance `smallAngleRadians * ( 1 + abs(a) + (abs(b)))`\n * * Effectively an absolute tolerance of `smallAngleRadians`, with tolerance increasing for larger values of a and b.\n */\n public static isAlmostEqualXAndY(a: XAndY, b: XAndY): boolean {\n const sumAbs = 1.0 + Math.abs(a.x) + Math.abs(b.x) + Math.abs(a.y) + Math.abs(b.y);\n const tolerance = Geometry.smallAngleRadians * sumAbs;\n return Math.abs(a.x - b.x) <= tolerance && Math.abs(a.y - b.y) <= tolerance;\n }\n /**\n * Toleranced equality test, using caller-supplied tolerance.\n * If no tolerance is given, use smallMetricDistance.\n */\n public static isDistanceWithinTol(distance: number, tol?: number): boolean {\n if (tol !== undefined)\n return Math.abs(distance) <= Math.abs(tol);\n return Math.abs(distance) <= Geometry.smallMetricDistance;\n }\n /** Toleranced equality test, using `smallMetricDistance` tolerance. */\n public static isSmallMetricDistance(distance: number): boolean {\n return Math.abs(distance) <= Geometry.smallMetricDistance;\n }\n\n /** Toleranced equality, using `smallMetricDistanceSquared` tolerance. */\n public static isSmallMetricDistanceSquared(distanceSquared: number): boolean {\n return Math.abs(distanceSquared) <= Geometry.smallMetricDistanceSquared;\n }\n /**\n * Return `axis modulo 3` with proper handling of negative indices\n * ..., -3:x, -2:y, -1:z, 0:x, 1:y, 2:z, 3:x, 4:y, 5:z, 6:x, 7:y, 8:z, ...\n * */\n public static cyclic3dAxis(axis: number): number {\n /* Direct test for the most common cases, avoid modulo */\n if (axis >= 0) {\n if (axis < 3)\n return axis;\n if (axis < 6)\n return axis - 3;\n return axis % 3;\n }\n const j = axis + 3;\n if (j >= 0)\n return j;\n return 2 - ((-axis - 1) % 3);\n }\n /** Return the AxisOrder for which axisIndex is the first named axis.\n * * `axisIndex === 0` returns `AxisOrder.XYZ`\n * * `axisIndex === 1` returns `AxisOrder.YZX`\n * * `axisIndex === 2` returns `AxisOrder.ZXY`\n */\n public static axisIndexToRightHandedAxisOrder(axisIndex: AxisIndex): AxisOrder {\n if (axisIndex === 0)\n return AxisOrder.XYZ;\n if (axisIndex === 1)\n return AxisOrder.YZX;\n if (axisIndex === 2)\n return AxisOrder.ZXY;\n return Geometry.axisIndexToRightHandedAxisOrder(Geometry.cyclic3dAxis(axisIndex));\n }\n /** Return the largest absolute distance from a to either of b0 or b1 */\n public static maxAbsDiff(a: number, b0: number, b1: number): number {\n return Math.max(Math.abs(a - b0), Math.abs(a - b1));\n }\n /** Return the largest absolute absolute value among x,y,z */\n public static maxAbsXYZ(x: number, y: number, z: number): number {\n return Geometry.maxXYZ(Math.abs(x), Math.abs(y), Math.abs(z));\n }\n /** Return the largest absolute absolute value among x,y */\n public static maxAbsXY(x: number, y: number): number {\n return Geometry.maxXY(Math.abs(x), Math.abs(y));\n }\n /** Return the largest signed value among a, b, c */\n public static maxXYZ(a: number, b: number, c: number): number {\n let q = a;\n if (b > q) q = b;\n if (c > q) q = c;\n return q;\n }\n /**\n * Examine the value (particularly sign) of x.\n * * If x is negative, return outNegative.\n * * If x is true zero, return outZero\n * * If x is positive, return outPositive\n */\n public static split3WaySign(x: number, outNegative: number, outZero: number, outPositive: number): number {\n if (x < 0)\n return outNegative;\n if (x > 0.0)\n return outPositive;\n return outZero;\n }\n /**\n * Examine the value (particularly sign) of x.\n * * If x is negative, return -1\n * * If x is true zero, return 0\n * * If x is positive, return 1\n */\n public static split3Way01(x: number, tolerance: number = Geometry.smallMetricDistance): -1 | 0 | 1 {\n if (x > tolerance)\n return 1;\n if (x < -tolerance)\n return -1;\n return 0;\n }\n /** Return the largest signed value among a, b */\n public static maxXY(a: number, b: number): number {\n let q = a;\n if (b > q) q = b;\n return q;\n }\n /** Return the smallest signed value among a, b */\n public static minXY(a: number, b: number): number {\n let q = a;\n if (b < q) q = b;\n return q;\n }\n /** Return the hypotenuse `sqrt(x*x + y*y)`. This is much faster than `Math.hypot(x,y)`. */\n public static hypotenuseXY(x: number, y: number): number {\n return Math.sqrt(x * x + y * y);\n }\n /** Return the squared `hypotenuse (x*x + y*y)`. */\n public static hypotenuseSquaredXY(x: number, y: number): number {\n return x * x + y * y;\n }\n /** Return the square of x */\n public static square(x: number): number {\n return x * x;\n }\n /** Return the hypotenuse `sqrt(x*x + y*y + z*z)`. This is much faster than `Math.hypot(x,y,z)`. */\n public static hypotenuseXYZ(x: number, y: number, z: number): number {\n return Math.sqrt(x * x + y * y + z * z);\n }\n /** Return the squared hypotenuse `(x*x + y*y + z*z)`. This is much faster than `Math.hypot(x,y,z)`. */\n public static hypotenuseSquaredXYZ(x: number, y: number, z: number): number {\n return x * x + y * y + z * z;\n }\n /** Return the (full 4d) hypotenuse `sqrt(x*x + y*y + z*z + w*w)`. This is much faster than `Math.hypot(x,y,z,w)`. */\n public static hypotenuseXYZW(x: number, y: number, z: number, w: number): number {\n return Math.sqrt(x * x + y * y + z * z + w * w);\n }\n /** Return the squared hypotenuse `(x*x + y*y + z*z+w*w)`. This is much faster than `Math.hypot(x,y,z)`. */\n public static hypotenuseSquaredXYZW(x: number, y: number, z: number, w: number): number {\n return x * x + y * y + z * z + w * w;\n }\n /**\n * Return the distance between xy points given as numbers.\n * @param x0 x coordinate of point 0\n * @param y0 y coordinate of point 0\n * @param x1 x coordinate of point 1\n * @param y1 y coordinate of point 1\n */\n public static distanceXYXY(x0: number, y0: number, x1: number, y1: number): number {\n return Geometry.hypotenuseXY(x1 - x0, y1 - y0);\n }\n /**\n * Return the distance between xyz points given as numbers.\n * @param x0 x coordinate of point 0\n * @param y0 y coordinate of point 0\n * @param z0 z coordinate of point 0\n * @param x1 x coordinate of point 1\n * @param y1 y coordinate of point 1\n * @param z1 z coordinate of point 1\n */\n public static distanceXYZXYZ(x0: number, y0: number, z0: number, x1: number, y1: number, z1: number): number {\n return Geometry.hypotenuseXYZ(x1 - x0, y1 - y0, z1 - z0);\n }\n /** Returns Returns the triple product of 3 vectors provided as x,y,z number sequences.\n *\n * * The triple product is the determinant of the 3x3 matrix with the 9 numbers (3 vectors placed in 3 rows).\n * * The triple product is positive if the 3 vectors form a right handed coordinate system.\n * * The triple product is negative if the 3 vectors form a left handed coordinate system.\n * * Treating the 9 numbers as 3 vectors U, V, W, any of these formulas gives the same result:\n * * U dot (V cross W)\n * * V dot (W cross U)\n * * W dot (U cross V)\n * * (-U dot (W cross V)) -- (note the negative -- reversing cross product order changes the sign)\n * * (-V dot (U cross W)) -- (note the negative -- reversing cross product order changes the sign)\n * * (-W dot (V cross U)) -- (note the negative -- reversing cross product order changes the sign)\n * * the triple product is 6 times the (signed) volume of the tetrahedron with the three vectors as edges from a common vertex.\n */\n public static tripleProduct(\n ux: number, uy: number, uz: number,\n vx: number, vy: number, vz: number,\n wx: number, wy: number, wz: number): number {\n return ux * (vy * wz - vz * wy)\n + uy * (vz * wx - vx * wz)\n + uz * (vx * wy - vy * wx);\n }\n /** Returns the determinant of the 4x4 matrix unrolled as the 16 parameters.\n */\n public static determinant4x4(\n xx: number, xy: number, xz: number, xw: number,\n yx: number, yy: number, yz: number, yw: number,\n zx: number, zy: number, zz: number, zw: number,\n wx: number, wy: number, wz: number, ww: number): number {\n return xx * this.tripleProduct(yy, yz, yw, zy, zz, zw, wy, wz, ww)\n - yx * this.tripleProduct(xy, xz, xw, zy, zz, zw, wy, wz, ww)\n + zx * this.tripleProduct(xy, xz, xw, yy, yz, yw, wy, wz, ww)\n - wx * this.tripleProduct(xy, xz, xw, yy, yz, yw, zy, zz, zw);\n }\n /** Return the mean curvature for two radii, with 0 radius implying 0 curvature */\n public static meanCurvatureOfRadii(r0: number, r1: number): number {\n return 0.5 * (this.safeDivideFraction(1, r0, 0) + this.safeDivideFraction(1, r1, 0));\n }\n /**\n * Returns curvature magnitude from a first and second derivative vector.\n * @param ux first derivative x component\n * @param uy first derivative y component\n * @param uz first derivative z component\n * @param vx second derivative x component\n * @param vy second derivative y component\n * @param vz second derivative z component\n */\n public static curvatureMagnitude(\n ux: number, uy: number, uz: number,\n vx: number, vy: number, vz: number): number {\n let q = uy * vz - uz * vy;\n let sum = q * q;\n q = uz * vx - ux * vz;\n sum += q * q;\n q = ux * vy - uy * vx;\n sum += q * q;\n const a = Math.sqrt(ux * ux + uy * uy + uz * uz);\n const b = Math.sqrt(sum);\n // (sum and a are both nonnegative)\n const aaa = a * a * a;\n // radius of curvature = aaa / b;\n // curvature = b/aaa\n const tol = Geometry.smallAngleRadians;\n if (aaa > tol * b)\n return b / aaa;\n return 0; // hm.. maybe should be infinite?\n }\n /** Returns the determinant of 3x3 matrix with x and y rows taken from 3 points, third row from corresponding numbers.\n *\n */\n public static tripleProductXYW(\n columnA: XAndY, weightA: number,\n columnB: XAndY, weightB: number,\n columnC: XAndY, weightC: number): number {\n return Geometry.tripleProduct(\n columnA.x, columnB.x, columnC.x,\n columnA.y, columnB.y, columnC.y,\n weightA, weightB, weightC);\n }\n /** Returns the determinant of 3x3 matrix with x and y rows taken from 3 points, third row from corresponding numbers.\n *\n */\n public static tripleProductPoint4dXYW(\n columnA: Point4d,\n columnB: Point4d,\n columnC: Point4d): number {\n return Geometry.tripleProduct(\n columnA.x, columnB.x, columnC.x,\n columnA.y, columnB.y, columnC.y,\n columnA.w, columnB.w, columnC.w);\n }\n /** 2D cross product of vectors layed out as scalars. */\n public static crossProductXYXY(ux: number, uy: number, vx: number, vy: number): number {\n return ux * vy - uy * vx;\n }\n /** 3D cross product of vectors layed out as scalars. */\n public static crossProductXYZXYZ(ux: number, uy: number, uz: number, vx: number, vy: number, vz: number, result?: Vector3d): Vector3d {\n return Vector3d.create(\n uy * vz - uz * vy,\n uz * vx - ux * vz,\n ux * vy - uy * vx, result);\n }\n /** magnitude of 3D cross product of vectors, with the vectors presented as */\n public static crossProductMagnitude(ux: number, uy: number, uz: number, vx: number, vy: number, vz: number): number {\n return Geometry.hypotenuseXYZ(\n uy * vz - uz * vy,\n uz * vx - ux * vz,\n ux * vy - uy * vx);\n }\n /** 3D dot product of vectors layed out as scalars. */\n public static dotProductXYZXYZ(ux: number, uy: number, uz: number, vx: number, vy: number, vz: number): number {\n return ux * vx + uy * vy + uz * vz;\n }\n /** 2D dot product of vectors layed out as scalars. */\n public static dotProductXYXY(ux: number, uy: number, vx: number, vy: number): number {\n return ux * vx + uy * vy;\n }\n /**\n * Clamp to (min(a,b), max(a,b))\n * * always returns a number between a and b\n * @param x\n * @param a\n * @param b\n */\n public static clampToStartEnd(x: number, a: number, b: number): number {\n if (a > b)\n return Geometry.clampToStartEnd(x, b, a);\n if (x < a)\n return a;\n if (b < x)\n return b;\n return x;\n }\n /**\n * Clamp value to (min,max) with no test for order of (min,max)\n * @param value value to clamp\n * @param min smallest allowed output\n * @param max largest allowed result.\n */\n public static clamp(value: number, min: number, max: number): number { return Math.max(min, Math.min(max, value)); }\n /** If given a number, return it. If given undefined, return `defaultValue`. */\n public static resolveNumber(value: number | undefined, defaultValue: number = 0): number {\n return value !== undefined ? value : defaultValue;\n }\n /** If given a value, return it. If given undefined, return `defaultValue`. */\n public static resolveValue<T>(value: T | undefined, defaultValue: T): T {\n return value !== undefined ? value : defaultValue;\n }\n /** If given value matches a target, return undefined. Otherwise return the value. */\n public static resolveToUndefined<T>(value: T | undefined, targetValue: T): T | undefined {\n return value === targetValue ? undefined : value;\n }\n /**\n * Simple interpolation between values, but choosing (based on fraction) a or b as starting\n * point for maximum accuracy.\n * * If `f = 0`, then `a` is returned and if `f = 1`, then `b` is returned.\n */\n public static interpolate(a: number, f: number, b: number): number {\n return f <= 0.5 ? a + f * (b - a) : b - (1.0 - f) * (b - a);\n }\n /**\n * Given an axisOrder (e.g. XYZ, YZX, etc) and an index, returns the axis index at the given index.\n * * For example, if axisOrder = XYZ, then for index 0 returns X (or axis index 0), for index 1 returns\n * Y (or axis index 1), and for index 2 returns Z (or axis index 2). For indexes greater than 2 or smaller\n * than 0, it returns cyclic axis index. See Geometry.cyclic3dAxis for more info.\n * * Another example: if axisOrder = ZYX, then for index 0 returns Z (or axis index 2), for index 1 returns\n * Y (or axis index 1), and for index 2 returns X (or axis index 0).\n * */\n public static axisOrderToAxis(order: AxisOrder, index: number): number {\n const axis = order <= AxisOrder.ZXY ? order + index : (order - AxisOrder.XZY) - index;\n return Geometry.cyclic3dAxis(axis);\n }\n /** Return (a modulo period), e.g. for use as a cyclic index. Both a and period may be negative. */\n public static modulo(a: number, period: number): number {\n if (period <= 0) {\n if (period === 0)\n return a;\n return -Geometry.modulo(-a, -period);\n }\n\n if (a >= 0) {\n if (a < period)\n return a;\n if (a < 2 * period)\n return a - period;\n } else {\n a += period; // hopefully move into primary period without division and floor\n if (a > 0)\n return a;\n }\n const m = Math.floor(a / period);\n return a - m * period;\n }\n /** return 0 if the value is undefined, 1 if defined. */\n public static defined01(value: any): number { return value === undefined ? 0 : 1; }\n /**\n * Return `numerator` divided by `denominator`, or `undefined`.\n * @param numerator the numerator\n * @param denominator the denominator\n * @returns return `numerator/denominator` but if the ratio would exceed `Geometry.largeFractionResult`,\n * return `undefined`.\n */\n public static conditionalDivideFraction(numerator: number, denominator: number): number | undefined {\n if (Math.abs(denominator) * Geometry.largeFractionResult > Math.abs(numerator))\n return numerator / denominator;\n return undefined;\n }\n /**\n * Return `numerator` divided by `denominator`.\n * @param numerator the numerator\n * @param denominator the denominator\n * @returns return `numerator/denominator` but if the ratio would exceed `Geometry.largeFractionResult`,\n * return `defaultResult`.\n */\n public static safeDivideFraction(numerator: number, denominator: number, defaultResult: number): number {\n const a = Geometry.conditionalDivideFraction(numerator, denominator);\n if (a !== undefined)\n return a;\n return defaultResult;\n }\n /**\n * Return `numerator` divided by `denominator` (with a given `largestResult`), or `undefined`.\n * @param numerator the numerator\n * @param denominator the denominator\n * @param largestResult the ratio threshold.\n * @returns return `numerator/denominator` but if the ratio would exceed `largestResult`, return `undefined`.\n */\n public static conditionalDivideCoordinate(numerator: number, denominator: number,\n largestResult: number = Geometry.largeCoordinateResult): number | undefined {\n if (Math.abs(denominator * largestResult) > Math.abs(numerator))\n return numerator / denominator;\n return undefined;\n }\n /** return the 0, 1, or 2 pairs of (c,s) values that solve\n * {constCoff + cosCoff * c + sinCoff * s = 0}\n * with the constraint {c*c+s*s = 1}\n */\n public static solveTrigForm(constCoff: number, cosCoff: number, sinCoff: number): Vector2d[] | undefined {\n {\n const delta2 = cosCoff * cosCoff + sinCoff * sinCoff;\n const constCoff2 = constCoff * constCoff;\n // nSolution = 0\n let result;\n if (delta2 > 0.0) {\n const lambda = - constCoff / delta2;\n const a2 = constCoff2 / delta2;\n const D2 = 1.0 - a2;\n if (-Geometry.smallMetricDistanceSquared < D2 && D2 <= 0.0) { // observed D2 = -2.22e-16 in rotated system\n // nSolution = 1\n const c0 = lambda * cosCoff;\n const s0 = lambda * sinCoff;\n result = [Vector2d.create(c0, s0)];\n } else if (D2 > 0.0) {\n const mu = Math.sqrt(D2 / delta2);\n /* c0,s0 = closest approach of line to origin */\n const c0 = lambda * cosCoff;\n const s0 = lambda * sinCoff;\n // nSolution = 2\n result = [Vector2d.create(c0 - mu * sinCoff, s0 + mu * cosCoff), Vector2d.create(c0 + mu * sinCoff, s0 - mu * cosCoff)];\n }\n }\n return result;\n }\n }\n /** For a line f(x) whose function values at x0 and x1 are f0 and f1, return the x value at which f(x)=fTarget; */\n public static inverseInterpolate(x0: number, f0: number, x1: number, f1: number, targetF: number = 0,\n defaultResult?: number): number | undefined {\n const g = Geometry.conditionalDivideFraction(targetF - f0, f1 - f0);\n if (g)\n return Geometry.interpolate(x0, g, x1);\n return defaultResult;\n }\n /** For a line f(x) whose function values at x=0 and x=1 are f0 and f1, return the x value at which f(x)=fTarget; */\n public static inverseInterpolate01(f0: number, f1: number, targetF: number = 0): number | undefined {\n return Geometry.conditionalDivideFraction(targetF - f0, f1 - f0);\n }\n /** Return true if json is an array with at least minEntries, and all entries are numbers (including those beyond minEntries) */\n public static isNumberArray(json: any, minEntries: number = 0): boolean {\n if (Array.isArray(json) && json.length >= minEntries) {\n let entry;\n for (entry of json) {\n // if (!(entry as number) && entry !== 0.0)\n if (!Number.isFinite(entry))\n return false;\n }\n return true;\n }\n return false;\n }\n /** Return true if json is an array of at least numNumberArrays, with at least minEntries in each number array.\n */\n public static isArrayOfNumberArray(json: any, numNumberArray: number, minEntries: number = 0): boolean {\n if (Array.isArray(json) && json.length >= numNumberArray) {\n let entry;\n for (entry of json)\n if (!Geometry.isNumberArray(entry, minEntries)) return false;\n return true;\n }\n return false;\n }\n /** return the number of steps to take so that numSteps * stepSize >= total.\n * minCount is returned for both (a) setSize 0 or less and (b) stepSize > total.\n * A small tolerance is applied for almost\n */\n public static stepCount(stepSize: number, total: number, minCount = 1, maxCount = 101): number {\n if (stepSize <= 0)\n return minCount;\n total = Math.abs(total);\n if (stepSize >= total)\n return minCount;\n const stepCount = Math.floor((total + 0.999999 * stepSize) / stepSize);\n if (stepCount < minCount)\n return minCount;\n if (stepCount > maxCount)\n return maxCount;\n return stepCount;\n }\n /** Test if x is in simple 0..1 interval. But optionally skip the test. (this odd behavior is very convenient for code that sometimes does not do the filtering.)\n * @param x value to test.\n * @param apply01 if false, accept all x.\n */\n public static isIn01(x: number, apply01: boolean = true): boolean { return apply01 ? x >= 0.0 && x <= 1.0 : true; }\n /** Test if x is in simple 0..1 interval. But optionally skip the test. (this odd behavior is very convenient for code that sometimes does not do the filtering.)\n * @param x value to test.\n * @param apply01 if false, accept all x.\n */\n public static isIn01WithTolerance(x: number, tolerance: number): boolean { return x + tolerance >= 0.0 && x - tolerance <= 1.0; }\n /**\n * restrict x so it is in the interval `[a,b]`, allowing a,b to be in either order.\n * @param x\n * @param a (usually the lower) interval limit\n * @param b (usually the upper) interval limit\n */\n public static restrictToInterval(x: number, a: number, b: number): number {\n if (a <= b) {\n if (x < a) return a;\n if (x > b) return b;\n return x;\n }\n // reversed interval ....\n if (x < b) return b;\n if (x > a) return a;\n return x;\n }\n /**\n * Case-insensitive string comparison.\n * * Return true if the toUpperCase values match.\n */\n public static equalStringNoCase(string1: string, string2: string): boolean {\n return string1.toUpperCase() === string2.toUpperCase();\n }\n /** test for EXACT match of number arrays. */\n public static exactEqualNumberArrays(a: number[] | undefined, b: number[] | undefined): boolean {\n if (Array.isArray(a) && a.length === 0)\n a = undefined;\n if (Array.isArray(b) && b.length === 0)\n b = undefined;\n if (a === undefined && b === undefined)\n return true;\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i++)\n if (a[i] !== b[i])\n return false;\n return true;\n }\n return false;\n }\n /** test for match of XYZ arrays. */\n public static almostEqualArrays<T>(a: T[] | undefined, b: T[] | undefined,\n testFunction: (p: T, q: T) => boolean): boolean {\n if (Array.isArray(a) && a.length === 0)\n a = undefined;\n if (Array.isArray(b) && b.length === 0)\n b = undefined;\n if (a === undefined && b === undefined)\n return true;\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n if (!testFunction(a[i], b[i]))\n return false;\n }\n return true;\n }\n return false;\n }\n /** test for match of typed arrays (e.g. Float64Array). */\n public static almostEqualNumberArrays(a: number[] | Float64Array | undefined, b: number[] | Float64Array | undefined,\n testFunction: (p: number, q: number) => boolean): boolean {\n if (Array.isArray(a) && a.length === 0)\n a = undefined;\n if (Array.isArray(b) && b.length === 0)\n b = undefined;\n if (a === undefined && b === undefined)\n return true;\n if (Array.isArray(a) && Array.isArray(b)) {\n if (a.length !== b.length)\n return false;\n for (let i = 0; i < a.length; i++) {\n if (!testFunction(a[i], b[i]))\n return false;\n }\n return true;\n }\n return false;\n }\n /**\n * Return\n * * true if both values are defined and equal (with ===).\n * * false if both defined by not equal\n * * return (option arg) resultIfBothUndefined when both are undefined.\n * * return false if one is defined and the other undefined\n * @param a first value\n * @param b second value\n * @param resultIfBothUndefined return value when both are undefined.\n * @returns\n */\n public static areEqualAllowUndefined<T>(a: T | undefined, b: T | undefined, resultIfBothUndefined: boolean = true): boolean {\n if (a === undefined && b === undefined)\n return resultIfBothUndefined;\n if (a !== undefined && b !== undefined)\n return a === b;\n return false;\n }\n /** clone an array whose members have a clone method.\n * * undefined return from clone is forced into the output array.\n */\n public static cloneMembers<T extends Cloneable<T>>(a: T[] | undefined): T[] | undefined {\n if (a === undefined)\n return undefined;\n const b: T[] = [];\n for (const p of a) {\n b.push(p.clone()!);\n }\n return b;\n }\n}\n/**\n * interface for method with a clone operation\n * @public\n */\nexport interface Cloneable<T> {\n /** required method to return a deep clone. */\n clone(): T | undefined;\n}\n/** Options used for methods like [[Vector2d.isPerpendicularTo]] and [[Vector3d.isParallelTo]].\n * @public\n */\nexport interface PerpParallelOptions {\n /** Squared radian tolerance for comparing the angle between two vectors.\n * Default: [[Geometry.smallAngleRadiansSquared]].\n */\n radianSquaredTol?: number;\n /** Squared distance tolerance for detecting a zero-length vector.\n * Default: [[Geometry.smallMetricDistanceSquared]].\n */\n distanceSquaredTol?: number;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"Akima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,CAAC,wBAAwB,EAAE,CAAC;IAClD,CAAC;IACD,2EAA2E;IACpE,UAAU;QACf,OAAO,IAAI,CAAC,QAAQ,CAAC,wBAAwB,EAAE,CAAC;IAClD,CAAC;IAED;;;OAGG;IACI,cAAc;QACnB,IAAI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC;QAClC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC;IACD;;OAEG;IACI,mBAAmB,CAAC,SAAoB;QAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAChE,IAAI,OAAO,EAAE;YACX,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;SACzD;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,0BAA0B;IACV,KAAK;QACnB,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,kDAAkD;IAC3C,mBAAmB,CAAC,KAAoB,IAAa,OAAO,KAAK,YAAY,YAAY,CAAC,CAAC,CAAC;IAEnF,aAAa,CAAC,KAAoB;QAChD,IAAI,KAAK,YAAY,YAAY,EAAE;YACjC,OAAO,mBAAmB,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;SAC1E;QACD,OAAO,KAAK,CAAC;IACf,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/** @packageDocumentation\r\n * @module Bspline\r\n */\r\n\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { Geometry } from \"../Geometry\";\r\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\r\nimport { ProxyCurve } from \"../curve/ProxyCurve\";\r\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\r\nimport { BSplineCurve3d } from \"./BSplineCurve\";\r\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\r\nimport { Transform } from \"../geometry3d/Transform\";\r\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\r\nimport { XYZProps } from \"../geometry3d/XYZProps\";\r\n\r\n/**\r\n * fitPoints [[AkimaCurve3d]]\r\n * * This is a \"json compatible\" version of the serializer-friendly [[AkimaCurve3dOptions]]\r\n * @public\r\n */\r\n export interface AkimaCurve3dProps {\r\n /** Points that the curve must pass through */\r\n fitPoints: XYZProps[];\r\n}\r\n\r\n/**\r\n * fitPoints and end condition data for [[AkimaCurve3d]]\r\n * * This is a \"typed object\" version of the serializer-friendly [[AkimaCurve3dProps]]\r\n * * Typical use cases rarely require all parameters, so the constructor does not itemize them as parameters.\r\n * @public\r\n */\r\nexport class AkimaCurve3dOptions {\r\n public fitPoints: Point3d[];\r\n /**\r\n *\r\n * @param fitPoints points to CAPTURE\r\n * @param knots array to CAPTURE\r\n */\r\n public constructor(fitPoints?: Point3d[]) {\r\n this.fitPoints = fitPoints ? fitPoints : [];\r\n }\r\n\r\n /** Points that the curve must pass through.\r\n * First and last 2 points are \"beyond the end\" for control of end slope.\r\n fitPoints: Point3d[];\r\n\r\n/** Clone with strongly typed members reduced to simple json. */\r\n public cloneAsAkimaCurve3dProps(): AkimaCurve3dProps {\r\n const props = {\r\n fitPoints: Point3dArray.cloneDeepJSONNumberArrays(this.fitPoints),\r\n };\r\n return props;\r\n }\r\n/** Clone with strongly typed members reduced to simple json. */\r\n public clone(): AkimaCurve3dOptions {\r\n const clone = new AkimaCurve3dOptions(Point3dArray.clonePoint3dArray(this.fitPoints));\r\n return clone;\r\n }\r\n\r\n/** Clone with strongly typed members reduced to simple json. */\r\npublic static create(source: AkimaCurve3dProps): AkimaCurve3dOptions {\r\n const result = new AkimaCurve3dOptions(Point3dArray.clonePoint3dArray(source.fitPoints));\r\n return result;\r\n}\r\n\r\n public static areAlmostEqual(dataA: AkimaCurve3dOptions | undefined, dataB: AkimaCurve3dOptions | undefined): boolean {\r\n if (dataA === undefined && dataB === undefined)\r\n return true;\r\n if (dataA !== undefined && dataB !== undefined) {\r\n return Geometry.almostEqualArrays(dataA.fitPoints, dataB.fitPoints, (a: Point3d, b: Point3d) => a.isAlmostEqual(b));\r\n }\r\n return false;\r\n }\r\n}\r\n\r\n/**\r\n * Interpolating curve.\r\n * * Derive from [[ProxyCurve]]\r\n * * Use a [[BSplineCurve3d]] as the proxy\r\n * *\r\n * @public\r\n */\r\nexport class AkimaCurve3d extends ProxyCurve {\r\n public readonly curvePrimitiveType = \"interpolationCurve\";\r\n private _options: AkimaCurve3dOptions;\r\n /**\r\n * CAPTURE properties and proxy curve.\r\n */\r\nprivate constructor(properties: AkimaCurve3dOptions, proxyCurve: CurvePrimitive) {\r\n super(proxyCurve);\r\n this._options = properties;\r\n }\r\n public override dispatchToGeometryHandler(handler: GeometryHandler) {\r\n return handler.handleAkimaCurve3d(this);\r\n }\r\n/**\r\n * Create an [[AkimaCurve3d]] based on points, knots, and other properties in the [[AkimaCurve3dProps]] or [[AkimaCurve3dOptions]].\r\n * * This saves a COPY OF the options or props.\r\n * * Use createCapture () if the options or props can be used without copy\r\n */\r\n public static create(options: AkimaCurve3dOptions | AkimaCurve3dProps): AkimaCurve3d | undefined {\r\n let optionsCopy;\r\n if (options instanceof AkimaCurve3dOptions) {\r\n optionsCopy = options.clone();\r\n } else {\r\n optionsCopy = AkimaCurve3dOptions.create(options);\r\n }\r\n return AkimaCurve3d.createCapture(optionsCopy);\r\n }\r\n\r\n public static createCapture(options: AkimaCurve3dOptions): AkimaCurve3d | undefined{\r\n const proxyCurve = BSplineCurve3d.createFromAkimaCurve3dOptions(options);\r\n if (proxyCurve)\r\n return new AkimaCurve3d(options, proxyCurve);\r\n return undefined;\r\n }\r\n\r\n /** Return a (copy of) the defining points, packed as a Float64Array */\r\n public copyFitPointsFloat64Array(): Float64Array {\r\n return Point3dArray.cloneXYZPropsAsFloat64Array(this._options.fitPoints);\r\n }\r\n\r\n /**\r\n * Return json key-value pairs for for this [[AkimaCurve3d]].\r\n * @returns\r\n */\r\n public toJSON(): any {\r\n return this._options.cloneAsAkimaCurve3dProps();\r\n }\r\n /** Clone the [[AkimaCurve3dProps]] object in this [[AkimaCurve3dProps]] */\r\n public cloneProps(): AkimaCurve3dProps {\r\n return this._options.cloneAsAkimaCurve3dProps();\r\n }\r\n\r\n /**\r\n * Reverse the curve direction.\r\n * * This updates both the defining properties and the proxy bspline.\r\n */\r\n public reverseInPlace(): void {\r\n this._proxyCurve.reverseInPlace();\r\n this._options.fitPoints.reverse();\r\n }\r\n /**\r\n * Transform this [[AkimaCurve3d]] and its defining data in place\r\n */\r\n public tryTransformInPlace(transform: Transform): boolean {\r\n const proxyOk = this._proxyCurve.tryTransformInPlace(transform);\r\n if (proxyOk) {\r\n transform.multiplyPoint3dArray(this._options.fitPoints);\r\n }\r\n return proxyOk;\r\n }\r\n\r\n /** Return a deep clone */\r\n public override clone(): AkimaCurve3d {\r\n return new AkimaCurve3d(this._options.clone(), this._proxyCurve.clone());\r\n }\r\n\r\n /** Test if `other` is also an [[AkimaCurve3d]] */\r\n public isSameGeometryClass(other: GeometryQuery): boolean { return other instanceof AkimaCurve3d; }\r\n\r\n public override isAlmostEqual(other: GeometryQuery): boolean{\r\n if (other instanceof AkimaCurve3d) {\r\n return AkimaCurve3dOptions.areAlmostEqual(this._options, other._options);\r\n }\r\n return false;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"AkimaCurve3d.js","sourceRoot":"","sources":["../../../src/bspline/AkimaCurve3d.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,YA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AI,CAAC,WAAW,CAAC,cAAc,EAAE,CAAC;QAClC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC;IACpC,CAAC;IACD;;OAEG;IACI,mBAAmB,CAAC,SAAoB;QAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,WAAW,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;QAChE,IAAI,OAAO,EAAE;YACX,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;SACzD;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,0BAA0B;IACV,KAAK;QACnB,OAAO,IAAI,YAAY,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,kDAAkD;IAC3C,mBAAmB,CAAC,KAAoB,IAAa,OAAO,KAAK,YAAY,YAAY,CAAC,CAAC,CAAC;IAEnF,aAAa,CAAC,KAAoB;QAChD,IAAI,KAAK,YAAY,YAAY,EAAE;YACjC,OAAO,mBAAmB,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;SAC1E;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Bspline\n */\n\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\nimport { Geometry } from \"../Geometry\";\nimport { Point3dArray } from \"../geometry3d/PointHelpers\";\nimport { ProxyCurve } from \"../curve/ProxyCurve\";\nimport { CurvePrimitive } from \"../curve/CurvePrimitive\";\nimport { BSplineCurve3d } from \"./BSplineCurve\";\nimport { GeometryQuery } from \"../curve/GeometryQuery\";\nimport { Transform } from \"../geometry3d/Transform\";\nimport { GeometryHandler } from \"../geometry3d/GeometryHandler\";\nimport { XYZProps } from \"../geometry3d/XYZProps\";\n\n/**\n * fitPoints [[AkimaCurve3d]]\n * * This is a \"json compatible\" version of the serializer-friendly [[AkimaCurve3dOptions]]\n * @public\n */\n export interface AkimaCurve3dProps {\n /** Points that the curve must pass through */\n fitPoints: XYZProps[];\n}\n\n/**\n * fitPoints and end condition data for [[AkimaCurve3d]]\n * * This is a \"typed object\" version of the serializer-friendly [[AkimaCurve3dProps]]\n * * Typical use cases rarely require all parameters, so the constructor does not itemize them as parameters.\n * @public\n */\nexport class AkimaCurve3dOptions {\n public fitPoints: Point3d[];\n /**\n *\n * @param fitPoints points to CAPTURE\n * @param knots array to CAPTURE\n */\n public constructor(fitPoints?: Point3d[]) {\n this.fitPoints = fitPoints ? fitPoints : [];\n }\n\n /** Points that the curve must pass through.\n * First and last 2 points are \"beyond the end\" for control of end slope.\n fitPoints: Point3d[];\n\n/** Clone with strongly typed members reduced to simple json. */\n public cloneAsAkimaCurve3dProps(): AkimaCurve3dProps {\n const props = {\n fitPoints: Point3dArray.cloneDeepJSONNumberArrays(this.fitPoints),\n };\n return props;\n }\n/** Clone with strongly typed members reduced to simple json. */\n public clone(): AkimaCurve3dOptions {\n const clone = new AkimaCurve3dOptions(Point3dArray.clonePoint3dArray(this.fitPoints));\n return clone;\n }\n\n/** Clone with strongly typed members reduced to simple json. */\npublic static create(source: AkimaCurve3dProps): AkimaCurve3dOptions {\n const result = new AkimaCurve3dOptions(Point3dArray.clonePoint3dArray(source.fitPoints));\n return result;\n}\n\n public static areAlmostEqual(dataA: AkimaCurve3dOptions | undefined, dataB: AkimaCurve3dOptions | undefined): boolean {\n if (dataA === undefined && dataB === undefined)\n return true;\n if (dataA !== undefined && dataB !== undefined) {\n return Geometry.almostEqualArrays(dataA.fitPoints, dataB.fitPoints, (a: Point3d, b: Point3d) => a.isAlmostEqual(b));\n }\n return false;\n }\n}\n\n/**\n * Interpolating curve.\n * * Derive from [[ProxyCurve]]\n * * Use a [[BSplineCurve3d]] as the proxy\n * *\n * @public\n */\nexport class AkimaCurve3d extends ProxyCurve {\n public readonly curvePrimitiveType = \"interpolationCurve\";\n private _options: AkimaCurve3dOptions;\n /**\n * CAPTURE properties and proxy curve.\n */\nprivate constructor(properties: AkimaCurve3dOptions, proxyCurve: CurvePrimitive) {\n super(proxyCurve);\n this._options = properties;\n }\n public override dispatchToGeometryHandler(handler: GeometryHandler) {\n return handler.handleAkimaCurve3d(this);\n }\n/**\n * Create an [[AkimaCurve3d]] based on points, knots, and other properties in the [[AkimaCurve3dProps]] or [[AkimaCurve3dOptions]].\n * * This saves a COPY OF the options or props.\n * * Use createCapture () if the options or props can be used without copy\n */\n public static create(options: AkimaCurve3dOptions | AkimaCurve3dProps): AkimaCurve3d | undefined {\n let optionsCopy;\n if (options instanceof AkimaCurve3dOptions) {\n optionsCopy = options.clone();\n } else {\n optionsCopy = AkimaCurve3dOptions.create(options);\n }\n return AkimaCurve3d.createCapture(optionsCopy);\n }\n\n public static createCapture(options: AkimaCurve3dOptions): AkimaCurve3d | undefined{\n const proxyCurve = BSplineCurve3d.createFromAkimaCurve3dOptions(options);\n if (proxyCurve)\n return new AkimaCurve3d(options, proxyCurve);\n return undefined;\n }\n\n /** Return a (copy of) the defining points, packed as a Float64Array */\n public copyFitPointsFloat64Array(): Float64Array {\n return Point3dArray.cloneXYZPropsAsFloat64Array(this._options.fitPoints);\n }\n\n /**\n * Return json key-value pairs for for this [[AkimaCurve3d]].\n * @returns\n */\n public toJSON(): any {\n return this._options.cloneAsAkimaCurve3dProps();\n }\n /** Clone the [[AkimaCurve3dProps]] object in this [[AkimaCurve3dProps]] */\n public cloneProps(): AkimaCurve3dProps {\n return this._options.cloneAsAkimaCurve3dProps();\n }\n\n /**\n * Reverse the curve direction.\n * * This updates both the defining properties and the proxy bspline.\n */\n public reverseInPlace(): void {\n this._proxyCurve.reverseInPlace();\n this._options.fitPoints.reverse();\n }\n /**\n * Transform this [[AkimaCurve3d]] and its defining data in place\n */\n public tryTransformInPlace(transform: Transform): boolean {\n const proxyOk = this._proxyCurve.tryTransformInPlace(transform);\n if (proxyOk) {\n transform.multiplyPoint3dArray(this._options.fitPoints);\n }\n return proxyOk;\n }\n\n /** Return a deep clone */\n public override clone(): AkimaCurve3d {\n return new AkimaCurve3d(this._options.clone(), this._proxyCurve.clone());\n }\n\n /** Test if `other` is also an [[AkimaCurve3d]] */\n public isSameGeometryClass(other: GeometryQuery): boolean { return other instanceof AkimaCurve3d; }\n\n public override isAlmostEqual(other: GeometryQuery): boolean{\n if (other instanceof AkimaCurve3d) {\n return AkimaCurve3dOptions.areAlmostEqual(this._options, other._options);\n }\n return false;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"BSpline1dNd.js","sourceRoot":"","sources":["../../../src/bspline/BSpline1dNd.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,2CAA2C;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,mEAAmE;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,OAAO,WAAW;IAOtB,gEAAgE;IAChE,IAAW,MAAM,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACzD,+FAA+F;IAC/F,IAAW,KAAK,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5D,oGAAoG;IACpG,IAAW,OAAO,KAAa,OAAO,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAC1E,qDAAqD;IACrD,IAAW,QAAQ,KAAa,OAAO,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,IAAI,C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,SAAS,CAAC;YACZ,EAAE,aAAa,CAAC;YAChB,EAAE,aAAa,CAAC;SACjB;QACD,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,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/** @packageDocumentation\r\n * @module Bspline\r\n */\r\n\r\n// import { Point2d } from \"../Geometry2d\";\r\nimport { Geometry } from \"../Geometry\";\r\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\r\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\r\nimport { BSplineWrapMode, KnotVector } from \"./KnotVector\";\r\n\r\n/** Bspline knots and poles for 1d-to-Nd.\r\n * * The \"pole\" (aka control point) of this class is a block of `poleLength` numbers.\r\n * * Derived classes (not this class) assign meaning such as x,y,z,w.\r\n * * for instance, an instance of this class with `poleLength===3` does not know if its poles are x,y,z or weighted 2D x,y,w\r\n * @public\r\n */\r\nexport class BSpline1dNd {\r\n /** knots of the bspline */\r\n public knots: KnotVector;\r\n /** poles, packed in blocks of `poleLength` doubles. */\r\n public packedData: Float64Array;\r\n /** (property accessor) Return the number of numeric values per pole. */\r\n public poleLength: number;\r\n /** (property accessor) Return the degree of the polynomials. */\r\n public get degree(): number { return this.knots.degree; }\r\n /** (property accessor) Return the number of order (one more than degree) of the polynomials */\r\n public get order(): number { return this.knots.degree + 1; }\r\n /** (property accessor) Return the number of bezier spans (including null spans at multiple knots)*/\r\n public get numSpan(): number { return this.numPoles - this.knots.degree; }\r\n /** (property accessor) Return the number of poles*/\r\n public get numPoles(): number { return this.packedData.length / this.poleLength; }\r\n /** copy 3 values of pole `i` into a point.\r\n * * The calling class is responsible for knowing if this is an appropriate access to the blocked data.\r\n */\r\n public getPoint3dPole(i: number, result?: Point3d): Point3d | undefined { return Point3d.createFromPacked(this.packedData, i, result); }\r\n /** preallocated array (length === `order`) used as temporary in evaluations */\r\n public basisBuffer: Float64Array; // one set of basis function values. ALLOCATED BY CTOR FOR FREQUENT REUSE\r\n /** preallocated array (length === `poleLength`) used as temporary in evaluations */\r\n public poleBuffer: Float64Array; // one set of target values. ALLOCATED BY CTOR FOR FREQUENT REUSE\r\n /** preallocated array (length === `order`) used as temporary in evaluations */\r\n public basisBuffer1: Float64Array; // one set of basis function values. ALLOCATED BY CTOR FOR FREQUENT REUSE\r\n /** preallocated array (length === `order`) used as temporary in evaluations */\r\n public basisBuffer2: Float64Array; // one set of basis function values. ALLOCATED BY CTOR FOR FREQUENT REUSE\r\n /** preallocated array (length === `poleLength`) used as temporary in evaluations */\r\n public poleBuffer1: Float64Array; // one set of target values. ALLOCATED BY CTOR FOR FREQUENT REUSE\r\n /** preallocated array (length === `poleLength`) used as temporary in evaluations */\r\n public poleBuffer2: Float64Array; // one set of target values. ALLOCATED BY CTOR FOR FREQUENT REUSE\r\n\r\n /**\r\n * initialize arrays for given spline dimensions.\r\n * @param numPoles number of poles\r\n * @param poleLength number of coordinates per pole (e.g.. 3 for 3D unweighted, 4 for 3d weighted, 2 for 2d unweighted, 3 for 2d weighted)\r\n * @param order number of poles in support for a section of the bspline\r\n * @param knots KnotVector. This is captured, not cloned.\r\n */\r\n protected constructor(numPoles: number, poleLength: number, order: number, knots: KnotVector) {\r\n this.knots = knots;\r\n this.packedData = new Float64Array(numPoles * poleLength);\r\n this.poleLength = poleLength;\r\n this.basisBuffer = new Float64Array(order);\r\n this.poleBuffer = new Float64Array(poleLength);\r\n this.basisBuffer1 = new Float64Array(order);\r\n this.basisBuffer2 = new Float64Array(order);\r\n this.poleBuffer1 = new Float64Array(poleLength);\r\n this.poleBuffer2 = new Float64Array(poleLength);\r\n }\r\n\r\n /**\r\n * create a 1Bspline1dNd`\r\n * @param numPoles number of poles\r\n * @param poleLength number of coordinates per pole (e.g.. 3 for 3D unweighted, 4 for 3d weighted, 2 for 2d unweighted, 3 for 2d weighted)\r\n * @param order number of poles in support for a section of the bspline\r\n * @param knots KnotVector. This is captured, not cloned.\r\n */\r\n public static create(numPoles: number, poleLength: number, order: number, knots: KnotVector): BSpline1dNd | undefined {\r\n return new BSpline1dNd(numPoles, poleLength, order, knots);\r\n }\r\n /** Map a span index and local fraction to knot value. */\r\n public spanFractionToKnot(span: number, localFraction: number): number {\r\n return this.knots.spanFractionToKnot(span, localFraction);\r\n }\r\n\r\n /** Evaluate the `order` basis functions (and optionally one or two derivatives) at a given fractional position within indexed span. */\r\n public evaluateBasisFunctionsInSpan(spanIndex: number, spanFraction: number, f: Float64Array, df?: Float64Array, ddf?: Float64Array) {\r\n if (spanIndex < 0) spanIndex = 0;\r\n if (spanIndex >= this.numSpan) spanIndex = this.numSpan - 1;\r\n const knotIndex0 = spanIndex + this.degree - 1;\r\n const globalKnot = this.knots.baseKnotFractionToKnot(knotIndex0, spanFraction);\r\n return df ?\r\n this.knots.evaluateBasisFunctions1(knotIndex0, globalKnot, f, df, ddf) :\r\n this.knots.evaluateBasisFunctions(knotIndex0, globalKnot, f);\r\n }\r\n /**\r\n * * Evaluate the basis functions at spanIndex and fraction.\r\n * * Evaluations are stored in the preallocated `this.basisBuffer`\r\n * * Immediately do the summations of the basis values times the respective control points\r\n * * Summations are stored in the preallocated `this.poleBuffer`\r\n * */\r\n public evaluateBuffersInSpan(spanIndex: number, spanFraction: number) {\r\n this.evaluateBasisFunctionsInSpan(spanIndex, spanFraction, this.basisBuffer);\r\n this.sumPoleBufferForSpan(spanIndex);\r\n }\r\n /**\r\n * * Evaluate the basis functions and one derivative at spanIndex and fraction.\r\n * * Evaluations are stored in the preallocated `this.basisBuffer`\r\n * * Immediately do the summations of the basis values times the respective control points\r\n * * Summations are stored in the preallocated `this.poleBuffer` and `this.poleBuffer1`\r\n * */\r\n public evaluateBuffersInSpan1(spanIndex: number, spanFraction: number) {\r\n this.evaluateBasisFunctionsInSpan(spanIndex, spanFraction, this.basisBuffer, this.basisBuffer1);\r\n this.sumPoleBufferForSpan(spanIndex);\r\n this.sumPoleBuffer1ForSpan(spanIndex);\r\n }\r\n /** sum poles in `poleBuffer` at span `spanIndex` by the weights in the `basisBuffer` */\r\n public sumPoleBufferForSpan(spanIndex: number) {\r\n this.poleBuffer.fill(0);\r\n let k = spanIndex * this.poleLength;\r\n for (const f of this.basisBuffer) {\r\n for (let j = 0; j < this.poleLength; j++) { this.poleBuffer[j] += f * this.packedData[k++]; }\r\n }\r\n }\r\n /** sum poles in `poleBuffer1` at span `spanIndex` by the weights in the `basisBuffer1`, i.e. form first derivatives */\r\n public sumPoleBuffer1ForSpan(spanIndex: number) {\r\n this.poleBuffer1.fill(0);\r\n let k = spanIndex * this.poleLength;\r\n for (const f of this.basisBuffer1) {\r\n for (let j = 0; j < this.poleLength; j++) {\r\n this.poleBuffer1[j] += f * this.packedData[k++];\r\n }\r\n }\r\n }\r\n /** sum poles in `poleBuffer2` at span `spanIndex` by the weights in the `basisBuffer2`, i.e. form second derivatives */\r\n public sumPoleBuffer2ForSpan(spanIndex: number) {\r\n this.poleBuffer2.fill(0);\r\n let k = spanIndex * this.poleLength;\r\n for (const f of this.basisBuffer2) {\r\n for (let j = 0; j < this.poleLength; j++) {\r\n this.poleBuffer2[j] += f * this.packedData[k++];\r\n }\r\n }\r\n }\r\n /** Evaluate the function values and 1 or 2 derivatives into `this.poleBuffer`, `this.poleBuffer1` and `this.poleBuffer2` */\r\n public evaluateBuffersAtKnot(u: number, numDerivative: number = 0) {\r\n const knotIndex0 = this.knots.knotToLeftKnotIndex(u);\r\n if (numDerivative < 1) {\r\n this.knots.evaluateBasisFunctions(knotIndex0, u, this.basisBuffer);\r\n this.sumPoleBufferForSpan(knotIndex0 - this.degree + 1);\r\n } else if (numDerivative === 1) {\r\n this.knots.evaluateBasisFunctions1(knotIndex0, u, this.basisBuffer, this.basisBuffer1);\r\n this.sumPoleBufferForSpan(knotIndex0 - this.degree + 1);\r\n this.sumPoleBuffer1ForSpan(knotIndex0 - this.degree + 1);\r\n } else {\r\n this.knots.evaluateBasisFunctions1(knotIndex0, u, this.basisBuffer, this.basisBuffer1, this.basisBuffer2);\r\n this.sumPoleBufferForSpan(knotIndex0 - this.degree + 1);\r\n this.sumPoleBuffer1ForSpan(knotIndex0 - this.degree + 1);\r\n this.sumPoleBuffer2ForSpan(knotIndex0 - this.degree + 1);\r\n }\r\n }\r\n /**\r\n * Reverse the (blocked) poles (in `this.packedData` in place.\r\n */\r\n public reverseInPlace(): void {\r\n // reverse poles in blocks ...\r\n const b = this.poleLength;\r\n const data = this.packedData;\r\n for (let i0 = 0, j0 = b * (this.numPoles - 1);\r\n i0 < j0;\r\n i0 += b, j0 -= b) {\r\n let t = 0;\r\n for (let i = 0; i < b; i++) {\r\n t = data[i0 + i];\r\n data[i0 + i] = data[j0 + i];\r\n data[j0 + i] = t;\r\n }\r\n }\r\n this.knots.reflectKnots();\r\n }\r\n /**\r\n * Test if the leading and trailing polygon coordinates are replicated in the manner of a \"closed\" bspline polygon which has been expanded\r\n * to act as a normal bspline.\r\n * @returns true if `degree` leading and trailing polygon blocks match\r\n */\r\n public testCloseablePolygon(mode?: BSplineWrapMode): boolean {\r\n if (mode === undefined)\r\n mode = this.knots.wrappable;\r\n const degree = this.degree;\r\n const blockSize = this.poleLength;\r\n const indexDelta = (this.numPoles - this.degree) * blockSize;\r\n const data = this.packedData;\r\n if (mode === BSplineWrapMode.OpenByAddingControlPoints) {\r\n // expect {degree} matched points.\r\n const numValuesToTest = degree * blockSize;\r\n for (let i0 = 0; i0 < numValuesToTest; i0++) {\r\n if (!Geometry.isSameCoordinate(data[i0], data[i0 + indexDelta]))\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n if (mode === BSplineWrapMode.OpenByRemovingKnots) {\r\n // no pole conditions are applied.\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /** Insert knot and resulting pole into the instance, optionally multiple times.\r\n * @param knot the knot to be inserted (may already exist in the KnotVector)\r\n * @param totalMultiplicity the total multiplicity of the knot on return\r\n */\r\n public addKnot(knot: number, totalMultiplicity: number): boolean {\r\n if (knot < this.knots.leftKnot || knot > this.knots.rightKnot)\r\n return false; // invalid input\r\n let iLeftKnot = this.knots.knotToLeftKnotIndex(knot);\r\n\r\n // snap input if too close to an existing knot\r\n if (Math.abs(knot - this.knots.knots[iLeftKnot]) < KnotVector.knotTolerance) {\r\n knot = this.knots.knots[iLeftKnot]; // snap to left knot of bracket\r\n } else if (Math.abs(knot - this.knots.knots[iLeftKnot + 1]) < KnotVector.knotTolerance) {\r\n iLeftKnot += this.knots.getKnotMultiplicityAtIndex(iLeftKnot + 1);\r\n if (iLeftKnot > this.knots.rightKnotIndex)\r\n return true; // nothing to do\r\n knot = this.knots.knots[iLeftKnot]; // snap to left knot of next bracket\r\n }\r\n const numKnotsToAdd = Math.min(totalMultiplicity, this.degree) - this.knots.getKnotMultiplicity(knot);\r\n if (numKnotsToAdd <= 0)\r\n return true; // nothing to do\r\n\r\n // working arrays and pole buffer\r\n let currKnotCount = this.knots.knots.length;\r\n const newKnots = new Float64Array(currKnotCount + numKnotsToAdd);\r\n for (let i = 0; i < currKnotCount; ++i)\r\n newKnots[i] = this.knots.knots[i];\r\n let currPoleCount = this.numPoles;\r\n const newPackedData = new Float64Array(this.packedData.length + (numKnotsToAdd * this.poleLength));\r\n for (let i = 0; i < this.packedData.length; ++i)\r\n newPackedData[i] = this.packedData[i];\r\n const dataBuf = new Float64Array(this.degree * this.poleLength); // holds degree poles\r\n\r\n // each iteration adds one knot and one pole to the working arrays (cf. Farin 4e)\r\n for (let iter = 0; iter < numKnotsToAdd; ++iter) {\r\n // fill the buffer with new poles obtained from control polygon corner cutting\r\n let iBuf = 0;\r\n const iStart = iLeftKnot - this.degree + 2;\r\n for (let i = iStart; i < iStart + this.degree; ++i) {\r\n const fraction = (knot - newKnots[i - 1]) / (newKnots[i + this.degree - 1] - newKnots[i - 1]);\r\n for (let j = i * this.poleLength; j < (i + 1) * this.poleLength; ++j) {\r\n dataBuf[iBuf++] = Geometry.interpolate(newPackedData[j - this.poleLength], fraction, newPackedData[j]);\r\n }\r\n }\r\n\r\n // overwrite degree-1 poles with degree new poles, shifting tail to the right by one\r\n newPackedData.copyWithin((iStart + this.degree) * this.poleLength, (iStart + this.degree - 1) * this.poleLength, currPoleCount * this.poleLength);\r\n let iData = iStart * this.poleLength;\r\n for (const d of dataBuf)\r\n newPackedData[iData++] = d; // overwrite degree new poles\r\n\r\n // add the knot to newKnots in position, shifting tail to the right by one\r\n newKnots.copyWithin(iLeftKnot + 2, iLeftKnot + 1, currKnotCount);\r\n newKnots[iLeftKnot + 1] = knot;\r\n\r\n ++iLeftKnot;\r\n ++currKnotCount;\r\n ++currPoleCount;\r\n }\r\n this.knots.setKnotsCapture(newKnots);\r\n this.packedData = newPackedData;\r\n return true;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"file":"BSpline1dNd.js","sourceRoot":"","sources":["../../../src/bspline/BSpline1dNd.ts"],"names":[],"mappings":"AAAA;;;+FAG+F;AAC/F;;GAEG;AAEH,2CAA2C;AAC3C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,mEAAmE;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,OAAO,WAAW;IAOtB,gEAAgE;IAChE,IAAW,MAAM,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IACzD,+FAA+F;IAC/F,IAAW,KAAK,KAAa,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;IAC5D,oGAAoG;IACpG,IAAW,OAAO,KAAa,OAAO,IAAI,CAAC,QAAQ,GAAG,IAAI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GAAG,CAAC,EAAE,SAAS,GAAG,CAAC,EAAE,aAAa,CAAC,CAAC;YACjE,QAAQ,CAAC,SAAS,GAAG,CAAC,CAAC,GAAG,IAAI,CAAC;YAE/B,EAAE,SAAS,CAAC;YACZ,EAAE,aAAa,CAAC;YAChB,EAAE,aAAa,CAAC;SACjB;QACD,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC;QACrC,IAAI,CAAC,UAAU,GAAG,aAAa,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;CACF","sourcesContent":["/*---------------------------------------------------------------------------------------------\n* Copyright (c) Bentley Systems, Incorporated. All rights reserved.\n* See LICENSE.md in the project root for license terms and full copyright notice.\n*--------------------------------------------------------------------------------------------*/\n/** @packageDocumentation\n * @module Bspline\n */\n\n// import { Point2d } from \"../Geometry2d\";\nimport { Geometry } from \"../Geometry\";\n/* eslint-disable @typescript-eslint/naming-convention, no-empty */\nimport { Point3d } from \"../geometry3d/Point3dVector3d\";\nimport { BSplineWrapMode, KnotVector } from \"./KnotVector\";\n\n/** Bspline knots and poles for 1d-to-Nd.\n * * The \"pole\" (aka control point) of this class is a block of `poleLength` numbers.\n * * Derived classes (not this class) assign meaning such as x,y,z,w.\n * * for instance, an instance of this class with `poleLength===3` does not know if its poles are x,y,z or weighted 2D x,y,w\n * @public\n */\nexport class BSpline1dNd {\n /** knots of the bspline */\n public knots: KnotVector;\n /** poles, packed in blocks of `poleLength` doubles. */\n public packedData: Float64Array;\n /** (property accessor) Return the number of numeric values per pole. */\n public poleLength: number;\n /** (property accessor) Return the degree of the polynomials. */\n public get degree(): number { return this.knots.degree; }\n /** (property accessor) Return the number of order (one more than degree) of the polynomials */\n public get order(): number { return this.knots.degree + 1; }\n /** (property accessor) Return the number of bezier spans (including null spans at multiple knots)*/\n public get numSpan(): number { return this.numPoles - this.knots.degree; }\n /** (property accessor) Return the number of poles*/\n public get numPoles(): number { return this.packedData.length / this.poleLength; }\n /** copy 3 values of pole `i` into a point.\n * * The calling class is responsible for knowing if this is an appropriate access to the blocked data.\n */\n public getPoint3dPole(i: number, result?: Point3d): Point3d | undefined { return Point3d.createFromPacked(this.packedData, i, result); }\n /** preallocated array (length === `order`) used as temporary in evaluations */\n public basisBuffer: Float64Array; // one set of basis function values. ALLOCATED BY CTOR FOR FREQUENT REUSE\n /** preallocated array (length === `poleLength`) used as temporary in evaluations */\n public poleBuffer: Float64Array; // one set of target values. ALLOCATED BY CTOR FOR FREQUENT REUSE\n /** preallocated array (length === `order`) used as temporary in evaluations */\n public basisBuffer1: Float64Array; // one set of basis function values. ALLOCATED BY CTOR FOR FREQUENT REUSE\n /** preallocated array (length === `order`) used as temporary in evaluations */\n public basisBuffer2: Float64Array; // one set of basis function values. ALLOCATED BY CTOR FOR FREQUENT REUSE\n /** preallocated array (length === `poleLength`) used as temporary in evaluations */\n public poleBuffer1: Float64Array; // one set of target values. ALLOCATED BY CTOR FOR FREQUENT REUSE\n /** preallocated array (length === `poleLength`) used as temporary in evaluations */\n public poleBuffer2: Float64Array; // one set of target values. ALLOCATED BY CTOR FOR FREQUENT REUSE\n\n /**\n * initialize arrays for given spline dimensions.\n * @param numPoles number of poles\n * @param poleLength number of coordinates per pole (e.g.. 3 for 3D unweighted, 4 for 3d weighted, 2 for 2d unweighted, 3 for 2d weighted)\n * @param order number of poles in support for a section of the bspline\n * @param knots KnotVector. This is captured, not cloned.\n */\n protected constructor(numPoles: number, poleLength: number, order: number, knots: KnotVector) {\n this.knots = knots;\n this.packedData = new Float64Array(numPoles * poleLength);\n this.poleLength = poleLength;\n this.basisBuffer = new Float64Array(order);\n this.poleBuffer = new Float64Array(poleLength);\n this.basisBuffer1 = new Float64Array(order);\n this.basisBuffer2 = new Float64Array(order);\n this.poleBuffer1 = new Float64Array(poleLength);\n this.poleBuffer2 = new Float64Array(poleLength);\n }\n\n /**\n * create a 1Bspline1dNd`\n * @param numPoles number of poles\n * @param poleLength number of coordinates per pole (e.g.. 3 for 3D unweighted, 4 for 3d weighted, 2 for 2d unweighted, 3 for 2d weighted)\n * @param order number of poles in support for a section of the bspline\n * @param knots KnotVector. This is captured, not cloned.\n */\n public static create(numPoles: number, poleLength: number, order: number, knots: KnotVector): BSpline1dNd | undefined {\n return new BSpline1dNd(numPoles, poleLength, order, knots);\n }\n /** Map a span index and local fraction to knot value. */\n public spanFractionToKnot(span: number, localFraction: number): number {\n return this.knots.spanFractionToKnot(span, localFraction);\n }\n\n /** Evaluate the `order` basis functions (and optionally one or two derivatives) at a given fractional position within indexed span. */\n public evaluateBasisFunctionsInSpan(spanIndex: number, spanFraction: number, f: Float64Array, df?: Float64Array, ddf?: Float64Array) {\n if (spanIndex < 0) spanIndex = 0;\n if (spanIndex >= this.numSpan) spanIndex = this.numSpan - 1;\n const knotIndex0 = spanIndex + this.degree - 1;\n const globalKnot = this.knots.baseKnotFractionToKnot(knotIndex0, spanFraction);\n return df ?\n this.knots.evaluateBasisFunctions1(knotIndex0, globalKnot, f, df, ddf) :\n this.knots.evaluateBasisFunctions(knotIndex0, globalKnot, f);\n }\n /**\n * * Evaluate the basis functions at spanIndex and fraction.\n * * Evaluations are stored in the preallocated `this.basisBuffer`\n * * Immediately do the summations of the basis values times the respective control points\n * * Summations are stored in the preallocated `this.poleBuffer`\n * */\n public evaluateBuffersInSpan(spanIndex: number, spanFraction: number) {\n this.evaluateBasisFunctionsInSpan(spanIndex, spanFraction, this.basisBuffer);\n this.sumPoleBufferForSpan(spanIndex);\n }\n /**\n * * Evaluate the basis functions and one derivative at spanIndex and fraction.\n * * Evaluations are stored in the preallocated `this.basisBuffer`\n * * Immediately do the summations of the basis values times the respective control points\n * * Summations are stored in the preallocated `this.poleBuffer` and `this.poleBuffer1`\n * */\n public evaluateBuffersInSpan1(spanIndex: number, spanFraction: number) {\n this.evaluateBasisFunctionsInSpan(spanIndex, spanFraction, this.basisBuffer, this.basisBuffer1);\n this.sumPoleBufferForSpan(spanIndex);\n this.sumPoleBuffer1ForSpan(spanIndex);\n }\n /** sum poles in `poleBuffer` at span `spanIndex` by the weights in the `basisBuffer` */\n public sumPoleBufferForSpan(spanIndex: number) {\n this.poleBuffer.fill(0);\n let k = spanIndex * this.poleLength;\n for (const f of this.basisBuffer) {\n for (let j = 0; j < this.poleLength; j++) { this.poleBuffer[j] += f * this.packedData[k++]; }\n }\n }\n /** sum poles in `poleBuffer1` at span `spanIndex` by the weights in the `basisBuffer1`, i.e. form first derivatives */\n public sumPoleBuffer1ForSpan(spanIndex: number) {\n this.poleBuffer1.fill(0);\n let k = spanIndex * this.poleLength;\n for (const f of this.basisBuffer1) {\n for (let j = 0; j < this.poleLength; j++) {\n this.poleBuffer1[j] += f * this.packedData[k++];\n }\n }\n }\n /** sum poles in `poleBuffer2` at span `spanIndex` by the weights in the `basisBuffer2`, i.e. form second derivatives */\n public sumPoleBuffer2ForSpan(spanIndex: number) {\n this.poleBuffer2.fill(0);\n let k = spanIndex * this.poleLength;\n for (const f of this.basisBuffer2) {\n for (let j = 0; j < this.poleLength; j++) {\n this.poleBuffer2[j] += f * this.packedData[k++];\n }\n }\n }\n /** Evaluate the function values and 1 or 2 derivatives into `this.poleBuffer`, `this.poleBuffer1` and `this.poleBuffer2` */\n public evaluateBuffersAtKnot(u: number, numDerivative: number = 0) {\n const knotIndex0 = this.knots.knotToLeftKnotIndex(u);\n if (numDerivative < 1) {\n this.knots.evaluateBasisFunctions(knotIndex0, u, this.basisBuffer);\n this.sumPoleBufferForSpan(knotIndex0 - this.degree + 1);\n } else if (numDerivative === 1) {\n this.knots.evaluateBasisFunctions1(knotIndex0, u, this.basisBuffer, this.basisBuffer1);\n this.sumPoleBufferForSpan(knotIndex0 - this.degree + 1);\n this.sumPoleBuffer1ForSpan(knotIndex0 - this.degree + 1);\n } else {\n this.knots.evaluateBasisFunctions1(knotIndex0, u, this.basisBuffer, this.basisBuffer1, this.basisBuffer2);\n this.sumPoleBufferForSpan(knotIndex0 - this.degree + 1);\n this.sumPoleBuffer1ForSpan(knotIndex0 - this.degree + 1);\n this.sumPoleBuffer2ForSpan(knotIndex0 - this.degree + 1);\n }\n }\n /**\n * Reverse the (blocked) poles (in `this.packedData` in place.\n */\n public reverseInPlace(): void {\n // reverse poles in blocks ...\n const b = this.poleLength;\n const data = this.packedData;\n for (let i0 = 0, j0 = b * (this.numPoles - 1);\n i0 < j0;\n i0 += b, j0 -= b) {\n let t = 0;\n for (let i = 0; i < b; i++) {\n t = data[i0 + i];\n data[i0 + i] = data[j0 + i];\n data[j0 + i] = t;\n }\n }\n this.knots.reflectKnots();\n }\n /**\n * Test if the leading and trailing polygon coordinates are replicated in the manner of a \"closed\" bspline polygon which has been expanded\n * to act as a normal bspline.\n * @returns true if `degree` leading and trailing polygon blocks match\n */\n public testCloseablePolygon(mode?: BSplineWrapMode): boolean {\n if (mode === undefined)\n mode = this.knots.wrappable;\n const degree = this.degree;\n const blockSize = this.poleLength;\n const indexDelta = (this.numPoles - this.degree) * blockSize;\n const data = this.packedData;\n if (mode === BSplineWrapMode.OpenByAddingControlPoints) {\n // expect {degree} matched points.\n const numValuesToTest = degree * blockSize;\n for (let i0 = 0; i0 < numValuesToTest; i0++) {\n if (!Geometry.isSameCoordinate(data[i0], data[i0 + indexDelta]))\n return false;\n }\n return true;\n }\n\n if (mode === BSplineWrapMode.OpenByRemovingKnots) {\n // no pole conditions are applied.\n return true;\n }\n\n return false;\n }\n\n /** Insert knot and resulting pole into the instance, optionally multiple times.\n * @param knot the knot to be inserted (may already exist in the KnotVector)\n * @param totalMultiplicity the total multiplicity of the knot on return\n */\n public addKnot(knot: number, totalMultiplicity: number): boolean {\n if (knot < this.knots.leftKnot || knot > this.knots.rightKnot)\n return false; // invalid input\n let iLeftKnot = this.knots.knotToLeftKnotIndex(knot);\n\n // snap input if too close to an existing knot\n if (Math.abs(knot - this.knots.knots[iLeftKnot]) < KnotVector.knotTolerance) {\n knot = this.knots.knots[iLeftKnot]; // snap to left knot of bracket\n } else if (Math.abs(knot - this.knots.knots[iLeftKnot + 1]) < KnotVector.knotTolerance) {\n iLeftKnot += this.knots.getKnotMultiplicityAtIndex(iLeftKnot + 1);\n if (iLeftKnot > this.knots.rightKnotIndex)\n return true; // nothing to do\n knot = this.knots.knots[iLeftKnot]; // snap to left knot of next bracket\n }\n const numKnotsToAdd = Math.min(totalMultiplicity, this.degree) - this.knots.getKnotMultiplicity(knot);\n if (numKnotsToAdd <= 0)\n return true; // nothing to do\n\n // working arrays and pole buffer\n let currKnotCount = this.knots.knots.length;\n const newKnots = new Float64Array(currKnotCount + numKnotsToAdd);\n for (let i = 0; i < currKnotCount; ++i)\n newKnots[i] = this.knots.knots[i];\n let currPoleCount = this.numPoles;\n const newPackedData = new Float64Array(this.packedData.length + (numKnotsToAdd * this.poleLength));\n for (let i = 0; i < this.packedData.length; ++i)\n newPackedData[i] = this.packedData[i];\n const dataBuf = new Float64Array(this.degree * this.poleLength); // holds degree poles\n\n // each iteration adds one knot and one pole to the working arrays (cf. Farin 4e)\n for (let iter = 0; iter < numKnotsToAdd; ++iter) {\n // fill the buffer with new poles obtained from control polygon corner cutting\n let iBuf = 0;\n const iStart = iLeftKnot - this.degree + 2;\n for (let i = iStart; i < iStart + this.degree; ++i) {\n const fraction = (knot - newKnots[i - 1]) / (newKnots[i + this.degree - 1] - newKnots[i - 1]);\n for (let j = i * this.poleLength; j < (i + 1) * this.poleLength; ++j) {\n dataBuf[iBuf++] = Geometry.interpolate(newPackedData[j - this.poleLength], fraction, newPackedData[j]);\n }\n }\n\n // overwrite degree-1 poles with degree new poles, shifting tail to the right by one\n newPackedData.copyWithin((iStart + this.degree) * this.poleLength, (iStart + this.degree - 1) * this.poleLength, currPoleCount * this.poleLength);\n let iData = iStart * this.poleLength;\n for (const d of dataBuf)\n newPackedData[iData++] = d; // overwrite degree new poles\n\n // add the knot to newKnots in position, shifting tail to the right by one\n newKnots.copyWithin(iLeftKnot + 2, iLeftKnot + 1, currKnotCount);\n newKnots[iLeftKnot + 1] = knot;\n\n ++iLeftKnot;\n ++currKnotCount;\n ++currPoleCount;\n }\n this.knots.setKnotsCapture(newKnots);\n this.packedData = newPackedData;\n return true;\n }\n}\n"]}